reward.getPendingRewards
Calculates the pending claimable rewards for an account without modifying state.
Usage
import { client } from './viem.config'
const pending = await client.reward.getPendingRewards({
token: '0x20c0000000000000000000000000000000000001',
account: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
})
console.log('Pending rewards:', pending)
Pending rewards: 1000000000000000000nimport { Account, createClient } from 'viem/tempo'
export const client = createClient({
account: Account.fromSecp256k1('0x...'),
})Return Type
type ReturnValue = bigintReturns the total pending claimable reward amount, including stored balance and newly accrued rewards.
Parameters
account
- Type:
Address
The account address to query pending rewards 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.