diff --git a/docs/tutorials/nodejs/batchingTransactions.md b/docs/tutorials/nodejs/batchingTransactions.md index de5d4e50..94a56c78 100644 --- a/docs/tutorials/nodejs/batchingTransactions.md +++ b/docs/tutorials/nodejs/batchingTransactions.md @@ -5,7 +5,7 @@ sidebar_position: 4 # Batching Multiple Transactions -In this guide, we will edit the functionality in the previous section to not only mint a gassless transaction but to showcase batching transactions by minting multiple transactions together. +In this guide, we will edit the functionality in the previous section to not only mint a gasless transaction but to showcase batching transactions by minting multiple transactions together.
Click to view code from previous section @@ -126,8 +126,10 @@ mintNFT(); Our Focus for this edit will be on the following section of the mintNFT function: ```typescript + const smartAccount = await createAccount(); + const address = await smartAccount.getAccountAddress(); -const nftInterface = new ethers.utils.Interface([ + const nftInterface = new ethers.utils.Interface([ "function safeMint(address _to)", ]); @@ -148,7 +150,7 @@ const nftInterface = new ethers.utils.Interface([ ``` -We start constructing our transaction here and pass the transaction to an array within the Smart Accounts `buildUserOp` method. The quickest edit we can do here is simply pass the transaction multiple times: +We begin by constructing a transaction and then pass it multiple times to the `buildUserOp` method of Smart Accounts. For simplicity, we'll just copy the same `transaction` object multiple times in the array. ```typescript @@ -160,9 +162,8 @@ let partialUserOp = await smartAccount.buildUserOp([transaction, transaction], { ``` -Passing the transaction twice in the Array will allow you to mint multiple NFTs in one transaction. This is useful for use cases such as using NFT's as a ticketing system and needing to mint multiple tickets, or creating one click experiences in defi by passing multiple types of transactions into the array. - -Try running the script yourself with this edit and you will notice multiple mints in the transaction details, allowing you to save gas in cases where users need to conduct multiple transactions. +By duplicating the `transaction` in the array, we enable the minting of several NFTs in a single operation. This approach is ideal for scenarios like **issuing multiple tickets via NFTs** or **streamlining DeFi interactions with one-click multi-transactions**. -In the next section we'll take a look at converting our script from being a gasless transaction to now instead paying for gas using an ERC20 token. +By making this change to your script, you can mint multiple NFTs in a single transaction, which saves on gas fees for multiple actions. +Next, we'll transition our script from **gasless transactions** to **utilizing ERC20 tokens for gas payments**.