Send tokens

Here's exactly how you can send tokens from your Portal wallet to another address.

Now that you have a Portal wallet, let's send some tokens.

To do that, first we need to fund the Portal wallet with both the chain's native token (to cover gas fees) and any other token you'd like to send (e.g. USDC). Check out our Testnet faucets page to get some free tokens.

Next, we can use portal.sendAsset to easily send tokens to another address.

Here is a simple example where we will send 1 USDC on Ethereum Sepolia:

// Fund your Portal wallet with ETH for gas fees + 1 USDC.

// Next, send the 1 USDC to whomever you'd like.
const txHash = await portal.sendAsset(
  '0xDestinationAddress',
  'USDC', // Token
  '1', // Sends 1 USDC
  'eip155:11155111' // Sepolia
)

// You can look up the transaction details on your chain's explorer (e.g. Etherscan, etc.)
console.log(`✅ Transaction hash: ${txHash}`)

Ensure you have set the gateway URL correctly with Infura, Alchemy, etc. when you initialize the Portal class.

You just sent your first token from your Portal wallet, that's awesome! 🎉

You may have a more advanced use case than simply sending tokens from your Portal wallet. Next, we will dive into how to build your own transaction and also how to sign it (without submitting it).

Last updated