Marketplace
Selling Item

Listing an Item for Sale

Allowing users to sell their items is critical to achieve a successful in-game economy.

In order to allow users to list their items for sale you need to generate sell transaction, prompt the user sign the transaction and then confirm he wants to sell his item, and finally check if the user has approved the selling of the transaction.

Dive right in

# Step 1: Generate a Sell Transaction (listing for sale)
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'
# Step 2: Authorize the generated transaction.
curl --request POST \
     --url 'https://api.fractal.is/sdk/transaction/authorize' \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer <PROJECT_API_TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
      "unsignedMessage": "<unsigned_tx_base58>"
      }
    '
# Step 3: Call the getSignedResult RPC to detect when a user has approved.
curl --request GET \
     --url 'https://api.fractal.is/sdk/transaction/signed_result?code=<code>' \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer <PROJECT_API_TOKEN>'

Cancel a Listing

Sometimes a user may not want togo through with selling their item.

A listing can be cancelled as follows:

# Step 1: Generate a cancel sell transaction (cancelling the listing)
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'
# Step 2: Authorize the generated transaction.
curl --request POST \
     --url 'https://api.fractal.is/sdk/transaction/authorize' \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer <PROJECT_API_TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
      "unsignedMessage": "<unsigned_tx_base58>"
      }
    '
# Step 3: Call the getSignedResult RPC to detect when a user has approved.
curl --request GET \
  --url 'https://api.fractal.is/sdk/transaction/signed_result?code=<code>' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <PROJECT_API_TOKEN>'