steamutils 1.1.42 → 1.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +154 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -4967,6 +4967,156 @@ class SteamUser {
4967
4967
  }
4968
4968
  }
4969
4969
 
4970
+ async getInventoryTrading (appID) {
4971
+ for (let i = 0; i < 10; i++) {
4972
+ const url = `https://steamcommunity.com/${this._steamid_user}/inventory/json/${appID}/2?l=english&trading=1`;
4973
+ const _result = (await this._httpRequest(url))?.data
4974
+ if (!_result) {
4975
+ await sleep(5000)
4976
+ } else if (_result.success !== true) {
4977
+ console.error(url)
4978
+ console.error(_result)
4979
+ await sleep(5000)
4980
+ } else {
4981
+ return _result
4982
+ break
4983
+ }
4984
+ }
4985
+
4986
+ const exampleResult = {
4987
+ success: true, rgInventory: {
4988
+ 30494845811: {
4989
+ id: "30494845811",
4990
+ classid: "1989278680",
4991
+ instanceid: "302028390",
4992
+ amount: "1",
4993
+ hide_in_china: 0,
4994
+ pos: 1
4995
+ },
4996
+ },
4997
+ rgCurrency: [],
4998
+ rgDescriptions: {
4999
+ 1989278680_302028390: {
5000
+ appid: "730",
5001
+ classid: "1989278680",
5002
+ instanceid: "302028390",
5003
+ icon_url: "IzMF03bi9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdB2ozio1RrlIWFK3UfvMYB8UsvjiMXojflsZalyxSh31CIyHz2GZ-KuFpPsrTzBG0pe2BEHXlJjadf3HcTQswSrJbPD6IrTak5O6dQDjPRbklQVpSf_BR9zAfPsiNPRIjlNlc7Wa3m0tvEwMkZsxWfBbmyyIQZbxw7hyF-Lk",
5004
+ icon_url_large: "IzMF03bi9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdB2ozio1RrlIWFK3UfvMYB8UsvjiMXojflsZalyxSh31CIyHz2GZ-KuFpPsrTzBG0pe2BEHXlVzvFPSbcUglrRLdXYGnd9mX3sbyUS23BQO0qFl0HL6oBo2cYb5-JOUY60NUL_Gf2h0p6WBUnfspUfRq33n0DPaR4yXcRccpXZsIUY5w",
5005
+ icon_drag_url: "",
5006
+ name: "Sealed Graffiti | Keep the Change (Cash Green)",
5007
+ market_hash_name: "Sealed Graffiti | Keep the Change (Cash Green)",
5008
+ market_name: "Sealed Graffiti | Keep the Change (Cash Green)",
5009
+ name_color: "D2D2D2",
5010
+ background_color: "",
5011
+ type: "Base Grade Graffiti",
5012
+ tradable: 1,
5013
+ marketable: 1,
5014
+ commodity: 1,
5015
+ market_tradable_restriction: "7",
5016
+ descriptions: [{
5017
+ type: "html",
5018
+ value: "This is a sealed container of a graffiti pattern. Once this graffiti pattern is unsealed, it will provide you with enough charges to apply the graffiti pattern <b>50<\/b> times to the in-game world."
5019
+ }],
5020
+ owner_descriptions: "",
5021
+ actions: [{
5022
+ name: "Inspect in Game...",
5023
+ link: "steam:\/\/rungame\/730\/76561202255233023\/+csgo_econ_action_preview%20S%owner_steamid%A%assetid%D9965600949259903302"
5024
+ }],
5025
+ market_actions: [{
5026
+ name: "Inspect in Game...",
5027
+ link: "steam:\/\/rungame\/730\/76561202255233023\/+csgo_econ_action_preview%20M%listingid%A%assetid%D9965600949259903302"
5028
+ }],
5029
+ tags: [{
5030
+ internal_name: "CSGO_Type_Spray",
5031
+ name: "Graffiti",
5032
+ category: "Type",
5033
+ category_name: "Type"
5034
+ },]
5035
+ },
5036
+ }, more: false, more_start: false
5037
+ }
5038
+ }
5039
+
5040
+ async getInventoryTradingPartner (appID, partner) {//partner steamID not accountid
5041
+ for (let i = 0; i < 10; i++) {
5042
+ const url = `https://steamcommunity.com/tradeoffer/new/partnerinventory/?sessionid=${this,this._sessionid}&partner=${partner}&appid=${appID}&contextid=2&l=english`;
5043
+ const _result = (await this._httpRequest({
5044
+ url,
5045
+ headers: {
5046
+ Referer: 'https://steamcommunity.com/tradeoffer/'
5047
+ }
5048
+ }))?.data
5049
+ if (!_result) {
5050
+ await sleep(5000)
5051
+ } else if (_result.success !== true) {
5052
+ console.error(url)
5053
+ console.error(_result)
5054
+ await sleep(5000)
5055
+ } else {
5056
+ return _result
5057
+ break
5058
+ }
5059
+ }
5060
+
5061
+ const exampleResult = {
5062
+ success: true,
5063
+ rgInventory: {
5064
+ 30348427188: {
5065
+ id: "30348427188",
5066
+ classid: "3035568051",
5067
+ instanceid: "302028390",
5068
+ amount: "1",
5069
+ hide_in_china: 0,
5070
+ pos: 1
5071
+ },
5072
+ },
5073
+ rgCurrency: [],
5074
+ rgDescriptions: {
5075
+ 3035568051_302028390: {
5076
+ appid: "730",
5077
+ classid: "3035568051",
5078
+ instanceid: "302028390",
5079
+ icon_url: "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpou7uifDhhwszbZThH4OO_moaOhfn7DLfYkWNFppEi27qXrNX3jgWyqUFtYTj3LYaScgVoYFmC-FHqkLzsgZG16c-cwCF9-n51emhCfk8",
5080
+ icon_url_large: "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpou7uifDhhwszbZThH4OO_moaOhfn7DLfYkWNF18lwmO7Eu9im2Qfi8ko-NWildoSUcFc6aFjX-lLowO-9h5bo7c_KzXVq73J37CzD30vgRSvO2Oo",
5081
+ icon_drag_url: "",
5082
+ name: "MAG-7 | Rust Coat",
5083
+ market_hash_name: "MAG-7 | Rust Coat (Minimal Wear)",
5084
+ market_name: "MAG-7 | Rust Coat (Minimal Wear)",
5085
+ name_color: "D2D2D2",
5086
+ background_color: "",
5087
+ type: "Consumer Grade Shotgun",
5088
+ tradable: 1,
5089
+ marketable: 1,
5090
+ commodity: 0,
5091
+ market_tradable_restriction: "7",
5092
+ descriptions: [{type: "html", value: "Exterior: Minimal Wear"}],
5093
+ actions: [{
5094
+ name: "Inspect in Game...",
5095
+ link: "steam:\/\/rungame\/730\/76561202255233023\/+csgo_econ_action_preview%20S%owner_steamid%A%assetid%D7964130800002776255"
5096
+ }],
5097
+ market_actions: [{
5098
+ name: "Inspect in Game...",
5099
+ link: "steam:\/\/rungame\/730\/76561202255233023\/+csgo_econ_action_preview%20M%listingid%A%assetid%D7964130800002776255"
5100
+ }],
5101
+ tags: [{
5102
+ internal_name: "CSGO_Type_Shotgun",
5103
+ name: "Shotgun",
5104
+ category: "Type",
5105
+ category_name: "Type"
5106
+ }]
5107
+ },
5108
+ },
5109
+ rgAppInfo: {
5110
+ appid: 730,
5111
+ name: "Counter-Strike: Global Offensive",
5112
+ icon: "https:\/\/cdn.akamai.steamstatic.com\/steamcommunity\/public\/images\/apps\/730\/69f7ebe2735c366c65c0b33dae00e12dc40edbe4.jpg",
5113
+ link: "https:\/\/steamcommunity.com\/app\/730"
5114
+ },
5115
+ more: false,
5116
+ more_start: false
5117
+ }
5118
+ }
5119
+
4970
5120
  static async getPriceOverview(appID, market_hash_name) {
4971
5121
  for (let i = 0; i < 10; i++) {
4972
5122
  const url = `https://steamcommunity.com/market/priceoverview/?appid=${appID}&currency=15&market_hash_name=${encodeURIComponent(market_hash_name)}`;
@@ -4986,10 +5136,10 @@ class SteamUser {
4986
5136
  }
4987
5137
  }
4988
5138
  const exampleResult = {
4989
- "success": true,
4990
- "lowest_price": "33.269,34₫",
4991
- "volume": "110,882",
4992
- "median_price": "30.936,57₫"
5139
+ success: true,
5140
+ lowest_price: "33.269,34₫",
5141
+ volume: "110,882",
5142
+ median_price: "30.936,57₫"
4993
5143
  }
4994
5144
  }
4995
5145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.1.42",
3
+ "version": "1.1.44",
4
4
  "main":"index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.3.4",