Jump to content
McKay Development

Recommended Posts

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 DB

Flow 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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...