Actalink Docs
Hooks

useFees Hook

Hook for getting fees related logic.

Import

import { useFees } from "@actalink/react-hooks";

Usage

import { useFees } from "@actalink/react-hooks";
import { useAccount } from "wagmi";
import { config } from "../wagmi"; // import wagmi config
 
const Home: NextPage = () => {
  const { address, status, chainId } = useAccount();
  const { calculateActaFees, getActaFeesRecipients,getPaymasterfees, error } = useFees({ chainId, config });
  return()
}

Parameters

ParameterTypeDefinition
chainIdnumberChain ID of the network to which the dApp is connected.
configConfigwagmi config.

Returns

ValueReturn TypeDefinition
calculateActaFees(amount: bigint, validator?: Address) => Promise<bigint>Get the value of Actalink fees.
getActaFeesRecipients(validator?: Address) ⇒ Promise<{ actaFeesRecipient: Hex; paymasterFeesRecipient: Hex; }>Get the addresses of Actalink fee receiver and Paymaster fees receiver.
getPaymasterfees(validator?: Address) ⇒ Promise<bigint>Get the value of Paymaster fees.
error`stringnull`

On this page