Skip to main content
For an overview of transfer fees head over to: GMP Transfer Fees

Estimating Fees

To estimate both fees, use estimateTransferRemoteFees:
const { interchainQuote, localQuote } =
  await warpCore.estimateTransferRemoteFees({
    originToken,
    destination,
    sender,
  });
  • interchainQuote: Fee to route the message to the destination chain (via IGP)
  • localQuote: Gas cost to send the tx on the origin chain
Each is returned as a TokenAmount which includes:
  • amount: The quantity of tokens required
  • token: The token metadata (including chain, decimals, and symbol)

Using the Fee in Transfers

When making a transfer, you can provide the pre-computed fee quote:
const txs = await warpCore.getTransferRemoteTxs({
  originTokenAmount,
  destination,
  sender,
  recipient,
});
Important Considerations:
  • Fees may vary between different chain types
  • Some chains require additional parameters
  • Missing or underpaying fees will cause the transaction to revert
  • Fee tokens may differ from the transfer token

How It Works

Under the hood, the SDK uses Mailbox.quoteDispatch() to compute the interchain fee. This is the same value that must be passed to dispatch.

Contract-Level Fee Quoting

New in version 10.0.0: Warp route contracts now expose a standardized quoteTransferRemote function for on-chain fee quoting.
For contracts interacting directly with warp routes (without using the TypeScript SDK), you can quote fees on-chain using the quoteTransferRemote function:
// Quote fees for a warp route transfer
Quote[] memory quotes = warpRoute.quoteTransferRemote(
    destinationDomain,
    recipientAddress,
    amount  // Exact amount recipient will receive
);

// quotes[0]: Native mailbox dispatch fee (token: address(0))
// quotes[1]: Total token amount including internal fees
// quotes[2]: External bridge fees (if any, else 0)
The quotes array always contains exactly 3 elements:
  1. Native Fee (quotes[0]): Must be sent as msg.value to transferRemote
  2. Token Amount (quotes[1]): Total tokens to approve/send, including fees
  3. External Fee (quotes[2]): Additional bridge fees (already included in quotes[1])
See the HWR Interface for detailed documentation and examples.