I’m trying to fetch the wallet that bough a given asset. I’ve figured that it can be done if I get all the trades for the given party_b_token_address, say this query. Next I take each a.order_id field and query it separately, like this. And here I can get the user field and that would be the wallet which bought the given asset for the given trade.
Questions:
is it the intended use of the API?
why don’t you add wallet / user to trades API response? Like:
The Orders API should be able to help you with all your needs, the Trades API is a good way to see filled orders as is an aggregated view, however you will then need to query each order id to get the user who created that order. For each trade you myst have two filled orders a sell order and a buy order.
If you are looking for all the wallet addresses who purchased an NFT for a specific collection you need to use the listOrders endpoint API Reference | Immutable X Documentation and apply some filters. For example this query shows all the buy orders for ERC721 token type of the Illuvium land collection on sandbox:
Hi @Enigo there is an order for a seller and an order for a buyer
sellers order is selling erc721 and buying ETH
buyers order is selling ETH and buying ERC721
The user in each order is representative of the wallet taking part in the trade when the orders are matched, therefore you can list orders based on the params depending on which side you want to see.
So to see all buyers you need to match all filled orders where the buy side token type is erc721
Hey @Arthur
With that I’ll need to do two API calls - one for buyer and one for seller. I was wondering why don’t you provide this information in the same call given that you already have both buyer and seller nodes in the response
And rereading your answer I have a feeling that maybe my question wasn’t very clear. What I’m trying to do is to match a buyer and a seller of a given filled order. Not just to query all sell or buy events. Similarly how the Trade type of transaction is displayed on immutascan - it has two fields wallet_from and wallet_to. I’m trying to get wallet_to data. Hope it’s clear now