kreghx Posted April 15, 2016 Report Posted April 15, 2016 Hello,Is there a way to know the assetID of the items received before it changes? Right now, I have 1 inventorybot and multiple tradebots. The inventorybot distributes the items to the different tradebots. When I send an item from my inventorybot to the tradebot, my flow is as follows: Flow of inventorybot : send item -> when accepted delete record in DBFlow of tradebot : receive item -> accept -> insert into database This is how I keep track of which items are in which bots. But there is data that only the inventorybot knows about some items, for example where I got the item from (Did I get it from bitskins, opskins or another seller). But that data is lost since I have to delete the record in DB. I would like to update the record instead of deleting and inserting a new one. I have no way to know which item in database I should update after it has been traded to anoter bot.This could be done with a " UPDATE ... WHERE assetid = ..." . But assetID changes after trade, so that is not an option. Am I missing something on how I should do this? Kind regards Quote
Dr. McKay Posted April 16, 2016 Report Posted April 16, 2016 You can get the assetid of the item pre-trade from just the trade offer's data (the itemsToGive and itemsToReceive arrays). That data doesn't change ever. You can get the assetid of the item post-trade from getReceivedItems. There isn't any way to link specific items together between these arrays. You could use the market_name but if you for example have two items with identical names in a trade, there's no way to know which is which and so they can potentially get mixed up. Quote
kreghx Posted April 16, 2016 Author Report Posted April 16, 2016 Okay thank you. One more question. Does offer.getReceivedItems and offer.itemsToReceive always return the items in the same order? Quote
Dr. McKay Posted April 16, 2016 Report Posted April 16, 2016 Probably, but I don't see what the use of that is. 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.