signrawtransaction is not a function on bitcoin core V0.17.1

2

I'm using npm bitcoin-core ^2.0.0 to get access to my bitcoind (v0.17.1 MAC)

My code:

let signedRawTx = await btcClient.signRawTransaction(rawTx, [], [privateKey], 'ALL');

I get an error message telling me that signrawtransaction is deprecated, use signrawtransactionwithkey instead.

My problem: I tried to mixed uppercase letters like this:

btcClient.signRawTransactionWithKey(...)
btcClient.signrawtransactionwithkey(...)
btcClient.signRawTransactionWithkey(...)
...

with always the same kind of error:

signRawTransactionWithKey is not a function...

In my text editor, I can see all the available functions for btcClient, signRawTransaction is in the list but nothing like signRawTransactionWithKey. If I type help in the console of bitcoind, I can see signrawtransaction and signrawtransactionwithkey.

Any advice ?

jfjobidon

Posted 2019-01-31T23:49:54.143

Reputation: 265

Answers

1

It looks like the new calls are not yet supported in btcClient.

https://github.com/ruimarinho/bitcoin-core/issues/77 refers generally to your issue.

v2.0.0 was released "a year ago" according to https://www.npmjs.com/package/bitcoin-core; v0.17 bitcoind, which made the change, four months ago.

If you're just tinkering, you might consider downgrading your bitcoind until the library catches up.

Alistair Mann

Posted 2019-01-31T23:49:54.143

Reputation: 522

1OK, until then, I will use this flag in bitcoin.conf: deprecatedrpc=signrawtransactionjfjobidon 2019-02-01T00:23:19.450

1This is probably a sign that you should not be using this library-- it's un(der)maintained, ...G. Maxwell 2019-02-02T03:31:17.527