Skip to content
LogoLogo

reward.getUserRewardInfo

Gets reward information for a specific account.

Usage

import {  } from './viem.config'
 
const { , ,  } =
  await .reward.getUserRewardInfo({
    : '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEbb',
    : '0x20c0000000000000000000000000000000000001',
  })
 
.('Reward recipient:', )
Reward recipient: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEbb
.('Reward balance:', )
Reward balance: 1000000000000000000n
.('Reward per token:', )
Reward per token: 385802469135802469135n

Return Type

type ReturnType = {
  /** Accumulated reward balance claimable by the account */
  rewardBalance: bigint
  /** Reward per token checkpoint for the account */
  rewardPerToken: bigint
  /** Current reward recipient address (zero address if opted out) */
  rewardRecipient: Address
}

Parameters

account

  • Type: Address

Address of the account to get reward info for.

token

  • Type: Address

Address of the TIP-20 token.

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.