settings
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSettings Skill
设置Skill
Manages configuration stored at . Controls the Hiro API key used for authenticated Stacks API requests, the custom Stacks API node URL, and provides version information.
~/.aibtc/config.json管理存储在中的配置。控制用于Stacks API认证请求的Hiro API密钥、自定义Stacks API节点URL,并提供版本信息。
~/.aibtc/config.jsonUsage
使用方法
bun run settings/settings.ts <subcommand> [options]bun run settings/settings.ts <subcommand> [options]Subcommands
子命令
set-hiro-api-key
set-hiro-api-key
Save a Hiro API key to . Authenticated requests receive higher rate limits than public (unauthenticated) requests.
~/.aibtc/config.jsonGet a free API key at https://platform.hiro.so/
bun run settings/settings.ts set-hiro-api-key --api-key <key>Options:
- (required) — Your Hiro API key (sensitive value)
--api-key
Output:
json
{
"success": true,
"message": "Hiro API key saved. All subsequent Hiro API requests will use this key.",
"maskedKey": "abcd...wxyz",
"storedIn": "~/.aibtc/config.json"
}将Hiro API密钥保存到中。认证请求比公开(未认证)请求享有更高的速率限制。
~/.aibtc/config.jsonbun run settings/settings.ts set-hiro-api-key --api-key <key>选项:
- (必填)—— 你的Hiro API密钥(敏感值)
--api-key
输出:
json
{
"success": true,
"message": "Hiro API key saved. All subsequent Hiro API requests will use this key.",
"maskedKey": "abcd...wxyz",
"storedIn": "~/.aibtc/config.json"
}get-hiro-api-key
get-hiro-api-key
Check whether a Hiro API key is configured. Shows the key source and a masked preview.
bun run settings/settings.ts get-hiro-api-keyOutput (key configured):
json
{
"configured": true,
"source": "~/.aibtc/config.json",
"maskedKey": "abcd...wxyz",
"hint": "API key is active. Hiro API requests use authenticated rate limits."
}Output (no key):
json
{
"configured": false,
"source": "none",
"maskedKey": "(not set)",
"hint": "No API key configured. Using public rate limits. Get a key at https://platform.hiro.so/"
}检查是否已配置Hiro API密钥。显示密钥来源和掩码预览。
bun run settings/settings.ts get-hiro-api-key输出(已配置密钥):
json
{
"configured": true,
"source": "~/.aibtc/config.json",
"maskedKey": "abcd...wxyz",
"hint": "API key is active. Hiro API requests use authenticated rate limits."
}输出(无密钥):
json
{
"configured": false,
"source": "none",
"maskedKey": "(not set)",
"hint": "No API key configured. Using public rate limits. Get a key at https://platform.hiro.so/"
}delete-hiro-api-key
delete-hiro-api-key
Remove the stored Hiro API key from . If is set in the environment, that will still be used as a fallback.
~/.aibtc/config.jsonHIRO_API_KEYbun run settings/settings.ts delete-hiro-api-keyOutput:
json
{
"success": true,
"message": "Hiro API key removed from ~/.aibtc/config.json.",
"envFallbackActive": false,
"hint": "No API key configured. Requests will use public rate limits."
}从中删除存储的Hiro API密钥。如果环境中设置了,仍会将其作为回退选项使用。
~/.aibtc/config.jsonHIRO_API_KEYbun run settings/settings.ts delete-hiro-api-key输出:
json
{
"success": true,
"message": "Hiro API key removed from ~/.aibtc/config.json.",
"envFallbackActive": false,
"hint": "No API key configured. Requests will use public rate limits."
}set-stacks-api-url
set-stacks-api-url
Point all Stacks API requests at a custom node instead of the default Hiro API. The URL must serve the same and endpoints as .
/v2//extended/v1/api.hiro.sobun run settings/settings.ts set-stacks-api-url --url <url>Options:
- (required) — Base URL of your Stacks API node (e.g.
--url)http://localhost:3999
Output:
json
{
"success": true,
"message": "Custom Stacks API URL saved. All subsequent Stacks API requests will use this node.",
"url": "http://localhost:3999",
"storedIn": "~/.aibtc/config.json",
"tip": "Use get-stacks-api-url to verify, or delete-stacks-api-url to revert to the default."
}将所有Stacks API请求指向自定义节点,而非默认的Hiro API。该URL必须提供与相同的和端点。
api.hiro.so/v2//extended/v1/bun run settings/settings.ts set-stacks-api-url --url <url>选项:
- (必填)—— 你的Stacks API节点基础URL(例如
--url)http://localhost:3999
输出:
json
{
"success": true,
"message": "Custom Stacks API URL saved. All subsequent Stacks API requests will use this node.",
"url": "http://localhost:3999",
"storedIn": "~/.aibtc/config.json",
"tip": "Use get-stacks-api-url to verify, or delete-stacks-api-url to revert to the default."
}get-stacks-api-url
get-stacks-api-url
Show the current Stacks API URL being used. Indicates whether it is a custom node or the default Hiro API.
bun run settings/settings.ts get-stacks-api-urlOutput (custom URL):
json
{
"activeUrl": "http://localhost:3999",
"isCustom": true,
"source": "~/.aibtc/config.json",
"defaultUrl": "https://api.testnet.hiro.so",
"network": "testnet",
"hint": "Using custom Stacks API node."
}Output (default):
json
{
"activeUrl": "https://api.testnet.hiro.so",
"isCustom": false,
"source": "default (Hiro API)",
"defaultUrl": "https://api.testnet.hiro.so",
"network": "testnet",
"hint": "Using default Hiro API. Use set-stacks-api-url to point to your own node."
}显示当前正在使用的Stacks API URL。指示其是自定义节点还是默认的Hiro API。
bun run settings/settings.ts get-stacks-api-url输出(自定义URL):
json
{
"activeUrl": "http://localhost:3999",
"isCustom": true,
"source": "~/.aibtc/config.json",
"defaultUrl": "https://api.testnet.hiro.so",
"network": "testnet",
"hint": "Using custom Stacks API node."
}输出(默认值):
json
{
"activeUrl": "https://api.testnet.hiro.so",
"isCustom": false,
"source": "default (Hiro API)",
"defaultUrl": "https://api.testnet.hiro.so",
"network": "testnet",
"hint": "Using default Hiro API. Use set-stacks-api-url to point to your own node."
}delete-stacks-api-url
delete-stacks-api-url
Remove the custom Stacks API URL and revert to the default Hiro API ( or ).
api.mainnet.hiro.soapi.testnet.hiro.sobun run settings/settings.ts delete-stacks-api-urlOutput:
json
{
"success": true,
"message": "Custom Stacks API URL removed. Reverted to default: https://api.testnet.hiro.so",
"activeUrl": "https://api.testnet.hiro.so",
"network": "testnet"
}删除自定义Stacks API URL,恢复为默认的Hiro API(或)。
api.mainnet.hiro.soapi.testnet.hiro.sobun run settings/settings.ts delete-stacks-api-url输出:
json
{
"success": true,
"message": "Custom Stacks API URL removed. Reverted to default: https://api.testnet.hiro.so",
"activeUrl": "https://api.testnet.hiro.so",
"network": "testnet"
}get-server-version
get-server-version
Check the currently installed package version and compare with the latest published version on npm.
bun run settings/settings.ts get-server-versionOutput:
json
{
"currentVersion": "0.1.0",
"latestVersion": "0.1.0",
"isLatest": true,
"updateAvailable": false,
"package": "@aibtc/skills"
}检查当前安装的包版本,并与npm上发布的最新版本进行比较。
bun run settings/settings.ts get-server-version输出:
json
{
"currentVersion": "0.1.0",
"latestVersion": "0.1.0",
"isLatest": true,
"updateAvailable": false,
"package": "@aibtc/skills"
}check-relay-health
check-relay-health
Check the health of the x402 sponsor relay and the sponsor address nonce status on-chain. Reports relay reachability, version, sponsor nonce gaps, and mempool congestion.
bun run settings/settings.ts check-relay-health [--relay-url <url>] [--sponsor-address <address>]Options:
- (optional) — Base URL of the sponsor relay (default:
--relay-url)https://sponsor.aibtc.dev - (optional) — STX address of the relay sponsor (default:
--sponsor-address)SP1PMPPVCMVW96FSWFV30KJQ4MNBMZ8MRWR3JWQ7
Output (healthy):
json
{
"healthy": true,
"relay": {
"url": "https://sponsor.aibtc.dev",
"reachable": true,
"status": "ok",
"version": "1.0.0"
},
"sponsor": {
"address": "SP1PMPPVCMVW96FSWFV30KJQ4MNBMZ8MRWR3JWQ7",
"lastExecutedNonce": 732,
"possibleNextNonce": 733,
"lastMempoolNonce": null,
"mempoolCount": 0,
"missingNonces": []
},
"issues": [],
"hint": "Relay and sponsor are operating normally."
}Output (issues detected):
json
{
"healthy": false,
"relay": { "url": "https://sponsor.aibtc.dev", "reachable": false, "error": "fetch failed" },
"sponsor": {
"address": "SP1PMPPVCMVW96FSWFV30KJQ4MNBMZ8MRWR3JWQ7",
"lastExecutedNonce": 732,
"possibleNextNonce": 733,
"lastMempoolNonce": null,
"mempoolCount": 0,
"missingNonces": [730]
},
"issues": [
"Relay unreachable: fetch failed",
"Nonce gaps detected: [730]. Transactions may be stuck. The sponsor may need to fill missing nonces."
],
"hint": "Issues detected — see the issues array for details."
}检查x402赞助中继的健康状态以及链上赞助地址的随机数状态。报告中继可达性、版本、赞助随机数缺口和内存池拥堵情况。
bun run settings/settings.ts check-relay-health [--relay-url <url>] [--sponsor-address <address>]选项:
- (可选)—— 赞助中继的基础URL(默认值:
--relay-url)https://sponsor.aibtc.dev - (可选)—— 中继赞助者的STX地址(默认值:
--sponsor-address)SP1PMPPVCMVW96FSWFV30KJQ4MNBMZ8MRWR3JWQ7
输出(健康状态):
json
{
"healthy": true,
"relay": {
"url": "https://sponsor.aibtc.dev",
"reachable": true,
"status": "ok",
"version": "1.0.0"
},
"sponsor": {
"address": "SP1PMPPVCMVW96FSWFV30KJQ4MNBMZ8MRWR3JWQ7",
"lastExecutedNonce": 732,
"possibleNextNonce": 733,
"lastMempoolNonce": null,
"mempoolCount": 0,
"missingNonces": []
},
"issues": [],
"hint": "Relay and sponsor are operating normally."
}输出(检测到问题):
json
{
"healthy": false,
"relay": { "url": "https://sponsor.aibtc.dev", "reachable": false, "error": "fetch failed" },
"sponsor": {
"address": "SP1PMPPVCMVW96FSWFV30KJQ4MNBMZ8MRWR3JWQ7",
"lastExecutedNonce": 732,
"possibleNextNonce": 733,
"lastMempoolNonce": null,
"mempoolCount": 0,
"missingNonces": [730]
},
"issues": [
"Relay unreachable: fetch failed",
"Nonce gaps detected: [730]. Transactions may be stuck. The sponsor may need to fill missing nonces."
],
"hint": "Issues detected — see the issues array for details."
}Configuration File
配置文件
All settings are stored in . This file is created automatically on first use by any wallet or settings subcommand.
~/.aibtc/config.jsonjson
{
"version": 1,
"activeWalletId": null,
"autoLockTimeout": 15,
"hiroApiKey": "your-key-here",
"stacksApiUrl": "http://localhost:3999"
}所有设置都存储在中。该文件会在任何钱包或设置子命令首次使用时自动创建。
~/.aibtc/config.jsonjson
{
"version": 1,
"activeWalletId": null,
"autoLockTimeout": 15,
"hiroApiKey": "your-key-here",
"stacksApiUrl": "http://localhost:3999"
}Environment Variable Fallbacks
环境变量回退
- — Used if no stored key is set in config
HIRO_API_KEY - — Set to
NETWORKormainnet(default:testnet)testnet - — Custom x402 relay URL
API_URL
- —— 如果配置中未存储密钥,则使用该变量
HIRO_API_KEY - —— 设置为
NETWORK或mainnet(默认值:testnet)testnet - —— 自定义x402中继URL
API_URL