You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/portal/src/app/transactions/page.mdx
+41-5Lines changed: 41 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,20 +146,56 @@ Send, monitor, and manage transactions. Send transactions from user or server wa
146
146
147
147
### Send a Transaction
148
148
149
-
Send a transaction from a [user wallet](/connect/wallet/sign-in-methods/configure) or [server wallet](/connect/wallet/server)using the [`sendTransaction`](/references/typescript/v5/sendTransaction) function.
149
+
Send a transaction from a [user wallet](/connect/wallet/sign-in-methods/configure)from the frontend, or [server wallet](/connect/wallet/server)from the backend.
150
150
151
-
The `account` parameter is the wallet that will be used to send the transaction. You can get an account object from a user wallet or a server wallet.
On the frontend, you can use the [`sendTransaction`](/references/typescript/v5/sendTransaction) function to send a transaction from user wallets. The `account` parameter is the wallet that will be used to send the transaction. You can get an account object from a user wallet or a server wallet.
152
159
153
160
```typescript
154
161
import { sendTransaction } from"thirdweb";
155
162
163
+
// connect user wallet
164
+
const wallet =inAppWallet();
165
+
const account =awaitwallet.connect({ client });
166
+
167
+
// send transaction
156
168
const { transactionHash } =awaitsendTransaction({
157
-
account: wallet.getAccount(),
169
+
account,
158
170
transaction,
159
171
});
160
172
161
173
console.log("transaction sent", transactionHash);
162
174
```
175
+
</TabsContent>
176
+
177
+
<TabsContentvalue="backend">
178
+
On the backend, you can use the server wallet to enqueue a transaction. Enqueued transactions is recommended to not block your server. You can then monitor the transaction status using the [transaction monitor](/transactions/monitor) API.
0 commit comments