Skip to main content

Function Signature

Description

Send tokens from your Portal wallet to another address. This is the recommended method for simple token transfers.

Parameters

Supported chainId values

sendAsset accepts chain IDs in CAIP-2 format (namespace:reference). The SDK routes by namespace, but the reference must be a chain Portal supports for sends — see Chain support. EVM sends also require an rpcConfig entry for the chain. For solana and bip122, only the specific references listed below are supported:
  • EVM chains (eip155 namespace):
    • 'eip155:1'
    • 'eip155:11155111'
    • etc.
  • Solana (solana namespace):
    • 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp' (Mainnet)
    • 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1' (Devnet)
  • Bitcoin (bip122 namespace):
    • 'bip122:000000000019d6689c085ae165831e93-p2wpkh'
    • 'bip122:000000000933ea01ad0ee984209779ba-p2wpkh'
See Chain ID formatting for the full CAIP-2 reference of chains Portal recognizes.
Bitcoin (bip122) is reference-specific. Only the two P2WPKH chain IDs above are accepted; any other bip122: reference is rejected with a PortalException with code SEND_ASSET_ERROR. Android support for Bitcoin requires portal_flutter 1.0.0 or later — on earlier versions a bip122: chain ID fails on Android.

Returns

String - The transaction hash. For Account Abstraction clients sending on EVM, this is a UserOperation hash rather than an on-chain transaction hash (see the warning below).
Account Abstraction clients: the returned txHash is a UserOperation hash, not an on-chain transaction hash — it will not resolve on a block explorer such as Etherscan or Monadscan. The on-chain transaction hash is only assigned once the bundler includes the UserOperation on-chain. Look up the UserOperation hash on a UserOp explorer such as JiffyScan to find the resulting transaction hash. See Account abstraction.

Example

Send ERC-20 Token

With Gas Sponsorship Control

Errors