Help us improve
Share bugs, ideas, or general feedback.
From bankr-x402-sdk-dev
Builds and executes token swaps using Bankr SDK with 0x routing on Base, Ethereum, Polygon, Solana. Handles ERC20 approvals, allowance targets, and swap transactions.
npx claudepluginhub bankrbot/claude-plugins --plugin bankr-x402-sdk-devHow this skill is triggered — by the user, by Claude, or both
Slash command
/bankr-x402-sdk-dev:sdk-token-swapsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Build and execute token swaps with AI-powered 0x routing.
Guides token swaps, bridges, ETH/WETH conversions, and trades on Base, Polygon, Ethereum, Unichain, Solana using USD, percentage, or exact amounts.
Executes token buys, sells, swaps, cross-chain bridges, and ETH/WETH conversions via natural language prompts. Supports chains like Ethereum, Base, Polygon, Solana; handles USD, percentage, exact amounts.
Generates unsigned token swap transactions via 1inch on Base, with approval tx if needed. Costs $0.01 USDC via x402. For rebalancing portfolios or token conversion.
Share bugs, ideas, or general feedback.
Build and execute token swaps with AI-powered 0x routing.
| Pattern | Example |
|---|---|
| Amount-based | "Swap 0.1 ETH to USDC" |
| Value-based | "Buy $100 worth of DEGEN" |
| Percentage | "Swap 50% of my ETH to USDC" |
| Sell all | "Sell all my DEGEN" |
| Chain-specific | "Swap ETH to USDC on Polygon" |
# Amount Swaps
"Swap 0.1 ETH to USDC"
"Exchange 100 USDC for WETH"
"Swap 1000 DEGEN to ETH"
# Value Swaps
"Buy $100 worth of DEGEN"
"Purchase $50 of ETH"
# Percentage Swaps
"Swap 50% of my ETH to USDC"
"Sell 25% of my DEGEN"
# Chain-Specific
"Swap 0.1 ETH to USDC on Base"
"Exchange 100 USDC for WETH on Ethereum"
For ERC20 swaps (selling tokens other than ETH), approval is required before the swap.
const result = await client.promptAndWait({
prompt: "Swap 100 USDC to WETH",
});
const swapTx = result.transactions?.find(tx => tx.type === "swap");
// Check if approval is needed
if (swapTx?.metadata.approvalRequired) {
// Execute pre-built approval transaction first
await wallet.sendTransaction(swapTx.metadata.approvalTx);
}
// Then execute the swap
await wallet.sendTransaction(swapTx.metadata.transaction);
| Field | Description |
|---|---|
approvalRequired | Whether approval needed before swap |
approvalTx | Pre-built approval transaction (ready to send) |
allowanceTarget | 0x AllowanceHolder address (for manual approval) |
import { BankrClient } from "@bankr/sdk";
const client = new BankrClient({
privateKey: process.env.BANKR_PRIVATE_KEY as `0x${string}`,
});
const result = await client.promptAndWait({
prompt: "Swap 0.1 ETH to USDC on Base",
});
if (result.status === "completed" && result.transactions?.length) {
const tx = result.transactions[0].metadata.transaction;
await wallet.sendTransaction(tx);
}
| Chain | Native Token | Default |
|---|---|---|
| Base | ETH | Yes |
| Ethereum | ETH | No |
| Polygon | MATIC | No |
| Solana | SOL | No |