
Bankr X402 Sdk Client Patterns
- 359 installs
- 80 repo stars
- Updated March 24, 2026
- bankrbot/claude-plugins
bankr x402 sdk - client patterns is an agent skill that provides reusable @bankr/sdk TypeScript client setup with bankr-client.ts, viem-based executor.ts, and standard project files for x402 micropayment HTTP integration
About
bankr x402 sdk - client patterns is a version 1.0.0 BankrBot/claude-plugins skill for bootstrapping @bankr/sdk clients that pay per request via the x402 protocol on Base instead of traditional API keys. The skill documents bankr-client.ts initialization from environment variables, executor.ts helpers that map chain IDs to viem chains and submit SDK-returned transactions, plus package.json, tsconfig.json, .env.example, and .gitignore templates. Bankr documents roughly $0.10 USDC per SDK request on Base for server-side calls. Reach for bankr x402 sdk - client patterns when implementing payment-authenticated Bankr SDK clients with consistent TypeScript structure across web services, CLIs, and agent backends.
- x402 client auth and signing patterns
- retry and idempotency for paid requests
- settlement and receipt verification flows
- error handling for insufficient funds and timeouts
- agent-safe payment call conventions
Bankr X402 Sdk Client Patterns by the numbers
- 359 all-time installs (skills.sh)
- Ranked #46 of 479 Web3 & Blockchain skills by installs in the Skillselion catalog
- Data as of Jul 31, 2026 (Skillselion catalog sync)
npx skills add https://github.com/bankrbot/claude-plugins --skill bankr-x402-sdk---client-patternsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 359 |
|---|---|
| repo stars | ★ 80 |
| Last updated | March 24, 2026 |
| Repository | bankrbot/claude-plugins ↗ |
How do you set up a Bankr x402 SDK TypeScript client?
Implement x402 HTTP payment clients with correct auth, retries, and settlement handling when building Bankr or agent apps that charge per request.
Who is it for?
TypeScript developers integrating @bankr/sdk with x402 per-request USDC payments who need a consistent client and viem execution layer.
Skip if: Skip bankr x402 sdk - client patterns when you only need full project scaffolding—use the Bankr x402 project templates skill instead.
When should I use this skill?
A developer asks to implement bankr-client.ts, Bankr SDK client setup, executor.ts, or common TypeScript files for x402 integrations.
What you get
bankr-client.ts, executor.ts, package.json, tsconfig.json, .env.example, and .gitignore aligned to @bankr/sdk patterns.
- bankr-client.ts
- executor.ts
- project config templates
By the numbers
- Skill metadata version 1.0.0
- Bankr SDK documents about $0.10 USDC per x402 request on Base
Files
Safety & Access Control
Comprehensive safety guidance for using the Bankr API and CLI.
API Key Types
Bankr uses a single key format (bk_...) with capability flags:
| Flag | Controls | Default |
|---|---|---|
agentApiEnabled | /agent/* endpoints | false |
llmGatewayEnabled | LLM Gateway at llm.bankr.bot | false |
readOnly | Restricts agent to read-only tools | false |
Manage flags at bankr.bot/api.
Read-Only API Keys
When readOnly: true, all write tools are filtered from the agent session:
Allowed: Balances, prices, analytics, portfolio, research Blocked: Swaps, transfers, NFT purchases, staking, orders, token launches, leverage, Polymarket bets, claims
The /agent/sign and /agent/submit endpoints return 403 for read-only keys.
IP Whitelisting
Set allowedIps on your API key to restrict usage to specific IPs. Requests from non-whitelisted IPs are rejected with 403.
- Empty array = all IPs allowed (default)
- Non-empty array = only listed IPs can use the key
Dedicated Agent Wallet
When building autonomous agents, create a separate Bankr account rather than using your personal wallet:
- Limited exposure — compromised key only exposes agent wallet funds
- Clear accounting — agent transactions isolated from personal activity
- Independent controls — apply stricter access controls without affecting personal use
- Easy revocation — disable agent account without disrupting primary wallet
Recommended Funding
| Chain | Gas Buffer | Trading Capital |
|---|---|---|
| Base | 0.01-0.05 ETH | As needed |
| Polygon | 5-10 MATIC | As needed |
| Ethereum | 0.05-0.1 ETH | As needed |
| Solana | 0.1-0.5 SOL | As needed |
Rate Limits
| Tier | Daily Limit |
|---|---|
| Standard | 100 messages/day |
| Bankr Club | 1,000 messages/day |
| Custom | Set per API key |
Reset window is 24 hours from first message (rolling), not midnight.
Key Management
- Store keys in environment variables (
BANKR_API_KEY,BANKR_LLM_KEY), never in source code - Add
~/.bankr/and.envto.gitignore - Rotate keys periodically at bankr.bot/api
- Revoke immediately if compromised
- Use separate keys for Agent API vs LLM Gateway if needed
Transaction Safety
- Test first — small amounts on Base/Polygon before scaling
- Verify recipients — double-check addresses before transfers
- Gas buffer — keep enough native tokens for gas
- Immediate execution —
/agent/submitexecutes with no confirmation prompt - Understand calldata — verify trusted source for arbitrary transactions
Pre-Deployment Checklist
- Use a dedicated agent wallet, not your personal account
- Fund with limited amounts appropriate to purpose
- Set read-only if agent only queries data
- Configure IP whitelisting for server-side agents
- Store keys in environment variables
- Test with small amounts first
- Implement error handling for rate limits (429) and access control (403)
Related skills
How it compares
Use client patterns for reusable SDK files inside an existing repo; use project templates to pick bot, web-service, dashboard, or CLI layouts.
FAQ
What files does bankr x402 sdk - client patterns provide?
bankr x402 sdk - client patterns delivers bankr-client.ts, executor.ts, package.json, tsconfig.json, .env.example, and .gitignore. Together they standardize @bankr/sdk initialization, viem transaction execution, and TypeScript build scripts for x402-enabled services.
How does x402 authentication work in Bankr SDK clients?
bankr x402 sdk - client patterns uses @bankr/sdk with x402 micropayments on Base—roughly $0.10 USDC per server-side request—instead of API key dashboards. The client wallet pays per call while a separate walletAddress can execute returned on-chain transactions.