An offer is a proposal to buy or sell an NFT (non-fungible token) at a specific price. Offers can be initiated by either the buyer or the seller and can be accepted or rejected by the other party. Offers allow users to negotiate and agree on a price for an NFT outside of the standard listing price. Once an offer is accepted by both parties, the NFT is transferred to the buyer and the seller receives the agreed-upon token
Create an offer
constoffer= {"price":0.01,"endTime":"Wed Mar 01 2023 20:48:16 GMT+0700 (Indochina Time)","assetId":"e304962a-b76a-11ed-afa1-0242ac120002"}constresult=awaitclient.createOffer(offer);
Get an offer
constofferId="e304962a-b76a-11ed-afa1-0242ac120002"; // {String} Address of the ERC721 contractconstresult=awaitclient.getOffer(offerId);
Get list offers
var opts = {'chainId':"56",// {String} Chain ID'tokenAddress':"0x88Ef499ab1688DE727c21f1b72fAaEe1A3F455AD",// {String} Token address'tokenId':"1",// {String} Token ID'ownerId':"0x0dD768A47eA2395bbE5574E3252505fe1202C4A8",// {String} Owner ID'status':"",// {String} Status of these offers'limit':10,// {Integer} Limit'page':1,// {Number} Current page number'orderBy':"created_at",// {String} Property to sort by'direction':"desc"// {String} Direction to sort};constresult=awaitclient.getOffers(opts);
Accept an offer
constofferId="e304962a-b76a-11ed-afa1-0242ac120002"; // {String} Address of the ERC721 contractconstresult=awaitclient.acceptOffer(offerId);