Queried by: developerswalletsanalytics
The Big Picture
Holds are the modern replacement for reserves in Substrate. Each hold has an identifier explaining why funds are held. Provides better visibility into balance reservations than the older reserve system.
Use Cases
- Understand why balance is reserved
- Track holds by reason code
- Debug balance availability issues
From Chain Metadata
Holds on account balances.
Purpose & Usage
Purpose
Track reserved balances with explicit reason codes for each hold.
Common Query Patterns
- Query by account address
- List all holds for an account
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | accountId account raw: key1 | AccountId [u8; 32] | key1 (AccountId) (hex -> SS58) |
Stored Value
value (BoundedVec)
Default Value
0x00 (raw SCALE bytes)
Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Query Holds storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const result = await api.query.Balances.Holds.getValue(key1);
console.log("Holds:", result);Runtime Info
- Pallet
- Balances
- Storage Kind
- Map
- First Version
- v149
- Current Version
- v472