-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: functions issue in nft dapp #348
base: develop
Are you sure you want to change the base?
Conversation
Pull request analysis by VIZIPI Below you will find who is the most qualified team member to review your code. Reviewers with knowledge related to these changes
Potential missing files from this Pull requestfiles commonly committed with a subset of this pr, but not committed this time. (click to collapse)
Committed file ranks(click to expand)96.34% [docs/quick-start/developers/nft-dapp/index.md] |
@@ -1042,10 +979,9 @@ const createNftToken = async (values: INftParams) => { | |||
memo: "We are issuing nftToken", | |||
}); | |||
setTransactionStatus(false); | |||
} catch (error: any) { | |||
} catch (error) { | |||
console.error(error, "=====error"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleerror?
@@ -1416,7 +1352,7 @@ const transferNftToOtherAccount = async (values: { | |||
await delay(3000); | |||
|
|||
handleReturnClick(); | |||
} catch (error: any) { | |||
} catch (error) { | |||
console.error(error.message, "=====error"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleerror?
@@ -525,7 +511,7 @@ const GetParentChainHeight = async () => { | |||
const result = await tdvwCrossChainContract.GetParentChainHeight.call() | |||
// Return the parent chain height if it exists, otherwise return an empty string. | |||
return result ? (result.value as string) : ""; | |||
} catch (error: any) { | |||
} catch (error) { | |||
// If there's an error, log it and return an error status. | |||
console.error(error, "=====error in GetParentChainHeight"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleerror?
### 4.3 Create NFT Collection on dAppChain | ||
|
||
:::tip | ||
ℹ️ Note: This step cannot be executed via the command line interface (CLI). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how should the user execute this step?
}, | ||
sideChainSmartContract: IContract | ||
): Promise<number> => { | ||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ignore?
|
||
- Replace the existing **`fetchNftBalances`** function with this code snippet: | ||
|
||
```javascript title="commonFunctions.ts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ts
|
||
- Replace the existing **`fetchUserNftData`** function with this code snippet: | ||
|
||
```javascript title="commonFunctions.ts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ts
|
||
- Replace the existing **`getNFTData`** function with this code snippet: | ||
|
||
```javascript title="home/index.tsx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsx
|
||
- Replace the existing **`getNFTData`** function with this code snippet: | ||
|
||
```javascript title="profile/index.tsx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsx
|
||
#### Install necessary packages and libraries | ||
|
||
- Run teh following command in the terminal: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
|
||
2. Replace the form variable with this code snippet: | ||
|
||
```javascript title="transfer-nft/index.tsx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsx
|
||
2. Replace the form variable with this code snippet: | ||
|
||
```javascript title="transfer-nft/index.tsx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsx
|
||
2. Replace the form variable with this code snippet: | ||
|
||
```javascript title="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ts
remove title=""
if no title is needed
2. **Parameters:** It takes `values`, which is inferred from the `formSchema` and represents the form's data. | ||
3. **Calls Transfer Function:** It calls the `transferNftToOtherAccount` function with the form values to initiate the NFT transfer. | ||
|
||
Now that we've written all the necessary frontend functions and components, we're ready to run the NFT dApp application in the next step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dApp stands for "decentralised application", no need to add "application" after "dApp"
No description provided.