If the tokenAddress hasn't been deployed, deployInWithdraw set to true will retrieve the deployment fee plus withdrawal fee.
If the tokenAddress is deployed, deployInWithdraw set to true will return withdrawal fee.
constfee=awaitLoopringAPI.userAPI.getNFTOffchainFeeAmt( { accountId:accInfo.accountId, requestType:sdk.OffchainNFTFeeReqType.NFT_WITHDRAWAL, tokenAddress:LOOPRING_EXPORTED_ACCOUNT.nftTokenAddress, deployInWithdraw:tokenInfo?.deploymentStatus ===DEPLOYMENT_STATUS.NOT_DEPLOYED,// when token is not deploy the fee is diff }, apiKey);console.log("fee:", fee);
Step 6: Withdraw
Congratulations! You have just withdrawn your NFT to Layer 1 from Loopring Layer 2!