Examples

walletAddressesData

๐Ÿšง

In the case of currencies that use a secondary address identifier/tag/memo, it can be specified in the addressAdditionalData field.

{
  networks: {
    ethereum: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1' },
    polygon: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1', addressAdditionalData: '123456' },
  },
  coins: {
    BTC: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1' },
    DAI: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1' },
    BNB: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1', addressAdditionalData: '123456' },
  },
}

userData

{
  firstName: 'Satoshi',
  lastName: 'Nakamoto',
  email: '[email protected]',
  mobileNumber: '+15417543010',
  dob: '1994-08-26',
  address: {
    addressLine1: '170 Pine St',
    addressLine2: 'San Francisco',
    city: 'San Francisco',
    state: 'CA',
    postCode: '94111',
    countryCode: 'US',
  },
}

The correct format of a US postal code can be either the first 5 digits alone or the complete 9 digits with a hyphen after the first 5 digits. For example, the valid formats are:

Five-digit format: "XXXXX" (e.g., 12345)
Nine-digit format: "XXXXX-XXXX" (e.g., 12345-6789)

redirectURL

User will be redirected to the partner page passed in redirectURL along with the following parameters appended to the URL:

  • orderId: Transak order ID
  • fiatCurrency: Payout fiat currency
  • cryptoCurrency: Token symbol to be transferred
  • fiatAmount: Expected payout fiat amount
  • cryptoAmount: Amount of crypto to be transferred
  • isBuyOrSell: Will be 'Sell' in case of off ramp
  • status: Transak order status
  • walletAddress: Destination wallet address where crypto should be transferred
  • totalFeeInFiat: Total fee charged in local currency for the transaction
  • partnerCustomerId: Partner's customer ID (if present)
  • partnerOrderId: Partner's order ID (if present)
  • network: Network on which relevant crypto currency needs to be transferred

For example, if you submit redirectURL=https%3A%2F%2Fwww.url.com, we will redirect the customer to https://www.url.com/?orderId={{id}}&fiatCurrency={{code}}&cryptoCurrency={{code}}&fiatAmount={{amount}}&cryptoAmount={{amount}}&isBuyorSell=Sell&status={{orderStatus}}&walletAddress={{address}}&totalFeeInFiat={{amount}}&partnerCustomerId={{id}}&partnerOrderId={{id}}&network={{code}}

walletRedirection

Usage

  1. When walletRedirection=true is passed along with redirectURL query param in case of SELL flow i.e. productsAvailed=SELL then:
    1. User will be redirected to the redirect URL with order info appended as parameters as mentioned here when user clicks on 'Transfer Crypto' CTA on 'Complete Your Transfer' page.
    2. An event called TRANSAK_WALLET_REDIRECTION is sent across with the following javascript object:
      {
      orderId: <Transak order ID>
      fiatCurrency: <Payout fiat currency>
      cryptoCurrency: <Token symbol to be transferred>
      fiatAmount: <Expected payout fiat amount>
      cryptoAmount: <Amount of crypto to be transferred>
      isBuyOrSell: <Will be 'Sell' in case of off ramp>
      status: <Transak order status>
      walletAddress: <Destination wallet address where crypto should be transferred>
      totalFeeInFiat: <Total fee charged in local currency for the transaction>
      partnerCustomerId: <Partner's customer ID (if present)>
      partnerOrderId: <Partner's order ID (if present)>
      network: <Network on which relevant crypto currency needs to be transferred>
      }
    3. It is upto the partner to redirect users to their crypto withdrawal page by pre-filling the relevant withdrawal details from the URL parameters or the frontend event json object.
  2. If redirectUrl query param is not passed along with walletRedirection then:
    1. Only the TRANSAK_WALLET_REDIRECTION frontend event is sent along with the order metadata as mentioned above in point 1. (ii)
    2. Partner can read the above event and redirect users to their crypto withdrawal page by pre-filling the relevant withdrawal details (from the above mentioned js object) like:
      1. cryptoCurrency
      2. cryptoAmount
      3. network
      4. walletAddress

nftData

[
        {
          imageURL: "https://pokemon-nfts.s3.ap-southeast-2.amazonaws.com/images/1.png",//String
          nftName: "Pokemon Metadata Legends", //String
          collectionAddress: "0x8a20e9e8e736643161ce6a2fe8dd8dd62050cd1e",//String
          tokenID: ["6","7","8"],//Array(string
          price: [15,15,15],//Array(number)
          quantity: 3,//Number
          nftType: "ERC721"//String (ERC721 or ERC1155)
        }
      ]

calldata

0xfb0f3ee1000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020d5b876e293000000000000000000000000000e800cda92e3c434bf3b6412ec620f349f37fe4df000000000000000000000000004c00500000ad104d7dbd00e3ae0a5c00560c000000000000000000000000000baeccd651cf4692a8790bcc4f606e79bf7a3b1c00000000000000000000000000000000000000000000000000000000000017c5000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000065ec02b10000000000000000000000000000000000000000000000000000000065ec57040000000000000000000000000000000000000000000000000000000000000000360c6ebe0000000000000000000000000000000000000000891d4fbc73a691d50000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f00000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000f029d782d10000000000000000000000000000000a26b00c1f0df003000390027140000faa719000000000000000000000000000000000000000000000000003c0a75e0b44000000000000000000000000000c52351897e3295286ce38775e3741fb81bee928d0000000000000000000000000000000000000000000000000000000000000040a1acca3d0a6189df6b89c755580dc6b7bb897f033a1b5d2f6e124ef24d99020e2f132444edb4d20b2e9fc0cf0d81d4cd69287ef848345d4eb6e12a923a9d392972db8c0b

cryptoCurrencyData

[
  {
    "cryptoCurrencyCode": "AUSDC",
    "cryptoCurrencyName": "Aave USDC",
    "cryptoCurrencyImageURL": "https://assets.coingecko.com/coins/images/11674/standard/aUSDC.png?1696511564"
  }
]

sourceTokenData

[
  {
    "sourceTokenCode": "USDC",
    "sourceTokenAmount": 10
  }
]

tokenData

[
  {
    nftName: "Fight Club",
    imageURL: "https://i.seadn.io/s/raw/files/c9c65ccb29917aa39b449573090b9222.png",
    collectionAddress: "0xc491a4a3601e9923366823523efe29415f6430c3",
    tokenID: ["0", "1", "2"],
    marketplace: "opensea",
    normalizeRoyalties: false
  }
]

How to generate calldata

In this example we are creating calldata for depositing funds into AAVE protocol but same method can be used to generate calldata for NFT trades, staking, borrowing/lending or any other smart contract function.