Well steps are same as of the 1st time. First I mint the NFT and then creating the app after this I put the NFT on sale, and I am not deleting the application id so when I resale the NFT I will not create the app again but that is the difference in resale, Here is the TestNet asset id you can check:
152083452
And here is the asset creation code:
const params = await algodClient.getTransactionParams().do();
const decimals = 0;
const defaultFrozen = false;
const unitName = assetName.substring(0, 6);
const txn = algosdk.makeAssetCreateTxnWithSuggestedParamsFromObject({
assetName: assetName,
assetURL: metaData.metaDataUrl,
decimals: decimals,
defaultFrozen: defaultFrozen,
from: connectedAddress.toString(),
suggestedParams: params,
total: 1,
unitName: unitName,
manager: connectedAddress.toString(),
freeze: connectedAddress.toString(),
clawback: connectedAddress.toString(),
});
Here is how I fund the app:
const fundAppTxn =
await algosdk.makePaymentTxnWithSuggestedParamsFromObject({
suggestedParams: {
...params,
},
from: accountaddress.toString(),
to: app_address,
amount: fundingAmount,
});
And here is how I can configure the asset:
const tx = await algosdk.makeAssetConfigTxnWithSuggestedParamsFromObject({
from: connectedAddress.toString(),
assetIndex: nftID,
clawback: appAddr,
freeze: appAddr,
suggestedParams: params,
strictEmptyAddressChecking: false,
manager: appAddr,
});