• Retrieves the last staking reward for a given stake account on the Solana blockchain.

    Parameters

    • endpoint: string

      The URL of the Solana RPC endpoint.

    • stakeAccountAddress: string

      The public key of the stake account.

    Returns Promise<null | StakeRewardParams>

    An object containing the details of the last staking reward, or null if no rewards are found.

    Example

    const endpoint = 'https://api.mainnet-beta.solana.com'
    const stakeAccountAddress = 'ExampleStakeAccountAddress'

    const reward = await getLastStakingReward(endpoint, stakeAccountAddress)
    if (reward) {
    console.log(`Last reward: ${JSON.stringify(reward)}`)
    } else {
    console.log('No rewards found.')
    }

Generated using TypeDoc