The getDepositAddress function allows developers to obtain a deposit address for cross-chain transactions, enabling seamless transfer of assets between different blockchain networks.

Expected parameters

ParametersTypeDescription
contractPayloadstringThe encoded contract call data for the transaction.
fromTokenobject

Object containing details about the source token:

  • decimals: Number of decimal places for the token
  • chainId: Chain ID of the source network
  • address: Contract address of the source token
fromAmountstringAmount of tokens to transfer.
transferTypeTransferTypeType of transfer (e.g., WALLET).
destinationChainIdstringChain ID of the destination network.
destinationTokenAddressstringContract address of the destination token.
toAmountstringAmount of tokens to receive on destination chain.
destinationRecipientstringAddress to receive the tokens on destination chain.
targetCalldatastringContract call data for the transaction.
fromAddressstringSource wallet address.

Function call

const depositData = await aarcCoreSDK.getDepositAddress({
  contractPayload: callData,
  fromToken: { 
    decimals: 18, 
    chainId: 1, 
    address: 'fromTokenAddress' 
  },
  fromAmount: '0.01',
  transferType: TransferType.WALLET,
  destinationChainId: destinationToken.chainId?.toString() ?? "",
  destinationTokenAddress: destinationToken.address ?? "",
  toAmount: baseToAmount,
  destinationRecipient: destinationWalletAddress ?? "",
  targetCalldata: contractPayload,
  fromAddress: fromAddress
});

Response

The response from the getDepositAddress will contain the deposit address and related information for the cross-chain transaction.

Support

For additional queries contact support.