TxnToast
The TxnToast component is a toast of transactions with metadata.
Installation
1. Install Dependencies
TxnToast requires Solana Wallet Adapter and must be wrapped in a Connection provider component.
2. Install shadcn/ui toast component
Use shadcn/ui CLI or manually install the shadcn/ui toast component.
3. Install SolanaUI TxnToast
Copy the code below to src/components/sol/txn-toast.tsx
.
5. Add Toaster to your app
6. Use TxnToast
Import the useTxnToast
hook and use it in your app.
API
Call txnToast()
to initiate a toast in pending state. The returned object has confirm
and error
methods to update the toast state.