Skip to content
LogoLogo

fee.validateToken

Validates that a token can be used as a Tempo fee token. Fee tokens must be unpaused USD-denominated TIP-20 tokens.

Usage

import { client } from './viem.config'
 
const result = await client.fee.validateToken({
  token: '0x20c0000000000000000000000000000000000001',
})
 
console.log('Fee token address:', result.address)
Fee token address: 0x20c0000000000000000000000000000000000001
console.log('Fee token currency:', result.metadata.currency)
Fee token currency: USD

Return Type

type ReturnType = {
  /** Address of the fee token */
  address: Address
  /** ID of the fee token */
  id: bigint
  /** TIP-20 token metadata */
  metadata: {
    currency: string
    decimals: number
    logoURI: string
    name: string
    paused?: boolean
    quoteToken?: Address
    supplyCap?: bigint
    symbol: string
    totalSupply: bigint
    transferPolicyId?: bigint
  }
}

Throws FeeTokenNotTip20Error, FeeTokenNotUsdError, or FeeTokenPausedError when the token cannot be used for fees.

Parameters

token

  • Type: Address | bigint

Fee token address or ID to validate.

blockNumber (optional)

  • Type: bigint

Block number to read the state from.

blockOverrides (optional)

  • Type: BlockOverrides

Block overrides to apply to the state.

blockTag (optional)

  • Type: BlockTag

Block tag to read the state from.

stateOverride (optional)

  • Type: StateOverride

State override to apply.