mcpField
B
Bankr x402 SDK - Wallet Operations

Bankr x402 SDK - Wallet Operations

github.com/bankrbotDevelopment88359 installsUpdated 31w ago
Repository

About Bankr x402 SDK - Wallet Operations

A Bankr SDK skill for configuring BankrClient wallet operations. It explains payment and receiving wallet roles, request methods, and security practices such as separating wallets.

Key features

  1. 01Payment and receiving wallet setup
  2. 02Per-request receiving wallet override
  3. 03Prompt submission and job controls
  4. 04API endpoint and timeout options
  5. 05Wallet security practices

Use cases

  1. 01Configure BankrClient credentials
  2. 02Separate payment and receiving wallets
  3. 03Submit prompts and manage jobs
  4. 04Set a receiving wallet for one request

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bankrbot/claude-plugins --skill bankr-x402-sdk---wallet-operations

After installing, type/bankr-x402-sdk---wallet-operationsin Claude Code to confirm it loaded.

Details

From the project README

SDK Wallet Operations

Initialize and configure the BankrClient with proper wallet setup.

Two-Wallet System

WalletPurposeRequired
Payment (privateKey)Signs x402 micropayments ($0.01/request)Yes
Context (walletAddress)Receives swapped tokens, NFTsNo (defaults to payment wallet)

Basic Setup

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?",
});

Separate Wallets (Recommended)

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

Configuration Options

OptionTypeRequiredDescription
privateKey0x${string}YesPayment wallet private key
walletAddressstringNoOverride receiving wallet
baseUrlstringNoAPI endpoint (default: production)
timeoutnumberNoRequest timeout ms (default: 600000)

SDK Methods

MethodDescription
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

Per-Request Override

// Override wallet for a single request
const result = await client.promptAndWait({
  prompt: "Swap 0.1 ETH to USDC",
  walletAddress: "0xDifferentWallet...",
});

Environment Setup

# Required
BANKR_PRIVATE_KEY=0x...your_payment_wallet_key...

# Optional
BANKR_WALLET_ADDRESS=0x...your_receiving_wallet...

Security Best Practices

  1. Never commit private keys - Use environment variables
  2. Minimize payment wallet balance - Keep only $1-2 USDC
  3. Use separate wallets - Payment (hot) vs receiving (cold)
  4. Rotate keys periodically - If payment wallet compromised

Related Skills

  • sdk-capabilities: Full list of supported operations
  • sdk-job-management: Async job handling and polling

Comments

Markdown supported