tonSignProof
使用要求
- 固件版本要求
- UKey Lite 24 / UKey Lite 25 / UKey Core 26: 1.1.0
TON:签名证明
使用指定 BIP32 路径派生的私钥为 dApp 身份验证生成证明签名,用户需要在 Ukey Wallet 设备上确认操作。
const result = await HardwareSDK.tonSignProof(connectId, deviceId, {
path: "m/44'/607'/1'",
appdomain: "connect.ukey.io",
comment: "50726f6f6620666f7220554b6579",
expireAt: Date.now() + 1000 * 60 * 30,
walletVersion: 3,
isBounceable: false,
isTestnetOnly: false,
});
参数
必需参数
path- 必需string | Array<number>,字符串数组最小长度限制为3。更多信息appdomain- 必需string,请求证明的 dApp 域名。expireAt- 必需number,证明过期时间戳。
可选参数
comment- 可选string,十六进制格式的消息备注。walletVersion- 可选TonWalletVersion,TON 钱包版本;默认值为3。walletId- 可选number,钱包 ID;默认值为698983191。workchain- 可选TonWorkChain,TON 工作链。isBounceable- 可选boolean,决定消息是否可弹回;默认值为false。isTestnetOnly- 可选boolean,决定是否使用测试网;默认值为false。
返回值
响应
signature- 十六进制格式的证明签名
示例
const response = await HardwareSDK.tonSignProof(connectId, deviceId, {
path: "m/44'/607'/1'",
appdomain: "connect.ukey.io",
comment: "50726f6f6620666f7220554b6579",
expireAt: Date.now() + 1000 * 60 * 30,
walletVersion: 3,
isBounceable: false,
isTestnetOnly: false,
});
返回结果
{
success: true,
payload: {
signature: string; // 证明签名结果
}
}
错误
{
success: false,
payload: {
error: string, // 错误消息
code: number // 错误码
}
}