Standard Gas Flow

Transfer tokens from EOA to any receiver wallet address.

The executeMigration function in our SDK enables the transfer of tokens from an Externally Owned Account (EOA) to any designated receiver's wallet address. This operation falls under the "Standard Gas Flow" model, which implies that the user initiating the transfer will be responsible for paying the gas fees that the transaction incurs.

Expected parameters

executeMigration 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 transferTokenDetails is not passed, then all the assets will be transferred.

Function Call

Transfer All tokens

await aarcSDK.executeMigration({
  senderSigner: signer, // ethers.signer object
  chainId: number,
  receiverAddress:'RECEIVER_WALLET_ADDRESS'
})

Transfer-specific tokens

await aarcSDK.executeMigration({
  senderSigner: signer, // ethers.signer object
  receiverAddress:'RECEIVER_WALLET_ADDRESS',
  chainId: 137,
  transferTokenDetails: // Optional. If not passed, the SDK will migrate all the tokens of the wallet
  [
    {
        tokenAddress:"0x2271e3Fef9e15046d09E1d78a8FF038c691E9Cf9",
        // .toString(16) is to convert TOKEN_AMOUNT to hex in string format
        amount:TOKEN_AMOUNT.toString(16) 
    },
    {
      tokenAddress:"0x932ca55b9ef0b3094e8fa82435b3b4c50d713043",
      tokenIds:["28507"] 
    },
  ],
})

Response

The response of the executeMigration will be:

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

Support

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

Last updated