Queried by: developers
The Big Picture
Globally unique position IDs across all subnets.
Use Cases
- Generate next ID
- Count total positions
From Chain Metadata
Position ID counter.
Purpose & Usage
Purpose
Generates unique position identifiers.
Common Query Patterns
- Single value query
Stored Value
Relationships
Modified By
Related Events
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 LastPositionId storage (no keys - plain value)
const result = await api.query
[stringCamelCase("Swap")]
[stringCamelCase("LastPositionId")]();
console.log("LastPositionId:", result.toHuman());Runtime Info
View Source- Pallet
- Swap
- Storage Kind
- Plain
- First Version
- v290
- Current Version
- v393