bankr-x402-sdk-dev Plugin
Web3 development integration with the @bankr/sdk for advanced use cases.
note
The SDK returns transaction data for you to submit using your own wallet infrastructure. If you want Bankr to handle transactions, use the Agent API or bankr-agent plugin instead.
Installation
claude plugin install bankr-x402-sdk-dev
Capabilities
Market Analysis
Build features using market data:
"get token prices for my dashboard"
"implement trending tokens display"
"add technical analysis charts"
Portfolio Tracking
Track user portfolios:
"fetch user balances across chains"
"calculate portfolio value in USD"
"track position P&L"
Token Swaps
Implement swap functionality:
"add swap feature with 0x routing"
"implement cross-chain bridging"
"handle approval transactions"
Leveraged Trading
Integrate Avantis trading:
"implement leveraged positions"
"add stop-loss and take-profit"
"track open positions"
SDK Features
The plugin helps you implement:
| Feature | Supported Chains |
|---|---|
| Prices & Charts | All |
| Token Swaps | EVM chains |
| Cross-chain Bridges | EVM chains |
| Leveraged Trading | Base (Avantis) |
| Portfolio Tracking | All |
| NFT Operations | EVM chains |
x402 Micropayments
The SDK uses x402 micropayments ($0.01 USDC per request on Base):
"how do x402 payments work?"
"implement payment handling"
"handle 402 responses"
Your wallet signs payment transactions automatically — USDC is deducted from your wallet on Base.
Example: Portfolio Dashboard
import { BankrClient } from '@bankr/sdk';
const client = new BankrClient({
privateKey: process.env.PRIVATE_KEY as `0x${string}`,
});
async function getPortfolio() {
const result = await client.promptAndWait({
prompt: 'what are my token balances on all chains?',
});
return result.response;
}
async function getTokenPrice(token: string) {
const result = await client.promptAndWait({
prompt: `what is the price of ${token}?`,
});
return result.response;
}
async function executeSwap(amount: number, from: string, to: string) {
const result = await client.promptAndWait({
prompt: `swap $${amount} of ${from} to ${to}`,
});
// SDK returns transaction data - you must submit it yourself
if (result.transactions?.length) {
for (const tx of result.transactions) {
// Submit using your wallet (e.g., viem walletClient)
// const hash = await walletClient.sendTransaction(tx.metadata.transaction);
}
}
return {
response: result.response,
transactions: result.transactions,
};
}
Limitations
Through the SDK, these are not supported:
- Solana operations (use API directly)
- Polymarket betting (use API directly)
For full feature access, use the Agent API directly or the bankr-agent plugin.