Skip to content

decodeRegistryEntryDetailsFromChain

decodeRegistryEntryDetailsFromChain(encoded, registryEntryId): IRegistryEntryChainStorage | null

Decodes the registry entry details from the blockchain state.

Takes an optional encoded entry and an identifier, then extracts and formats the relevant properties into a structured object containing the entry’s URI, transaction hash, revocation status, creator, and registry URI.

Parameters

encoded: Option<PalletEntryRegistryEntryDetails>

The optional encoded data from the blockchain, containing entry details or None.

registryEntryId: string

The identifier used to generate the entry’s id

Returns

IRegistryEntryChainStorage | null

The decoded entry details as IRegistryEntryChainStorage, or null if encoded is None.

Example

const encoded = await api.query.entry.registryEntries('abc123');
const details = decodeRegistryEntryDetailsFromChain(encoded, 'abc123');
console.log(details); // { uri: 'entry:cord:abc123...', tx_hash: '0x...', ... }

Source

entry/src/Entry.chain.ts:495