方法
tonConnect_connect
连接钱包并请求账户信息。
请求
[
{
"manifestUrl": "https://yourapp.com/tonconnect-manifest.json",
"items": [
{ "name": "ton_addr" }
]
}
]
响应
{
"items": [
{
"name": "ton_addr",
"address": "0:057bdabe92e2963cdf83e906cedadde13d418be6deb394faea77e1090097f747",
"network": "-239",
"walletStateInit": "te6cck...",
"publicKey": "6fc8798de2bd48a1a0f4b3b4b37f7d30d51dca23f4b143ed3439096ca01897b9"
}
],
"device": {
"platform": "mac",
"appName": "cactus link",
"appVersion": "2.1.8",
"maxProtocolVersion": 2,
"features": [
"SendTransaction",
{
"name": "SendTransaction",
"maxMessages": 255,
"extraCurrencySupported": true
},
{
"name": "SignData",
"types": ["text", "binary", "cell"]
}
]
}
}
注意:
network: "-239"是TON主网的网络ID(固定值)。device部分由插件负责组装。
tonConnect_reconnect
重新连接之前已授权的钱包会话。
请求
[
{ "name": "ton_addr" }
]
响应
与 tonConnect_connect 响应结构相同。
tonConnect_sendTransaction
发送一条或多条TON交易消息。
请求
[
{
"from": "0:057bdabe92e2963cdf83e906cedadde13d418be6deb394faea77e1090097f747",
"network": "-239",
"valid_until": 1750734652242,
"messages": [
{
"address": "EQAwYg4_Y9LnDJ_zSDCxEHs-BvpHZQM6GQ-2AZBnxeP2PxTW",
"amount": "200000000",
"payload": "te6cckEBAQEADgAAGAAAAABXaXRoZHJhd6/QZtE="
}
]
}
]
响应
BOC(Bag of Cells)编码字符串:
te6cckEBBAEAwwAB5YgACve1fSXFLHm...
插件将dApp的请求消息直接透传。托管签名接口的参数与
tonConnect_sendTransaction请求参数相同。
tonConnect_disconnect
断开当前连接的钱包。
请求
[]
响应
无
tonConnect_signData
对任意数据(文本、二进制或cell格式)进行签名。
支持的数据类型
textbinarycell
请求
{
"schema_crc": 0,
"cell": "..."
}
响应
{
"signature": "...",
"timestamp": 1234567890
}