bankr-x402-sdk---wallet-operations by bankrbot/claude-plugins
npx skills add https://github.com/bankrbot/claude-plugins --skill 'Bankr x402 SDK - Wallet Operations'初始化并配置 BankrClient,正确设置钱包。
| 钱包 | 用途 | 是否必需 |
|---|---|---|
支付钱包 (privateKey) | 签署 x402 微支付($0.01/请求) | 是 |
上下文钱包 (walletAddress) | 接收兑换的代币、NFT | 否(默认为支付钱包) |
import { BankrClient } from "@bankr/sdk";
const client = new BankrClient({
privateKey: process.env.BANKR_PRIVATE_KEY as `0x${string}`,
});
const result = await client.promptAndWait({
prompt: "What are my balances?",
});
为了增强安全性,建议使用不同的钱包进行支付和接收:
const client = new BankrClient({
// 热钱包,仅存少量用于支付的 USDC
privateKey: process.env.PAYMENT_WALLET_PK as `0x${string}`,
// 冷/交易钱包用于接收代币
walletAddress: process.env.RECEIVING_WALLET,
});
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 选项 | 类型 | 是否必需 | 描述 |
|---|---|---|---|
privateKey | 0x${string} | 是 | 支付钱包的私钥 |
walletAddress | string | 否 | 覆盖接收钱包地址 |
baseUrl | string | 否 | API 端点(默认:生产环境) |
timeout | number | 否 | 请求超时时间(毫秒,默认:600000) |
| 方法 | 描述 |
|---|---|
promptAndWait() | 提交提示词并等待结果 |
prompt() | 提交提示词,立即返回 |
pollJob() | 轮询直到任务完成 |
getJobStatus() | 检查一次任务状态 |
cancelJob() | 取消待处理/处理中的任务 |
getWalletAddress() | 获取上下文钱包地址 |
// 为单次请求覆盖钱包地址
const result = await client.promptAndWait({
prompt: "Swap 0.1 ETH to USDC",
walletAddress: "0xDifferentWallet...",
});
# 必需
BANKR_PRIVATE_KEY=0x...your_payment_wallet_key...
# 可选
BANKR_WALLET_ADDRESS=0x...your_receiving_wallet...
每周安装数
–
仓库
GitHub 星标数
69
首次出现
–
Initialize and configure the BankrClient with proper wallet setup.
| Wallet | Purpose | Required |
|---|---|---|
Payment (privateKey) | Signs x402 micropayments ($0.01/request) | Yes |
Context (walletAddress) | Receives swapped tokens, NFTs | No (defaults to payment wallet) |
import { BankrClient } from "@bankr/sdk";
const client = new BankrClient({
privateKey: process.env.BANKR_PRIVATE_KEY as `0x${string}`,
});
const result = await client.promptAndWait({
prompt: "What are my balances?",
});
For enhanced security, use different wallets for payments and receiving:
const client = new BankrClient({
// Hot wallet with minimal USDC for payments
privateKey: process.env.PAYMENT_WALLET_PK as `0x${string}`,
// Cold/trading wallet receives tokens
walletAddress: process.env.RECEIVING_WALLET,
});
| Option | Type | Required | Description |
|---|---|---|---|
privateKey | 0x${string} | Yes | Payment wallet private key |
walletAddress | string | No | Override receiving wallet |
baseUrl | string | No | API endpoint (default: production) |
| Method | Description |
|---|---|
promptAndWait() | Submit prompt and wait for result |
prompt() | Submit prompt, return immediately |
pollJob() | Poll until job completes |
getJobStatus() | Check job status once |
cancelJob() | Cancel pending/processing job |
getWalletAddress() | Get context wallet address |
// Override wallet for a single request
const result = await client.promptAndWait({
prompt: "Swap 0.1 ETH to USDC",
walletAddress: "0xDifferentWallet...",
});
# Required
BANKR_PRIVATE_KEY=0x...your_payment_wallet_key...
# Optional
BANKR_WALLET_ADDRESS=0x...your_receiving_wallet...
Weekly Installs
–
Repository
GitHub Stars
69
First Seen
–
Azure RBAC 权限管理工具:查找最小角色、创建自定义角色与自动化分配
110,700 周安装
timeout | number | No | Request timeout ms (default: 600000) |