BuyNFT
Purchase NFT on specified Marketplace.
Parameters
collection_address|string
- The address of the collection.
price|double
- The price of the NFT.
token_id|int
- The token_id of the NFT.
marketplace_address|string
- The address of the marketplace.
approveFinish|Action
- This action will be invoked after the user completes the permission verification in the approval process. You can use it to provide UI prompts. For example, in a game, after calling the current API, you can immediately display a "Waiting" UI. The SDK will then automatically pop up the permission verification interface. When the user enters the password on the interface and clicks "Return," this action will be called to close the previous "Waiting" UI.
action|Action<CommonResponse<EVMResBuyNFT>>
- The callback function of this method is used to receive the results.
Returns
response class
- CommonResponse<EVMResBuyNFT>
Code Example
string collection_address = "collection address on evm";double price = "NFT's price";int token_id = 1;string marketplace_address = "marketplace_address";Action approveFinish = null;MWSDK.BNB.Asset.BuyNFT(collection_address, price, token_id, marketplace_address, approveFinish, (res) => { CommonResponse<EVMResBuyNFT> resObj = res; long code = resObj.code; string message = resObj.message; EVMResBuyNFT buyResult = resObj.data; //todo...});
Edit this page on GitHub