SDK Transaction Types
GET /agent/job/{jobId} never returns a transactions array: prompts sent with an API key execute from your Bankr wallet, and the job's response and richData describe what ran. The transaction objects below come back from the x402 Bankr SDK (@bankr/sdk), which prepares transactions for a wallet you control to sign.
Common Structure
All transactions follow this pattern:
{
"type": "transaction_type",
"metadata": {
"chainId": 8453,
"to": "0x...",
"data": "0x...",
"value": "0",
"gas": "150000"
}
}
Swap Transactions
swap
Token-to-token or token-to-native swaps.
{
"type": "swap",
"metadata": {
"__ORIGINAL_TX_DATA__": {
"chain": "base",
"humanReadableMessage": "Swap 100 USDC for ETH",
"inputTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"inputTokenAmount": "100000000",
"inputTokenTicker": "USDC",
"outputTokenAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"outputTokenTicker": "ETH",
"receiver": "0x..."
},
"transaction": {
"chainId": 8453,
"to": "0x...",
"data": "0x...",
"gas": "200000",
"gasPrice": "1000000",
"value": "0"
}
}
}
swapCrossChain
Cross-chain swaps using bridge aggregators.
{
"type": "swapCrossChain",
"metadata": {
"chainId": 137,
"description": "Bridge 50 USDC from Polygon to Base",
"to": "0x...",
"data": "0x...",
"value": "0"
}
}
Transfer Transactions
transfer_erc20
ERC-20 token transfers.
{
"type": "transfer_erc20",
"metadata": {
"__ORIGINAL_TX_DATA__": {
"chain": "base",
"humanReadableMessage": "Send 50 USDC to 0x...",
"inputTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"inputTokenAmount": "50000000",
"inputTokenTicker": "USDC",
"receiver": "0x..."
},
"transaction": {
"chainId": 8453,
"to": "0x...",
"data": "0x...",
"gas": "65000",
"gasPrice": "1000000",
"value": "0"
}
}
}
transfer_eth
Native ETH transfers.
{
"type": "transfer_eth",
"metadata": {
"__ORIGINAL_TX_DATA__": {
"chain": "base",
"humanReadableMessage": "Send 0.1 ETH to 0x...",
"inputTokenAmount": "100000000000000000",
"inputTokenTicker": "ETH",
"receiver": "0x..."
},
"transaction": {
"chainId": 8453,
"to": "0x...",
"data": "0x",
"gas": "21000",
"gasPrice": "1000000",
"value": "100000000000000000"
}
}
}
Approval Transactions
approval
Token approval for DEX or contract interaction.
{
"type": "approval",
"metadata": {
"__ORIGINAL_TX_DATA__": {
"chain": "base",
"humanReadableMessage": "Approve USDC for swap",
"inputTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"inputTokenTicker": "USDC"
},
"transaction": {
"chainId": 8453,
"to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"data": "0x...",
"gas": "50000",
"gasPrice": "1000000",
"value": "0"
}
}
}
Wrapper Transactions
convert_eth_to_weth
Wrap ETH to WETH.
convert_weth_to_eth
Unwrap WETH to ETH.
NFT Transactions
buy_nft
Purchase an NFT from marketplace.
transfer_nft
Transfer NFT to another address.
mint_manifold_nft / mint_seadrop_nft
Mint NFTs from specific platforms.
Trading Transactions
avantisTrade
Leveraged trading position on Avantis (Base).
{
"type": "avantisTrade",
"metadata": {
"chainId": 8453,
"description": "Open $50 long on BTC/USD with 10x leverage",
"to": "0x...",
"data": "0x...",
"value": "0"
}
}
Staking Transactions
manage_bankr_staking
BNKR staking on Base: stake, start or cancel an unstake cooldown, withdraw, claim or restake rewards, or exit — plus withdrawals from the legacy vault.
One request can return more than one manage_bankr_staking transaction — for example an approval before a stake. Submit them in order, each confirmed before the next.
{
"type": "manage_bankr_staking",
"metadata": {
"chainId": 8453,
"description": "Stake 1000 BNKR",
"to": "0x...",
"data": "0x...",
"value": "0"
}
}
Executing Transactions
Sign and broadcast the returned transactions with your own wallet, for example with viem:
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';
const client = createWalletClient({
account: privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`),
chain: base,
transport: http(),
});
// Most types nest the calldata under metadata.transaction; avantisTrade,
// swapCrossChain and manage_bankr_staking put to/data/value on metadata itself.
const tx = transaction.metadata.transaction ?? transaction.metadata;
const hash = await client.sendTransaction({
to: tx.to,
data: tx.data,
value: BigInt(tx.value ?? '0'),
gas: tx.gas ? BigInt(tx.gas) : undefined,
});