Did you try to auction NFTs using the application? You can check out this guide to sell an NFT using our no-code application.
The process of auctioning an NFT with NFT.Kred using the API takes on the same approach as auctioning it using our no-code application. We have an API /nft/auction which we can use to post an auction an NFTs using API.
curl --request POST \ --url 'https://api.nft.kred/nft/auction?token=YourTokenValue&mode=normal&nft=99999&reserve=70&maximum=100&minimum=50&start=9&end=14' \ --header 'Accept: application/json' \ --header 'Authorization: Basic am9obndvb2R5OTg1MkBnbWFpbC5jb206QWRtaW5AMTIzNA=='
Auction an NFT using Python-SDK is simple. This Python SDK bridges the gap between your applications and NFT.Kred APIs. Full-scale NFT solutions can be built in hours - instead of months. You can use NFT.Kred functionality via this python package and interact with the NFT.Kred APIs directly in your app.
Installation & Usage
We have created a tutorial on how you can install the Python SDK on your machine. Read our step-by-step guide on “How to install Python SDK” for more details. After importing the python SDK on the python file, please follow the below steps to sell an NFT using Python SDK.
Step 1: Import SDK Files
Create a python file and import the below necessary library files by adding the following code.
from kred import services from kred import models
Step 2: Define auction API method on your python file
Now we need to create a method that will call the "Auction an NFT" functionality on your code. Right now, we want to auction an NFT on NFT so we will use an "auction" method. we can check which method we should use by following the available examples related to the SocialActions, please have a look at the Example References documentation section, where all the available examples are given. You can copy those methods in your file and build your app.
def auction(token, mode='normal', nft=None, uuid=None, symbol=None, sequence=None, reserve=None, maximum=None, minimum=None, start=None, end=None): """Auction an NFT. """ # service class service = services.BuyingSellingClient(token) # parameters model = models.BuyingSellingModels() model.nft = nft # The ID of the NFT model.uuid = uuid # The UUID of the NFT. model.symbol = symbol # The symbol of the NFT batch. model.sequence = sequence #The sequence of the NFT within the batch. mode = mode # Auction mode - either normal or reverse. reserve = reserve # The reserve price for standard auctions. If this is not met, the auction will fail. maximum = maximum # The maximum (starting) price for reverse auctions. minimum = minimum # The minimum (ending) price for reverse auctions. start = start # The start time for the auction. end = end # The end time for the auction. # Service API calling response = service.auction(model, mode, reserve, maximum, minimum, start, end)
Step 3: Call your Defined method to auction an NFTs
From the above step, we have created a python file and defined an "auction" method to auction an NFT. Now we will call that method and pass the required parameter. We may have a look at the required parameter list by following this auction API endpoint.
# Define your token here token = "token value" # Call define method with values auction(token, mode, nft, uuid, symbol, sequence, reserve, maximum, minimum, start, end)
That's it, now, your NFT is listed for sale in the marketplace. Your NFT will immediately be listed in /nft/sales and /nft/marketplace, and a message will be sent notifying users that the NFT is for sale. (The notification is automatic, but a separate message can be sent with /nft/post if desired. You can also offer NFTs for trade using /nft/trade.
Auctions are listed in /nft/auctions and /nft/marketplace. If an auction expires without sale, it is automatically removed from the listings. Sales and auctions can be canceled at any time using /nft/cancel.
Updated 10 months ago