kaspaSignTransaction
Use requirement
Firmware version required
Touch: 4.3.0
Classic/Mini: 3.0.0
Kaspa: Sign transaction
Asks device to sign given transaction using the private key derived by given BIP32 path. User is asked to confirm all transaction details on OneKey.
Copy
Params
version
— requirednumber
transaction version.inputs
- requiredArray
of KaspaSignInputParams.outputs
- requiredArray
of KaspaSignOutputParams.lockTime
- requirednumber
sigHashType
- requirednumber
Copy
sigOpCount
- optionalnumber
subNetworkID
- optionalstring
prefix
- optionalstring
Address prefix. Default is set tokaspa
scheme
- optionalstring
Encryption algorithm mode. Default is set toschnorr
Examples
Copy
const response = await HardwareSDK.kaspaSignTransaction(
connectId,
deviceId,
{
version: 0,
lockTime: '0',
sigHashType: 0x1,
sigOpCount: 1,
subNetworkID: "00000000000000000000000000000000",
prefix: "prefix",
scheme: "schnorr",
inputs: [
{
outputIndex: 1,
path: "m/44'/111111'/0'/0/0",
prevTxId: '1f226507807ff7dc5a7f8f2dec353fffc9dacc2645d8aecd02e5046907e3e2b2',
sequenceNumber: '0',
sigOpCount: 1,
output: {
satoshis: '990096458',
script: '207afdae557e69c0040fd4135adffc60f9486fb21f4cbae233fd6db3e84ba47c55ac',
},
},
],
outputs: [
{
satoshis: '100000000',
script: '205ca3a7530284e5c5e472544edd6002c3afeb8c8f84d3a728fad255a4872753fbac',
scriptVersion: 0,
},
{
satoshis: '890094182',
script: '207afdae557e69c0040fd4135adffc60f9486fb21f4cbae233fd6db3e84ba47c55ac',
scriptVersion: 0,
},
]
}
);
{
success: true,
payload: {
index: 0,
signature: "signed data"
}
}
Error
Copy
感动 | 同情 | 无聊 | 愤怒 | 搞笑 | 难过 | 高兴 | 路过 |
- 上一篇:Kaspa存档节点运行测试
- 下一篇:Kaspa签约函数
相关文章
-
没有相关内容