Skip to content

useToken

Returns the Rune associated with a given EVM address.


Parameters

NameTypeDescription
addressAddressThe EVM address for which to retrieve the Rune.
optionsUseERC20ParamsOptional parameters for the contract call.
options.queryobjectCustom query options for the contract call.
options.configConfigCustom configuration to override the default.

Returns

NameTypeDescription
stateUseRuneReturnState returned by the useRune hook.
bytes32StateUseReadContractReturnState from the useReadContract hook for Rune ID.
bytes32RuneIdstring | undefinedThe bytes32 representation of the Rune ID.
runeRune | undefinedThe corresponding Rune data.

Variables

NameTypeDescription
runeIdstringThe decoded Rune ID.

Example

typescript
const { rune } = useToken('0xabc123...');
if (rune) {
  console.log(`Rune Name: ${rune.name}`);
}