Skip to main content

Transfer of Non-Reserve Tokens

function depositNonReserveToken(
bool isSourceNative,
bytes calldata swapData,
bytes calldata executeData,
bytes calldata requestMetadata
) external payable;

Non-Reserve tokens include all those tokens which are not kept as reserve tokens for the Voyager and are not the LP tokens for any of these reserve tokens. These can be any random token.

When a user wants to transfer any non-reserve token from source chain to any other token on the destination chain, this function is to be called. After this function is called, the Voyager’s infrastructure will handle the transfer of tokens to the other chain.

Parameters:

isSourceNativeIf the source token is the native token for that chain, this should be true.
swapDataabi encoded data for the swap which is created by an API
executeDataabi encoded data for the destination chain which is created by an API
requestMetadata

The Swap Data includes:

  1. srcTokenAmount: Amount of the non-reserve token the user wants to transfer to the other chain.
  2. srcStableTokenAmount: Amount of the stable token equivalent to the amount of source token user wants to transfer.
  3. destChainIdBytes: The Chain ID identifier for the destination chain.
  4. srcTokenAddress: Address of the token the user wants to transfer to the other chain.
  5. srcStableTokenAddress: Address of the stable token in which the stable amount (srcStableTokenAmount) equivalent to the srcTokenAmount is calculated.
  6. dataTx: Data for the transaction for swap to convert the non-reserve token to the stable token on source chain (received from the API).
  7. path: Data for the transaction for swap to convert the non-reserve token to the stable token on source chain (received from the API).
  8. flags: The identifiers of DEXes that will be used for swap on source chain (received from the API).

The details for the Execute Data can be found here.

The details for the Request Metadata can be found here

info

💡 Note: Swap data and Execute data will directly be generated by the API. You don’t need to worry about generating this data.