Skip to content

Commit bc7d7f7

Browse files
fix: added space between lines for formate the docs
1 parent fd4c384 commit bc7d7f7

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

docs/quick-start/advance-tutorials/nft-indexer/_frontend_fetch_nft_data.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
### Fetch NFT Data
2+
23
Let's write the Function for the fetch NFT data from user's Wallet using API.
4+
35
**Step 1: Locate the File**
6+
47
- go to the `src/lib/commonFunctions.ts` file.
8+
59
**Step 2: Write the Helper Functions for fetch the NFT data**
10+
611
- The `commonFunctions.ts` file is contains the helpers function for fetch NFT and etc.
712
- Find the comment `// fetch NFT Data from Indexer API`.
813

@@ -61,7 +66,9 @@ export const fetchUserNftData = async (address:string) => {
6166
1. **Retrieves NFT Data:** The function `fetchUserNftData` fetches the NFT data for a given owner using AeIndexer API.
6267
We have Prepared all necessary function for fetch NFT Data from User's Wallet.
6368
Now, Let's call **`fetchUserNftData`** on necessary page.
69+
6470
**Step 3: Call fetchUserNftData Functions on Home Page**
71+
6572
- go to the `src/pages/home/index.tsx` file.
6673
- The `home/index.tsx` file contains the Home Page of NFT dApp
6774
- Find the comment `// get NFT Data from User's wallet`.
@@ -84,7 +91,9 @@ const getNFTData = async () => {
8491
3. **Handles Result:** It checks the result:
8592
- If the result is not "error", it updates the state with the fetched NFT data by calling `setUserNfts(result)`.
8693
4. **Updates Loading State:** Regardless of the result, it sets the loading state to false by calling `setLoading(false)`.
94+
8795
**Step 4: Call fetchUserNftData Functions on Profile Page**
96+
8897
- go to the `src/pages/profile/index.tsx` file.
8998
- The `profile/index.tsx` file contains the Home Page of NFT dApp
9099
- Find the comment `// get NFT Data from User's wallet`.

docs/quick-start/advance-tutorials/nft-indexer/_frontend_nft_submit_form.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Configure Submit Form
22
Now, let's write a function to call necessary functions for NFT creation.
3-
1. Scroll down to find the comment `// Step 11 - Handle Submit Form`.
3+
1. Scroll down to find the comment `//Step 11 - Handle Submit Form`.
44

55
2. Replace the existing **`onSubmit`** function with this code snippet:
66

docs/quick-start/advance-tutorials/nft-indexer/_frontend_nft_token.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### Create NFT Token
22
**Step 1: Write a Function to create NFTs on the mainchain**
3+
34
Now, let's write the **create NFTs on MainChain** function.
45
1. Scroll down to find the comment `// step 6 - Create an NFT on the mainchain`.
56

@@ -59,7 +60,9 @@ const createNFTOnMainChain = async (values: INftParams) => {
5960
4. **Handles Success:** Updates the notification to show successful NFT creation.
6061
5. **Handles Errors:** Displays an error message if the operation fails and logs the error.
6162
6. **Final Return:** Returns `"success"` if the NFT is created successfully; otherwise, returns `"error"`.
63+
6264
**Step 2: Write the Function for Validate NFT Info Exist**
65+
6366
Now, let's write the Validate NFT Info Exist function.
6467
1. Scroll down to find the comment `// step 7 - Validate an NFT token on the mainchain`.
6568

@@ -157,7 +160,9 @@ const validateNftToken = async (values: INftParams) => {
157160
6. **Fetches Merkle Path:** Retrieves the Merkle path for the validated transaction.
158161
7. **Handles Success:** Updates the notification to show successful validation and returns necessary values.
159162
8. **Handles Errors:** Logs errors and returns `"error"` if something goes wrong.
163+
160164
**Step 3: Write a Function for Create NFT on dAppChain**
165+
161166
Now, let's write the Create NFT on dAppChain function.
162167
1. Scroll down to find the comment `// step 8 - Create a NFT on dAppChain`.
163168

@@ -202,8 +207,11 @@ const createNftTokenOnSideChain = async (values: INftValidateResult) => {
202207
3. **Calls Smart Contract Method:** Sends the transaction to the dAppChain smart contract to create the NFT.
203208
4. **Handles Success:** Updates the notification to show successful NFT creation on the dAppChain.
204209
5. **Handles Errors:** Logs errors and returns `"error"` if something goes wrong.
210+
205211
**Step 4: Write a Function for Issue NFT Token which has been Created on dAppChain.**
212+
206213
Now, let's write the Issue NFT Function.
214+
207215
1. Scroll down to find the comment `// step 9 - Issue a NFT Function which has been Created on dAppChain`.
208216

209217
2. Replace the existing **`issueNftOnSideChain`** function with this code snippet:
@@ -255,8 +263,11 @@ const issueNftOnSideChain = async (values: {
255263
3. **Calls Smart Contract Method:** Sends the transaction to the dAppChain smart contract to issue the NFT.
256264
4. **Handles Success:** Updates the notification to show successful issuance and notifies the user that the NFT will appear in their wallet.
257265
5. **Handles Errors:** Logs and displays any error messages, updates the transaction status, and returns `"error"`.
266+
258267
**Step 5: Create a Function to Call Necessary Functions for NFT Creation**
268+
259269
Now, let's write the createNftToken Function.
270+
260271
1. Scroll down to find the comment `// step 10 - Call Necessary Function for Create NFT`.
261272

262273
2. Replace the existing **`createNftToken`** function with this code snippet:

docs/quick-start/advance-tutorials/nft-indexer/_frontend_transfer_nft.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
### Transfer NFT Token
2+
23
As we have completed `Create` and `Fetch NFT` so now it's time to `Transfer NFT`.
34
So now let's **Transfer NFT** to other wallet now.
5+
46
**Step 1: Locate the File**
7+
58
1. go to the `src/pages/transfer-nft/index.tsx` file. This file is the **Transfer NFT** page where users can enter details like the `address`, `amount` and `memo`.
9+
610
**Step 2: Prepare Form for Transfer NFT**
11+
712
1. Find the comment `// Configure NFT Transfer Form`.
813

914
2. Replace the form variable with this code snippet:
@@ -24,9 +29,12 @@ const form = useForm<z.infer<typeof formSchema>>({
2429
1. Initializes a new form variable with default values needed to transfer a nft.
2530
2. Fields include: `address` , `amount` , and `memo`.
2631
Now your form is ready for users to fill in the necessary details for their NFTs Transfer function Interaction.
32+
2733
**Step 3: Create NFT Transfer Function**
34+
2835
1. Find the comment `// Transfer NFT to Other Wallet`.
2936
2. Replace the form variable with this code snippet:
37+
3038
```tsx title="transfer-nft/index.tsx"
3139
// Transfer NFT to Other Wallet
3240
const transferNftToOtherAccount = async (values: {

0 commit comments

Comments
 (0)