Arc
Search
K
Comment on page

Marketplace

Learn how to sell and buy NFTs in your Arc application.
The Arc's marketplace allows the application users to trade NFTs and SFTs in exchange for other fungible assets (e.g. Eth and ERC-20s).
Only assets enabled in your application can be exchanged in the marketplace.

Selling items in the marketplace

To help with the process of submitting a new sell offer in Arc's marketplace, users should start by fetching the sell offer details with the following action:
post
https://testnet-api.onarc.io
/api/v1/marketplace/sell-details
Get sell offer details
If you're using one of our SDKs, you use the following snippet as a reference:
Typescript
// Get sell offer details
const sellOfferDetails: SellOfferDetailsModel = {
sellerId: '5a35dbab-02ba-4ed4-b799-59daa263488b',
assetId: '5a35dbab-02ba-4ed4-b799-59daa263488c',
quantity: '1',
tokenId: '0xdeadbeef',
currencyId: '5a35dbab-02ba-4ed4-b799-59daa263488d',
dataAvailabilityMode: DataAvailabilityModes.Validium,
price: '10000',
};
const sellOfferDetailsResponse = await arcClient
.marketplace()
.getSellOfferDetails(sellOfferDetails);
After fetching the sell offer details, users are now able to sign their offer, which is required to submit the sell offer in the marketplace afterward. Once again, if you're using one of our SDKs, you can use the following snippet as a reference:
TypeScript
// fetch sell order details
...
// sign sell order
const sellerSignature = cryptoUtils.marketplace().signOrder(sellOrderData);
With the sell offer signature, users are now able to correctly submit a new sell offer in the marketplace through the following action:
post
https://testnet-api.onarc.io
/api/v1/marketplace/sell
Register sell offer
If you're using one of our SDKs, you can use the following snippet as a reference:
Typescript
// Submit sell offer
const sellOffer: RegisterSellOfferModel = {
sellerId: '5a35dbab-02ba-4ed4-b799-59daa263488b',
productVaultId: '5a35dbab-02ba-4ed4-b799-59daa263488c',
productAmount: '1',
currencyVaultId: '5a35dbab-02ba-4ed4-b799-59daa263488d',
currencyAmount: '10000',
expirationTimestamp: 1231231,
nonce: 123,
productName: 'some name',
productDescription: 'some description',
signature: sellerSignature,
};
const sellOfferResponse = await arcClient
.marketplace()
.submitSellOffer(sellOffer);
After successfully submitting a new sell offer, users are now able to submit a buy order to match the price stipulated by the seller. If the seller wants to delist the item from the marketplace, the application should call the following action:
delete
https://testnet-api.onarc.io
/api/v1/marketplace/sell/{offerId}
Delete sell offer
Sell offers can be retrieved through the following action as well:
get
https://testnet-api.onarc.io
/api/v1/marketplace/sell-offers
List sell offers

Buying items in the marketplace

Just like the sell offer action, we also provide an auxiliary endpoint to help users compile a buy offer with the following action:
post
https://testnet-api.onarc.io
/api/v1/marketplace/buy-details
Get buy order details
If using one of our SDKs, you can the following snippet as a reference
Typescript
// Fetch buy order details
const buyOrderDetails: BuyOrderDetailsModel = {
buyerId: '5a35dbab-02ba-4ed4-b799-59daa263488f',
offerId: offerDto.offerId,
dataAvailabilityMode: DataAvailabilityModes.Validium,
};
const buyOrderDetailsResponse = await arcClient
.marketplace()
.getBuyOrderDetails(buyOrderDetails);
After fetching the full buy order details, the buyer should sign its order to be able to later submit a valid buy order in Arc's marketplace. If using one of ours SDKs, please use the following snippet as a reference:
Typescript
// fetch buy offer details
...
// Sign buy order
const buyerSignature = cryptoUtils.marketplace().signOrder(buyOrderData);
After successfully signing the buy order, buyers are now able to submit a buy order to Arc's marketplace through the following action:
post
https://testnet-api.onarc.io
/api/v1/marketplace/buy
Register buy order
If using one of our SDKs, feel free to use the following snippet as a reference:
Typescript
// Submit buy order
const buyOrder: RegisterBuyOrderModel = {
buyerId: '5a35dbab-02ba-4ed4-b799-59daa263488f',
offerId: offerDto.offerId,
productVaultId: buyOrderData.buyVaultId,
currencyVaultId: buyOrderData.sellVaultChainId,
expirationTimestamp: buyOrderData.expirationTimestamp,
nonce: buyOrderData.nonce,
signature: buyerSignature,
};
const buyOrderResponse = await arcClient
.marketplace()
.submitBuyOrder(buyOrder);
After successfully submitting a buy order, the item is delisted from the marketplace and the sell offer is immediately closed. Buy orders can then be queried through the following action:
get
https://testnet-api.onarc.io
/api/v1/marketplace/buy-orders
List buy orders