hathor-wallet-lib
hathor-wallet-lib copied to clipboard
sendTransacton throwing unknown error
The wallet and other functions are working fine except the sendTransaction, and neither the error is clear enough for what to look on.
Here is my code -
if (state === HathorWallet.ERROR) {
console.log("Oops Wallet failed to load...");
} else if (wallet.isReady()) {
let address = "WNu8RmBqUbr2khES1PybQSE6iHrQbgnnaU";
let value = 2;
let token_id = '00';
let changeAddress = null;
const response = await wallet.sendTransaction(address, value, { token: token_id, changeAddress });
console.log(response);
}
Error -
Uncaught (in promise) Error: Assertion failed
at n (bn.js:6:21)
at o.toBuffer (bn.js:529:5)
at t.u.toBuffer.u.toDER (signature.js:169:22)
at Object.getSignature (transaction.js:447:37)
at Object.signTx (transaction.js:413:30)
at Object.prepareData (transaction.js:767:26)
at r.value (sendTransaction.js:239:43)
at r.<anonymous> (sendTransaction.js:462:12)
at f (runtime.js:63:40)
at Generator._invoke (runtime.js:294:22)