bankr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Bankr

Bankr

Execute crypto trading and DeFi operations using natural language. Two integration options:
  1. Bankr CLI (recommended) — Install
    @bankr/cli
    for a batteries-included terminal experience
  2. REST API — Call
    https://api.bankr.bot
    directly from any language or tool
Both use the same API key and the same async job workflow under the hood.
通过自然语言执行加密货币交易与DeFi操作。提供两种集成方式:
  1. Bankr CLI(推荐)—— 安装
    @bankr/cli
    以获得功能完备的终端使用体验
  2. REST API—— 直接从任意语言或工具调用
    https://api.bankr.bot
二者底层使用相同的API密钥与异步任务工作流。

Getting an API Key

获取API密钥

Before using either option, you need a Bankr API key:
  1. Visit bankr.bot/api
  2. Sign up / Sign in — Enter your email and the one-time passcode (OTP) sent to it
  3. Generate an API key — Create a key with Agent API access enabled (the key starts with
    bk_...
    )
Creating a new account automatically provisions EVM wallets (Base, Ethereum, Polygon, Unichain) and a Solana wallet — no manual wallet setup needed.
使用任一方式前,你需要一个Bankr API密钥:
  1. 访问bankr.bot/api
  2. 注册/登录—— 输入你的邮箱及收到的一次性验证码(OTP)
  3. 生成API密钥—— 创建一个启用了Agent API访问权限的密钥(密钥以
    bk_...
    开头)
创建新账户会自动配置EVM钱包(Base、Ethereum、Polygon、Unichain)和Solana钱包——无需手动设置钱包。

Option 1: Bankr CLI (Recommended)

方式1:Bankr CLI(推荐)

Install

安装

bash
bun install -g @bankr/cli
Or with npm:
bash
npm install -g @bankr/cli
bash
bun install -g @bankr/cli
或使用npm:
bash
npm install -g @bankr/cli

First-Time Setup

首次设置

bash
undefined
bash
undefined

Authenticate with Bankr (interactive — opens browser or paste key)

与Bankr进行身份验证(交互式——打开浏览器或粘贴密钥)

bankr login
bankr login

Verify your identity

验证身份

bankr whoami

The `bankr login` command gives you two choices:

**A) Open the Bankr dashboard** — The CLI opens [bankr.bot/api](https://bankr.bot/api) where you generate a key and paste it back.

**B) Paste an existing API key** — Select "Paste an existing Bankr API key" and enter it directly.
bankr whoami

`bankr login`命令提供两种选择:

**A) 打开Bankr控制台**—— CLI会打开[bankr.bot/api](https://bankr.bot/api),你可以在此生成密钥并粘贴回终端。

**B) 粘贴现有API密钥**—— 选择"Paste an existing Bankr API key"并直接输入密钥。

Separate LLM Gateway Key (Optional)

独立LLM网关密钥(可选)

If your LLM gateway key differs from your API key, pass
--llm-key
during login or run
bankr config set llmKey YOUR_LLM_KEY
afterward. When not set, the API key is used for both. See references/llm-gateway.md for full details.
如果你的LLM网关密钥与API密钥不同,可在登录时传递
--llm-key
参数,或之后运行
bankr config set llmKey YOUR_LLM_KEY
。若未设置,将默认使用API密钥同时用于二者。详见references/llm-gateway.md的完整说明。

Non-Interactive Login (for AI agents)

非交互式登录(适用于AI Agent)

If you cannot interact with terminal prompts, use these flags:
If the user needs to create an API key:
  1. Run
    bankr login --url
    — prints the dashboard URL
  2. Present the URL to the user, ask them to generate a
    bk_...
    key
  3. Run
    bankr login --api-key bk_THE_KEY
If the user already has an API key:
bash
bankr login --api-key bk_YOUR_KEY_HERE
若无法与终端提示交互,可使用以下参数:
如果用户需要创建API密钥:
  1. 运行
    bankr login --url
    —— 打印控制台URL
  2. 将URL提供给用户,要求其生成
    bk_...
    格式的密钥
  3. 运行
    bankr login --api-key bk_THE_KEY
如果用户已有API密钥:
bash
bankr login --api-key bk_YOUR_KEY_HERE

Verify Setup

验证设置

bash
bankr whoami
bankr prompt "What is my balance?"
bash
bankr whoami
bankr prompt "What is my balance?"

Option 2: REST API (Direct)

方式2:直接使用REST API

No CLI installation required — call the API directly with
curl
,
fetch
, or any HTTP client.
无需安装CLI——直接使用
curl
fetch
或任意HTTP客户端调用API。

Authentication

身份验证

All requests require an
X-API-Key
header:
bash
curl -X POST "https://api.bankr.bot/agent/prompt" \
  -H "X-API-Key: bk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "What is my ETH balance?"}'
所有请求均需携带
X-API-Key
请求头:
bash
curl -X POST "https://api.bankr.bot/agent/prompt" \
  -H "X-API-Key: bk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "What is my ETH balance?"}'

Quick Example: Submit → Poll → Complete

快速示例:提交→轮询→完成

bash
undefined
bash
undefined

1. Submit a prompt — returns a job ID

1. 提交请求——返回任务ID

JOB=$(curl -s -X POST "https://api.bankr.bot/agent/prompt"
-H "X-API-Key: $BANKR_API_KEY"
-H "Content-Type: application/json"
-d '{"prompt": "What is my ETH balance?"}') JOB_ID=$(echo "$JOB" | jq -r '.jobId')
JOB=$(curl -s -X POST "https://api.bankr.bot/agent/prompt"
-H "X-API-Key: $BANKR_API_KEY"
-H "Content-Type: application/json"
-d '{"prompt": "What is my ETH balance?"}') JOB_ID=$(echo "$JOB" | jq -r '.jobId')

2. Poll until terminal status

2. 轮询直到任务进入终端状态

while true; do RESULT=$(curl -s "https://api.bankr.bot/agent/job/$JOB_ID"
-H "X-API-Key: $BANKR_API_KEY") STATUS=$(echo "$RESULT" | jq -r '.status') [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] || [ "$STATUS" = "cancelled" ] && break sleep 2 done
while true; do RESULT=$(curl -s "https://api.bankr.bot/agent/job/$JOB_ID"
-H "X-API-Key: $BANKR_API_KEY") STATUS=$(echo "$RESULT" | jq -r '.status') [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] || [ "$STATUS" = "cancelled" ] && break sleep 2 done

3. Read the response

3. 读取响应结果

echo "$RESULT" | jq -r '.response'
undefined
echo "$RESULT" | jq -r '.response'
undefined

Conversation Threads

对话线程

Every prompt response includes a
threadId
. Pass it back to continue the conversation:
bash
undefined
每个请求响应都会包含一个
threadId
。将其传回即可继续对话:
bash
undefined

Start — the response includes a threadId

开始对话——响应中包含threadId

curl -X POST "https://api.bankr.bot/agent/prompt"
-H "X-API-Key: $BANKR_API_KEY"
-H "Content-Type: application/json"
-d '{"prompt": "What is the price of ETH?"}'
curl -X POST "https://api.bankr.bot/agent/prompt"
-H "X-API-Key: $BANKR_API_KEY"
-H "Content-Type: application/json"
-d '{"prompt": "What is the price of ETH?"}'

→ {"jobId": "job_abc", "threadId": "thr_XYZ", ...}

→ {"jobId": "job_abc", "threadId": "thr_XYZ", ...}

Continue — pass threadId to maintain context

继续对话——传入threadId以保持上下文

curl -X POST "https://api.bankr.bot/agent/prompt"
-H "X-API-Key: $BANKR_API_KEY"
-H "Content-Type: application/json"
-d '{"prompt": "And what about SOL?", "threadId": "thr_XYZ"}'

Omit `threadId` to start a new conversation. CLI equivalent: `bankr prompt --continue` (reuses last thread) or `bankr prompt --thread <id>`.
curl -X POST "https://api.bankr.bot/agent/prompt"
-H "X-API-Key: $BANKR_API_KEY"
-H "Content-Type: application/json"
-d '{"prompt": "And what about SOL?", "threadId": "thr_XYZ"}'

若不传入`threadId`则会开启新对话。对应的CLI命令为:`bankr prompt --continue`(复用最后一个线程)或`bankr prompt --thread <id>`。

API Endpoints Summary

API端点汇总

EndpointMethodDescription
/agent/prompt
POSTSubmit a prompt (async, returns job ID)
/agent/job/{jobId}
GETCheck job status and results
/agent/job/{jobId}/cancel
POSTCancel a running job
/agent/sign
POSTSign messages/transactions (sync)
/agent/submit
POSTSubmit raw transactions (sync)
For full API details (request/response schemas, job states, rich data, polling strategy), see:
Reference: references/api-workflow.md | references/sign-submit-api.md
端点请求方法描述
/agent/prompt
POST提交请求(异步,返回任务ID)
/agent/job/{jobId}
GET检查任务状态与结果
/agent/job/{jobId}/cancel
POST取消运行中的任务
/agent/sign
POST签署消息/交易(同步)
/agent/submit
POST提交原始交易(同步)
关于API的完整详情(请求/响应 schema、任务状态、富数据、轮询策略),请查看:
参考文档references/api-workflow.md | references/sign-submit-api.md

CLI Command Reference

CLI命令参考

Core Commands

核心命令

CommandDescription
bankr login
Authenticate with the Bankr API (interactive)
bankr login --url
Print dashboard URL for API key generation
bankr login --api-key <key>
Login with an API key directly (non-interactive)
bankr login --api-key <key> --llm-key <key>
Login with separate LLM gateway key
bankr logout
Clear stored credentials
bankr whoami
Show current authentication info
bankr prompt <text>
Send a prompt to the Bankr AI agent
bankr prompt --continue <text>
Continue the most recent conversation thread
bankr prompt --thread <id> <text>
Continue a specific conversation thread
bankr status <jobId>
Check the status of a running job
bankr cancel <jobId>
Cancel a running job
bankr skills
Show all Bankr AI agent skills with examples
命令描述
bankr login
与Bankr API进行身份验证(交互式)
bankr login --url
打印用于生成API密钥的控制台URL
bankr login --api-key <key>
直接使用API密钥登录(非交互式)
bankr login --api-key <key> --llm-key <key>
使用独立的LLM网关密钥登录
bankr logout
清除存储的凭证
bankr whoami
显示当前身份验证信息
bankr prompt <text>
向Bankr AI Agent发送请求
bankr prompt --continue <text>
继续最近的对话线程
bankr prompt --thread <id> <text>
继续指定的对话线程
bankr status <jobId>
检查运行中任务的状态
bankr cancel <jobId>
取消运行中的任务
bankr skills
显示Bankr AI Agent的所有技能及示例

Configuration Commands

配置命令

CommandDescription
bankr config get [key]
Get config value(s)
bankr config set <key> <value>
Set a config value
bankr --config <path> <command>
Use a custom config file path
Valid config keys:
apiKey
,
apiUrl
,
llmKey
,
llmUrl
Default config location:
~/.bankr/config.json
. Override with
--config
or
BANKR_CONFIG
env var.
命令描述
bankr config get [key]
获取配置值
bankr config set <key> <value>
设置配置值
bankr --config <path> <command>
使用自定义配置文件路径
有效的配置键:
apiKey
apiUrl
llmKey
llmUrl
默认配置文件位置:
~/.bankr/config.json
。可通过
--config
参数或
BANKR_CONFIG
环境变量覆盖。

Environment Variables

环境变量

VariableDescription
BANKR_API_KEY
API key (overrides stored key)
BANKR_API_URL
API URL (default:
https://api.bankr.bot
)
BANKR_LLM_KEY
LLM gateway key (falls back to
BANKR_API_KEY
if not set)
BANKR_LLM_URL
LLM gateway URL (default:
https://llm.bankr.bot
)
Environment variables override config file values. Config file values override defaults.
变量描述
BANKR_API_KEY
API密钥(覆盖存储的密钥)
BANKR_API_URL
API地址(默认:
https://api.bankr.bot
BANKR_LLM_KEY
LLM网关密钥(若未设置则回退使用
BANKR_API_KEY
BANKR_LLM_URL
LLM网关地址(默认:
https://llm.bankr.bot
环境变量优先级高于配置文件,配置文件优先级高于默认值。

LLM Gateway Commands

LLM网关命令

CommandDescription
bankr llm models
List available LLM models
bankr llm setup openclaw [--install]
Generate or install OpenClaw config
bankr llm setup opencode [--install]
Generate or install OpenCode config
bankr llm setup claude
Show Claude Code environment setup
bankr llm setup cursor
Show Cursor IDE setup instructions
bankr llm claude [args...]
Launch Claude Code via the Bankr LLM Gateway
命令描述
bankr llm models
列出可用的LLM模型
bankr llm setup openclaw [--install]
生成或安装OpenClaw配置
bankr llm setup opencode [--install]
生成或安装OpenCode配置
bankr llm setup claude
显示Claude Code环境设置说明
bankr llm setup cursor
显示Cursor IDE设置说明
bankr llm claude [args...]
通过Bankr LLM网关启动Claude Code

Core Usage

核心用法

Simple Query

简单查询

For straightforward requests that complete quickly:
bash
bankr prompt "What is my ETH balance?"
bankr prompt "What's the price of Bitcoin?"
The CLI handles the full submit-poll-complete workflow automatically. You can also use the shorthand — any unrecognized command is treated as a prompt:
bash
bankr What is the price of ETH?
适用于快速完成的简单请求:
bash
bankr prompt "What is my ETH balance?"
bankr prompt "What's the price of Bitcoin?"
CLI会自动处理完整的提交-轮询-完成流程。你也可以使用简写——任何未识别的命令都会被视为请求:
bash
bankr What is the price of ETH?

Interactive Prompt

交互式请求

For prompts containing
$
or special characters that the shell would expand:
bash
undefined
对于包含
$
或会被Shell解析的特殊字符的请求:
bash
undefined

Interactive mode — no shell expansion issues

交互模式——无Shell解析问题

bankr prompt
bankr prompt

Then type: Buy $50 of ETH on Base

然后输入:Buy $50 of ETH on Base

Or pipe input

或通过管道输入

echo 'Buy $50 of ETH on Base' | bankr prompt
undefined
echo 'Buy $50 of ETH on Base' | bankr prompt
undefined

Conversation Threads

对话线程

Continue a multi-turn conversation with the agent:
bash
undefined
与Agent进行多轮对话:
bash
undefined

First prompt — starts a new thread automatically

首次请求——自动开启新线程

bankr prompt "What is the price of ETH?"
bankr prompt "What is the price of ETH?"

→ Thread: thr_ABC123

→ 线程:thr_ABC123

Continue the conversation (agent remembers the ETH context)

继续对话(Agent会记住ETH相关上下文)

bankr prompt --continue "And what about BTC?" bankr prompt -c "Compare them"
bankr prompt --continue "And what about BTC?" bankr prompt -c "Compare them"

Resume any thread by ID

通过ID恢复任意线程

bankr prompt --thread thr_ABC123 "Show me ETH chart"

Thread IDs are automatically saved to config after each prompt. The `--continue` / `-c` flag reuses the last thread.
bankr prompt --thread thr_ABC123 "Show me ETH chart"

线程ID会在每次请求后自动保存到配置中。`--continue`/`-c`参数会复用最后一个线程。

Manual Job Control

手动任务控制

For advanced use or long-running operations:
bash
undefined
适用于高级使用场景或长时间运行的操作:
bash
undefined

Submit and get job ID

提交请求并获取任务ID

bankr prompt "Buy $100 of ETH"
bankr prompt "Buy $100 of ETH"

→ Job submitted: job_abc123

→ 任务已提交:job_abc123

Check status of a specific job

检查指定任务的状态

bankr status job_abc123
bankr status job_abc123

Cancel if needed

必要时取消任务

bankr cancel job_abc123
undefined
bankr cancel job_abc123
undefined

LLM Gateway

LLM网关

The Bankr LLM Gateway is a unified API for Claude, Gemini, GPT, and other models — multi-provider access, cost tracking, automatic failover, and SDK compatibility through a single endpoint.
Base URL:
https://llm.bankr.bot
Uses your
llmKey
if configured, otherwise falls back to your API key.
Bankr LLM网关是一个统一API,支持Claude、Gemini、GPT等多种模型——通过单一端点实现多供应商访问、成本追踪、自动故障转移及SDK兼容。
基础地址
https://llm.bankr.bot
若已配置
llmKey
则使用该密钥,否则回退使用API密钥。

Quick Commands

快速命令

bash
bankr llm models                           # List available models
bankr llm credits                          # Check credit balance
bankr llm setup openclaw --install         # Install Bankr provider into OpenClaw
bankr llm setup opencode --install         # Install Bankr provider into OpenCode
bankr llm setup claude                     # Print Claude Code env vars
bankr llm setup cursor                     # Cursor setup instructions
bankr llm claude                           # Launch Claude Code through gateway
bankr llm claude --model claude-opus-4.6   # Launch with specific model
bash
bankr llm models                           # 列出可用模型
bankr llm credits                          # 查看余额
bankr llm setup openclaw --install         # 将Bankr提供者安装到OpenClaw
bankr llm setup opencode --install         # 将Bankr提供者安装到OpenCode
bankr llm setup claude                     # 打印Claude Code环境变量
bankr llm setup cursor                     # Cursor设置说明
bankr llm claude                           # 通过网关启动Claude Code
bankr llm claude --model claude-opus-4.6   # 使用指定模型启动

Direct SDK Usage

直接SDK使用

The gateway works with standard OpenAI and Anthropic SDKs — just override the base URL:
bash
undefined
该网关兼容标准OpenAI和Anthropic SDK——只需覆盖基础地址即可:
bash
undefined

OpenAI-compatible

OpenAI兼容接口

curl -X POST "https://llm.bankr.bot/v1/chat/completions"
-H "Authorization: Bearer $BANKR_LLM_KEY"
-H "Content-Type: application/json"
-d '{"model": "claude-sonnet-4.5", "messages": [{"role": "user", "content": "Hello"}]}'

For full model list, provider config JSON shape, SDK examples (Python, TypeScript), all setup commands, and troubleshooting, see:

**Reference**: [references/llm-gateway.md](references/llm-gateway.md)
curl -X POST "https://llm.bankr.bot/v1/chat/completions"
-H "Authorization: Bearer $BANKR_LLM_KEY"
-H "Content-Type: application/json"
-d '{"model": "claude-sonnet-4.5", "messages": [{"role": "user", "content": "Hello"}]}'

关于完整模型列表、供应商配置JSON格式、SDK示例(Python、TypeScript)、所有设置命令及故障排除,请查看:

**参考文档**:[references/llm-gateway.md](references/llm-gateway.md)

Capabilities Overview

功能概述

Trading Operations

交易操作

  • Token Swaps: Buy/sell/swap tokens across chains
  • Cross-Chain: Bridge tokens between chains
  • Limit Orders: Execute at target prices
  • Stop Loss: Automatic sell protection
  • DCA: Dollar-cost averaging strategies
  • TWAP: Time-weighted average pricing
Reference: references/token-trading.md
  • 代币兑换:跨链买卖/兑换代币
  • 跨链桥接:在链之间转移代币
  • 限价订单:按目标价格执行交易
  • 止损订单:自动卖出保护
  • DCA策略:美元成本平均策略
  • TWAP策略:时间加权平均定价
参考文档references/token-trading.md

Portfolio Management

投资组合管理

  • Check balances across all chains
  • View USD valuations
  • Track holdings by token or chain
  • Real-time price updates
  • Multi-chain aggregation
Reference: references/portfolio.md
  • 查看所有链上的余额
  • 查看美元估值
  • 按代币或链追踪持仓
  • 实时价格更新
  • 多链聚合
参考文档references/portfolio.md

Market Research

市场研究

  • Token prices and market data
  • Technical analysis (RSI, MACD, etc.)
  • Social sentiment analysis
  • Price charts
  • Trending tokens
  • Token comparisons
Reference: references/market-research.md
  • 代币价格与市场数据
  • 技术分析(RSI、MACD等)
  • 社交情绪分析
  • 价格图表
  • 热门代币
  • 代币对比
参考文档references/market-research.md

Transfers

转账

  • Send to addresses, ENS, or social handles
  • Multi-chain support
  • Flexible amount formats
  • Social handle resolution (Twitter, Farcaster, Telegram)
Reference: references/transfers.md
  • 向地址、ENS或社交账号转账
  • 多链支持
  • 灵活的金额格式
  • 社交账号解析(Twitter、Farcaster、Telegram)
参考文档references/transfers.md

NFT Operations

NFT操作

  • Browse and search collections
  • View floor prices and listings
  • Purchase NFTs via OpenSea
  • View your NFT portfolio
  • Transfer NFTs
  • Mint from supported platforms
Reference: references/nft-operations.md
  • 浏览和搜索NFT合集
  • 查看地板价与挂单
  • 通过OpenSea购买NFT
  • 查看你的NFT投资组合
  • 转账NFT
  • 从支持的平台铸造NFT
参考文档references/nft-operations.md

Polymarket Betting

Polymarket投注

  • Search prediction markets
  • Check odds
  • Place bets on outcomes
  • View positions
  • Redeem winnings
Reference: references/polymarket.md
  • 搜索预测市场
  • 查看赔率
  • 对结果下注
  • 查看持仓
  • 提取奖金
参考文档references/polymarket.md

Leverage Trading

杠杆交易

  • Long/short positions (up to 50x crypto, 100x forex/commodities)
  • Crypto, forex, and commodities
  • Stop loss and take profit
  • Position management via Avantis on Base
Reference: references/leverage-trading.md
  • 做多/做空仓位(加密货币最高50倍杠杆,外汇/大宗商品最高100倍)
  • 支持加密货币、外汇和大宗商品
  • 止损与止盈
  • 通过Base上的Avantis管理仓位
参考文档references/leverage-trading.md

Token Deployment

代币部署

  • EVM (Base): Deploy ERC20 tokens via Clanker with customizable metadata and social links
  • Solana: Launch SPL tokens via Raydium LaunchLab with bonding curve and auto-migration to CPMM
  • Creator fee claiming on both chains
  • Fee Key NFTs for Solana (50% LP trading fees post-migration)
  • Optional fee recipient designation with 99.9%/0.1% split (Solana)
  • Both creator AND fee recipient can claim bonding curve fees (gas sponsored)
  • Optional vesting parameters (Solana)
  • Rate limits: 1/day standard, 10/day Bankr Club (gas sponsored within limits)
Reference: references/token-deployment.md
  • EVM(Base):通过Clanker部署ERC20代币,支持自定义元数据和社交链接
  • Solana:通过Raydium LaunchLab发行SPL代币,支持绑定曲线和自动迁移至CPMM
  • 两条链均支持创作者手续费提取
  • Solana链的Fee Key NFT(迁移后可获得50%的LP交易手续费)
  • 可选手续费接收方设置(Solana链支持99.9%/0.1%拆分)
  • 创作者和手续费接收方均可提取绑定曲线手续费(Gas由平台赞助)
  • 可选锁仓参数(Solana链)
  • 速率限制:标准用户1天1次,Bankr Club用户1天10次(Gas在限制内由平台赞助)
参考文档references/token-deployment.md

Automation

自动化

  • Limit orders
  • Stop loss orders
  • DCA (dollar-cost averaging)
  • TWAP (time-weighted average price)
  • Scheduled commands
Reference: references/automation.md
  • 限价订单
  • 止损订单
  • DCA(美元成本平均)
  • TWAP(时间加权平均价格)
  • 定时命令
参考文档references/automation.md

Arbitrary Transactions

自定义交易

  • Submit raw EVM transactions with explicit calldata
  • Custom contract calls to any address
  • Execute pre-built calldata from other tools
  • Value transfers with data
Reference: references/arbitrary-transaction.md
  • 提交包含明确calldata的原始EVM交易
  • 向任意地址发起自定义合约调用
  • 执行其他工具生成的预构建calldata
  • 带数据的价值转移
参考文档references/arbitrary-transaction.md

Supported Chains

支持的区块链

ChainNative TokenBest ForGas Cost
BaseETHMemecoins, general tradingVery Low
PolygonMATICGaming, NFTs, frequent tradesVery Low
EthereumETHBlue chips, high liquidityHigh
SolanaSOLHigh-speed tradingMinimal
UnichainETHNewer L2 optionVery Low
区块链原生代币适用场景手续费
BaseETH迷因币、通用交易极低
PolygonMATIC游戏、NFT、高频交易极低
EthereumETH蓝筹币、高流动性资产
SolanaSOL高速交易极低
UnichainETH新型Layer2选项极低

Common Patterns

常见使用模式

Check Before Trading

交易前检查

bash
undefined
bash
undefined

Check balance

检查余额

bankr prompt "What is my ETH balance on Base?"
bankr prompt "What is my ETH balance on Base?"

Check price

检查价格

bankr prompt "What's the current price of PEPE?"
bankr prompt "What's the current price of PEPE?"

Then trade

进行交易

bankr prompt "Buy $20 of PEPE on Base"
undefined
bankr prompt "Buy $20 of PEPE on Base"
undefined

Portfolio Review

投资组合回顾

bash
undefined
bash
undefined

Full portfolio

完整投资组合

bankr prompt "Show my complete portfolio"
bankr prompt "Show my complete portfolio"

Chain-specific

指定链的持仓

bankr prompt "What tokens do I have on Base?"
bankr prompt "What tokens do I have on Base?"

Token-specific

指定代币的跨链持仓

bankr prompt "Show my ETH across all chains"
undefined
bankr prompt "Show my ETH across all chains"
undefined

Set Up Automation

设置自动化

bash
undefined
bash
undefined

DCA strategy

DCA策略

bankr prompt "DCA $100 into ETH every week"
bankr prompt "DCA $100 into ETH every week"

Stop loss protection

止损保护

bankr prompt "Set stop loss for my ETH at $2,500"
bankr prompt "Set stop loss for my ETH at $2,500"

Limit order

限价订单

bankr prompt "Buy ETH if price drops to $3,000"
undefined
bankr prompt "Buy ETH if price drops to $3,000"
undefined

Market Research

市场研究

bash
undefined
bash
undefined

Price and analysis

价格与分析

bankr prompt "Do technical analysis on ETH"
bankr prompt "Do technical analysis on ETH"

Trending tokens

热门代币

bankr prompt "What tokens are trending on Base?"
bankr prompt "What tokens are trending on Base?"

Compare tokens

代币对比

bankr prompt "Compare ETH vs SOL"
undefined
bankr prompt "Compare ETH vs SOL"
undefined

API Workflow

API工作流

Bankr uses an asynchronous job-based API:
  1. Submit — Send prompt (with optional
    threadId
    ), get job ID and thread ID
  2. Poll — Check status every 2 seconds
  3. Complete — Process results when done
  4. Continue — Reuse
    threadId
    for multi-turn conversations
The
bankr prompt
command handles this automatically. When using the REST API directly, implement the poll loop yourself (see Option 2 above or the reference below). For manual job control via CLI, use
bankr status <jobId>
and
bankr cancel <jobId>
.
For details on the API structure, job states, polling strategy, and error handling, see:
Reference: references/api-workflow.md
Bankr采用异步任务式API:
  1. 提交—— 发送请求(可选携带
    threadId
    ),获取任务ID和线程ID
  2. 轮询—— 每2秒检查一次状态
  3. 完成—— 任务完成后处理结果
  4. 继续—— 复用
    threadId
    进行多轮对话
bankr prompt
命令会自动处理上述流程。直接使用REST API时,需自行实现轮询循环(见方式2或下方参考文档)。通过CLI手动控制任务可使用
bankr status <jobId>
bankr cancel <jobId>
关于API结构、任务状态、轮询策略和错误处理的详情,请查看:
参考文档references/api-workflow.md

Synchronous Endpoints

同步端点

For direct signing and transaction submission, Bankr also provides synchronous endpoints:
  • POST /agent/sign - Sign messages, typed data, or transactions without broadcasting
  • POST /agent/submit - Submit raw transactions directly to the blockchain
These endpoints return immediately (no polling required) and are ideal for:
  • Authentication flows (sign messages)
  • Gasless approvals (sign EIP-712 permits)
  • Pre-built transactions (submit raw calldata)
Reference: references/sign-submit-api.md
对于直接签署和提交交易,Bankr还提供同步端点:
  • POST /agent/sign - 签署消息、类型化数据或交易但不广播
  • POST /agent/submit - 直接向区块链提交原始交易
这些端点会立即返回结果(无需轮询),适用于:
  • 身份验证流程(签署消息)
  • 无Gas授权(签署EIP-712许可)
  • 预构建交易(提交原始calldata)
参考文档references/sign-submit-api.md

Error Handling

错误处理

Common issues and fixes:
  • Authentication errors → Run
    bankr login
    or check
    bankr whoami
    (CLI), or verify your
    X-API-Key
    header (REST API)
  • Insufficient balance → Add funds or reduce amount
  • Token not found → Verify symbol and chain
  • Transaction reverted → Check parameters and balances
  • Rate limiting → Wait and retry
For comprehensive error troubleshooting, setup instructions, and debugging steps, see:
Reference: references/error-handling.md
常见问题及解决方法:
  • 身份验证错误 → 运行
    bankr login
    或检查
    bankr whoami
    (CLI),或验证
    X-API-Key
    请求头(REST API)
  • 余额不足 → 充值或减少交易金额
  • 代币未找到 → 验证代币符号和链
  • 交易回滚 → 检查参数和余额
  • 速率限制 → 等待后重试
关于全面的错误排查、设置说明和调试步骤,请查看:
参考文档references/error-handling.md

Best Practices

最佳实践

Security

安全

  1. Never share your API key
  2. Start with small test amounts
  3. Verify addresses before large transfers
  4. Use stop losses for leverage trading
  5. Double-check transaction details
  1. 切勿分享你的API密钥
  2. 先使用小额测试金额
  3. 大额转账前验证地址
  4. 杠杆交易使用止损
  5. 仔细核对交易详情

Trading

交易

  1. Check balance before trades
  2. Specify chain for lesser-known tokens
  3. Consider gas costs (use Base/Polygon for small amounts)
  4. Start small, scale up after testing
  5. Use limit orders for better prices
  1. 交易前检查余额
  2. 小众代币需指定链
  3. 考虑Gas成本(小额交易使用Base/Polygon)
  4. 从小额交易开始,测试后再扩大规模
  5. 使用限价订单获取更优价格

Automation

自动化

  1. Test automation with small amounts first
  2. Review active orders regularly
  3. Set realistic price targets
  4. Always use stop loss for leverage
  5. Monitor execution and adjust as needed
  1. 先使用小额金额测试自动化策略
  2. 定期查看活跃订单
  3. 设置合理的价格目标
  4. 杠杆交易务必使用止损
  5. 监控执行情况并按需调整

Tips for Success

成功技巧

For New Users

新用户

  • Start with balance checks and price queries
  • Test with $5-10 trades first
  • Use Base for lower fees
  • Enable trading confirmations initially
  • Learn one feature at a time
  • 从余额查询和价格查询开始
  • 先测试5-10美元的交易
  • 使用Base链以降低手续费
  • 初始阶段启用交易确认
  • 逐个学习功能

For Experienced Users

资深用户

  • Leverage automation for strategies
  • Use multiple chains for diversification
  • Combine DCA with stop losses
  • Explore advanced features (leverage, Polymarket)
  • Monitor gas costs across chains
  • 利用自动化执行策略
  • 使用多条链进行多元化配置
  • 结合DCA与止损策略
  • 探索高级功能(杠杆、Polymarket)
  • 监控各链的Gas成本

Prompt Examples by Category

按分类整理的请求示例

Trading

交易

  • "Buy $50 of ETH on Base"
  • "Swap 0.1 ETH for USDC"
  • "Sell 50% of my PEPE"
  • "Bridge 100 USDC from Polygon to Base"
  • "Buy $50 of ETH on Base"
  • "Swap 0.1 ETH for USDC"
  • "Sell 50% of my PEPE"
  • "Bridge 100 USDC from Polygon to Base"

Portfolio

投资组合

  • "Show my portfolio"
  • "What's my ETH balance?"
  • "Total portfolio value"
  • "Holdings on Base"
  • "Show my portfolio"
  • "What's my ETH balance?"
  • "Total portfolio value"
  • "Holdings on Base"

Market Research

市场研究

  • "What's the price of Bitcoin?"
  • "Analyze ETH price"
  • "Trending tokens on Base"
  • "Compare UNI vs SUSHI"
  • "What's the price of Bitcoin?"
  • "Analyze ETH price"
  • "Trending tokens on Base"
  • "Compare UNI vs SUSHI"

Transfers

转账

  • "Send 0.1 ETH to vitalik.eth"
  • "Transfer $20 USDC to @friend"
  • "Send 50 USDC to 0x123..."
  • "Send 0.1 ETH to vitalik.eth"
  • "Transfer $20 USDC to @friend"
  • "Send 50 USDC to 0x123..."

NFTs

NFT

  • "Show Bored Ape floor price"
  • "Buy cheapest Pudgy Penguin"
  • "Show my NFTs"
  • "Show Bored Ape floor price"
  • "Buy cheapest Pudgy Penguin"
  • "Show my NFTs"

Polymarket

Polymarket

  • "What are the odds Trump wins?"
  • "Bet $10 on Yes for [market]"
  • "Show my Polymarket positions"
  • "What are the odds Trump wins?"
  • "Bet $10 on Yes for [market]"
  • "Show my Polymarket positions"

Leverage

杠杆

  • "Open 5x long on ETH with $100"
  • "Short BTC 10x with stop loss at $45k"
  • "Show my Avantis positions"
  • "Open 5x long on ETH with $100"
  • "Short BTC 10x with stop loss at $45k"
  • "Show my Avantis positions"

Automation

自动化

  • "DCA $100 into ETH weekly"
  • "Set limit order to buy ETH at $3,000"
  • "Stop loss for all holdings at -20%"
  • "DCA $100 into ETH weekly"
  • "Set limit order to buy ETH at $3,000"
  • "Stop loss for all holdings at -20%"

Token Deployment

代币部署

Solana (LaunchLab):
  • "Launch a token called MOON on Solana"
  • "Launch a token called FROG and give fees to @0xDeployer"
  • "Deploy SpaceRocket with symbol ROCK"
  • "Launch BRAIN and route fees to 7xKXtg..."
  • "How much fees can I claim for MOON?"
  • "Claim my fees for MOON" (works for creator or fee recipient)
  • "Show my Fee Key NFTs"
  • "Claim my fee NFT for ROCKET" (post-migration)
  • "Transfer fees for MOON to 7xKXtg..."
EVM (Clanker):
  • "Deploy a token called BankrFan with symbol BFAN on Base"
  • "Claim fees for my token MTK"
Solana(LaunchLab)
  • "Launch a token called MOON on Solana"
  • "Launch a token called FROG and give fees to @0xDeployer"
  • "Deploy SpaceRocket with symbol ROCK"
  • "Launch BRAIN and route fees to 7xKXtg..."
  • "How much fees can I claim for MOON?"
  • "Claim my fees for MOON"(创作者和手续费接收方均可使用)
  • "Show my Fee Key NFTs"
  • "Claim my fee NFT for ROCKET"(迁移后)
  • "Transfer fees for MOON to 7xKXtg..."
EVM(Clanker)
  • "Deploy a token called BankrFan with symbol BFAN on Base"
  • "Claim fees for my token MTK"

Arbitrary Transactions

自定义交易

  • "Submit this transaction: {to: 0x..., data: 0x..., value: 0, chainId: 8453}"
  • "Execute this calldata on Base: {...}"
  • "Send raw transaction with this JSON: {...}"
  • "Submit this transaction: {to: 0x..., data: 0x..., value: 0, chainId: 8453}"
  • "Execute this calldata on Base: {...}"
  • "Send raw transaction with this JSON: {...}"

Sign API (Synchronous)

Sign API(同步)

Direct message signing without AI processing:
bash
undefined
无需AI处理的直接消息签署:
bash
undefined

Sign a plain text message

签署纯文本消息

curl -X POST "https://api.bankr.bot/agent/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "personal_sign", "message": "Hello, Bankr!"}'
curl -X POST "https://api.bankr.bot/agent/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "personal_sign", "message": "Hello, Bankr!"}'

Sign EIP-712 typed data (permits, orders)

签署EIP-712类型化数据(许可、订单)

curl -X POST "https://api.bankr.bot/agent/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "eth_signTypedData_v4", "typedData": {...}}'
curl -X POST "https://api.bankr.bot/agent/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "eth_signTypedData_v4", "typedData": {...}}'

Sign a transaction without broadcasting

签署交易但不广播

curl -X POST "https://api.bankr.bot/agent/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "eth_signTransaction", "transaction": {"to": "0x...", "chainId": 8453}}'
undefined
curl -X POST "https://api.bankr.bot/agent/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "eth_signTransaction", "transaction": {"to": "0x...", "chainId": 8453}}'
undefined

Submit API (Synchronous)

Submit API(同步)

Direct transaction submission without AI processing:
bash
undefined
无需AI处理的直接交易提交:
bash
undefined

Submit a raw transaction

提交原始交易

curl -X POST "https://api.bankr.bot/agent/submit"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{ "transaction": {"to": "0x...", "chainId": 8453, "value": "1000000000000000000"}, "waitForConfirmation": true }'

**Reference**: [references/sign-submit-api.md](references/sign-submit-api.md)
curl -X POST "https://api.bankr.bot/agent/submit"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{ "transaction": {"to": "0x...", "chainId": 8453, "value": "1000000000000000000"}, "waitForConfirmation": true }'

**参考文档**:[references/sign-submit-api.md](references/sign-submit-api.md)

Resources

资源

Troubleshooting

故障排除

CLI Not Found

CLI未找到

bash
undefined
bash
undefined

Verify installation

验证安装

which bankr
which bankr

Reinstall if needed

必要时重新安装

bun install -g @bankr/cli
undefined
bun install -g @bankr/cli
undefined

Authentication Issues

身份验证问题

CLI:
bash
undefined
CLI:
bash
undefined

Check current auth

检查当前身份验证状态

bankr whoami
bankr whoami

Re-authenticate

重新验证

bankr login
bankr login

Check LLM key specifically

单独检查LLM密钥

bankr config get llmKey

**REST API:**
```bash
bankr config get llmKey

**REST API:**
```bash

Test your API key

测试API密钥

curl -s "https://api.bankr.bot/_health" -H "X-API-Key: $BANKR_API_KEY"
undefined
curl -s "https://api.bankr.bot/_health" -H "X-API-Key: $BANKR_API_KEY"
undefined

API Errors

API错误

See references/error-handling.md for comprehensive troubleshooting.
请查看references/error-handling.md获取全面的故障排查、设置说明和调试步骤。

Getting Help

获取帮助

  1. Check error message in CLI output or API response
  2. Run
    bankr whoami
    to verify auth (CLI) or test with a curl to
    /_health
    (REST API)
  3. Consult relevant reference document
  4. Test with simple queries first (
    bankr prompt "What is my balance?"
    or
    POST /agent/prompt
    )

Pro Tip: The most common issue is not specifying the chain for tokens. When in doubt, always include "on Base" or "on Ethereum" in your prompt.
Security: Keep your API key private. Never commit your config file to version control. Only trade amounts you can afford to lose.
Quick Win: Start by checking your portfolio (
bankr prompt "Show my portfolio"
) to see what's possible, then try a small $5-10 trade on Base to get familiar with the flow.
  1. 查看CLI输出或API响应中的错误消息
  2. 运行
    bankr whoami
    验证身份(CLI)或通过curl调用
    /_health
    测试(REST API)
  3. 查阅相关参考文档
  4. 先测试简单请求(
    bankr prompt "What is my balance?"
    POST /agent/prompt

专业提示:最常见的问题是未为小众代币指定链。如有疑问,请求中务必包含“on Base”或“on Ethereum”。
安全提示:请妥善保管你的API密钥。切勿将配置文件提交到版本控制。仅交易你能承受损失的金额。
快速上手:先从查看投资组合开始(
bankr prompt "Show my portfolio"
)了解可用功能,然后在Base链上尝试5-10美元的小额交易熟悉流程。