Skip to content

queryAllDokenStateHistory

queryAllDokenStateHistory(api, doken): Promise<DokenState[]>

Retrieves the complete history of state changes for a given doken identifier.

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).

Promise<DokenState[]>

A Promise resolving to an array of DokenState objects, or an empty array if no history is found.

Error if doken is invalid.

const history = await queryAllDokenStateHistory(api, 'T6fvpeF1Q5y1qFB15aUnTpreo7JRLgJFM1ED5Qzqw6dV8oCnP4kS');
console.log(history); // [{ state: '...', action: 'RegistryEntryCreated', height: 748 }, ...]

utils/src/DokenHistory.ts:61