跳到主要内容

algoSignTransaction

使用要求

  • 固件版本要求
    • UKey Lite 24 / UKey Lite 25: 1.1.0
    • UKey Core 26: 1.1.0

Algorand:签名交易

使用指定 BIP32 路径派生的私钥对交易进行签名。用户需要在 Ukey Wallet 上核对交易目标、金额、费用等关键信息后确认。

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

参数

可选通用参数

  • path - 必需 string | Array<number>,字符串数组最小长度限制为 3更多信息
  • rawTx - 必需 string,序列化后的交易字符串。

示例

const response = await HardwareSDK.algoSignTransaction(connectId, deviceId, {
path: "m/44'/283'/1'/0/0",
rawTx:
"5a21c6d94e70b1839b4fd2c761a9e8b54d3c7f2196ab4e0cd8f57231a6d94cbf83a1de670f25bc9e14d6a9c3e84b7d5f2c18ea046b95cd731ef4b2280cae67d34b18f5c2a7d9e0634cb58a1fd9472be6c2a34e8f5910bd46c7a82f3dc95e6147bb2fd8c6ea193705bd4f61e9a7cc2845d1f3e96ab4d072cf18",
});

返回结果

{
success: true,
payload: {
path: "m/44'/283'/1'/0/0", // 派生路径
signature: "signed data", // 签名结果
}
}

错误

{
success: false,
payload: {
error: string, // 错误消息
code: number // 错误码
}
}