Skip to main content
By default, the tokens you receive from a swap arrive at the same address as your signing wallet. For same-chain swaps, you can specify a different recipient so the output tokens go to that address instead. Your signing wallet still signs and funds the swap. For crosschain swaps, see Swap tokens across blockchains.

Prerequisites

Before you begin, ensure that you’ve: These are required so any example below runs with a valid kit and adapter.

Specify a recipient

Set the recipient with the to parameter. For a same-chain swap, to.chain defaults to the source chain (from.chain), so you only need to set to.recipientAddress. This example swaps 1.00 USDC for EURC on Arc Testnet and sends the EURC to a different address than the one that signs the swap:
TypeScript
const result = await kit.swap({
  from: { adapter, chain: "Arc_Testnet" },
  tokenIn: "USDC",
  tokenOut: "EURC",
  amountIn: "1.00",
  to: {
    recipientAddress: "0xRecipientAddress",
  },
  config: {
    kitKey: process.env.KIT_KEY as string,
  },
});
to.recipientAddress sets where the output tokens are sent. It’s different from config.customFee.recipientAddress, which sets the recipient of a custom swap fee.