Buying a listed item
If a user shows interest in a listing for sale by another user, it’s possible to buy the listed asset by simply calling the buyListedAsset
method. Note that in order to actually buy the asset, the buyer-player account needs to be funded with enough BEAM based on the listing price set by the seller.
const response = await beam.marketplaceV2.buyListedAssetV2('buyer-profile-id', 'order-id-to-fulfill' {
quantity: 1 // the amount of NFTs to buy, only relevant for ERC-1155 based tokens, defaults to 1
});
// {
// "status": "Pending",
// "id": "string",
// "createdAt": "2024-06-06T10:48:36.627Z",
// "updatedAt": "2024-06-06T10:48:36.627Z",
// "gameId": "string",
// "userId": "string",
// "chainId": 0,
// "url": "string",
// "transactions": [
// (...)
// ]
// }
Operation returned by the method needs to be signed. Learn more about Operations here: Operations introduction.