TheMaster Posted May 21 Report Posted May 21 I want to map the asset ids of items that some in my inventory by that i mean i have a accept gifts function which accepts gift trades i want to see the new asset id of the item how can i do that without calling additional methods is this possible ? Quote
Dr. McKay Posted May 21 Report Posted May 21 Not possible without calling additional methods, no. Quote
TheMaster Posted May 22 Author Report Posted May 22 my problem statement is i want to input the asset ids and the name of items in my database as soon as they are received what is the most fastest and efficient way to do that? 18 hours ago, Dr. McKay said: Not possible without calling additional methods, no. Quote
Dr. McKay Posted May 23 Report Posted May 23 https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#getexchangedetailsgetdetailsiffailed-callback Quote
TheMaster Posted May 24 Author Report Posted May 24 On 5/23/2024 at 7:54 AM, Dr. McKay said: https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#getexchangedetailsgetdetailsiffailed-callback they are one way trades like when u get trades from p2p market places i have read the description of the method this applies to two way trades i am asking about 1 way trades or in other words gift trades Quote
TheMaster Posted May 24 Author Report Posted May 24 (edited) On 5/23/2024 at 7:54 AM, Dr. McKay said: https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#getexchangedetailsgetdetailsiffailed-callback i have now resolved issue to listening received offerchange event when a n offer changes to accepted and is a gift then it extracts the id and send it to db is this approach ok? Edited May 24 by TheMaster was dublicated Quote
Dr. McKay Posted May 24 Report Posted May 24 1 hour ago, TheMaster said: they are one way trades like when u get trades from p2p market places i have read the description of the method this applies to two way trades i am asking about 1 way trades or in other words gift trades It works for one-sided trades as well. An exchange is still an exchange, even if one side is empty. 44 minutes ago, TheMaster said: i have now resolved issue to listening received offerchange event when a n offer changes to accepted and is a gift then it extracts the id and send it to db is this approach ok? Extracts the ID how? Quote
TheMaster Posted May 24 Author Report Posted May 24 8 minutes ago, Dr. McKay said: It works for one-sided trades as well. An exchange is still an exchange, even if one side is empty. Extracts the ID how? manager.on('receivedOfferChanged', function(offer, oldState) { console.log(green, `RECEIVED OFFER changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`); // Extract asset IDs and market hash names of the received items if (offer.itemsToReceive && offer.itemsToReceive.length > 0) { offer.itemsToReceive.forEach(item => { console.log(`Received item asset ID: ${item.assetid}, Market Hash Name: ${item.market_hash_name}`); }); } else { console.log('No items received in this offer.'); } }); Quote
Dr. McKay Posted May 24 Report Posted May 24 Those are the asset IDs before the exchange happened, not after. Quote
TheMaster Posted May 24 Author Report Posted May 24 (edited) 3 minutes ago, Dr. McKay said: Those are the asset IDs before the exchange happened, not after. then how to get the new asset ids i somewhere saw this mapping but cant remember the same get exchage details? Edited May 24 by TheMaster Quote
TheMaster Posted May 24 Author Report Posted May 24 1 minute ago, Dr. McKay said: Use getExchangeDetails. so this is the algorithm i think is possible as i dont have the trade id of the trade from the p2p website what i do is i check i modify the received offer changed event to get the trade offer id of the gift trade and then use the getOffer(id, callback) method to call the get exchange details method as it says in the wiki it must be created with the get offer or offers method right? TradeOffer is a class which represents an individual trade offer sent or received by your account. It cannot be instantiated directly, it must be created using TradeOfferManager#createOffer, TradeOfferManager#getOffer, or TradeOfferManager#getOffers. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.