steamutils 1.3.87 → 1.3.89

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/index.js +32 -3
  2. package/package.json +1 -1
  3. package/remote.js +493 -0
package/index.js CHANGED
@@ -6056,8 +6056,8 @@ export default class SteamUser {
6056
6056
  .split(",")
6057
6057
  .map((r) => r.trim().replaceAll(`'`, "").replaceAll(`"`, ""));
6058
6058
  const image = $1.find(`#mylisting_${listingid}_image`).attr("src");
6059
- const buyer_pays_price = parseInt($1.find(`.market_listing_price span[title="This is the price the buyer pays."]`).text().replaceAll(`(`, "").replaceAll(`)`, "").replaceAll(`₫`, "").replaceAll(`.`, "").replaceAll(`,`, "").trim());
6060
- const receive_price = parseInt($1.find(`.market_listing_price span[title="This is how much you will receive."]`).text().replaceAll(`(`, "").replaceAll(`)`, "").replaceAll(`₫`, "").replaceAll(`.`, "").replaceAll(`,`, "").trim());
6059
+ const buyer_pays_price = StringUtils.cleanSpace($1.find(`.market_listing_price span[title="This is the price the buyer pays."]`).text().replaceAll(`(`, "").replaceAll(`)`, ""));
6060
+ const receive_price = StringUtils.cleanSpace($1.find(`.market_listing_price span[title="This is how much you will receive."]`).text().replaceAll(`(`, "").replaceAll(`)`, ""));
6061
6061
  const item_name = $1.find(".market_listing_item_name_link").text();
6062
6062
  const game_name = $1.find(".market_listing_game_name").text();
6063
6063
  const date_combined = StringUtils.cleanSpace($1.find(".market_listing_listed_date_combined").text().replaceAll(`Listed:`, ""));
@@ -6689,7 +6689,11 @@ export default class SteamUser {
6689
6689
  if (result instanceof ResponseError) {
6690
6690
  return result;
6691
6691
  }
6692
- const $ = cheerio.load(result?.data);
6692
+ const html = result?.data;
6693
+ if (!html || typeof html !== "string") {
6694
+ return;
6695
+ }
6696
+ const $ = cheerio.load(html);
6693
6697
  const help_request_table = $(".help_request_table");
6694
6698
  const help_request_row = [...help_request_table.find("a.help_request_row")].map(function (el) {
6695
6699
  el = $(el);
@@ -7073,6 +7077,31 @@ export default class SteamUser {
7073
7077
  }
7074
7078
  }
7075
7079
 
7080
+ static async getItemOrdersHistogram(appID, market_hash_name, item_nameid) {
7081
+ let result = null;
7082
+
7083
+ if (!item_nameid) {
7084
+ try {
7085
+ result = await axios.get(`https://steamcommunity.com/market/listings/${appID}/${encodeURIComponent(market_hash_name)}`);
7086
+ } catch (e) {}
7087
+ if (!result?.data || typeof result.data !== "string") {
7088
+ return;
7089
+ }
7090
+ item_nameid = parseInt(result.data.substringAfterOrNull("Market_LoadOrderSpread(")?.substringBeforeOrNull(")")?.trim());
7091
+ }
7092
+
7093
+ if (!item_nameid) {
7094
+ return;
7095
+ }
7096
+
7097
+ try {
7098
+ result = await axios.get(`https://steamcommunity.com/market/itemordershistogram?country=VN&language=english&currency=15&item_nameid=${item_nameid}&two_factor=0`);
7099
+ } catch (e) {
7100
+ result = null;
7101
+ }
7102
+ return result?.data;
7103
+ }
7104
+
7076
7105
  async redeemWalletCode(wallet_code) {
7077
7106
  const result = await this._httpRequestAjax({
7078
7107
  url: "https://store.steampowered.com/account/ajaxredeemwalletcode/",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.3.87",
3
+ "version": "1.3.89",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",
package/remote.js CHANGED
@@ -3994,6 +3994,35 @@ export default class RemoteSteamUser {
3994
3994
  /* empty */
3995
3995
  }
3996
3996
  }
3997
+ async getMyMarketHistory({ start, count }) {
3998
+ const __params = [{ start, count }];
3999
+ if (__params.length === 1 && __params[0] === undefined) {
4000
+ __params.length = 0;
4001
+ }
4002
+ let __cookies = this._cookies;
4003
+ if (__cookies) {
4004
+ if (!Array.isArray(__cookies)) {
4005
+ __cookies = [__cookies];
4006
+ }
4007
+ __cookies = __cookies.map(function (cookie) {
4008
+ return cookie.toString();
4009
+ });
4010
+ }
4011
+
4012
+ try {
4013
+ const result = (
4014
+ await axios.post(getAppURL(), {
4015
+ method: "getMyMarketHistory",
4016
+ params: __params,
4017
+ cookies: __cookies,
4018
+ is_static: false,
4019
+ })
4020
+ ).data?.result;
4021
+ return result;
4022
+ } catch (e) {
4023
+ /* empty */
4024
+ }
4025
+ }
3997
4026
  async getPlayerReports(token) {
3998
4027
  const __params = [token];
3999
4028
  if (__params.length === 1 && __params[0] === undefined) {
@@ -4284,6 +4313,412 @@ export default class RemoteSteamUser {
4284
4313
  /* empty */
4285
4314
  }
4286
4315
  }
4316
+ async acceptConfirmationForObject(accessToken, identitySecret, objectID) {
4317
+ const __params = [accessToken, identitySecret, objectID];
4318
+ if (__params.length === 1 && __params[0] === undefined) {
4319
+ __params.length = 0;
4320
+ }
4321
+ let __cookies = this._cookies;
4322
+ if (__cookies) {
4323
+ if (!Array.isArray(__cookies)) {
4324
+ __cookies = [__cookies];
4325
+ }
4326
+ __cookies = __cookies.map(function (cookie) {
4327
+ return cookie.toString();
4328
+ });
4329
+ }
4330
+
4331
+ try {
4332
+ const result = (
4333
+ await axios.post(getAppURL(), {
4334
+ method: "acceptConfirmationForObject",
4335
+ params: __params,
4336
+ cookies: __cookies,
4337
+ is_static: false,
4338
+ })
4339
+ ).data?.result;
4340
+ return result;
4341
+ } catch (e) {
4342
+ /* empty */
4343
+ }
4344
+ }
4345
+ async denyConfirmationForObject(accessToken, identitySecret, objectID) {
4346
+ const __params = [accessToken, identitySecret, objectID];
4347
+ if (__params.length === 1 && __params[0] === undefined) {
4348
+ __params.length = 0;
4349
+ }
4350
+ let __cookies = this._cookies;
4351
+ if (__cookies) {
4352
+ if (!Array.isArray(__cookies)) {
4353
+ __cookies = [__cookies];
4354
+ }
4355
+ __cookies = __cookies.map(function (cookie) {
4356
+ return cookie.toString();
4357
+ });
4358
+ }
4359
+
4360
+ try {
4361
+ const result = (
4362
+ await axios.post(getAppURL(), {
4363
+ method: "denyConfirmationForObject",
4364
+ params: __params,
4365
+ cookies: __cookies,
4366
+ is_static: false,
4367
+ })
4368
+ ).data?.result;
4369
+ return result;
4370
+ } catch (e) {
4371
+ /* empty */
4372
+ }
4373
+ }
4374
+ async getConfirmations(accessToken, identitySecret) {
4375
+ const __params = [accessToken, identitySecret];
4376
+ if (__params.length === 1 && __params[0] === undefined) {
4377
+ __params.length = 0;
4378
+ }
4379
+ let __cookies = this._cookies;
4380
+ if (__cookies) {
4381
+ if (!Array.isArray(__cookies)) {
4382
+ __cookies = [__cookies];
4383
+ }
4384
+ __cookies = __cookies.map(function (cookie) {
4385
+ return cookie.toString();
4386
+ });
4387
+ }
4388
+
4389
+ try {
4390
+ const result = (
4391
+ await axios.post(getAppURL(), {
4392
+ method: "getConfirmations",
4393
+ params: __params,
4394
+ cookies: __cookies,
4395
+ is_static: false,
4396
+ })
4397
+ ).data?.result;
4398
+ return result;
4399
+ } catch (e) {
4400
+ /* empty */
4401
+ }
4402
+ }
4403
+ async enableTwoFactor(accessToken) {
4404
+ const __params = [accessToken];
4405
+ if (__params.length === 1 && __params[0] === undefined) {
4406
+ __params.length = 0;
4407
+ }
4408
+ let __cookies = this._cookies;
4409
+ if (__cookies) {
4410
+ if (!Array.isArray(__cookies)) {
4411
+ __cookies = [__cookies];
4412
+ }
4413
+ __cookies = __cookies.map(function (cookie) {
4414
+ return cookie.toString();
4415
+ });
4416
+ }
4417
+
4418
+ try {
4419
+ const result = (
4420
+ await axios.post(getAppURL(), {
4421
+ method: "enableTwoFactor",
4422
+ params: __params,
4423
+ cookies: __cookies,
4424
+ is_static: false,
4425
+ })
4426
+ ).data?.result;
4427
+ return result;
4428
+ } catch (e) {
4429
+ /* empty */
4430
+ }
4431
+ }
4432
+ async finalizeTwoFactor(accessToken, identitySecret, finalizeTwoFactorCode) {
4433
+ const __params = [accessToken, identitySecret, finalizeTwoFactorCode];
4434
+ if (__params.length === 1 && __params[0] === undefined) {
4435
+ __params.length = 0;
4436
+ }
4437
+ let __cookies = this._cookies;
4438
+ if (__cookies) {
4439
+ if (!Array.isArray(__cookies)) {
4440
+ __cookies = [__cookies];
4441
+ }
4442
+ __cookies = __cookies.map(function (cookie) {
4443
+ return cookie.toString();
4444
+ });
4445
+ }
4446
+
4447
+ try {
4448
+ const result = (
4449
+ await axios.post(getAppURL(), {
4450
+ method: "finalizeTwoFactor",
4451
+ params: __params,
4452
+ cookies: __cookies,
4453
+ is_static: false,
4454
+ })
4455
+ ).data?.result;
4456
+ return result;
4457
+ } catch (e) {
4458
+ /* empty */
4459
+ }
4460
+ }
4461
+ async getHelpRequests() {
4462
+ const __params = [];
4463
+ if (__params.length === 1 && __params[0] === undefined) {
4464
+ __params.length = 0;
4465
+ }
4466
+ let __cookies = this._cookies;
4467
+ if (__cookies) {
4468
+ if (!Array.isArray(__cookies)) {
4469
+ __cookies = [__cookies];
4470
+ }
4471
+ __cookies = __cookies.map(function (cookie) {
4472
+ return cookie.toString();
4473
+ });
4474
+ }
4475
+
4476
+ try {
4477
+ const result = (
4478
+ await axios.post(getAppURL(), {
4479
+ method: "getHelpRequests",
4480
+ params: __params,
4481
+ cookies: __cookies,
4482
+ is_static: false,
4483
+ })
4484
+ ).data?.result;
4485
+ return result;
4486
+ } catch (e) {
4487
+ /* empty */
4488
+ }
4489
+ }
4490
+ async getHelpRequestDetail(id) {
4491
+ const __params = [id];
4492
+ if (__params.length === 1 && __params[0] === undefined) {
4493
+ __params.length = 0;
4494
+ }
4495
+ let __cookies = this._cookies;
4496
+ if (__cookies) {
4497
+ if (!Array.isArray(__cookies)) {
4498
+ __cookies = [__cookies];
4499
+ }
4500
+ __cookies = __cookies.map(function (cookie) {
4501
+ return cookie.toString();
4502
+ });
4503
+ }
4504
+
4505
+ try {
4506
+ const result = (
4507
+ await axios.post(getAppURL(), {
4508
+ method: "getHelpRequestDetail",
4509
+ params: __params,
4510
+ cookies: __cookies,
4511
+ is_static: false,
4512
+ })
4513
+ ).data?.result;
4514
+ return result;
4515
+ } catch (e) {
4516
+ /* empty */
4517
+ }
4518
+ }
4519
+ async getFriendOwnershipForGifting(accessToken) {
4520
+ const __params = [accessToken];
4521
+ if (__params.length === 1 && __params[0] === undefined) {
4522
+ __params.length = 0;
4523
+ }
4524
+ let __cookies = this._cookies;
4525
+ if (__cookies) {
4526
+ if (!Array.isArray(__cookies)) {
4527
+ __cookies = [__cookies];
4528
+ }
4529
+ __cookies = __cookies.map(function (cookie) {
4530
+ return cookie.toString();
4531
+ });
4532
+ }
4533
+
4534
+ try {
4535
+ const result = (
4536
+ await axios.post(getAppURL(), {
4537
+ method: "getFriendOwnershipForGifting",
4538
+ params: __params,
4539
+ cookies: __cookies,
4540
+ is_static: false,
4541
+ })
4542
+ ).data?.result;
4543
+ return result;
4544
+ } catch (e) {
4545
+ /* empty */
4546
+ }
4547
+ }
4548
+ async getFriendsList_v1(accessToken) {
4549
+ const __params = [accessToken];
4550
+ if (__params.length === 1 && __params[0] === undefined) {
4551
+ __params.length = 0;
4552
+ }
4553
+ let __cookies = this._cookies;
4554
+ if (__cookies) {
4555
+ if (!Array.isArray(__cookies)) {
4556
+ __cookies = [__cookies];
4557
+ }
4558
+ __cookies = __cookies.map(function (cookie) {
4559
+ return cookie.toString();
4560
+ });
4561
+ }
4562
+
4563
+ try {
4564
+ const result = (
4565
+ await axios.post(getAppURL(), {
4566
+ method: "getFriendsList_v1",
4567
+ params: __params,
4568
+ cookies: __cookies,
4569
+ is_static: false,
4570
+ })
4571
+ ).data?.result;
4572
+ return result;
4573
+ } catch (e) {
4574
+ /* empty */
4575
+ }
4576
+ }
4577
+ async getPlayerLinkDetails(accessToken, steamIds) {
4578
+ const __params = [accessToken, steamIds];
4579
+ if (__params.length === 1 && __params[0] === undefined) {
4580
+ __params.length = 0;
4581
+ }
4582
+ let __cookies = this._cookies;
4583
+ if (__cookies) {
4584
+ if (!Array.isArray(__cookies)) {
4585
+ __cookies = [__cookies];
4586
+ }
4587
+ __cookies = __cookies.map(function (cookie) {
4588
+ return cookie.toString();
4589
+ });
4590
+ }
4591
+
4592
+ try {
4593
+ const result = (
4594
+ await axios.post(getAppURL(), {
4595
+ method: "getPlayerLinkDetails",
4596
+ params: __params,
4597
+ cookies: __cookies,
4598
+ is_static: false,
4599
+ })
4600
+ ).data?.result;
4601
+ return result;
4602
+ } catch (e) {
4603
+ /* empty */
4604
+ }
4605
+ }
4606
+ async getFriendsGameplayInfo(accessToken, appId) {
4607
+ const __params = [accessToken, appId];
4608
+ if (__params.length === 1 && __params[0] === undefined) {
4609
+ __params.length = 0;
4610
+ }
4611
+ let __cookies = this._cookies;
4612
+ if (__cookies) {
4613
+ if (!Array.isArray(__cookies)) {
4614
+ __cookies = [__cookies];
4615
+ }
4616
+ __cookies = __cookies.map(function (cookie) {
4617
+ return cookie.toString();
4618
+ });
4619
+ }
4620
+
4621
+ try {
4622
+ const result = (
4623
+ await axios.post(getAppURL(), {
4624
+ method: "getFriendsGameplayInfo",
4625
+ params: __params,
4626
+ cookies: __cookies,
4627
+ is_static: false,
4628
+ })
4629
+ ).data?.result;
4630
+ return result;
4631
+ } catch (e) {
4632
+ /* empty */
4633
+ }
4634
+ }
4635
+ async getPurchaseHistory() {
4636
+ const __params = [];
4637
+ if (__params.length === 1 && __params[0] === undefined) {
4638
+ __params.length = 0;
4639
+ }
4640
+ let __cookies = this._cookies;
4641
+ if (__cookies) {
4642
+ if (!Array.isArray(__cookies)) {
4643
+ __cookies = [__cookies];
4644
+ }
4645
+ __cookies = __cookies.map(function (cookie) {
4646
+ return cookie.toString();
4647
+ });
4648
+ }
4649
+
4650
+ try {
4651
+ const result = (
4652
+ await axios.post(getAppURL(), {
4653
+ method: "getPurchaseHistory",
4654
+ params: __params,
4655
+ cookies: __cookies,
4656
+ is_static: false,
4657
+ })
4658
+ ).data?.result;
4659
+ return result;
4660
+ } catch (e) {
4661
+ /* empty */
4662
+ }
4663
+ }
4664
+ async getActiveInventories() {
4665
+ const __params = [];
4666
+ if (__params.length === 1 && __params[0] === undefined) {
4667
+ __params.length = 0;
4668
+ }
4669
+ let __cookies = this._cookies;
4670
+ if (__cookies) {
4671
+ if (!Array.isArray(__cookies)) {
4672
+ __cookies = [__cookies];
4673
+ }
4674
+ __cookies = __cookies.map(function (cookie) {
4675
+ return cookie.toString();
4676
+ });
4677
+ }
4678
+
4679
+ try {
4680
+ const result = (
4681
+ await axios.post(getAppURL(), {
4682
+ method: "getActiveInventories",
4683
+ params: __params,
4684
+ cookies: __cookies,
4685
+ is_static: false,
4686
+ })
4687
+ ).data?.result;
4688
+ return result;
4689
+ } catch (e) {
4690
+ /* empty */
4691
+ }
4692
+ }
4693
+ async redeemWalletCode(wallet_code) {
4694
+ const __params = [wallet_code];
4695
+ if (__params.length === 1 && __params[0] === undefined) {
4696
+ __params.length = 0;
4697
+ }
4698
+ let __cookies = this._cookies;
4699
+ if (__cookies) {
4700
+ if (!Array.isArray(__cookies)) {
4701
+ __cookies = [__cookies];
4702
+ }
4703
+ __cookies = __cookies.map(function (cookie) {
4704
+ return cookie.toString();
4705
+ });
4706
+ }
4707
+
4708
+ try {
4709
+ const result = (
4710
+ await axios.post(getAppURL(), {
4711
+ method: "redeemWalletCode",
4712
+ params: __params,
4713
+ cookies: __cookies,
4714
+ is_static: false,
4715
+ })
4716
+ ).data?.result;
4717
+ return result;
4718
+ } catch (e) {
4719
+ /* empty */
4720
+ }
4721
+ }
4287
4722
  static async parseCookie(cookies) {
4288
4723
  const __params = [cookies];
4289
4724
  if (__params.length === 1 && __params[0] === undefined) {
@@ -5763,4 +6198,62 @@ export default class RemoteSteamUser {
5763
6198
  /* empty */
5764
6199
  }
5765
6200
  }
6201
+ static async isCookieAlive(cookie) {
6202
+ const __params = [cookie];
6203
+ if (__params.length === 1 && __params[0] === undefined) {
6204
+ __params.length = 0;
6205
+ }
6206
+ let __cookies = this._cookies;
6207
+ if (__cookies) {
6208
+ if (!Array.isArray(__cookies)) {
6209
+ __cookies = [__cookies];
6210
+ }
6211
+ __cookies = __cookies.map(function (cookie) {
6212
+ return cookie.toString();
6213
+ });
6214
+ }
6215
+
6216
+ try {
6217
+ const result = (
6218
+ await axios.post(getAppURL(), {
6219
+ method: "isCookieAlive",
6220
+ params: __params,
6221
+ cookies: __cookies,
6222
+ is_static: true,
6223
+ })
6224
+ ).data?.result;
6225
+ return result;
6226
+ } catch (e) {
6227
+ /* empty */
6228
+ }
6229
+ }
6230
+ static async getItemOrdersHistogram(appID, market_hash_name, item_nameid) {
6231
+ const __params = [appID, market_hash_name, item_nameid];
6232
+ if (__params.length === 1 && __params[0] === undefined) {
6233
+ __params.length = 0;
6234
+ }
6235
+ let __cookies = this._cookies;
6236
+ if (__cookies) {
6237
+ if (!Array.isArray(__cookies)) {
6238
+ __cookies = [__cookies];
6239
+ }
6240
+ __cookies = __cookies.map(function (cookie) {
6241
+ return cookie.toString();
6242
+ });
6243
+ }
6244
+
6245
+ try {
6246
+ const result = (
6247
+ await axios.post(getAppURL(), {
6248
+ method: "getItemOrdersHistogram",
6249
+ params: __params,
6250
+ cookies: __cookies,
6251
+ is_static: true,
6252
+ })
6253
+ ).data?.result;
6254
+ return result;
6255
+ } catch (e) {
6256
+ /* empty */
6257
+ }
6258
+ }
5766
6259
  }