Submit Endpoint
Endpoint
Section titled “Endpoint”POST /agent/submit
The submit endpoint lets you send a pre-built transaction directly to the blockchain. Unlike the Prompt Endpoint, there is no AI interpretation — you provide the exact calldata, target address, and value, and Bankr submits it on your behalf.
When to use this:
- You have already encoded the transaction calldata yourself.
- You are making custom contract calls or DeFi interactions.
- You know exactly what transaction to send and do not need natural language processing.
Prompt vs Submit: The Prompt endpoint interprets natural language and builds the transaction for you. The Submit endpoint takes a pre-built transaction and executes it as-is.
Examples
Section titled “Examples”curl -X POST https://api.bankr.bot/agent/submit \ -H "X-API-Key: bk_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "transaction": { "to": "0xContractAddress", "data": "0xCalldata...", "value": "0x0", "chainId": 8453 }, "waitForConfirmation": true }'const result = await fetch("https://api.bankr.bot/agent/submit", { method: "POST", headers: { "X-API-Key": process.env.BANKR_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ transaction: { to: "0xContractAddress", data: "0xCalldata...", value: "0x0", chainId: 8453, }, waitForConfirmation: true, }),}).then(r => r.json());
console.log("Transaction hash:", result.transactionHash);Request Fields
Section titled “Request Fields”| Field | Type | Description |
|---|---|---|
transaction.to | string | Target contract address |
transaction.data | string | Encoded calldata |
transaction.value | string | ETH value in hex (use "0x0" for no value) |
transaction.chainId | number | Chain ID (8453 for Base) |
waitForConfirmation | boolean | Wait for on-chain confirmation before responding |