Making an offer
Assets in the Beam marketplace are listed in specific currencies, for specific listing prices. That price might just not be right based on the current market value. In order to do this we allow you to create offers on both listed and unlisted assets in the marketplace.
Currencies
As mentioned in the currencies page for the Marketplace, depending on the chain you're implementing on, you're limited to the available currencies for the chain available in Sphere. Offers are scoped to the same flexibility as the listing and buying process itself: The supported currencies for the chain you use, are the same currencies you can use for creating an offer.
Making an offer
Based on the available currencies, you can create an offer for items which are listed, but also items which are not. Keep in mind that it's up to the seller (whenever that's a Marketplace user or a profile created through the SDK) to accept the offer.
const transaction = await beam.marketplaceV2.createAssetOfferV2('profile-offerer-id', {
assetAddress: '0x...',
assetId: '1',
quantity: 1 // You can make an offer for multiple 1155 assets from the same token
price: '1000', // Listing price
currency: 'USDC' // Defaults to WBEAM. Find all available options through the getCurrencies() method; You cannot use native(BEAM) to make offers.
});
// {
// "offerId": "651bfbb9b47baf2d2a092c04",
// }
Canceling offers
If you want to cancel the offer, you can use the following snippet.
const transaction = await beam.marketplaceV2.cancelAssetOfferV2("profile-offerer-id", {
offerId: 'offer-id-you-created'
}
);
// {
// "success": true,
// "transactionHash": "0x53df915ed7d86bd9a79a3ac09b7171d48f7b7ba60a8d08f981e67f891d157f7b",
// "explorerUrl": "https://subnets-test.avax.network/beam/tx/0x53df915ed7d86bd9a79a3ac09b7171d48f7b7ba60a8d08f981e67f891d157f7b"
// }
Listing offers
If you want to list all the offers made to an NFT, you are able to do so with the following snippets
// Get all offers for an asset
const transaction = await beam.marketplaceV2.getAssetOffersV2(
"asset-address",
"asset-id"
);
// Get all offers that player created
const transaction = await beam.marketplaceV2.getPlayerOffersV2(
"profile-offerer-id"
);
//Get all asset offers that player created
const transaction = await beam.marketplaceV2.getPlayerAssetOffersV2(
"profile-offerer-id",
"asset-address",
"asset-id"
);
Accepting an offer
If an item is listed by a profile that is managed by you through the SDK, it's possible to accept an offer through the SDK as well. Keep in mind that not every listing is managed through the SDK: accepting offers to an asset on Sphere only can be done if you manage the profile that listed it in the first place.
const transaction = await beam.marketplaceV2.acceptAssetOfferV2(
"profile-seller-id",
{
offerId: 'offer-id-you-accept'
quantity: 1, // You can accept multiple 1155 assets from the same token
}
);
// {
// "success": true,
// "transactionHash": "0xda0288e8a6f47d2d35de96873990e343b15f11c36a8a1ec095553e5ac6f7ec67",
// "explorerUrl": "https://subnets-test.avax.network/beam/tx/0xda0288e8a6f47d2d35de96873990e343b15f11c36a8a1ec095553e5ac6f7ec67"
// }