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 | key1 | AccountId | key1 (AccountId) (hex -> SS58) |
Stored Value
value (BoundedVec)
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query Holds storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const result = await api.query
[stringCamelCase("Balances")]
[stringCamelCase("Holds")](
key1
);
console.log("Holds:", result.toHuman());Runtime Info
- Pallet
- Balances
- Storage Kind
- Map
- First Version
- v149
- Current Version
- v393