bankr-x402-sdk---project-templates by bankrbot/claude-plugins
npx skills add https://github.com/bankrbot/claude-plugins --skill 'Bankr x402 SDK - Project Templates'使用 x402 微支付的 Bankr SDK 项目目录结构和模板。
| 模板 | 使用场景 | 主要特性 |
|---|---|---|
| bot | 自动化任务 | 轮询循环、调度器、交易执行 |
| web-service | HTTP API | REST 端点、异步处理、Webhook 支持 |
| dashboard | Web 用户界面 | 前端 + 后端、投资组合展示 |
| cli | 命令行工具 | 子命令、交互式提示 |
适用于自动化交易机器人、价格监控器、投资组合再平衡器和计划任务。
{project-name}/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── README.md
├── src/
│ ├── index.ts # 主入口点,包含调度器
│ ├── bankr-client.ts # Bankr SDK 客户端(来自 x402-client-patterns skill)
│ ├── executor.ts # 使用 viem/ethers 执行交易
│ ├── types.ts # TypeScript 接口
│ └── config.ts # 配置加载
└── scripts/
└── run.sh # 便捷脚本
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
import { bankrClient } from "./bankr-client";
import { executeTransaction } from "./executor";
const INTERVAL = 60000; // 1 分钟
async function runBot() {
console.log("Starting Bankr SDK bot...");
while (true) {
try {
const result = await bankrClient.promptAndWait({
prompt: "Check ETH price",
onStatusUpdate: (msg) => console.log("Status:", msg),
});
if (result.status === "completed") {
console.log("Result:", result.response);
// 如果返回了交易,则执行
if (result.transactions?.length) {
for (const tx of result.transactions) {
await executeTransaction(tx);
}
}
}
} catch (error) {
console.error("Error:", error);
}
await new Promise((r) => setTimeout(r, INTERVAL));
}
}
runBot();
适用于为移动应用或集成封装 Bankr SDK 的 HTTP API。
{project-name}/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── README.md
├── src/
│ ├── index.ts # 服务器入口点
│ ├── server.ts # Express/Fastify 服务器设置
│ ├── routes/
│ │ ├── health.ts # 健康检查端点
│ │ ├── swap.ts # 交换端点
│ │ └── portfolio.ts # 投资组合端点
│ ├── bankr-client.ts # Bankr SDK 客户端
│ ├── types.ts # TypeScript 接口
│ └── config.ts # 配置加载
└── scripts/
└── run.sh
{
"dependencies": {
"express": "^4.18.0"
}
}
适用于包含投资组合跟踪、交换界面或监控功能的 Web 用户界面。
{project-name}/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── README.md
├── server/
│ ├── index.ts # 后端服务器
│ ├── bankr-client.ts # Bankr SDK 客户端
│ ├── routes/
│ │ └── api.ts # 前端 API 路由
│ └── types.ts
├── public/
│ ├── index.html # 主 HTML 页面
│ ├── styles.css # 基础样式
│ └── app.js # 前端 JavaScript
└── scripts/
└── run.sh
适用于包含子命令和交互功能的命令行工具。
{project-name}/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── README.md
├── src/
│ ├── index.ts # 使用 commander.js 的 CLI 入口点
│ ├── commands/
│ │ ├── swap.ts # 交换命令
│ │ ├── balance.ts # 余额查询命令
│ │ └── send.ts # 转账命令
│ ├── bankr-client.ts # Bankr SDK 客户端
│ ├── executor.ts # 交易执行
│ └── types.ts
└── scripts/
└── run.sh
{
"dependencies": {
"commander": "^12.0.0"
}
}
import { program } from "commander";
import { swap } from "./commands/swap";
import { balance } from "./commands/balance";
program
.name("bankr-cli")
.description("CLI for Bankr SDK operations")
.version("1.0.0");
program
.command("balance")
.description("Get wallet balances")
.action(balance);
program
.command("swap <amount> <from> <to>")
.description("Swap tokens")
.option("-c, --chain <chain>", "Target chain", "base")
.option("-y, --yes", "Skip confirmation")
.action(swap);
program.parse();
| 需求 | 推荐模板 |
|---|---|
| 自动化重复任务 | bot |
| 移动端/Web 的 HTTP API | web-service |
| 可视化界面 | dashboard |
| 基于终端的工具 | cli |
| 价格警报 | bot |
| 投资组合查看器 | dashboard |
| 快速交易 | cli |
所有模板共享通用文件。加载 x402-client-patterns skill 以获取:
bankr-client.ts - SDK 客户端设置executor.ts - 交易执行package.json - 基础依赖项tsconfig.json - TypeScript 配置.env.example - 环境变量模板.gitignore - 标准忽略文件bun install 或 npm install.env.example 为 .env 并添加 BANKR_PRIVATE_KEYbun dev 或 npm run dev 用于开发bun run build 或 npm run build 用于生产每周安装量
0
代码仓库
GitHub 星标数
70
首次出现时间
1970年1月1日
Directory structures and templates for Bankr SDK projects using x402 micropayments.
| Template | Use Case | Key Features |
|---|---|---|
| bot | Automated tasks | Polling loop, scheduler, transaction execution |
| web-service | HTTP APIs | REST endpoints, async handling, webhook support |
| dashboard | Web UIs | Frontend + backend, portfolio display |
| cli | Command-line tools | Subcommands, interactive prompts |
For automated trading bots, price monitors, portfolio rebalancers, and scheduled tasks.
{project-name}/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── README.md
├── src/
│ ├── index.ts # Main entry point with scheduler
│ ├── bankr-client.ts # Bankr SDK client (from x402-client-patterns skill)
│ ├── executor.ts # Transaction execution with viem/ethers
│ ├── types.ts # TypeScript interfaces
│ └── config.ts # Configuration loading
└── scripts/
└── run.sh # Convenience script
import { bankrClient } from "./bankr-client";
import { executeTransaction } from "./executor";
const INTERVAL = 60000; // 1 minute
async function runBot() {
console.log("Starting Bankr SDK bot...");
while (true) {
try {
const result = await bankrClient.promptAndWait({
prompt: "Check ETH price",
onStatusUpdate: (msg) => console.log("Status:", msg),
});
if (result.status === "completed") {
console.log("Result:", result.response);
// Execute transactions if returned
if (result.transactions?.length) {
for (const tx of result.transactions) {
await executeTransaction(tx);
}
}
}
} catch (error) {
console.error("Error:", error);
}
await new Promise((r) => setTimeout(r, INTERVAL));
}
}
runBot();
For HTTP APIs that wrap Bankr SDK for mobile apps or integrations.
{project-name}/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── README.md
├── src/
│ ├── index.ts # Server entry point
│ ├── server.ts # Express/Fastify server setup
│ ├── routes/
│ │ ├── health.ts # Health check endpoint
│ │ ├── swap.ts # Swap endpoints
│ │ └── portfolio.ts # Portfolio endpoints
│ ├── bankr-client.ts # Bankr SDK client
│ ├── types.ts # TypeScript interfaces
│ └── config.ts # Configuration loading
└── scripts/
└── run.sh
{
"dependencies": {
"express": "^4.18.0"
}
}
For web UIs with portfolio tracking, swap interfaces, or monitoring.
{project-name}/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── README.md
├── server/
│ ├── index.ts # Backend server
│ ├── bankr-client.ts # Bankr SDK client
│ ├── routes/
│ │ └── api.ts # API routes for frontend
│ └── types.ts
├── public/
│ ├── index.html # Main HTML page
│ ├── styles.css # Basic styles
│ └── app.js # Frontend JavaScript
└── scripts/
└── run.sh
For command-line tools with subcommands and interactive features.
{project-name}/
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── README.md
├── src/
│ ├── index.ts # CLI entry with commander.js
│ ├── commands/
│ │ ├── swap.ts # Swap commands
│ │ ├── balance.ts # Balance query commands
│ │ └── send.ts # Transfer commands
│ ├── bankr-client.ts # Bankr SDK client
│ ├── executor.ts # Transaction execution
│ └── types.ts
└── scripts/
└── run.sh
{
"dependencies": {
"commander": "^12.0.0"
}
}
import { program } from "commander";
import { swap } from "./commands/swap";
import { balance } from "./commands/balance";
program
.name("bankr-cli")
.description("CLI for Bankr SDK operations")
.version("1.0.0");
program
.command("balance")
.description("Get wallet balances")
.action(balance);
program
.command("swap <amount> <from> <to>")
.description("Swap tokens")
.option("-c, --chain <chain>", "Target chain", "base")
.option("-y, --yes", "Skip confirmation")
.action(swap);
program.parse();
| Need | Recommended Template |
|---|---|
| Automated recurring tasks | bot |
| HTTP API for mobile/web | web-service |
| Visual interface | dashboard |
| Terminal-based tool | cli |
| Price alerts | bot |
| Portfolio viewer | dashboard |
| Quick trades | cli |
All templates share common files. Load the x402-client-patterns skill for:
bankr-client.ts - SDK client setupexecutor.ts - Transaction executionpackage.json - Base dependenciestsconfig.json - TypeScript config.env.example - Environment template.gitignore - Standard ignoresbun install or npm install.env.example to .env and add BANKR_PRIVATE_KEYbun dev or npm run dev for developmentbun run build or npm run build for productionWeekly Installs
0
Repository
GitHub Stars
70
First Seen
Jan 1, 1970