query
Stacks network and blockchain query operations — get STX fees, account info, transaction history, block info, mempool transactions, contract info and events, network status, and call read-only contract functions. All queries use the Hiro API.
What this skill does
# Query Skill
Provides Stacks network and blockchain query operations using the Hiro API. No wallet required for most queries; `get-account-info` and `get-account-transactions` fall back to the active wallet address if no address is provided.
## Usage
```
bun run query/query.ts <subcommand> [options]
```
## Subcommands
### get-stx-fees
Get current STX fee estimates for different priority levels.
```
bun run query/query.ts get-stx-fees
```
Output:
```json
{
"network": "mainnet",
"fees": {
"low": { "microStx": 1000, "stx": "0.001 STX", "description": "Lower fee, may take longer to confirm" },
"medium": { "microStx": 2500, "stx": "0.0025 STX", "description": "Standard fee, typical confirmation time" },
"high": { "microStx": 5000, "stx": "0.005 STX", "description": "Higher fee, faster confirmation" }
},
"byTransactionType": {
"tokenTransfer": { "low": 1000, "medium": 2500, "high": 5000 },
"contractCall": { "low": 1500, "medium": 3000, "high": 6000 },
"smartContract": { "low": 2000, "medium": 4000, "high": 8000 }
},
"unit": "micro-STX",
"note": "1 STX = 1,000,000 micro-STX. Fees are estimates based on current mempool conditions."
}
```
### get-account-info
Get account information including nonce and STX balance.
```
bun run query/query.ts get-account-info [--address <stxAddress>]
```
Options:
- `--address` (optional) — Stacks address to check (uses active wallet if omitted)
Output:
```json
{
"address": "SP...",
"network": "mainnet",
"nonce": 42,
"balance": { "microStx": "1000000000", "stx": "1000 STX" },
"explorerUrl": "https://explorer.hiro.so/address/SP...?chain=mainnet"
}
```
### get-account-transactions
Get transaction history for a Stacks account.
```
bun run query/query.ts get-account-transactions [--address <stxAddress>] [--limit 20] [--offset 0]
```
Options:
- `--address` (optional) — Stacks address (uses active wallet if omitted)
- `--limit` (optional) — Maximum results (default: 20)
- `--offset` (optional) — Pagination offset (default: 0)
Output:
```json
{
"address": "SP...",
"network": "mainnet",
"total": 150,
"limit": 20,
"offset": 0,
"transactions": [
{
"txId": "0x...",
"type": "token_transfer",
"status": "success",
"sender": "SP...",
"blockHeight": 145000,
"fee": "1000",
"explorerUrl": "https://explorer.hiro.so/txid/0x...?chain=mainnet"
}
],
"explorerUrl": "https://explorer.hiro.so/address/SP...?chain=mainnet"
}
```
### get-block-info
Get information about a specific Stacks block.
```
bun run query/query.ts get-block-info --height-or-hash <value>
```
Options:
- `--height-or-hash` (required) — Block height (integer) or block hash (0x-prefixed)
Output:
```json
{
"network": "mainnet",
"hash": "0x...",
"height": 145000,
"canonical": true,
"burnBlockHeight": 840000,
"burnBlockTime": 1700000000,
"burnBlockTimeIso": "2024-01-01T00:00:00.000Z",
"txCount": 12,
"txIds": ["0x..."]
}
```
### get-mempool-info
Get pending transactions in the Stacks mempool.
```
bun run query/query.ts get-mempool-info [--sender-address <addr>] [--limit 20] [--offset 0]
```
Options:
- `--sender-address` (optional) — Filter by sender address
- `--limit` (optional) — Maximum results (default: 20)
- `--offset` (optional) — Pagination offset (default: 0)
Output:
```json
{
"network": "mainnet",
"total": 5,
"limit": 20,
"offset": 0,
"transactions": [
{
"txId": "0x...",
"type": "contract_call",
"sender": "SP...",
"fee": "2500",
"nonce": 43,
"receiptTime": "2024-01-01T00:00:00.000Z",
"explorerUrl": "https://explorer.hiro.so/txid/0x...?chain=mainnet"
}
]
}
```
### get-contract-info
Get information about a smart contract including its ABI.
```
bun run query/query.ts get-contract-info --contract-id <address.contract-name>
```
Options:
- `--contract-id` (required) — Contract ID in format `address.contract-name`
Output:
```json
{
"contractId": "SP...contract-name",
"network": "mainnet",
"txId": "0x...",
"blockHeight": 140000,
"functions": [
{ "name": "transfer", "access": "public", "args": [...], "outputs": {...} }
],
"variables": [...],
"maps": [...],
"fungibleTokens": [...],
"nonFungibleTokens": [...],
"explorerUrl": "https://explorer.hiro.so/txid/SP...contract-name?chain=mainnet"
}
```
### get-contract-events
Get events emitted by a smart contract.
```
bun run query/query.ts get-contract-events --contract-id <address.contract-name> [--limit 20] [--offset 0]
```
Options:
- `--contract-id` (required) — Contract ID in format `address.contract-name`
- `--limit` (optional) — Maximum results (default: 20)
- `--offset` (optional) — Pagination offset (default: 0)
Output:
```json
{
"contractId": "SP...contract-name",
"network": "mainnet",
"limit": 20,
"offset": 0,
"events": [...],
"explorerUrl": "https://explorer.hiro.so/txid/SP...contract-name?chain=mainnet"
}
```
### get-network-status
Get the current status of the Stacks network.
```
bun run query/query.ts get-network-status
```
Output:
```json
{
"network": "mainnet",
"serverVersion": "stacks-node 2.4.0.0.0",
"status": "ready",
"chainTip": { "block_height": 145000, "block_hash": "0x..." },
"coreInfo": {
"peerVersion": 4026533888,
"stacksTipHeight": 145000,
"burnBlockHeight": 840000,
"networkId": 1
}
}
```
### call-read-only
Call a read-only function on a smart contract.
```
bun run query/query.ts call-read-only --contract-id <id> --function-name <name> [--args <json>] [--sender <address>]
```
Options:
- `--contract-id` (required) — Contract ID in format `address.contract-name`
- `--function-name` (required) — Name of the read-only function
- `--args` (optional) — JSON array of hex-encoded Clarity values (default: `[]`)
- `--sender` (optional) — Sender address (uses active wallet or contract address if omitted)
The `--args` option accepts a JSON array of hex-encoded Clarity values. Use `@stacks/transactions` to encode values. For example, `uintCV(1)` serialized as hex would be `"0100000000000000000000000000000001"`.
Output:
```json
{
"contractId": "SP...contract-name",
"functionName": "get-balance",
"network": "mainnet",
"okay": true,
"result": "0x0100000000000000000000000000000064",
"cause": null
}
```
## Notes
- All queries use the Hiro API (`api.mainnet.hiro.so` or `api.testnet.hiro.so`)
- Network is controlled by the `NETWORK` environment variable (default: testnet)
- `get-account-info` and `get-account-transactions` fall back to the active wallet address
- `call-read-only` falls back to the contract's own address as sender if no wallet is active
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.