claimYieldRewards
Claims a wallet’s accrued bonus rewards in an Earn vault, then signs and sends the transaction for you. You only pass avaultId — Dynamic resolves everything else needed to process the claim.
This is separate from base yield, which never needs claiming. Rewards are an optional bonus some vaults pay out in addition to base yield, and they sit unclaimed until you call this function.
Rejects when there’s nothing claimable for this vault right now — no active reward campaign, or everything has already been claimed. Check getYieldRewards first, and only show a claim action when it returns a non-zero accrued amount.
Usage
Parameters
Returns
Promise<{ transactionHash: string }> - The hash of the claim transaction.
Waiting for confirmation
transactionHash is returned as soon as the claim is broadcast to the network — it can still fail or revert after that. Wait for a receipt before telling the user their claim succeeded:
Examples
Only offer claim when something is claimable
Supported Chains
claimYieldRewards only supports EVM wallet accounts — vault actions are EVM-only today. Calling it with a non-EVM walletAccount throws a WalletProviderMethodUnavailableError, since only EVM wallet providers implement the underlying executeYieldTransaction method.
React
This hides the button entirely when there’s nothing to claim, rather than showing it and reporting the resulting rejection as a normal outcome:useClaimYieldRewards invalidates useGetYieldRewards on success, so rewards refetch automatically. That refetch can still briefly show the old amount, since the claim transaction may not be mined yet — see Waiting for confirmation.
Related
getYieldRewards- Check accrued rewards before claimingdepositToYieldVault- Deposit into a vault