Previewing transaction details before sending a transaction through Universal Accounts.
createBuyTransaction()
or any other transaction-related method.
You can use this preview to show users key transaction details before they confirm by including it in your transaction flow UI.
createBuyTransaction()
or similar methods, the SDK returns a structured preview object with key transaction details.
Here’s a breakdown of the main fields included in this preview:
createBuyTransaction
, but the same approach will apply to any transaction method supported by the SDK.formatUnits
from ethers.js
, but feel free to use any formatting utility that fits your stack.