Before getting started, make sure you followed Lesson 2 and have your Universal Account instance initialized.
Lesson Overview
This lesson covers:- Creating a convert assets across chains transaction
- Signing the transaction
- Broadcasting the transaction to the blockchain
Prerequisites
Before starting, make sure you have:- Initialized a Universal Account (see Lesson 1)
- Display the unified balance of your Universal Account (see Lesson 2)
- Basic familiarity with TypeScript and blockchain transaction concepts
Lesson 3 Video
The video below walks you through the process of creating and sending transactions:Get your Universal Accounts project ID from the Particle Dashboard.
TL;DR
This lesson covers:- Creating a convert assets across chains transaction using the
createConvertTransaction()
method - Signing the transaction using a connected wallet
- Broadcasting the transaction using
sendTransaction()
Creating a Convert Assets Across Chains Transaction
The Universal Accounts SDK allows you to create convert assets across chains transactions that convert any Primary Asset into a target token (e.g., USDT on Solana) without requiring the user to hold funds on the destination chain.The Universal Account SDK allows for various types of transactions, find more details in the Universal Accounts SDK reference.
Signing the Transaction
Once the transaction is created, the object returned includes arootHash
that must be signed by the user. Use the signMessage()
method from your connected provider:
Here is an example:
Sending the Transaction
After signing the transaction, you can broadcast it to the network as follows:sendTransaction()
method returns a TransactionResult
object, which includes the transaction ID and other metadata. You can link directly to the transaction details on UniversalX:
This approach abstracts away the complexities of chain-specific gas fees and liquidity routing, making it possible to send transactions without requiring the user to hold funds on the destination chain.
Next Steps
This marks the end of this course on the fundamentals of developing chain agnostic applications using Universal Accounts. You now have the foundational skills to create seamless, multi-chain dApps using the Universal Accounts SDK. To level up your Chain Abstraction skills, explore the How-to section for more advanced use cases, including:- How to preview transactions details
- How to use Universal Accounts as a deposit flow in existing apps
You can also join the ChADs (Chain Abstracted Developers) Telegram Group to ask questions, share knowledge, and connect with Chain Abstracted developers.