@assetpay/steam-mobile 1.0.4 → 1.1.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/README.md CHANGED
@@ -5,6 +5,19 @@ unifies the *web* logic of [`steamcommunity`](https://github.com/DoctorMcKay/nod
5
5
  [`steam-tradeoffer-manager`](https://github.com/DoctorMcKay/node-steam-tradeoffer-manager) into one
6
6
  cohesive, Promise-native package — with **no `steam-user` and no Steam CM binary protocol**.
7
7
 
8
+ ## Built by AssetPay
9
+
10
+ This library is built and maintained by [AssetPay](https://assetpay.gg), B2B skin payment
11
+ infrastructure for merchants accepting CS2 and Rust skins. AssetPay provides a documented REST API
12
+ for inventory valuation, trade creation, automated settlement, and webhooks, backed by live pricing
13
+ and fraud controls.
14
+
15
+ In production, `@assetpay/steam-mobile` powers AssetPay's Steam-facing layer: it maintains bot
16
+ sessions, loads inventories, sends and monitors trade offers, handles mobile confirmations, and
17
+ decodes item inspection data. AssetPay's merchant API, orchestration, and ledger are built on top of
18
+ this lower-level client. See the [AssetPay API documentation](https://assetpay.gg/docs) to learn how
19
+ the complete payment platform fits together.
20
+
8
21
  Everything the mobile app needs is in-package: credential login, TOTP, mobile confirmations
9
22
  (`mobileconf`), and the `IAuthenticationService` protobufs. The only runtime dependencies are
10
23
  [`got`](https://github.com/sindresorhus/got), [`proxy-agent`](https://github.com/TooTallNate/proxy-agents),
@@ -18,6 +31,7 @@ persistent CM connection.
18
31
 
19
32
  ## Table of contents
20
33
 
34
+ - [Built by AssetPay](#built-by-assetpay)
21
35
  - [Installation](#installation)
22
36
  - [The basics](#the-basics)
23
37
  - [Logging in](#logging-in)
@@ -25,6 +39,7 @@ persistent CM connection.
25
39
  - [bot.trade](#bottrade) — sending, reading, and polling trade offers
26
40
  - [TradeOffer](#tradeoffer) — a single offer
27
41
  - [bot.community](#botcommunity) — inventories, profiles, trade URLs, API keys
42
+ - [bot.market](#botmarket) — Community Market: listings, buy orders, history, order book
28
43
  - [bot.session](#botsession) — token lifecycle and sessions
29
44
  - [bot.confirmations](#botconfirmations) — low-level mobile confirmations
30
45
  - [decodePreviewToken](#decodepreviewtoken) — decode CS2 item inspect/certificate data
@@ -669,6 +684,13 @@ state, VAC status, privacy state, and the `isLimited` flag. (Steam level isn't i
669
684
  Returns the account's Steam level as a `Promise<number>` via `IPlayerService/GetSteamLevel` (which
670
685
  accepts the access token — no API key required).
671
686
 
687
+ ### getTwoFactorStatus()
688
+
689
+ Returns the mobile-authenticator status via `ITwoFactorService/QueryStatus` as
690
+ `Promise<RawTwoFactorStatus>`: `state`, `email_validated`, `time_created` (when the authenticator was
691
+ added), and the rest of Steam's fields. For Steam's can-trade verdict (Steam Guard / new-device holds
692
+ included) use `getWebTradeEligibility()`.
693
+
672
694
  ### community.ensureApiKey(\[domain])
673
695
 
674
696
  - `domain` — Optional hostname for the key (default `"assetpay.gg"`).
@@ -685,6 +707,127 @@ for completeness. Returns `Promise<void>`.
685
707
 
686
708
  ---
687
709
 
710
+ ## bot.market
711
+
712
+ The Steam Community Market. Needs an account that can use the market (not limited). Responses are
713
+ returned as Steam sends them (snake_case, unknown fields preserved); nothing is retried — rate limits
714
+ surface as `RateLimitError` (HTTP 429), and the order book's 403 wall as `ThrottledError`.
715
+
716
+ **Currency.** `bot.market.walletCurrency` (`1` USD, `3` EUR, …) is learned by
717
+ [`getWalletDetails()`](#getwalletdetails) or set by you. Once known it is sent with
718
+ `getMyListings` / `createBuyOrder` and **enforced on every `getOrderbook`** — a book in another
719
+ currency throws instead of being compared. Call `getWalletDetails()` first on each account.
720
+
721
+ ### getWalletDetails()
722
+
723
+ Returns the wallet via `IUserAccountService/GetClientWalletDetails` as `Promise<RawWalletDetails>`:
724
+ `has_wallet`, `balance` / `delayed_balance` (int64 cents, as strings), `currency_code` (the wallet
725
+ currency id — `1` USD, `3` EUR, …), `user_country_code`, `time_most_recent_txn`,
726
+ `formatted_balance`, and the rest of Steam's fields. Sets `walletCurrency`.
727
+
728
+ ### getMyListings(\[options])
729
+
730
+ - `options`
731
+ - `currency` — Optional. Wallet currency id, sent as `currency` (default `walletCurrency`).
732
+
733
+ Loads every page of your listings. Returns `Promise<MyListings>`:
734
+ `{ listings, listings_to_confirm, buy_orders, num_active_listings }` with Steam's raw entries. A
735
+ listing's `price` is what you receive and `fee` Steam's cut (the buyer pays `price + fee`).
736
+ `listings_to_confirm` are listings still awaiting mobile confirmation; their item can't be relisted
737
+ until the listing is confirmed or removed with [`cancelListing`](#cancellistinglistingid).
738
+
739
+ ### getMyHistory(\[options])
740
+
741
+ - `options`
742
+ - `count` — Optional. Rows per page (default `500`).
743
+ - `start` — Optional. Row offset, for paging back.
744
+
745
+ Parses the rendered market history into `Promise<MarketHistory>`:
746
+ `{ events, sales, purchases, listingEvents, totalCount }` — `events` is every row in page order
747
+ (newest first), the others split it by `type`. Every event has `historyId`
748
+ (`history_row_<listingid>_<eventid>`), `listingid`, `eventid`, `type`, `itemName`, `gameName`, `actedOn` /
749
+ `listedOn` (display dates, no year), `displayPrice` and `priceInCents` (also as `receivedAmount` on
750
+ sales and `paidAmount` on purchases). Sales and purchases also carry the asset: `appID`,
751
+ `contextID`, `assetID`, `classID`, `instanceID`, `marketName`, `unOwnedContextID`, `unOwnedID`.
752
+ Throws if a real price string parses to 0 cents. `parseMarketHistory(body)` is exported for raw
753
+ responses.
754
+
755
+ ### getOrderbook(appid, marketHashName\[, options])
756
+
757
+ - `options`
758
+ - `expectedCurrency` — Optional (default `walletCurrency`). Throw instead of returning a book in
759
+ any other currency.
760
+
761
+ Returns the live order book as `Promise<RawOrderbookData>`: `eCurrency`, `amtMinSellOrder` /
762
+ `amtMaxBuyOrder` (best ask / bid in cents, `null` — not `NaN` — when that side is empty), and
763
+ `rgCompactSellOrders` / `rgCompactBuyOrders` (flat `[price, qty, price, qty, …]`, best first). The
764
+ endpoint always answers in the wallet currency. A 403 here is Steam's order-book throttle wall and
765
+ throws `ThrottledError`.
766
+
767
+ ### getPriceHistory(appid, marketHashName)
768
+
769
+ Returns the price history rows as `Promise<RawPriceHistoryPoint[]>` —
770
+ `[date, price (major units), volume]`; `[]` for an item without sales history. Throws when Steam
771
+ answers `success: false`.
772
+
773
+ ### getMarketItemDetails(appid, marketHashName)
774
+
775
+ Searches the market and returns the row whose `hash_name` matches exactly (`sell_listings`,
776
+ `asset_description`), or `null`.
777
+
778
+ ### sellItem(options)
779
+
780
+ - `options`
781
+ - `appid`, `assetid`
782
+ - `price` — What **you** receive, in cents (the buyer pays this plus fees).
783
+ - `contextid` — Optional (default `"2"`).
784
+ - `amount` — Optional (default `1`).
785
+
786
+ Lists an item and returns Steam's response as `Promise<RawSellItemResponse>`. The listing still needs
787
+ its mobile confirmation — see [`confirmListings`](#confirmlistingsexpected). Refusals throw
788
+ `MarketConfirmationLimitError`, `WalletBalanceLimitError` or `MarketBlockedError`, otherwise a
789
+ `SteamError` with Steam's message.
790
+
791
+ ### cancelListing(listingId)
792
+
793
+ Removes a listing. Returns `Promise<void>`.
794
+
795
+ ### createBuyOrder(options)
796
+
797
+ - `options`
798
+ - `appid`, `marketHashName`, `quantity`
799
+ - `priceTotal` — Price per unit × quantity, in cents.
800
+ - `currency` — Optional. Wallet currency id (default `walletCurrency`; throws if neither is known).
801
+
802
+ Places a buy order and returns its `buy_orderid` as `Promise<string>`. When Steam answers with a
803
+ mobile confirmation (HTTP 406), it is accepted (needs `identitySecret`) and the order finalized. A
804
+ refusal is a `SteamError` whose `eresult` is Steam's code. Not retried: the confirmation id carries
805
+ between steps, so re-run the whole call — but a failure after the confirmation was accepted may
806
+ still have placed the order, so check [`getMyListings`](#getmylistingsoptions) first.
807
+
808
+ ### cancelBuyOrder(buyOrderId)
809
+
810
+ Cancels a buy order and returns Steam's response as `Promise<RawCancelBuyOrderResponse>`.
811
+
812
+ ### confirmListings(expected)
813
+
814
+ - `expected` — `{ [market_hash_name]: number of listings created }`.
815
+
816
+ Accepts the pending market-listing confirmations that match, in one request: oldest first, exact name
817
+ first, then a substring match (the confirmation text can omit the wear; an empty one never matches). Returns
818
+ `Promise<{ confirmed, skipped }>` ([`Confirmation`](#confirmation)`[]` each); unmatched ones stay
819
+ pending in `skipped`.
820
+
821
+ ### rejectListings(\[types])
822
+
823
+ - `types` — Optional [`EConfirmationType`](#econfirmationtype)`[]` (default `[MarketListing]`; pass
824
+ `[BuyOrder]` for buy orders).
825
+
826
+ Rejects every pending confirmation of those types in one request and returns them. Other types are
827
+ never touched.
828
+
829
+ ---
830
+
688
831
  ## bot.session
689
832
 
690
833
  The `SessionManager` owns the token lifecycle. You rarely call it directly — the namespaces refresh the
@@ -743,6 +886,12 @@ Accept or reject (cancel) a single confirmation by its `id` and `nonce` (the `ke
743
886
  [`getPending`](#getpending)). Each returns `Promise<void>` and handles the time-offset + per-request
744
887
  HMAC timestamp for you.
745
888
 
889
+ ### acceptConfirmations(confs) · rejectConfirmations(confs)
890
+
891
+ - `confs` — The confirmations to act on (`id` + `key`, e.g. from [`getPending`](#getpending)).
892
+
893
+ Accept or reject a selected set in one request. Returns `Promise<void>`; an empty set is a no-op.
894
+
746
895
  ### acceptAll()
747
896
 
748
897
  Accepts every pending confirmation and resolves to the [`Confirmation`](#confirmation)`[]` it acted on.
@@ -762,13 +911,13 @@ Returns the outstanding confirmations as `Promise<`[`Confirmation`](#confirmatio
762
911
 
763
912
  ### respondToConfirmation(confID, confKey, time, key, accept)
764
913
 
765
- - `confID` — The confirmation id.
766
- - `confKey` — The confirmation's nonce.
914
+ - `confID` — The confirmation id, or an array of ids.
915
+ - `confKey` — The confirmation's nonce, or an array of nonces (same order as `confID`).
767
916
  - `time` — A Unix timestamp.
768
917
  - `key` — A confirmation key, or `{ tag, key }`.
769
918
  - `accept` — `true` to allow, `false` to cancel.
770
919
 
771
- Accepts or rejects a single confirmation. Returns `Promise<void>`.
920
+ Accepts or rejects the confirmation(s) in one request. Returns `Promise<void>`.
772
921
 
773
922
  ### acceptConfirmationForObject(objectID)
774
923
 
@@ -1092,7 +1241,7 @@ All are exported and have the standard Steam numeric values.
1092
1241
  ### EConfirmationType
1093
1242
 
1094
1243
  `Invalid (0)`, `Generic (1)`, `Trade (2)`, `MarketListing (3)`, `FeatureOptOut (4)`,
1095
- `PhoneNumberChange (5)`, `AccountRecovery (6)`.
1244
+ `PhoneNumberChange (5)`, `AccountRecovery (6)`, `BuyOrder (12)`.
1096
1245
 
1097
1246
  ### EOfferFilter
1098
1247
 
@@ -1131,6 +1280,7 @@ one shared classifier so the same `instanceof` check works everywhere.
1131
1280
  | `HttpStatusError` | `statusCode` | A non-2xx HTTP response. |
1132
1281
  | `SteamSessionExpiredError` | — | The session/token is no longer valid; re-authenticate. |
1133
1282
  | `RateLimitError` | `statusCode?`, `retryAfterMs`, `unlockAt` | Rate limited (HTTP 429 or eresult 84). `unlockAt` is a millisecond epoch when you may retry — **always populated** (a conservative default when Steam gives no hint). |
1283
+ | `ThrottledError` | `statusCode = 403` | The order book's 403 throttle wall. Not a `RateLimitError`: it persists and switching proxy doesn't help — stop using the account for a while. |
1134
1284
  | `ProxyError` | `cause?` | A request through a configured proxy failed at the transport layer (unreachable / refused / timeout / auth). Only thrown when a `proxy` is set. |
1135
1285
  | `EscrowError` | `escrowDays` | The trade would be (or is) held in escrow. |
1136
1286
  | `TradeBanError` | — | The account is trade-banned. |
@@ -1141,6 +1291,9 @@ one shared classifier so the same `instanceof` check works everywhere.
1141
1291
  | `PrivateInventoryError` | — | Partner's inventory is private (or friends-only and we're not friends). A trade URL/token does **not** bypass inventory privacy. |
1142
1292
  | `ConfirmationError` | — | A mobile-confirmation step failed (incl. missing `identitySecret` when calling [`offer.confirm()`](#confirm)). |
1143
1293
  | `FamilyViewError` | — | Family View is restricting the account. |
1294
+ | `MarketConfirmationLimitError` | `eresult?` | `sellItem` refused over pending confirmations: too many listings awaiting confirmation, or this item already has one pending. |
1295
+ | `WalletBalanceLimitError` | `eresult?` | `sellItem` would push the wallet past Steam's maximum balance. |
1296
+ | `MarketBlockedError` | `eresult?` | The account is currently unable to use the Community Market. |
1144
1297
  | `LoginError` | `extendedErrorMessage?`, `isTransient` | Credential-login failure; `isTransient` is `true` for a retryable blip (timeout / service unavailable) rather than bad credentials. |
1145
1298
  | `NoMobileAuthenticatorError` | (extends `LoginError`) | `sharedSecret` was supplied but the account has no mobile authenticator attached, so TOTP can't answer the guard challenge. Use `steamGuardCode` / `onSteamGuardRequired` with an email code instead. |
1146
1299
 
@@ -1219,4 +1372,5 @@ pnpm smoke # read-only health check across the whole API
1219
1372
  pnpm watch # live trade-event watcher — send the bot a trade and watch it fire
1220
1373
  pnpm trade # send → confirm → cancel lifecycle (gated: SEND=1 PARTNER_TRADE_URL=…; needs a non-limited bot)
1221
1374
  pnpm partner-inventory # load a partner's inventory via /partnerinventory/ (PARTNER_TRADE_URL=…; surfaces PrivateInventoryError etc.)
1375
+ pnpm market-probe # read-only market + account-status probe (PROBE_APPID / PROBE_ITEM; needs a non-limited account)
1222
1376
  ```
package/dist/index.d.mts CHANGED
@@ -465,7 +465,8 @@ declare enum EConfirmationType {
465
465
  MarketListing = 3,
466
466
  FeatureOptOut = 4,
467
467
  PhoneNumberChange = 5,
468
- AccountRecovery = 6
468
+ AccountRecovery = 6,
469
+ BuyOrder = 12
469
470
  }
470
471
  declare enum EOfferFilter {
471
472
  ActiveOnly = 1,
@@ -895,14 +896,149 @@ interface RawGetTradeStatusResponse {
895
896
  }
896
897
  interface WebTradeEligibility {
897
898
  allowed: number;
898
- reason: number;
899
+ reason?: number;
899
900
  allowed_at_time: number;
900
901
  steamguard_required_days: number;
901
902
  new_device_cooldown_days: number;
902
- expiration: number;
903
+ expiration?: number;
903
904
  time_checked: number;
904
905
  [key: string]: unknown;
905
906
  }
907
+ interface RawMarketListing {
908
+ listingid: string;
909
+ price: number;
910
+ fee: number;
911
+ asset?: RawMarketListingAsset;
912
+ [key: string]: unknown;
913
+ }
914
+ interface RawMarketListingAsset {
915
+ appid: number;
916
+ id: string;
917
+ amount: string;
918
+ market_hash_name: string;
919
+ [key: string]: unknown;
920
+ }
921
+ interface RawMarketBuyOrder {
922
+ buy_orderid: string;
923
+ appid: number;
924
+ hash_name: string;
925
+ price: number | string;
926
+ quantity: number | string;
927
+ quantity_remaining: number | string;
928
+ description?: RawDescription;
929
+ [key: string]: unknown;
930
+ }
931
+ interface RawMyListingsResponse {
932
+ success?: boolean | number;
933
+ num_active_listings?: number;
934
+ listings?: RawMarketListing[];
935
+ results?: {
936
+ listings?: RawMarketListing[];
937
+ [key: string]: unknown;
938
+ };
939
+ listings_to_confirm?: RawMarketListing[];
940
+ buy_orders?: RawMarketBuyOrder[];
941
+ [key: string]: unknown;
942
+ }
943
+ interface RawMarketHistoryAsset {
944
+ classid?: string;
945
+ instanceid?: string;
946
+ unowned_contextid?: string;
947
+ unowned_id?: string;
948
+ market_hash_name?: string;
949
+ [key: string]: unknown;
950
+ }
951
+ interface RawMarketHistoryResponse {
952
+ success?: boolean | number;
953
+ total_count?: number;
954
+ results_html?: string;
955
+ hovers?: string;
956
+ assets?: Record<string, Record<string, Record<string, RawMarketHistoryAsset>>>;
957
+ [key: string]: unknown;
958
+ }
959
+ interface RawOrderbookData {
960
+ eCurrency: number;
961
+ amtMinSellOrder?: number | null;
962
+ amtMaxBuyOrder?: number | null;
963
+ rgCompactSellOrders?: number[];
964
+ rgCompactBuyOrders?: number[];
965
+ [key: string]: unknown;
966
+ }
967
+ type RawPriceHistoryPoint = [date: string, price: number, volume: string];
968
+ interface RawPriceHistoryResponse {
969
+ success?: boolean | number;
970
+ prices?: RawPriceHistoryPoint[];
971
+ [key: string]: unknown;
972
+ }
973
+ interface RawMarketSearchResult {
974
+ hash_name: string;
975
+ sell_listings: number;
976
+ asset_description: RawDescription;
977
+ [key: string]: unknown;
978
+ }
979
+ interface RawMarketSearchResponse {
980
+ results?: RawMarketSearchResult[];
981
+ [key: string]: unknown;
982
+ }
983
+ interface RawSellItemResponse {
984
+ success?: boolean | number;
985
+ message?: string;
986
+ [key: string]: unknown;
987
+ }
988
+ interface RawCreateBuyOrderResponse {
989
+ success?: boolean | number;
990
+ buy_orderid?: string | number;
991
+ message?: string;
992
+ need_confirmation?: boolean;
993
+ confirmation?: {
994
+ confirmation_id?: string | number;
995
+ [key: string]: unknown;
996
+ };
997
+ wallet_info?: {
998
+ success?: number;
999
+ [key: string]: unknown;
1000
+ };
1001
+ [key: string]: unknown;
1002
+ }
1003
+ interface RawCancelBuyOrderResponse {
1004
+ success?: boolean | number;
1005
+ [key: string]: unknown;
1006
+ }
1007
+ interface RawWalletDetails {
1008
+ has_wallet?: boolean;
1009
+ user_country_code?: string;
1010
+ wallet_country_code?: string;
1011
+ wallet_state?: string;
1012
+ balance?: string;
1013
+ delayed_balance?: string;
1014
+ currency_code?: number;
1015
+ time_most_recent_txn?: number;
1016
+ most_recent_txnid?: string;
1017
+ balance_in_usd?: string;
1018
+ delayed_balance_in_usd?: string;
1019
+ has_wallet_in_other_regions?: boolean;
1020
+ other_regions?: number[];
1021
+ formatted_balance?: string;
1022
+ [key: string]: unknown;
1023
+ }
1024
+ interface RawTwoFactorStatus {
1025
+ state?: number;
1026
+ inactivation_reason?: number;
1027
+ authenticator_type?: number;
1028
+ authenticator_allowed?: boolean;
1029
+ steamguard_scheme?: number;
1030
+ token_gid?: string;
1031
+ email_validated?: boolean;
1032
+ device_identifier?: string;
1033
+ time_created?: number;
1034
+ revocation_attempts_remaining?: number;
1035
+ classified_agent?: string;
1036
+ allow_external_authenticator?: boolean;
1037
+ time_transferred?: number;
1038
+ version?: number;
1039
+ last_seen_auth_token_id?: string;
1040
+ [key: string]: unknown;
1041
+ }
906
1042
  //#endregion
907
1043
  //#region src/http/webApi.d.ts
908
1044
  type Scalar = string | number | boolean;
@@ -977,13 +1113,15 @@ declare class ConfirmationManager {
977
1113
  get hasIdentitySecret(): boolean;
978
1114
  private deviceId;
979
1115
  getConfirmations(time: number, key: ConfKey): Promise<Confirmation[]>;
980
- respondToConfirmation(confID: string, confKey: string, time: number, key: ConfKey, accept: boolean): Promise<void>;
1116
+ respondToConfirmation(confID: string | string[], confKey: string | string[], time: number, key: ConfKey, accept: boolean): Promise<void>;
981
1117
  getPending(): Promise<Confirmation[]>;
982
1118
  acceptConfirmation(confID: string, nonce: string): Promise<void>;
983
1119
  rejectConfirmation(confID: string, nonce: string): Promise<void>;
1120
+ acceptConfirmations(confs: Pick<Confirmation, "id" | "key">[]): Promise<void>;
1121
+ rejectConfirmations(confs: Pick<Confirmation, "id" | "key">[]): Promise<void>;
984
1122
  acceptAll(): Promise<Confirmation[]>;
985
1123
  acceptConfirmationForObject(objectID: string): Promise<void>;
986
- private actOnConfirmation;
1124
+ private actOnConfirmations;
987
1125
  private requireSecret;
988
1126
  private nextConfTime;
989
1127
  private getTimeOffset;
@@ -1052,6 +1190,7 @@ declare class CommunityNamespace {
1052
1190
  getWebTradeEligibility(): Promise<WebTradeEligibility>;
1053
1191
  openidLogin(options: OpenidLoginOptions): Promise<OpenidLoginResult>;
1054
1192
  getSteamLevel(steamId?: string): Promise<number>;
1193
+ getTwoFactorStatus(): Promise<RawTwoFactorStatus>;
1055
1194
  ensureApiKey(domain?: string): Promise<string | null>;
1056
1195
  private requestApiKey;
1057
1196
  getInventory(appid: number, contextid?: string, options?: GetInventoryOptions): Promise<EconItem[]>;
@@ -1059,42 +1198,6 @@ declare class CommunityNamespace {
1059
1198
  private getTheirInventory;
1060
1199
  }
1061
1200
  //#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
1201
  //#region src/core/errors.d.ts
1099
1202
  declare const DEFAULT_RATE_LIMIT_RETRY_MS = 60000;
1100
1203
  declare class SteamError extends Error {
@@ -1133,6 +1236,12 @@ declare class RateLimitError extends SteamError {
1133
1236
  statusCode?: number;
1134
1237
  });
1135
1238
  }
1239
+ declare class ThrottledError extends SteamError {
1240
+ readonly statusCode = 403;
1241
+ constructor(message?: string, options?: {
1242
+ body?: unknown;
1243
+ });
1244
+ }
1136
1245
  declare class EscrowError extends SteamError {
1137
1246
  readonly escrowDays: number;
1138
1247
  constructor(escrowDays: number, message?: string);
@@ -1167,6 +1276,24 @@ declare class FamilyViewError extends SteamError {
1167
1276
  declare class PrivateInventoryError extends SteamError {
1168
1277
  constructor(message?: string);
1169
1278
  }
1279
+ declare class MarketConfirmationLimitError extends SteamError {
1280
+ constructor(message?: string, options?: {
1281
+ eresult?: number;
1282
+ body?: unknown;
1283
+ });
1284
+ }
1285
+ declare class WalletBalanceLimitError extends SteamError {
1286
+ constructor(message?: string, options?: {
1287
+ eresult?: number;
1288
+ body?: unknown;
1289
+ });
1290
+ }
1291
+ declare class MarketBlockedError extends SteamError {
1292
+ constructor(message?: string, options?: {
1293
+ eresult?: number;
1294
+ body?: unknown;
1295
+ });
1296
+ }
1170
1297
  declare class LoginError extends SteamError {
1171
1298
  readonly extendedErrorMessage: string | undefined;
1172
1299
  readonly isTransient: boolean;
@@ -1180,6 +1307,42 @@ declare class NoMobileAuthenticatorError extends LoginError {
1180
1307
  constructor(message?: string);
1181
1308
  }
1182
1309
  //#endregion
1310
+ //#region src/community/userDetails.d.ts
1311
+ interface UserSideDetails {
1312
+ personaName: string;
1313
+ contexts: Record<string, unknown> | null;
1314
+ escrowDays: number;
1315
+ avatarIcon: string | undefined;
1316
+ avatarMedium: string | undefined;
1317
+ avatarFull: string | undefined;
1318
+ }
1319
+ interface UserPartnerDetails extends UserSideDetails {
1320
+ probation: boolean;
1321
+ }
1322
+ interface UserDetails {
1323
+ me: UserSideDetails;
1324
+ them: UserPartnerDetails;
1325
+ }
1326
+ //#endregion
1327
+ //#region src/core/constants.d.ts
1328
+ declare const LANG: {
1329
+ readonly l: "english";
1330
+ readonly language: "en";
1331
+ };
1332
+ declare const URLS: {
1333
+ readonly community: "https://steamcommunity.com";
1334
+ readonly store: "https://store.steampowered.com";
1335
+ readonly help: "https://help.steampowered.com";
1336
+ readonly api: "https://api.steampowered.com";
1337
+ };
1338
+ declare const DEFAULT_CONTEXTID = "2";
1339
+ //#endregion
1340
+ //#region src/core/eresults.d.ts
1341
+ declare const TRANSIENT_ERESULTS: ReadonlySet<number>;
1342
+ declare function isTransientEResult(eresult: number | undefined): boolean;
1343
+ declare const TERMINAL_AUTH_ERESULTS: ReadonlySet<number>;
1344
+ declare function isTerminalAuthEResult(eresult: number | undefined): boolean;
1345
+ //#endregion
1183
1346
  //#region src/core/offerState.d.ts
1184
1347
  declare function isTerminalState(state: ETradeOfferState): boolean;
1185
1348
  //#endregion
@@ -1310,6 +1473,106 @@ declare class SteamWebApi {
1310
1473
  getBadges(steamId: string): Promise<PlayerBadges>;
1311
1474
  }
1312
1475
  //#endregion
1476
+ //#region src/market/history.d.ts
1477
+ type MarketHistoryEventType = "sale" | "purchase" | "listing_event";
1478
+ interface MarketHistoryEvent {
1479
+ historyId: string;
1480
+ listingid: string;
1481
+ eventid: string;
1482
+ itemName: string;
1483
+ gameName: string;
1484
+ listedOn: string;
1485
+ actedOn: string;
1486
+ displayPrice: string;
1487
+ priceInCents: number;
1488
+ type: MarketHistoryEventType;
1489
+ marketName: string | null;
1490
+ appID: number | null;
1491
+ contextID: string | null;
1492
+ assetID: string | null;
1493
+ classID: string | null;
1494
+ instanceID: string | null;
1495
+ unOwnedContextID: string | null;
1496
+ unOwnedID: string | null;
1497
+ }
1498
+ interface MarketSale extends MarketHistoryEvent {
1499
+ type: "sale";
1500
+ receivedAmount: number;
1501
+ }
1502
+ interface MarketPurchase extends MarketHistoryEvent {
1503
+ type: "purchase";
1504
+ paidAmount: number;
1505
+ }
1506
+ interface MarketListingEvent extends MarketHistoryEvent {
1507
+ type: "listing_event";
1508
+ }
1509
+ type MarketHistoryRow = MarketSale | MarketPurchase | MarketListingEvent;
1510
+ interface MarketHistory {
1511
+ events: MarketHistoryRow[];
1512
+ sales: MarketSale[];
1513
+ purchases: MarketPurchase[];
1514
+ listingEvents: MarketListingEvent[];
1515
+ totalCount: number | undefined;
1516
+ }
1517
+ declare function parseMarketHistory(body: RawMarketHistoryResponse): MarketHistory;
1518
+ //#endregion
1519
+ //#region src/market/MarketNamespace.d.ts
1520
+ interface MyListings {
1521
+ listings: RawMarketListing[];
1522
+ listings_to_confirm: RawMarketListing[];
1523
+ buy_orders: RawMarketBuyOrder[];
1524
+ num_active_listings: number;
1525
+ }
1526
+ interface SellItemOptions {
1527
+ appid: number;
1528
+ contextid?: string;
1529
+ assetid: string;
1530
+ amount?: number;
1531
+ price: number;
1532
+ }
1533
+ interface CreateBuyOrderOptions {
1534
+ appid: number;
1535
+ marketHashName: string;
1536
+ priceTotal: number;
1537
+ quantity: number;
1538
+ currency?: number;
1539
+ }
1540
+ interface ConfirmListingsResult {
1541
+ confirmed: Confirmation[];
1542
+ skipped: Confirmation[];
1543
+ }
1544
+ declare class MarketNamespace {
1545
+ private readonly http;
1546
+ private readonly session;
1547
+ private readonly confirmations;
1548
+ private readonly api;
1549
+ walletCurrency: number | undefined;
1550
+ constructor(http: HttpClient, session: SessionManager, confirmations: ConfirmationManager, api: WebApiClient);
1551
+ getWalletDetails(): Promise<RawWalletDetails>;
1552
+ getMyListings(options?: {
1553
+ currency?: number;
1554
+ }): Promise<MyListings>;
1555
+ getMyHistory(options?: {
1556
+ count?: number;
1557
+ start?: number;
1558
+ }): Promise<MarketHistory>;
1559
+ getOrderbook(appid: number, marketHashName: string, options?: {
1560
+ expectedCurrency?: number;
1561
+ }): Promise<RawOrderbookData>;
1562
+ getPriceHistory(appid: number, marketHashName: string): Promise<RawPriceHistoryPoint[]>;
1563
+ getMarketItemDetails(appid: number, marketHashName: string): Promise<RawMarketSearchResult | null>;
1564
+ sellItem(options: SellItemOptions): Promise<RawSellItemResponse>;
1565
+ cancelListing(listingId: string): Promise<void>;
1566
+ createBuyOrder(options: CreateBuyOrderOptions): Promise<string>;
1567
+ cancelBuyOrder(buyOrderId: string): Promise<RawCancelBuyOrderResponse>;
1568
+ confirmListings(expected: Record<string, number>): Promise<ConfirmListingsResult>;
1569
+ rejectListings(types?: EConfirmationType[]): Promise<Confirmation[]>;
1570
+ private postBuyOrder;
1571
+ }
1572
+ //#endregion
1573
+ //#region src/market/prices.d.ts
1574
+ declare function getPriceValueAsInt(strAmount: string | null | undefined): number;
1575
+ //#endregion
1313
1576
  //#region src/models/inspect.d.ts
1314
1577
  /**
1315
1578
  * Decode a CS2 masked preview token — the asset_properties propertyid-6
@@ -1558,6 +1821,7 @@ declare class SteamMobile extends EventEmitter<SteamMobileEvents> {
1558
1821
  readonly confirmations: ConfirmationManager;
1559
1822
  readonly trade: TradeNamespace;
1560
1823
  readonly community: CommunityNamespace;
1824
+ readonly market: MarketNamespace;
1561
1825
  readonly identitySecret: string | undefined;
1562
1826
  private readonly polling;
1563
1827
  private readonly proxy;
@@ -1637,5 +1901,5 @@ declare class Poller {
1637
1901
  private stamp;
1638
1902
  }
1639
1903
  //#endregion
1640
- 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, encodePreviewToken, getTradeHistory, getTradeOffersSummary, getTradeStatus, isTerminalAuthEResult, isTerminalState, isTransientEResult, loginWithCredentials, parseInventory, parseOpenidForm, parsePartnerInventory, resolveMobileProfile, resolveTarget, secondsUntilExpiry, steamOpenidLogin };
1904
+ export { ANDROID_PROFILE, type AcceptResult, AccessTokenError, type ApiCallParams, type AssetProperty, AuthClient, type Badge, CommunityNamespace, type ConfirmListingsResult, type Confirmation, ConfirmationError, ConfirmationManager, type CreateBuyOrderOptions, 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, MarketBlockedError, MarketConfirmationLimitError, type MarketHistory, type MarketHistoryEvent, type MarketHistoryEventType, type MarketHistoryRow, type MarketListingEvent, MarketNamespace, type MarketPurchase, type MarketSale, type MobilePlatform, type MobileProfile, type MyListings, 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, RawCancelBuyOrderResponse, RawCreateBuyOrderResponse, type RawDescription, RawExchangeAsset, RawGetTradeOffersResponse, RawGetTradeStatusResponse, type RawInventoryAsset, type RawInventoryResponse, RawMarketBuyOrder, RawMarketHistoryAsset, RawMarketHistoryResponse, RawMarketListing, RawMarketListingAsset, RawMarketSearchResponse, RawMarketSearchResult, RawMyListingsResponse, RawOrderbookData, type RawPartnerInventoryResponse, RawPriceHistoryPoint, RawPriceHistoryResponse, RawSellItemResponse, RawTradeStatus, RawTwoFactorStatus, RawWalletDetails, type ReauthenticateOptions, type RequestOptions, type ResolvedTarget, type SellItemOptions, 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, ThrottledError, 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, WalletBalanceLimitError, WebApiClient, WebTradeEligibility, confirmOpenid, decodeJwt, decodePreviewToken, encodePreviewToken, getPriceValueAsInt, getTradeHistory, getTradeOffersSummary, getTradeStatus, isTerminalAuthEResult, isTerminalState, isTransientEResult, loginWithCredentials, parseInventory, parseMarketHistory, parseOpenidForm, parsePartnerInventory, resolveMobileProfile, resolveTarget, secondsUntilExpiry, steamOpenidLogin };
1641
1905
  //# sourceMappingURL=index.d.mts.map