BOU Wallet
Use direct HTTP requests with curl. Prefer this skill when the task is to operate this backend through an existing agent bearer key instead of building a separate SDK or CLI first.
First-time setup after install
If the user has installed this skill but does not have an agent API key yet, walk them through this setup first:
- 1. Open INLINECODE1
- Sign in, then create an agent in the app
- Generate the agent API key, then copy it and use it as
AGENT_KEY in requests
If the user has not completed these steps yet, do not pretend the skill can run successfully. First help them obtain a valid ak_... key.
Required inputs
Collect these values before making any request:
- -
BASE_URL: use https://api.bankofuniverse.org/ unless the user explicitly gives a different backend - INLINECODE6 : bearer token in
ak_... format
Treat the agent key as secret. Do not print, commit, or store it in repo files.
Common request pattern
Use the same bearer auth for all three capability groups.
CODEBLOCK0
For JSON request bodies, also add:
CODEBLOCK1
Most responses use the shared wrapper:
CODEBLOCK2
Capability 1: x402 pay-and-call
Use POST /agent/pay-and-call when the agent needs to access an x402-protected upstream URL through this backend. Call this backend endpoint, not the merchant directly.
Body shape:
CODEBLOCK3
Rules:
- - Send a full upstream
http:// or https:// URL in INLINECODE11 - Use the upstream HTTP verb in INLINECODE12
- Pass merchant headers as a JSON object when needed
- Pass
body only when the upstream endpoint expects one - The backend enforces agent status and USDC payment limits before paying
- The backend rejects requests when the required payment is
>= 0.1 USDC
Example:
CODEBLOCK4
x402 test cases
Use these upstream URLs to quickly test the pay-and-call flow.
Test case 1: random number
Upstream endpoint:
Expected response body:
CODEBLOCK5
Example:
CODEBLOCK6
Test case 2: crypto price
Upstream endpoint:
Supported symbols:
- - INLINECODE18
- INLINECODE19
- INLINECODE20
- INLINECODE21
- INLINECODE22
- INLINECODE23
Expected response body:
CODEBLOCK7
Example:
CODEBLOCK8
Capability 2: current agent info
Use GET /agent/me to inspect the current agent resolved by the bearer key.
This endpoint returns the resolved agent, matched API key metadata, cumulative spent USDC, and a best-effort Base USDC balance lookup.
Example:
CODEBLOCK9
Capability 3: Hyperliquid operations
Use the /hyperliquid endpoints when the agent needs to inspect or trade through the backend's Hyperliquid integration. All requests use the same bearer auth pattern.
Read endpoints
Purpose: verify the current agent is authorized to use Hyperliquid for the resolved account.
Key return fields:
address is the resolved Hyperliquid account address. In agent mode, the response may also include signer-related identity information returned by the backend.
Use it when: you want to confirm the bearer key is valid and Hyperliquid access is ready before reading balances or sending orders.
Purpose: fetch the latest account balance snapshot from Hyperliquid.
Key return fields:
data contains the balance payload returned by Hyperliquid for the resolved account, including available funds and account balance details.
Use it when: you need to check available funds before trading, transferring, or withdrawing.
Purpose: list current open orders, optionally filtered by one symbol.
Key return fields: each item is normalized to include readable
coin,
side, and
marketType; the rest of the item is the underlying open-order data.
Use it when: you want to inspect working orders before canceling or placing another order.
Purpose: list supported spot or perp markets.
Key return fields: spot markets include fields such as
coin,
pairId,
base,
quote,
szDecimals,
weiDecimals, and
marketType; perp markets include fields such as
coin,
base,
quote,
dexName,
maxLeverage,
szDecimals,
onlyIsolated,
marginMode, and
marketType.
Use it when: you need to discover valid symbols, decimals, supported dex markets, or leverage-related metadata before trading.
Purpose: inspect the current account trading state for one perp coin.
Key return fields:
coin,
leverage,
isCross,
leverageType,
maxTradeSzs,
availableToTrade, and
markPx.
maxTradeSzs and
availableToTrade are two-element arrays: index
0 is the
BUY value and index
1 is the
SELL value.
Use it when: you need the current leverage mode, tradeable size, or mark price for a perp coin before placing or sizing an order.
Purpose: fetch current and next funding information for one perp market.
Key return fields:
coin,
fundingRate,
nextFundingRate,
nextFundingTimestamp,
markPrice, and
indexPrice.
Use it when: you want to evaluate funding cost, expected next funding, or compare mark price with oracle/index price.
Purpose: fetch the live L2 order book for one market.
Key return fields:
data is the raw Hyperliquid order book snapshot, including bid and ask levels plus the snapshot time.
Use it when: you need market depth, best bid/ask context, or raw book levels for quoting and execution logic.
Purpose: list current perp positions across available dex contexts for the account.
Key return fields: each position includes
dexName,
marketType,
coin,
szi,
leverage,
isCross,
leverageType,
entryPx,
positionValue,
unrealizedPnl,
returnOnEquity,
liquidationPx,
marginUsed,
maxLeverage, and
cumFunding.
Use it when: you want a full view of current exposure, PnL, liquidation risk, and leverage usage.
Purpose: list historical fills for the account, optionally filtered by symbol, start time, and result count.
Key return fields: each fill is normalized to include readable
coin,
side, and
marketType; the rest of the fill fields come from Hyperliquid's fill history.
Use it when: you want recent execution history for trade reconciliation, reporting, or strategy logic.
Purpose: fetch a compact ticker-style market snapshot for one symbol.
Key return fields:
coin,
marketType,
last,
bid,
ask,
open,
close,
change,
percentage,
volume,
quoteVolume, and
timestamp.
Use it when: you need a lightweight summary of current price, spread, daily move, and volume without reading the full order book.
Query rules:
- -
marketType: perp or INLINECODE109 - INLINECODE110 : short asset symbol such as
BTC or INLINECODE112 - INLINECODE113 for fills:
1 to INLINECODE115 - INLINECODE116 for orderbook:
2, 3, 4, or INLINECODE120 - INLINECODE121 for orderbook:
2 or INLINECODE123
Write endpoints
- - INLINECODE124
- INLINECODE125
- INLINECODE126
- INLINECODE127
- INLINECODE128
- INLINECODE129
Place order
Request body:
CODEBLOCK10
Field rules:
- -
orderType: market, limit, stop_limit, stop_market, or INLINECODE135 - INLINECODE136 :
BUY or INLINECODE138 - INLINECODE139 : numeric string
- INLINECODE140 : optional in the DTO, but required for limit-style orders such as
limit and INLINECODE142 - INLINECODE143 : optional in the DTO, but use it for stop orders such as
stop_limit and INLINECODE145 - INLINECODE146 and
slPrice: optional take-profit and stop-loss values - INLINECODE148 :
Gtc, Ioc, or INLINECODE151 - INLINECODE152 : optional in the DTO, min
5, max 1440; use it for TWAP-style flows when required by the backend logic - INLINECODE155 : optional boolean for TWAP-style flows
Example:
CODEBLOCK11
Cancel selected orders
Request body:
CODEBLOCK12
Field rules:
- -
orders: required array with at most 100 items - INLINECODE158 : required string for each item
- INLINECODE159 : required integer for each item, minimum INLINECODE160
Cancel all orders
Request body:
CODEBLOCK13
Omit coin to cancel all open orders across supported assets.
Set leverage
Request body:
CODEBLOCK14
Transfer asset
Request body:
CODEBLOCK15
Field rules:
- -
amount: required numeric string - INLINECODE163 : optional dex name string; omit it to use the primary dex.
- INLINECODE164 : optional boolean,
true means transfer from perp side
Withdraw asset
Use this endpoint to withdraw Perps USDC to the Arbitrum network.
Request body:
CODEBLOCK16
Field rules:
- -
destination: required EVM address - INLINECODE167 : required numeric string
Execution checklist
Before running requests:
- - Verify
BASE_URL is correct - Verify the token looks like INLINECODE169
- Verify JSON is valid
- Verify Hyperliquid enum values match the accepted casing exactly
- Prefer the two built-in x402 test cases above when validating a new agent key
- Use
-i when you need status codes or headers for debugging
If a request fails, inspect the wrapped JSON message plus the HTTP status first.
BOU 钱包
使用 curl 直接发送 HTTP 请求。当任务需要通过现有的代理持有者密钥操作此后端,而不是先构建单独的 SDK 或 CLI 时,优先使用此技能。
安装后的首次设置
如果用户已安装此技能但尚未获得代理 API 密钥,请先引导他们完成以下设置:
- 1. 打开 https://app.bankofuniverse.org/
- 登录,然后在应用中创建一个代理
- 生成代理 API 密钥,复制后将其作为请求中的 AGENT_KEY 使用
如果用户尚未完成这些步骤,请不要假装该技能可以成功运行。首先帮助他们获取一个有效的 ak_... 格式的密钥。
必需的输入参数
在发起任何请求前,请先收集以下值:
- - BASEURL:使用 https://api.bankofuniverse.org/,除非用户明确指定了不同的后端地址
- AGENTKEY:格式为 ak_... 的持有者令牌
将代理密钥视为机密信息。不要打印、提交或将其存储在仓库文件中。
通用请求模式
所有三个能力组均使用相同的持有者认证方式。
sh
curl -sS $BASE_URL/... \
-H Authorization: Bearer $AGENT_KEY \
-H Accept: application/json
对于 JSON 请求体,还需添加:
sh
-H Content-Type: application/json
大多数响应使用统一的包装格式:
json
{
code: 0,
message: ,
data: {}
}
能力 1:x402 支付并调用
当代理需要通过此后端访问受 x402 保护的上游 URL 时,使用 POST /agent/pay-and-call。调用此后端端点,而非直接调用商户。
请求体格式:
json
{
url: https://merchant.example.com/path,
method: GET,
headers: {
X-Custom-Header: value
},
body: {
query: ETH 价格
}
}
规则:
- - 在 url 中发送完整的 http:// 或 https:// 上游 URL
- 在 method 中使用上游的 HTTP 动词
- 需要时以 JSON 对象形式传递商户头部信息
- 仅当上游端点期望请求体时才传递 body
- 后端在支付前会强制检查代理状态和 USDC 支付限额
- 当所需支付金额 >= 0.1 USDC 时,后端会拒绝请求
示例:
sh
curl -sS -X POST $BASE_URL/agent/pay-and-call \
-H Authorization: Bearer $AGENT_KEY \
-H Content-Type: application/json \
-d {
url: https://api.example.com/search,
method: POST,
body: {
query: BTC
}
}
x402 测试用例
使用以下上游 URL 快速测试 pay-and-call 流程。
测试用例 1:随机数
上游端点:
- - GET /cos/crypto/chainlink/random
预期响应体:
json
{
number: 42
}
示例:
sh
curl -sS -X POST https://api.bankofuniverse.org/agent/pay-and-call \
-H Authorization: Bearer $AGENT_KEY \
-H Content-Type: application/json \
-d {
url: https://skills.bankofuniverse.org/cos/crypto/chainlink/random,
method: GET
}
测试用例 2:加密货币价格
上游端点:
- - GET /cos/crypto/price/:symbol
支持的币种:
预期响应体:
json
{
symbol: BTC,
supportedSymbols: [ETH, BTC, USDC, USDT, TRX, BNB],
price: 84000.12,
timestamp: 1710000000000
}
示例:
sh
curl -sS -X POST https://api.bankofuniverse.org/agent/pay-and-call \
-H Authorization: Bearer $AGENT_KEY \
-H Content-Type: application/json \
-d {
url: https://skills.bankofuniverse.org/cos/crypto/price/BTC,
method: GET
}
能力 2:当前代理信息
使用 GET /agent/me 查看通过持有者密钥解析的当前代理信息。
此端点返回已解析的代理、匹配的 API 密钥元数据、累计花费的 USDC,以及尽力而为的 Base USDC 余额查询。
示例:
sh
curl -sS $BASE_URL/agent/me \
-H Authorization: Bearer $AGENT_KEY
能力 3:Hyperliquid 操作
当代理需要通过后端的 Hyperliquid 集成进行查询或交易时,使用 /hyperliquid 端点。所有请求均使用相同的持有者认证模式。
查询端点
- - GET /hyperliquid/status
用途:验证当前代理是否有权限为已解析的账户使用 Hyperliquid。
关键返回字段:address 是已解析的 Hyperliquid 账户地址。在代理模式下,响应还可能包含后端返回的与签名者相关的身份信息。
使用场景:在读取余额或发送订单前,确认持有者密钥有效且 Hyperliquid 访问已就绪。
- - GET /hyperliquid/balances
用途:从 Hyperliquid 获取最新的账户余额快照。
关键返回字段:data 包含 Hyperliquid 为已解析账户返回的余额数据,包括可用资金和账户余额详情。
使用场景:在交易、转账或提现前检查可用资金。
- - GET /hyperliquid/open-orders?coin=BTC
用途:列出当前未成交订单,可选按单个币种过滤。
关键返回字段:每个条目已标准化,包含可读的 coin、side 和 marketType;其余部分为底层的未成交订单数据。
使用场景:在取消或下达新订单前检查当前挂单。
- - GET /hyperliquid/markets?marketType=perp
用途:列出支持的现货或永续合约市场。
关键返回字段:现货市场包含 coin、pairId、base、quote、szDecimals、weiDecimals 和 marketType 等字段;永续合约市场包含 coin、base、quote、dexName、maxLeverage、szDecimals、onlyIsolated、marginMode 和 marketType 等字段。
使用场景:在交易前需要发现有效的币种、小数位、支持的 DEX 市场或杠杆相关元数据。
- - GET /hyperliquid/active-asset-data?coin=BTC
用途:查看当前账户对某个永续合约币种的交易状态。
关键返回字段:coin、leverage、isCross、leverageType、maxTradeSzs、availableToTrade 和 markPx。
maxTradeSzs 和 availableToTrade 是包含两个元素的数组:索引 0 为 BUY 值,索引 1 为 SELL 值。
使用场景:在下单或确定订单规模前,需要了解当前杠杆模式、可交易数量或永续合约币种的标记价格。
- - GET /hyperliquid/funding?coin=BTC
用途:获取某个永续合约市场当前和下一次的资金费率信息。
关键返回字段:coin、fundingRate、nextFundingRate、nextFundingTimestamp、markPrice 和 indexPrice。
使用场景:评估资金成本、预期下一次资金费率,或比较标记价格与预言机/指数价格。
- - GET /hyperliquid/orderbook?coin=BTC
用途:获取某个市场的实时 L2 订单簿。
关键返回字段:data 是原始的 Hyperliquid 订单簿快照,包括买卖盘口层级及快照时间。
使用场景:需要市场深度、最佳买卖报价或用于报价和执行逻辑的原始盘口层级。
- - GET /hyperliquid/positions
用途:列出账户在所有可用 DEX 上下文中的当前永续合约持仓。
关键返回字段:每个持仓包含 dexName、marketType、coin、szi、leverage、isCross、leverageType、entryPx、positionValue、unrealizedPnl、returnOnEquity、