claimYieldRewards
Claims a wallet account’s accrued rewards in an Earn vault, then signs and sends the resulting transaction. The reward distributor’s address and the per-user merkle proof are resolved server-side — you only pass avaultId.
Rejects when there is nothing claimable for this vault right now — no active reward campaign, or every attributable token is already fully claimed. Check getYieldRewards before calling, 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.
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
useClaimYieldRewards invalidates useGetYieldRewards on success — treat that refetch as a nudge, since the claim is only broadcast (not necessarily mined) when the mutation resolves.
Related
getYieldRewards- Check accrued rewards before claimingdepositToYieldVault- Deposit into a vault