Forwarder Flow

AARC SDK supports the migrations of tokens with gas fees paid in stable tokens.

The executeForwardTransaction function of the our SDK implements a forwarder flow that enables the migration of tokens between wallets or contracts with a unique feature: the gas fees are paid using stable tokens instead of the native blockchain currency. This method is tailored for users who prefer or need to utilize stable tokens to cover transaction costs, offering a practical solution in volatile market conditions.

Expected parameters

executeForwardTransaction accepts the following parameters:

  • senderSigner: The signer object from ethers.

  • chainId: The chain id of the current network.

  • receiverAddress: The address of the recipient.

  • transferTokenDetails[OPTIONAL]: The object specifies tokens with respective amounts to transfer.

NOTE:

  • If transferTokenDetailsis not passed, then all the assets will be transferred.

Function Call

Transfer all tokens

await aarcSDK.executeForwardTransaction({
    senderSigner: signer,
    chainId: number,
    receiverAddress:"0x786E6045eacb96cAe0259cd761e151b68B85bdA7"
  });

Transfer-specific tokens

await aarcSDK.executeForwardTransaction({
    senderSigner: signer,
    receiverAddress:"0x786E6045eacb96cAe0259cd761e151b68B85bdA7",
    chainId: 137,
    transferTokenDetails:[
    {
        tokenAddress:"0x2271e3Fef9e15046d09E1d78a8FF038c691E9Cf9",
        // .toString(16) is to convert TOKEN_AMOUNT to hex in string format
        amount:TOKEN_AMOUNT.toString(16)  
    },
    {
      tokenAddress:"0x932ca55b9ef0b3094e8fa82435b3b4c50d713043",
      tokenIds:["28507"] 
     },
    ],
  });

Response

[
  {
  tokenAddress: string;
  taskId?: string;
  amount?: string;
  message: string;
  txHash?: string;
  tokenId?: string;
  },
]

Supported Networks and Tokens

TokenAddress

USDC

0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

USDT

0xdac17f958d2ee523a2206206994597c13d831ec7

BUSD

0x4fabb145d64652a948d72533023f6e7a623c7c53

DAI

0x6b175474e89094c44da98b954eedeac495271d0f

UNI

0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

Support

If you face any trouble, feel free to reach out to our engineers in the Telegram support group.

Last updated