This guide explains how to use Universal Accounts to convert existing Primary Assets across chains.
createUniversalTransaction()
.
createUniversalTransaction()
with the following parameters:
chainId
: the destination chain where the asset should be made availableexpectTokens
: a list of expected tokens and amounts you want to receive on the destination chaintransactions
(optional): an array of follow-up actions to execute after the conversion (e.g., contract interactions). When empty, the converted tokens are sent back to the Universal Account.createUniversalTransaction
ethers.js
:
TSX
component that implements the conversion flow.
This is a simple version and allows the user to convert any Primary Asset they hold into USDC on Base or Arbitrum.