@assetpay/steam-mobile 1.0.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.
- package/LICENSE +21 -0
- package/README.md +1188 -0
- package/dist/index.d.mts +1632 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2984 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +80 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1632 @@
|
|
|
1
|
+
import { Buffer as Buffer$1 } from "node:buffer";
|
|
2
|
+
import { Message, MessageInitShape, MessageShape } from "@bufbuild/protobuf";
|
|
3
|
+
import { GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
4
|
+
import { EventEmitter } from "node:events";
|
|
5
|
+
import SteamID from "steamid";
|
|
6
|
+
import { CookieJar } from "tough-cookie";
|
|
7
|
+
|
|
8
|
+
//#region src/core/mobileProfile.d.ts
|
|
9
|
+
type MobilePlatform = "ios" | "android";
|
|
10
|
+
interface MobileProfile {
|
|
11
|
+
mobileClient: MobilePlatform;
|
|
12
|
+
mobileClientVersion: string;
|
|
13
|
+
apiUserAgent: string;
|
|
14
|
+
webUserAgent: string;
|
|
15
|
+
deviceFriendlyName: string;
|
|
16
|
+
osType: number;
|
|
17
|
+
gamingDeviceType: number;
|
|
18
|
+
appType?: number;
|
|
19
|
+
}
|
|
20
|
+
declare const IOS_PROFILE: MobileProfile;
|
|
21
|
+
declare const ANDROID_PROFILE: MobileProfile;
|
|
22
|
+
declare function resolveMobileProfile(input?: MobilePlatform | Partial<MobileProfile>): MobileProfile;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/http/HttpClient.d.ts
|
|
25
|
+
type Method = "GET" | "POST";
|
|
26
|
+
type ResponseType = "text" | "json" | "buffer";
|
|
27
|
+
type Scalar$1 = string | number | boolean;
|
|
28
|
+
interface HttpResponse<T = string> {
|
|
29
|
+
statusCode: number;
|
|
30
|
+
headers: Record<string, string | string[] | undefined>;
|
|
31
|
+
body: T;
|
|
32
|
+
}
|
|
33
|
+
interface MultipartField {
|
|
34
|
+
name: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
interface RequestOptions {
|
|
38
|
+
searchParams?: Record<string, Scalar$1 | undefined>;
|
|
39
|
+
form?: Record<string, Scalar$1 | undefined>;
|
|
40
|
+
multipart?: MultipartField[];
|
|
41
|
+
json?: unknown;
|
|
42
|
+
body?: string | Buffer;
|
|
43
|
+
headers?: Record<string, string>;
|
|
44
|
+
responseType?: ResponseType;
|
|
45
|
+
referer?: string;
|
|
46
|
+
signal?: AbortSignal;
|
|
47
|
+
timeoutMs?: number;
|
|
48
|
+
}
|
|
49
|
+
declare class HttpClient {
|
|
50
|
+
readonly jar: CookieJar;
|
|
51
|
+
private readonly webClient;
|
|
52
|
+
private readonly nativeClient;
|
|
53
|
+
private readonly profile;
|
|
54
|
+
private readonly proxy;
|
|
55
|
+
constructor(opts: {
|
|
56
|
+
proxy?: string;
|
|
57
|
+
profile: MobileProfile;
|
|
58
|
+
});
|
|
59
|
+
request<T = string>(method: Method, url: string, opts?: RequestOptions): Promise<HttpResponse<T>>;
|
|
60
|
+
private perform;
|
|
61
|
+
private wrapTransportError;
|
|
62
|
+
get<T = string>(url: string, opts?: RequestOptions): Promise<HttpResponse<T>>;
|
|
63
|
+
post<T = string>(url: string, opts?: RequestOptions): Promise<HttpResponse<T>>;
|
|
64
|
+
setCookie(rawCookie: string): Promise<void>;
|
|
65
|
+
getCookie(key: string, url?: string): Promise<string | undefined>;
|
|
66
|
+
getSessionId(): Promise<string>;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/protobufs/steammessages_auth_pb.d.ts
|
|
70
|
+
/**
|
|
71
|
+
* @generated from message CAuthentication_GetPasswordRSAPublicKey_Response
|
|
72
|
+
*/
|
|
73
|
+
type CAuthentication_GetPasswordRSAPublicKey_Response = Message<"CAuthentication_GetPasswordRSAPublicKey_Response"> & {
|
|
74
|
+
/**
|
|
75
|
+
* @generated from field: optional string publickey_mod = 1;
|
|
76
|
+
*/
|
|
77
|
+
publickeyMod: string;
|
|
78
|
+
/**
|
|
79
|
+
* @generated from field: optional string publickey_exp = 2;
|
|
80
|
+
*/
|
|
81
|
+
publickeyExp: string;
|
|
82
|
+
/**
|
|
83
|
+
* @generated from field: optional uint64 timestamp = 3;
|
|
84
|
+
*/
|
|
85
|
+
timestamp: bigint;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Describes the message CAuthentication_GetPasswordRSAPublicKey_Response.
|
|
89
|
+
* Use `create(CAuthentication_GetPasswordRSAPublicKey_ResponseSchema)` to create a new message.
|
|
90
|
+
*/
|
|
91
|
+
declare const CAuthentication_GetPasswordRSAPublicKey_ResponseSchema: GenMessage<CAuthentication_GetPasswordRSAPublicKey_Response>;
|
|
92
|
+
/**
|
|
93
|
+
* @generated from message CAuthentication_DeviceDetails
|
|
94
|
+
*/
|
|
95
|
+
type CAuthentication_DeviceDetails = Message<"CAuthentication_DeviceDetails"> & {
|
|
96
|
+
/**
|
|
97
|
+
* @generated from field: optional string device_friendly_name = 1;
|
|
98
|
+
*/
|
|
99
|
+
deviceFriendlyName: string;
|
|
100
|
+
/**
|
|
101
|
+
* @generated from field: optional EAuthTokenPlatformType platform_type = 2 [default = k_EAuthTokenPlatformType_Unknown];
|
|
102
|
+
*/
|
|
103
|
+
platformType: EAuthTokenPlatformType$1;
|
|
104
|
+
/**
|
|
105
|
+
* @generated from field: optional int32 os_type = 3;
|
|
106
|
+
*/
|
|
107
|
+
osType: number;
|
|
108
|
+
/**
|
|
109
|
+
* @generated from field: optional uint32 gaming_device_type = 4;
|
|
110
|
+
*/
|
|
111
|
+
gamingDeviceType: number;
|
|
112
|
+
/**
|
|
113
|
+
* @generated from field: optional uint32 client_count = 5;
|
|
114
|
+
*/
|
|
115
|
+
clientCount: number;
|
|
116
|
+
/**
|
|
117
|
+
* @generated from field: optional bytes machine_id = 6;
|
|
118
|
+
*/
|
|
119
|
+
machineId: Uint8Array;
|
|
120
|
+
/**
|
|
121
|
+
* @generated from field: optional EAuthTokenAppType app_type = 7 [default = k_EAuthTokenAppType_Unknown];
|
|
122
|
+
*/
|
|
123
|
+
appType: EAuthTokenAppType;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* @generated from message CAuthentication_AllowedConfirmation
|
|
127
|
+
*/
|
|
128
|
+
type CAuthentication_AllowedConfirmation = Message<"CAuthentication_AllowedConfirmation"> & {
|
|
129
|
+
/**
|
|
130
|
+
* @generated from field: optional EAuthSessionGuardType confirmation_type = 1 [default = k_EAuthSessionGuardType_Unknown];
|
|
131
|
+
*/
|
|
132
|
+
confirmationType: EAuthSessionGuardType$1;
|
|
133
|
+
/**
|
|
134
|
+
* @generated from field: optional string associated_message = 2;
|
|
135
|
+
*/
|
|
136
|
+
associatedMessage: string;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* @generated from message CAuthentication_BeginAuthSessionViaCredentials_Request
|
|
140
|
+
*/
|
|
141
|
+
type CAuthentication_BeginAuthSessionViaCredentials_Request = Message<"CAuthentication_BeginAuthSessionViaCredentials_Request"> & {
|
|
142
|
+
/**
|
|
143
|
+
* @generated from field: optional string device_friendly_name = 1;
|
|
144
|
+
*/
|
|
145
|
+
deviceFriendlyName: string;
|
|
146
|
+
/**
|
|
147
|
+
* @generated from field: optional string account_name = 2;
|
|
148
|
+
*/
|
|
149
|
+
accountName: string;
|
|
150
|
+
/**
|
|
151
|
+
* @generated from field: optional string encrypted_password = 3;
|
|
152
|
+
*/
|
|
153
|
+
encryptedPassword: string;
|
|
154
|
+
/**
|
|
155
|
+
* @generated from field: optional uint64 encryption_timestamp = 4;
|
|
156
|
+
*/
|
|
157
|
+
encryptionTimestamp: bigint;
|
|
158
|
+
/**
|
|
159
|
+
* @generated from field: optional bool remember_login = 5;
|
|
160
|
+
*/
|
|
161
|
+
rememberLogin: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* @generated from field: optional EAuthTokenPlatformType platform_type = 6 [default = k_EAuthTokenPlatformType_Unknown];
|
|
164
|
+
*/
|
|
165
|
+
platformType: EAuthTokenPlatformType$1;
|
|
166
|
+
/**
|
|
167
|
+
* @generated from field: optional ESessionPersistence persistence = 7 [default = k_ESessionPersistence_Persistent];
|
|
168
|
+
*/
|
|
169
|
+
persistence: ESessionPersistence$1;
|
|
170
|
+
/**
|
|
171
|
+
* @generated from field: optional string website_id = 8 [default = "Unknown"];
|
|
172
|
+
*/
|
|
173
|
+
websiteId: string;
|
|
174
|
+
/**
|
|
175
|
+
* @generated from field: optional CAuthentication_DeviceDetails device_details = 9;
|
|
176
|
+
*/
|
|
177
|
+
deviceDetails?: CAuthentication_DeviceDetails | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* @generated from field: optional string guard_data = 10;
|
|
180
|
+
*/
|
|
181
|
+
guardData: string;
|
|
182
|
+
/**
|
|
183
|
+
* @generated from field: optional uint32 language = 11;
|
|
184
|
+
*/
|
|
185
|
+
language: number;
|
|
186
|
+
/**
|
|
187
|
+
* @generated from field: optional int32 qos_level = 12 [default = 2];
|
|
188
|
+
*/
|
|
189
|
+
qosLevel: number;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Describes the message CAuthentication_BeginAuthSessionViaCredentials_Request.
|
|
193
|
+
* Use `create(CAuthentication_BeginAuthSessionViaCredentials_RequestSchema)` to create a new message.
|
|
194
|
+
*/
|
|
195
|
+
declare const CAuthentication_BeginAuthSessionViaCredentials_RequestSchema: GenMessage<CAuthentication_BeginAuthSessionViaCredentials_Request>;
|
|
196
|
+
/**
|
|
197
|
+
* @generated from message CAuthentication_BeginAuthSessionViaCredentials_Response
|
|
198
|
+
*/
|
|
199
|
+
type CAuthentication_BeginAuthSessionViaCredentials_Response = Message<"CAuthentication_BeginAuthSessionViaCredentials_Response"> & {
|
|
200
|
+
/**
|
|
201
|
+
* @generated from field: optional uint64 client_id = 1;
|
|
202
|
+
*/
|
|
203
|
+
clientId: bigint;
|
|
204
|
+
/**
|
|
205
|
+
* @generated from field: optional bytes request_id = 2;
|
|
206
|
+
*/
|
|
207
|
+
requestId: Uint8Array;
|
|
208
|
+
/**
|
|
209
|
+
* @generated from field: optional float interval = 3;
|
|
210
|
+
*/
|
|
211
|
+
interval: number;
|
|
212
|
+
/**
|
|
213
|
+
* @generated from field: repeated CAuthentication_AllowedConfirmation allowed_confirmations = 4;
|
|
214
|
+
*/
|
|
215
|
+
allowedConfirmations: CAuthentication_AllowedConfirmation[];
|
|
216
|
+
/**
|
|
217
|
+
* @generated from field: optional uint64 steamid = 5;
|
|
218
|
+
*/
|
|
219
|
+
steamid: bigint;
|
|
220
|
+
/**
|
|
221
|
+
* @generated from field: optional string weak_token = 6;
|
|
222
|
+
*/
|
|
223
|
+
weakToken: string;
|
|
224
|
+
/**
|
|
225
|
+
* @generated from field: optional string agreement_session_url = 7;
|
|
226
|
+
*/
|
|
227
|
+
agreementSessionUrl: string;
|
|
228
|
+
/**
|
|
229
|
+
* @generated from field: optional string extended_error_message = 8;
|
|
230
|
+
*/
|
|
231
|
+
extendedErrorMessage: string;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Describes the message CAuthentication_BeginAuthSessionViaCredentials_Response.
|
|
235
|
+
* Use `create(CAuthentication_BeginAuthSessionViaCredentials_ResponseSchema)` to create a new message.
|
|
236
|
+
*/
|
|
237
|
+
declare const CAuthentication_BeginAuthSessionViaCredentials_ResponseSchema: GenMessage<CAuthentication_BeginAuthSessionViaCredentials_Response>;
|
|
238
|
+
/**
|
|
239
|
+
* @generated from message CAuthentication_PollAuthSessionStatus_Response
|
|
240
|
+
*/
|
|
241
|
+
type CAuthentication_PollAuthSessionStatus_Response = Message<"CAuthentication_PollAuthSessionStatus_Response"> & {
|
|
242
|
+
/**
|
|
243
|
+
* @generated from field: optional uint64 new_client_id = 1;
|
|
244
|
+
*/
|
|
245
|
+
newClientId: bigint;
|
|
246
|
+
/**
|
|
247
|
+
* @generated from field: optional string new_challenge_url = 2;
|
|
248
|
+
*/
|
|
249
|
+
newChallengeUrl: string;
|
|
250
|
+
/**
|
|
251
|
+
* @generated from field: optional string refresh_token = 3;
|
|
252
|
+
*/
|
|
253
|
+
refreshToken: string;
|
|
254
|
+
/**
|
|
255
|
+
* @generated from field: optional string access_token = 4;
|
|
256
|
+
*/
|
|
257
|
+
accessToken: string;
|
|
258
|
+
/**
|
|
259
|
+
* @generated from field: optional bool had_remote_interaction = 5;
|
|
260
|
+
*/
|
|
261
|
+
hadRemoteInteraction: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* @generated from field: optional string account_name = 6;
|
|
264
|
+
*/
|
|
265
|
+
accountName: string;
|
|
266
|
+
/**
|
|
267
|
+
* @generated from field: optional string new_guard_data = 7;
|
|
268
|
+
*/
|
|
269
|
+
newGuardData: string;
|
|
270
|
+
/**
|
|
271
|
+
* @generated from field: optional string agreement_session_url = 8;
|
|
272
|
+
*/
|
|
273
|
+
agreementSessionUrl: string;
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Describes the message CAuthentication_PollAuthSessionStatus_Response.
|
|
277
|
+
* Use `create(CAuthentication_PollAuthSessionStatus_ResponseSchema)` to create a new message.
|
|
278
|
+
*/
|
|
279
|
+
declare const CAuthentication_PollAuthSessionStatus_ResponseSchema: GenMessage<CAuthentication_PollAuthSessionStatus_Response>;
|
|
280
|
+
/**
|
|
281
|
+
* @generated from message CAuthentication_UpdateAuthSessionWithSteamGuardCode_Response
|
|
282
|
+
*/
|
|
283
|
+
type CAuthentication_UpdateAuthSessionWithSteamGuardCode_Response = Message<"CAuthentication_UpdateAuthSessionWithSteamGuardCode_Response"> & {
|
|
284
|
+
/**
|
|
285
|
+
* @generated from field: optional string agreement_session_url = 7;
|
|
286
|
+
*/
|
|
287
|
+
agreementSessionUrl: string;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* Describes the message CAuthentication_UpdateAuthSessionWithSteamGuardCode_Response.
|
|
291
|
+
* Use `create(CAuthentication_UpdateAuthSessionWithSteamGuardCode_ResponseSchema)` to create a new message.
|
|
292
|
+
*/
|
|
293
|
+
declare const CAuthentication_UpdateAuthSessionWithSteamGuardCode_ResponseSchema: GenMessage<CAuthentication_UpdateAuthSessionWithSteamGuardCode_Response>;
|
|
294
|
+
/**
|
|
295
|
+
* @generated from message CAuthentication_GetAuthSessionsForAccount_Response
|
|
296
|
+
*/
|
|
297
|
+
type CAuthentication_GetAuthSessionsForAccount_Response = Message<"CAuthentication_GetAuthSessionsForAccount_Response"> & {
|
|
298
|
+
/**
|
|
299
|
+
* @generated from field: repeated uint64 client_ids = 1;
|
|
300
|
+
*/
|
|
301
|
+
clientIds: bigint[];
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Describes the message CAuthentication_GetAuthSessionsForAccount_Response.
|
|
305
|
+
* Use `create(CAuthentication_GetAuthSessionsForAccount_ResponseSchema)` to create a new message.
|
|
306
|
+
*/
|
|
307
|
+
declare const CAuthentication_GetAuthSessionsForAccount_ResponseSchema: GenMessage<CAuthentication_GetAuthSessionsForAccount_Response>;
|
|
308
|
+
/**
|
|
309
|
+
* @generated from message CAuthentication_RefreshToken_Revoke_Response
|
|
310
|
+
*/
|
|
311
|
+
type CAuthentication_RefreshToken_Revoke_Response = Message<"CAuthentication_RefreshToken_Revoke_Response"> & {};
|
|
312
|
+
/**
|
|
313
|
+
* Describes the message CAuthentication_RefreshToken_Revoke_Response.
|
|
314
|
+
* Use `create(CAuthentication_RefreshToken_Revoke_ResponseSchema)` to create a new message.
|
|
315
|
+
*/
|
|
316
|
+
declare const CAuthentication_RefreshToken_Revoke_ResponseSchema: GenMessage<CAuthentication_RefreshToken_Revoke_Response>;
|
|
317
|
+
/**
|
|
318
|
+
* @generated from enum EAuthTokenPlatformType
|
|
319
|
+
*/
|
|
320
|
+
declare enum EAuthTokenPlatformType$1 {
|
|
321
|
+
/**
|
|
322
|
+
* @generated from enum value: k_EAuthTokenPlatformType_Unknown = 0;
|
|
323
|
+
*/
|
|
324
|
+
k_EAuthTokenPlatformType_Unknown = 0,
|
|
325
|
+
/**
|
|
326
|
+
* @generated from enum value: k_EAuthTokenPlatformType_SteamClient = 1;
|
|
327
|
+
*/
|
|
328
|
+
k_EAuthTokenPlatformType_SteamClient = 1,
|
|
329
|
+
/**
|
|
330
|
+
* @generated from enum value: k_EAuthTokenPlatformType_WebBrowser = 2;
|
|
331
|
+
*/
|
|
332
|
+
k_EAuthTokenPlatformType_WebBrowser = 2,
|
|
333
|
+
/**
|
|
334
|
+
* @generated from enum value: k_EAuthTokenPlatformType_MobileApp = 3;
|
|
335
|
+
*/
|
|
336
|
+
k_EAuthTokenPlatformType_MobileApp = 3
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* @generated from enum EAuthTokenAppType
|
|
340
|
+
*/
|
|
341
|
+
declare enum EAuthTokenAppType {
|
|
342
|
+
/**
|
|
343
|
+
* @generated from enum value: k_EAuthTokenAppType_Unknown = 0;
|
|
344
|
+
*/
|
|
345
|
+
k_EAuthTokenAppType_Unknown = 0,
|
|
346
|
+
/**
|
|
347
|
+
* @generated from enum value: k_EAuthTokenAppType_Mobile_SteamApp = 1;
|
|
348
|
+
*/
|
|
349
|
+
k_EAuthTokenAppType_Mobile_SteamApp = 1,
|
|
350
|
+
/**
|
|
351
|
+
* @generated from enum value: k_EAuthTokenAppType_Mobile_ChatApp = 2;
|
|
352
|
+
*/
|
|
353
|
+
k_EAuthTokenAppType_Mobile_ChatApp = 2
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* @generated from enum EAuthSessionGuardType
|
|
357
|
+
*/
|
|
358
|
+
declare enum EAuthSessionGuardType$1 {
|
|
359
|
+
/**
|
|
360
|
+
* @generated from enum value: k_EAuthSessionGuardType_Unknown = 0;
|
|
361
|
+
*/
|
|
362
|
+
k_EAuthSessionGuardType_Unknown = 0,
|
|
363
|
+
/**
|
|
364
|
+
* @generated from enum value: k_EAuthSessionGuardType_None = 1;
|
|
365
|
+
*/
|
|
366
|
+
k_EAuthSessionGuardType_None = 1,
|
|
367
|
+
/**
|
|
368
|
+
* @generated from enum value: k_EAuthSessionGuardType_EmailCode = 2;
|
|
369
|
+
*/
|
|
370
|
+
k_EAuthSessionGuardType_EmailCode = 2,
|
|
371
|
+
/**
|
|
372
|
+
* @generated from enum value: k_EAuthSessionGuardType_DeviceCode = 3;
|
|
373
|
+
*/
|
|
374
|
+
k_EAuthSessionGuardType_DeviceCode = 3,
|
|
375
|
+
/**
|
|
376
|
+
* @generated from enum value: k_EAuthSessionGuardType_DeviceConfirmation = 4;
|
|
377
|
+
*/
|
|
378
|
+
k_EAuthSessionGuardType_DeviceConfirmation = 4,
|
|
379
|
+
/**
|
|
380
|
+
* @generated from enum value: k_EAuthSessionGuardType_EmailConfirmation = 5;
|
|
381
|
+
*/
|
|
382
|
+
k_EAuthSessionGuardType_EmailConfirmation = 5,
|
|
383
|
+
/**
|
|
384
|
+
* @generated from enum value: k_EAuthSessionGuardType_MachineToken = 6;
|
|
385
|
+
*/
|
|
386
|
+
k_EAuthSessionGuardType_MachineToken = 6,
|
|
387
|
+
/**
|
|
388
|
+
* @generated from enum value: k_EAuthSessionGuardType_LegacyMachineAuth = 7;
|
|
389
|
+
*/
|
|
390
|
+
k_EAuthSessionGuardType_LegacyMachineAuth = 7
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* @generated from enum ESessionPersistence
|
|
394
|
+
*/
|
|
395
|
+
declare enum ESessionPersistence$1 {
|
|
396
|
+
/**
|
|
397
|
+
* @generated from enum value: k_ESessionPersistence_Invalid = -1;
|
|
398
|
+
*/
|
|
399
|
+
k_ESessionPersistence_Invalid = -1,
|
|
400
|
+
/**
|
|
401
|
+
* @generated from enum value: k_ESessionPersistence_Ephemeral = 0;
|
|
402
|
+
*/
|
|
403
|
+
k_ESessionPersistence_Ephemeral = 0,
|
|
404
|
+
/**
|
|
405
|
+
* @generated from enum value: k_ESessionPersistence_Persistent = 1;
|
|
406
|
+
*/
|
|
407
|
+
k_ESessionPersistence_Persistent = 1
|
|
408
|
+
}
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/auth/AuthClient.d.ts
|
|
411
|
+
type BeginRequest = MessageInitShape<typeof CAuthentication_BeginAuthSessionViaCredentials_RequestSchema>;
|
|
412
|
+
declare class AuthClient {
|
|
413
|
+
private readonly transport;
|
|
414
|
+
constructor(http: HttpClient);
|
|
415
|
+
getPasswordRSAPublicKey(accountName: string): Promise<MessageShape<typeof CAuthentication_GetPasswordRSAPublicKey_ResponseSchema>>;
|
|
416
|
+
beginAuthSessionViaCredentials(req: BeginRequest): Promise<MessageShape<typeof CAuthentication_BeginAuthSessionViaCredentials_ResponseSchema>>;
|
|
417
|
+
pollAuthSessionStatus(clientId: bigint, requestId: Uint8Array): Promise<MessageShape<typeof CAuthentication_PollAuthSessionStatus_ResponseSchema>>;
|
|
418
|
+
updateAuthSessionWithSteamGuardCode(clientId: bigint, steamid: bigint, code: string, codeType: number): Promise<MessageShape<typeof CAuthentication_UpdateAuthSessionWithSteamGuardCode_ResponseSchema>>;
|
|
419
|
+
getAuthSessionsForAccount(accessToken: string): Promise<MessageShape<typeof CAuthentication_GetAuthSessionsForAccount_ResponseSchema>>;
|
|
420
|
+
revokeRefreshToken(accessToken: string, revokeAction: number): Promise<MessageShape<typeof CAuthentication_RefreshToken_Revoke_ResponseSchema>>;
|
|
421
|
+
private send;
|
|
422
|
+
}
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region src/core/enums.d.ts
|
|
425
|
+
declare enum ETradeOfferState {
|
|
426
|
+
Invalid = 1,
|
|
427
|
+
Active = 2,
|
|
428
|
+
Accepted = 3,
|
|
429
|
+
Countered = 4,
|
|
430
|
+
Expired = 5,
|
|
431
|
+
Canceled = 6,
|
|
432
|
+
Declined = 7,
|
|
433
|
+
InvalidItems = 8,
|
|
434
|
+
CreatedNeedsConfirmation = 9,
|
|
435
|
+
CanceledBySecondFactor = 10,
|
|
436
|
+
InEscrow = 11,
|
|
437
|
+
/** Trade was reverted by the user (Trade protection update 2025) */
|
|
438
|
+
Reverted = 12
|
|
439
|
+
}
|
|
440
|
+
declare enum ETradeStatus {
|
|
441
|
+
Init = 0,
|
|
442
|
+
PreCommitted = 1,
|
|
443
|
+
Committed = 2,
|
|
444
|
+
Complete = 3,
|
|
445
|
+
Failed = 4,
|
|
446
|
+
PartialSupportRollback = 5,
|
|
447
|
+
FullSupportRollback = 6,
|
|
448
|
+
SupportRollback_Selective = 7,
|
|
449
|
+
RollbackFailed = 8,
|
|
450
|
+
RollbackAbandoned = 9,
|
|
451
|
+
InEscrow = 10,
|
|
452
|
+
EscrowRollback = 11,
|
|
453
|
+
/** Trade was reverted by the user (Trade protection update 2025) */
|
|
454
|
+
Reverted = 12
|
|
455
|
+
}
|
|
456
|
+
declare enum EConfirmationMethod {
|
|
457
|
+
None = 0,
|
|
458
|
+
Email = 1,
|
|
459
|
+
MobileApp = 2
|
|
460
|
+
}
|
|
461
|
+
declare enum EConfirmationType {
|
|
462
|
+
Invalid = 0,
|
|
463
|
+
Generic = 1,
|
|
464
|
+
Trade = 2,
|
|
465
|
+
MarketListing = 3,
|
|
466
|
+
FeatureOptOut = 4,
|
|
467
|
+
PhoneNumberChange = 5,
|
|
468
|
+
AccountRecovery = 6
|
|
469
|
+
}
|
|
470
|
+
declare enum EOfferFilter {
|
|
471
|
+
ActiveOnly = 1,
|
|
472
|
+
HistoricalOnly = 2,
|
|
473
|
+
All = 3
|
|
474
|
+
}
|
|
475
|
+
declare enum EAuthTokenPlatformType {
|
|
476
|
+
Unknown = 0,
|
|
477
|
+
SteamClient = 1,
|
|
478
|
+
WebBrowser = 2,
|
|
479
|
+
MobileApp = 3
|
|
480
|
+
}
|
|
481
|
+
declare enum ESessionPersistence {
|
|
482
|
+
Invalid = -1,
|
|
483
|
+
Ephemeral = 0,
|
|
484
|
+
Persistent = 1
|
|
485
|
+
}
|
|
486
|
+
declare enum EAuthSessionGuardType {
|
|
487
|
+
Unknown = 0,
|
|
488
|
+
None = 1,
|
|
489
|
+
EmailCode = 2,
|
|
490
|
+
DeviceCode = 3,
|
|
491
|
+
DeviceConfirmation = 4,
|
|
492
|
+
EmailConfirmation = 5,
|
|
493
|
+
MachineToken = 6,
|
|
494
|
+
LegacyMachineAuth = 7
|
|
495
|
+
}
|
|
496
|
+
declare enum EAuthTokenRevokeAction {
|
|
497
|
+
Logout = 0,
|
|
498
|
+
Permanent = 1,
|
|
499
|
+
Replaced = 2,
|
|
500
|
+
Support = 3,
|
|
501
|
+
Consume = 4,
|
|
502
|
+
NonRememberedLogout = 5,
|
|
503
|
+
NonRememberedPermanent = 6,
|
|
504
|
+
Automatic = 7
|
|
505
|
+
}
|
|
506
|
+
declare enum ETokenRenewalType {
|
|
507
|
+
None = 0,
|
|
508
|
+
Allow = 1
|
|
509
|
+
}
|
|
510
|
+
declare enum EResult {
|
|
511
|
+
Invalid = 0,
|
|
512
|
+
OK = 1,
|
|
513
|
+
Fail = 2,
|
|
514
|
+
NoConnection = 3,
|
|
515
|
+
InvalidPassword = 5,
|
|
516
|
+
LoggedInElsewhere = 6,
|
|
517
|
+
InvalidProtocolVer = 7,
|
|
518
|
+
InvalidParam = 8,
|
|
519
|
+
FileNotFound = 9,
|
|
520
|
+
Busy = 10,
|
|
521
|
+
InvalidState = 11,
|
|
522
|
+
InvalidName = 12,
|
|
523
|
+
InvalidEmail = 13,
|
|
524
|
+
DuplicateName = 14,
|
|
525
|
+
AccessDenied = 15,
|
|
526
|
+
Timeout = 16,
|
|
527
|
+
Banned = 17,
|
|
528
|
+
AccountNotFound = 18,
|
|
529
|
+
InvalidSteamID = 19,
|
|
530
|
+
ServiceUnavailable = 20,
|
|
531
|
+
NotLoggedOn = 21,
|
|
532
|
+
Pending = 22,
|
|
533
|
+
EncryptionFailure = 23,
|
|
534
|
+
InsufficientPrivilege = 24,
|
|
535
|
+
LimitExceeded = 25,
|
|
536
|
+
Revoked = 26,
|
|
537
|
+
Expired = 27,
|
|
538
|
+
AlreadyRedeemed = 28,
|
|
539
|
+
DuplicateRequest = 29,
|
|
540
|
+
AlreadyOwned = 30,
|
|
541
|
+
IPNotFound = 31,
|
|
542
|
+
PersistFailed = 32,
|
|
543
|
+
LockingFailed = 33,
|
|
544
|
+
LogonSessionReplaced = 34,
|
|
545
|
+
ConnectFailed = 35,
|
|
546
|
+
HandshakeFailed = 36,
|
|
547
|
+
IOFailure = 37,
|
|
548
|
+
RemoteDisconnect = 38,
|
|
549
|
+
ShoppingCartNotFound = 39,
|
|
550
|
+
Blocked = 40,
|
|
551
|
+
Ignored = 41,
|
|
552
|
+
NoMatch = 42,
|
|
553
|
+
AccountDisabled = 43,
|
|
554
|
+
ServiceReadOnly = 44,
|
|
555
|
+
AccountNotFeatured = 45,
|
|
556
|
+
AdministratorOK = 46,
|
|
557
|
+
ContentVersion = 47,
|
|
558
|
+
TryAnotherCM = 48,
|
|
559
|
+
PasswordRequiredToKickSession = 49,
|
|
560
|
+
AlreadyLoggedInElsewhere = 50,
|
|
561
|
+
Suspended = 51,
|
|
562
|
+
Cancelled = 52,
|
|
563
|
+
DataCorruption = 53,
|
|
564
|
+
DiskFull = 54,
|
|
565
|
+
RemoteCallFailed = 55,
|
|
566
|
+
PasswordUnset = 56,
|
|
567
|
+
ExternalAccountUnlinked = 57,
|
|
568
|
+
PSNTicketInvalid = 58,
|
|
569
|
+
ExternalAccountAlreadyLinked = 59,
|
|
570
|
+
RemoteFileConflict = 60,
|
|
571
|
+
IllegalPassword = 61,
|
|
572
|
+
SameAsPreviousValue = 62,
|
|
573
|
+
AccountLogonDenied = 63,
|
|
574
|
+
CannotUseOldPassword = 64,
|
|
575
|
+
InvalidLoginAuthCode = 65,
|
|
576
|
+
AccountLogonDeniedNoMail = 66,
|
|
577
|
+
HardwareNotCapableOfIPT = 67,
|
|
578
|
+
IPTInitError = 68,
|
|
579
|
+
ParentalControlRestricted = 69,
|
|
580
|
+
FacebookQueryError = 70,
|
|
581
|
+
ExpiredLoginAuthCode = 71,
|
|
582
|
+
IPLoginRestrictionFailed = 72,
|
|
583
|
+
AccountLockedDown = 73,
|
|
584
|
+
AccountLogonDeniedVerifiedEmailRequired = 74,
|
|
585
|
+
NoMatchingURL = 75,
|
|
586
|
+
BadResponse = 76,
|
|
587
|
+
RequirePasswordReEntry = 77,
|
|
588
|
+
ValueOutOfRange = 78,
|
|
589
|
+
UnexpectedError = 79,
|
|
590
|
+
Disabled = 80,
|
|
591
|
+
InvalidCEGSubmission = 81,
|
|
592
|
+
RestrictedDevice = 82,
|
|
593
|
+
RegionLocked = 83,
|
|
594
|
+
RateLimitExceeded = 84,
|
|
595
|
+
AccountLoginDeniedNeedTwoFactor = 85,
|
|
596
|
+
ItemDeleted = 86,
|
|
597
|
+
AccountLoginDeniedThrottle = 87,
|
|
598
|
+
TwoFactorCodeMismatch = 88,
|
|
599
|
+
TwoFactorActivationCodeMismatch = 89,
|
|
600
|
+
AccountAssociatedToMultiplePartners = 90,
|
|
601
|
+
NotModified = 91,
|
|
602
|
+
NoMobileDevice = 92,
|
|
603
|
+
TimeNotSynced = 93,
|
|
604
|
+
SMSCodeFailed = 94,
|
|
605
|
+
AccountLimitExceeded = 95,
|
|
606
|
+
AccountActivityLimitExceeded = 96,
|
|
607
|
+
PhoneActivityLimitExceeded = 97,
|
|
608
|
+
RefundToWallet = 98,
|
|
609
|
+
EmailSendFailure = 99,
|
|
610
|
+
NotSettled = 100,
|
|
611
|
+
NeedCaptcha = 101,
|
|
612
|
+
GSLTDenied = 102,
|
|
613
|
+
GSOwnerDenied = 103,
|
|
614
|
+
InvalidItemType = 104,
|
|
615
|
+
IPBanned = 105,
|
|
616
|
+
GSLTExpired = 106,
|
|
617
|
+
InsufficientFunds = 107,
|
|
618
|
+
TooManyPending = 108,
|
|
619
|
+
NoSiteLicensesFound = 109,
|
|
620
|
+
WGNetworkSendExceeded = 110,
|
|
621
|
+
AccountNotFriends = 111,
|
|
622
|
+
LimitedUserAccount = 112
|
|
623
|
+
}
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region src/auth/CredentialSession.d.ts
|
|
626
|
+
interface CredentialSessionEvents {
|
|
627
|
+
debug: [message: string];
|
|
628
|
+
authenticated: [];
|
|
629
|
+
timeout: [];
|
|
630
|
+
error: [error: Error];
|
|
631
|
+
steamGuardRequired: [info: {
|
|
632
|
+
type: EAuthSessionGuardType;
|
|
633
|
+
message: string;
|
|
634
|
+
}];
|
|
635
|
+
remoteInteraction: [];
|
|
636
|
+
}
|
|
637
|
+
interface CredentialStartOptions {
|
|
638
|
+
username: string;
|
|
639
|
+
password: string;
|
|
640
|
+
sharedSecret?: string;
|
|
641
|
+
steamGuardCode?: string;
|
|
642
|
+
}
|
|
643
|
+
declare class CredentialSession extends EventEmitter<CredentialSessionEvents> {
|
|
644
|
+
private readonly profile;
|
|
645
|
+
private readonly pollTimeoutMs;
|
|
646
|
+
private readonly auth;
|
|
647
|
+
private clientId;
|
|
648
|
+
private requestId;
|
|
649
|
+
private pollIntervalMs;
|
|
650
|
+
private allowedConfirmations;
|
|
651
|
+
private deadline;
|
|
652
|
+
private pollTimer;
|
|
653
|
+
private settled;
|
|
654
|
+
private remoteInteractionEmitted;
|
|
655
|
+
steamID: SteamID | undefined;
|
|
656
|
+
username: string;
|
|
657
|
+
accessToken: string | undefined;
|
|
658
|
+
refreshToken: string | undefined;
|
|
659
|
+
constructor(http: HttpClient, profile: MobileProfile, pollTimeoutMs?: number);
|
|
660
|
+
start(opts: CredentialStartOptions): Promise<void>;
|
|
661
|
+
submitSteamGuardCode(code: string): Promise<void>;
|
|
662
|
+
stop(): void;
|
|
663
|
+
private answerConfirmations;
|
|
664
|
+
private submitCode;
|
|
665
|
+
private schedulePoll;
|
|
666
|
+
private poll;
|
|
667
|
+
private emitRemoteInteraction;
|
|
668
|
+
private fail;
|
|
669
|
+
}
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region src/auth/loginWithCredentials.d.ts
|
|
672
|
+
interface LoginWithCredentialsOptions {
|
|
673
|
+
username: string;
|
|
674
|
+
password: string;
|
|
675
|
+
sharedSecret?: string;
|
|
676
|
+
steamGuardCode?: string;
|
|
677
|
+
proxy?: string;
|
|
678
|
+
mobileProfile?: MobilePlatform | Partial<MobileProfile>;
|
|
679
|
+
signal?: AbortSignal;
|
|
680
|
+
onSteamGuardRequired?: (info: {
|
|
681
|
+
type: number;
|
|
682
|
+
message: string;
|
|
683
|
+
}) => Promise<string> | string;
|
|
684
|
+
}
|
|
685
|
+
interface LoginResult {
|
|
686
|
+
refreshToken: string;
|
|
687
|
+
accessToken: string | undefined;
|
|
688
|
+
steamId: string;
|
|
689
|
+
username: string;
|
|
690
|
+
}
|
|
691
|
+
declare function loginWithCredentials(opts: LoginWithCredentialsOptions): Promise<LoginResult>;
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region src/models/EconItem.d.ts
|
|
694
|
+
interface SteamTag {
|
|
695
|
+
category: string;
|
|
696
|
+
internal_name: string;
|
|
697
|
+
localized_category_name?: string;
|
|
698
|
+
category_name?: string;
|
|
699
|
+
localized_tag_name?: string;
|
|
700
|
+
name?: string;
|
|
701
|
+
color?: string;
|
|
702
|
+
}
|
|
703
|
+
interface SteamDescriptionLine {
|
|
704
|
+
type: string;
|
|
705
|
+
value: string;
|
|
706
|
+
color?: string;
|
|
707
|
+
name?: string;
|
|
708
|
+
}
|
|
709
|
+
interface SteamAction {
|
|
710
|
+
link: string;
|
|
711
|
+
name: string;
|
|
712
|
+
type?: string;
|
|
713
|
+
}
|
|
714
|
+
interface AssetProperty {
|
|
715
|
+
propertyid: number;
|
|
716
|
+
int_value?: string;
|
|
717
|
+
float_value?: string;
|
|
718
|
+
string_value?: string;
|
|
719
|
+
}
|
|
720
|
+
interface RawInventoryAsset {
|
|
721
|
+
appid?: number | string;
|
|
722
|
+
contextid?: string;
|
|
723
|
+
assetid?: string;
|
|
724
|
+
id?: string;
|
|
725
|
+
classid: string;
|
|
726
|
+
instanceid?: string;
|
|
727
|
+
amount: string;
|
|
728
|
+
currencyid?: string;
|
|
729
|
+
pos?: number;
|
|
730
|
+
[key: string]: unknown;
|
|
731
|
+
}
|
|
732
|
+
interface RawDescription {
|
|
733
|
+
appid?: number | string;
|
|
734
|
+
classid: string;
|
|
735
|
+
instanceid?: string;
|
|
736
|
+
icon_url?: string;
|
|
737
|
+
name?: string;
|
|
738
|
+
type?: string;
|
|
739
|
+
market_name?: string;
|
|
740
|
+
market_hash_name?: string;
|
|
741
|
+
tradable?: number | boolean;
|
|
742
|
+
marketable?: number | boolean;
|
|
743
|
+
commodity?: number | boolean;
|
|
744
|
+
market_tradable_restriction?: number | string;
|
|
745
|
+
market_marketable_restriction?: number | string;
|
|
746
|
+
descriptions?: SteamDescriptionLine[];
|
|
747
|
+
owner_descriptions?: SteamDescriptionLine[];
|
|
748
|
+
actions?: SteamAction[];
|
|
749
|
+
market_actions?: SteamAction[];
|
|
750
|
+
fraudwarnings?: string[];
|
|
751
|
+
tags?: SteamTag[];
|
|
752
|
+
[key: string]: unknown;
|
|
753
|
+
}
|
|
754
|
+
interface RawAssetPropertyEntry {
|
|
755
|
+
appid: number;
|
|
756
|
+
contextid: string;
|
|
757
|
+
assetid: string;
|
|
758
|
+
asset_properties: AssetProperty[];
|
|
759
|
+
}
|
|
760
|
+
interface RawInventoryResponse {
|
|
761
|
+
assets?: RawInventoryAsset[];
|
|
762
|
+
descriptions?: RawDescription[];
|
|
763
|
+
asset_properties?: RawAssetPropertyEntry[];
|
|
764
|
+
more_items?: number;
|
|
765
|
+
last_assetid?: string;
|
|
766
|
+
total_inventory_count?: number;
|
|
767
|
+
success?: number;
|
|
768
|
+
error?: string;
|
|
769
|
+
Error?: string;
|
|
770
|
+
}
|
|
771
|
+
interface RawPartnerInventoryResponse {
|
|
772
|
+
success?: boolean;
|
|
773
|
+
error?: string;
|
|
774
|
+
Error?: string;
|
|
775
|
+
rgInventory?: Record<string, RawInventoryAsset> | unknown[];
|
|
776
|
+
rgDescriptions?: Record<string, RawDescription> | unknown[];
|
|
777
|
+
rgAssetProperties?: Record<string, AssetProperty[]> | unknown[];
|
|
778
|
+
more?: boolean;
|
|
779
|
+
more_start?: number | boolean;
|
|
780
|
+
}
|
|
781
|
+
interface EconItem {
|
|
782
|
+
appid: number;
|
|
783
|
+
contextid: string;
|
|
784
|
+
assetid: string;
|
|
785
|
+
classid: string;
|
|
786
|
+
instanceid: string;
|
|
787
|
+
amount: number;
|
|
788
|
+
currencyid?: string;
|
|
789
|
+
name: string;
|
|
790
|
+
market_name: string;
|
|
791
|
+
market_hash_name: string;
|
|
792
|
+
type: string;
|
|
793
|
+
name_color?: string;
|
|
794
|
+
background_color?: string;
|
|
795
|
+
icon_url: string;
|
|
796
|
+
icon_url_large?: string;
|
|
797
|
+
tradable: boolean;
|
|
798
|
+
marketable: boolean;
|
|
799
|
+
commodity: boolean;
|
|
800
|
+
market_tradable_restriction: number;
|
|
801
|
+
market_marketable_restriction: number;
|
|
802
|
+
descriptions: SteamDescriptionLine[];
|
|
803
|
+
owner_descriptions: SteamDescriptionLine[];
|
|
804
|
+
actions: SteamAction[];
|
|
805
|
+
market_actions: SteamAction[];
|
|
806
|
+
fraudwarnings: string[];
|
|
807
|
+
tags: SteamTag[];
|
|
808
|
+
asset_properties: AssetProperty[];
|
|
809
|
+
[key: string]: unknown;
|
|
810
|
+
}
|
|
811
|
+
declare function parseInventory(body: RawInventoryResponse, contextid: string, tradableOnly?: boolean): EconItem[];
|
|
812
|
+
declare function parsePartnerInventory(body: RawPartnerInventoryResponse, contextid: string, tradableOnly?: boolean): EconItem[];
|
|
813
|
+
//#endregion
|
|
814
|
+
//#region src/core/types.d.ts
|
|
815
|
+
type OfferTarget = {
|
|
816
|
+
tradeUrl: string;
|
|
817
|
+
steamId?: never;
|
|
818
|
+
token?: never;
|
|
819
|
+
} | {
|
|
820
|
+
steamId: string;
|
|
821
|
+
token?: string;
|
|
822
|
+
tradeUrl?: never;
|
|
823
|
+
};
|
|
824
|
+
interface TradeItem {
|
|
825
|
+
appid: number;
|
|
826
|
+
contextid: string;
|
|
827
|
+
assetid: string;
|
|
828
|
+
amount?: number;
|
|
829
|
+
}
|
|
830
|
+
interface RawAsset {
|
|
831
|
+
appid: number;
|
|
832
|
+
contextid: string;
|
|
833
|
+
assetid: string;
|
|
834
|
+
classid: string;
|
|
835
|
+
instanceid: string;
|
|
836
|
+
amount: string;
|
|
837
|
+
missing?: boolean;
|
|
838
|
+
est_usd?: string;
|
|
839
|
+
[key: string]: unknown;
|
|
840
|
+
}
|
|
841
|
+
interface RawCEconTradeOffer {
|
|
842
|
+
tradeofferid: string;
|
|
843
|
+
accountid_other: number;
|
|
844
|
+
message?: string;
|
|
845
|
+
expiration_time: number;
|
|
846
|
+
trade_offer_state: number;
|
|
847
|
+
items_to_give?: RawAsset[];
|
|
848
|
+
items_to_receive?: RawAsset[];
|
|
849
|
+
is_our_offer: boolean;
|
|
850
|
+
time_created: number;
|
|
851
|
+
time_updated: number;
|
|
852
|
+
tradeid?: string;
|
|
853
|
+
from_real_time_trade: boolean;
|
|
854
|
+
escrow_end_date: number;
|
|
855
|
+
confirmation_method: number;
|
|
856
|
+
eresult?: number;
|
|
857
|
+
delay_settlement?: boolean;
|
|
858
|
+
settlement_date?: number;
|
|
859
|
+
[key: string]: unknown;
|
|
860
|
+
}
|
|
861
|
+
interface RawGetTradeOffersResponse {
|
|
862
|
+
trade_offers_sent?: RawCEconTradeOffer[];
|
|
863
|
+
trade_offers_received?: RawCEconTradeOffer[];
|
|
864
|
+
descriptions?: RawDescription[];
|
|
865
|
+
next_cursor?: number;
|
|
866
|
+
}
|
|
867
|
+
interface RawExchangeAsset {
|
|
868
|
+
appid: number;
|
|
869
|
+
contextid: string;
|
|
870
|
+
assetid: string;
|
|
871
|
+
classid: string;
|
|
872
|
+
instanceid: string;
|
|
873
|
+
amount: string;
|
|
874
|
+
new_assetid?: string;
|
|
875
|
+
new_contextid?: string;
|
|
876
|
+
rollback_new_assetid?: string;
|
|
877
|
+
rollback_new_contextid?: string;
|
|
878
|
+
currencyid?: string;
|
|
879
|
+
[key: string]: unknown;
|
|
880
|
+
}
|
|
881
|
+
interface RawTradeStatus {
|
|
882
|
+
tradeid: string;
|
|
883
|
+
steamid_other?: string;
|
|
884
|
+
time_init: number;
|
|
885
|
+
time_settlement?: number;
|
|
886
|
+
status: number;
|
|
887
|
+
assets_received?: RawExchangeAsset[];
|
|
888
|
+
assets_given?: RawExchangeAsset[];
|
|
889
|
+
time_mod?: number;
|
|
890
|
+
[key: string]: unknown;
|
|
891
|
+
}
|
|
892
|
+
interface RawGetTradeStatusResponse {
|
|
893
|
+
trades?: RawTradeStatus[];
|
|
894
|
+
descriptions?: RawDescription[];
|
|
895
|
+
}
|
|
896
|
+
interface WebTradeEligibility {
|
|
897
|
+
allowed: number;
|
|
898
|
+
reason: number;
|
|
899
|
+
allowed_at_time: number;
|
|
900
|
+
steamguard_required_days: number;
|
|
901
|
+
new_device_cooldown_days: number;
|
|
902
|
+
expiration: number;
|
|
903
|
+
time_checked: number;
|
|
904
|
+
[key: string]: unknown;
|
|
905
|
+
}
|
|
906
|
+
//#endregion
|
|
907
|
+
//#region src/http/webApi.d.ts
|
|
908
|
+
type Scalar = string | number | boolean;
|
|
909
|
+
interface ApiCallParams {
|
|
910
|
+
httpMethod: "GET" | "POST";
|
|
911
|
+
iface: string;
|
|
912
|
+
method: string;
|
|
913
|
+
version?: number;
|
|
914
|
+
input?: Record<string, Scalar | undefined>;
|
|
915
|
+
retryAfterMs?: number | null;
|
|
916
|
+
}
|
|
917
|
+
type ApiBody = {
|
|
918
|
+
response?: Record<string, unknown>;
|
|
919
|
+
} & Record<string, unknown>;
|
|
920
|
+
declare class WebApiClient {
|
|
921
|
+
private readonly http;
|
|
922
|
+
private readonly getAccessToken;
|
|
923
|
+
constructor(http: HttpClient, getAccessToken: () => Promise<string>);
|
|
924
|
+
call<T = ApiBody>(params: ApiCallParams): Promise<T>;
|
|
925
|
+
}
|
|
926
|
+
//#endregion
|
|
927
|
+
//#region src/session/SessionManager.d.ts
|
|
928
|
+
interface SessionManagerEvents {
|
|
929
|
+
refreshToken: [token: string];
|
|
930
|
+
sessionExpired: [error: Error];
|
|
931
|
+
debug: [message: string];
|
|
932
|
+
}
|
|
933
|
+
declare class SessionManager extends EventEmitter<SessionManagerEvents> {
|
|
934
|
+
refreshToken: string;
|
|
935
|
+
accessToken: string | undefined;
|
|
936
|
+
readonly steamID: SteamID;
|
|
937
|
+
private readonly http;
|
|
938
|
+
private readonly protoPost;
|
|
939
|
+
private minting;
|
|
940
|
+
private revoked;
|
|
941
|
+
constructor(http: HttpClient, refreshToken: string);
|
|
942
|
+
getAccessToken(): Promise<string>;
|
|
943
|
+
listSessions(): Promise<bigint[]>;
|
|
944
|
+
logout(action?: EAuthTokenRevokeAction): Promise<void>;
|
|
945
|
+
setRefreshToken(refreshToken: string): Promise<void>;
|
|
946
|
+
private mint;
|
|
947
|
+
private expire;
|
|
948
|
+
private applyLoginCookie;
|
|
949
|
+
}
|
|
950
|
+
//#endregion
|
|
951
|
+
//#region src/community/confirmations.d.ts
|
|
952
|
+
interface Confirmation {
|
|
953
|
+
id: string;
|
|
954
|
+
type: number;
|
|
955
|
+
creator: string;
|
|
956
|
+
key: string;
|
|
957
|
+
title: string;
|
|
958
|
+
receiving: string;
|
|
959
|
+
sending: string;
|
|
960
|
+
time: string;
|
|
961
|
+
timestamp: Date;
|
|
962
|
+
icon: string;
|
|
963
|
+
}
|
|
964
|
+
type ConfKey = string | {
|
|
965
|
+
tag: string;
|
|
966
|
+
key: string;
|
|
967
|
+
};
|
|
968
|
+
declare class ConfirmationManager {
|
|
969
|
+
private readonly http;
|
|
970
|
+
private readonly steamID;
|
|
971
|
+
private readonly identitySecret;
|
|
972
|
+
private readonly profile;
|
|
973
|
+
private timeOffset;
|
|
974
|
+
private timeOffsetAt;
|
|
975
|
+
private readonly usedConfTimes;
|
|
976
|
+
constructor(http: HttpClient, steamID: SteamID, identitySecret: string | undefined, profile: MobileProfile);
|
|
977
|
+
get hasIdentitySecret(): boolean;
|
|
978
|
+
private deviceId;
|
|
979
|
+
getConfirmations(time: number, key: ConfKey): Promise<Confirmation[]>;
|
|
980
|
+
respondToConfirmation(confID: string, confKey: string, time: number, key: ConfKey, accept: boolean): Promise<void>;
|
|
981
|
+
getPending(): Promise<Confirmation[]>;
|
|
982
|
+
acceptConfirmation(confID: string, nonce: string): Promise<void>;
|
|
983
|
+
rejectConfirmation(confID: string, nonce: string): Promise<void>;
|
|
984
|
+
acceptAll(): Promise<Confirmation[]>;
|
|
985
|
+
acceptConfirmationForObject(objectID: string): Promise<void>;
|
|
986
|
+
private actOnConfirmation;
|
|
987
|
+
private requireSecret;
|
|
988
|
+
private nextConfTime;
|
|
989
|
+
private getTimeOffset;
|
|
990
|
+
private confParams;
|
|
991
|
+
private getlist;
|
|
992
|
+
}
|
|
993
|
+
//#endregion
|
|
994
|
+
//#region src/community/openid.d.ts
|
|
995
|
+
interface OpenidConfirmation {
|
|
996
|
+
location: string;
|
|
997
|
+
params: Record<string, string>;
|
|
998
|
+
steamId: string;
|
|
999
|
+
}
|
|
1000
|
+
interface OpenidCookie {
|
|
1001
|
+
name: string;
|
|
1002
|
+
value: string;
|
|
1003
|
+
}
|
|
1004
|
+
interface OpenidLoginResult {
|
|
1005
|
+
steamId: string;
|
|
1006
|
+
finalUrl: string;
|
|
1007
|
+
cookies: OpenidCookie[];
|
|
1008
|
+
}
|
|
1009
|
+
interface OpenidLoginOptions {
|
|
1010
|
+
initiateUrl: string;
|
|
1011
|
+
cookieHost?: string;
|
|
1012
|
+
maxRedirects?: number;
|
|
1013
|
+
}
|
|
1014
|
+
declare function parseOpenidForm(html: string): {
|
|
1015
|
+
action: string;
|
|
1016
|
+
fields: MultipartField[];
|
|
1017
|
+
} | null;
|
|
1018
|
+
declare function confirmOpenid(http: HttpClient, interstitialHtml: string, referer?: string): Promise<OpenidConfirmation>;
|
|
1019
|
+
declare function steamOpenidLogin(http: HttpClient, options: OpenidLoginOptions): Promise<OpenidLoginResult>;
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region src/community/CommunityNamespace.d.ts
|
|
1022
|
+
interface GetInventoryOptions {
|
|
1023
|
+
steamId?: string;
|
|
1024
|
+
tradableOnly?: boolean;
|
|
1025
|
+
}
|
|
1026
|
+
interface SteamProfile {
|
|
1027
|
+
steamId: string;
|
|
1028
|
+
personaName: string;
|
|
1029
|
+
avatar: string;
|
|
1030
|
+
accountCreated: Date | null;
|
|
1031
|
+
tradeBanState: string;
|
|
1032
|
+
isLimited: boolean;
|
|
1033
|
+
vacBanned: boolean;
|
|
1034
|
+
privacyState: string;
|
|
1035
|
+
}
|
|
1036
|
+
declare class CommunityNamespace {
|
|
1037
|
+
private readonly http;
|
|
1038
|
+
private readonly session;
|
|
1039
|
+
private readonly confirmations;
|
|
1040
|
+
private readonly api;
|
|
1041
|
+
constructor(http: HttpClient, session: SessionManager, confirmations: ConfirmationManager, api: WebApiClient);
|
|
1042
|
+
acknowledgeTradeProtection(): Promise<void>;
|
|
1043
|
+
getTradeURL(): Promise<{
|
|
1044
|
+
url: string;
|
|
1045
|
+
token: string;
|
|
1046
|
+
}>;
|
|
1047
|
+
changeTradeURL(): Promise<{
|
|
1048
|
+
url: string;
|
|
1049
|
+
token: string;
|
|
1050
|
+
}>;
|
|
1051
|
+
getProfile(steamId?: string): Promise<SteamProfile>;
|
|
1052
|
+
getWebTradeEligibility(): Promise<WebTradeEligibility>;
|
|
1053
|
+
openidLogin(options: OpenidLoginOptions): Promise<OpenidLoginResult>;
|
|
1054
|
+
getSteamLevel(steamId?: string): Promise<number>;
|
|
1055
|
+
ensureApiKey(domain?: string): Promise<string | null>;
|
|
1056
|
+
private requestApiKey;
|
|
1057
|
+
getInventory(appid: number, contextid?: string, options?: GetInventoryOptions): Promise<EconItem[]>;
|
|
1058
|
+
private getOwnInventoryItems;
|
|
1059
|
+
private getTheirInventory;
|
|
1060
|
+
}
|
|
1061
|
+
//#endregion
|
|
1062
|
+
//#region src/community/userDetails.d.ts
|
|
1063
|
+
interface UserSideDetails {
|
|
1064
|
+
personaName: string;
|
|
1065
|
+
contexts: Record<string, unknown> | null;
|
|
1066
|
+
escrowDays: number;
|
|
1067
|
+
avatarIcon: string | undefined;
|
|
1068
|
+
avatarMedium: string | undefined;
|
|
1069
|
+
avatarFull: string | undefined;
|
|
1070
|
+
}
|
|
1071
|
+
interface UserPartnerDetails extends UserSideDetails {
|
|
1072
|
+
probation: boolean;
|
|
1073
|
+
}
|
|
1074
|
+
interface UserDetails {
|
|
1075
|
+
me: UserSideDetails;
|
|
1076
|
+
them: UserPartnerDetails;
|
|
1077
|
+
}
|
|
1078
|
+
//#endregion
|
|
1079
|
+
//#region src/core/constants.d.ts
|
|
1080
|
+
declare const LANG: {
|
|
1081
|
+
readonly l: "english";
|
|
1082
|
+
readonly language: "en";
|
|
1083
|
+
};
|
|
1084
|
+
declare const URLS: {
|
|
1085
|
+
readonly community: "https://steamcommunity.com";
|
|
1086
|
+
readonly store: "https://store.steampowered.com";
|
|
1087
|
+
readonly help: "https://help.steampowered.com";
|
|
1088
|
+
readonly api: "https://api.steampowered.com";
|
|
1089
|
+
};
|
|
1090
|
+
declare const DEFAULT_CONTEXTID = "2";
|
|
1091
|
+
//#endregion
|
|
1092
|
+
//#region src/core/eresults.d.ts
|
|
1093
|
+
declare const TRANSIENT_ERESULTS: ReadonlySet<number>;
|
|
1094
|
+
declare function isTransientEResult(eresult: number | undefined): boolean;
|
|
1095
|
+
declare const TERMINAL_AUTH_ERESULTS: ReadonlySet<number>;
|
|
1096
|
+
declare function isTerminalAuthEResult(eresult: number | undefined): boolean;
|
|
1097
|
+
//#endregion
|
|
1098
|
+
//#region src/core/errors.d.ts
|
|
1099
|
+
declare const DEFAULT_RATE_LIMIT_RETRY_MS = 60000;
|
|
1100
|
+
declare class SteamError extends Error {
|
|
1101
|
+
readonly eresult?: number;
|
|
1102
|
+
readonly body?: unknown;
|
|
1103
|
+
constructor(message: string, options?: {
|
|
1104
|
+
eresult?: number;
|
|
1105
|
+
body?: unknown;
|
|
1106
|
+
cause?: unknown;
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
declare class ProxyError extends SteamError {
|
|
1110
|
+
constructor(message: string, options?: {
|
|
1111
|
+
cause?: unknown;
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
declare class HttpStatusError extends SteamError {
|
|
1115
|
+
readonly statusCode: number;
|
|
1116
|
+
constructor(statusCode: number, message?: string, body?: unknown);
|
|
1117
|
+
}
|
|
1118
|
+
declare class SteamSessionExpiredError extends SteamError {
|
|
1119
|
+
constructor(message?: string);
|
|
1120
|
+
}
|
|
1121
|
+
declare class OpenIdError extends SteamError {
|
|
1122
|
+
constructor(message: string);
|
|
1123
|
+
}
|
|
1124
|
+
declare class RateLimitError extends SteamError {
|
|
1125
|
+
readonly statusCode: number | undefined;
|
|
1126
|
+
readonly retryAfterMs: number;
|
|
1127
|
+
readonly unlockAt: number;
|
|
1128
|
+
constructor(options?: {
|
|
1129
|
+
message?: string;
|
|
1130
|
+
body?: unknown;
|
|
1131
|
+
retryAfterMs?: number;
|
|
1132
|
+
eresult?: number;
|
|
1133
|
+
statusCode?: number;
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
declare class EscrowError extends SteamError {
|
|
1137
|
+
readonly escrowDays: number;
|
|
1138
|
+
constructor(escrowDays: number, message?: string);
|
|
1139
|
+
}
|
|
1140
|
+
declare class TradeBanError extends SteamError {
|
|
1141
|
+
constructor(message?: string);
|
|
1142
|
+
}
|
|
1143
|
+
declare class OfferLimitError extends SteamError {
|
|
1144
|
+
constructor(message?: string);
|
|
1145
|
+
}
|
|
1146
|
+
declare class NewDeviceError extends SteamError {
|
|
1147
|
+
constructor(message?: string, options?: {
|
|
1148
|
+
eresult?: number;
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
declare class TargetCannotTradeError extends SteamError {
|
|
1152
|
+
constructor(message?: string, options?: {
|
|
1153
|
+
eresult?: number;
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
declare class ItemServerUnavailableError extends SteamError {
|
|
1157
|
+
constructor(message?: string, options?: {
|
|
1158
|
+
eresult?: number;
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
declare class ConfirmationError extends SteamError {
|
|
1162
|
+
constructor(message: string);
|
|
1163
|
+
}
|
|
1164
|
+
declare class FamilyViewError extends SteamError {
|
|
1165
|
+
constructor(message?: string);
|
|
1166
|
+
}
|
|
1167
|
+
declare class PrivateInventoryError extends SteamError {
|
|
1168
|
+
constructor(message?: string);
|
|
1169
|
+
}
|
|
1170
|
+
declare class LoginError extends SteamError {
|
|
1171
|
+
readonly extendedErrorMessage: string | undefined;
|
|
1172
|
+
readonly isTransient: boolean;
|
|
1173
|
+
constructor(message: string, options?: {
|
|
1174
|
+
eresult?: number;
|
|
1175
|
+
body?: unknown;
|
|
1176
|
+
extendedErrorMessage?: string;
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
declare class NoMobileAuthenticatorError extends LoginError {
|
|
1180
|
+
constructor(message?: string);
|
|
1181
|
+
}
|
|
1182
|
+
//#endregion
|
|
1183
|
+
//#region src/core/offerState.d.ts
|
|
1184
|
+
declare function isTerminalState(state: ETradeOfferState): boolean;
|
|
1185
|
+
//#endregion
|
|
1186
|
+
//#region src/core/rateLimits.d.ts
|
|
1187
|
+
type RateLimit = {
|
|
1188
|
+
type: "window";
|
|
1189
|
+
windowMs: number;
|
|
1190
|
+
max: number;
|
|
1191
|
+
} | {
|
|
1192
|
+
type: "bucket";
|
|
1193
|
+
capacity: number;
|
|
1194
|
+
refillMs: number;
|
|
1195
|
+
};
|
|
1196
|
+
declare const RATE_LIMITS: {
|
|
1197
|
+
readonly partnerInventory: {
|
|
1198
|
+
readonly type: "window";
|
|
1199
|
+
readonly windowMs: 120000;
|
|
1200
|
+
readonly max: 30;
|
|
1201
|
+
};
|
|
1202
|
+
readonly inventory: null;
|
|
1203
|
+
readonly GetTradeHistory: {
|
|
1204
|
+
readonly type: "bucket";
|
|
1205
|
+
readonly capacity: 25;
|
|
1206
|
+
readonly refillMs: 15000;
|
|
1207
|
+
};
|
|
1208
|
+
readonly GetTradeHoldDurations: {
|
|
1209
|
+
readonly type: "bucket";
|
|
1210
|
+
readonly capacity: 3750;
|
|
1211
|
+
readonly refillMs: 5;
|
|
1212
|
+
};
|
|
1213
|
+
readonly GetTradeOffer: {
|
|
1214
|
+
readonly type: "bucket";
|
|
1215
|
+
readonly capacity: 3750;
|
|
1216
|
+
readonly refillMs: 5;
|
|
1217
|
+
};
|
|
1218
|
+
readonly GetTradeOffers: {
|
|
1219
|
+
readonly type: "bucket";
|
|
1220
|
+
readonly capacity: 85;
|
|
1221
|
+
readonly refillMs: 125;
|
|
1222
|
+
};
|
|
1223
|
+
readonly GetTradeOffersSummary: {
|
|
1224
|
+
readonly type: "bucket";
|
|
1225
|
+
readonly capacity: 85;
|
|
1226
|
+
readonly refillMs: 125;
|
|
1227
|
+
};
|
|
1228
|
+
readonly GetTradeStatus: {
|
|
1229
|
+
readonly type: "bucket";
|
|
1230
|
+
readonly capacity: 25;
|
|
1231
|
+
readonly refillMs: 2000;
|
|
1232
|
+
};
|
|
1233
|
+
};
|
|
1234
|
+
type RateLimitedEndpoint = keyof typeof RATE_LIMITS;
|
|
1235
|
+
declare const RETRY_AFTER: Record<RateLimitedEndpoint, number | null>;
|
|
1236
|
+
//#endregion
|
|
1237
|
+
//#region src/core/target.d.ts
|
|
1238
|
+
interface ResolvedTarget {
|
|
1239
|
+
steamId: string;
|
|
1240
|
+
token: string | undefined;
|
|
1241
|
+
}
|
|
1242
|
+
declare function resolveTarget(target: OfferTarget): ResolvedTarget;
|
|
1243
|
+
//#endregion
|
|
1244
|
+
//#region src/keyApi/SteamWebApi.d.ts
|
|
1245
|
+
interface SteamWebApiOptions {
|
|
1246
|
+
apiKey: string;
|
|
1247
|
+
proxy?: string;
|
|
1248
|
+
http?: HttpClient;
|
|
1249
|
+
}
|
|
1250
|
+
interface PlayerBans {
|
|
1251
|
+
SteamId: string;
|
|
1252
|
+
CommunityBanned: boolean;
|
|
1253
|
+
VACBanned: boolean;
|
|
1254
|
+
NumberOfVACBans: number;
|
|
1255
|
+
DaysSinceLastBan: number;
|
|
1256
|
+
NumberOfGameBans: number;
|
|
1257
|
+
EconomyBan: string;
|
|
1258
|
+
[key: string]: unknown;
|
|
1259
|
+
}
|
|
1260
|
+
interface PlayerSummary {
|
|
1261
|
+
steamid: string;
|
|
1262
|
+
personaname: string;
|
|
1263
|
+
profileurl: string;
|
|
1264
|
+
avatar: string;
|
|
1265
|
+
avatarmedium: string;
|
|
1266
|
+
avatarfull: string;
|
|
1267
|
+
avatarhash: string;
|
|
1268
|
+
personastate: number;
|
|
1269
|
+
communityvisibilitystate: number;
|
|
1270
|
+
profilestate?: number;
|
|
1271
|
+
lastlogoff?: number;
|
|
1272
|
+
commentpermission?: number;
|
|
1273
|
+
realname?: string;
|
|
1274
|
+
primaryclanid?: string;
|
|
1275
|
+
timecreated?: number;
|
|
1276
|
+
personastateflags?: number;
|
|
1277
|
+
gameid?: string;
|
|
1278
|
+
gameserverip?: string;
|
|
1279
|
+
gameextrainfo?: string;
|
|
1280
|
+
loccountrycode?: string;
|
|
1281
|
+
locstatecode?: string;
|
|
1282
|
+
loccityid?: number;
|
|
1283
|
+
[key: string]: unknown;
|
|
1284
|
+
}
|
|
1285
|
+
interface Badge {
|
|
1286
|
+
badgeid: number;
|
|
1287
|
+
level: number;
|
|
1288
|
+
completion_time: number;
|
|
1289
|
+
xp: number;
|
|
1290
|
+
scarcity: number;
|
|
1291
|
+
appid?: number;
|
|
1292
|
+
communityitemid?: string;
|
|
1293
|
+
border_color?: number;
|
|
1294
|
+
[key: string]: unknown;
|
|
1295
|
+
}
|
|
1296
|
+
interface PlayerBadges {
|
|
1297
|
+
badges: Badge[];
|
|
1298
|
+
player_xp: number;
|
|
1299
|
+
player_level: number;
|
|
1300
|
+
player_xp_needed_to_level_up: number;
|
|
1301
|
+
player_xp_needed_current_level: number;
|
|
1302
|
+
[key: string]: unknown;
|
|
1303
|
+
}
|
|
1304
|
+
declare class SteamWebApi {
|
|
1305
|
+
private readonly http;
|
|
1306
|
+
private readonly apiKey;
|
|
1307
|
+
constructor(options: SteamWebApiOptions);
|
|
1308
|
+
getPlayerBans(steamIds: readonly string[]): Promise<PlayerBans[]>;
|
|
1309
|
+
getPlayerSummaries(steamIds: readonly string[]): Promise<PlayerSummary[]>;
|
|
1310
|
+
getBadges(steamId: string): Promise<PlayerBadges>;
|
|
1311
|
+
}
|
|
1312
|
+
//#endregion
|
|
1313
|
+
//#region src/models/inspect.d.ts
|
|
1314
|
+
/**
|
|
1315
|
+
* Decode a CS2 masked preview token — the asset_properties propertyid-6
|
|
1316
|
+
* "certificate" hex — into a plain JSON object (uint64 ids as strings, camelCase
|
|
1317
|
+
* fields, only set fields present). Layout is `[xorKey][protobuf][crc32]`: every
|
|
1318
|
+
* byte after the key is XOR'd with it and the trailing 4-byte crc32 dropped.
|
|
1319
|
+
* `paintwear` is returned as the float wear (0..1), not its raw uint32 bits.
|
|
1320
|
+
* Returns `null` for non-hex input.
|
|
1321
|
+
*/
|
|
1322
|
+
declare function decodePreviewToken(hex: string | null | undefined): Record<string, unknown> | null;
|
|
1323
|
+
//#endregion
|
|
1324
|
+
//#region src/trade/exchange.d.ts
|
|
1325
|
+
interface ExchangeItem extends EconItem {
|
|
1326
|
+
new_assetid?: string;
|
|
1327
|
+
new_contextid?: string;
|
|
1328
|
+
rollback_new_assetid?: string;
|
|
1329
|
+
rollback_new_contextid?: string;
|
|
1330
|
+
}
|
|
1331
|
+
interface ExchangeDetails {
|
|
1332
|
+
status: ETradeStatus;
|
|
1333
|
+
tradeInitTime: Date;
|
|
1334
|
+
settlementTime: Date | null;
|
|
1335
|
+
receivedItems: ExchangeItem[];
|
|
1336
|
+
sentItems: ExchangeItem[];
|
|
1337
|
+
usedInventoryFallback: boolean;
|
|
1338
|
+
}
|
|
1339
|
+
interface TradeHistoryEntry extends ExchangeDetails {
|
|
1340
|
+
tradeId: string;
|
|
1341
|
+
partnerSteamId: string | undefined;
|
|
1342
|
+
}
|
|
1343
|
+
interface TradeHistory {
|
|
1344
|
+
trades: TradeHistoryEntry[];
|
|
1345
|
+
more: boolean;
|
|
1346
|
+
totalTrades: number | undefined;
|
|
1347
|
+
}
|
|
1348
|
+
interface TradeHistoryOptions {
|
|
1349
|
+
maxTrades?: number;
|
|
1350
|
+
startAfterTime?: number;
|
|
1351
|
+
startAfterTradeId?: string;
|
|
1352
|
+
navigatingBack?: boolean;
|
|
1353
|
+
includeFailed?: boolean;
|
|
1354
|
+
includeTotal?: boolean;
|
|
1355
|
+
}
|
|
1356
|
+
interface TradeOffersSummary {
|
|
1357
|
+
pending_received_count: number;
|
|
1358
|
+
new_received_count: number;
|
|
1359
|
+
updated_received_count: number;
|
|
1360
|
+
historical_received_count: number;
|
|
1361
|
+
pending_sent_count: number;
|
|
1362
|
+
newly_accepted_sent_count: number;
|
|
1363
|
+
updated_sent_count: number;
|
|
1364
|
+
historical_sent_count: number;
|
|
1365
|
+
escrow_received_count: number;
|
|
1366
|
+
escrow_sent_count: number;
|
|
1367
|
+
}
|
|
1368
|
+
declare function getTradeStatus(api: WebApiClient, tradeId: string): Promise<ExchangeDetails>;
|
|
1369
|
+
declare function getTradeHistory(api: WebApiClient, opts?: TradeHistoryOptions): Promise<TradeHistory>;
|
|
1370
|
+
declare function getTradeOffersSummary(api: WebApiClient): Promise<TradeOffersSummary>;
|
|
1371
|
+
//#endregion
|
|
1372
|
+
//#region src/trade/TradeNamespace.d.ts
|
|
1373
|
+
interface EscrowSide {
|
|
1374
|
+
escrow_end_duration_seconds: number;
|
|
1375
|
+
}
|
|
1376
|
+
interface EscrowHold {
|
|
1377
|
+
me: EscrowSide;
|
|
1378
|
+
them: EscrowSide;
|
|
1379
|
+
both: EscrowSide;
|
|
1380
|
+
}
|
|
1381
|
+
declare class TradeNamespace extends EventEmitter<TradeEvents> {
|
|
1382
|
+
private readonly api;
|
|
1383
|
+
private readonly http;
|
|
1384
|
+
private readonly session;
|
|
1385
|
+
private readonly confirmations;
|
|
1386
|
+
private poller;
|
|
1387
|
+
constructor(api: WebApiClient, http: HttpClient, session: SessionManager, confirmations: ConfirmationManager);
|
|
1388
|
+
private offerDeps;
|
|
1389
|
+
createOffer(target: OfferTarget): TradeOffer;
|
|
1390
|
+
getTradeOffer(id: string): Promise<TradeOffer>;
|
|
1391
|
+
getTradeOffers(filter?: EOfferFilter, historicalCutoff?: Date): Promise<{
|
|
1392
|
+
sent: TradeOffer[];
|
|
1393
|
+
received: TradeOffer[];
|
|
1394
|
+
}>;
|
|
1395
|
+
getTradeStatus(opts: {
|
|
1396
|
+
tradeId: string;
|
|
1397
|
+
}): Promise<ExchangeDetails>;
|
|
1398
|
+
getUserDetails(target: OfferTarget): Promise<UserDetails>;
|
|
1399
|
+
getEscrow(target: OfferTarget): Promise<EscrowHold>;
|
|
1400
|
+
getTradeHistory(opts?: TradeHistoryOptions): Promise<TradeHistory>;
|
|
1401
|
+
getTradeOffersSummary(): Promise<TradeOffersSummary>;
|
|
1402
|
+
reconcile(ids: string[]): Promise<Map<string, TradeOffer>>;
|
|
1403
|
+
getOffersContainingItems(items: {
|
|
1404
|
+
appid: number;
|
|
1405
|
+
contextid: string;
|
|
1406
|
+
assetid: string;
|
|
1407
|
+
}[], includeInactive?: boolean): Promise<TradeOffer[]>;
|
|
1408
|
+
startPolling(options?: PollOptions): void;
|
|
1409
|
+
stopPolling(): void;
|
|
1410
|
+
pollOnce(options?: PollOptions & {
|
|
1411
|
+
forceFull?: boolean;
|
|
1412
|
+
}): Promise<{
|
|
1413
|
+
changes: PollChange[];
|
|
1414
|
+
pollData: PollData;
|
|
1415
|
+
}>;
|
|
1416
|
+
get pollData(): PollData | undefined;
|
|
1417
|
+
getInventory(target: OfferTarget, appid: number, contextid?: string, options?: {
|
|
1418
|
+
tradableOnly?: boolean;
|
|
1419
|
+
}): Promise<EconItem[]>;
|
|
1420
|
+
}
|
|
1421
|
+
//#endregion
|
|
1422
|
+
//#region src/trade/TradeOffer.d.ts
|
|
1423
|
+
type SendResult = "sent" | "needs_confirmation";
|
|
1424
|
+
type AcceptResult = "accepted" | "escrow" | "needs_confirmation";
|
|
1425
|
+
interface TradeOfferDeps {
|
|
1426
|
+
http: HttpClient;
|
|
1427
|
+
session: SessionManager;
|
|
1428
|
+
confirmations: ConfirmationManager;
|
|
1429
|
+
trade: TradeNamespace;
|
|
1430
|
+
}
|
|
1431
|
+
declare class TradeOffer {
|
|
1432
|
+
private readonly deps;
|
|
1433
|
+
id: string | undefined;
|
|
1434
|
+
readonly partner: SteamID;
|
|
1435
|
+
token: string | undefined;
|
|
1436
|
+
message: string;
|
|
1437
|
+
state: ETradeOfferState;
|
|
1438
|
+
itemsToGive: TradeItem[];
|
|
1439
|
+
itemsToReceive: TradeItem[];
|
|
1440
|
+
isOurOffer: boolean;
|
|
1441
|
+
tradeID: string | undefined;
|
|
1442
|
+
confirmationMethod: EConfirmationMethod;
|
|
1443
|
+
escrowEnds: Date | undefined;
|
|
1444
|
+
settlementDate: Date | undefined;
|
|
1445
|
+
delaySettlement: boolean;
|
|
1446
|
+
created: Date | undefined;
|
|
1447
|
+
updated: Date | undefined;
|
|
1448
|
+
expires: Date | undefined;
|
|
1449
|
+
fromRealTimeTrade: boolean;
|
|
1450
|
+
glitched: boolean;
|
|
1451
|
+
private countering;
|
|
1452
|
+
constructor(deps: TradeOfferDeps, init: {
|
|
1453
|
+
partner: SteamID;
|
|
1454
|
+
token?: string;
|
|
1455
|
+
id?: string;
|
|
1456
|
+
});
|
|
1457
|
+
static fromData(deps: TradeOfferDeps, raw: RawCEconTradeOffer, descriptions?: Map<string, RawDescription>): TradeOffer;
|
|
1458
|
+
containsItem(item: {
|
|
1459
|
+
appid: number;
|
|
1460
|
+
contextid: string;
|
|
1461
|
+
assetid: string;
|
|
1462
|
+
}): boolean;
|
|
1463
|
+
give(items: TradeItem[]): this;
|
|
1464
|
+
receive(items: TradeItem[]): this;
|
|
1465
|
+
setMessage(message: string): this;
|
|
1466
|
+
send(): Promise<SendResult>;
|
|
1467
|
+
accept(): Promise<AcceptResult>;
|
|
1468
|
+
cancel(): Promise<void>;
|
|
1469
|
+
decline(): Promise<void>;
|
|
1470
|
+
confirm(): Promise<void>;
|
|
1471
|
+
counter(): TradeOffer;
|
|
1472
|
+
getTradeStatus(): Promise<ExchangeDetails>;
|
|
1473
|
+
getPartnerInventory(appid: number, contextid?: string, tradableOnly?: boolean): Promise<EconItem[]>;
|
|
1474
|
+
getUserDetails(): Promise<UserDetails>;
|
|
1475
|
+
private partnerTarget;
|
|
1476
|
+
private newOfferReferer;
|
|
1477
|
+
private offerReferer;
|
|
1478
|
+
}
|
|
1479
|
+
//#endregion
|
|
1480
|
+
//#region src/trade/pollTypes.d.ts
|
|
1481
|
+
interface PollData {
|
|
1482
|
+
offersSince: number;
|
|
1483
|
+
sent: Record<string, ETradeOfferState>;
|
|
1484
|
+
received: Record<string, ETradeOfferState>;
|
|
1485
|
+
timestamps: Record<string, number>;
|
|
1486
|
+
lastFullUpdate?: number;
|
|
1487
|
+
}
|
|
1488
|
+
interface PollDataStore {
|
|
1489
|
+
load(): Promise<PollData | undefined>;
|
|
1490
|
+
save(pollData: PollData): Promise<void>;
|
|
1491
|
+
}
|
|
1492
|
+
type PollChange = {
|
|
1493
|
+
type: "newOffer";
|
|
1494
|
+
offer: TradeOffer;
|
|
1495
|
+
} | {
|
|
1496
|
+
type: "sentOfferChanged";
|
|
1497
|
+
offer: TradeOffer;
|
|
1498
|
+
oldState: ETradeOfferState;
|
|
1499
|
+
} | {
|
|
1500
|
+
type: "receivedOfferChanged";
|
|
1501
|
+
offer: TradeOffer;
|
|
1502
|
+
oldState: ETradeOfferState;
|
|
1503
|
+
} | {
|
|
1504
|
+
type: "unknownOfferSent";
|
|
1505
|
+
offer: TradeOffer;
|
|
1506
|
+
};
|
|
1507
|
+
interface TradeOfferUpdate {
|
|
1508
|
+
offer: TradeOffer;
|
|
1509
|
+
previousState?: ETradeOfferState;
|
|
1510
|
+
}
|
|
1511
|
+
interface PollOptions {
|
|
1512
|
+
pollInterval?: number;
|
|
1513
|
+
pollFullUpdateInterval?: number;
|
|
1514
|
+
pollData?: PollData;
|
|
1515
|
+
store?: PollDataStore;
|
|
1516
|
+
maxAgeMs?: number;
|
|
1517
|
+
cancelTime?: number;
|
|
1518
|
+
}
|
|
1519
|
+
interface TradeEvents {
|
|
1520
|
+
newOffer: [offer: TradeOffer];
|
|
1521
|
+
sentOfferChanged: [offer: TradeOffer, oldState: ETradeOfferState];
|
|
1522
|
+
receivedOfferChanged: [offer: TradeOffer, oldState: ETradeOfferState];
|
|
1523
|
+
unknownOfferSent: [offer: TradeOffer];
|
|
1524
|
+
sentOfferCanceled: [offer: TradeOffer, reason: string];
|
|
1525
|
+
offerUpdate: [update: TradeOfferUpdate];
|
|
1526
|
+
pollData: [data: PollData];
|
|
1527
|
+
pollSuccess: [];
|
|
1528
|
+
pollFailure: [error: Error];
|
|
1529
|
+
debug: [message: string];
|
|
1530
|
+
}
|
|
1531
|
+
//#endregion
|
|
1532
|
+
//#region src/SteamMobile.d.ts
|
|
1533
|
+
interface SteamMobileEvents extends TradeEvents {
|
|
1534
|
+
refreshToken: [token: string];
|
|
1535
|
+
sessionExpired: [error: Error];
|
|
1536
|
+
}
|
|
1537
|
+
interface SteamMobileOptions {
|
|
1538
|
+
refreshToken: string;
|
|
1539
|
+
identitySecret?: string;
|
|
1540
|
+
proxy?: string;
|
|
1541
|
+
mobileProfile?: MobilePlatform | Partial<MobileProfile>;
|
|
1542
|
+
polling?: boolean | PollOptions;
|
|
1543
|
+
}
|
|
1544
|
+
type ReauthenticateOptions = Omit<LoginWithCredentialsOptions, "proxy" | "mobileProfile">;
|
|
1545
|
+
declare class SteamMobile extends EventEmitter<SteamMobileEvents> {
|
|
1546
|
+
readonly http: HttpClient;
|
|
1547
|
+
readonly session: SessionManager;
|
|
1548
|
+
readonly api: WebApiClient;
|
|
1549
|
+
readonly confirmations: ConfirmationManager;
|
|
1550
|
+
readonly trade: TradeNamespace;
|
|
1551
|
+
readonly community: CommunityNamespace;
|
|
1552
|
+
readonly identitySecret: string | undefined;
|
|
1553
|
+
private readonly polling;
|
|
1554
|
+
private readonly proxy;
|
|
1555
|
+
private readonly profile;
|
|
1556
|
+
constructor(options: SteamMobileOptions);
|
|
1557
|
+
login(): Promise<this>;
|
|
1558
|
+
reauthenticate(credentials: ReauthenticateOptions): Promise<void>;
|
|
1559
|
+
ensureApiKey(domain?: string): Promise<string | null>;
|
|
1560
|
+
openidLogin(options: OpenidLoginOptions): Promise<OpenidLoginResult>;
|
|
1561
|
+
request<T = string>(method: "GET" | "POST", url: string, opts?: RequestOptions): Promise<HttpResponse<T>>;
|
|
1562
|
+
get<T = string>(url: string, opts?: RequestOptions): Promise<HttpResponse<T>>;
|
|
1563
|
+
post<T = string>(url: string, opts?: RequestOptions): Promise<HttpResponse<T>>;
|
|
1564
|
+
get steamID(): SteamID;
|
|
1565
|
+
get accessToken(): string | undefined;
|
|
1566
|
+
get refreshToken(): string;
|
|
1567
|
+
shutdown(): Promise<void>;
|
|
1568
|
+
}
|
|
1569
|
+
//#endregion
|
|
1570
|
+
//#region src/session/tokens.d.ts
|
|
1571
|
+
interface JwtPayload {
|
|
1572
|
+
iss?: string;
|
|
1573
|
+
sub?: string;
|
|
1574
|
+
aud?: string[];
|
|
1575
|
+
exp?: number;
|
|
1576
|
+
iat?: number;
|
|
1577
|
+
[k: string]: unknown;
|
|
1578
|
+
}
|
|
1579
|
+
declare class AccessTokenError extends Error {
|
|
1580
|
+
readonly eresult?: number | undefined;
|
|
1581
|
+
constructor(message: string, eresult?: number | undefined);
|
|
1582
|
+
}
|
|
1583
|
+
declare function decodeJwt(token: string): JwtPayload | null;
|
|
1584
|
+
declare function secondsUntilExpiry(token: string): number;
|
|
1585
|
+
//#endregion
|
|
1586
|
+
//#region src/trade/polling.d.ts
|
|
1587
|
+
declare const DEFAULT_POLL_INTERVAL = 10000;
|
|
1588
|
+
declare const DEFAULT_POLL_FULL_UPDATE_INTERVAL = 300000;
|
|
1589
|
+
declare const DEFAULT_POLL_MAX_AGE_MS = 2592000000;
|
|
1590
|
+
interface PollSource {
|
|
1591
|
+
getTradeOffers(filter: EOfferFilter, historicalCutoff: Date): Promise<{
|
|
1592
|
+
sent: TradeOffer[];
|
|
1593
|
+
received: TradeOffer[];
|
|
1594
|
+
}>;
|
|
1595
|
+
emit<K extends keyof TradeEvents>(event: K, ...args: TradeEvents[K]): void;
|
|
1596
|
+
}
|
|
1597
|
+
declare class Poller {
|
|
1598
|
+
private readonly source;
|
|
1599
|
+
pollData: PollData;
|
|
1600
|
+
private readonly pollInterval;
|
|
1601
|
+
private readonly fullInterval;
|
|
1602
|
+
private readonly maxAgeMs;
|
|
1603
|
+
private readonly cancelTime;
|
|
1604
|
+
private readonly store;
|
|
1605
|
+
private timer;
|
|
1606
|
+
private running;
|
|
1607
|
+
private stopped;
|
|
1608
|
+
private loaded;
|
|
1609
|
+
constructor(source: PollSource, options?: PollOptions);
|
|
1610
|
+
start(): void;
|
|
1611
|
+
stop(): void;
|
|
1612
|
+
poll(forceFull?: boolean): Promise<number>;
|
|
1613
|
+
pollOnce(forceFull?: boolean): Promise<{
|
|
1614
|
+
changes: PollChange[];
|
|
1615
|
+
pollData: PollData;
|
|
1616
|
+
}>;
|
|
1617
|
+
private loadFromStore;
|
|
1618
|
+
private persist;
|
|
1619
|
+
private schedule;
|
|
1620
|
+
private backoffDelay;
|
|
1621
|
+
private runCycle;
|
|
1622
|
+
private autoCancel;
|
|
1623
|
+
private sweepCutoffSeconds;
|
|
1624
|
+
private process;
|
|
1625
|
+
private record;
|
|
1626
|
+
private prune;
|
|
1627
|
+
private pruneMap;
|
|
1628
|
+
private stamp;
|
|
1629
|
+
}
|
|
1630
|
+
//#endregion
|
|
1631
|
+
export { ANDROID_PROFILE, type AcceptResult, AccessTokenError, type ApiCallParams, type AssetProperty, AuthClient, type Badge, CommunityNamespace, type Confirmation, ConfirmationError, ConfirmationManager, CredentialSession, type CredentialSessionEvents, type CredentialStartOptions, DEFAULT_CONTEXTID, DEFAULT_POLL_FULL_UPDATE_INTERVAL, DEFAULT_POLL_INTERVAL, DEFAULT_POLL_MAX_AGE_MS, DEFAULT_RATE_LIMIT_RETRY_MS, EAuthSessionGuardType, EAuthTokenPlatformType, EAuthTokenRevokeAction, EConfirmationMethod, EConfirmationType, EOfferFilter, EResult, ESessionPersistence, ETokenRenewalType, ETradeOfferState, ETradeStatus, type EconItem, EscrowError, type EscrowHold, type EscrowSide, type ExchangeDetails, type ExchangeItem, FamilyViewError, type GetInventoryOptions, HttpClient, type HttpResponse, HttpStatusError, IOS_PROFILE, ItemServerUnavailableError, type JwtPayload, LANG, LoginError, type LoginResult, type LoginWithCredentialsOptions, type MobilePlatform, type MobileProfile, NewDeviceError, NoMobileAuthenticatorError, OfferLimitError, OfferTarget, OpenIdError, type OpenidConfirmation, type OpenidCookie, type OpenidLoginOptions, type OpenidLoginResult, type PlayerBadges, type PlayerBans, type PlayerSummary, type PollChange, type PollData, type PollDataStore, type PollOptions, type PollSource, Poller, PrivateInventoryError, ProxyError, RATE_LIMITS, RETRY_AFTER, type RateLimit, RateLimitError, type RateLimitedEndpoint, RawAsset, type RawAssetPropertyEntry, RawCEconTradeOffer, type RawDescription, RawExchangeAsset, RawGetTradeOffersResponse, RawGetTradeStatusResponse, type RawInventoryAsset, type RawInventoryResponse, type RawPartnerInventoryResponse, RawTradeStatus, type ReauthenticateOptions, type RequestOptions, type ResolvedTarget, type SendResult, SessionManager, type SessionManagerEvents, type SteamAction, type SteamDescriptionLine, SteamError, SteamMobile, type SteamMobileEvents, type SteamMobileOptions, type SteamProfile, SteamSessionExpiredError, type SteamTag, SteamWebApi, type SteamWebApiOptions, TERMINAL_AUTH_ERESULTS, TRANSIENT_ERESULTS, TargetCannotTradeError, TradeBanError, type TradeEvents, type TradeHistory, type TradeHistoryEntry, type TradeHistoryOptions, TradeItem, TradeNamespace, TradeOffer, type TradeOfferDeps, type TradeOfferUpdate, type TradeOffersSummary, URLS, type UserDetails, type UserPartnerDetails, type UserSideDetails, WebApiClient, WebTradeEligibility, confirmOpenid, decodeJwt, decodePreviewToken, getTradeHistory, getTradeOffersSummary, getTradeStatus, isTerminalAuthEResult, isTerminalState, isTransientEResult, loginWithCredentials, parseInventory, parseOpenidForm, parsePartnerInventory, resolveMobileProfile, resolveTarget, secondsUntilExpiry, steamOpenidLogin };
|
|
1632
|
+
//# sourceMappingURL=index.d.mts.map
|