Skip to content

mapTokenMetadata

mapTokenMetadata(response): IcrcTokenMetadata | undefined

Defined in: packages/ledger-icrc/src/utils/ledger.utils.ts:118

Maps the token metadata information from a ledger response into a structured record.

This utility processes an array of metadata key-value pairs provided by the ledger and extracts specific fields, such as symbol, name, fee, decimals, and logo. It then constructs a IcrcTokenMetadata record. If any required fields are missing, the function returns undefined.

IcrcTokenMetadataResponse

An array of key-value pairs representing token metadata.

IcrcTokenMetadata | undefined

  • A structured metadata record or undefined if required fields are missing.