steamutils 1.5.49 → 1.5.50
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.
- package/index.js +19 -10
- package/package.json +1 -1
- package/remote.js +2503 -2268
package/index.js
CHANGED
@@ -6262,10 +6262,27 @@ export default class SteamUser {
|
|
6262
6262
|
}
|
6263
6263
|
}
|
6264
6264
|
|
6265
|
+
/**
|
6266
|
+
* Sells an item from the user's inventory on the Steam market.
|
6267
|
+
*
|
6268
|
+
* @param {Object} options - The item selling options.
|
6269
|
+
* @param {number} [options.appid=730] - The application ID (default is 730).
|
6270
|
+
* @param {number} [options.contextid=2] - The inventory context ID (default is 2).
|
6271
|
+
* @param {string|number} options.assetid - The asset ID of the item to sell.
|
6272
|
+
* @param {number} [options.amount=1] - The number of items to sell (default is 1).
|
6273
|
+
* @param {number|string} options.price - The price at which to list the item.
|
6274
|
+
* @returns {Promise<{
|
6275
|
+
* success: boolean,
|
6276
|
+
* requires_confirmation: number,
|
6277
|
+
* needs_mobile_confirmation: boolean,
|
6278
|
+
* needs_email_confirmation: boolean,
|
6279
|
+
* email_domain: string
|
6280
|
+
* } | null>} An object with the sale result and required confirmations, or null if input is invalid or request fails.
|
6281
|
+
*/
|
6265
6282
|
async sellItem({ appid = 730, contextid = 2, assetid, amount = 1, price }) {
|
6266
6283
|
price = parseInt(price);
|
6267
6284
|
if (!price) {
|
6268
|
-
return;
|
6285
|
+
return null;
|
6269
6286
|
}
|
6270
6287
|
|
6271
6288
|
const result = await this._httpRequestAjax({
|
@@ -6285,18 +6302,10 @@ export default class SteamUser {
|
|
6285
6302
|
});
|
6286
6303
|
|
6287
6304
|
if (result instanceof ResponseError) {
|
6288
|
-
return
|
6305
|
+
return null;
|
6289
6306
|
}
|
6290
6307
|
|
6291
6308
|
return result?.data;
|
6292
|
-
|
6293
|
-
const resultExample = {
|
6294
|
-
success: true,
|
6295
|
-
requires_confirmation: 1,
|
6296
|
-
needs_mobile_confirmation: true,
|
6297
|
-
needs_email_confirmation: false,
|
6298
|
-
email_domain: "gmail.com",
|
6299
|
-
};
|
6300
6309
|
}
|
6301
6310
|
|
6302
6311
|
async removeListing(id) {
|