Skip to main content
Function Signature
Parameters
  1. chainId: The chain identifier in CAIP-2 format (e.g., “eip155:1” for Ethereum mainnet)
  2. params: A BuildTransactionParam object containing:
    • to: Recipient’s address
    • token: Token identifier or contract address
    • amount: Amount to transfer as a string
Returns A BuildEip115TransactionResponse containing:
  • transaction: An Eip115Transaction object with:
    • from: Sender’s address
    • to: Recipient’s address
    • data: Optional transaction data for contract interactions
    • value: Optional transaction value in wei
  • metadata: A BuildTransactionMetaData object containing:
    • amount: Formatted transaction amount
    • fromAddress: Sender’s address
    • toAddress: Recipient’s address
    • tokenAddress: Optional token contract address for ERC20 transfers
    • tokenDecimals: Number of decimal places for the token
    • tokenSymbol: Optional token symbol
    • rawAmount: Raw transaction amount value
  • error: Optional error message if the build process encounters issues
Example Usage
Implementation Notes
  1. Transaction Types:
    • For native ETH transfers, use “ETH” as the token identifier
    • For ERC20 transfers, use the token’s contract address as the token identifier
    • Amount should be provided in the token’s smallest unit (wei for ETH, token-specific decimal places for ERC20)
  2. Token Handling:
    • Native ETH is identified by “ETH” token value
    • ERC20 tokens are identified by their contract address
    • Amount decimal places must match the token’s decimal configuration
  3. Amount Formats:
    • ETH amounts should be in wei (1 ETH = 1e18 wei)
    • Token amounts should account for the token’s decimal places
    • All amounts should be provided as strings to preserve precision
  4. Error Handling:
    • Check response.error for build-specific issues
    • Validate addresses are in correct Ethereum format
    • Verify amount format matches token decimals
    • Handle network-specific errors during transaction building
Related Documentation For more information about transaction building, see: