> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperlane.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Message Transfer Fee Calculations

<Note>
  For an overview of transfer fees head over to: [GMP Transfer
  Fees](/docs/protocol/core/fees)
</Note>

## Estimating Fees

To estimate both fees, use `estimateTransferRemoteFees`:

```ts theme={null}
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:

```ts theme={null}
const txs = await warpCore.getTransferRemoteTxs({
  originTokenAmount,
  destination,
  sender,
  recipient,
});
```

<Warning>
  **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
</Warning>

## How It Works

Under the hood, the SDK uses [`Mailbox.quoteDispatch()`](/docs/reference/messaging/send#quote-dispatch) to compute the interchain fee. This is the same value that must be passed to `dispatch`.

## Contract-Level Fee Quoting

<Info>
  New in version 10.0.0: Warp route contracts now expose a standardized `quoteTransferRemote` function for on-chain fee quoting.
</Info>

For contracts interacting directly with warp routes (without using the TypeScript SDK), you can quote fees on-chain using the `quoteTransferRemote` function:

```solidity theme={null}
// 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](/docs/applications/warp-routes/interface#fee-quoting-interface) for detailed documentation and examples.
