queryDokenStateByIndex
queryDokenStateByIndex(
api,doken,index):Promise<DokenState>
Retrieves the state change details for a specific index in the doken’s state history.
Parameters
Section titled “Parameters”• api: ApiPromise
An instance of ApiPromise from @polkadot/api, connected to the CORD network.
• doken: string
A string representing the doken identifier (not necessarily in hex).
• index: number
A non-negative integer indicating the position of the state change in the history (e.g., 0 for creation).
Returns
Section titled “Returns”Promise<DokenState>
A Promise resolving to a DokenState object containing the state, action, and height.
Throws
Section titled “Throws”Error if doken is invalid, index is negative or non-integer, or no state change is found at the given index.
Example
Section titled “Example”const state = await queryDokenStateByIndex(api, 'T6fvpeF1Q5y1qFB15aUnTpreo7JRLgJFM1ED5Qzqw6dV8oCnP4kS', 0);console.log(state); // { state: '...', action: 'RegistryEntryCreated', height: 748 }