
Query Address Info
Query on-chain wallet token positions on BSC, Base, and Solana through Binance’s CLI without hand-rolling API clients.
Overview
query-address-info is an agent skill for the Build phase that queries Binance wallet active-token positions on BSC, Base, and Solana through `scripts/cli.mjs`.
Install
npx skills add https://github.com/binance/binance-skills-hub --skill query-address-infoWhat is this skill?
- `positions` command lists active wallet holdings with USD price, 24h change, and human-readable quantities
- Supports EVM (`0x…`) and Solana base58 addresses with chain IDs `56`, `8453`, and `CT_501`
- Standard invocation: `node <skill-dir>/scripts/cli.mjs <command> '<json_params>'`
- Documented exit codes: `0` success, `1` usage/upstream error, `3` network failure
- Returns token metadata (`symbol`, `decimals`, `binanceTokenId`) plus icon URLs under `https://bin.bnbstatic.com`
- Supports chain IDs 56 (BSC), 8453 (Base), and CT_501 (Solana)
- CLI documents exit codes 0, 1, and 3 for success, usage/upstream, and network failure
Adoption & trust: 4.9k installs on skills.sh; 881 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need reliable, paginated wallet position data across multiple chains without maintaining fragile one-off API scripts in every project.
Who is it for?
Solo builders wiring crypto portfolio or treasury views into Claude Code, Cursor, or Codex via a documented Node CLI.
Skip if: Teams that only need static docs with no live chain queries, or workflows that require trade execution rather than read-only address info.
When should I use this skill?
You need paginated active-position lists for a wallet address on supported Binance chains via the documented CLI.
What do I get? / Deliverables
Your agent returns a structured position list with prices and quantities per chain, ready to feed dashboards, alerts, or downstream trading logic.
- JSON position list with token metadata, USD price, and remainQty per wallet
- Deterministic CLI exit status for agent retry and error handling
Recommended Skills
Journey fit
Canonical shelf is Build because the skill is a developer integration that wires agents to Binance address-position APIs via `cli.mjs`. Integrations is the right subphase: it exposes external Binance/Web3 data to coding agents through a scripted command surface.
How it compares
Use this Binance CLI skill package instead of scattering raw REST snippets that omit exit codes and field semantics.
Common Questions / FAQ
Who is query-address-info for?
Indie developers and agent authors who integrate Binance on-chain address intelligence into CLIs, bots, or internal ops tools.
When should I use query-address-info?
During Build integrations when you must list what tokens a wallet holds on BSC, Base, or Solana; also handy in Operate monitoring when reconciling treasury balances before incidents.
Is query-address-info safe to install?
Review the Security Audits panel on this Prism page and treat wallet addresses and API access as sensitive; the skill performs network calls to upstream Binance services.
SKILL.md
READMESKILL.md - Query Address Info
# query-address-info — CLI Reference Complete reference for every command in `scripts/cli.mjs`. **Invocation pattern:** `node <skill-dir>/scripts/cli.mjs <command> '<json_params>'` **Exit codes:** `0` success · `1` usage/upstream error · `3` network failure --- ## `positions` — Wallet active-position list ```bash node <skill-dir>/scripts/cli.mjs positions '{"address":"0x...","chainId":"56","offset":0}' ``` ### Parameters | Param | Type | Required | Description | |---|---|---|---| | `address` | string | **yes** | Wallet address (EVM `0x...` or Solana base58) | | `chainId` | string | **yes** | `"56"` (BSC) · `"8453"` (Base) · `"CT_501"` (Solana) | | `offset` | number | **yes** | Pagination offset (start from `0`) | ### Return fields (under `.data.list[]`) | Field | Type | Description | |---|---|---| | `chainId` | string | Chain identifier | | `address` | string | Queried wallet address (lowercased) | | `contractAddress` | string | Token contract address | | `binanceTokenId` | string | Binance-internal stable token ID | | `name`, `symbol` | string | Token display names | | `icon` | string | Logo path — prefix with `https://bin.bnbstatic.com` | | `decimals` | number | Token decimals | | `price` | string | Current USD price (decimal string) | | `percentChange24h` | string | 24h price change (%, signed decimal string) | | `baseCoinPrice` | string | USD price of the chain native coin | | `remainQty` | string | Holding quantity (human-readable, already divided by decimals) | | `circulatingSupply` | string | Circulating supply | | `riskLevel`, `riskLevelInt` | string \| null, number | Risk badge (`"LOW"` = 1, etc.); may be `null` | | `lowLiquidity` | number | `1` = low-liquidity warning | ### Response envelope (under `.data`) | Field | Type | Description | |---|---|---| | `offset` | number | Echo of request offset | | `list` | array \| `null` | Position list; `null` when wallet has no tracked holdings | | `addressStatus` | any | Reserved (currently always `null`) | --- ## Errors Exit codes: `0` ok · `1` upstream/usage (stderr: reason; stdout: body with business `code`) · `3` network. Business `code`: `000000` ok · `100004` rate-limited · `100002` bad param · `000400` unsupported chain / bad address. #!/usr/bin/env node // query-address-info CLI — self-contained, zero-dep, Node >= 22 // Usage: node cli.mjs <command> '<json_params>' // // Commands: // positions GET wallet active-position list (token balances + 24h price change) // // ---- inline HTTP helper (self-contained, zero dependency) ---- const TIMEOUT_MS = 10_000; const UA = { 'Accept-Encoding': 'identity', 'User-Agent': 'binance-web3/2.0 (Skill)' }; const qs = (p) => Object.entries(p) .filter(([, v]) => v != null) .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`) .join('&'); async function call({ url, method = 'GET', body, headers = {} }) { const ctrl = new AbortController(); const timer = setTimeout(() => ctrl.abort(), TIMEOUT_MS); const opts = { method, headers: { ...UA, ...headers }, signal: ctrl.signal }; if (method === 'POST') { opts.headers['content-type'] = 'application/json'; opts.body = JSON.stringify(body || {}); } let res; try { res = await fetch(url, opts); } catch { clearTimeout(timer); throw Object.assign(new Error('Network request failed'), { exitCode: 3 }); } clearTimeout(timer); const data = await res.json(); if (res.status >= 400) throw Object.assign(new Error(`HTTP ${res.status}`), { exitCode: 1, body: data }); return data; } // ---- supported chains (client-side fail-fast) ---- const SUPPORTED_CHAINS = new Set(['1', '56', '8453', 'CT_501']); function validateChainId(chainId) { const id = String(chainId ?? ''); if (!SUPPORTED_CHAINS.has(id)) { const supported = [...SUPPORTED_CHAINS].map((c) => `"${c}"`).join(', '); throw Object.assign( new Error(`positions: unsupported chainId "${chainId}". Supported: ${supported}`), { exitCode: 1 }, ); } } // Client-side fa