UNPKG

bsv-sdk

Version:

bsv sdk

56 lines (50 loc) 1.87 kB
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; import _regeneratorRuntime from "@babel/runtime/regenerator"; import { API_NET } from "sensible-sdk"; import HdWallet from "./hd-wallet"; import { FT } from "./utils/CommonUtils"; import Wallet from "./wallet"; var wif = "L5dHUZWhnhYLn33dbKRhHnXr2RHpg7hE8GmcxYjoWnaxmA43vdf5"; var metasvAuth = { privateKey: "KxTz5CPZYb3CasVEYX5cv8YMHBF3EjGdKQKVZPHqrvQYWgNzbfGY" }; var wallet = new Wallet(wif, "mainnet", metasvAuth, 0.5); var mnemonic = "emerge cricket glow drink inch picture resource tank harsh mammal funny horn"; var hdWallet = new HdWallet(mnemonic, API_NET.MAIN, metasvAuth, 0.5); function test() { return _test.apply(this, arguments); } function _test() { _test = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { var receivers, res, mergeOneRes; return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: receivers = [{ address: "1txLawHqheNC8cH5r16augc8Hrb5c28au", amount: 1000 }, { address: "1txLawHqheNC8cH5r16augc8Hrb5c28au", amount: 1000 }]; _context.next = 3; return hdWallet.getFtMergeTime(FT["MC"].codehash, FT["MC"].genesis, FT["MC"].sensibleId); case 3: res = _context.sent; console.log(res); _context.next = 7; return hdWallet.ftMergeOne(FT["MC"].codehash, FT["MC"].genesis, FT["MC"].sensibleId); case 7: mergeOneRes = _context.sent; console.log(mergeOneRes); case 9: case "end": return _context.stop(); } } }, _callee); })); return _test.apply(this, arguments); } test();