Bankr x402 SDK - Token Swaps

Bankr x402 SDK - Token Swaps is a skill for Claude Code from BankrBot/claude-plugins. It costs 102 tokens per session (731 once invoked), scanned A, original, MIT.

A guide for using the Bankr SDK to exchange one cryptocurrency token for another, with routing handled through 0x. It includes fixed-amount, dollar-value, percentage, sell-all, and chain-specific requests, plus ERC20 approval steps.

In plain words
What is it for?
Use it to build ETH, ERC20, and cross-chain token swaps, buy or sell by amount or value, exchange a percentage of a balance, and submit required token approvals.
Why use it?
It removes uncertainty around writing swap requests and handling the extra permission transaction required for many tokens. Developers can follow examples for common swap forms.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the bankr-x402-sdk-dev plugin — 8 skills, 1 agent shipped together

Good fit Use it to build ETH, ERC20, and cross-chain token swaps, buy or sell by amount or value, exchange a percentage of a balance, and submit required token approvals.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bankrbot/claude-plugins/sdk-token-swaps
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add BankrBot/claude-plugins --skill sdk-token-swaps
Clone the repo
git clone --depth 1 https://github.com/BankrBot/claude-plugins

Made for: Claude Code.

Or install bankr-x402-sdk-dev, the plugin that ships this one along with the rest of its 8 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Bankr x402 SDK - Token Swaps

README.md
[![agentmods](https://agentmods.dev/badge/skills/bankrbot/claude-plugins/sdk-token-swaps.svg)](https://agentmods.dev/skills/bankrbot/claude-plugins/sdk-token-swaps)
Your own site
<a href="https://agentmods.dev/skills/bankrbot/claude-plugins/sdk-token-swaps"><img src="https://agentmods.dev/badge/skills/bankrbot/claude-plugins/sdk-token-swaps.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 731 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00102 $0.00731
Opus 5 $0.00051 $0.00365
Sonnet 5 $0.00020 $0.00146
Haiku 4.5 $0.00010 $0.00073

Measured 8d ago against content hash 54bd09695d48, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

Bankr x402 SDK - Token Swaps scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

x402-sdk-dev/skills/sdk-token-swaps/SKILL.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SDK Token Swaps

Build and execute token swaps with AI-powered 0x routing.

Prompt Patterns

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"

ERC20 Approval Handling

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);

Approval Fields

Field Description
approvalRequired Whether approval needed before swap
approvalTx Pre-built approval transaction (ready to send)
allowanceTarget 0x AllowanceHolder address (for manual approval)

Usage

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);
}

Supported Chains

Chain Native Token Default
Base ETH Yes
Ethereum ETH No
Polygon MATIC No
Solana SOL No

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 102 lines · 102 tokens per session scan A 54bd09695d48

Subscribe to this mod's changes

Bankr x402 SDK - Token Swaps is a skill published in the GitHub repository BankrBot/claude-plugins (85 stars, last pushed 5mo ago), licensed MIT. It adds 102 tokens to every session and 731 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.