Skip to main content
What are app fees?

Parameters

PropertyDescriptionRequired
walletA valid WalletClient from viem or an adapted wallet generated from an adapter that meets this interface.
chainIdChain ID to claim fees on
currencyToken address to claim
recipientAddress to receive claimed fees (defaults to wallet address)
onProgressCallback to update UI state as execution progresses. Can also be used to get the transaction hash for a given step item. The following data points are returned: steps, fees, breakdown, txHashes, currentStep, currentStepItem, details

Example

import { getClient } from "@relayprotocol/relay-sdk";
import { useWalletClient } from "wagmi";

const { data: wallet } = useWalletClient();

const { data } = await getClient().actions.claimAppFees({
  wallet,
  chainId: 8453, // Base
  currency: "0x0000000000000000000000000000000000000000", // ETH
  recipient: "0x...", // Optional
  onProgress: ({steps, fees, breakdown, currentStep, currentStepItem, txHashes, details}) => {
    // custom handling
  },
});