We have built our APIs on top of the Metaplex protocol with a lot of added advantages. The goal here is to enable businesses to:
Build their own white labeled marketplaces with the minimum development effort.
Launch in-app marketplaces so that a dApps user never has to leave the dApp to purchase NFTs and creators can weave seamless experiences for their dApp's users.
These APIs are built with aim of powering many scalable marketplaces. Therefore there are a lot of systems that developers get without writing a single line of code. Some of these systems include:
Blockchain Data Cache:
All your marketplace data is cached in a MongoDB database instance, which always remains in sync with the blockchain data. You can do complex queries on this data, and enable cool experiences for your marketplace users.
Real-time Stats:
We give you stats like a collection's floor prices, average price, total traded volume, popular collections, and many more, and that too in real-time.
Auctions:
Allow your users to auction their NFTs and maximize their profits and play a fair game as all the bids are placed on-chain.
Flexible currency:
Choose SOL or any SPL token (USDC, mSol, RAY, or create your own)as the marketplace currency. Use this currency to sell and transact in the marketplace.
Updatable marketplaces:
Set up and update the properties of the marketplace like transaction fees, treasury withdrawal owner, marketplace update authority, and gas fee payment account.
Royalty Distribution
Our APIs ensure that the original creators of the NFT get their royalty whenever the NFTs are sold in your marketplaces.
In very simple terms these APIs enable you to iterate and build fast, cutting down on your go-to-market time.
Terminology
Shyft marketplace APIs create escrow-less marketplaces, where the NFTs remain in a user's wallet until the sale is complete. There are a few important concepts to understand and efficiently use these APIs.
Authority : The account which has the permission to update the marketplace properties and execute a withdrawal from the marketplace treasury. By default, the marketplace creator is the authority.
Creator : The account which pays the gas fee for executing the marketplace creation instruction.
Fee Recipient: The destination account address that will receive the funds whenever they are withdrawn from the marketplace treasury.
Fee Account: The account that pays the listing cost on behalf of the seller when used in gas less listing.
Fee Payer : An account that is used to pay for Solana fees for the seller and buyer if the marketplace chooses to execute the sale in the background.
Transaction Fee: The percentage of every sales transaction amount that will be deposited in the marketplace treasury. By default, all the Shyft-created marketplaces charge a 2% transaction fee.
Treasury: The marketplace treasury is an on-chain account where all the transaction fee received by the marketplace gets deposited and remains there until withdrawn.
Currency Address : The SPL token that is used as the currency in the marketplace. SOL is the default currency, if not provided while marketplace setup.
Currency Symbol : The on-chain symbol of the SPL token currency of the marketplace.
Listing : Before an NFT can be sold and bought by a user, it has to be listed for sale in the marketplace at a certain price. Listing represents an NFT on sale.
List State : An on-chain address where all the transactions that happen on an NFT listing are stored. This is unique for each NFT listing created. Generated at the time of list creation.
xxx_wallet : In the following doc, there are API input params ending with the wallet. These are essentially the accounts that pay the gas fee of the API's operation.
Tools
The post API calls return a transaction string object, that needs to be signed and sent to the blockchain.
A small tutorial and code snippet on how to programtically sign and send transactions on Solana can be found here, How to sign transactions on Solana.
Create Marketplace
Create your own on-chain NFT marketplace
POST /sol/v1/marketplace/create
Input Parameters:
Required Params:
network : string - either of [mainnet-beta, testnet, devnet]
creator_wallet: string - wallet address of the creator of the marketplace. This is the account that pays the gas fees for creating marketplace transactions.
Optional Params:
currency_address: string
fee_payer: string
fee_recipient: string
transaction_fee: number
Response:
A JSON object containing
Marketplace properties
encoded_tranaction: A base64 encoded transaction string to be signed with the creator_wallet.
var myHeaders =newHeaders();myHeaders.append("x-api-key","20CcwuFeQOIcfuHx");myHeaders.append("Content-Type","application/json");var raw =JSON.stringify({"network":"devnet","transaction_fee":10,"currency_address":"4TLk2jocJuEysZubcMFCqsEFFu5jVGzTp14kAANDaEFv","fee_payer":"EijtaNNHqqaPmWwAmUi8f1TC6gSPnqkoodQd2BLFpA8T","fee_recipient":"Eb3ykuiCtvGcqs4XRCASThFf4EUxrL7k3TZsytWkXTBe","creator_wallet":"Eb3ykuiCtvGcqs4XRCASThFf4EUxrL7k3TZsytWkXTBe"});var requestOptions = { method:'POST', headers: myHeaders, body: raw, redirect:'follow'};fetch("https://api.shyft.to/sol/v1/marketplace/create", requestOptions).then(response =>response.text()).then(result =>console.log(result)).catch(error =>console.log('error', error));
network:string- either of [mainnet-beta, testnet, devnet]
authority_wallet: string - wallet address of the marketplace authority.
marketplace_address: string - on-chain address of the marketplace that is to be updated.
Optional Params: Properties of the marketplace that can be updated, if not provided then left unchanged.
new_authority_address : string - account address that will be the new update authority of the marketplace.
new_transaction_fee: string - marketplace transaction fee will be set to this value if provided.
new_fee_payer: string - updates the marketplace's fee payer account address.
fee_recipient : string - updates the marketplace's fee recipient . If your marketplace is using any SPL token currency other than SOL then this is field is required, even if you do not wish to change it. You can just send the current feerecipient address.
Response:
A JSON object containing
Updated marketplace properties
encoded_tranaction: A base64 encoded transaction string to be signed with the authority_wallet.
var myHeaders =newHeaders();myHeaders.append("x-api-key","20CcwuFeQOIcfuHx");myHeaders.append("Content-Type","application/json");var raw =JSON.stringify({"network":"devnet","marketplace_address":"5p4Bua5tSsSo1RJ94H1w5DiMSPfWcvMvnMVjPpZ6sJUb","new_transaction_fee":1,"authority_wallet":"Eb3ykuiCtvGcqs4XRCASThFf4EUxrL7k3TZsytWkXTBe","fee_recipient":"Eb3ykuiCtvGcqs4XRCASThFf4EUxrL7k3TZsytWkXTBe"});var requestOptions = { method:'POST', headers: myHeaders, body: raw, redirect:'follow'};fetch("https://api.shyft.to/sol/v1/marketplace/update", requestOptions).then(response =>response.text()).then(result =>console.log(result)).catch(error =>console.log('error', error));
{"success":true,"message":"Marketplace found successfully","result": {"network":"devnet","address":"7b2dSy4F26A6WweKgdmXzyi5FhhN5AqhuXAQHYcaXfqW","fee_account":"5jdmaVFbJH6uZB8dABqEUt96cicgEMtFtZUDoDjc7dGb","currency_address":"So11111111111111111111111111111111111111112","currency_symbol":"SOL","authority":"HFiyiUWFxmyKgBwCZ5ay9MYG4AajRDAJBiyRxYqM9JC","fee_payer":"HFiyiUWFxmyKgBwCZ5ay9MYG4AajRDAJBiyRxYqM9JC","fee_recipient_account":"EijtaNNHqqaPmWwAmUi8f1TC6gSPnqkoodQd2BLFpA8T","fee_recipient":null,"treasury_address":"DVDKeRmPEL3HV1kE8ErtHX7xc1q93p9YqwMGrfB6wQDG","creator":"HFiyiUWFxmyKgBwCZ5ay9MYG4AajRDAJBiyRxYqM9JC","transaction_fee":10 }}
Get Markets
Get details of all your marketplaces that are created using Shyft APIs. This information is fetched from the data cache.
Withdraw the transaction fees that got deposited in the marketplace treasury as a result of the sales transactions that happened in your marketplace. The withdrawn amount will go into the marketplace's fee recipient account.
POST /sol/v1/marketplace/withdraw_fee
Input Parameters:
network:string- either of [mainnet-beta, testnet, devnet]
authority_wallet: string - wallet address of the marketplace authority.
marketplace_address: string - the address of the marketplace.
amount: number - Amount to be withdrawn.
Response:
encoded_transaction: A base64 encoded transaction string to be signed with the authority_wallet.
from : marketplace treasury account address.
to : marketplace fee recipient account address.
amount : amount to be withdrawn
var myHeaders =newHeaders();myHeaders.append("x-api-key","20CcwuFeQOIcfuHx");myHeaders.append("Content-Type","application/json");var raw =JSON.stringify({"network":"devnet","marketplace_address":"5p4Bua5tSsSo1RJ94H1w5DiMSPfWcvMvnMVjPpZ6sJUb","amount":1,"authority_wallet":"Eb3ykuiCtvGcqs4XRCASThFf4EUxrL7k3TZsytWkXTBe"});var requestOptions = { method:'POST', headers: myHeaders, body: raw, redirect:'follow'};fetch("https://api.shyft.to/sol/v1/marketplace/withdraw_fee", requestOptions).then(response =>response.text()).then(result =>console.log(result)).catch(error =>console.log('error', error));
{"success":true,"message":"Fee withdrawal transaction created successfully","result": {"from":"CRA4Qd6H4tisWLCENT7pzaRbURcKwZTToDnGHTezRxBG","to":"EUUT8hfgak2YKcW41HoNWeiTuARv33fwRPn416enRxsR","amount":1, "encoded_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAQIyeELoVlWCYLzz5fir3Nbcqf9Gx2d8RF9cFc+TSeDElFHfKaEpfrS4sxhTff+YHEOX/lQ1QNNWX1H25zIx6SthKmgvQV3nsD/OO7+XxS/J6DzL6yyUKOy+3PQUD+AOLz/yDGmfLg6xNhu9NDmNtXnhx0ZrxBqwdoCsUBaP+p1ChgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADNSe+qQqT3GAvPsRINdaFIq6fOJtX7xNNqyXom6lJf9CmWThjy6RhVk6uQTc3IVRusBUckwgna71K0qHDpCEHsG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqaMKy0fh8oHtamtDl4kF1O2PHC5CeU8uf1uHup73YnvsAQYHBQADAgEHBBAApFZMOEgMqgDKmjsAAAAA"
}}
Listings
Before an NFT can be sold and bought by a user, it has to be listed for sale in the marketplace at a certain price. Listing represents an NFT on sale.
The sections below list the listing APIs needed to fulfill different functionalities related to selling and buying NFT in the marketplace.
List NFT
List an NFT for sale in the marketplace. (⨠pNFT support added)
POST /sol/v1/marketplace/list
Input Parameters
Required Param:
network:string- either of [mainnet-beta, testnet, devnet]
nft_address: string - on-chain address of the NFT which has to be listed for sale.
marketplace_address: string - the address of the marketplace.
price: number - sale price of the NFT.
seller_wallet : string - wallet address of the NFT owner who wants to sell the NFT.
Optional Params:
service_charge : object - Transaction fee to be paid by the seller for listing an NFT on the marketplace. This fee can be charged in SOL or any SPL-20 token. Below is the structure of the service_charge key.
receiver : string - An address that will receive the service charge amount.
amount : number - The amount of currency to be charged.
token : string - The address of the SPL token, the service charge currency.
{"success":true,"message":"Listing transaction created successfully","result": {"network":"devnet","marketplace_address":"6rwieGXAJ9xsMkMjTC8FXyjnttTw4th2x8ngcYeDar7K","seller_address":"2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc","price":0.3,"nft_address":"6PStcTWbV546dQCHbjVj4SP6Ht8e2eE4D8Mc951mH1yq","list_state":"vt7XVgUxXh9Yf78vRjaMJp7yz5JukMbSCjE5TRZpFpe","currency_symbol":"TEST", "encoded_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAA8aGMqfUcVHHu2+lyU5gx9wU2rGxk2NoSXtodMSdev+DxUb3986VtfRHwHrvY6XX4lMf8sLBR1y1RoVWbuSr9WPQR52vd+5NTczhA26Ra4GnSXc+tpXtqmZ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ao+ERAAAAAAEAAAAAAAAAFAUFAAsYFwnPayygS97DG/4QBwAHDA0LGRgAGQQCDQcACgwQJwAAAAAAAAY="
}}
Gasless NFT Listing
Users can list an NFT for sale in the marketplace, without paying the transaction gas fee. (⨠pNFT support added)
Under the hood, this API pays the transaction fee from 2 accounts:
marketplace fee_account: This is the account that is returned as fee_account in marketplace creation/find request. This is a PDA generated by the auction house protocol for a particular auction house. Pays the listing creation fee.
marketplace authority: This is the address of the marketplace authority, specified at the time of creating/updating a marketplace. This information can be found using marketplace find/get_marketplaces API calls. Pays the Listing receipt generation fee and network gas fee.
For the successful execution of this request, both fee_account and authority should have sufficient SOL balance.
Important Note: Please ensure that these two wallets should have a SOL balance greater than 0 for listing an NFT gaslessly. The fee_account created by the auction house protocol, by default has a SOL balance of 0, so it is important we transfer some SOL to the fee_account before attempting to list an NFT gaslessly.
POST /sol/v1/marketplace/list_gasless
Input Parameters
Required Param:
network:string- either of [mainnet-beta, testnet, devnet]
nft_address: string - on-chain address of the NFT which has to be listed for sale.
marketplace_address: string - the address of the marketplace.
price: number - sale price of the NFT.
seller_wallet : string - wallet address of the NFT owner who wants to sell the NFT.
Response:
list properties
list_state : An on-chain address where all the transactions that happen on an NFT listing are stored. This is unique for each NFT listing created.
encoded_tranaction: A base64 encoded transaction string to be signed by:
marketplace_authority : The authority address of the marketplace in which the NFT needs to be listed.
{"success":true,"message":"Listing transaction created successfully","result": {"network":"devnet","marketplace_address":"6rwieGXAJ9xsMkMjTC8FXyjnttTw4th2x8ngcYeDar7K","seller_address":"2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc","price":0.3,"nft_address":"6PStcTWbV546dQCHbjVj4SP6Ht8e2eE4D8Mc951mH1yq","list_state":"vt7XVgUxXh9Yf78vRjaMJp7yz5JukMbSCjE5TRZpFpe","currency_symbol":"TEST", "encoded_transaction": "AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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/awTDzVi4bHMaoP21SbbRvAP4KUYGp9UXGHvRZjXa1ARV/cLAwSTGjyFWdaXbustfCAAAAAan1RcZLFxRIYzJTD1K8X9Y2u4Im6H9ROPb2YoAAAAABt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKk/JxQRCtP4NPHg3VVT1wI5sbjhNhUQOe1P07fTlbTrwAQUFAEJCgAQBAsCGQwVGBYHBQ8TEhYXGzPmhaQBf4Ot////AKPhEQAAAAABAAAAAAAAABQFBgAMGBcJz2ssoEvewxv+EQcBCA0ODBkYABkEAw4IAQoMECcAAAAAAAAG"
}}
Buy NFT
Buy the listed NFT from the marketplace (⨠pNFT support added)
POST /sol/v1/marketplace/buy
Input Parameters
Required Params:
network:string- either of [mainnet-beta, testnet, devnet]
nft_address: string - on-chain address of the NFT which has to be listed for sale.
marketplace_address: string - the address of the marketplace.
price: number - sale price of the NFT listing.
seller_address : string - address of the NFT seller.
buyer_wallet: string - wallet address of the buyer who wants to purchase the NFT.
Optional Params:
service_charge : object - Transaction fee to be paid by the buyer for buying the NFT from the marketplace. This fee can be charged in SOL or any SPL-20 token. Below is the structure of the service_charge key.
receiver : string - An address that will receive the service charge amount.
amount : number - The amount of currency to be charged.
token : string - The address of the SPL token, the service charge currency.
Please note that the wallet from which an NFT was listed, cannot buy the same NFT. When buying listed pNFT generated transaction need to signed by buyer and marketplace_authority.
purchase_receipt: on-chain purchase receipt of the NFT listing.
buyer_address : address of the NFT buyer.
encoded_tranaction: A base64 encoded transaction string to be signed with the buyer_wallet.
transaction_version: returns either 'lagacy' or 0. To overcome legacy transaction size (1232 bytes), in some special condition returns 'v0' transaction.
signers: generated transaction need to signed by these signers.
Unlist an already listed NFT. This operation will make the NFT unavailable for sale, and nobody would be able to buy this NFT until it is listed back again. (⨠pNFT support added)
POST /sol/v1/marketplace/unlist
Input Parameters:
network:string- either of [mainnet-beta, testnet, devnet]
marketplace_address: string - the address of the marketplace.
list_state: string - an on-chain address where all the transactions that happen on an NFT listing are stored. This is unique for each NFT listing created. Generated at the time of list creation.
seller_wallet : string - wallet address of the NFT seller who created the listing in the first place.
fee_payer (optional) : string - public key of the account from which unlinsting fee would be taken.
Response:
encoded_transaction: A base64 encoded transaction string to be signed with the seller_wallet.
var myHeaders =newHeaders();myHeaders.append("Content-Type","application/json");myHeaders.append("x-api-key","YOUR_API_KEY");var raw =JSON.stringify({"network":"devnet","marketplace_address":"5LSMwR5GLr4WjDHS5FoUXQCN5osZYHRoDGjmcEsS843B","list_state":"3vbYYDeup22vPgxEVuGeCaXCdHhCDMwChVTgtY9xHafJ","seller_wallet":"2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc","fee_payer":"BFefyp7jNF5Xq2A4JDLLFFGpxLq5oPEFKBAQ46KJHW2R"});var requestOptions = { method:'POST', headers: myHeaders, body: raw, redirect:'follow'};fetch("https://api.shyft.to/sol/v1/marketplace/unlist", requestOptions).then(response =>response.text()).then(result =>console.log(result)).catch(error =>console.log('error', error));
{"success":true,"message":"NFT unlist transaction created successfully","result": { "encoded_transaction": "AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAKE5hVmLXkbyWMNhyHxoFAGxgq89NMznNX8fwEjaO6EZr2GMqfUcVHHu2+lyU5gx9wU2rGxk2NoSXtodMSdev+DxUrcjcqaFIhuzMAq7/smPr1f/7vIlvfeAqDmVgW9bNcgYwG0k4zijLNBgPaGbr6VYdk55F4/7sY44AWhkQo3NKdoD4+qI8zwyJy8PxicPwwJY1ZYWlhYcx5exmkeSyIXImyoSOovOgC0QS92kIOKxJ+jKS+A+vD8ccNlt2q3e0BVtgIJPJv+iRwN5BhJkED2D+PZv7YrhuqfySscVJ4M4mk4nqxpQW4EVV9M0sUUc0R8jfkEJItIYRIn/jSLxJFbwfjs2GNhpZBcydN1bJeqcApwhd4pP9FlmWrVK1RF7etgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQGl1d5C8owDqkO9zKSp5uxeLU/ICgwUgFQTYs5c/K5JQCnx2NQE11qJaZ3L4fHdwCH7c27d0NyW1ySq44T9SIAiv+JTD+mfAFjow8jSjPTRn8DqhZBcxXrS4FCe9m6bt2d9q42KPfoRWjq4U6AwP7JVEtOWaQDnBSgwTS0nh890KZZOGPLpGFWTq5BNzchVG6wFRyTCCdrvUrSocOkIQe/QkXpd1kxJfsVlBtsCpJgr0Q4vNEDVSkqQLBd+H9dUgC3BlsePRfEU4nVJ/awTDzVi4bHMaoP21SbbRvAP4KUYGp9UXGHvRZjXa1ARV/cLAwSTGjyFWdaXbustfCAAAAAbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCpOu3Od0P+XqKxuoownKBRtXNne7XN6j0JGy0E9Jd7XRsCDhMBBwsACgYCEhAFDwgNAwsMEBEJGOjb3ynb7Ny+AKPhEQAAAAABAAAAAAAAAA4DBAkRCKs7in72vVsL"
}}
Bid NFT
You can place a public bid on an unlisted NFT without specifying the seller and tokenAccount properties. Public bids are associated with the token itself and are not tied to a particular auction. This implies that a bid can remain active even after an auction ends and will be considered if it meets the criteria for future auctions involving that token.
POST /sol/v1/marketplace/bid
Input Parameters
Required Param:
network:string- either of [mainnet-beta, testnet, devnet]
nft_address: string - on-chain address of the NFT which has to be listed for sale.
marketplace_address: string - the address of the marketplace.
price: number - sale price of the NFT.
buyer_wallet: string - the address of the wallet seeking to purchase the NFT.
Optional Params:
on_the_house: boolean - if this option enabled transaction gas fee would be taken from auctionhouse authority.
service_charge: object - Transaction fee to be paid by the seller for listing an NFT on the marketplace. This fee can be charged in SOL or any SPL-20 token. Below is the structure of the service_charge key.
receiver: string - An address that will receive the service charge amount.
amount: number - The amount of currency to be charged.
token: string - The address of the SPL token, the service charge currency.
bid_state : An on-chain address where all the transactions that happen on an NFT bidding are stored. This is unique for each NFT bid created.
encoded_tranaction: A base64 encoded transaction string to be signed with the buyer_wallet.
var myHeaders =newHeaders();myHeaders.append("Content-Type","application/json");myHeaders.append("x-api-key","YOUR_API_KEY");var raw =JSON.stringify({"network":"devnet","marketplace_address":"5LSMwR5GLr4WjDHS5FoUXQCN5osZYHRoDGjmcEsS843B","nft_address":"FPEkgMzrhV7ZspZBGP4fd8VCkY6Ga4SmkjSVkgZFVBYL","price":0.4,"buyer_wallet":"3yTKSCKoDcjBFpbgxyJUh4cM1NG77gFXBimkVBx2hKrf"});var requestOptions = { method:'POST', headers: myHeaders, body: raw, redirect:'follow'};fetch("https://api.shyft.to/sol/v1/marketplace/bid", requestOptions).then(response =>response.text()).then(result =>console.log(result)).catch(error =>console.log('error', error));
{"success":true,"message":"Bidding transaction created successfully","result": {"network":"devnet","marketplace_address":"5LSMwR5GLr4WjDHS5FoUXQCN5osZYHRoDGjmcEsS843B","buyer_address":"3yTKSCKoDcjBFpbgxyJUh4cM1NG77gFXBimkVBx2hKrf","price":0.4,"nft_address":"FPEkgMzrhV7ZspZBGP4fd8VCkY6Ga4SmkjSVkgZFVBYL","bid_state":"GG3Wdgex5iMvP1VJ36fomK2abZR5JPG46QWsPKRJq8Pd","currency_symbol":"SOL", "encoded_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAsRLC2oJheXOGuryYTK++GE1M58Z4jLPfs+EGJTCdcdm/jIG6CKPc8pSTmcDJmWcAS0O+bDIErVkqR5FjcbakJWwNgIJPJv+iRwN5BhJkED2D+PZv7YrhuqfySscVJ4M4mk4rna6S1fGMlZIGSyD/JuXjSetTaUGg99zf7QZ0frfSzvhRN8RQmUa3wATPgG3e1lVWYG9ENPdZ8bzEPUEctZrAcLuNTXJWDbk2swwM/ERuteFAwW1qx+vppDFd6lwYQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAaXV3kLyjAOqQ73MpKnm7F4tT8gKDBSAVBNizlz8rkoyXJY9OJInxuz0QKRSODYMLWhOZ2v8QhASOe9jb6fhZApCBGhX3OJ9lXty/FC7EhVUmORV51SFbG8d76Bm7Bk2YVZi15G8ljDYch8aBQBsYKvPTTM5zV/H8BI2juhGa9tW18gdwkY7EaW5fz7M2KN6yTn/RokR65VlqFNJnKE8BCmWThjy6RhVk6uQTc3IVRusBUckwgna71K0qHDpCEHsGm4hX/quBhPtof2NGGMA12sQ53BrrO1WYoPAAAAAAAQan1RcYe9FmNdrUBFX9wsDBJMaPIVZ1pdu6y18IAAAABqfVFxksXFEhjMlMPUrxf1ja7gibof1E49vZigAAAAAG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqZE9+5OSuWTCkXyAlCdmgslA3fQD6Y2WxQ4ChaN6tvr2AwgHAAUACwYQDwAMDgAAAA0FCQQKBwIDEAYPGqlU2iMqzhCr//8AhNcXAAAAAAEAAAAAAAAADAUBAAYPDgle+Vrm70BE2v8="
}}
Accept Bid
The NFT's current owner has the option to accept the bid, resulting in the bid's price being transferred to the NFT owner, while the bidder receives the NFT.
POST /sol/v1/marketplace/accept_bid
Input Parameters
Required Param:
network:string- either of [mainnet-beta, testnet, devnet]
marketplace_address: string - the address of the marketplace.
bid_state: string - a unique on-chain address records all transactions related to an NFT bidding, created at the time of bid initiation.
seller_wallet: string - the address of the NFT owner.
Response:
purchase_receipt: on-chain purchase receipt of the NFT listing.
buyer_address : address of the NFT buyer.
encoded_tranaction: A base64 encoded transaction string to be signed with the seller_wallet.
transaction_version: returns either 'lagacy' or 0. To overcome legacy transaction size (1232 bytes), in some special condition returns 'v0' transaction.
var myHeaders =newHeaders();myHeaders.append("Content-Type","application/json");myHeaders.append("x-api-key","YOUR_API_KEY");var raw =JSON.stringify({"network":"devnet","marketplace_address":"5LSMwR5GLr4WjDHS5FoUXQCN5osZYHRoDGjmcEsS843B","bid_state":"CjuEr7tYExFVsa9eSnd5p86DFG2GqKdgDXKy14ag1VEQ","seller_wallet":"2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc"});var requestOptions = { method:'POST', headers: myHeaders, body: raw, redirect:'follow'};fetch("https://api.shyft.to/sol/v1/marketplace/accept_bid", requestOptions).then(response =>response.text()).then(result =>console.log(result)).catch(error =>console.log('error', error));
{"success":true,"message":"Accept bid transaction created successfully","result": {"network":"devnet","marketplace_address":"5LSMwR5GLr4WjDHS5FoUXQCN5osZYHRoDGjmcEsS843B","seller_address":"2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc","price":0.4,"nft_address":"8pNjm9UmY6RhGQaLuCdtDt6uXhqXg5rFQX9t2oWq3PL1","purchase_receipt":"A15dfTMrggqnN6gRaxxkPvN1NCimHRBLBmBhCBgXm3bo","currecy_symbol":"P2","buyer_address":"3yTKSCKoDcjBFpbgxyJUh4cM1NG77gFXBimkVBx2hKrf", "encoded_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAwaGMqfUcVHHu2+lyU5gx9wU2rGxk2NoSXtodMSdev+DxUsLagmF5c4a6vJhMr74YTUznxniMs9+z4QYlMJ1x2b+EW47KKP/tj5O8nsnqCbP/ibkqfarh+6COV0GpEwjbwRQCwHlX8JKKwKpawHjfHTp/CXruh+Lt6Hx8xs+BZ7UD9yESF+ueko+RTzuz0v2rAR7PPjJQfk7gdWVw78Iq3+83kcqaEMaakznxM+2nyvrdnl1Ni05VdlGdvQAEdGJ6Gqhb5rfhnB/liRDKADvOjdZTSjyi4PKO2RNlK7EdD9gkqubgRGkWgGYqEM7d8BLqZ6zSzk18gSlU18BCBOsjaAyatsLUfR0Z0MkDUv5CbeHhtPRRybMUei7U59xqecVqkNuCAyT10noSAQfrJtqnRvN/yu78TQ78YoXKB/OmGzglDYCCTyb/okcDeQYSZBA9g/j2b+2K4bqn8krHFSeDOJpOkSa8GvVlUK+VQU+ZPB0X77gFyQ2FYuO2AD7oiYamEv4tXUT43bBldKzJ3X17VA65S0WPElborQLwJC+2bRq9bvhRN8RQmUa3wATPgG3e1lVWYG9ENPdZ8bzEPUEctZrAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQGl1d5C8owDqkO9zKSp5uxeLU/ICgwUgFQTYs5c/K5J0JK9WSiHFj1SN2JFvoZ7VgfmoUng3v6uOaKR3LS7c1oyXJY9OJInxuz0QKRSODYMLWhOZ2v8QhASOe9jb6fhZmFWYteRvJYw2HIfGgUAbGCrz00zOc1fx/ASNo7oRmvYKZZOGPLpGFWTq5BNzchVG6wFRyTCCdrvUrSocOkIQe/mWqpZBlR3FKG2qN5Su+c5Og+poyc4Lm3l/pi3rRaZG9CRel3WTEl+xWUG2wKkmCvRDi80QNVKSpAsF34f11SAGm4hX/quBhPtof2NGGMA12sQ53BrrO1WYoPAAAAAAAQan1RcYe9FmNdrUBFX9wsDBJMaPIVZ1pdu6y18IAAAABqfVFxksXFEhjMlMPUrxf1ja7gibof1E49vZigAAAAAG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqYAP5G2njOH8ke9ypWLJdztoH/VmC0QmrAfLX/KGgsnjBBMMAAQUEg8KBQgZDhUYGzPmhaQBf4Ot////AITXFwAAAAABAAAAAAAAABMFCQAOGBcJz2ssoEvewxv6ExYBAAQQFBYNAAISDwoMBwUIGQ4RFRgDGyVK2Z1PMSMG////AITXFwAAAAABAAAAAAAAABMHBgkLAA4YFwnjmvsHtDhkj/4=",
"transaction_version":"legacy" }}
Cancel Bid
Cancels a specific bid for an NFT.
POST /sol/v1/marketplace/cancel_bid
Input Parameters
Required Param:
network:string- either of [mainnet-beta, testnet, devnet]
marketplace_address: string - the address of the marketplace.
bid_state: string - a unique on-chain address records all transactions related to an NFT bidding, created at the time of bid initiation.
buyer_wallet: string - the address of the bidder.
Optional Params:
on_the_house: boolean - if this option enabled transaction gas fee would be taken from auctionhouse authority.
Response:
encoded_transaction: A base64 encoded transaction string to be signed with the buyer_wallet.
var myHeaders =newHeaders();myHeaders.append("Content-Type","application/json");myHeaders.append("x-api-key","YOUR_API_KEY");var raw =JSON.stringify({"network":"devnet","marketplace_address":"5LSMwR5GLr4WjDHS5FoUXQCN5osZYHRoDGjmcEsS843B","bid_state":"2pTTd61MW5hcNiiDvLar2ffEMkg7k8x4gnbSe35LQngC","buyer_wallet":"2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc","on_the_house":false});var requestOptions = { method:'POST', headers: myHeaders, body: raw, redirect:'follow'};fetch("https://api.shyft.to/sol/v1/marketplace/cancel_bid", requestOptions).then(response =>response.text()).then(result =>console.log(result)).catch(error =>console.log('error', error));
{"success":true,"message":"NFT bid cancelled transaction created successfully","result": { "encoded_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAcMGMqfUcVHHu2+lyU5gx9wU2rGxk2NoSXtodMSdev+DxUbA+b5ZhXFnFZQRA9T2+56RUMLPhITwUrq/Lc5Ofgafaf97KbPstiKTEHYcXDVePk5ky3FynVEr9Nz08I+you1ypAOIGVIFku2rqtBWxaHGlnkEnQqtX7SrUpw0QUn2ZHYCCTyb/okcDeQYSZBA9g/j2b+2K4bqn8krHFSeDOJpAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQGl1d5C8owDqkO9zKSp5uxeLU/ICgwUgFQTYs5c/K5JYEF3bMc4Eh2PW+gZqDzDnpsvjwFyZ23u4G4rvPBu9rphVmLXkbyWMNhyHxoFAGxgq89NMznNX8fwEjaO6EZr2CmWThjy6RhVk6uQTc3IVRusBUckwgna71K0qHDpCEHsGp9UXGHvRZjXa1ARV/cLAwSTGjyFWdaXbustfCAAAAAbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCptX1YGUJ94BAo5h3PiqmUBJyT7y4yutJgog4b8RF1DdoCCQgAAgcIBgQBCxjo298p2+zcvoCWmAAAAAAAAQAAAAAAAAAJAwMFCgj2bBvl3CqwKw=="
}}
Active Listings
Get details of all the active listings in a marketplace.
GET/sol/v1/marketplace/active_listings
Query parameters:
network:string- either of [mainnet-beta, testnet, devnet]
marketplace_address:string - the address of the marketplace.
var myHeaders =newHeaders();myHeaders.append("x-api-key","20CcwuFeQOIcfuHx");var raw ="";var requestOptions = { method:'GET', headers: myHeaders, body: raw, redirect:'follow'};fetch("https://api.shyft.to/sol/v1/marketplace/active_listings?network=devnet&marketplace_address=5LSMwR5GLr4WjDHS5FoUXQCN5osZYHRoDGjmcEsS843B", requestOptions).then(response =>response.text()).then(result =>console.log(result)).catch(error =>console.log('error', error));
Get details of all the active listings in a marketplace. This endpoint allows you to filter the active listings based on a variety of filters. Also, you can sort the result based on price or list_date
GET/sol/v2/marketplace/active_listings
Query parameters:
network:string- either of [mainnet-beta, testnet, devnet]
marketplace_address:string - the address of the marketplace.
collection_address:string (optional) - filter listings based on the collection to which the NFTs belong.
seller_address:string (optional) - filter based on the address of a seller.
nft_address:string (optional) - filter based on the address of an NFT.
sort_by:string (optional) - sort is available on the listed price or listing creation time. The value should be price or list_date.
sort_order:string (optional) - order either in asc(ascending) or desc(descending). Default value is asc.
page:number (optional) - which page data want to fetch? Default is 1.
size:number (optional) - number of listings on a single page. Default is 10, maximum 50.
{"success":true,"message":"order history fetched successfully","result": [ {"network":"devnet","marketplace_address":"7b2dSy4F26A6WweKgdmXzyi5FhhN5AqhuXAQHYcaXfqW","seller_address":"GE4kh5FsCDWeJfqLsKx7zC9ijkqKpCuYQxh8FYBiTJe","price": 1,"nft_address":"DcxcgowdRg2bXFP4CcgFMaeppYY7GFquNhbZ5RwTVz3L","buyer_address":"AaYFExyZuMHbJHzjimKyQBAH1yfA9sKTxSzBc6Nr5X4s","created_at":"2022-08-17T04:36:16.094Z" } ]
Marketplace Stats
Fetches detailed statistics of a marketplace.
GET/sol/v1/marketplace/stats
Query parameters:
network: string- either of [mainnet-beta, testnet, devnet]
marketplace_address: string - the address of the marketplace.
start_date: string (optional) - from the date, you want to see the stats (format: YYYY-MM-DD). If not provided, shows all stats from the marketplace's creation date.
end_date: string(optional) - to the date you want to see the stats (default value: today's date)
Retrieve information about all active bids within a marketplace. This endpoint provides the flexibility to apply various filters for refining active bids and allows sorting results based on either price or bid_date.
GET/sol/v2/marketplace/active_bids
Query parameters:
network: string- either of [mainnet-beta, testnet, devnet]
marketplace_address: string - the address of the marketplace.
collection_address: string (optional) - filter listings based on the collection to which the NFTs belong.
buyer_address: string (optional) - filter based on the address of a bidder.
nft_address: string (optional) - filter based on the address of an NFT.
sort_by: string (optional) - sort is available on the listed price or listing creation time. The value should be price or bid_date.
sort_order: string (optional) - order either in asc(ascending) or desc(descending). Default value is asc.
page: number (optional) - which page data want to fetch? Default is 1.
size: number (optional) - number of listings on a single page. Default is 10, maximum 50.
This endpoint helps to cache the marketplace and its listings. After indexing a marketplace, you can view and explore active listings, seller listings, marketplace stats, etc.
This is an async endpoint. It'll take 5 minutes to cache given the marketplace.