How can I implement buy Nft Item from marketplace service properly?
We support Nft listing with different currencies on the marketplace. Therefore, during the purchase of an Nft Item listed on the marketplace, the steps to be taken may vary depending on the currency offered for sale.
If the Nft Item that you want to buy has been put up for sale with the coin of the blockchain you are working on, you can continue the flow by using the Init Buy Nft Item From Marketplace service.
If the Nft Item that you want to buy has been put up for sale with a crypto token (ERC-20), we need to check whether the buyer address allows the crypto tokens to be used during the purchase. If permissioned, purchase can be performed on the marketplace without getting an error on the blockchain. Otherwise the permission process must be performed first. You can see QafNft services below that should be used to perform this flow.
Check Marketplace Token Allowance
If the service returned true, it means that the approval permission has been received. You can continue with the Init Buy Nft Item From Marketplace service.
If the service returned false, it means that the approval permission has not been received. You need to get approval permission using the Init Marketplace Token Allowance service.
Init Marketplace Token Allowance
This service will be returned Init transaction information. You should trigger the user's wallet provider with the returned information and confirm the transaction.
After you see that the approved transaction has been completed successfully, you can continue the flow by using the Init Buy Nft Item From Marketplace service.
Init Buy Nft Item From Marketplace
This service will be returned Init transaction information. You should trigger the user's wallet provider with the returned information and confirm the transaction.
After you see that the approved transaction has been completed successfully, you can retrieve the information of your sold Nft Items using the Filter Marketplace Items service.
Last updated