授权 agent 交易
build_agent_authorizeCreates a user-signed authorization transaction that sets an agent wallet as a restricted trading sub-account with action-count, duration, USDC-margin, and gas caps, so it can trade but not withdraw.
Instructions
agent 专用通道:生成用户主钱包要签的授权交易,把 agent 的地址设为「只能交易、不能提币」的子账户。限定操作次数、有效天数(默认 3 天,最长 30 天)、可动用的精确 USDC 保证金上限,可选 gas 预算(合约每次按实际花费从用户 WBNB 报销给 agent)。签完后 agent 在开仓 / 平仓 / 止盈止损 / 撤单工具里带上 agent 参数,就能用自己的私钥直接下单。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"account": "<account>",
"agent": "<agent>",
"maxActions": "<maxActions>",
"days": "<days>",
"usdcBudget": "<usdcBudget>",
"gasBudgetBnb": "<gasBudgetBnb>",
"topUpPerActionBnb": "<topUpPerActionBnb>",
"seedAgentBnb": "<seedAgentBnb>"
},
"name": "build_agent_authorize"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | Yes | 有效天数(默认 3 天,最长 30 天),到期后自动失效 | |
| agent | Yes | agent 自己的钱包地址(agent 本地生成的新私钥对应的地址,不要用用户主钱包) | |
| account | Yes | 用户钱包地址(交易的签名人和收款人) | |
| maxActions | Yes | 本次授权可用的操作次数(下单、改单、撤单各算一次;开仓带止盈止损算 3 次) | |
| usdcBudget | Yes | agent 最多能动用的 USDC 保证金(设为 Router 的精确 USDC 授权额度,与网页下单共用) | |
| gasBudgetBnb | Yes | gas 预算:包成 WBNB 授权给合约,每次操作后按实际花费报销给 agent;0 表示不报销,agent 自己出 gas | |
| seedAgentBnb | Yes | agent 钱包 BNB 少于这个数时,顺带转给它这么多,用来发第一笔交易;0 表示不转 | |
| topUpPerActionBnb | Yes | 单次操作最多报销多少 BNB |