How To Trade Digital Assets
Simple Examples Showing How To Trade Digital Assets
Protokol NFT set comes with full trading capabilities built-in and tracked on the digital ledger. In the following section we are going to explain the basic trading process supported with code examples.
STEP 1. Auction Creation And Cancellation
We can open a new auction by using the NFTAuction Transaction Type. Auction can set the following fields:
startAmount - minimal starting amount
expiration - set in block height (when we stop accepting bid for our items)
nftIds - list of owned items we want to auction
Only an auction owner can cancel an auction.
How To Create An Auction
Initialization
NFTAuction - Builder
How To Cancel An Auction
To cancel an auction we need to specify auctionId and be owners of the specific auction.
NFTAuctionCancel - Builder
STEP 2. Biding On Auction Items
We can create a bid for NFT items being available for sale via NFTAuctions (Step 1). To bid on a specific auction we need to define the following fields:
bidAmount (our bidAmount) - needs to be higher that auction start Amount
auctionId - id of auction we are bidding for.
When a bid is issued, the users balance is locked for the duration of this bid. The user can always check their locked balance on the wallet endpoint via exchange endpoints.
How To Create A Bid
NFTBid - Builder
How To Cancel A Bid
To cancel a bid we need to specify a bidId and be owners of the specific bid.
NFTBidCancel - Builder
STEP 3. Accepting A Trade
We can accept a trade by specifying the sub-transactions related to closing a specific trade. These transactions are:
auctionId - id of a NFTAuction Transaction (Step 1)
bidId - id of a NFTBid Transaction (Step 2)
Both IDs correspond with the seller request and bidder offerings. The seller is responsible for which bid he is willing to accept.
When a trade is accepted all other bids are canceled, and locked balances are returned to the bidders.
How to Accept A Trade
NFTAcceptTrade - Builder
Last updated