Skip to main content
Bridge Kit lets you collect a custom fee from your end users. You can set this fee globally for the kit or on each bridge call. Per-call fees override the global fee. You can set a flat or dynamic fee based on the parameters.
If you use this feature, Circle keeps 10% of the custom fee you collect from your end users. To understand how this fee works, see Custom Fees.

Set fee per bridge call

This example configures your bridge call to collect a fee of 1.50 USDC for a specific bridge transfer:
TypeScript
// Transfer 1 USDC
const result = await kit.bridge({
  from: { adapter, chain: "Arc_Testnet" },
  to: { adapter, chain: "Polygon_Amoy_Testnet" },
  amount: "1.00",
  // Collect a fee of 1.50 USDC on this transfer and override the global fee, if set
  config: {
    customFee: {
      value: "1.50",
      recipientAddress: "YOUR_WALLET_ADDRESS",
    },
  },
});

Set fee globally

This example configures your global setup to collect a fee of 1 USDC on transfers from Arc Testnet and 1.50 USDC on transfers from other blockchains:
TypeScript
import { Blockchain, BridgeKit } from "@circle-fin/bridge-kit";
const kit = new BridgeKit();

kit.setCustomFeePolicy({
  computeFee: (params) => {
    // Charge 1 USDC if the source chain is Arc Testnet and 1.50 USDC on other blockchains
    return params.source.chain.chain === Blockchain.Arc_Testnet
      ? "1.00"
      : "1.50";
  },
  resolveFeeRecipientAddress: (feePayoutChain) => {
    // Change the recipient address if the source chain is Arc Testnet
    return feePayoutChain.chain === Blockchain.Arc_Testnet
      ? "YOUR_WALLET_ADDRESS"
      : "YOUR_OTHER_WALLET_ADDRESS";
  },
});