API
zAuction bid data management
zAuction API code and build instructions can be found at
https://github.com/zer0-os/zAuction-API
The zAuction API is a service helping access storage of signed bid messages.
It helps encode bid data for signing, and stores the user-signed message after verification that the user has signed valid data that can be submitted in a successful transaction. It can retrieve bids for a single NFT, a list of NFTs, and for an account.
The intended bid flow is:
User chooses amount to bid on NFT ->
Client sends data to 'Encode bid', which returns the data to sign ->
User signs data with their locally stored private key ->
Client sends signed data to 'Create bid', which validates and stores the bid
Acceptance of bids happens on-contract and does not go through the API. When a bid is accepted by the owner of that NFT, the acceptBid contract function will ensure all the correct properties are set and the bid is not fraudulent. These properties include checking whether the bid is within the specified block range for the auction, that the bid is large enough, and that it is being accepted by an account that is not the same as the bidding account. To avoid any accidental replication, the unique pairing of bidder and auctionId are also marked as consumed. Once this is the case, the payment transfers occur to send funds from the bidder to the owner for the NFT itself, as well as the top level domain owner as a subdomain fee, and to the minter of that domain as a royalty. The NFT transfer is the final step in this process once all payments are confirmed, and moves the NFT from the current owner to the bidder.
Last modified 1yr ago