Listing an Item for Sale
Like buying an item, listing an item for sale is a multi-step process. First, you need to generate a sell transaction, then prompt the user to sign the transaction, and finally, you can optionally check if the user has approved the transaction.
Read Sign Transaction page to learn how to sign a transaction payload using Fractal Account.
Selling Item
To generate a sell transaction that the user can sign, you need to send a request to the /sdk/v1/marketplace/solana/token/sell (opens in a new tab) GET
The following query parameters are required and need to be passed as part of the URL:
Attribute | Content |
---|---|
tokenId | The token id of the item to be sold. |
walletId | The public key of the seller. |
price | The price of the item in SOL. |
quantity | The quantity of the item to be sold. |
curl --request GET \
--url 'https://api.fractal.is/sdk/v1/marketplace/solana/token/sell?tokenId=<token_to_sell>&walletId=<public_key_of_seller>&price=<price_in_sol>&quantity=1' \
--header 'Accept: application/json'
This will return a base58 encoded transaction you can sign and verify using Fractal Account or other wallet providers.
{
"transaction": "<BASE58_TRANSACTION_PAYLOAD>"
}
Cancel Listing
To cancel a listing, you need to send a request to the /sdk/v1/marketplace/solana/token/cancel_sell (opens in a new tab) GET
The following query parameters are required and need to be passed as part of the URL:
Attribute | Content |
---|---|
tokenId | The token id of the item to be sold. |
walletId | The public key of the seller. |
quantity | The quantity of the item to be sold. |
curl --request GET \
--url 'https://api.fractal.is/sdk/v1/marketplace/solana/token/cancel_sell?tokenId=<token_to_sell>&walletId=<public_key_of_seller>&quantity=1' \
--header 'Accept: application/json'
Same as above, this will return a base58 encoded transaction you can sign and verify using Fractal Account or other wallet providers.