Compare commits

...

15 Commits

Author SHA1 Message Date
Alex Corn
2a12174a7c 3.50.0 2026-03-27 04:32:44 -04:00
DoctorMcKay
caa76ee84b Merge pull request #365 from DarkGL/feat/asset-properties
feat: Add asset_properties support to getInventoryContents
2026-03-27 04:29:47 -04:00
Rafal Wiecek
bc8893fedd feat: add asset properties to inventory items 2026-03-16 15:52:32 +01:00
Alex Corn
d3e90f6fd3 3.49.0 2025-07-19 05:00:47 -04:00
Alex Corn
a61b50b7a2 Added acknowledgeTradeProtection method 2025-07-19 04:59:15 -04:00
Alex Corn
39fe4a4106 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	package.json
2025-07-19 04:49:23 -04:00
Alex Corn
0d991c2655 3.48.8 2025-05-28 05:23:39 -04:00
Alex Corn
0a307de9b9 Prevent descriptions overwriting base econ item properties 2025-05-28 05:23:25 -04:00
Alex Corn
c0b8dcf3a2 3.48.7 2025-05-27 20:27:10 -04:00
DoctorMcKay
dcf00b4ea1 Merge pull request #354 from metzz1/master
fix: steam now only accepts 1000 <
2025-05-27 20:26:40 -04:00
metzz
ee0cc34512 fix: steam now only accepts 1000 < 2025-05-28 03:08:12 +03:00
Alex Corn
4b8799ddd4 3.48.5 2024-11-02 02:54:44 -04:00
Alex Corn
f02f85a2aa Don't error out if a CS inventory has no visible items 2024-11-02 02:54:16 -04:00
Alex Corn
4948cbeac0 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	package.json
2024-11-02 02:49:14 -04:00
Alex Corn
0fb2798424 3.48.3 2024-04-18 06:04:25 -04:00
4 changed files with 35 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
module.exports = CEconItem;
function CEconItem(item, description, contextID) {
function CEconItem(item, description, contextID, assetProperties) {
var thing;
for (thing in item) {
if (item.hasOwnProperty(thing)) {
@@ -28,7 +28,7 @@ function CEconItem(item, description, contextID) {
}
for (thing in description) {
if (description.hasOwnProperty(thing)) {
if (description.hasOwnProperty(thing) && !this.hasOwnProperty(thing)) {
this[thing] = description[thing];
}
}
@@ -86,6 +86,11 @@ function CEconItem(item, description, contextID) {
this.actions = [];
}
// Assign asset_properties if provided
if (assetProperties) {
this.asset_properties = assetProperties;
}
// One wouldn't think that we need this if statement, but apparently v8 has a weird bug/quirk where deleting a
// property results in greatly increased memory usage. Because that makes sense.
if (this.currency) {

View File

@@ -392,6 +392,22 @@ SteamCommunity.prototype.checkConfirmations = function() {
}
};
SteamCommunity.prototype.acknowledgeTradeProtection = function(callback) {
this.httpRequestPost({
uri: 'https://steamcommunity.com//trade/new/acknowledge',
form: {
sessionid: this.getSessionID(),
message: 1
}
}, (err, res, body) => {
if (err) {
return callback && callback(err);
}
callback && callback(null);
}, 'steamcommunity');
}
SteamCommunity.prototype._confirmationCheckerGetKey = function(tag, callback) {
if(this._identitySecret) {
if(tag == 'details') {

View File

@@ -590,7 +590,7 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
},
"qs": {
"l": language, // Default language
"count": 5000, // Max items per 'page'
"count": 1000, // Max items per 'page'
"start_assetid": start
},
"json": true
@@ -647,12 +647,21 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
return;
}
// Build asset_properties lookup by assetid
var assetPropertiesLookup = {};
if (body.asset_properties) {
for (var j = 0; j < body.asset_properties.length; j++) {
assetPropertiesLookup[body.asset_properties[j].assetid] = body.asset_properties[j].asset_properties;
}
}
for (var i = 0; i < body.assets.length; i++) {
var description = getDescription(body.descriptions, body.assets[i].classid, body.assets[i].instanceid);
if (!tradableOnly || (description && description.tradable)) {
body.assets[i].pos = pos++;
(body.assets[i].currencyid ? currency : inventory).push(new CEconItem(body.assets[i], description, contextID));
var assetProperties = assetPropertiesLookup[body.assets[i].assetid] || null;
(body.assets[i].currencyid ? currency : inventory).push(new CEconItem(body.assets[i], description, contextID, assetProperties));
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "steamcommunity",
"version": "3.48.6",
"version": "3.50.0",
"description": "Provides an interface for logging into and interacting with the Steam Community website",
"files": [
"/classes",