Skip to content

Commit 8abcf3d

Browse files
committed
[Portal] Update useSendTransaction docs (#4380)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview The focus of this PR is to update the example and improve clarity in the `useSendTransaction` hook documentation. ### Detailed summary - Updated the example from "Using a prepared contract call" to "Sending a prepared contract call" - Added comments for clarity in the example code - Added `chain` and `client` properties to the prepared transaction object > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 2ce8840 commit 8abcf3d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/thirdweb/src/react/web/hooks/transaction/useSendTransaction.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { TransactionModal } from "../../ui/TransactionButton/TransactionModal.js
1919
* Refer to [`SendTransactionConfig`](https://portal.thirdweb.com/references/typescript/v5/SendTransactionConfig) for more details.
2020
* @example
2121
*
22-
* ### Using a prepared contract call
22+
* ### Sending a prepared contract call
2323
*
2424
* ```tsx
2525
* import { useSendTransaction } from "thirdweb/react";
@@ -83,11 +83,12 @@ import { TransactionModal } from "../../ui/TransactionButton/TransactionModal.js
8383
* const { mutate: sendTx, data: transactionResult } = useSendTransaction();
8484
*
8585
* const onClick = () => {
86+
* // Send 0.1 SepoliaETH to an address
8687
* const transaction = prepareTransaction({
87-
* contract,
88-
* to: "0x...",
89-
* value: toWei("0.1"),
90-
* }),
88+
* to: "0x...",
89+
* value: toWei("0.1"),
90+
* chain: sepolia,
91+
* client: thirdwebClient,
9192
* });
9293
* sendTx(transaction);
9394
* };

0 commit comments

Comments
 (0)