Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

account.sign(transaction) throws error 'Require one or multiple privateKeys to sign' #160

Closed
dashameter opened this issue Jun 30, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@dashameter
Copy link
Contributor

dashameter commented Jun 30, 2020

Expected Behavior

Will find the privateKey from keychain for you and sign a transaction e.g. when the tx looses its signatures by adding OP_RETURN data using transaction.addData('correct horse battery staple') . via https://dashevo.github.io/wallet-lib/#/account/sign

Current Behavior

throws error:

Something went wrong: Error: Require one or multiple privateKeys to sign
    at KeyChain.sign (node_modules/@dashevo/wallet-lib/src/types/KeyChain/methods/sign.js:13:27)
    at Account.sign (node_modules/@dashevo/wallet-lib/src/types/Account/methods/sign.js:8:24)
    at sendFunds (sendFunds.js:21:39)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Steps to Reproduce (for bugs)

Run example code:
https://gist.github.com/dashameter/fce17bad0d97ab644d0cff0acb98cbcc

@dashameter dashameter added the bug Something isn't working label Jun 30, 2020
@dashameter
Copy link
Contributor Author

Another context where account.sign() throws the same error instead of looking up the private keys for signing:

const UTXO = DAPIclient.getUTXO(address)
const transaction = account.createTransaction({
        recipient,
        satoshis,
        utxos: UTXO.items,
})

const signedTx = account.sign(transaction); // Will find the privateKey from keychain for you.

@Alex-Werner
Copy link
Contributor

Closing this issue as #188 should have fixed this already.

Do not hesitate to re-open if you find a similar issue.

Thanks,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants