Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions docs/quick-start/developers/nft-dapp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ const createNftCollectionOnMainChain = async (values: {
totalSupply: string;
decimals: string;
}) => {
let createLoadingId;
let createLoadingId: any;
try {
createLoadingId = toast.loading("Creating NFT Collection..");

Expand Down Expand Up @@ -415,7 +415,7 @@ Next, we'll write the **Validate Collection Info Exist** function.
// step 2 - Validate Collection information exist
// This function validates if the token collection information already exists on the main blockchain.
const validateNftCollectionInfo = async (values: INftInput) => {
let validateLoadingId
let validateLoadingId: any;
try {
// Start Loading before initiate the transaction
validateLoadingId = toast.loading(
Expand Down Expand Up @@ -459,7 +459,7 @@ const validateNftCollectionInfo = async (values: INftInput) => {
const sideIndexMainHeight = await GetParentChainHeight();
if (
// check the latest index Hight is grater than or equal
sideIndexMainHeight >= VALIDATE_TXRESULT.Transaction.RefBlockNumber
Number(sideIndexMainHeight) >= VALIDATE_TXRESULT.Transaction.RefBlockNumber
) {
VALIDATE_TXRESULT = await aelf.chain.getTxResult(VALIDATE_TXID);
heightDone = true;
Expand Down Expand Up @@ -599,7 +599,7 @@ const createCollectionOnSideChain = async (
signedTx: string,
BlockNumber: number
) => {
let crossChainLoadingId;
let crossChainLoadingId: any;
try {
crossChainLoadingId = toast.loading(
"Creating Collection on SideChain..."
Expand Down Expand Up @@ -656,7 +656,7 @@ const createCollectionOnSideChain = async (
type: "error",
isLoading: false,
});
removeNotification(validateLoadingId);
removeNotification(crossChainLoadingId);
return "error";
}
};
Expand Down Expand Up @@ -771,7 +771,7 @@ Now, let's write the Validate NFT Info Exist function.
```javascript title="create-nft/index.tsx"
// step 7 - Validate an NFT token on the maincgit stashhain
const validateNftToken = async (values: INftParams) => {
let validateNFTLoadingId;
let validateNFTLoadingId: any;
try {
// Start Loading before initiate the transaction
validateNFTLoadingId = toast.loading(
Expand Down Expand Up @@ -820,7 +820,7 @@ const validateNftToken = async (values: INftParams) => {
const sideIndexMainHeight = await GetParentChainHeight();
if (
// check the latest index Hight is grater than or equal
sideIndexMainHeight >= VALIDATE_TXRESULT.Transaction.RefBlockNumber
Number(sideIndexMainHeight >= VALIDATE_TXRESULT.Transaction.RefBlockNumber)
) {
VALIDATE_TXRESULT = await aelf.chain.getTxResult(VALIDATE_TXID);
heightDone = true;
Expand All @@ -844,13 +844,13 @@ const validateNftToken = async (values: INftParams) => {
signedTx: signedTx,
merklePath: merklePath,
};
} catch (error) {
} catch (error: any) {
toast.update(validateNFTLoadingId, {
render: error.message,
type: "error",
isLoading: false,
});
removeNotification(validateLoadingId);
removeNotification(validateNFTLoadingId);
return "error";
}
};
Expand Down Expand Up @@ -885,7 +885,7 @@ Now, let's write the Create NFT on dAppChain function.
```javascript title="create-nft/index.tsx"
// step 8 - Create a NFT on dAppChain.
const createNftTokenOnSideChain = async (values: INftValidateResult) => {
let createSideChainNFTLoadingId;
let createSideChainNFTLoadingId: any;
try {
createSideChainNFTLoadingId = toast.loading(
"Creating NFT on SideChain..."
Expand All @@ -911,7 +911,7 @@ const createNftTokenOnSideChain = async (values: INftValidateResult) => {
});
removeNotification(createSideChainNFTLoadingId);
return "success";
} catch (error) {
} catch (error: any) {
toast.update(createSideChainNFTLoadingId, {
render: error.message,
type: "error",
Expand Down Expand Up @@ -950,7 +950,7 @@ const issueNftOnSideChain = async (values: {
amount: string;
memo: string;
}) => {
let issuingNFTLoadingId
let issuingNFTLoadingId: any;
try {
issuingNFTLoadingId = toast.loading(
"Issuing NFT on SideChain..."
Expand Down Expand Up @@ -1357,7 +1357,7 @@ const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
address: "",
amount: 0,
amount: "",
memo: "",
},
});
Expand Down
Loading