External Sign
Use Developer Mode to preview and execute user-built contract calls and message signatures. These commands are intentionally two-step: first preview and inspect the parsed operation and security result, then execute only after explicit user confirmation.
Developer Mode can only be enabled or configured in the Binance App. Use baw wallet settings --json to check whether Developer Mode is active before attempting external signing. If devMode.enabled is false, tell the user to enable Developer Mode in the Binance App instead of running preview.
Safety Flow
Always follow this flow:
- Run the relevant
previewcommand. - Show the user the parsed transaction or parsed message,
risks, andauthorityChangesif present. - Ask for explicit confirmation before executing.
- Run
executeonly with arequestIdreturned by a successful preview.
Do not run execute if preview returns an error. Intercepted previews do not return a usable requestId.
Preview cache can expire. If execute returns an expired-preview error, run preview again.
contract-call preview
Preview a contract call, simulate it, and get risk information.
Syntax
baw contract-call preview --binanceChainId <binanceChainId> --from <from> --to <to> [--value <wei>] [--inputData <hex>] --jsonFor Solana:
baw contract-call preview --binanceChainId CT_501 --from <from> --unsignedTx <base64> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--binanceChainId |
Yes | - | Binance chain ID, for example 56 for BSC, 1 for Ethereum, or CT_501 for Solana. |
--from |
Yes | - | Agentic wallet address on the selected chain. The backend verifies ownership. |
--to |
EVM yes | - | Contract address to interact with. |
--value |
EVM no | 0 |
Raw eth_sendTransaction value in wei, not human-readable. Must be a non-negative integer (decimal or 0x-hex); decimals are rejected. |
--inputData |
EVM no | 0x |
EVM calldata. |
--unsignedTx |
Solana yes | - | Solana unsigned transaction, base64 encoded. |
--gasLimit |
EVM no | - | Custom EVM gas limit, an integer from 21000 to 15000000. Omit it and the backend estimates. See below. |
Do not pass gas price or gas option parameters — contract-call does not accept them. By default,
leave gas alone entirely: preview simulates the call and the backend estimates the gas limit.
--gasLimit (advanced fallback)
--gasLimit is the one exception, and it is a fallback rather than part of the normal flow. Do not
decide to use it yourself — pass it only when the user explicitly asks for a specific gas limit.
Otherwise omit it and let the backend estimate.
How it behaves:
- It is a cap, not a bypass. The transaction is still simulated, with your value as the ceiling. If it passes, that exact value goes on chain — no buffer is added.
- Too low fails at preview. If the call needs more gas than the cap, preview fails with
351805instead of letting the transaction run out of gas after broadcast.351805is the generic simulation-failure code, so read the message before acting: when it points at gas ("The transaction ran out of gas. Please increase the gas limit and try again."), the user's value was too low — tell them, and let them pick a higher one. - Preview only. Pass it on
preview;executetakes just therequestIdand reuses the value from that preview. There is nothing to pass twice. - EVM only. Passing it on Solana is rejected with
351821, as is any value outside 21000–15000000.
Example
baw contract-call preview --binanceChainId 56 --from 0xYourAgentWallet --to 0xTargetContract --value 0 --inputData 0x... --jsonResponse
Successful preview:
{
"success": true,
"data": {
"requestId": "a1b2c3d4...",
"parsedTx": {
"transactionType": "Send",
"amount": 255,
"isMax": false,
"recipient": "0x1234...",
"contractAddress": "0x...",
"memo": null
},
"simulationResult": {
"simulationCode": "000000000",
"simulationErrorDetail": null,
"gasTokenFromData": 255,
"balanceChanges": [],
"allowanceChanges": [],
"authorityChanges": [],
"preCheckCode": ""
},
"risks": {
"riskDetails": [
{
"code": "RISK_001",
"title": "High Risk Address",
"description": "The target address is flagged as high risk.",
"riskType": "RISK",
"order": 1
}
],
"addresses": {
"0xabc123...": {
"riskLevel": 5,
"riskDetails": [
{
"code": "ADDR_RISK_001",
"title": "Suspicious Address",
"description": "This address has been associated with phishing activity.",
"riskType": "RISK",
"order": 1
}
]
}
},
"riskBehaviors": []
},
"tokenInfos": {
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee": {
"name": "BNB Chain Native Token",
"symbol": "BNB",
"decimals": 18,
"price": "..."
}
},
"requireConfirmation": false,
"expiresAt": 1784037104410
}
}Intercepted preview:
{
"success": false,
"error": {
"code": 351803,
"name": "AGENT_DEV_MODE_RISK_BLOCKED",
"message": "High risk transaction",
"data": {
"blockLevel": "Block",
"blockReason": "High risk transaction",
"risks": {}
}
}
}Notes
parsedTx.amountis in the smallest unit (wei for native tokens), not human-readable. Divide it by the token'sdecimalsfromtokenInfosbefore showing it to the user.requireConfirmation=falsemeans execute can broadcast directly.requireConfirmation=truemeans execute will create an order that must be approved in the Binance App.- Intercepted previews have no
requestId; do not attempt execute. risks.riskDetailsis a list of transaction-level risk items. Each item hascode,title,description,riskType(RISKorCAUTION), andorder. When non-empty, show the risktitleanddescriptionto the user before executing.risks.addressesis a map of address →{ riskLevel, riskDetails }. When an address has risks, mention it to the user (e.g. "The target address 0x... is flagged as risky: {title} — {description}").
contract-call execute
Execute a contract-call preview.
Syntax
baw contract-call execute --requestId <requestId> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--requestId |
Yes | - | Request ID from a successful contract-call preview. |
Example
baw contract-call execute --requestId a1b2c3d4... --jsonResponse
Direct broadcast:
{
"success": true,
"data": {
"orderId": "order-xxx",
"status": "BROADCASTED",
"txHash": "0xabc123...",
"message": null
}
}Pending App confirmation:
{
"success": true,
"data": {
"orderId": "order-xxx",
"status": "PENDING_CONFIRMATION",
"txHash": null,
"message": "Please confirm in the Binance App"
}
}Notes
BROADCASTEDmeans the transaction was signed and submitted to the chain. Use the returnedtxHashto check chain status.PENDING_CONFIRMATIONmeans the user must approve in the Binance App before the transaction can complete.
sign-message preview
Preview a message signature and get parsed-message and risk information.
Syntax
baw sign-message preview --binanceChainId <binanceChainId> --message <message> --signType <signType> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--binanceChainId |
Yes | - | Binance chain ID, for example 1, 56, or CT_501. |
--message |
Yes | - | A full eth_signTypedData_v4 JSON-RPC request string, not a hex digest: {"method":"eth_signTypedData_v4","params":[<signerAddress>,<typedDataJson>]}. params[0] must be your own agentic wallet address; params[1] is the EIP-712 typed data (domain, types, primaryType, message) as a JSON string. |
--signType |
Yes | - | EIP712. |
Example
baw sign-message preview --binanceChainId 1 --signType EIP712 --message '{"method":"eth_signTypedData_v4","params":["0xYourAgentWallet","{\"domain\":{\"name\":\"Permit2\",\"chainId\":1,\"verifyingContract\":\"0x...\"},\"primaryType\":\"Permit\",\"types\":{...},\"message\":{...}}"]}' --jsonResponse
{
"success": true,
"data": {
"requestId": "e5f6g7h8...",
"parsedMessage": {
"messageType": "SignTypedData",
"preCheckCode": "",
"version": "V4",
"message": "{...}"
},
"risks": {
"riskDetails": [],
"addresses": {},
"riskBehaviors": []
},
"requireConfirmation": false,
"expiresAt": 1784037104410
}
}Notes
- For Permit or Permit2 messages, show the user the authority being granted before signing. It comes from
parsedMessage:spender,sigDeadline, anddetails[](token, amount, expiration). risksstructure is the same as contract-call preview. See contract-call Notes for field details.
sign-message execute
Execute a message-signature preview.
Syntax
baw sign-message execute --requestId <requestId> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--requestId |
Yes | - | Request ID from a successful sign-message preview. |
Example
baw sign-message execute --requestId e5f6g7h8... --jsonResponse
Direct signature:
{
"success": true,
"data": {
"orderId": "msg-order-xxx",
"status": "COMPLETED",
"signature": "363c1325...2852ae48",
"signatureRecovery": "01",
"message": null
}
}Pending App confirmation:
{
"success": true,
"data": {
"orderId": "msg-order-xxx",
"status": "PENDING_CONFIRMATION",
"signature": null,
"signatureRecovery": null,
"message": "Please confirm in the Binance App"
}
}sign-message result
Fetch the result after sign-message execute returns PENDING_CONFIRMATION and the user confirms in the Binance App.
Syntax
baw sign-message result --order-id <orderId> --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--order-id |
Yes | - | Order ID returned by sign-message execute. |
Example
baw sign-message result --order-id msg-order-xxx --jsonResponse
{
"success": true,
"data": {
"orderId": "msg-order-xxx",
"status": "COMPLETED",
"signature": "363c1325...2852ae48",
"signatureRecovery": "01",
"message": null
}
}status=PENDING_CONFIRMATION means App confirmation has not completed yet. Retry later. REJECTED or EXPIRED means no signature is available.
sign-message history
View message signature history for the current agentic wallet.
Syntax
baw sign-message history [--binanceChainId <binanceChainId>] [--limit <limit>] [--nextToken <token>] [--startTime <ms>] [--endTime <ms>] [--sortType <type>] --jsonParameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--binanceChainId |
No | - | Filter by chain ID, for example 56 or 1. If omitted, queries all chains. |
--limit |
No | 20 |
Number of records to return. |
--nextToken |
No | - | Pagination cursor, taken from nextToken of a previous response. |
--startTime |
No | - | Start of the time range, Unix epoch milliseconds. |
--endTime |
No | - | End of the time range, Unix epoch milliseconds. |
--sortType |
No | - | Sort order, DESC or ASC. |
Examples
baw sign-message history --json
baw sign-message history --binanceChainId 56 --limit 50 --jsonResponse
{
"success": true,
"data": {
"nextToken": null,
"items": [
{
"signatureType": "sign_message",
"binanceChainId": "56",
"address": "0x...",
"signatureHash": "0x...",
"signatureTime": 1719921600000,
"spenderAddress": null,
"spenderLabel": null,
"tokenPermits": null,
"signatureDeadline": null,
"messageType": "SignTypedData",
"rawData": "{\"method\":\"eth_signTypedData_v4\",\"params\":[\"0x...\",{\"domain\":{...},\"primaryType\":\"...\",\"types\":{...},\"message\":{...}}]}"
}
]
}
}