walletAddressesData

🚧

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

Data Format

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

Convert the JSON to encoded data

encodeURIComponent(JSON.stringify({
  networks: {
    ethereum: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1' },
    polygon: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1', addressAdditionalData: '123456' },
  },
  coins: {
    BTC: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1' },
    DAI: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1' },
    BNB: { address: '0x6353D15E8A61df4eD412746654D44B8188a737C1', addressAdditionalData: '123456' },
  },
}))

Usage

&walletAddressesData=%7B%22networks%22%3A%7B%22ethereum%22%3A%7B%22address%22%3A%220x6353D15E8A61df4eD412746654D44B8188a737C1%22%7D%2C%22polygon%22%3A%7B%22address%22%3A%220x6353D15E8A61df4eD412746654D44B8188a737C1%22%2C%22addressAdditionalData%22%3A%22123456%22%7D%7D%2C%22coins%22%3A%7B%22BTC%22%3A%7B%22address%22%3A%220x6353D15E8A61df4eD412746654D44B8188a737C1%22%7D%2C%22DAI%22%3A%7B%22address%22%3A%220x6353D15E8A61df4eD412746654D44B8188a737C1%22%7D%2C%22BNB%22%3A%7B%22address%22%3A%220x6353D15E8A61df4eD412746654D44B8188a737C1%22%2C%22addressAdditionalData%22%3A%22123456%22%7D%7D%7D

userData

Data Format

{
  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',
  },
}

Convert the JSON to encoded data

encodeURIComponent(JSON.stringify({
  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',
  },
}))

Usage

&userData=%7B%22firstName%22%3A%22Satoshi%22%2C%22lastName%22%3A%22Nakamoto%22%2C%22email%22%3A%22satoshi.nakamoto%40transak.com%22%2C%22mobileNumber%22%3A%22%2B15417543010%22%2C%22dob%22%3A%221994-08-26%22%2C%22address%22%3A%7B%22addressLine1%22%3A%22170%20Pine%20St%22%2C%22addressLine2%22%3A%22San%20Francisco%22%2C%22city%22%3A%22San%20Francisco%22%2C%22state%22%3A%22CA%22%2C%22postCode%22%3A%2294111%22%2C%22countryCode%22%3A%22US%22%7D%7D

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

calldata

In case, you don't know how to generate calldata, refer this.

In case of multiple NFTs and a complicated contract, the size of calldata can exceed header limits.
To prevent this, you need to compress the calldata using a lossless compression library like Pako.

Data Format

0xf6ad734200000000000000000000000008d30445495bbcb3bab60ef5b4d1ecc3fcc65ae76334586972637676557a4e6d545756716e353456785a0000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000018b04b4d2650000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000300000000000000000000000021b51ec6fb7654b7e59e832f9e9687f29df94fb800000000000000000000000021b51ec6fb7654b7e59e832f9e9687f29df94fb800000000000000000000000088320b06e132dc1020e47fff61022e943466f51b00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000006423b872dd00000000000000000000000092b676d4caf95c07e33866d6e8cb40e65177f88a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006423b872dd00000000000000000000000092b676d4caf95c07e33866d6e8cb40e65177f88a000000000000000000000000b6e5b4c297d6b504f830d66093af4756a5ba798500000000000000000000000000000000000000000000000000000000000dbba00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4234af04600000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000092b676d4caf95c07e33866d6e8cb40e65177f88a000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000005330425000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a4223a1f675cf721b541bdfbce04162a35f57f5564b07a8165033dab325cf2a15495aac7dffb7d7bbf5c4211a536e8a98ed79728c47ceda5c8758a9726902fb41b00000000000000000000000000000000000000000000000000000000000000

Convert the string to encoded Base64-encoded ASCII compressed data

import pako from 'pako';

const callData = '0xf6ad734200000000000000000000000008d30445495bbcb3bab60ef5b4d1ecc3fcc65ae76334586972637676557a4e6d545756716e353456785a0000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000018b04b4d2650000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000300000000000000000000000021b51ec6fb7654b7e59e832f9e9687f29df94fb800000000000000000000000021b51ec6fb7654b7e59e832f9e9687f29df94fb800000000000000000000000088320b06e132dc1020e47fff61022e943466f51b00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000006423b872dd00000000000000000000000092b676d4caf95c07e33866d6e8cb40e65177f88a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006423b872dd00000000000000000000000092b676d4caf95c07e33866d6e8cb40e65177f88a000000000000000000000000b6e5b4c297d6b504f830d66093af4756a5ba798500000000000000000000000000000000000000000000000000000000000dbba00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4234af04600000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000092b676d4caf95c07e33866d6e8cb40e65177f88a000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000005330425000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a4223a1f675cf721b541bdfbce04162a35f57f5564b07a8165033dab325cf2a15495aac7dffb7d7bbf5c4211a536e8a98ed79728c47ceda5c8758a9726902fb41b00000000000000000000000000000000000000000000000000000000000000'

encodeURIComponent(btoa(String.fromCharCode.apply(null, pako.deflate(callData))))

Usage

&calldata=eJzFVkuuHDEIvJLN38cBY86Q44e3yqqjUVuT1KrVBmEXoorxq8RTkWA8wRIHEdPiiB0YHjJOcVDOszfW3sJ%2BVBCJTZaCoIoKszodSSZWFp1ykDtC1Ngfa73Gvkuf9DLPYlAzAcJX9f9C%2F4fApwOYwd0oqeieUOjhdQyh1lliWrCyFlXYt%2FKtg0cMORMh9xwwDmlVSX%2FCWYQkUjzjW%2B%2F%2FDHKXPu%2FSx7wdCSHAMIXMp4gF0VOZtL0W76EH0URSju2gcYSnapndXuSGiWnyBWn4CN%2FnL%2BS0Zm5YmhI8qAxHioyFXtQK6Ryuy250JCP%2BF3%2Bn%2BSOvQZeDdK2Dl5P4XP%2FfzM9LH%2FqD9%2B9nbJ%2BHOx97DZpOAOizRHmX%2FrgOzciKffpQwJGLtZiFYqjbbMdFTA%2BEjgefPwuK%2B9asdqrUiOJNMKczdo982Unt5cQ26T7pvE25f%2Fe6sgZU0K0D%2FQY6newc

nftData

Data Format

[
  {
    imageURL: 'https://gateway.ipfs.io/ipfs/QmdPYeQ63YPWzXaTeWA1EfK3yYY6WN4mQQkRHABDwXqhcb', //String
    nftName: 'My Test Collection', //String
    collectionAddress: '0x12bd...', //String
    tokenID: [123, 124, 167, 128], //Array(string)
    price: [12, 13, 23, 34], //Array(number)
    quantity: 4, //Number
    nftType: 'ERC721', //String (ERC721 or ERC1155)  
  }
]

Convert the JSON to encoded Base64-encoded ASCII data

encodeURIComponent(btoa(JSON.stringify([
  {
    imageURL: 'https://gateway.ipfs.io/ipfs/QmdPYeQ63YPWzXaTeWA1EfK3yYY6WN4mQQkRHABDwXqhcb',
    nftName: 'My Test Collection',
    collectionAddress: '0x12bd...',
    tokenID: [123, 124, 167, 128],
    price: [12, 13, 23, 34],
    quantity: 4,
    nftType: 'ERC721',
  }
])))

Usage

&nftData=W3siaW1hZ2VVUkwiOiJodHRwczovL2dhdGV3YXkuaXBmcy5pby9pcGZzL1FtZFBZZVE2M1lQV3pYYVRlV0ExRWZLM3lZWTZXTjRtUVFrUkhBQkR3WHFoY2IiLCJuZnROYW1lIjoiTXkgVGVzdCBDb2xsZWN0aW9uIiwiY29sbGVjdGlvbkFkZHJlc3MiOiIweDEyYmQuLi4iLCJ0b2tlbklEIjpbMTIzLDEyNCwxNjcsMTI4XSwicHJpY2UiOlsxMiwxMywyMywzNF0sInF1YW50aXR5Ijo0LCJuZnRUeXBlIjoiRVJDNzIxIn1d

cryptoCurrencyData

Data Format

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

Convert the JSON to encoded Base64-encoded ASCII data

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

sourceTokenData

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

Convert the JSON to encoded Base64-encoded ASCII data

encodeURIComponent(btoa(JSON.stringify([
  {
    "sourceTokenCode": "USDC",
    "sourceTokenAmount": 10
  }
])))

tokenData

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

Convert the JSON to encoded Base64-encoded ASCII data

encodeURIComponent(btoa(JSON.stringify(
[
  {
    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 WBTC into Testnet AAVE protocol but same method can be used to generate calldata for NFT trades, staking, borrowing/lending or any other smart contract function.