Transfers

On each of the supported chains, Fordefi supports creating arbitrary tranasctions in their most general form. For example, on EVM chains, you can create an arbitrary contract call, and on Solana, you can execute any list of instructions. That said, for the most common use case of transferring assets (native or tokens), Fordefi supports a special purpose transaction type. To create a transfer transaction, you can set the details.type field within the request body to the transfer type (e.g. evm_transfer, solana_transfer, etc.). For more info, see the documentation for the specific chain: EVM, Solana, Sui, Ton, Solana, Sui, Ton.

Max Transfer

To empty your balance of a specific asset, you can set create a maximum-amount transfer transaction, by setting the value.type field to max. Following is an example showing how to construct such a transaction for an ERC-20 token. On all other chains, the valueobject should look the same as in the example below both for native asset and tokens.

{
   "signer_type":"api_signer",
   "type":"evm_transaction",
   "details":{
      "type":"evm_transfer",
      "gas":{
         "type":"priority",
         "priority_level":"medium"
      },
      "to":"0xB572Cf029bD939B260b16A97036456d6165F2222",
      "value":{
         "type":"max"
      },
      "asset_identifier":{
         "type":"evm",
         "details":{
            "type":"erc20",
            "token":{
               "chain":"ethereum_mainnet",
               "hex_repr":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
            }
         }
      }
   },
   "note":"Emptying USDC",
   "vault_id":"8988893a-cf29-4a02-acc7-5bb723c74f47"
}