Bridge Kit

Collect a Transfer Fee

Bridge Kit lets you collect a transfer 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.

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: "Ethereum" },
  to: { adapter, chain: "Base" },
  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",
    },
  },
});

This example configures your global setup to collect a fee of 1 USDC on transfers from Ethereum and 1.50 USDC on transfers from other blockchains:

Typescript
import { Blockchain } from "@circle-fin/bridge-kit";
const kit = new BridgeKit();

kit.setCustomFeePolicy({
  calculateFee: (params) => {
    // Charge 1 USDC if the source chain is Ethereum and 1.50 USDC on other blockchains
    return params.source.chain.chain == Blockchain.Ethereum ? "1.00" : "1.50";
  },
  resolveFeeRecipientAddress: (feePayoutChain, params) => {
    // Change the recipient address if the source chain is Ethereum
    return params.source.chain.chain == Blockchain.Ethereum
      ? "YOUR_WALLET_ADDRESS"
      : "YOUR_OTHER_WALLET_ADDRESS";
  },
});
Did this page help you?
© 2023-2025 Circle Technology Services, LLC. All rights reserved.