Skip to content
Bankr Support home
InboxAsk a human

How Do I Execute Direct Transactions via the Wallet API?

While the Agent API uses natural language to figure out what you want to do, the Wallet API is designed for direct operations. Use this when you know exactly what transaction you want to execute and you want it done quickly without AI reasoning.

1. Get Your API Key

To perform write operations (like transfers or swaps), you need an API key with the Wallet & Agent API feature enabled. You can generate and manage your keys at bankr.bot/api-keys.

If you try to use a standard key for a transfer, you will receive a 403 Forbidden error.

2. Choose Your Endpoint

The Wallet API uses the base URL https://api.bankr.bot. Here are the most common endpoints for direct transactions:

  • POST /wallet/transfer: Send native tokens (like ETH) or ERC20 tokens on EVM chains.

  • POST /wallet/swap-quote: Price a swap before executing it. Returns the quoted buy amount, minBuyAmount, the Bankr fee, price impact and a quoteId.

  • POST /wallet/swap: Execute a swap. Same-chain EVM, Solana, and cross-chain swaps all route through this one endpoint.

  • POST /wallet/sign: Sign a message or a raw transaction.

  • POST /wallet/submit: Broadcast a signed transaction to the network.

3. Example: Sending a Transfer

To send a transaction directly via the API, you'll need to include your API key in the X-API-Key header. Here is an example of how to send 1 ETH using curl:

curl -X POST https://api.bankr.bot/wallet/transfer \ -H "Content-Type: application/json" \ -H "X-API-Key: your_api_key_here" \ -d '{ "to": "0xYourRecipientAddress", "chainId": 8453, "value": "1000000000000000000" }'

Swapping Tokens

Swaps are a two-step flow: quote, then execute with the minBuyAmount the quote returned.

  • Cross-chain and Solana are supported. fromChain and toChain can differ, and Solana legs use your wallet's Solana address (a wallet with no Solana address returns 400).

  • Slippage: pass slippageBps (10–2000, default 500 = 5%) to shape the quote's minBuyAmount. Note that on the same-chain EVM aggregator path, execution re-quotes with a tighter 2% clamp — a 2000 bps quote does not execute at 2000 bps there.

  • Native gas tokens: pass the native sentinel 0xeeee…eeee (or the zero address) as the token.

  • Tokenized stocks on Robinhood Chain require a passed location check — without one, /wallet/swap returns 403. Quotes are not gated, so a successful quote is not clearance to execute. Verify at the Bankr console.

4. Executing the Transaction

Depending on how you are using Bankr, there are two ways the transaction actually gets onto the blockchain:

  • Hosted Wallet: If you are using Bankr's hosted wallet (e.g., via the Terminal), transactions are often signed and broadcasted automatically.

  • Self-Custody: If you are building your own app, the API will return the transaction data. You must then sign it using a library like viem or ethers.js and broadcast it yourself.

Using the Bankr CLI

If you prefer the command line over raw API calls, the Bankr CLI makes direct transactions much simpler. You can execute a transfer with a single command:

bankr wallet submit tx --to 0x... --chain-id 8453 --value 1000000000000000000

Troubleshooting Tips

  • 403 Errors: Double-check that your API key has "Wallet & Agent API" permissions enabled in your dashboard. On a swap, a 403 can also mean the buy token is flagged by the security scan, or that a Robinhood Chain stock leg needs a location check.

  • Chain IDs: Ensure you are using the correct decimal Chain ID (e.g., 8453 for Base, 1 for Ethereum Mainnet).

  • Values: Remember that values are typically handled in wei (the smallest unit of the token). Swap endpoints are the exception — amount there is human-readable (e.g. "0.5").

For a full technical reference of all available parameters and response shapes, visit the Bankr Wallet API Documentation.