Jump to content
McKay Development

Recommended Posts

Posted

After the new steam update with the ability to reverse trades, I tested the revert system on a trade, but by calling manager.getOffer(), I am getting the same state id 3 (Completed), instead 12 (Rolled Back).

This is the history of my trades using https://api.steampowered.com/IEconService/GetTradeHistory/v1 API. You can see how the original trade has been rolled back with status 12, and the other one is the rollback trade, which gave me back the item.
image.thumb.png.8c6810473042017e8af22b511a50d4fc.png

And this is the response from manager.getOffer(). The state didnt change and is still 3.
image.png.6fde44840a00779adeff35e4a315294d.png

Any solutions for this problem? Is there comming a fix for this steam update for node-steam-tradeoffer-manager module?

Posted
2 hours ago, JVz said:

could you check same trade using this api endpoint? I assume steam failed to update it. https://api.steampowered.com/IEconService/GetTradeOffer/v1/

I checked also that API endpoint you mention and still same state id, 3 (Completed). Now I thing that is something from steam, they didnt update properly the system, or they didnt update this endpoint. I think that node-steam-tradeoffer-manager module is also using this endpoint, so may not be a problem from module, but from steam.

image.png.81c3c726f85d25ee84814e790d4dadec.png

As a conclusion, the trade state is updated only on trade history API: https://api.steampowered.com/IEconService/GetTradeHistory/v1

Posted
18 minutes ago, JVz said:

yep, if you will find other endpoint that will give info about trades on hold let us all know. GetTradeHistory isn't convenient for our use case

Yes is a bit difficult to use GetTradeHistory, but for the moment this is the only solution, until steam will solve the endpoint. I just implemented GetTradeHistory to track also the rolled back trades (state == 12) and is working. You just have to get the trade history and find that one with your trade id, and you will get the state and the items also.

Posted

As you've figured out, the actual trade offer stays in the Accepted state, but the underlying trade gets rolled back. steam-tradeoffer-manager doesn't poll GetTradeHistory at all right now, so adding support for detecting these rolled back trades would incur additional requests. I'm still working on thinking of the best way to go about this, but for now I suggest you do your own GetTradeHistory polling.

Posted
6 hours ago, Dr. McKay said:

As you've figured out, the actual trade offer stays in the Accepted state, but the underlying trade gets rolled back. steam-tradeoffer-manager doesn't poll GetTradeHistory at all right now, so adding support for detecting these rolled back trades would incur additional requests. I'm still working on thinking of the best way to go about this, but for now I suggest you do your own GetTradeHistory polling.

the trade offer is not updated during the rollback, only trade. Thus, GetTradeStatus with tradeid from GetTradeOffer returns the correct status 12

Posted
43 minutes ago, uft said:

the trade offer is not updated during the rollback, only trade. Thus, GetTradeStatus with tradeid from GetTradeOffer returns the correct status 12

Yes, that's what I said.

Posted (edited)
  1. Retrieve time_updated from the Trade Offer API

First, use the Steam Trade Offer API to get the time_updated field of the target trade. For example:

https://api.steampowered.com/IEconService/GetTradeOffer/v1/?tradeofferid=8301957547&access_token=xx.xx.xx

 

{
  "response": {
    "offer": {
      "tradeofferid": "8301957547",
      "tradeid": "807950398061201297",
      "time_updated": 1753501576,
      ...
    }
  }
}
  1. Use time_updated as the start_after_time parameter to query the Trade History API

Next, pass the time_updated value as the start_after_time parameter when calling the Trade History API:

GET https://api.steampowered.com/IEconService/GetTradeHistory/v1/?max_trades=1&start_after_time=1753501576&access_token=xxx.xxx.xxx

The API response will include the trade information starting from that timestamp:

{
  "response": {
    "more": true,
    "trades": [
      {
        "tradeid": "807950398061201297",
        "time_init": 1753501576,
        ...
      },
      ...
    ]
  }
}

This method allows you to accurately locate a trade in the trade history using the time_updated value, which is useful for tracking or further processing.

Edited by 月光下漫步
Posted
51 minutes ago, 月光下漫步 said:
  1. Retrieve time_updated from the Trade Offer API

First, use the Steam Trade Offer API to get the time_updated field of the target trade. For example:

https://api.steampowered.com/IEconService/GetTradeOffer/v1/?tradeofferid=8301957547&access_token=xx.xx.xx

 

{
  "response": {
    "offer": {
      "tradeofferid": "8301957547",
      "tradeid": "807950398061201297",
      "time_updated": 1753501576,
      ...
    }
  }
}
  1. Use time_updated as the start_after_time parameter to query the Trade History API

Next, pass the time_updated value as the start_after_time parameter when calling the Trade History API:

GET https://api.steampowered.com/IEconService/GetTradeHistory/v1/?max_trades=1&start_after_time=1753501576&access_token=xxx.xxx.xxx

The API response will include the trade information starting from that timestamp:

{
  "response": {
    "more": true,
    "trades": [
      {
        "tradeid": "807950398061201297",
        "time_init": 1753501576,
        ...
      },
      ...
    ]
  }
}

This method allows you to accurately locate a trade in the trade history using the time_updated value, which is useful for tracking or further processing.

Or you could just use GetTradeStatus which takes a tradeid as input?

Posted
3 hours ago, Dr. McKay said:

Or you could just use GetTradeStatus which takes a tradeid as input?

In GetTradeStatus, even if a trade is rolled back midway, it still returns a success status (3). It has been observed that when using the start_after_time parameter in the GetTradeHistory API, there are still cases where the corresponding tradeid is not returned—approximately 1 out of every 20 trades. Therefore, it’s still necessary to paginate through the results to locate it.

Posted
31 minutes ago, 月光下漫步 said:

In GetTradeStatus, even if a trade is rolled back midway, it still returns a success status (3). It has been observed that when using the start_after_time parameter in the GetTradeHistory API, there are still cases where the corresponding tradeid is not returned—approximately 1 out of every 20 trades. Therefore, it’s still necessary to paginate through the results to locate it.

A previous offer's corresponding tradeid couldn't be found in the trade history API because the previously saved time_updated value was not the latest—it had changed. By using the updated time_updated value, the corresponding tradeid can be found in the trade history.

Posted
2 hours ago, 月光下漫步 said:

In GetTradeStatus, even if a trade is rolled back midway, it still returns a success status (3). It has been observed that when using the start_after_time parameter in the GetTradeHistory API, there are still cases where the corresponding tradeid is not returned—approximately 1 out of every 20 trades. Therefore, it’s still necessary to paginate through the results to locate it.

A trade that's reversed during Trade Protection will go to status 12 in GetTradeHistory and GetTradeStatus.

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...