@darkgl/waxpeer 1.8.0

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.
@@ -0,0 +1,1027 @@
1
+ import type { EDopplersPhases, EGameId, EMinExteriors, EWeapon, EWeaponBrand, FetchInventory, GetItems, GetMySteamInv, IAvailable, IBuy, IBuyMyHistory, IBuyOrderHistory, IBuyOrders, ICheckTradeLink, ICheckWssUser, ICreateBuyOrder, IEditBuyOrder, IEditItemsReq, IGetItemsList, IGetSteamItems, IHistory, IListedItem, IMassInfo, IMerchantDepositsHistory, IMerchantInventory, IMerchantInventoryUpate, IMerchantListItem, IMerchantListItemsSteam, IMerchantUser, IMyHistory, IPrices, IPricesDopplers, IReadyTransferTrade, IRemoveAll, IRemoveAllOrders, IRemoveBuyOrder, IResponseEdit, ISetMyKeys, ISetUserSteamToken, IUser, ListedItem, ListItems, TradesStatus } from './types/waxpeer.js';
2
+ export declare class Waxpeer {
3
+ private readonly api;
4
+ private apiClient;
5
+ constructor(api: string, localAddress?: string);
6
+ /**
7
+ * Fetch trades and transactions by one request, maximum 100 in response.
8
+ *
9
+ * @param skip Skip to get next results (max 1000)
10
+ * @param start Start date
11
+ * @param end End date
12
+ * @param sort (optional) Sort by creation time
13
+ * @example
14
+ * // example response:
15
+ * {
16
+ * "success": true,
17
+ * "data": {
18
+ * "trades": [
19
+ * {
20
+ * "date": "2022-10-29T23:58:17.318Z",
21
+ * "created": "2022-10-29T23:52:17.318Z",
22
+ * "id": 4258120,
23
+ * "item_id": "27341302961",
24
+ * "give_amount": 22,
25
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/4839650857/200fx125f",
26
+ * "price": 24,
27
+ * "game": "csgo",
28
+ * "name": "Sticker | BIG | Antwerp 2022",
29
+ * "status": 5,
30
+ * "average": 30,
31
+ * "action": "buy"
32
+ * }
33
+ * ],
34
+ * "transactions": [
35
+ * {
36
+ * "wallet": "string",
37
+ * "type": "BTC",
38
+ * "status": "completed",
39
+ * "amount": "10256672",
40
+ * "give_amount": "10256672",
41
+ * "direction": "in",
42
+ * "date": "2022-01-22T01:22:43.021Z"
43
+ * }
44
+ * ]
45
+ * }
46
+ * }
47
+ */
48
+ myHistory(skip: number, start: string, end: string, sort?: 'ASC' | 'DESC'): Promise<IMyHistory>;
49
+ /**
50
+ * Change your tradelink - `/change-tradelink`
51
+ * @param tradelink Your new tradelink
52
+ * @example
53
+ * // example response:
54
+ * /{
55
+ * / "success": false,
56
+ * / "link": "https://steamcommunity.com/tradeoffer/new/?partner=900267897&token=P2YkRJOk",
57
+ * / "info": "You cannot trade with SteamUserName because they have a trade ban.",
58
+ * / "msg": "We couldn't validate your trade link, either your inventory is private or you can't trade",
59
+ * / "token": "P2YkRJOk",
60
+ * / "steamid32": 900267897,
61
+ * / "steamid64": 76561198000000000
62
+ * /}
63
+ */
64
+ changeTradeLink(tradelink: string): Promise<ICheckTradeLink>;
65
+ /**
66
+ * Buy item using name and send to specific tradelink - `buy-one-p2p-name`
67
+ *
68
+ * Notes about trades and frequently asked questions.
69
+ * The duration of the trade in different situations:
70
+ * If seller's info is invalid then it can be cancelled immediately and status 6 is set;
71
+ * If seller's details are valid, but no trade is created, then it will auto-cancel after 6 minutes;
72
+ * if created or waiting for mobile confirmation then it will auto-cancel after 11 to 15 min (depends on when created);
73
+ * if trade is waiting for mobile confirmation and connection with the seller was lost then it will auto-cancel after 6 hours.
74
+ * We recommend adding project_id to purchase so that you can track a trade in case of a timeout or break of purchase request using the /check-many-project-id GET method one minute after the request.
75
+ * An array of possible messages with purchase errors and other information, such as status, can be seen by opening the response scheme, where:
76
+ * System busy - trade is cancelled due to tradelink check timeout or heavy load;
77
+ * buy_csgo - CS:GO purchases are deactivated on the market;
78
+ * buy_rust - RUST purchases are deactivated on the market.
79
+ *
80
+ * @param name Market hash name of the item
81
+ * @param price Price, should be greater than item price
82
+ * @param token Token from tradelink
83
+ * @param partner Partner from tradelink
84
+ * @param project_id Your custom id string[50]
85
+ * @param game Game from supported games
86
+ * @example
87
+ * // example response:
88
+ * {
89
+ * "success": true,
90
+ * "id": 1,
91
+ * "msg": "buy_csgo"
92
+ * }
93
+ */
94
+ buyItemWithName(name: string, price: number, token: string, partner: string, project_id?: string | undefined, game?: keyof typeof EGameId): Promise<IBuy>;
95
+ /**
96
+ * Buy item using `item_id` and send to specific tradelink - `/buy-one-p2p`
97
+ *
98
+ * WARNING: Always paste item_id as string for RUST items.
99
+ * Notes about trades and frequently asked questions.
100
+ * The duration of the trade in different situations:
101
+ * If seller's info is invalid then it can be cancelled immediately and status 6 is set;
102
+ * If seller's details are valid, but no trade is created, then it will auto-cancel after 6 minutes;
103
+ * if created or waiting for mobile confirmation then it will auto-cancel after 11 to 15 min (depends on when created);
104
+ * if trade is waiting for mobile confirmation and connection with the seller was lost then it will auto-cancel after 6 hours.
105
+ * We recommend adding project_id to purchase so that you can track a trade in case of a timeout or break of purchase request using the /check-many-project-id GET method one minute after the request.
106
+ * An array of possible messages with purchase errors and other information, such as status, can be seen by opening the response scheme, where:
107
+ * System busy - trade is cancelled due to tradelink check timeout or heavy load;
108
+ * buy_csgo - CS:GO purchases are deactivated on the market;
109
+ * buy_rust - RUST purchases are deactivated on the market.
110
+ *
111
+ * @param item_id Item id from fetching items
112
+ * @param price Price of the item 1$=1000
113
+ * @param token Token from tradelink
114
+ * @param partner Partner from tradelink
115
+ * @param project_id Your custom id string[50]
116
+ * @example
117
+ * // example resonse:
118
+ * {
119
+ * "success": true,
120
+ * "id": 1,
121
+ * "msg": "buy_csgo"
122
+ * }
123
+ */
124
+ buyItemWithId(item_id: string | number, price: number, token: string, partner: string, project_id?: string): Promise<IBuy>;
125
+ /**
126
+ * Get recent purchases by filters - `/history`
127
+ *
128
+ * @param partner (optional) Partner from tradelink
129
+ * @param token (optional) Token from tradelink
130
+ * @param skip (optional) How many items to skip
131
+ * @example
132
+ * // example response:
133
+ * {
134
+ * "success": true,
135
+ * "history": [
136
+ * {
137
+ * "item_id": "27165625733",
138
+ * "trade_id": 5114261104,
139
+ * "token": "ssR242yo",
140
+ * "partner": 153912146,
141
+ * "created": "2020-01-18T07:28:12.360Z",
142
+ * "send_until": "2020-01-18T07:28:12.360Z",
143
+ * "reason": "Buyer failed to accept",
144
+ * "id": 4258189,
145
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/5040342865/200fx125f",
146
+ * "price": 1200,
147
+ * "name": "USP-S | Cortex (Field-Tested)",
148
+ * "status": 6
149
+ * }
150
+ * ]
151
+ * }
152
+ */
153
+ getHistory(partner?: string, token?: string, skip?: number): Promise<IHistory>;
154
+ /**
155
+ * Checking the status of many steam trades by project_id identifier - `/check-many-steam`
156
+ *
157
+ * Please check success state. Success must be "true" and msg usually null, but if something went wrong, you will get error message here and you need to retry the request.
158
+ *
159
+ * @param ids Ids or id that you recived when purchasing items
160
+ * @example
161
+ * // example response:
162
+ * {
163
+ * "success": true,
164
+ * "msg": "Invalid ID",
165
+ * "trades": [
166
+ * {
167
+ * "id": 1,
168
+ * "price": 140,
169
+ * "name": "Nova | Sand Dune (Field-Tested)",
170
+ * "status": 4,
171
+ * "project_id": "My_custom_project_identifier_asgd6ad8sg68gasgas8d",
172
+ * "custom_id": "224bdce2-as44-5ae6-be3g-1a80500de23s",
173
+ * "trade_id": "3547735377",
174
+ * "done": false,
175
+ * "for_steamid64": "76561198338314XXX",
176
+ * "reason": "We couldn't validate your trade link, either your inventory is private or you can't trade",
177
+ * "seller_name": "turboTrade",
178
+ * "seller_avatar": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg",
179
+ * "seller_steam_joined": 1589314982,
180
+ * "seller_steam_level": 45,
181
+ * "send_until": 1566796475,
182
+ * "last_updated": 1566796111,
183
+ * "counter": 10
184
+ * }
185
+ * ]
186
+ * }
187
+ */
188
+ tradeRequestStatus(ids: number | number[] | string | string[]): Promise<TradesStatus>;
189
+ /**
190
+ * Check many steam trades - `check-many-project-id
191
+ *
192
+ * Please check success state. Success must be "true" and msg usually null, but if something went wrong, you will get error message here and you need to retry the request.
193
+ *
194
+ * @param ids Ids or id that you passed as project_id when making a purchase
195
+ * @example
196
+ * // example response:
197
+ * {
198
+ * "success": true,
199
+ * "msg": "Please try again",
200
+ * "trades": [
201
+ * {
202
+ * "id": 1,
203
+ * "price": 140,
204
+ * "name": "Nova | Sand Dune (Field-Tested)",
205
+ * "status": 4,
206
+ * "project_id": "My_custom_project_identifier_asgd6ad8sg68gasgas8d",
207
+ * "custom_id": "224bdce2-as44-5ae6-be3g-1a80500de23s",
208
+ * "trade_id": "3547735377",
209
+ * "done": false,
210
+ * "for_steamid64": "76561198338314XXX",
211
+ * "reason": "We couldn't validate your trade link, either your inventory is private or you can't trade",
212
+ * "seller_name": "turboTrade",
213
+ * "seller_avatar": "https://avatars.akamai.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg",
214
+ * "seller_steam_joined": 1589314982,
215
+ * "seller_steam_level": 45,
216
+ * "send_until": 1566796475,
217
+ * "last_updated": 1566796111,
218
+ * "counter": 10
219
+ * }
220
+ * ]
221
+ * }
222
+ */
223
+ customTradeRequest(ids: number | number[] | string | string[]): Promise<TradesStatus>;
224
+ /**
225
+ * Connect steam api and waxpeer api - `/set-my-steamapi`
226
+ *
227
+ * @param steam_api (optional) you can pass a steam api to waxpeer
228
+ * @example
229
+ * // example response:
230
+ * {
231
+ * "success": true,
232
+ * "msg": "string"
233
+ * }
234
+ */
235
+ setMyKeys(steam_api: string): Promise<ISetMyKeys>;
236
+ /**
237
+ * Due to the steam update, it became mandatory to pass regularly (we recommend sending once an hour and keep 6 hours from the time we receive it) to be online and sell on the marketplace.
238
+ *
239
+ * Token should be in base64 format and belong to your account.
240
+ *
241
+ * It is recommended to transmit it once an hour to maintain validity, as well as in case of refreshing
242
+ *
243
+ * If the "success" parameter in the response is false, you will not get online and most likely you need to update the token and send a new one
244
+ *
245
+ * @param token Steam access token in base64 format
246
+ * @example
247
+ * // example response:
248
+ * {
249
+ * "success": false,
250
+ * "msg": "Need to refresh access token",
251
+ * "exp": 1712852259
252
+ * }
253
+ */
254
+ UserSteamToken(token: string): Promise<ISetUserSteamToken>;
255
+ /**
256
+ * Due to the Steam update we recommend to send this request and do mobile confirmation only if you receive a successful response (success param is true).
257
+ * @param tradeid Created Steam trade id
258
+ * @param waxid Waxpeer uuid trade id (waxid in "send-trade" event OR "costum_id" from another source)
259
+ * @example
260
+ * // example response:
261
+ * {
262
+ * "success": false,
263
+ * "msg": "No token found"
264
+ * }
265
+ *
266
+ */
267
+ steamTrade(tradeid: string, waxid: string): Promise<ISetUserSteamToken>;
268
+ /**
269
+ * Fetches your steam inventory make sure your steamid is connected on waxpeer - `/fetch-my-inventory`.
270
+ * Call this endpoint before calling {@link getMyInventory|getMyInventory()} (`/get-my-inventory`)
271
+ *
272
+ * @param game Game from supported games
273
+ * @example
274
+ * // example response:
275
+ * {
276
+ * "success": true,
277
+ * "total_inventory_count": 120
278
+ * }
279
+ */
280
+ fetchInventory(game?: keyof typeof EGameId): Promise<FetchInventory>;
281
+ /**
282
+ * Fetch all unique items and their min price and count - `/prices`
283
+ *
284
+ * @param game Game from supported games
285
+ * @param min_price (optional) Min price
286
+ * @param max_price (optional) Max price
287
+ * @param search (optional) Search by part of the name, ex: 'hardened'.
288
+ * @param minified (optional) Will return additional data about items if set to 0
289
+ * @param highest_offer (optional) Will return highest_offer for the items if set to 1
290
+ * @param single (optional) Will select only one item if set to 1
291
+ * @example
292
+ * // example response:
293
+ * {
294
+ * "success": true,
295
+ * "items": [
296
+ * {
297
+ * "name": "★ Hand Wraps | Cobalt Skulls (Minimal Wear)",
298
+ * "count": 5,
299
+ * "min": 937999,
300
+ * "img": "https://community.akamai.steamstatic.com/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DfVlxgLQFFibKkJQN3wfLYYgJK7dKyg5KKh8j4NrrFnm5D8fp3i-vT_I_KilihriwvOCyveMX6Ll9pORy_pgD8lrvxgJfpvpWamnZn6XUl5SmJm0DjhhlFbedp1PWYH1jNVaUcSqOKBnuCtYczFntLO18msw",
301
+ * "steam_price": "990000",
302
+ * "rarity_color": "#EB4B4B",
303
+ * "type": "Gloves"
304
+ * }
305
+ * ]
306
+ * }
307
+ */
308
+ getPrices(game?: keyof typeof EGameId, min_price?: number | undefined, max_price?: number | undefined, search?: string | undefined, minified?: 0 | 1, highest_offer?: number, single?: 0 | 1): Promise<IPrices>;
309
+ /**
310
+ * Fetch all dopplers phases by filters - `/prices/dopplers`
311
+ *
312
+ * @param phase (optional) Doppler phase. Will return all if set to 'any'. For multiple phases pass it like this phase=Emerald&phase=Ruby
313
+ * @param exterior (optional) Item exterior. Will return all if not set. For multiple exteriors pass it like this exterior=FN&exterior=MW
314
+ * @param weapon (optional) Weapon type. Will return all if not set. For multiple weapons pass it like this weapon=Bayonet&weapon=Karambit
315
+ * @param minified (optional) Will return additional data about items if set to 0 (steam_price, img, weapon, float, paint_index)
316
+ * @param min_price (optional) Min price
317
+ * @param max_price (optional) Max price
318
+ * @param search (optional) Search by part of the name, ex: 'bayonet'.
319
+ * @param single (optional) Will select only one item if set to 1
320
+ * @example
321
+ * {
322
+ * "success": true,
323
+ * "items": [
324
+ * {
325
+ * "name": "★ Butterfly Knife | Doppler (Factory New)",
326
+ * "item_id": "27253164358",
327
+ * "price": 1380000,
328
+ * "phase": "Phase 3",
329
+ * "steam_price": 1453040,
330
+ * "img": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/5070448210/200fx125f",
331
+ * "weapon": "Butterfly Knife",
332
+ * "paint_index": 420,
333
+ * "float": 0.0460052728652954
334
+ * }
335
+ * ],
336
+ * "msg": "Wrong input"
337
+ * }
338
+ */
339
+ getPricesDopplers(phase?: keyof typeof EDopplersPhases, exterior?: keyof typeof EMinExteriors | undefined, weapon?: keyof typeof EWeapon | undefined, minified?: 0 | 1, min_price?: number | undefined, max_price?: number | undefined, search?: string | undefined, single?: 0 | 1): Promise<IPricesDopplers>;
340
+ /**
341
+ * Fetch all listings by names. The maximum names per request is 50
342
+ * For csgo dopplers items 'phase' parameter available in response. Possible values: 'Emerald', 'Ruby', 'Sapphire', 'Black Pearl', 'Phase 1', 'Phase 2', 'Phase 3', 'Phase 4'
343
+ * @param game (optional) Game from supported games
344
+ * @example
345
+ * // example response:
346
+ * {
347
+ * "success": true,
348
+ * "data": {
349
+ * "AK-47 | Redline (Field-Tested)": {
350
+ * "listings": [
351
+ * [
352
+ * {
353
+ * "price": 12100,
354
+ * "by": "1247ffd5-f437-4a30-9953-10eda7df6e17",
355
+ * "item_id": "27165625733",
356
+ * "name": "AK-47 | Redline (Field-Tested)",
357
+ * "paint_index": 123,
358
+ * "steam_price": 14100,
359
+ * "classid": "3669724953",
360
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/3669724953"
361
+ * }
362
+ * ]
363
+ * ],
364
+ * "orders": [
365
+ * {}
366
+ * ],
367
+ * "history": [
368
+ * {}
369
+ * ],
370
+ * "info": {}
371
+ * },
372
+ * "★ Butterfly Knife | Gamma Doppler (Factory New)": {
373
+ * "listings": [
374
+ * [
375
+ * {
376
+ * "price": 2050000,
377
+ * "by": "1247ffd5-f437-4a30-9953-10eda7df6e17",
378
+ * "item_id": "27165625734",
379
+ * "name": "★ Butterfly Knife | Gamma Doppler (Factory New)",
380
+ * "paint_index": 572,
381
+ * "steam_price": 1709860,
382
+ * "classid": "5035516602",
383
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/5035516602",
384
+ * "phase": "Phase 4"
385
+ * }
386
+ * ]
387
+ * ],
388
+ * "orders": [
389
+ * {}
390
+ * ],
391
+ * "history": [
392
+ * {}
393
+ * ],
394
+ * "info": {}
395
+ * }
396
+ * }
397
+ * }
398
+ */
399
+ massInfo(names: string[], game?: keyof typeof EGameId): Promise<IMassInfo>;
400
+ /**
401
+ * Check provided tradelink - `/check-tradelink`
402
+ * @param tradelink Target tradelink
403
+ * @example
404
+ * // example response:
405
+ * /{
406
+ * / "success": false,
407
+ * / "link": "https://steamcommunity.com/tradeoffer/new/?partner=900267897&token=P2YkRJOk",
408
+ * / "info": "You cannot trade with SteamUserName because they have a trade ban.",
409
+ * / "msg": "We couldn't validate your trade link, either your inventory is private or you can't trade",
410
+ * / "token": "P2YkRJOk",
411
+ * / "steamid32": 900267897,
412
+ * / "steamid64": 76561198000000000
413
+ * /}
414
+ */
415
+ validateTradeLink(tradelink: string): Promise<ICheckTradeLink>;
416
+ /**
417
+ * Check weather items are available by item_id max 100 items - `/check-availability`
418
+ *
419
+ * @param item_id ItemIds that you want to check weather items are available
420
+ * @example
421
+ * // example response:
422
+ * {
423
+ * "success": true,
424
+ * "items": [
425
+ * {
426
+ * "item_id": "27165625733",
427
+ * "selling": true,
428
+ * "price": 1687470,
429
+ * "name": "★ Karambit | Fade (Factory New)",
430
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/310854699/200fx125f"
431
+ * }
432
+ * ]
433
+ * }
434
+ */
435
+ checkItemAvailability(item_id: string | number | string[] | number[]): Promise<{
436
+ success: boolean;
437
+ data: IAvailable[];
438
+ }>;
439
+ /**
440
+ * Edit price for listed items - `/edit-items`
441
+ *
442
+ * Array of items
443
+ * Rate limit of list/edit actions for each item_id is 2 requests per 120 seconds
444
+ * Note: For Rust items item_id must be a string type, since id is greater than the maximum for number type
445
+ * Set the price to 0 to remove the item from sale
446
+ * @param items Array of items with item_id and price keys
447
+ * @param game (optional) Game from supported games
448
+ * @example
449
+ * // example response:
450
+ * {
451
+ * "success": true,
452
+ * "updated": [
453
+ * {
454
+ * "item_id": "141414144",
455
+ * "price": "1000"
456
+ * }
457
+ * ],
458
+ * "failed": [
459
+ * {
460
+ * "item_id": 141414145,
461
+ * "price": 1000,
462
+ * "msg": "You can update price after 40 seconds",
463
+ * "msBeforeNext": 39636
464
+ * }
465
+ * ],
466
+ * "removed": 0
467
+ * }
468
+ */
469
+ editItems(items: IEditItemsReq[], game?: keyof typeof EGameId): Promise<IResponseEdit>;
470
+ /**
471
+ * List steam items from inventory - `/list-items-steam`
472
+ *
473
+ * @param items Items object https://api.waxpeer.com/docs/#/Steam/post_list_items_steam
474
+ * @param game (optional) Game from supported games
475
+ * @example
476
+ * // example value:
477
+ * {
478
+ * "success": true,
479
+ * "msg": "no items",
480
+ * "listed": [
481
+ * {
482
+ * "item_id": 141414144,
483
+ * "price": 1000,
484
+ * "name": "AWP | Asiimov (Field-tested)"
485
+ * }
486
+ * ],
487
+ * "failed": [
488
+ * {
489
+ * "item_id": 141414145,
490
+ * "price": 1000,
491
+ * "msg": "You can list your item after 40 seconds",
492
+ * "msBeforeNext": 39636
493
+ * }
494
+ * ]
495
+ * }
496
+ */
497
+ listItemsSteam(items: ListedItem[], game?: keyof typeof EGameId): Promise<ListItems>;
498
+ /**
499
+ * Get listed steam items - `/list-items-steam`
500
+ *
501
+ * @param game (optional) Game from supported games
502
+ * @example
503
+ * // example response:
504
+ * {
505
+ * "success": true,
506
+ * "items": [
507
+ * {
508
+ * "item_id": "16037911576",
509
+ * "price": 2367941,
510
+ * "date": "2020-01-11T07:18:50.749Z",
511
+ * "position": 1,
512
+ * "name": "★ Butterfly Knife | Gamma Doppler (Factory New)",
513
+ * "market_name": "Gamma Doppler Phase 2",
514
+ * "steam_price": {
515
+ * "average": 2767941,
516
+ * "rarity_color": "string",
517
+ * "rarity": "string",
518
+ * "current": 2633000,
519
+ * "name": "★ Butterfly Knife | Gamma Doppler Phase 2 (Factory New)",
520
+ * "lowest_price": 2125555,
521
+ * "img": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf0ebcZThQ6tCvq4GGqPD1PrbQqW9e-NV9j_v-5YT0m1HllB81NDG3S9rEMFFrf1iC_QXqw7u9h5PqupTKyiNh6ClxtCvczUPmgUtPPbE-1qDISFicAqVXXP7V9p_o84A"
522
+ * }
523
+ * }
524
+ * ]
525
+ * }
526
+ */
527
+ myListedItems(game?: keyof typeof EGameId): Promise<{
528
+ success: boolean;
529
+ items: IListedItem[];
530
+ }>;
531
+ /**
532
+ * Get items that you can list for sale - `/get-my-inventory`
533
+ *
534
+ * @param skip (optional) Skip items
535
+ * @param game (optional) Game from supported games
536
+ * @example
537
+ * // example response:
538
+ * {
539
+ * "success": true,
540
+ * "items": [
541
+ * {
542
+ * "item_id": "24758826121",
543
+ * "type": "Butterfly Knife",
544
+ * "icon_url": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf0ebcZThQ6tCvq4GGqPD1PrbQqW9e-NV9j_v-5YT0m1HmlB81NDG3OtOcdlM5MF3Srla4wO-8h5PuucyawHo37HZxsXePnEe20xseaLBnhPSACQLJc-o5FQc",
545
+ * "name": "★ Butterfly Knife | Gamma Doppler (Factory New)",
546
+ * "steam_price": {
547
+ * "average": 2767941,
548
+ * "rarity_color": "string",
549
+ * "rarity": "string",
550
+ * "current": 2633000,
551
+ * "name": "★ Butterfly Knife | Gamma Doppler Phase 2 (Factory New)",
552
+ * "lowest_price": 2125555,
553
+ * "img": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf0ebcZThQ6tCvq4GGqPD1PrbQqW9e-NV9j_v-5YT0m1HllB81NDG3S9rEMFFrf1iC_QXqw7u9h5PqupTKyiNh6ClxtCvczUPmgUtPPbE-1qDISFicAqVXXP7V9p_o84A"
554
+ * }
555
+ * }
556
+ * ],
557
+ * "count": 5,
558
+ * }
559
+ */
560
+ getMyInventory(skip?: number, game?: keyof typeof EGameId): Promise<GetMySteamInv>;
561
+ /**
562
+ * Search multiple items by name - `/search-items-by-name`
563
+ *
564
+ * @param names Array of item names
565
+ * @param game (optional) Game from supported games
566
+ * @example
567
+ * // example response:
568
+ * {
569
+ * "success": true,
570
+ * "items": [
571
+ * {
572
+ * "name": "★ Butterfly Knife | Gamma Doppler (Factory New)",
573
+ * "price": 2050000,
574
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/5035516602",
575
+ * "item_id": "27165625734",
576
+ * "phase": "Phase 4"
577
+ * }
578
+ * ]
579
+ * }
580
+ */
581
+ searchItems(names: string[] | string, game?: keyof typeof EGameId): Promise<GetItems>;
582
+ /**
583
+ * Get recent purchases - `/history`
584
+ *
585
+ * @param skip skip since by default it returns 50 items
586
+ * @param partner (optional) partner parameter that you passed when buying
587
+ * @param token (optional) token parameter that you passed when buying
588
+ * @example
589
+ * // example response
590
+ * {
591
+ * "success": true,
592
+ * "history": [
593
+ * {
594
+ * "item_id": "27165625733",
595
+ * "trade_id": 5114261104,
596
+ * "token": "ssR242yo",
597
+ * "partner": 153912146,
598
+ * "created": "2020-01-18T07:28:12.360Z",
599
+ * "send_until": "2020-01-18T07:28:12.360Z",
600
+ * "reason": "Buyer failed to accept",
601
+ * "id": 4258189,
602
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/5040342865/200fx125f",
603
+ * "price": 1200,
604
+ * "name": "USP-S | Cortex (Field-Tested)",
605
+ * "status": 6
606
+ * }
607
+ * ]
608
+ * }
609
+ */
610
+ myPurchases(skip?: number, partner?: string | undefined, token?: string | undefined): Promise<IBuyMyHistory>;
611
+ /**
612
+ * Fetch trades that need to be sent - `/ready-to-transfer-p2p`
613
+ *
614
+ * Connecting to the trade websocket is required to sell items (included in the extension and official app).
615
+ * If your connection is unstable (such as public Wi-Fi or mobile data), your trade websocket connection can be interrupted and the creation of a trade event may be missed.
616
+ * In order not to miss the sending of a trade you should be making this request at least every minute.
617
+ * Please check send_until timestamp before creating trade in Steam (we do not recommend creating a trade if one minute or less is left).
618
+ * Trade websocket documentation is published here (https://docs.waxpeer.com/?method=websocket).
619
+ *
620
+ * @param steam_api Steam API key
621
+ * @example
622
+ * // example response
623
+ * {
624
+ * "id": 1,
625
+ * "costum_id": "string",
626
+ * "trade_id": "3547735377",
627
+ * "tradelink": "https://steamcommunity.com/tradeoffer/new/?partner=14221897&token=i2yUssgF",
628
+ * "trade_message": "string",
629
+ * "done": false,
630
+ * "stage": 1,
631
+ * "creator": "seller",
632
+ * "send_until": "2022-10-30T15:18:46.566Z",
633
+ * "last_updated": "2022-10-30T15:13:08.139Z",
634
+ * "for_steamid64": "76561198338314XXX",
635
+ * "user": {
636
+ * "id": "182dbd1c-2es6-470s-z1q2-627xa6207211",
637
+ * "avatar": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/16/1622081f90ef78b0ca1372cae7663a2592939e00_medium.jpg"
638
+ * },
639
+ * "seller": {
640
+ * "id": "282dbd1c-2es6-470s-z1q2-627xa6207212",
641
+ * "avatar": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/16/1622081f90ef78b0ca1372cae7663a2592939e00_medium.jpg"
642
+ * },
643
+ * "items": [
644
+ * {
645
+ * "id": 4258189,
646
+ * "item_id": "27165625733",
647
+ * "give_amount": 25926,
648
+ * "merchant": "string",
649
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/5041964706/200fx125f",
650
+ * "price": 27581,
651
+ * "game": "csgo",
652
+ * "name": "AWP | Neo-Noir (Minimal Wear)",
653
+ * "status": 0
654
+ * }
655
+ * ]
656
+ * }
657
+ */
658
+ readyToTransferP2P(steam_api: string): Promise<IReadyTransferTrade>;
659
+ /**
660
+ * Force p2p status check. Recommended for usage with poor network connections - `/check-wss-user`
661
+ *
662
+ * If the network connection is poor, we recommend to request once per hour so that items remain or come back on sale.
663
+ * Note: This method will enable items for sale if you're connected to the trade websocket and even if you set your sales status to offline.
664
+ * @param steamid Your Steam64ID. Can be found in /user endpoint
665
+ * @example
666
+ * // example response
667
+ * {
668
+ * "success": true,
669
+ * "step": 3,
670
+ * "msg": "You can sell now"
671
+ * }
672
+ */
673
+ checkWssUser(steamid: string): Promise<ICheckWssUser>;
674
+ /**
675
+ * Get Profile data - `/user`
676
+ *
677
+ * @example
678
+ * // example response:
679
+ * {
680
+ * "success": true,
681
+ * "user": {
682
+ * "wallet": 1000,
683
+ * "id": "11d6f117-1ad2-47e1-aca1-bcasdf9e37fa",
684
+ * "userid": 1,
685
+ * "id64": "765611983383140000",
686
+ * "avatar": "https://www.gravatar.com/avatar/31609d41eb6ccb405b1984967693de76?d=identicon&r=pg&s=32",
687
+ * "name": "WAXPEER",
688
+ * "sell_fees": 0.95,
689
+ * "can_p2p": true,
690
+ * "tradelink": "https://steamcommunity.com/tradeoffer/new/?partner=378049039&token=XWpC4ZTT",
691
+ * "login": "makc",
692
+ * "ref": "waxpeer",
693
+ * "sell_status": true
694
+ * }
695
+ * }
696
+ */
697
+ getProfile(): Promise<IUser>;
698
+ /**
699
+ * Removes all listed items - `/remove-all`
700
+ *
701
+ * @param game (optional) Game from supported games (If not passed - will remove for all games)
702
+ * @example
703
+ * // example response:
704
+ * {
705
+ * "success": true,
706
+ * "msg": "string",
707
+ * "count": 0
708
+ * }
709
+ */
710
+ removeAll(game?: keyof typeof EGameId | undefined): Promise<IRemoveAll>;
711
+ /**
712
+ * Remove specified items - `/remove-items`
713
+ *
714
+ * @param ids Either array or one item_id that you want to remove from listing
715
+ * @example
716
+ * // example response:
717
+ * {
718
+ * "success": true,
719
+ * "count": 1
720
+ * }
721
+ */
722
+ removeItems(ids: number | number[] | string | string[]): Promise<{
723
+ success: boolean;
724
+ count: number;
725
+ removed: number[];
726
+ }>;
727
+ /**
728
+ * Buy order trigger history - `/buy-order-history`
729
+ *
730
+ * @param skip (optional) How many orders to skip
731
+ * @param game (optional) Game from supported games (without game param will return for all)
732
+ * @param sort (optional) Sort by date (default: ASC)
733
+ * @example
734
+ * // example response:
735
+ * {
736
+ * "success": true,
737
+ * "history": [
738
+ * {
739
+ * "id": 0,
740
+ * "item_name": "string",
741
+ * "game": "string",
742
+ * "price": 0,
743
+ * "created": "2020-03-25T07:10:03.674Z",
744
+ * "last_updated": "2020-03-25T07:10:03.674Z"
745
+ * }
746
+ * ],
747
+ * "count": 2
748
+ * }
749
+ */
750
+ buyOrderHistory(skip?: number, game?: keyof typeof EGameId, sort?: 'ASC' | 'DESC'): Promise<IBuyOrderHistory>;
751
+ /**
752
+ * Active buy orders. Sorted by price DESC, if a filter by name is specified - `/buy-orders`
753
+ *
754
+ * @param skip (optional) How many orders to skip
755
+ * @param name (optional) Filter by item name
756
+ * @param own (optional) Filter by own orders
757
+ * @param game (optional) Game from supported games (without game param will return for all)
758
+ * @example
759
+ * // example response:
760
+ * {
761
+ * "success": true,
762
+ * "offers": [
763
+ * {
764
+ * "id": 1,
765
+ * "name": "MP9 | Hypnotic (Minimal Wear)",
766
+ * "price": 1,
767
+ * "amount": 5,
768
+ * "game": "csgo",
769
+ * "filled": 2,
770
+ * "by": "1247ffd5-f437-4a30-9953-10eda7df6e17"
771
+ * }
772
+ * ],
773
+ * "count": 0
774
+ * }
775
+ */
776
+ buyOrders(skip?: number, name?: string, own?: '0' | '1', game?: keyof typeof EGameId): Promise<IBuyOrders>;
777
+ /**
778
+ * Create a buy order to auto purchase items. Currently independent of the p2p status of the user - `/create-buy-order`
779
+ *
780
+ * @param name Item name
781
+ * @param amount Amount of items to buy
782
+ * @param price Max price that you want to buy item for (1000 = 1$)
783
+ * @param game Game from supported games
784
+ * @example
785
+ * // example response:
786
+ * {
787
+ * "success": true,
788
+ * "msg": "Placed order",
789
+ * "filled": 2,
790
+ * "id": 2007
791
+ * }
792
+ */
793
+ createBuyOrder(name: string, amount: number, price: number, game?: keyof typeof EGameId): Promise<ICreateBuyOrder>;
794
+ /**
795
+ * Edit buy order - `/edit-buy-order`
796
+ *
797
+ * @param id Order id
798
+ * @param amount Amount of items to buy
799
+ * @param price Max price that you want to buy item for (1000 = 1$)
800
+ * @example
801
+ * // example response:
802
+ * {
803
+ * "success": true,
804
+ * "msg": "string",
805
+ * "id": 2007,
806
+ * "amount": 6,
807
+ * "price": 2008
808
+ * }
809
+ */
810
+ editBuyOrder(id: number, amount: number, price: number): Promise<IEditBuyOrder>;
811
+ /**
812
+ * Remove buy order(s) - `/remove-buy-order`
813
+ *
814
+ * @param ids Either array or one order_id that you want to remove from listing
815
+ * @example
816
+ * // example response:
817
+ * {
818
+ * "success": true,
819
+ * "msg": "string",
820
+ * "removed": 5
821
+ * }
822
+ */
823
+ removeBuyOrder(ids: number | number[]): Promise<IRemoveBuyOrder>;
824
+ /**
825
+ * Remove all buy orders by filters - `/remove-all-orders`
826
+ *
827
+ * Remove all orders with filter by game.
828
+ * Note: If response success is false, then some orders may be not removed (due to timeout), removed count will be also available in that case
829
+ *
830
+ * @param game (optional) Game from supported games (without game param will remove all)
831
+ */
832
+ removeAllOrders(game?: keyof typeof EGameId): Promise<IRemoveAllOrders>;
833
+ /**
834
+ * Fetches items based on the game you pass as a query - `/get-items-list`
835
+ *
836
+ * Responses are limited to 100 items.
837
+ *
838
+ * @param skip (optional) How many items to skip
839
+ * @param search (optional) Search by item name
840
+ * @param brand (optional) The specified category of game items, ex: rifle for CS:GO and Pants for Rust
841
+ * @param order (optional) Order by ASC or DESC (default DESC)
842
+ * @param order_by (optional) Return order
843
+ * @param exterior (optional) Exterior of the item (for CS:GO game)
844
+ * @param max_price (optional) Max price of the item (1000 = 1$)
845
+ * @param min_price (optional) Min price of the item (1000 = 1$)
846
+ * @param game Game from supported games (default csgo)
847
+ * @example
848
+ * // example response:
849
+ * {
850
+ * "success": true,
851
+ * "items": [
852
+ * {
853
+ * "name": "★ Butterfly Knife | Gamma Doppler (Factory New)",
854
+ * "price": 4999,
855
+ * "float": 0.1452850103378296,
856
+ * "best_deals": 541,
857
+ * "discount": 10,
858
+ * "steam_price": 5540,
859
+ * "image": "https://steamcommunity-a.akamaihd.net/economy/image/class/730/520026599/200fx125f",
860
+ * "item_id": "27402864642",
861
+ * "brand": "pistol",
862
+ * "type": "Glock-18"
863
+ * }
864
+ * ],
865
+ * "count": 100
866
+ * }
867
+ */
868
+ getItemsList(skip?: number, search?: string | undefined, brand?: keyof typeof EWeaponBrand | undefined, order?: 'ASC' | 'DESC', order_by?: 'price' | 'name' | 'discount' | 'best_deals', exterior?: keyof typeof EMinExteriors | undefined, max_price?: number | undefined, min_price?: number | undefined, game?: keyof typeof EGameId): Promise<IGetItemsList>;
869
+ /**
870
+ * Fetches recommended item price and other info - `/get-steam-items`
871
+ *
872
+ * @param game Game app_id from supported games (default 730)
873
+ * @param highest_offer (optional) Highest offer price (Not accurate, because not filtering offers by users balances)
874
+ * @example
875
+ * // example response:
876
+ * {
877
+ * "success": true,
878
+ * "items": [
879
+ * {
880
+ * "name": "AK-47 | Predator (Minimal Wear)",
881
+ * "average": 12685,
882
+ * "game_id": 730,
883
+ * "type": "Rifle",
884
+ * "collection": "The Dust Collection",
885
+ * "ru_name": "AK-47 | Хищник (Немного поношенное)"
886
+ * }
887
+ * ]
888
+ * }
889
+ */
890
+ getSteamItems(game?: number, highest_offer?: '0' | '1'): Promise<IGetSteamItems>;
891
+ /**
892
+ * Check if user is in system - `/merchant/user`
893
+ *
894
+ * @param steam_id Steam ID of the user
895
+ * @param merchant Your merchant name
896
+ * @example
897
+ * // example response:
898
+ * {
899
+ * "success": true,
900
+ * "user": {
901
+ * "steam_id": "string",
902
+ * "can_sell": true,
903
+ * "can_p2p": true,
904
+ * "tradelink": "string"
905
+ * }
906
+ * }
907
+ */
908
+ getMerchantUser(steam_id: string, merchant: string): Promise<IMerchantUser>;
909
+ /**
910
+ * Insert a user into a system - `/merchant/user`
911
+ *
912
+ * @param merchant Your merchant name
913
+ * @param tradelink User's tradelink
914
+ * @param steam_id Steam ID of the user
915
+ * @example
916
+ * // example response:
917
+ * {
918
+ * "success": true,
919
+ * "user": {
920
+ * "steam_id": "string",
921
+ * "can_sell": true,
922
+ * "can_p2p": true,
923
+ * "tradelink": "string"
924
+ * },
925
+ * "msg": "string"
926
+ * }
927
+ */
928
+ postMerchantUser(merchant: string, tradelink: string, steam_id: string): Promise<IMerchantUser>;
929
+ /**
930
+ * Fetch user inventory - `/merchant/inventory`
931
+ *
932
+ * Fetch and process user inventory via our system, call this endpoint before calling {@link MerchantInventory|MerchantInventory()} /merchant/inventory GET
933
+ *
934
+ * @param steam_id Steam ID of the user
935
+ * @param merchant Your merchant name
936
+ * @example
937
+ * // example response:
938
+ * {
939
+ * "success": false,
940
+ * "msg": "Inventory is closed",
941
+ * "count": 0
942
+ * }
943
+ */
944
+ MerchantInventoryUpdate(steam_id: string, merchant: string): Promise<IMerchantInventoryUpate>;
945
+ /**
946
+ * Get items that you can list for the user - `/merchant/inventory`
947
+ *
948
+ * Display items for the user to select.
949
+ * Will return fetched items by {@link MerchantInventoryUpdate|MerchantInventoryUpdate()} /merchant/inventory POST
950
+ *
951
+ * @param merchant Your merchant name
952
+ * @param steam_id Steam ID of the user
953
+ * @param game Game app_id from supported games (default 730)
954
+ * @param skip (optional) Skip first N items (default 0)
955
+ */
956
+ MerchantInventory(steam_id: string, merchant: string, game?: number, skip?: number): Promise<IMerchantInventory>;
957
+ /**
958
+ * List steam items from inventory - `/merchant/list-items-steam`
959
+ *
960
+ * Which items need to be deposited
961
+ * If instant set to true, the price will be overwritten during processing
962
+ *
963
+ * @param merchant Your merchant name
964
+ * @param steam_id Steam ID of the user
965
+ * @param items Items to list
966
+ * @param item_id Item ID to list
967
+ * @param price Price to list (1000 = 1$)
968
+ * @param instant (optional) Instant listing (default false)
969
+ * @example
970
+ * // example response:
971
+ * {
972
+ * "success": true,
973
+ * "msg": "item_not_in_inventory",
974
+ * "listed": [
975
+ * {
976
+ * "item_id": 141414144,
977
+ * "price": 1000,
978
+ * "name": "AWP | Asiimov (Field-tested)"
979
+ * }
980
+ * ],
981
+ * "tx_id": "string"
982
+ * }
983
+ */
984
+ MerchantListItemsSteam(merchant: string, steam_id: string, items: IMerchantListItem[]): Promise<IMerchantListItemsSteam>;
985
+ /**
986
+ * Returns history of deposits - `/merchant/deposits`
987
+ *
988
+ * @param merchant Your merchant name
989
+ * @param steam_id (optional) Steam ID of the user
990
+ * @param tx_id (optional) Transaction ID
991
+ * @example
992
+ * // example response:
993
+ * {
994
+ * "success": true,
995
+ * "data": [
996
+ * {
997
+ * "id": "string",
998
+ * "costum_id": "string",
999
+ * "trade_id": "string",
1000
+ * "tradelink": "string",
1001
+ * "steamid_seller": "string",
1002
+ * "created": "2022-04-14T13:39:51.362Z",
1003
+ * "send_until": "2022-04-14T13:39:51.362Z",
1004
+ * "last_updated": "string",
1005
+ * "reason": "string",
1006
+ * "user": {
1007
+ * "name": "string",
1008
+ * "steam_id": "string",
1009
+ * "steam_joined": 0
1010
+ * },
1011
+ * "items": [
1012
+ * {
1013
+ * "item_id": "string",
1014
+ * "price": 0,
1015
+ * "give_amount": 0,
1016
+ * "name": "string",
1017
+ * "status": 5
1018
+ * }
1019
+ * ]
1020
+ * }
1021
+ * ]
1022
+ * }
1023
+ */
1024
+ MerchantDepositsHistory(merchant: string, steam_id?: string, tx_id?: string): Promise<IMerchantDepositsHistory>;
1025
+ post(url: string, body: any, token?: string): Promise<any>;
1026
+ get(url: string, token?: string): Promise<any>;
1027
+ }