btcSignTransaction

Bitcoin: sign transaction

Asks device to sign given inputs and outputs of pre-composed transaction. User is asked to confirm all transaction details on OneKey.

const result = await HardwareSDK.btcSignTransaction(connectId, deviceId, params);

Params

Optional common params

  • coin - required string Determines network definition specified in bitcoin.json file. Coin shortcut, name or label can be used.

  • inputs - required Array of TxInputType,

  • outputs - required Array of TxOutputType,

  • refTxs - required Array of RefTransaction. Zcash and Komodo refTxs should also contains expiry, version_group_id and extra_data fields.

  • locktime - optional number,

  • version - optional number transaction version,

  • expiry - optional number, only for Decred and Zcash,

  • versionGroupId - optional number only for Zcash, nVersionGroupId when overwintered is set,

  • overwintered - optional boolean only for Zcash

  • timestamp - optional number only for Capricoin, transaction timestamp,

  • branchId - optional number, only for Zcash, BRANCH_ID when overwintered is set

Help tool

build input

build Output

buildPrevTx

Example

PAYTOADDRESS

SPENDP2SHWITNESS

PAYTOADDRESS with refTxs (transaction data provided from custom backend)

Result

Error

Last updated

Was this helpful?