@polyester/sdk 0.27.0 → 0.27.2

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/account-signer/types.d.ts +3 -1
  3. package/dist/account-signer/types.d.ts.map +1 -1
  4. package/dist/account-signer/types.js.map +1 -1
  5. package/dist/catalogs/snapshot-validation.js +3 -1
  6. package/dist/catalogs/snapshot-validation.js.map +1 -1
  7. package/dist/gen/marketdata/v1/marketdata_pb.d.ts +46 -26
  8. package/dist/gen/marketdata/v1/marketdata_pb.d.ts.map +1 -1
  9. package/dist/gen/marketdata/v1/marketdata_pb.js +1 -1
  10. package/dist/gen/marketdata/v1/marketdata_pb.js.map +1 -1
  11. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts +3 -2
  12. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts.map +1 -1
  13. package/dist/gen/marketoverview/v1/marketoverview_pb.js.map +1 -1
  14. package/dist/services/auth/account-signer-auth.d.ts +3 -3
  15. package/dist/services/auth/account-signer-auth.d.ts.map +1 -1
  16. package/dist/services/auth/account-signer-auth.js +1 -1
  17. package/dist/services/auth/account-signer-auth.js.map +1 -1
  18. package/dist/services/auth/auth.d.ts +3 -0
  19. package/dist/services/auth/auth.d.ts.map +1 -1
  20. package/dist/services/auth/auth.js +3 -0
  21. package/dist/services/auth/auth.js.map +1 -1
  22. package/dist/services/auth/session.schemas.js +1 -0
  23. package/dist/services/auth/session.schemas.js.map +1 -1
  24. package/dist/services/auth/session.types.d.ts +1 -1
  25. package/dist/services/candles/candles.schemas.d.ts +10 -10
  26. package/dist/services/candles/candles.schemas.d.ts.map +1 -1
  27. package/dist/services/candles/candles.schemas.js +13 -11
  28. package/dist/services/candles/candles.schemas.js.map +1 -1
  29. package/dist/services/heatmap/heatmap.schemas.d.ts +9 -9
  30. package/dist/services/lifecycle/lifecycle.schemas.d.ts +42 -42
  31. package/dist/services/market-data/market-data.schemas.js +14 -2
  32. package/dist/services/market-data/market-data.schemas.js.map +1 -1
  33. package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
  34. package/dist/services/market-overview/market-overview.schemas.d.ts.map +1 -1
  35. package/dist/services/market-overview/market-overview.schemas.js +2 -1
  36. package/dist/services/market-overview/market-overview.schemas.js.map +1 -1
  37. package/dist/services/orders/orders-output.schemas.d.ts +6 -6
  38. package/dist/services/subaccounts/subaccounts.schemas.d.ts +4 -4
  39. package/dist/services/triggers/trigger-input.schemas.d.ts +1 -1
  40. package/dist/services/triggers/triggers-output.schemas.d.ts +15 -15
  41. package/dist/shared/catalog-config.d.ts +4 -0
  42. package/dist/shared/catalog-config.d.ts.map +1 -1
  43. package/dist/shared/catalog-config.js.map +1 -1
  44. package/dist/shared/decimal-surface.d.ts +4 -0
  45. package/dist/shared/decimal-surface.d.ts.map +1 -1
  46. package/dist/shared/decimal-surface.js +5 -0
  47. package/dist/shared/decimal-surface.js.map +1 -1
  48. package/package.json +3 -1
@@ -1 +1 @@
1
- {"version":3,"file":"marketoverview_pb.js","names":[],"sources":["../../../../src/gen/marketoverview/v1/marketoverview_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file marketoverview/v1/marketoverview.proto (package marketoverview.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport { file_polyester_api_options } from \"../../polyester/api/options_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file marketoverview/v1/marketoverview.proto.\n */\nexport const file_marketoverview_v1_marketoverview: GenFile = /*@__PURE__*/\n fileDesc(\"CiZtYXJrZXRvdmVydmlldy92MS9tYXJrZXRvdmVydmlldy5wcm90bxIRbWFya2V0b3ZlcnZpZXcudjEiOQo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HVtZUhpc3RvcnlSZXF1ZXN0Gi8ubWFya2V0b3ZlcnZpZXcudjEuR2V0U3BvdFZvbHVtZUhpc3RvcnlSZXNwb25zZSIAEnMKEkxpc3RNYXJrZXRPdmVydmlldxIsLm1hcmtldG92ZXJ2aWV3LnYxLkxpc3RNYXJrZXRPdmVydmlld1JlcXVlc3QaLS5tYXJrZXRvdmVydmlldy52MS5MaXN0TWFya2V0T3ZlcnZpZXdSZXNwb25zZSIAQlBaTmdpdGh1Yi5jb20vRmFicmljLUxhYnMvcG9seWVzdGVyLXNkay1nby9nZW4vbWFya2V0b3ZlcnZpZXcvdjE7bWFya2V0b3ZlcnZpZXd2MWIGcHJvdG8z\", [file_polyester_api_options]);\n\n/**\n * ErrorDetail carries a typed domain error code for machine-readable handling.\n *\n * @generated from message marketoverview.v1.ErrorDetail\n */\nexport type ErrorDetail = Message<\"marketoverview.v1.ErrorDetail\"> & {\n /**\n * Stable error code for programmatic matching.\n *\n * @generated from field: marketoverview.v1.ErrorCode code = 1;\n */\n code: ErrorCode;\n};\n\n/**\n * Describes the message marketoverview.v1.ErrorDetail.\n * Use `create(ErrorDetailSchema)` to create a new message.\n */\nexport const ErrorDetailSchema: GenMessage<ErrorDetail> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 0);\n\n/**\n * Sparkline contains newest-first close prices for one time range.\n *\n * @generated from message marketoverview.v1.Sparkline\n */\nexport type Sparkline = Message<\"marketoverview.v1.Sparkline\"> & {\n /**\n * Time range and sampling resolution represented by these close prices.\n *\n * @generated from field: marketoverview.v1.SparklineInterval interval = 1;\n */\n interval: SparklineInterval;\n\n /**\n * Newest-first close prices in quote units scaled by 1e6.\n *\n * @generated from field: repeated int64 close_ticks = 2;\n */\n closeTicks: bigint[];\n};\n\n/**\n * Describes the message marketoverview.v1.Sparkline.\n * Use `create(SparklineSchema)` to create a new message.\n */\nexport const SparklineSchema: GenMessage<Sparkline> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 1);\n\n/**\n * @generated from message marketoverview.v1.MarketOverview\n */\nexport type MarketOverview = Message<\"marketoverview.v1.MarketOverview\"> & {\n /**\n * Numeric spot market identifier.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n\n /**\n * Last traded price in quote units scaled by 1e6.\n *\n * @generated from field: int64 last_price_ticks = 3;\n */\n lastPriceTicks: bigint;\n\n /**\n * Last trade timestamp in nanoseconds since epoch.\n *\n * @generated from field: uint64 last_trade_ts_ns = 4;\n */\n lastTradeTsNs: bigint;\n\n /**\n * Rolling 24h change expressed in basis points (bp). Example: +123 = +1.23%.\n *\n * @generated from field: int32 change_24h_bps = 5;\n */\n change24hBps: number;\n\n /**\n * Rolling 24h stats.\n * Highest traded price in the 24h window, in quote units scaled by 1e6.\n *\n * @generated from field: int64 high_24h_ticks = 6;\n */\n high24hTicks: bigint;\n\n /**\n * Lowest traded price in the 24h window, in quote units scaled by 1e6.\n *\n * @generated from field: int64 low_24h_ticks = 7;\n */\n low24hTicks: bigint;\n\n /**\n * Rolling 24h base volume scaled by the pair's base_quantity_scale from\n * GetSpotConfig. Omitted if the amount exceeds the signed 64-bit range.\n *\n * @generated from field: optional int64 volume_24h_base_scaled = 8;\n */\n volume24hBaseScaled?: bigint | undefined;\n\n /**\n * Rolling 24h quote volume scaled by the pair's quote_quantity_scale from\n * GetSpotConfig. Omitted if the amount exceeds the signed 64-bit range.\n *\n * @generated from field: optional int64 volume_24h_quote_scaled = 14;\n */\n volume24hQuoteScaled?: bigint | undefined;\n\n /**\n * Rolling 24h USD volume, scaled by 1e6 (one unit is 0.000001 USD).\n * Applies the current quote/USD conversion to the rolling quote volume.\n * When conversion is unavailable, USDT and USDC are valued at USD parity.\n * Omitted for other quote assets when a current conversion is unavailable.\n *\n * @generated from field: optional int64 volume_24h_usd_scaled = 17;\n */\n volume24hUsdScaled?: bigint | undefined;\n\n /**\n * Listing timestamp in nanoseconds since epoch.\n *\n * @generated from field: uint64 listed_ts_ns = 15;\n */\n listedTsNs: bigint;\n\n /**\n * Current best bid price in quote units scaled by 1e6.\n *\n * @generated from field: int64 best_bid_ticks = 9;\n */\n bestBidTicks: bigint;\n\n /**\n * Best bid quantity scaled by the pair's base_quantity_scale from\n * GetSpotConfig.\n *\n * @generated from field: int64 best_bid_qty_scaled = 10;\n */\n bestBidQtyScaled: bigint;\n\n /**\n * Current best ask price in quote units scaled by 1e6.\n *\n * @generated from field: int64 best_ask_ticks = 11;\n */\n bestAskTicks: bigint;\n\n /**\n * Best ask quantity scaled by the pair's base_quantity_scale from\n * GetSpotConfig.\n *\n * @generated from field: int64 best_ask_qty_scaled = 12;\n */\n bestAskQtyScaled: bigint;\n\n /**\n * Optional sparklines (requested explicitly).\n *\n * @generated from field: repeated marketoverview.v1.Sparkline sparklines = 13;\n */\n sparklines: Sparkline[];\n\n /**\n * Current multi-venue index price in quote units scaled by 1e6.\n * Zero when no fresh, valid index price is available.\n *\n * @generated from field: int64 index_price_ticks = 16;\n */\n indexPriceTicks: bigint;\n};\n\n/**\n * Describes the message marketoverview.v1.MarketOverview.\n * Use `create(MarketOverviewSchema)` to create a new message.\n */\nexport const MarketOverviewSchema: GenMessage<MarketOverview> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 2);\n\n/**\n * @generated from message marketoverview.v1.ListMarketOverviewRequest\n */\nexport type ListMarketOverviewRequest = Message<\"marketoverview.v1.ListMarketOverviewRequest\"> & {\n /**\n * Filter by stable numeric pair IDs from GetSpotConfig. When empty, returns\n * all enabled markets.\n *\n * @generated from field: repeated uint32 symbol_id = 1;\n */\n symbolId: number[];\n\n /**\n * Maximum number of markets to return. Defaults to 50 when omitted; maximum\n * is 2000.\n *\n * @generated from field: uint32 limit = 2;\n */\n limit: number;\n\n /**\n * Opaque keyset cursor from a previous response. The cursor is exclusive and\n * bound to symbol IDs, sort key, and sort direction. Sparkline options\n * affect only response enrichment and may change between pages.\n *\n * @generated from field: string page_token = 3;\n */\n pageToken: string;\n\n /**\n * Sort key. When unset/UNSPECIFIED, defaults to descending 24h USD volume.\n *\n * @generated from field: marketoverview.v1.MarketOrderBy order_by = 4;\n */\n orderBy: MarketOrderBy;\n\n /**\n * Sort direction (DESC=newest/highest first).\n *\n * @generated from field: marketoverview.v1.SortDirection sort = 5;\n */\n sort: SortDirection;\n\n /**\n * When true, include sparklines in each MarketOverview.\n *\n * @generated from field: bool include_sparklines = 6;\n */\n includeSparklines: boolean;\n\n /**\n * Which sparklines to include. If empty and include_sparklines is true,\n * server defaults to 24h.\n *\n * @generated from field: repeated marketoverview.v1.SparklineInterval sparkline_intervals = 7;\n */\n sparklineIntervals: SparklineInterval[];\n};\n\n/**\n * Describes the message marketoverview.v1.ListMarketOverviewRequest.\n * Use `create(ListMarketOverviewRequestSchema)` to create a new message.\n */\nexport const ListMarketOverviewRequestSchema: GenMessage<ListMarketOverviewRequest> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 3);\n\n/**\n * @generated from message marketoverview.v1.ListMarketOverviewResponse\n */\nexport type ListMarketOverviewResponse = Message<\"marketoverview.v1.ListMarketOverviewResponse\"> & {\n /**\n * Market overview rows for the requested page.\n *\n * @generated from field: repeated marketoverview.v1.MarketOverview markets = 1;\n */\n markets: MarketOverview[];\n\n /**\n * Opaque cursor for the next page. Empty when no more results exist.\n *\n * @generated from field: string next_page_token = 2;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message marketoverview.v1.ListMarketOverviewResponse.\n * Use `create(ListMarketOverviewResponseSchema)` to create a new message.\n */\nexport const ListMarketOverviewResponseSchema: GenMessage<ListMarketOverviewResponse> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 4);\n\n/**\n * MarketOverviewBatch is a websocket payload carrying batched market overview\n * updates. It is published to a single all-markets channel at a fixed cadence.\n *\n * @generated from message marketoverview.v1.MarketOverviewBatch\n */\nexport type MarketOverviewBatch = Message<\"marketoverview.v1.MarketOverviewBatch\"> & {\n /**\n * Market overviews included in this batch.\n *\n * @generated from field: repeated marketoverview.v1.MarketOverview markets = 1;\n */\n markets: MarketOverview[];\n\n /**\n * Batch publish timestamp in nanoseconds since epoch.\n *\n * @generated from field: uint64 ts_ns = 2;\n */\n tsNs: bigint;\n};\n\n/**\n * Describes the message marketoverview.v1.MarketOverviewBatch.\n * Use `create(MarketOverviewBatchSchema)` to create a new message.\n */\nexport const MarketOverviewBatchSchema: GenMessage<MarketOverviewBatch> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 5);\n\n/**\n * A finite spot-volume chart request; no pagination or arbitrary time range.\n *\n * @generated from message marketoverview.v1.GetSpotVolumeHistoryRequest\n */\nexport type GetSpotVolumeHistoryRequest = Message<\"marketoverview.v1.GetSpotVolumeHistoryRequest\"> & {\n /**\n * Pair IDs from GetSpotConfig; empty selects every configured pair separately.\n * At most 2000 distinct positive IDs. Unknown IDs are rejected. If the full\n * universe exceeds 2000 pairs, specify a filter; results are never truncated.\n *\n * @generated from field: repeated uint32 symbol_id = 1;\n */\n symbolId: number[];\n};\n\n/**\n * Describes the message marketoverview.v1.GetSpotVolumeHistoryRequest.\n * Use `create(GetSpotVolumeHistoryRequestSchema)` to create a new message.\n */\nexport const GetSpotVolumeHistoryRequestSchema: GenMessage<GetSpotVolumeHistoryRequest> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 6);\n\n/**\n * One pair appears exactly once, regardless of its base and quote assets.\n * REST renders the scaled amounts as decimal strings in volumeUsd.\n *\n * @generated from message marketoverview.v1.SpotPairVolumeSeries\n */\nexport type SpotPairVolumeSeries = Message<\"marketoverview.v1.SpotPairVolumeSeries\"> & {\n /**\n * Stable numeric pair ID; clients may group these series by base asset.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n\n /**\n * Trailing-24h USD amounts scaled by 1e6, oldest first. Exactly points values,\n * aligned with the shared response grid. Zero means no executed trades in\n * the window. USD values round down once per contributing 15-minute bucket.\n *\n * @generated from field: repeated sint64 volume_usd_scaled = 2;\n */\n volumeUsdScaled: bigint[];\n};\n\n/**\n * Describes the message marketoverview.v1.SpotPairVolumeSeries.\n * Use `create(SpotPairVolumeSeriesSchema)` to create a new message.\n */\nexport const SpotPairVolumeSeriesSchema: GenMessage<SpotPairVolumeSeries> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 7);\n\n/**\n * Aligned columnar trailing-24h USD series over the most recent 24 hours.\n * The grid always contains 97 samples ending at the latest completed UTC\n * quarter-hour. Index i maps to start_ts_sec + i * 900 seconds. Each sample\n * covers [sample time - 24h, sample time); only the preceding 48 hours contribute.\n * USD conversion uses historical quote/USD prices at each completed bucket\n * boundary. When conversion is unavailable, USDT and USDC are valued at USD parity.\n * If any contributing trade cannot be valued, or a USD amount overflows,\n * the RPC fails as unavailable; partial or zero-filled valuations are not returned.\n * Intervals without executed trades are zero. Results may be reused for 15 seconds.\n *\n * @generated from message marketoverview.v1.GetSpotVolumeHistoryResponse\n */\nexport type GetSpotVolumeHistoryResponse = Message<\"marketoverview.v1.GetSpotVolumeHistoryResponse\"> & {\n /**\n * Sampling interval between points; currently always \"15m\".\n *\n * @generated from field: string bucket = 1;\n */\n bucket: string;\n\n /**\n * First sample timestamp in seconds since Unix epoch (UTC), inclusive.\n *\n * @generated from field: fixed32 start_ts_sec = 2;\n */\n startTsSec: number;\n\n /**\n * Last sample timestamp in seconds since Unix epoch (UTC), inclusive.\n *\n * @generated from field: fixed32 end_ts_sec = 3;\n */\n endTsSec: number;\n\n /**\n * Number of aligned values in every pair array and the total array; always 97.\n *\n * @generated from field: uint32 points = 4;\n */\n points: number;\n\n /**\n * Pairs ordered by ascending symbol_id; at most 2000, each included once.\n *\n * @generated from field: repeated marketoverview.v1.SpotPairVolumeSeries pairs = 5;\n */\n pairs: SpotPairVolumeSeries[];\n\n /**\n * Sum across selected pairs, USD scaled by 1e6. Exactly points values,\n * oldest first. REST renders decimal strings in totalVolumeUsd.\n * Do not sum overlapping trailing-24h samples to obtain period traded volume.\n *\n * @generated from field: repeated sint64 total_volume_usd_scaled = 6;\n */\n totalVolumeUsdScaled: bigint[];\n};\n\n/**\n * Describes the message marketoverview.v1.GetSpotVolumeHistoryResponse.\n * Use `create(GetSpotVolumeHistoryResponseSchema)` to create a new message.\n */\nexport const GetSpotVolumeHistoryResponseSchema: GenMessage<GetSpotVolumeHistoryResponse> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 8);\n\n/**\n * CurrencyMetadata supplies stable defaults for display conversion. Clients may\n * localize names, symbols, and number formatting for the user's locale.\n *\n * @generated from message marketoverview.v1.CurrencyMetadata\n */\nexport type CurrencyMetadata = Message<\"marketoverview.v1.CurrencyMetadata\"> & {\n /**\n * Uppercase currency or stablecoin code, such as EUR or USDT.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Default English display name.\n *\n * @generated from field: string default_english_name = 2;\n */\n defaultEnglishName: string;\n\n /**\n * Representative local display symbol; multiple currencies may share a symbol.\n * Uses the code when the selected local display data has no distinct visible symbol.\n *\n * @generated from field: string symbol = 3;\n */\n symbol: string;\n\n /**\n * Default display fraction digits, including zero for currencies such as JPY.\n * This is a formatting default, not rate precision, token decimals, or cash rounding.\n * Stablecoins use two display fraction digits.\n *\n * @generated from field: uint32 fraction_digits = 4;\n */\n fractionDigits: number;\n};\n\n/**\n * Describes the message marketoverview.v1.CurrencyMetadata.\n * Use `create(CurrencyMetadataSchema)` to create a new message.\n */\nexport const CurrencyMetadataSchema: GenMessage<CurrencyMetadata> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 9);\n\n/**\n * GetCurrencyConversionConfigRequest has no parameters.\n *\n * @generated from message marketoverview.v1.GetCurrencyConversionConfigRequest\n */\nexport type GetCurrencyConversionConfigRequest = Message<\"marketoverview.v1.GetCurrencyConversionConfigRequest\"> & {\n};\n\n/**\n * Describes the message marketoverview.v1.GetCurrencyConversionConfigRequest.\n * Use `create(GetCurrencyConversionConfigRequestSchema)` to create a new message.\n */\nexport const GetCurrencyConversionConfigRequestSchema: GenMessage<GetCurrencyConversionConfigRequest> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 10);\n\n/**\n * GetCurrencyConversionConfigResponse contains finite, cacheable display metadata.\n * It remains available before any rates have been observed.\n *\n * @generated from message marketoverview.v1.GetCurrencyConversionConfigResponse\n */\nexport type GetCurrencyConversionConfigResponse = Message<\"marketoverview.v1.GetCurrencyConversionConfigResponse\"> & {\n /**\n * Supported fiat currencies, including USD, ordered by code.\n *\n * @generated from field: repeated marketoverview.v1.CurrencyMetadata fiat = 1;\n */\n fiat: CurrencyMetadata[];\n\n /**\n * Supported stablecoins (USDC and USDT), ordered by code.\n *\n * @generated from field: repeated marketoverview.v1.CurrencyMetadata stablecoins = 2;\n */\n stablecoins: CurrencyMetadata[];\n};\n\n/**\n * Describes the message marketoverview.v1.GetCurrencyConversionConfigResponse.\n * Use `create(GetCurrencyConversionConfigResponseSchema)` to create a new message.\n */\nexport const GetCurrencyConversionConfigResponseSchema: GenMessage<GetCurrencyConversionConfigResponse> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 11);\n\n/**\n * FiatConversionRate states the fiat currency units equal to one US dollar.\n *\n * @generated from message marketoverview.v1.FiatConversionRate\n */\nexport type FiatConversionRate = Message<\"marketoverview.v1.FiatConversionRate\"> & {\n /**\n * Supported fiat currency code.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Fiat currency units per 1 USD, scaled by 1e8. USD has the identity value 1e8.\n *\n * @generated from field: int64 units_per_usd_e8 = 2;\n */\n unitsPerUsdE8: bigint;\n};\n\n/**\n * Describes the message marketoverview.v1.FiatConversionRate.\n * Use `create(FiatConversionRateSchema)` to create a new message.\n */\nexport const FiatConversionRateSchema: GenMessage<FiatConversionRate> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 12);\n\n/**\n * FiatConversionSnapshot contains all supported fiat rates from one observation.\n *\n * @generated from message marketoverview.v1.FiatConversionSnapshot\n */\nexport type FiatConversionSnapshot = Message<\"marketoverview.v1.FiatConversionSnapshot\"> & {\n /**\n * Complete fiat rates, including USD, ordered by code.\n *\n * @generated from field: repeated marketoverview.v1.FiatConversionRate rates = 1;\n */\n rates: FiatConversionRate[];\n\n /**\n * Shared source observation time in seconds since the Unix epoch (UTC).\n *\n * @generated from field: uint64 source_ts_sec = 2;\n */\n sourceTsSec: bigint;\n\n /**\n * True once the source observation is at least two hours old.\n *\n * @generated from field: bool stale = 3;\n */\n stale: boolean;\n};\n\n/**\n * Describes the message marketoverview.v1.FiatConversionSnapshot.\n * Use `create(FiatConversionSnapshotSchema)` to create a new message.\n */\nexport const FiatConversionSnapshotSchema: GenMessage<FiatConversionSnapshot> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 13);\n\n/**\n * StablecoinConversionRate states the observed USD value of one stablecoin unit.\n *\n * @generated from message marketoverview.v1.StablecoinConversionRate\n */\nexport type StablecoinConversionRate = Message<\"marketoverview.v1.StablecoinConversionRate\"> & {\n /**\n * Supported stablecoin code (USDC or USDT).\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * USD per 1 stablecoin unit, scaled by 1e8. This is an observed price, not a fixed peg.\n *\n * @generated from field: int64 usd_per_unit_e8 = 2;\n */\n usdPerUnitE8: bigint;\n\n /**\n * This stablecoin's source observation time in seconds since the Unix epoch (UTC).\n *\n * @generated from field: uint64 source_ts_sec = 3;\n */\n sourceTsSec: bigint;\n\n /**\n * True once this stablecoin's source observation is at least five seconds old.\n *\n * @generated from field: bool stale = 4;\n */\n stale: boolean;\n};\n\n/**\n * Describes the message marketoverview.v1.StablecoinConversionRate.\n * Use `create(StablecoinConversionRateSchema)` to create a new message.\n */\nexport const StablecoinConversionRateSchema: GenMessage<StablecoinConversionRate> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 14);\n\n/**\n * GetCurrencyConversionRatesRequest has no parameters.\n *\n * @generated from message marketoverview.v1.GetCurrencyConversionRatesRequest\n */\nexport type GetCurrencyConversionRatesRequest = Message<\"marketoverview.v1.GetCurrencyConversionRatesRequest\"> & {\n};\n\n/**\n * Describes the message marketoverview.v1.GetCurrencyConversionRatesRequest.\n * Use `create(GetCurrencyConversionRatesRequestSchema)` to create a new message.\n */\nexport const GetCurrencyConversionRatesRequestSchema: GenMessage<GetCurrencyConversionRatesRequest> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 15);\n\n/**\n * GetCurrencyConversionRatesResponse groups rates by their USD conversion direction.\n * Last-known observations remain available with staleness indicated. Before any\n * observation is available, the request fails with unavailable (HTTP 503).\n *\n * @generated from message marketoverview.v1.GetCurrencyConversionRatesResponse\n */\nexport type GetCurrencyConversionRatesResponse = Message<\"marketoverview.v1.GetCurrencyConversionRatesResponse\"> & {\n /**\n * Complete fiat snapshot; absent until a complete snapshot has been observed.\n *\n * @generated from field: marketoverview.v1.FiatConversionSnapshot fiat = 1;\n */\n fiat?: FiatConversionSnapshot | undefined;\n\n /**\n * Observed stablecoin rates ordered by code. Unobserved stablecoins are omitted.\n *\n * @generated from field: repeated marketoverview.v1.StablecoinConversionRate stablecoins = 2;\n */\n stablecoins: StablecoinConversionRate[];\n\n /**\n * Response construction time in seconds since the Unix epoch (UTC).\n *\n * @generated from field: uint64 snapshot_ts_sec = 3;\n */\n snapshotTsSec: bigint;\n};\n\n/**\n * Describes the message marketoverview.v1.GetCurrencyConversionRatesResponse.\n * Use `create(GetCurrencyConversionRatesResponseSchema)` to create a new message.\n */\nexport const GetCurrencyConversionRatesResponseSchema: GenMessage<GetCurrencyConversionRatesResponse> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 16);\n\n/**\n * SparklineInterval identifies the time range and sampling resolution for a\n * sparkline.\n *\n * @generated from enum marketoverview.v1.SparklineInterval\n */\nexport enum SparklineInterval {\n /**\n * Unspecified interval. When requested, server may default to 24H.\n *\n * @generated from enum value: SPARKLINE_INTERVAL_UNSPECIFIED = 0;\n */\n SPARKLINE_INTERVAL_UNSPECIFIED = 0,\n\n /**\n * 1 hour sparkline. Typically returns up to 60 points (1-minute buckets).\n *\n * @generated from enum value: SPARKLINE_1H = 1;\n */\n SPARKLINE_1H = 1,\n\n /**\n * 24 hour sparkline. Typically returns up to 96 points (15-minute buckets).\n *\n * @generated from enum value: SPARKLINE_24H = 2;\n */\n SPARKLINE_24H = 2,\n\n /**\n * 1 week sparkline. Typically returns up to 168 points (1-hour buckets).\n *\n * @generated from enum value: SPARKLINE_1W = 3;\n */\n SPARKLINE_1W = 3,\n\n /**\n * 1 month sparkline. Typically returns up to 180 points (4-hour buckets).\n *\n * @generated from enum value: SPARKLINE_1M = 4;\n */\n SPARKLINE_1M = 4,\n}\n\n/**\n * Describes the enum marketoverview.v1.SparklineInterval.\n */\nexport const SparklineIntervalSchema: GenEnum<SparklineInterval> = /*@__PURE__*/\n enumDesc(file_marketoverview_v1_marketoverview, 0);\n\n/**\n * @generated from enum marketoverview.v1.MarketOrderBy\n */\nexport enum MarketOrderBy {\n /**\n * @generated from enum value: MARKET_ORDER_BY_UNSPECIFIED = 0;\n */\n MARKET_ORDER_BY_UNSPECIFIED = 0,\n\n /**\n * Sort by absolute 24h change (basis points).\n *\n * @generated from enum value: ORDER_BY_CHANGE_24H_BPS = 1;\n */\n ORDER_BY_CHANGE_24H_BPS = 1,\n\n /**\n * Sort by canonical USD 24h volume. Unvalued markets sort last in either direction.\n *\n * @generated from enum value: ORDER_BY_VOLUME_24H_USD = 2;\n */\n ORDER_BY_VOLUME_24H_USD = 2,\n\n /**\n * Sort by last price in quote units scaled by 1e6.\n *\n * @generated from enum value: ORDER_BY_LAST_PRICE = 3;\n */\n ORDER_BY_LAST_PRICE = 3,\n\n /**\n * Sort by listing time (new listings first).\n *\n * @generated from enum value: ORDER_BY_DATE_ADDED = 4;\n */\n ORDER_BY_DATE_ADDED = 4,\n}\n\n/**\n * Describes the enum marketoverview.v1.MarketOrderBy.\n */\nexport const MarketOrderBySchema: GenEnum<MarketOrderBy> = /*@__PURE__*/\n enumDesc(file_marketoverview_v1_marketoverview, 1);\n\n/**\n * @generated from enum marketoverview.v1.SortDirection\n */\nexport enum SortDirection {\n /**\n * @generated from enum value: SORT_DIRECTION_UNSPECIFIED = 0;\n */\n SORT_DIRECTION_UNSPECIFIED = 0,\n\n /**\n * Ascending (oldest/lowest first).\n *\n * @generated from enum value: SORT_ASC = 1;\n */\n SORT_ASC = 1,\n\n /**\n * Descending (newest/highest first).\n *\n * @generated from enum value: SORT_DESC = 2;\n */\n SORT_DESC = 2,\n}\n\n/**\n * Describes the enum marketoverview.v1.SortDirection.\n */\nexport const SortDirectionSchema: GenEnum<SortDirection> = /*@__PURE__*/\n enumDesc(file_marketoverview_v1_marketoverview, 2);\n\n/**\n * ErrorCode is a stable domain error code enum for Market Overview.\n * It is used for consistent error surfaces across ConnectRPC and REST.\n *\n * @generated from enum marketoverview.v1.ErrorCode\n */\nexport enum ErrorCode {\n /**\n * @generated from enum value: ERROR_CODE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: ERROR_CODE_BAD_REQUEST = 1;\n */\n BAD_REQUEST = 1,\n\n /**\n * @generated from enum value: ERROR_CODE_INVALID_ARGUMENT = 2;\n */\n INVALID_ARGUMENT = 2,\n\n /**\n * @generated from enum value: ERROR_CODE_NOT_FOUND = 3;\n */\n NOT_FOUND = 3,\n\n /**\n * @generated from enum value: ERROR_CODE_UNAVAILABLE = 4;\n */\n UNAVAILABLE = 4,\n\n /**\n * @generated from enum value: ERROR_CODE_UPSTREAM_ERROR = 5;\n */\n UPSTREAM_ERROR = 5,\n}\n\n/**\n * Describes the enum marketoverview.v1.ErrorCode.\n */\nexport const ErrorCodeSchema: GenEnum<ErrorCode> = /*@__PURE__*/\n enumDesc(file_marketoverview_v1_marketoverview, 3);\n\n/**\n * List ticker-style market overview rows with optional sparklines.\n * Supports symbol filtering, sorting, and pagination controls.\n *\n * @generated from service marketoverview.v1.MarketOverviewService\n */\nexport const MarketOverviewService: GenService<{\n /**\n * Get supported fiat and stablecoin display metadata with default English names,\n * symbols, and fraction digits. Clients may localize presentation.\n *\n * @generated from rpc marketoverview.v1.MarketOverviewService.GetCurrencyConversionConfig\n */\n getCurrencyConversionConfig: {\n methodKind: \"unary\";\n input: typeof GetCurrencyConversionConfigRequestSchema;\n output: typeof GetCurrencyConversionConfigResponseSchema;\n },\n /**\n * Get fiat units per USD and USD per stablecoin unit, grouped with source freshness.\n *\n * @generated from rpc marketoverview.v1.MarketOverviewService.GetCurrencyConversionRates\n */\n getCurrencyConversionRates: {\n methodKind: \"unary\";\n input: typeof GetCurrencyConversionRatesRequestSchema;\n output: typeof GetCurrencyConversionRatesResponseSchema;\n },\n /**\n * Get aligned pair-level and total trailing-24h USD volume, sampled every\n * 15 minutes over the latest day. Unavailable valuations fail the request.\n *\n * @generated from rpc marketoverview.v1.MarketOverviewService.GetSpotVolumeHistory\n */\n getSpotVolumeHistory: {\n methodKind: \"unary\";\n input: typeof GetSpotVolumeHistoryRequestSchema;\n output: typeof GetSpotVolumeHistoryResponseSchema;\n },\n /**\n * @generated from rpc marketoverview.v1.MarketOverviewService.ListMarketOverview\n */\n listMarketOverview: {\n methodKind: \"unary\";\n input: typeof ListMarketOverviewRequestSchema;\n output: typeof ListMarketOverviewResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_marketoverview_v1_marketoverview, 0);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,wCACX,uBAAS,oqJAAoqJ,CAAC,0BAA0B,CAAC;;;;;AAoB3sJ,MAAa,oBACX,0BAAY,uCAAuC,CAAC;;;;;AA2BtD,MAAa,kBACX,0BAAY,uCAAuC,CAAC;;;;;AAoItD,MAAa,uBACX,0BAAY,uCAAuC,CAAC;;;;;AAiEtD,MAAa,kCACX,0BAAY,uCAAuC,CAAC;;;;;AAyBtD,MAAa,mCACX,0BAAY,uC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KAAA;;;;;;CAOA,cAAA,cAAA,cAAA,KAAA;;;;;;CAOA,cAAA,cAAA,eAAA,KAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,MAAa,sBACX,uBAAS,uCAAuC,CAAC;;;;;;;AAQnD,IAAY,YAAL,yBAAA,WAAA;;;;CAIL,UAAA,UAAA,iBAAA,KAAA;;;;CAKA,UAAA,UAAA,iBAAA,KAAA;;;;CAKA,UAAA,UAAA,sBAAA,KAAA;;;;CAKA,UAAA,UAAA,eAAA,KAAA;;;;CAKA,UAAA,UAAA,iBAAA,KAAA;;;;CAKA,UAAA,UAAA,oBAAA,KAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,MAAa,kBACX,uBAAS,uCAAuC,CAAC;;;;;;;AAQnD,MAAa,wBA0CX,0BAAY,uCAAuC,CAAC"}
1
+ {"version":3,"file":"marketoverview_pb.js","names":[],"sources":["../../../../src/gen/marketoverview/v1/marketoverview_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file marketoverview/v1/marketoverview.proto (package marketoverview.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport { file_polyester_api_options } from \"../../polyester/api/options_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file marketoverview/v1/marketoverview.proto.\n */\nexport const file_marketoverview_v1_marketoverview: GenFile = /*@__PURE__*/\n fileDesc(\"CiZtYXJrZXRvdmVydmlldy92MS9tYXJrZXRvdmVydmlldy5wcm90bxIRbWFya2V0b3ZlcnZpZXcudjEiOQoLRXJyb3JEZXRhaWwSKgoEY29kZRgBIAEoDjIcLm1hcmtldG92ZXJ2aWV3LnYxLkVycm9yQ29kZSJaCglTcGFya2xpbmUSOAoIaW50ZXJ2YWwYASABKA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PdmVydmlldxIsLm1hcmtldG92ZXJ2aWV3LnYxLkxpc3RNYXJrZXRPdmVydmlld1JlcXVlc3QaLS5tYXJrZXRvdmVydmlldy52MS5MaXN0TWFya2V0T3ZlcnZpZXdSZXNwb25zZSIAQlBaTmdpdGh1Yi5jb20vRmFicmljLUxhYnMvcG9seWVzdGVyLXNkay1nby9nZW4vbWFya2V0b3ZlcnZpZXcvdjE7bWFya2V0b3ZlcnZpZXd2MWIGcHJvdG8z\", [file_polyester_api_options]);\n\n/**\n * ErrorDetail carries a typed domain error code for machine-readable handling.\n *\n * @generated from message marketoverview.v1.ErrorDetail\n */\nexport type ErrorDetail = Message<\"marketoverview.v1.ErrorDetail\"> & {\n /**\n * Stable error code for programmatic matching.\n *\n * @generated from field: marketoverview.v1.ErrorCode code = 1;\n */\n code: ErrorCode;\n};\n\n/**\n * Describes the message marketoverview.v1.ErrorDetail.\n * Use `create(ErrorDetailSchema)` to create a new message.\n */\nexport const ErrorDetailSchema: GenMessage<ErrorDetail> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 0);\n\n/**\n * Sparkline contains newest-first close prices for one time range.\n *\n * @generated from message marketoverview.v1.Sparkline\n */\nexport type Sparkline = Message<\"marketoverview.v1.Sparkline\"> & {\n /**\n * Time range and sampling resolution represented by these close prices.\n *\n * @generated from field: marketoverview.v1.SparklineInterval interval = 1;\n */\n interval: SparklineInterval;\n\n /**\n * Newest-first close prices in quote units scaled by 1e6.\n *\n * @generated from field: repeated int64 close_ticks = 2;\n */\n closeTicks: bigint[];\n};\n\n/**\n * Describes the message marketoverview.v1.Sparkline.\n * Use `create(SparklineSchema)` to create a new message.\n */\nexport const SparklineSchema: GenMessage<Sparkline> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 1);\n\n/**\n * @generated from message marketoverview.v1.MarketOverview\n */\nexport type MarketOverview = Message<\"marketoverview.v1.MarketOverview\"> & {\n /**\n * Numeric spot market identifier.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n\n /**\n * Last traded price in quote units scaled by 1e6.\n *\n * @generated from field: int64 last_price_ticks = 3;\n */\n lastPriceTicks: bigint;\n\n /**\n * Last trade timestamp in nanoseconds since epoch.\n *\n * @generated from field: uint64 last_trade_ts_ns = 4;\n */\n lastTradeTsNs: bigint;\n\n /**\n * Rolling 24h change expressed in basis points (bp). Example: +123 = +1.23%.\n *\n * @generated from field: int32 change_24h_bps = 5;\n */\n change24hBps: number;\n\n /**\n * Rolling 24h stats.\n * Highest traded price in the 24h window, in quote units scaled by 1e6.\n *\n * @generated from field: int64 high_24h_ticks = 6;\n */\n high24hTicks: bigint;\n\n /**\n * Lowest traded price in the 24h window, in quote units scaled by 1e6.\n *\n * @generated from field: int64 low_24h_ticks = 7;\n */\n low24hTicks: bigint;\n\n /**\n * Rolling 24h base volume scaled by the base asset's\n * market_data_volume_scale from GetSpotConfig. Omitted if the amount exceeds\n * the signed 64-bit range.\n *\n * @generated from field: optional int64 volume_24h_base_scaled = 8;\n */\n volume24hBaseScaled?: bigint | undefined;\n\n /**\n * Rolling 24h quote volume scaled by the pair's quote_quantity_scale from\n * GetSpotConfig. Omitted if the amount exceeds the signed 64-bit range.\n *\n * @generated from field: optional int64 volume_24h_quote_scaled = 14;\n */\n volume24hQuoteScaled?: bigint | undefined;\n\n /**\n * Rolling 24h USD volume, scaled by 1e6 (one unit is 0.000001 USD).\n * Applies the current quote/USD conversion to the rolling quote volume.\n * When conversion is unavailable, USDT and USDC are valued at USD parity.\n * Omitted for other quote assets when a current conversion is unavailable.\n *\n * @generated from field: optional int64 volume_24h_usd_scaled = 17;\n */\n volume24hUsdScaled?: bigint | undefined;\n\n /**\n * Listing timestamp in nanoseconds since epoch.\n *\n * @generated from field: uint64 listed_ts_ns = 15;\n */\n listedTsNs: bigint;\n\n /**\n * Current best bid price in quote units scaled by 1e6.\n *\n * @generated from field: int64 best_bid_ticks = 9;\n */\n bestBidTicks: bigint;\n\n /**\n * Best bid quantity scaled by the pair's base_quantity_scale from\n * GetSpotConfig.\n *\n * @generated from field: int64 best_bid_qty_scaled = 10;\n */\n bestBidQtyScaled: bigint;\n\n /**\n * Current best ask price in quote units scaled by 1e6.\n *\n * @generated from field: int64 best_ask_ticks = 11;\n */\n bestAskTicks: bigint;\n\n /**\n * Best ask quantity scaled by the pair's base_quantity_scale from\n * GetSpotConfig.\n *\n * @generated from field: int64 best_ask_qty_scaled = 12;\n */\n bestAskQtyScaled: bigint;\n\n /**\n * Optional sparklines (requested explicitly).\n *\n * @generated from field: repeated marketoverview.v1.Sparkline sparklines = 13;\n */\n sparklines: Sparkline[];\n\n /**\n * Current multi-venue index price in quote units scaled by 1e6.\n * Zero when no fresh, valid index price is available.\n *\n * @generated from field: int64 index_price_ticks = 16;\n */\n indexPriceTicks: bigint;\n};\n\n/**\n * Describes the message marketoverview.v1.MarketOverview.\n * Use `create(MarketOverviewSchema)` to create a new message.\n */\nexport const MarketOverviewSchema: GenMessage<MarketOverview> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 2);\n\n/**\n * @generated from message marketoverview.v1.ListMarketOverviewRequest\n */\nexport type ListMarketOverviewRequest = Message<\"marketoverview.v1.ListMarketOverviewRequest\"> & {\n /**\n * Filter by stable numeric pair IDs from GetSpotConfig. When empty, returns\n * all enabled markets.\n *\n * @generated from field: repeated uint32 symbol_id = 1;\n */\n symbolId: number[];\n\n /**\n * Maximum number of markets to return. Defaults to 50 when omitted; maximum\n * is 2000.\n *\n * @generated from field: uint32 limit = 2;\n */\n limit: number;\n\n /**\n * Opaque keyset cursor from a previous response. The cursor is exclusive and\n * bound to symbol IDs, sort key, and sort direction. Sparkline options\n * affect only response enrichment and may change between pages.\n *\n * @generated from field: string page_token = 3;\n */\n pageToken: string;\n\n /**\n * Sort key. When unset/UNSPECIFIED, defaults to descending 24h USD volume.\n *\n * @generated from field: marketoverview.v1.MarketOrderBy order_by = 4;\n */\n orderBy: MarketOrderBy;\n\n /**\n * Sort direction (DESC=newest/highest first).\n *\n * @generated from field: marketoverview.v1.SortDirection sort = 5;\n */\n sort: SortDirection;\n\n /**\n * When true, include sparklines in each MarketOverview.\n *\n * @generated from field: bool include_sparklines = 6;\n */\n includeSparklines: boolean;\n\n /**\n * Which sparklines to include. If empty and include_sparklines is true,\n * server defaults to 24h.\n *\n * @generated from field: repeated marketoverview.v1.SparklineInterval sparkline_intervals = 7;\n */\n sparklineIntervals: SparklineInterval[];\n};\n\n/**\n * Describes the message marketoverview.v1.ListMarketOverviewRequest.\n * Use `create(ListMarketOverviewRequestSchema)` to create a new message.\n */\nexport const ListMarketOverviewRequestSchema: GenMessage<ListMarketOverviewRequest> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 3);\n\n/**\n * @generated from message marketoverview.v1.ListMarketOverviewResponse\n */\nexport type ListMarketOverviewResponse = Message<\"marketoverview.v1.ListMarketOverviewResponse\"> & {\n /**\n * Market overview rows for the requested page.\n *\n * @generated from field: repeated marketoverview.v1.MarketOverview markets = 1;\n */\n markets: MarketOverview[];\n\n /**\n * Opaque cursor for the next page. Empty when no more results exist.\n *\n * @generated from field: string next_page_token = 2;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message marketoverview.v1.ListMarketOverviewResponse.\n * Use `create(ListMarketOverviewResponseSchema)` to create a new message.\n */\nexport const ListMarketOverviewResponseSchema: GenMessage<ListMarketOverviewResponse> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 4);\n\n/**\n * MarketOverviewBatch is a websocket payload carrying batched market overview\n * updates. It is published to a single all-markets channel at a fixed cadence.\n *\n * @generated from message marketoverview.v1.MarketOverviewBatch\n */\nexport type MarketOverviewBatch = Message<\"marketoverview.v1.MarketOverviewBatch\"> & {\n /**\n * Market overviews included in this batch.\n *\n * @generated from field: repeated marketoverview.v1.MarketOverview markets = 1;\n */\n markets: MarketOverview[];\n\n /**\n * Batch publish timestamp in nanoseconds since epoch.\n *\n * @generated from field: uint64 ts_ns = 2;\n */\n tsNs: bigint;\n};\n\n/**\n * Describes the message marketoverview.v1.MarketOverviewBatch.\n * Use `create(MarketOverviewBatchSchema)` to create a new message.\n */\nexport const MarketOverviewBatchSchema: GenMessage<MarketOverviewBatch> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 5);\n\n/**\n * A finite spot-volume chart request; no pagination or arbitrary time range.\n *\n * @generated from message marketoverview.v1.GetSpotVolumeHistoryRequest\n */\nexport type GetSpotVolumeHistoryRequest = Message<\"marketoverview.v1.GetSpotVolumeHistoryRequest\"> & {\n /**\n * Pair IDs from GetSpotConfig; empty selects every configured pair separately.\n * At most 2000 distinct positive IDs. Unknown IDs are rejected. If the full\n * universe exceeds 2000 pairs, specify a filter; results are never truncated.\n *\n * @generated from field: repeated uint32 symbol_id = 1;\n */\n symbolId: number[];\n};\n\n/**\n * Describes the message marketoverview.v1.GetSpotVolumeHistoryRequest.\n * Use `create(GetSpotVolumeHistoryRequestSchema)` to create a new message.\n */\nexport const GetSpotVolumeHistoryRequestSchema: GenMessage<GetSpotVolumeHistoryRequest> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 6);\n\n/**\n * One pair appears exactly once, regardless of its base and quote assets.\n * REST renders the scaled amounts as decimal strings in volumeUsd.\n *\n * @generated from message marketoverview.v1.SpotPairVolumeSeries\n */\nexport type SpotPairVolumeSeries = Message<\"marketoverview.v1.SpotPairVolumeSeries\"> & {\n /**\n * Stable numeric pair ID; clients may group these series by base asset.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n\n /**\n * Trailing-24h USD amounts scaled by 1e6, oldest first. Exactly points values,\n * aligned with the shared response grid. Zero means no executed trades in\n * the window. USD values round down once per contributing 15-minute bucket.\n *\n * @generated from field: repeated sint64 volume_usd_scaled = 2;\n */\n volumeUsdScaled: bigint[];\n};\n\n/**\n * Describes the message marketoverview.v1.SpotPairVolumeSeries.\n * Use `create(SpotPairVolumeSeriesSchema)` to create a new message.\n */\nexport const SpotPairVolumeSeriesSchema: GenMessage<SpotPairVolumeSeries> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 7);\n\n/**\n * Aligned columnar trailing-24h USD series over the most recent 24 hours.\n * The grid always contains 97 samples ending at the latest completed UTC\n * quarter-hour. Index i maps to start_ts_sec + i * 900 seconds. Each sample\n * covers [sample time - 24h, sample time); only the preceding 48 hours contribute.\n * USD conversion uses historical quote/USD prices at each completed bucket\n * boundary. When conversion is unavailable, USDT and USDC are valued at USD parity.\n * If any contributing trade cannot be valued, or a USD amount overflows,\n * the RPC fails as unavailable; partial or zero-filled valuations are not returned.\n * Intervals without executed trades are zero. Results may be reused for 15 seconds.\n *\n * @generated from message marketoverview.v1.GetSpotVolumeHistoryResponse\n */\nexport type GetSpotVolumeHistoryResponse = Message<\"marketoverview.v1.GetSpotVolumeHistoryResponse\"> & {\n /**\n * Sampling interval between points; currently always \"15m\".\n *\n * @generated from field: string bucket = 1;\n */\n bucket: string;\n\n /**\n * First sample timestamp in seconds since Unix epoch (UTC), inclusive.\n *\n * @generated from field: fixed32 start_ts_sec = 2;\n */\n startTsSec: number;\n\n /**\n * Last sample timestamp in seconds since Unix epoch (UTC), inclusive.\n *\n * @generated from field: fixed32 end_ts_sec = 3;\n */\n endTsSec: number;\n\n /**\n * Number of aligned values in every pair array and the total array; always 97.\n *\n * @generated from field: uint32 points = 4;\n */\n points: number;\n\n /**\n * Pairs ordered by ascending symbol_id; at most 2000, each included once.\n *\n * @generated from field: repeated marketoverview.v1.SpotPairVolumeSeries pairs = 5;\n */\n pairs: SpotPairVolumeSeries[];\n\n /**\n * Sum across selected pairs, USD scaled by 1e6. Exactly points values,\n * oldest first. REST renders decimal strings in totalVolumeUsd.\n * Do not sum overlapping trailing-24h samples to obtain period traded volume.\n *\n * @generated from field: repeated sint64 total_volume_usd_scaled = 6;\n */\n totalVolumeUsdScaled: bigint[];\n};\n\n/**\n * Describes the message marketoverview.v1.GetSpotVolumeHistoryResponse.\n * Use `create(GetSpotVolumeHistoryResponseSchema)` to create a new message.\n */\nexport const GetSpotVolumeHistoryResponseSchema: GenMessage<GetSpotVolumeHistoryResponse> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 8);\n\n/**\n * CurrencyMetadata supplies stable defaults for display conversion. Clients may\n * localize names, symbols, and number formatting for the user's locale.\n *\n * @generated from message marketoverview.v1.CurrencyMetadata\n */\nexport type CurrencyMetadata = Message<\"marketoverview.v1.CurrencyMetadata\"> & {\n /**\n * Uppercase currency or stablecoin code, such as EUR or USDT.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Default English display name.\n *\n * @generated from field: string default_english_name = 2;\n */\n defaultEnglishName: string;\n\n /**\n * Representative local display symbol; multiple currencies may share a symbol.\n * Uses the code when the selected local display data has no distinct visible symbol.\n *\n * @generated from field: string symbol = 3;\n */\n symbol: string;\n\n /**\n * Default display fraction digits, including zero for currencies such as JPY.\n * This is a formatting default, not rate precision, token decimals, or cash rounding.\n * Stablecoins use two display fraction digits.\n *\n * @generated from field: uint32 fraction_digits = 4;\n */\n fractionDigits: number;\n};\n\n/**\n * Describes the message marketoverview.v1.CurrencyMetadata.\n * Use `create(CurrencyMetadataSchema)` to create a new message.\n */\nexport const CurrencyMetadataSchema: GenMessage<CurrencyMetadata> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 9);\n\n/**\n * GetCurrencyConversionConfigRequest has no parameters.\n *\n * @generated from message marketoverview.v1.GetCurrencyConversionConfigRequest\n */\nexport type GetCurrencyConversionConfigRequest = Message<\"marketoverview.v1.GetCurrencyConversionConfigRequest\"> & {\n};\n\n/**\n * Describes the message marketoverview.v1.GetCurrencyConversionConfigRequest.\n * Use `create(GetCurrencyConversionConfigRequestSchema)` to create a new message.\n */\nexport const GetCurrencyConversionConfigRequestSchema: GenMessage<GetCurrencyConversionConfigRequest> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 10);\n\n/**\n * GetCurrencyConversionConfigResponse contains finite, cacheable display metadata.\n * It remains available before any rates have been observed.\n *\n * @generated from message marketoverview.v1.GetCurrencyConversionConfigResponse\n */\nexport type GetCurrencyConversionConfigResponse = Message<\"marketoverview.v1.GetCurrencyConversionConfigResponse\"> & {\n /**\n * Supported fiat currencies, including USD, ordered by code.\n *\n * @generated from field: repeated marketoverview.v1.CurrencyMetadata fiat = 1;\n */\n fiat: CurrencyMetadata[];\n\n /**\n * Supported stablecoins (USDC and USDT), ordered by code.\n *\n * @generated from field: repeated marketoverview.v1.CurrencyMetadata stablecoins = 2;\n */\n stablecoins: CurrencyMetadata[];\n};\n\n/**\n * Describes the message marketoverview.v1.GetCurrencyConversionConfigResponse.\n * Use `create(GetCurrencyConversionConfigResponseSchema)` to create a new message.\n */\nexport const GetCurrencyConversionConfigResponseSchema: GenMessage<GetCurrencyConversionConfigResponse> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 11);\n\n/**\n * FiatConversionRate states the fiat currency units equal to one US dollar.\n *\n * @generated from message marketoverview.v1.FiatConversionRate\n */\nexport type FiatConversionRate = Message<\"marketoverview.v1.FiatConversionRate\"> & {\n /**\n * Supported fiat currency code.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Fiat currency units per 1 USD, scaled by 1e8. USD has the identity value 1e8.\n *\n * @generated from field: int64 units_per_usd_e8 = 2;\n */\n unitsPerUsdE8: bigint;\n};\n\n/**\n * Describes the message marketoverview.v1.FiatConversionRate.\n * Use `create(FiatConversionRateSchema)` to create a new message.\n */\nexport const FiatConversionRateSchema: GenMessage<FiatConversionRate> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 12);\n\n/**\n * FiatConversionSnapshot contains all supported fiat rates from one observation.\n *\n * @generated from message marketoverview.v1.FiatConversionSnapshot\n */\nexport type FiatConversionSnapshot = Message<\"marketoverview.v1.FiatConversionSnapshot\"> & {\n /**\n * Complete fiat rates, including USD, ordered by code.\n *\n * @generated from field: repeated marketoverview.v1.FiatConversionRate rates = 1;\n */\n rates: FiatConversionRate[];\n\n /**\n * Shared source observation time in seconds since the Unix epoch (UTC).\n *\n * @generated from field: uint64 source_ts_sec = 2;\n */\n sourceTsSec: bigint;\n\n /**\n * True once the source observation is at least two hours old.\n *\n * @generated from field: bool stale = 3;\n */\n stale: boolean;\n};\n\n/**\n * Describes the message marketoverview.v1.FiatConversionSnapshot.\n * Use `create(FiatConversionSnapshotSchema)` to create a new message.\n */\nexport const FiatConversionSnapshotSchema: GenMessage<FiatConversionSnapshot> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 13);\n\n/**\n * StablecoinConversionRate states the observed USD value of one stablecoin unit.\n *\n * @generated from message marketoverview.v1.StablecoinConversionRate\n */\nexport type StablecoinConversionRate = Message<\"marketoverview.v1.StablecoinConversionRate\"> & {\n /**\n * Supported stablecoin code (USDC or USDT).\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * USD per 1 stablecoin unit, scaled by 1e8. This is an observed price, not a fixed peg.\n *\n * @generated from field: int64 usd_per_unit_e8 = 2;\n */\n usdPerUnitE8: bigint;\n\n /**\n * This stablecoin's source observation time in seconds since the Unix epoch (UTC).\n *\n * @generated from field: uint64 source_ts_sec = 3;\n */\n sourceTsSec: bigint;\n\n /**\n * True once this stablecoin's source observation is at least five seconds old.\n *\n * @generated from field: bool stale = 4;\n */\n stale: boolean;\n};\n\n/**\n * Describes the message marketoverview.v1.StablecoinConversionRate.\n * Use `create(StablecoinConversionRateSchema)` to create a new message.\n */\nexport const StablecoinConversionRateSchema: GenMessage<StablecoinConversionRate> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 14);\n\n/**\n * GetCurrencyConversionRatesRequest has no parameters.\n *\n * @generated from message marketoverview.v1.GetCurrencyConversionRatesRequest\n */\nexport type GetCurrencyConversionRatesRequest = Message<\"marketoverview.v1.GetCurrencyConversionRatesRequest\"> & {\n};\n\n/**\n * Describes the message marketoverview.v1.GetCurrencyConversionRatesRequest.\n * Use `create(GetCurrencyConversionRatesRequestSchema)` to create a new message.\n */\nexport const GetCurrencyConversionRatesRequestSchema: GenMessage<GetCurrencyConversionRatesRequest> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 15);\n\n/**\n * GetCurrencyConversionRatesResponse groups rates by their USD conversion direction.\n * Last-known observations remain available with staleness indicated. Before any\n * observation is available, the request fails with unavailable (HTTP 503).\n *\n * @generated from message marketoverview.v1.GetCurrencyConversionRatesResponse\n */\nexport type GetCurrencyConversionRatesResponse = Message<\"marketoverview.v1.GetCurrencyConversionRatesResponse\"> & {\n /**\n * Complete fiat snapshot; absent until a complete snapshot has been observed.\n *\n * @generated from field: marketoverview.v1.FiatConversionSnapshot fiat = 1;\n */\n fiat?: FiatConversionSnapshot | undefined;\n\n /**\n * Observed stablecoin rates ordered by code. Unobserved stablecoins are omitted.\n *\n * @generated from field: repeated marketoverview.v1.StablecoinConversionRate stablecoins = 2;\n */\n stablecoins: StablecoinConversionRate[];\n\n /**\n * Response construction time in seconds since the Unix epoch (UTC).\n *\n * @generated from field: uint64 snapshot_ts_sec = 3;\n */\n snapshotTsSec: bigint;\n};\n\n/**\n * Describes the message marketoverview.v1.GetCurrencyConversionRatesResponse.\n * Use `create(GetCurrencyConversionRatesResponseSchema)` to create a new message.\n */\nexport const GetCurrencyConversionRatesResponseSchema: GenMessage<GetCurrencyConversionRatesResponse> = /*@__PURE__*/\n messageDesc(file_marketoverview_v1_marketoverview, 16);\n\n/**\n * SparklineInterval identifies the time range and sampling resolution for a\n * sparkline.\n *\n * @generated from enum marketoverview.v1.SparklineInterval\n */\nexport enum SparklineInterval {\n /**\n * Unspecified interval. When requested, server may default to 24H.\n *\n * @generated from enum value: SPARKLINE_INTERVAL_UNSPECIFIED = 0;\n */\n SPARKLINE_INTERVAL_UNSPECIFIED = 0,\n\n /**\n * 1 hour sparkline. Typically returns up to 60 points (1-minute buckets).\n *\n * @generated from enum value: SPARKLINE_1H = 1;\n */\n SPARKLINE_1H = 1,\n\n /**\n * 24 hour sparkline. Typically returns up to 96 points (15-minute buckets).\n *\n * @generated from enum value: SPARKLINE_24H = 2;\n */\n SPARKLINE_24H = 2,\n\n /**\n * 1 week sparkline. Typically returns up to 168 points (1-hour buckets).\n *\n * @generated from enum value: SPARKLINE_1W = 3;\n */\n SPARKLINE_1W = 3,\n\n /**\n * 1 month sparkline. Typically returns up to 180 points (4-hour buckets).\n *\n * @generated from enum value: SPARKLINE_1M = 4;\n */\n SPARKLINE_1M = 4,\n}\n\n/**\n * Describes the enum marketoverview.v1.SparklineInterval.\n */\nexport const SparklineIntervalSchema: GenEnum<SparklineInterval> = /*@__PURE__*/\n enumDesc(file_marketoverview_v1_marketoverview, 0);\n\n/**\n * @generated from enum marketoverview.v1.MarketOrderBy\n */\nexport enum MarketOrderBy {\n /**\n * @generated from enum value: MARKET_ORDER_BY_UNSPECIFIED = 0;\n */\n MARKET_ORDER_BY_UNSPECIFIED = 0,\n\n /**\n * Sort by absolute 24h change (basis points).\n *\n * @generated from enum value: ORDER_BY_CHANGE_24H_BPS = 1;\n */\n ORDER_BY_CHANGE_24H_BPS = 1,\n\n /**\n * Sort by canonical USD 24h volume. Unvalued markets sort last in either direction.\n *\n * @generated from enum value: ORDER_BY_VOLUME_24H_USD = 2;\n */\n ORDER_BY_VOLUME_24H_USD = 2,\n\n /**\n * Sort by last price in quote units scaled by 1e6.\n *\n * @generated from enum value: ORDER_BY_LAST_PRICE = 3;\n */\n ORDER_BY_LAST_PRICE = 3,\n\n /**\n * Sort by listing time (new listings first).\n *\n * @generated from enum value: ORDER_BY_DATE_ADDED = 4;\n */\n ORDER_BY_DATE_ADDED = 4,\n}\n\n/**\n * Describes the enum marketoverview.v1.MarketOrderBy.\n */\nexport const MarketOrderBySchema: GenEnum<MarketOrderBy> = /*@__PURE__*/\n enumDesc(file_marketoverview_v1_marketoverview, 1);\n\n/**\n * @generated from enum marketoverview.v1.SortDirection\n */\nexport enum SortDirection {\n /**\n * @generated from enum value: SORT_DIRECTION_UNSPECIFIED = 0;\n */\n SORT_DIRECTION_UNSPECIFIED = 0,\n\n /**\n * Ascending (oldest/lowest first).\n *\n * @generated from enum value: SORT_ASC = 1;\n */\n SORT_ASC = 1,\n\n /**\n * Descending (newest/highest first).\n *\n * @generated from enum value: SORT_DESC = 2;\n */\n SORT_DESC = 2,\n}\n\n/**\n * Describes the enum marketoverview.v1.SortDirection.\n */\nexport const SortDirectionSchema: GenEnum<SortDirection> = /*@__PURE__*/\n enumDesc(file_marketoverview_v1_marketoverview, 2);\n\n/**\n * ErrorCode is a stable domain error code enum for Market Overview.\n * It is used for consistent error surfaces across ConnectRPC and REST.\n *\n * @generated from enum marketoverview.v1.ErrorCode\n */\nexport enum ErrorCode {\n /**\n * @generated from enum value: ERROR_CODE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: ERROR_CODE_BAD_REQUEST = 1;\n */\n BAD_REQUEST = 1,\n\n /**\n * @generated from enum value: ERROR_CODE_INVALID_ARGUMENT = 2;\n */\n INVALID_ARGUMENT = 2,\n\n /**\n * @generated from enum value: ERROR_CODE_NOT_FOUND = 3;\n */\n NOT_FOUND = 3,\n\n /**\n * @generated from enum value: ERROR_CODE_UNAVAILABLE = 4;\n */\n UNAVAILABLE = 4,\n\n /**\n * @generated from enum value: ERROR_CODE_UPSTREAM_ERROR = 5;\n */\n UPSTREAM_ERROR = 5,\n}\n\n/**\n * Describes the enum marketoverview.v1.ErrorCode.\n */\nexport const ErrorCodeSchema: GenEnum<ErrorCode> = /*@__PURE__*/\n enumDesc(file_marketoverview_v1_marketoverview, 3);\n\n/**\n * List ticker-style market overview rows with optional sparklines.\n * Supports symbol filtering, sorting, and pagination controls.\n *\n * @generated from service marketoverview.v1.MarketOverviewService\n */\nexport const MarketOverviewService: GenService<{\n /**\n * Get supported fiat and stablecoin display metadata with default English names,\n * symbols, and fraction digits. Clients may localize presentation.\n *\n * @generated from rpc marketoverview.v1.MarketOverviewService.GetCurrencyConversionConfig\n */\n getCurrencyConversionConfig: {\n methodKind: \"unary\";\n input: typeof GetCurrencyConversionConfigRequestSchema;\n output: typeof GetCurrencyConversionConfigResponseSchema;\n },\n /**\n * Get fiat units per USD and USD per stablecoin unit, grouped with source freshness.\n *\n * @generated from rpc marketoverview.v1.MarketOverviewService.GetCurrencyConversionRates\n */\n getCurrencyConversionRates: {\n methodKind: \"unary\";\n input: typeof GetCurrencyConversionRatesRequestSchema;\n output: typeof GetCurrencyConversionRatesResponseSchema;\n },\n /**\n * Get aligned pair-level and total trailing-24h USD volume, sampled every\n * 15 minutes over the latest day. Unavailable valuations fail the request.\n *\n * @generated from rpc marketoverview.v1.MarketOverviewService.GetSpotVolumeHistory\n */\n getSpotVolumeHistory: {\n methodKind: \"unary\";\n input: typeof GetSpotVolumeHistoryRequestSchema;\n output: typeof GetSpotVolumeHistoryResponseSchema;\n },\n /**\n * @generated from rpc marketoverview.v1.MarketOverviewService.ListMarketOverview\n */\n listMarketOverview: {\n methodKind: \"unary\";\n input: typeof ListMarketOverviewRequestSchema;\n output: typeof ListMarketOverviewResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_marketoverview_v1_marketoverview, 0);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,wCACX,uBAAS,oqJAAoqJ,CAAC,0BAA0B,CAAC;;;;;AAoB3sJ,MAAa,oBACX,0BAAY,uCAAuC,CAAC;;;;;AA2BtD,MAAa,kBACX,0BAAY,uCAAuC,CAAC;;;;;AAqItD,MAAa,uBACX,0BAAY,uCAAuC,CAAC;;;;;AAiEtD,MAAa,kCACX,0BAAY,uCAAuC,CAAC;;;;;AAyBtD,MAAa,mCACX,0BAAY,uCAAuC,CAAC;;;;;AA4BtD,MAAa,4BACX,0BAAY,uCAAuC,CAAC;;;;;AAsBtD,MAAa,oCACX,0BAAY,uCAAuC,CAAC;;;;;AA8BtD,MAAa,6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AAS,uCAAuC,CAAC;;;;;;;AAQnD,IAAY,YAAL,yBAAA,WAAA;;;;CAIL,UAAA,UAAA,iBAAA,KAAA;;;;CAKA,UAAA,UAAA,iBAAA,KAAA;;;;CAKA,UAAA,UAAA,sBAAA,KAAA;;;;CAKA,UAAA,UAAA,eAAA,KAAA;;;;CAKA,UAAA,UAAA,iBAAA,KAAA;;;;CAKA,UAAA,UAAA,oBAAA,KAAA;;AACF,EAAA,CAAA,CAAA;;;;AAKA,MAAa,kBACX,uBAAS,uCAAuC,CAAC;;;;;;;AAQnD,MAAa,wBA0CX,0BAAY,uCAAuC,CAAC"}
@@ -8,7 +8,7 @@ import { SubaccountChallenge } from "../subaccounts/subaccounts.schemas.js";
8
8
  import { SubaccountsService } from "../subaccounts/subaccounts.js";
9
9
  import "../subaccounts/index.js";
10
10
  import { AuthTokenStorage } from "./token-storage.js";
11
- import { AuthHydrationData, AuthLoginMethod, AuthState } from "./session.types.js";
11
+ import { AuthHydrationData, AuthLoginMethod, AuthState, SessionData } from "./session.types.js";
12
12
  import { AuthSessionStore } from "./session.js";
13
13
  import { EventEmitter } from "../../utils/event-emitter.js";
14
14
  //#region src/services/auth/account-signer-auth.d.ts
@@ -34,7 +34,7 @@ interface LoginOptions {
34
34
  /**
35
35
  * The wallet provider to use for login.
36
36
  */
37
- provider: "metamask" | "turnkey" | "other";
37
+ provider: SessionData["provider"];
38
38
  /** Browser origin requesting the signature; defaults to location.origin in browsers. Required outside browsers. */
39
39
  uri?: string;
40
40
  loginMethod?: AuthLoginMethod | null;
@@ -114,7 +114,7 @@ declare class AccountSignerAuthService extends AuthService {
114
114
  refreshSession(params?: {
115
115
  /** Overrides the origin remembered from login. */
116
116
  uri?: string;
117
- provider?: "metamask" | "turnkey" | "other";
117
+ provider?: SessionData["provider"];
118
118
  loginMethod?: AuthLoginMethod | null;
119
119
  }): Promise<LoginResult>;
120
120
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"account-signer-auth.d.ts","names":[],"sources":["../../../src/services/auth/account-signer-auth.ts"],"mappings":";;;;;;;;;;;;;;UAyBiB;EACb;IAAiB;IAAmB;;EACpC;EACA;IAAS;IAAc;;EACvB;EACA,aAAa;;UAGA;EACb;EACA;EACA,WAAW;;UAGE;;;;EAIb;;EAEA;EACA,cAAc;;UAGD;;;;;;EAMb,eACM,kBACE,WAAW,wBAAwB,gBAAgB,QAAQ;;EAEnE;;EAEA;;EAEA,eAAe;;UAGF;EACb;EACA;EACA;;;;;cAWS,iCAAiC;;WACjC,QAAM,aAAA;EAoBH,cACR,YACA,qBACA,aACA,aACA,UACA,cACA;IAEA,YAAY;IACZ,sBAAsB;IACtB,aAAa;IACb,aAAa;IACb,UAAU;IACV,cAAc;IACd,eAAe;;;;;EAmBnB,sBAAsB,aAAa;;;;EAOnC,iBAAiB,eAAe;;;;EAWhC,oBAAoB;;;;EAOd,MAAM,SAAS,eAAe,QAAQ;;;;EAyF5C,iBAAiB,OAAO;;;;EAyBlB,kBAAkB;IAAU;IAAmB;;;;;EA0E/C,UAAU;;;;EAqChB;;;;EASM,eAAe;;IAEjB;IACA;IACA,cAAc;MACd,QAAQ;;;;EAmBZ,cACI,mBACA;IAAY;IAA8B;;IACzC;IAAmB;;;EAuBxB,oBAAoB;;;;EASd,iBAAiB,QAAQ,yBAAyB,QAAQ;;;;EAyDhE,YAAY"}
1
+ {"version":3,"file":"account-signer-auth.d.ts","names":[],"sources":["../../../src/services/auth/account-signer-auth.ts"],"mappings":";;;;;;;;;;;;;;UAyBiB;EACb;IAAiB;IAAmB;;EACpC;EACA;IAAS;IAAc;;EACvB;EACA,aAAa;;UAGA;EACb;EACA;EACA,WAAW;;UAGE;;;;EAIb,UAAU;;EAEV;EACA,cAAc;;UAGD;;;;;;EAMb,eACM,kBACE,WAAW,wBAAwB,gBAAgB,QAAQ;;EAEnE;;EAEA;;EAEA,eAAe;;UAGF;EACb;EACA;EACA;;;;;cAWS,iCAAiC;;WACjC,QAAM,aAAA;EAoBH,cACR,YACA,qBACA,aACA,aACA,UACA,cACA;IAEA,YAAY;IACZ,sBAAsB;IACtB,aAAa;IACb,aAAa;IACb,UAAU;IACV,cAAc;IACd,eAAe;;;;;EAmBnB,sBAAsB,aAAa;;;;EAOnC,iBAAiB,eAAe;;;;EAWhC,oBAAoB;;;;EAOd,MAAM,SAAS,eAAe,QAAQ;;;;EAyF5C,iBAAiB,OAAO;;;;EAyBlB,kBAAkB;IAAU;IAAmB;;;;;EA0E/C,UAAU;;;;EAqChB;;;;EASM,eAAe;;IAEjB;IACA,WAAW;IACX,cAAc;MACd,QAAQ;;;;EAmBZ,cACI,mBACA;IAAY;IAA8B;;IACzC;IAAmB;;;EAuBxB,oBAAoB;;;;EASd,iBAAiB,QAAQ,yBAAyB,QAAQ;;;;EAyDhE,YAAY"}
@@ -87,7 +87,7 @@ var AccountSignerAuthService = class extends AuthService {
87
87
  });
88
88
  if (!this.#isCurrentAuthOperation(generation, startingToken)) throw new DOMException("Authentication operation superseded", "AbortError");
89
89
  const environmentSession = this.#getEnvironmentSession();
90
- const resolvedLoginMethod = loginMethod ?? this.#loginMethod ?? environmentSession?.loginMethod ?? (provider === "metamask" ? "metamask" : null);
90
+ const resolvedLoginMethod = loginMethod ?? this.#loginMethod ?? environmentSession?.loginMethod ?? (provider === "metamask" || provider === "phantom" ? provider : null);
91
91
  const tokenOptions = createAuthTokenStorageSetOptions(response.accessToken);
92
92
  const activeAccount = previousActiveAccount?.mainAccountId === response.accountId ? previousActiveAccount : void 0;
93
93
  this.#sessionStore.commitLogin({
@@ -1 +1 @@
1
- {"version":3,"file":"account-signer-auth.js","names":["#accountSignerConfig","#environmentFingerprint","#subaccounts","#tokenStorage","#realtime","#sessionStore","#assertAccountSignerEnvironment","#beginAuthOperation","#accountSigner","#accountIdentity","#identityFromSigner","#notifyStateChange","#login","#resolveAccountSigner","#challengeUri","#isCurrentAuthOperation","#getEnvironmentSession","#loginMethod","#isAuthenticated","#mainAccountId","#activeAccountId","#walletProvider","#loginResult","#getEnvironmentBoundToken","#clearExpiredSessionState","#getCurrentTokenStorageOptions","#resolveRefreshProvider","#authOperationGeneration"],"sources":["../../../src/services/auth/account-signer-auth.ts"],"sourcesContent":["import { AuthService, type LoginWithWalletResponse } from \"./auth.js\";\nimport { AuthenticationError, ConfigurationError } from \"../../shared/errors.js\";\nimport { toPolyesterError } from \"../../shared/connect-error-mapping.js\";\nimport { AuthSessionStore } from \"./session.js\";\nimport type { AccountSigner, AccountSignerConfig, HexAddress } from \"../../account-signer/types.js\";\nimport { assertAccountSigner, resolveAccountSigner } from \"../../account-signer/types.js\";\nimport { EventEmitter } from \"../../utils/event-emitter.js\";\nimport { isJwtValid, getJwtTimeToExpiry } from \"../../utils/jwt.js\";\nimport type { SubaccountChallenge, SubaccountsService } from \"../subaccounts/index.js\";\nimport type {\n AuthState,\n AuthHydrationData,\n AuthLoginMethod,\n SessionData,\n ActiveAccountInfo,\n} from \"./session.types.js\";\nimport type { PolyesterRealtime } from \"../../realtime/index.js\";\nimport type { PolyesterEnvironment } from \"../../environment.js\";\nimport type { AuthAndPublicApiTransports } from \"../../shared/transports.js\";\nimport {\n createAuthTokenStorageSetOptions,\n type AuthTokenStorage,\n type AuthTokenStorageSetOptions,\n} from \"./token-storage.js\";\n\nexport interface AccountSignerAuthEvents {\n authenticated: { accountId: string; username: string };\n loggedOut: void;\n error: { code: string; message: string };\n servicesReady: void;\n stateChange: AuthState;\n}\n\nexport interface LoginResult {\n accountId: string;\n username: string;\n expiresAt: Date;\n}\n\nexport interface LoginOptions {\n /**\n * The wallet provider to use for login.\n */\n provider: \"metamask\" | \"turnkey\" | \"other\";\n /** Browser origin requesting the signature; defaults to location.origin in browsers. Required outside browsers. */\n uri?: string;\n loginMethod?: AuthLoginMethod | null;\n}\n\nexport interface CreateSubaccountParams {\n /**\n * Signer for the new subaccount, or a factory that derives it from the server challenge\n * (for example via Turnkey with `challenge.smartAccountSaltNonce`). Its accountAddress must\n * equal `challenge.smartAccountAddress`.\n */\n accountSigner:\n | AccountSigner\n | ((challenge: SubaccountChallenge) => AccountSigner | Promise<AccountSigner>);\n /** Optional human-readable label for this subaccount */\n label?: string;\n /** Browser origin requesting the signature; defaults to location.origin in browsers. Required outside browsers. */\n uri?: string;\n /** Root owner EOA bound to the authenticated account; defaults to the configured signer's owner. */\n ownerAddress?: HexAddress;\n}\n\nexport interface CreateSubaccountResult {\n subaccountId: string;\n smartAccountSaltNonce: number;\n revision: string;\n}\n\ninterface AccountIdentity {\n accountAddress: HexAddress;\n ownerAddress?: HexAddress;\n}\n\n/**\n * Coordinates wallet/account-signer authentication, session storage, subaccount selection, and session refresh.\n */\nexport class AccountSignerAuthService extends AuthService {\n readonly events = new EventEmitter<AccountSignerAuthEvents>();\n\n #accountSignerConfig: AccountSignerConfig | undefined;\n #accountSigner: AccountSigner | null = null;\n #accountIdentity: AccountIdentity | null = null;\n #isAuthenticated = false;\n #mainAccountId: string | null = null;\n #activeAccountId: string | null = null;\n #subaccounts: SubaccountsService;\n #walletProvider: \"metamask\" | \"turnkey\" | \"other\" | undefined = undefined;\n #loginMethod: AuthLoginMethod | null = null;\n #challengeUri: string | undefined = undefined;\n #environmentFingerprint: string;\n #tokenStorage: AuthTokenStorage;\n #sessionStore: AuthSessionStore;\n #realtime: PolyesterRealtime;\n // Every asynchronous auth transition captures this generation. A later login,\n // logout, signer change, or restore makes older work observational only.\n #authOperationGeneration = 0;\n\n constructor({\n transports,\n accountSignerConfig,\n environment,\n subaccounts,\n realtime,\n tokenStorage,\n sessionStore,\n }: {\n transports: AuthAndPublicApiTransports;\n accountSignerConfig?: AccountSignerConfig;\n environment: PolyesterEnvironment;\n subaccounts: SubaccountsService;\n realtime: PolyesterRealtime;\n tokenStorage: AuthTokenStorage;\n sessionStore?: AuthSessionStore;\n }) {\n super(transports, realtime);\n\n this.#accountSignerConfig = accountSignerConfig;\n this.#environmentFingerprint = environment.fingerprint;\n this.#subaccounts = subaccounts;\n this.#tokenStorage = tokenStorage;\n this.#realtime = realtime;\n this.#sessionStore =\n sessionStore ??\n new AuthSessionStore({\n environmentFingerprint: environment.fingerprint,\n });\n }\n\n /**\n * Attaches the subaccounts service used when creating a subaccount during authenticated flows.\n */\n setSubaccountsService(subaccounts: SubaccountsService): void {\n this.#subaccounts = subaccounts;\n }\n\n /**\n * Sets the account signer used to sign login and account-switch challenges.\n */\n setAccountSigner(accountSigner: AccountSigner | null): void {\n if (accountSigner) this.#assertAccountSignerEnvironment(accountSigner);\n this.#beginAuthOperation();\n this.#accountSigner = accountSigner;\n this.#accountIdentity = accountSigner ? this.#identityFromSigner(accountSigner) : null;\n this.#notifyStateChange();\n }\n\n /**\n * Returns the active account signer, throwing if one has not been configured.\n */\n getAccountSigner(): AccountSigner | null {\n return this.#accountSigner;\n }\n\n /**\n * Signs a server-issued SIWE message with the configured account signer, exchanges it for a session token, and stores the hydrated account/subaccount session state.\n */\n async login(options: LoginOptions): Promise<LoginResult> {\n return this.#login(options);\n }\n\n async #login(\n options: LoginOptions,\n previousActiveAccount?: ActiveAccountInfo,\n ): Promise<LoginResult> {\n const generation = this.#beginAuthOperation();\n const startingToken = this.#tokenStorage.get();\n const { provider, loginMethod } = options;\n\n const accountSigner = await this.#resolveAccountSigner();\n\n if (!accountSigner) {\n throw new ConfigurationError(\n \"No account signer configured. Call setAccountSigner() or pass accountSigner in config.\",\n );\n }\n\n const smartAccountAddress = accountSigner.accountAddress;\n const ownerAddress = accountSigner.ownerAddress ?? accountSigner.accountAddress;\n\n const uri = resolveChallengeUri(options.uri ?? this.#challengeUri);\n const { message } = await this.createWalletChallenge({\n smartAccountAddress,\n signerAddress: ownerAddress,\n uri,\n });\n const signature = await accountSigner.signMessage(message);\n\n const response = await this.loginWithWallet({\n smartAccountAddress,\n message,\n signature,\n walletProvider: provider,\n });\n\n if (!this.#isCurrentAuthOperation(generation, startingToken)) {\n throw new DOMException(\"Authentication operation superseded\", \"AbortError\");\n }\n const environmentSession = this.#getEnvironmentSession();\n const resolvedLoginMethod =\n loginMethod ??\n this.#loginMethod ??\n environmentSession?.loginMethod ??\n (provider === \"metamask\" ? \"metamask\" : null);\n\n const tokenOptions = createAuthTokenStorageSetOptions(response.accessToken);\n const activeAccount =\n previousActiveAccount?.mainAccountId === response.accountId\n ? previousActiveAccount\n : undefined;\n this.#sessionStore.commitLogin(\n {\n accessToken: response.accessToken,\n tokenOptions,\n provider,\n loginMethod: resolvedLoginMethod,\n primaryWallet: ownerAddress,\n smartAccount: smartAccountAddress,\n accountId: response.accountId,\n activeAccount,\n username: response.username ?? undefined,\n },\n this.#tokenStorage,\n );\n this.#isAuthenticated = true;\n this.#mainAccountId = response.accountId;\n this.#activeAccountId = activeAccount?.accountId ?? response.accountId;\n this.#walletProvider = provider;\n this.#loginMethod = resolvedLoginMethod;\n this.#challengeUri = uri;\n this.#accountSigner = accountSigner;\n this.#accountIdentity = this.#identityFromSigner(accountSigner);\n\n this.#notifyStateChange();\n\n this.events.emit(\"authenticated\", {\n accountId: response.accountId,\n username: response.username,\n });\n\n return this.#loginResult(response);\n }\n\n /**\n * Builds auth state from a session token and optional active account override.\n */\n hydrateAuthState(state: AuthHydrationData): void {\n this.#beginAuthOperation();\n const existingToken = this.#getEnvironmentBoundToken();\n if (!existingToken || !isJwtValid(existingToken)) return;\n\n const existingSession = this.#getEnvironmentSession();\n this.#walletProvider = existingSession?.provider ?? this.#walletProvider;\n this.#loginMethod = existingSession?.loginMethod ?? this.#loginMethod;\n\n this.#isAuthenticated = true;\n this.#mainAccountId = state.mainAccountId;\n this.#activeAccountId = state.activeAccountId ?? state.mainAccountId;\n this.#accountIdentity = state.smartAccountAddress\n ? {\n accountAddress: state.smartAccountAddress,\n ownerAddress: state.ownerAddress,\n }\n : null;\n\n this.#notifyStateChange();\n }\n\n /**\n * Loads the stored token, validates that it still belongs to this environment, and restores auth state when possible.\n */\n async restoreSession(): Promise<{ accountId: string; username: string } | null> {\n const generation = this.#beginAuthOperation();\n const existingToken = this.#getEnvironmentBoundToken();\n\n if (!existingToken || !isJwtValid(existingToken)) {\n if (this.#isCurrentAuthOperation(generation)) this.#clearExpiredSessionState();\n return null;\n }\n\n let me: Awaited<ReturnType<AuthService[\"me\"]>>;\n try {\n me = await this.me();\n } catch (error) {\n if (!this.#isCurrentAuthOperation(generation, existingToken)) return null;\n const mappedError = toPolyesterError(error);\n if (mappedError instanceof AuthenticationError) {\n this.#clearExpiredSessionState();\n return null;\n }\n throw mappedError;\n }\n if (!this.#isCurrentAuthOperation(generation, existingToken)) return null;\n\n let accountSigner = this.#accountSigner;\n if (!accountSigner) {\n try {\n accountSigner = await resolveAccountSigner(this.#accountSignerConfig);\n } catch (error) {\n if (!this.#isCurrentAuthOperation(generation, existingToken)) return null;\n throw error;\n }\n if (!this.#isCurrentAuthOperation(generation, existingToken)) return null;\n if (accountSigner) this.#assertAccountSignerEnvironment(accountSigner);\n }\n\n if (!isJwtValid(existingToken) || this.#getEnvironmentBoundToken() !== existingToken) {\n this.#clearExpiredSessionState();\n return null;\n }\n\n const existingSession = this.#getEnvironmentSession();\n const walletProvider = existingSession?.provider ?? this.#walletProvider;\n const loginMethod = existingSession?.loginMethod ?? this.#loginMethod;\n const activeAccountId =\n this.#activeAccountId ?? existingSession?.activeAccount?.accountId ?? me.accountId;\n\n // Publish runtime state only after asynchronous restoration has completed.\n if (accountSigner) {\n this.#sessionStore.ensureSession(\n {\n provider: walletProvider ?? \"other\",\n loginMethod: loginMethod ?? (walletProvider === \"metamask\" ? \"metamask\" : null),\n primaryWallet: accountSigner.ownerAddress ?? accountSigner.accountAddress,\n smartAccount: accountSigner.accountAddress,\n accountId: me.accountId,\n username: me.username ?? undefined,\n },\n { maxAgeSeconds: this.#getCurrentTokenStorageOptions().maxAgeSeconds },\n );\n this.#accountSigner = accountSigner;\n this.#accountIdentity = this.#identityFromSigner(accountSigner);\n }\n this.#isAuthenticated = true;\n this.#mainAccountId = me.accountId;\n this.#activeAccountId = activeAccountId;\n this.#walletProvider = walletProvider ?? (accountSigner ? \"other\" : undefined);\n this.#loginMethod = loginMethod;\n this.#notifyStateChange();\n return { accountId: me.accountId, username: me.username };\n }\n\n /**\n * Clears stored auth state and removes the persisted auth token.\n */\n async logout(): Promise<void> {\n this.#beginAuthOperation();\n this.#realtime.disconnectPrivate();\n this.#tokenStorage.clear();\n this.#isAuthenticated = false;\n this.#mainAccountId = null;\n this.#activeAccountId = null;\n this.#loginMethod = null;\n this.#challengeUri = undefined;\n this.#accountIdentity = null;\n\n this.#sessionStore.clear();\n\n this.#notifyStateChange();\n this.events.emit(\"loggedOut\", undefined);\n }\n\n #clearExpiredSessionState(): void {\n const shouldEmitLoggedOut = this.#isAuthenticated;\n this.#realtime.disconnectPrivate();\n this.#tokenStorage.clear();\n this.#sessionStore.clear();\n this.#isAuthenticated = false;\n this.#mainAccountId = null;\n this.#activeAccountId = null;\n this.#loginMethod = null;\n this.#challengeUri = undefined;\n this.#accountIdentity = null;\n this.#notifyStateChange();\n if (shouldEmitLoggedOut) {\n this.events.emit(\"loggedOut\", undefined);\n }\n }\n\n /**\n * Returns the remaining lifetime of the stored session token in milliseconds.\n */\n getSessionTimeToExpiry(): number {\n const token = this.#getEnvironmentBoundToken();\n if (!token || !isJwtValid(token)) return 0;\n return getJwtTimeToExpiry(token);\n }\n\n /**\n * Refreshes the active account-signer session and updates persisted auth state.\n */\n async refreshSession(params?: {\n /** Overrides the origin remembered from login. */\n uri?: string;\n provider?: \"metamask\" | \"turnkey\" | \"other\";\n loginMethod?: AuthLoginMethod | null;\n }): Promise<LoginResult> {\n if (!this.#isAuthenticated) {\n throw new AuthenticationError(\"Must be authenticated to refresh session\");\n }\n\n const currentSession = this.#getEnvironmentSession();\n return this.#login(\n {\n provider: this.#resolveRefreshProvider(params?.provider),\n uri: params?.uri,\n loginMethod: params?.loginMethod ?? this.#loginMethod,\n },\n currentSession?.activeAccount,\n );\n }\n\n /**\n * Switches the active account/subaccount by signing the required account switch flow.\n */\n switchAccount(\n accountId: string,\n options?: { smartAccountAddress?: string; label?: string },\n ): { accountId: string; isMain: boolean } {\n if (!this.#isAuthenticated || !this.#mainAccountId) {\n throw new AuthenticationError(\"Must be authenticated to switch accounts\");\n }\n\n this.#activeAccountId = accountId;\n const isMain = accountId === this.#mainAccountId;\n\n this.#sessionStore.setActiveAccount(\n {\n accountId,\n isMain,\n smartAccountAddress: options?.smartAccountAddress,\n label: options?.label,\n },\n { maxAgeSeconds: this.#getCurrentTokenStorageOptions().maxAgeSeconds },\n );\n this.#notifyStateChange();\n\n return { accountId, isMain };\n }\n\n /** Keeps the display-session identity current for the next server render. */\n syncSessionUsername(username: string | null): void {\n this.#sessionStore.setUsername(username, {\n maxAgeSeconds: this.#getCurrentTokenStorageOptions().maxAgeSeconds,\n });\n }\n\n /**\n * Creates a subaccount for the authenticated account and makes it available to the session state.\n */\n async createSubaccount(params: CreateSubaccountParams): Promise<CreateSubaccountResult> {\n if (!this.#isAuthenticated) {\n throw new AuthenticationError(\"Must be authenticated to create subaccounts\");\n }\n\n if (!this.#subaccounts) {\n throw new ConfigurationError(\n \"SubaccountsService not configured. Pass it to constructor or call setSubaccountsService().\",\n );\n }\n\n const identity = this.#accountSigner ?? this.#accountIdentity;\n const ownerAddress =\n params.ownerAddress ?? identity?.ownerAddress ?? identity?.accountAddress;\n if (!ownerAddress) {\n throw new ConfigurationError(\n \"No root owner address available. Pass ownerAddress or configure an account signer.\",\n );\n }\n\n const { label = \"\" } = params;\n const challenge = await this.#subaccounts.createChallenge({\n ownerAddress,\n uri: resolveChallengeUri(params.uri ?? this.#challengeUri),\n });\n const accountSigner =\n typeof params.accountSigner === \"function\"\n ? await params.accountSigner(challenge)\n : params.accountSigner;\n this.#assertAccountSignerEnvironment(accountSigner);\n if (\n accountSigner.accountAddress.toLowerCase() !==\n challenge.smartAccountAddress.toLowerCase()\n ) {\n throw new ConfigurationError(\n `Subaccount signer address ${accountSigner.accountAddress} does not match the server-derived smart account ${challenge.smartAccountAddress}.`,\n );\n }\n const signature = await accountSigner.signMessage(challenge.message);\n\n const response = await this.#subaccounts.create({\n label,\n smartAccountAddress: challenge.smartAccountAddress,\n message: challenge.message,\n signature,\n });\n\n return {\n subaccountId: response.subaccountId,\n smartAccountSaltNonce: response.smartAccountSaltNonce,\n revision: response.revision,\n };\n }\n\n /**\n * Returns the current account-signer auth state snapshot.\n */\n getState(): AuthState {\n const accountIdentity = this.#accountSigner ?? this.#accountIdentity;\n\n return {\n isAuthenticated: this.#isAuthenticated,\n accountAddress: accountIdentity?.accountAddress ?? null,\n ownerAddress: accountIdentity?.ownerAddress ?? null,\n mainAccountId: this.#mainAccountId,\n activeAccount:\n this.#activeAccountId && this.#mainAccountId\n ? {\n accountId: this.#activeAccountId,\n isMain: this.#activeAccountId === this.#mainAccountId,\n mainAccountId: this.#mainAccountId,\n smartAccountAddress: accountIdentity?.accountAddress,\n }\n : null,\n };\n }\n\n async #resolveAccountSigner(): Promise<AccountSigner | null> {\n if (this.#accountSigner) {\n this.#assertAccountSignerEnvironment(this.#accountSigner);\n return this.#accountSigner;\n }\n\n const resolved = await resolveAccountSigner(this.#accountSignerConfig);\n if (resolved) {\n this.#assertAccountSignerEnvironment(resolved);\n }\n return resolved;\n }\n\n #notifyStateChange(): void {\n this.events.emit(\"stateChange\", this.getState());\n }\n\n #beginAuthOperation(): number {\n this.#authOperationGeneration += 1;\n return this.#authOperationGeneration;\n }\n\n #isCurrentAuthOperation(generation: number, token?: string | null): boolean {\n return (\n generation === this.#authOperationGeneration &&\n (token === undefined || this.#tokenStorage.get() === token)\n );\n }\n\n #loginResult(response: LoginWithWalletResponse): LoginResult {\n const expiresAt = response.expiresAt\n ? new Date(\n Number(response.expiresAt.seconds) * 1000 +\n (response.expiresAt.nanos ?? 0) / 1_000_000,\n )\n : new Date();\n return { accountId: response.accountId, username: response.username, expiresAt };\n }\n\n #getEnvironmentBoundToken(): string | null {\n return this.#sessionStore.getEnvironmentBoundToken(this.#tokenStorage);\n }\n\n #getCurrentTokenStorageOptions(): AuthTokenStorageSetOptions {\n const token = this.#tokenStorage.get();\n if (!token) return { expiresAt: null, maxAgeSeconds: null };\n return createAuthTokenStorageSetOptions(token);\n }\n\n #resolveRefreshProvider(\n provider?: \"metamask\" | \"turnkey\" | \"other\",\n ): \"metamask\" | \"turnkey\" | \"other\" {\n return (\n provider ?? this.#walletProvider ?? this.#getEnvironmentSession()?.provider ?? \"other\"\n );\n }\n\n #assertAccountSignerEnvironment(accountSigner: AccountSigner): void {\n assertAccountSigner(accountSigner);\n if (accountSigner.environmentFingerprint !== this.#environmentFingerprint) {\n throw new ConfigurationError(\n \"Account signer environment does not match client environment.\",\n );\n }\n }\n\n #identityFromSigner(accountSigner: AccountSigner): AccountIdentity {\n return {\n accountAddress: accountSigner.accountAddress,\n ownerAddress: accountSigner.ownerAddress,\n };\n }\n\n #getEnvironmentSession(): SessionData | null {\n return this.#sessionStore.get();\n }\n}\n\nfunction resolveChallengeUri(uri: string | undefined): string {\n const resolved = uri ?? (typeof location === \"undefined\" ? undefined : location.origin);\n if (!resolved)\n throw new ConfigurationError(\n \"Wallet authentication requires a browser origin URI. Pass uri outside a browser.\",\n );\n return resolved;\n}\n"],"mappings":";;;;;;;;;;;;AAgFA,IAAa,2BAAb,cAA8C,YAAY;CACtD,SAAkB,IAAI,aAAsC;CAE5D;CACA,iBAAuC;CACvC,mBAA2C;CAC3C,mBAAmB;CACnB,iBAAgC;CAChC,mBAAkC;CAClC;CACA,kBAAgE,KAAA;CAChE,eAAuC;CACvC,gBAAoC,KAAA;CACpC;CACA;CACA;CACA;CAGA,2BAA2B;CAE3B,YAAY,EACR,YACA,qBACA,aACA,aACA,UACA,cACA,gBASD;EACC,MAAM,YAAY,QAAQ;EAE1B,KAAKA,uBAAuB;EAC5B,KAAKC,0BAA0B,YAAY;EAC3C,KAAKC,eAAe;EACpB,KAAKC,gBAAgB;EACrB,KAAKC,YAAY;EACjB,KAAKC,gBACD,gBACA,IAAI,iBAAiB,EACjB,wBAAwB,YAAY,YACxC,CAAC;CACT;;;;CAKA,sBAAsB,aAAuC;EAC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ACzD,MAAM,QAAQ,KAAKA,cAAc,IAAI;EACrC,IAAI,CAAC,OAAO,OAAO;GAAE,WAAW;GAAM,eAAe;EAAK;EAC1D,OAAO,iCAAiC,KAAK;CACjD;CAEA,wBACI,UACgC;EAChC,OACI,YAAY,KAAKkB,mBAAmB,KAAKL,uBAAuB,CAAC,EAAE,YAAY;CAEvF;CAEA,gCAAgC,eAAoC;EAChE,oBAAoB,aAAa;EACjC,IAAI,cAAc,2BAA2B,KAAKf,yBAC9C,MAAM,IAAI,mBACN,+DACJ;CAER;CAEA,oBAAoB,eAA+C;EAC/D,OAAO;GACH,gBAAgB,cAAc;GAC9B,cAAc,cAAc;EAChC;CACJ;CAEA,yBAA6C;EACzC,OAAO,KAAKI,cAAc,IAAI;CAClC;AACJ;AAEA,SAAS,oBAAoB,KAAiC;CAC1D,MAAM,WAAW,QAAQ,OAAO,aAAa,cAAc,KAAA,IAAY,SAAS;CAChF,IAAI,CAAC,UACD,MAAM,IAAI,mBACN,kFACJ;CACJ,OAAO;AACX"}
1
+ {"version":3,"file":"account-signer-auth.js","names":["#accountSignerConfig","#environmentFingerprint","#subaccounts","#tokenStorage","#realtime","#sessionStore","#assertAccountSignerEnvironment","#beginAuthOperation","#accountSigner","#accountIdentity","#identityFromSigner","#notifyStateChange","#login","#resolveAccountSigner","#challengeUri","#isCurrentAuthOperation","#getEnvironmentSession","#loginMethod","#isAuthenticated","#mainAccountId","#activeAccountId","#walletProvider","#loginResult","#getEnvironmentBoundToken","#clearExpiredSessionState","#getCurrentTokenStorageOptions","#resolveRefreshProvider","#authOperationGeneration"],"sources":["../../../src/services/auth/account-signer-auth.ts"],"sourcesContent":["import { AuthService, type LoginWithWalletResponse } from \"./auth.js\";\nimport { AuthenticationError, ConfigurationError } from \"../../shared/errors.js\";\nimport { toPolyesterError } from \"../../shared/connect-error-mapping.js\";\nimport { AuthSessionStore } from \"./session.js\";\nimport type { AccountSigner, AccountSignerConfig, HexAddress } from \"../../account-signer/types.js\";\nimport { assertAccountSigner, resolveAccountSigner } from \"../../account-signer/types.js\";\nimport { EventEmitter } from \"../../utils/event-emitter.js\";\nimport { isJwtValid, getJwtTimeToExpiry } from \"../../utils/jwt.js\";\nimport type { SubaccountChallenge, SubaccountsService } from \"../subaccounts/index.js\";\nimport type {\n AuthState,\n AuthHydrationData,\n AuthLoginMethod,\n SessionData,\n ActiveAccountInfo,\n} from \"./session.types.js\";\nimport type { PolyesterRealtime } from \"../../realtime/index.js\";\nimport type { PolyesterEnvironment } from \"../../environment.js\";\nimport type { AuthAndPublicApiTransports } from \"../../shared/transports.js\";\nimport {\n createAuthTokenStorageSetOptions,\n type AuthTokenStorage,\n type AuthTokenStorageSetOptions,\n} from \"./token-storage.js\";\n\nexport interface AccountSignerAuthEvents {\n authenticated: { accountId: string; username: string };\n loggedOut: void;\n error: { code: string; message: string };\n servicesReady: void;\n stateChange: AuthState;\n}\n\nexport interface LoginResult {\n accountId: string;\n username: string;\n expiresAt: Date;\n}\n\nexport interface LoginOptions {\n /**\n * The wallet provider to use for login.\n */\n provider: SessionData[\"provider\"];\n /** Browser origin requesting the signature; defaults to location.origin in browsers. Required outside browsers. */\n uri?: string;\n loginMethod?: AuthLoginMethod | null;\n}\n\nexport interface CreateSubaccountParams {\n /**\n * Signer for the new subaccount, or a factory that derives it from the server challenge\n * (for example via Turnkey with `challenge.smartAccountSaltNonce`). Its accountAddress must\n * equal `challenge.smartAccountAddress`.\n */\n accountSigner:\n | AccountSigner\n | ((challenge: SubaccountChallenge) => AccountSigner | Promise<AccountSigner>);\n /** Optional human-readable label for this subaccount */\n label?: string;\n /** Browser origin requesting the signature; defaults to location.origin in browsers. Required outside browsers. */\n uri?: string;\n /** Root owner EOA bound to the authenticated account; defaults to the configured signer's owner. */\n ownerAddress?: HexAddress;\n}\n\nexport interface CreateSubaccountResult {\n subaccountId: string;\n smartAccountSaltNonce: number;\n revision: string;\n}\n\ninterface AccountIdentity {\n accountAddress: HexAddress;\n ownerAddress?: HexAddress;\n}\n\n/**\n * Coordinates wallet/account-signer authentication, session storage, subaccount selection, and session refresh.\n */\nexport class AccountSignerAuthService extends AuthService {\n readonly events = new EventEmitter<AccountSignerAuthEvents>();\n\n #accountSignerConfig: AccountSignerConfig | undefined;\n #accountSigner: AccountSigner | null = null;\n #accountIdentity: AccountIdentity | null = null;\n #isAuthenticated = false;\n #mainAccountId: string | null = null;\n #activeAccountId: string | null = null;\n #subaccounts: SubaccountsService;\n #walletProvider: SessionData[\"provider\"] | undefined = undefined;\n #loginMethod: AuthLoginMethod | null = null;\n #challengeUri: string | undefined = undefined;\n #environmentFingerprint: string;\n #tokenStorage: AuthTokenStorage;\n #sessionStore: AuthSessionStore;\n #realtime: PolyesterRealtime;\n // Every asynchronous auth transition captures this generation. A later login,\n // logout, signer change, or restore makes older work observational only.\n #authOperationGeneration = 0;\n\n constructor({\n transports,\n accountSignerConfig,\n environment,\n subaccounts,\n realtime,\n tokenStorage,\n sessionStore,\n }: {\n transports: AuthAndPublicApiTransports;\n accountSignerConfig?: AccountSignerConfig;\n environment: PolyesterEnvironment;\n subaccounts: SubaccountsService;\n realtime: PolyesterRealtime;\n tokenStorage: AuthTokenStorage;\n sessionStore?: AuthSessionStore;\n }) {\n super(transports, realtime);\n\n this.#accountSignerConfig = accountSignerConfig;\n this.#environmentFingerprint = environment.fingerprint;\n this.#subaccounts = subaccounts;\n this.#tokenStorage = tokenStorage;\n this.#realtime = realtime;\n this.#sessionStore =\n sessionStore ??\n new AuthSessionStore({\n environmentFingerprint: environment.fingerprint,\n });\n }\n\n /**\n * Attaches the subaccounts service used when creating a subaccount during authenticated flows.\n */\n setSubaccountsService(subaccounts: SubaccountsService): void {\n this.#subaccounts = subaccounts;\n }\n\n /**\n * Sets the account signer used to sign login and account-switch challenges.\n */\n setAccountSigner(accountSigner: AccountSigner | null): void {\n if (accountSigner) this.#assertAccountSignerEnvironment(accountSigner);\n this.#beginAuthOperation();\n this.#accountSigner = accountSigner;\n this.#accountIdentity = accountSigner ? this.#identityFromSigner(accountSigner) : null;\n this.#notifyStateChange();\n }\n\n /**\n * Returns the active account signer, throwing if one has not been configured.\n */\n getAccountSigner(): AccountSigner | null {\n return this.#accountSigner;\n }\n\n /**\n * Signs a server-issued SIWE message with the configured account signer, exchanges it for a session token, and stores the hydrated account/subaccount session state.\n */\n async login(options: LoginOptions): Promise<LoginResult> {\n return this.#login(options);\n }\n\n async #login(\n options: LoginOptions,\n previousActiveAccount?: ActiveAccountInfo,\n ): Promise<LoginResult> {\n const generation = this.#beginAuthOperation();\n const startingToken = this.#tokenStorage.get();\n const { provider, loginMethod } = options;\n\n const accountSigner = await this.#resolveAccountSigner();\n\n if (!accountSigner) {\n throw new ConfigurationError(\n \"No account signer configured. Call setAccountSigner() or pass accountSigner in config.\",\n );\n }\n\n const smartAccountAddress = accountSigner.accountAddress;\n const ownerAddress = accountSigner.ownerAddress ?? accountSigner.accountAddress;\n\n const uri = resolveChallengeUri(options.uri ?? this.#challengeUri);\n const { message } = await this.createWalletChallenge({\n smartAccountAddress,\n signerAddress: ownerAddress,\n uri,\n });\n const signature = await accountSigner.signMessage(message);\n\n const response = await this.loginWithWallet({\n smartAccountAddress,\n message,\n signature,\n walletProvider: provider,\n });\n\n if (!this.#isCurrentAuthOperation(generation, startingToken)) {\n throw new DOMException(\"Authentication operation superseded\", \"AbortError\");\n }\n const environmentSession = this.#getEnvironmentSession();\n const resolvedLoginMethod =\n loginMethod ??\n this.#loginMethod ??\n environmentSession?.loginMethod ??\n (provider === \"metamask\" || provider === \"phantom\" ? provider : null);\n\n const tokenOptions = createAuthTokenStorageSetOptions(response.accessToken);\n const activeAccount =\n previousActiveAccount?.mainAccountId === response.accountId\n ? previousActiveAccount\n : undefined;\n this.#sessionStore.commitLogin(\n {\n accessToken: response.accessToken,\n tokenOptions,\n provider,\n loginMethod: resolvedLoginMethod,\n primaryWallet: ownerAddress,\n smartAccount: smartAccountAddress,\n accountId: response.accountId,\n activeAccount,\n username: response.username ?? undefined,\n },\n this.#tokenStorage,\n );\n this.#isAuthenticated = true;\n this.#mainAccountId = response.accountId;\n this.#activeAccountId = activeAccount?.accountId ?? response.accountId;\n this.#walletProvider = provider;\n this.#loginMethod = resolvedLoginMethod;\n this.#challengeUri = uri;\n this.#accountSigner = accountSigner;\n this.#accountIdentity = this.#identityFromSigner(accountSigner);\n\n this.#notifyStateChange();\n\n this.events.emit(\"authenticated\", {\n accountId: response.accountId,\n username: response.username,\n });\n\n return this.#loginResult(response);\n }\n\n /**\n * Builds auth state from a session token and optional active account override.\n */\n hydrateAuthState(state: AuthHydrationData): void {\n this.#beginAuthOperation();\n const existingToken = this.#getEnvironmentBoundToken();\n if (!existingToken || !isJwtValid(existingToken)) return;\n\n const existingSession = this.#getEnvironmentSession();\n this.#walletProvider = existingSession?.provider ?? this.#walletProvider;\n this.#loginMethod = existingSession?.loginMethod ?? this.#loginMethod;\n\n this.#isAuthenticated = true;\n this.#mainAccountId = state.mainAccountId;\n this.#activeAccountId = state.activeAccountId ?? state.mainAccountId;\n this.#accountIdentity = state.smartAccountAddress\n ? {\n accountAddress: state.smartAccountAddress,\n ownerAddress: state.ownerAddress,\n }\n : null;\n\n this.#notifyStateChange();\n }\n\n /**\n * Loads the stored token, validates that it still belongs to this environment, and restores auth state when possible.\n */\n async restoreSession(): Promise<{ accountId: string; username: string } | null> {\n const generation = this.#beginAuthOperation();\n const existingToken = this.#getEnvironmentBoundToken();\n\n if (!existingToken || !isJwtValid(existingToken)) {\n if (this.#isCurrentAuthOperation(generation)) this.#clearExpiredSessionState();\n return null;\n }\n\n let me: Awaited<ReturnType<AuthService[\"me\"]>>;\n try {\n me = await this.me();\n } catch (error) {\n if (!this.#isCurrentAuthOperation(generation, existingToken)) return null;\n const mappedError = toPolyesterError(error);\n if (mappedError instanceof AuthenticationError) {\n this.#clearExpiredSessionState();\n return null;\n }\n throw mappedError;\n }\n if (!this.#isCurrentAuthOperation(generation, existingToken)) return null;\n\n let accountSigner = this.#accountSigner;\n if (!accountSigner) {\n try {\n accountSigner = await resolveAccountSigner(this.#accountSignerConfig);\n } catch (error) {\n if (!this.#isCurrentAuthOperation(generation, existingToken)) return null;\n throw error;\n }\n if (!this.#isCurrentAuthOperation(generation, existingToken)) return null;\n if (accountSigner) this.#assertAccountSignerEnvironment(accountSigner);\n }\n\n if (!isJwtValid(existingToken) || this.#getEnvironmentBoundToken() !== existingToken) {\n this.#clearExpiredSessionState();\n return null;\n }\n\n const existingSession = this.#getEnvironmentSession();\n const walletProvider = existingSession?.provider ?? this.#walletProvider;\n const loginMethod = existingSession?.loginMethod ?? this.#loginMethod;\n const activeAccountId =\n this.#activeAccountId ?? existingSession?.activeAccount?.accountId ?? me.accountId;\n\n // Publish runtime state only after asynchronous restoration has completed.\n if (accountSigner) {\n this.#sessionStore.ensureSession(\n {\n provider: walletProvider ?? \"other\",\n loginMethod: loginMethod ?? (walletProvider === \"metamask\" ? \"metamask\" : null),\n primaryWallet: accountSigner.ownerAddress ?? accountSigner.accountAddress,\n smartAccount: accountSigner.accountAddress,\n accountId: me.accountId,\n username: me.username ?? undefined,\n },\n { maxAgeSeconds: this.#getCurrentTokenStorageOptions().maxAgeSeconds },\n );\n this.#accountSigner = accountSigner;\n this.#accountIdentity = this.#identityFromSigner(accountSigner);\n }\n this.#isAuthenticated = true;\n this.#mainAccountId = me.accountId;\n this.#activeAccountId = activeAccountId;\n this.#walletProvider = walletProvider ?? (accountSigner ? \"other\" : undefined);\n this.#loginMethod = loginMethod;\n this.#notifyStateChange();\n return { accountId: me.accountId, username: me.username };\n }\n\n /**\n * Clears stored auth state and removes the persisted auth token.\n */\n async logout(): Promise<void> {\n this.#beginAuthOperation();\n this.#realtime.disconnectPrivate();\n this.#tokenStorage.clear();\n this.#isAuthenticated = false;\n this.#mainAccountId = null;\n this.#activeAccountId = null;\n this.#loginMethod = null;\n this.#challengeUri = undefined;\n this.#accountIdentity = null;\n\n this.#sessionStore.clear();\n\n this.#notifyStateChange();\n this.events.emit(\"loggedOut\", undefined);\n }\n\n #clearExpiredSessionState(): void {\n const shouldEmitLoggedOut = this.#isAuthenticated;\n this.#realtime.disconnectPrivate();\n this.#tokenStorage.clear();\n this.#sessionStore.clear();\n this.#isAuthenticated = false;\n this.#mainAccountId = null;\n this.#activeAccountId = null;\n this.#loginMethod = null;\n this.#challengeUri = undefined;\n this.#accountIdentity = null;\n this.#notifyStateChange();\n if (shouldEmitLoggedOut) {\n this.events.emit(\"loggedOut\", undefined);\n }\n }\n\n /**\n * Returns the remaining lifetime of the stored session token in milliseconds.\n */\n getSessionTimeToExpiry(): number {\n const token = this.#getEnvironmentBoundToken();\n if (!token || !isJwtValid(token)) return 0;\n return getJwtTimeToExpiry(token);\n }\n\n /**\n * Refreshes the active account-signer session and updates persisted auth state.\n */\n async refreshSession(params?: {\n /** Overrides the origin remembered from login. */\n uri?: string;\n provider?: SessionData[\"provider\"];\n loginMethod?: AuthLoginMethod | null;\n }): Promise<LoginResult> {\n if (!this.#isAuthenticated) {\n throw new AuthenticationError(\"Must be authenticated to refresh session\");\n }\n\n const currentSession = this.#getEnvironmentSession();\n return this.#login(\n {\n provider: this.#resolveRefreshProvider(params?.provider),\n uri: params?.uri,\n loginMethod: params?.loginMethod ?? this.#loginMethod,\n },\n currentSession?.activeAccount,\n );\n }\n\n /**\n * Switches the active account/subaccount by signing the required account switch flow.\n */\n switchAccount(\n accountId: string,\n options?: { smartAccountAddress?: string; label?: string },\n ): { accountId: string; isMain: boolean } {\n if (!this.#isAuthenticated || !this.#mainAccountId) {\n throw new AuthenticationError(\"Must be authenticated to switch accounts\");\n }\n\n this.#activeAccountId = accountId;\n const isMain = accountId === this.#mainAccountId;\n\n this.#sessionStore.setActiveAccount(\n {\n accountId,\n isMain,\n smartAccountAddress: options?.smartAccountAddress,\n label: options?.label,\n },\n { maxAgeSeconds: this.#getCurrentTokenStorageOptions().maxAgeSeconds },\n );\n this.#notifyStateChange();\n\n return { accountId, isMain };\n }\n\n /** Keeps the display-session identity current for the next server render. */\n syncSessionUsername(username: string | null): void {\n this.#sessionStore.setUsername(username, {\n maxAgeSeconds: this.#getCurrentTokenStorageOptions().maxAgeSeconds,\n });\n }\n\n /**\n * Creates a subaccount for the authenticated account and makes it available to the session state.\n */\n async createSubaccount(params: CreateSubaccountParams): Promise<CreateSubaccountResult> {\n if (!this.#isAuthenticated) {\n throw new AuthenticationError(\"Must be authenticated to create subaccounts\");\n }\n\n if (!this.#subaccounts) {\n throw new ConfigurationError(\n \"SubaccountsService not configured. Pass it to constructor or call setSubaccountsService().\",\n );\n }\n\n const identity = this.#accountSigner ?? this.#accountIdentity;\n const ownerAddress =\n params.ownerAddress ?? identity?.ownerAddress ?? identity?.accountAddress;\n if (!ownerAddress) {\n throw new ConfigurationError(\n \"No root owner address available. Pass ownerAddress or configure an account signer.\",\n );\n }\n\n const { label = \"\" } = params;\n const challenge = await this.#subaccounts.createChallenge({\n ownerAddress,\n uri: resolveChallengeUri(params.uri ?? this.#challengeUri),\n });\n const accountSigner =\n typeof params.accountSigner === \"function\"\n ? await params.accountSigner(challenge)\n : params.accountSigner;\n this.#assertAccountSignerEnvironment(accountSigner);\n if (\n accountSigner.accountAddress.toLowerCase() !==\n challenge.smartAccountAddress.toLowerCase()\n ) {\n throw new ConfigurationError(\n `Subaccount signer address ${accountSigner.accountAddress} does not match the server-derived smart account ${challenge.smartAccountAddress}.`,\n );\n }\n const signature = await accountSigner.signMessage(challenge.message);\n\n const response = await this.#subaccounts.create({\n label,\n smartAccountAddress: challenge.smartAccountAddress,\n message: challenge.message,\n signature,\n });\n\n return {\n subaccountId: response.subaccountId,\n smartAccountSaltNonce: response.smartAccountSaltNonce,\n revision: response.revision,\n };\n }\n\n /**\n * Returns the current account-signer auth state snapshot.\n */\n getState(): AuthState {\n const accountIdentity = this.#accountSigner ?? this.#accountIdentity;\n\n return {\n isAuthenticated: this.#isAuthenticated,\n accountAddress: accountIdentity?.accountAddress ?? null,\n ownerAddress: accountIdentity?.ownerAddress ?? null,\n mainAccountId: this.#mainAccountId,\n activeAccount:\n this.#activeAccountId && this.#mainAccountId\n ? {\n accountId: this.#activeAccountId,\n isMain: this.#activeAccountId === this.#mainAccountId,\n mainAccountId: this.#mainAccountId,\n smartAccountAddress: accountIdentity?.accountAddress,\n }\n : null,\n };\n }\n\n async #resolveAccountSigner(): Promise<AccountSigner | null> {\n if (this.#accountSigner) {\n this.#assertAccountSignerEnvironment(this.#accountSigner);\n return this.#accountSigner;\n }\n\n const resolved = await resolveAccountSigner(this.#accountSignerConfig);\n if (resolved) {\n this.#assertAccountSignerEnvironment(resolved);\n }\n return resolved;\n }\n\n #notifyStateChange(): void {\n this.events.emit(\"stateChange\", this.getState());\n }\n\n #beginAuthOperation(): number {\n this.#authOperationGeneration += 1;\n return this.#authOperationGeneration;\n }\n\n #isCurrentAuthOperation(generation: number, token?: string | null): boolean {\n return (\n generation === this.#authOperationGeneration &&\n (token === undefined || this.#tokenStorage.get() === token)\n );\n }\n\n #loginResult(response: LoginWithWalletResponse): LoginResult {\n const expiresAt = response.expiresAt\n ? new Date(\n Number(response.expiresAt.seconds) * 1000 +\n (response.expiresAt.nanos ?? 0) / 1_000_000,\n )\n : new Date();\n return { accountId: response.accountId, username: response.username, expiresAt };\n }\n\n #getEnvironmentBoundToken(): string | null {\n return this.#sessionStore.getEnvironmentBoundToken(this.#tokenStorage);\n }\n\n #getCurrentTokenStorageOptions(): AuthTokenStorageSetOptions {\n const token = this.#tokenStorage.get();\n if (!token) return { expiresAt: null, maxAgeSeconds: null };\n return createAuthTokenStorageSetOptions(token);\n }\n\n #resolveRefreshProvider(provider?: SessionData[\"provider\"]): SessionData[\"provider\"] {\n return (\n provider ?? this.#walletProvider ?? this.#getEnvironmentSession()?.provider ?? \"other\"\n );\n }\n\n #assertAccountSignerEnvironment(accountSigner: AccountSigner): void {\n assertAccountSigner(accountSigner);\n if (accountSigner.environmentFingerprint !== this.#environmentFingerprint) {\n throw new ConfigurationError(\n \"Account signer environment does not match client environment.\",\n );\n }\n }\n\n #identityFromSigner(accountSigner: AccountSigner): AccountIdentity {\n return {\n accountAddress: accountSigner.accountAddress,\n ownerAddress: accountSigner.ownerAddress,\n };\n }\n\n #getEnvironmentSession(): SessionData | null {\n return this.#sessionStore.get();\n }\n}\n\nfunction resolveChallengeUri(uri: string | undefined): string {\n const resolved = uri ?? (typeof location === \"undefined\" ? undefined : location.origin);\n if (!resolved)\n throw new ConfigurationError(\n \"Wallet authentication requires a browser origin URI. Pass uri outside a browser.\",\n );\n return resolved;\n}\n"],"mappings":";;;;;;;;;;;;AAgFA,IAAa,2BAAb,cAA8C,YAAY;CACtD,SAAkB,IAAI,aAAsC;CAE5D;CACA,iBAAuC;CACvC,mBAA2C;CAC3C,mBAAmB;CACnB,iBAAgC;CAChC,mBAAkC;CAClC;CACA,kBAAuD,KAAA;CACvD,eAAuC;CACvC,gBAAoC,KAAA;CACpC;CACA;CACA;CACA;CAGA,2BAA2B;CAE3B,YAAY,EACR,YACA,qBACA,aACA,aACA,UACA,cACA,gBASD;EACC,MAAM,YAAY,QAAQ;EAE1B,KAAKA,uBAAuB;EAC5B,KAAKC,0BAA0B,YAAY;EAC3C,KAAKC,eAAe;EACpB,KAAKC,gBAAgB;EACrB,KAAKC,YAAY;EACjB,KAAKC,gBACD,gBACA,IAAI,iBAAiB,EACjB,wBAAwB,YAAY,YACxC,CAAC;CACT;;;;CAKA,sBAAsB,aAAuC;EACzD,KAAKH,eAAe;CACxB;;;;CAKA,iBAAiB,eAA2C;EACxD,IAAI,eAAe,KAAKI,gCAAgC,aAAa;EACrE,KAAKC,oBAAoB;EACzB,KAAKC,iBAAiB;EACtB,KAAKC,mBAAmB,gBAAgB,KAAKC,oBAAoB,aAAa,IAAI;EAClF,KAAKC,mBAAmB;CAC5B;;;;CAKA,mBAAyC;EACrC,OAAO,KAAKH;CAChB;;;;CAKA,MAAM,MAAM,SAA6C;EACrD,OAAO,KAAKI,OAAO,OAAO;CAC9B;CAEA,MAAMA,OACF,SACA,uBACoB;EACpB,MAAM,aAAa,KA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/D,OAAO;GACH,gBAAgB,cAAc;GAC9B,cAAc,cAAc;EAChC;CACJ;CAEA,yBAA6C;EACzC,OAAO,KAAKI,cAAc,IAAI;CAClC;AACJ;AAEA,SAAS,oBAAoB,KAAiC;CAC1D,MAAM,WAAW,QAAQ,OAAO,aAAa,cAAc,KAAA,IAAY,SAAS;CAChF,IAAI,CAAC,UACD,MAAM,IAAI,mBACN,kFACJ;CACJ,OAAO;AACX"}
@@ -90,6 +90,9 @@ declare class AuthService {
90
90
  /**
91
91
  * Requests a server-issued SIWE login message. Sign its exact UTF-8 bytes with
92
92
  * personal_sign; do not hash or reconstruct it. Expiry is epoch milliseconds.
93
+ * The backend sets SIWE Chain ID to Ethereum mainnet (1) and binds the
94
+ * Polyester chain in Resources. Do not send a chain ID or rewrite either binding.
95
+ * Wallet adapters must select Ethereum mainnet before signing if required by the wallet.
93
96
  * Subaccount creation uses `subaccounts.createChallenge` instead.
94
97
  */
95
98
  createWalletChallenge(input: CreateWalletChallengeInput, options?: PolyesterRequestOptions): Promise<WalletChallenge>;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","names":[],"sources":["../../../src/services/auth/auth.ts"],"mappings":";;;;;;;cAyBa,kCAAgC,EAAA;;;;;KAKjC,6BAA6B,EAAE,kBAAkB;cAWhD,4BAA0B,EAAA;;;;;;;;KAS3B,uBAAuB,EAAE,kBAAkB;cAEjD,UAAQ,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOF,KAAK,EAAE,mBAAmB;cAEhC,+BAA6B,EAAA;;;;;;;;;KAOvB,0BAA0B,EAAE,mBAAmB;cAErD,uBAAqB,EAAA;;;;;;;;;;KAKf,kBAAkB,EAAE,mBAAmB;;;;cAKtC;;EAGT,SAAS;EAEG,YAAA,YAAY,4BAA4B,UAAU;;;;EASxD,GAAG,UAAU,0BAA0B,QAAQ;;;;;;;EAW/C,YAAY,UAAU,2BAA2B;;;;;;EASjD,sBACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;;;YAcK,gBACZ,OAAO,sBACP,UAAU,2BACX,QAAQ"}
1
+ {"version":3,"file":"auth.d.ts","names":[],"sources":["../../../src/services/auth/auth.ts"],"mappings":";;;;;;;cAyBa,kCAAgC,EAAA;;;;;KAKjC,6BAA6B,EAAE,kBAAkB;cAWhD,4BAA0B,EAAA;;;;;;;;KAS3B,uBAAuB,EAAE,kBAAkB;cAEjD,UAAQ,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOF,KAAK,EAAE,mBAAmB;cAEhC,+BAA6B,EAAA;;;;;;;;;KAOvB,0BAA0B,EAAE,mBAAmB;cAErD,uBAAqB,EAAA;;;;;;;;;;KAKf,kBAAkB,EAAE,mBAAmB;;;;cAKtC;;EAGT,SAAS;EAEG,YAAA,YAAY,4BAA4B,UAAU;;;;EASxD,GAAG,UAAU,0BAA0B,QAAQ;;;;;;;EAW/C,YAAY,UAAU,2BAA2B;;;;;;;;;EAYjD,sBACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;;;YAcK,gBACZ,OAAO,sBACP,UAAU,2BACX,QAAQ"}
@@ -70,6 +70,9 @@ var AuthService = class {
70
70
  /**
71
71
  * Requests a server-issued SIWE login message. Sign its exact UTF-8 bytes with
72
72
  * personal_sign; do not hash or reconstruct it. Expiry is epoch milliseconds.
73
+ * The backend sets SIWE Chain ID to Ethereum mainnet (1) and binds the
74
+ * Polyester chain in Resources. Do not send a chain ID or rewrite either binding.
75
+ * Wallet adapters must select Ethereum mainnet before signing if required by the wallet.
73
76
  * Subaccount creation uses `subaccounts.createChallenge` instead.
74
77
  */
75
78
  async createWalletChallenge(input, options) {
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","names":["#publicClient","Proto.AuthService","#authClient"],"sources":["../../../src/services/auth/auth.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/auth/v1/auth_pb.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport { ProfileService } from \"./profile/profile.js\";\nimport {\n OptionalTimestampMsSchema,\n PublicIdSchema,\n TimestampSchema,\n} from \"../../shared/schemas.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { MfaSessionInfoSchema } from \"../mfa/mfa.schemas.js\";\nimport type { PolyesterRealtime } from \"../../realtime/index.js\";\nimport type { AuthAndPublicApiTransports } from \"../../shared/transports.js\";\n\nimport {\n WalletAddressSchema,\n WalletChallengeUriSchema,\n WalletChallengeMessageSchema,\n} from \"./wallet-challenge.schemas.js\";\n\nexport const CreateWalletChallengeInputSchema = v.strictObject({\n smartAccountAddress: WalletAddressSchema,\n signerAddress: WalletAddressSchema,\n uri: WalletChallengeUriSchema,\n});\nexport type CreateWalletChallengeInput = v.InferInput<typeof CreateWalletChallengeInputSchema>;\n\n/** An EIP-191 EOA signature: 65 hexadecimal bytes, with an optional 0x prefix. */\nconst LoginEoaSignatureSchema = v.pipe(\n v.string(),\n v.regex(\n /^(?:0x)?[0-9a-fA-F]{130}$/,\n \"Login signature must be a 65-byte hexadecimal EOA signature.\",\n ),\n);\n\nexport const LoginWithWalletInputSchema = v.strictObject({\n smartAccountAddress: WalletAddressSchema,\n message: WalletChallengeMessageSchema,\n signature: LoginEoaSignatureSchema,\n userAgent: v.optional(v.string(), \"\"),\n ip: v.optional(v.string(), \"\"),\n walletProvider: v.optional(v.string(), \"\"),\n});\n\nexport type LoginWithWalletInput = v.InferInput<typeof LoginWithWalletInputSchema>;\n\nconst MeSchema = v.object({\n accountId: PublicIdSchema,\n apiKeyId: v.optional(v.string()),\n username: v.string(),\n session: v.optional(MfaSessionInfoSchema),\n});\n\nexport type Me = v.InferOutput<typeof MeSchema>;\n\nconst LoginWithWalletResponseSchema = v.object({\n accessToken: v.string(),\n expiresAt: v.optional(TimestampSchema),\n accountId: PublicIdSchema,\n username: v.string(),\n});\n\nexport type LoginWithWalletResponse = v.InferOutput<typeof LoginWithWalletResponseSchema>;\n\nconst WalletChallengeSchema = v.object({\n message: WalletChallengeMessageSchema,\n expiresAt: OptionalTimestampMsSchema,\n});\n\nexport type WalletChallenge = v.InferOutput<typeof WalletChallengeSchema>;\n\n/**\n * Handles wallet-based authentication, caller introspection, and authenticated profile operations.\n */\nexport class AuthService {\n #publicClient: Client<typeof Proto.AuthService>;\n #authClient: Client<typeof Proto.AuthService>;\n profile: ProfileService;\n\n constructor(transports: AuthAndPublicApiTransports, realtime: PolyesterRealtime) {\n this.#publicClient = createClient(Proto.AuthService, transports.publicApi);\n this.#authClient = createClient(Proto.AuthService, transports.authApi);\n this.profile = new ProfileService(transports, realtime);\n }\n\n /**\n * Returns the authenticated caller's account context, including account ID, optional API key ID, username, and session assurance details from the presented token or API key.\n */\n async me(options?: PolyesterRequestOptions): Promise<Me> {\n const res = await this.#authClient.me({}, toConnectCallOptions(options));\n return parse(MeSchema, res);\n }\n\n /**\n * Records explicit consent to the current terms for the caller's root account.\n * Call only after the user consents. Requires an interactive JWT session;\n * API keys are not allowed. Repeated acceptance succeeds without changing\n * the first acceptance time. No MFA is required.\n */\n async acceptTerms(options?: PolyesterMutationOptions): Promise<void> {\n await this.#authClient.acceptTerms({}, toConnectCallOptions(options));\n }\n\n /**\n * Requests a server-issued SIWE login message. Sign its exact UTF-8 bytes with\n * personal_sign; do not hash or reconstruct it. Expiry is epoch milliseconds.\n * Subaccount creation uses `subaccounts.createChallenge` instead.\n */\n async createWalletChallenge(\n input: CreateWalletChallengeInput,\n options?: PolyesterRequestOptions,\n ): Promise<WalletChallenge> {\n const validated = parse(CreateWalletChallengeInputSchema, input);\n return parse(\n WalletChallengeSchema,\n await this.#publicClient.createWalletChallenge(\n { ...validated, purpose: Proto.WalletChallengePurpose.LOGIN },\n toConnectCallOptions(options),\n ),\n );\n }\n\n /**\n * Exchanges a signed SIWE message for an authenticated session token and account identity returned by the auth API.\n */\n protected async loginWithWallet(\n input: LoginWithWalletInput,\n options?: PolyesterMutationOptions,\n ): Promise<LoginWithWalletResponse> {\n const validatedInput = parse(LoginWithWalletInputSchema, input);\n const res = await this.#publicClient.loginWithWallet(\n validatedInput,\n toConnectCallOptions(options),\n );\n return parse(LoginWithWalletResponseSchema, res);\n }\n}\n"],"mappings":";;;;;;;;;;AAyBA,MAAa,mCAAmC,EAAE,aAAa;CAC3D,qBAAqB;CACrB,eAAe;CACf,KAAK;AACT,CAAC;;AAID,MAAM,0BAA0B,EAAE,KAC9B,EAAE,OAAO,GACT,EAAE,MACE,6BACA,8DACJ,CACJ;AAEA,MAAa,6BAA6B,EAAE,aAAa;CACrD,qBAAqB;CACrB,SAAS;CACT,WAAW;CACX,WAAW,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;CACpC,IAAI,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;CAC7B,gBAAgB,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;AAC7C,CAAC;AAID,MAAM,WAAW,EAAE,OAAO;CACtB,WAAW;CACX,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC;CAC/B,UAAU,EAAE,OAAO;CACnB,SAAS,EAAE,SAAS,oBAAoB;AAC5C,CAAC;AAID,MAAM,gCAAgC,EAAE,OAAO;CAC3C,aAAa,EAAE,OAAO;CACtB,WAAW,EAAE,SAAS,eAAe;CACrC,WAAW;CACX,UAAU,EAAE,OAAO;AACvB,CAAC;AAID,MAAM,wBAAwB,EAAE,OAAO;CACnC,SAAS;CACT,WAAW;AACf,CAAC;;;;AAOD,IAAa,cAAb,MAAyB;CACrB;CACA;CACA;CAEA,YAAY,YAAwC,UAA6B;EAC7E,KAAKA,gBAAgB,aAAaC,eAAmB,WAAW,SAAS;EACzE,KAAKC,cAAc,aAAaD,eAAmB,WAAW,OAAO;EACrE,KAAK,UAAU,IAAI,eAAe,YAAY,QAAQ;CAC1D;;;;CAKA,MAAM,GAAG,SAAgD;EACrD,MAAM,MAAM,MAAM,KAAKC,YAAY,GAAG,CAAC,GAAG,qBAAqB,OAAO,CAAC;EACvE,OAAO,MAAM,UAAU,GAAG;CAC9B;;;;;;;CAQA,MAAM,YAAY,SAAmD;EACjE,MAAM,KAAKA,YAAY,YAAY,CAAC,GAAG,qBAAqB,OAAO,CAAC;CACxE;;;;;;CAOA,MAAM,sBACF,OACA,SACwB;EACxB,MAAM,YAAY,MAAM,kCAAkC,KAAK;EAC/D,OAAO,MACH,uBACA,MAAM,KAAKF,cAAc,sBACrB;GAAE,GAAG;GAAW,SAAA;EAA4C,GAC5D,qBAAqB,OAAO,CAChC,CACJ;CACJ;;;;CAKA,MAAgB,gBACZ,OACA,SACgC;EAChC,MAAM,iBAAiB,MAAM,4BAA4B,KAAK;EAC9D,MAAM,MAAM,MAAM,KAAKA,cAAc,gBACjC,gBACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,+BAA+B,GAAG;CACnD;AACJ"}
1
+ {"version":3,"file":"auth.js","names":["#publicClient","Proto.AuthService","#authClient"],"sources":["../../../src/services/auth/auth.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/auth/v1/auth_pb.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport { ProfileService } from \"./profile/profile.js\";\nimport {\n OptionalTimestampMsSchema,\n PublicIdSchema,\n TimestampSchema,\n} from \"../../shared/schemas.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { MfaSessionInfoSchema } from \"../mfa/mfa.schemas.js\";\nimport type { PolyesterRealtime } from \"../../realtime/index.js\";\nimport type { AuthAndPublicApiTransports } from \"../../shared/transports.js\";\n\nimport {\n WalletAddressSchema,\n WalletChallengeUriSchema,\n WalletChallengeMessageSchema,\n} from \"./wallet-challenge.schemas.js\";\n\nexport const CreateWalletChallengeInputSchema = v.strictObject({\n smartAccountAddress: WalletAddressSchema,\n signerAddress: WalletAddressSchema,\n uri: WalletChallengeUriSchema,\n});\nexport type CreateWalletChallengeInput = v.InferInput<typeof CreateWalletChallengeInputSchema>;\n\n/** An EIP-191 EOA signature: 65 hexadecimal bytes, with an optional 0x prefix. */\nconst LoginEoaSignatureSchema = v.pipe(\n v.string(),\n v.regex(\n /^(?:0x)?[0-9a-fA-F]{130}$/,\n \"Login signature must be a 65-byte hexadecimal EOA signature.\",\n ),\n);\n\nexport const LoginWithWalletInputSchema = v.strictObject({\n smartAccountAddress: WalletAddressSchema,\n message: WalletChallengeMessageSchema,\n signature: LoginEoaSignatureSchema,\n userAgent: v.optional(v.string(), \"\"),\n ip: v.optional(v.string(), \"\"),\n walletProvider: v.optional(v.string(), \"\"),\n});\n\nexport type LoginWithWalletInput = v.InferInput<typeof LoginWithWalletInputSchema>;\n\nconst MeSchema = v.object({\n accountId: PublicIdSchema,\n apiKeyId: v.optional(v.string()),\n username: v.string(),\n session: v.optional(MfaSessionInfoSchema),\n});\n\nexport type Me = v.InferOutput<typeof MeSchema>;\n\nconst LoginWithWalletResponseSchema = v.object({\n accessToken: v.string(),\n expiresAt: v.optional(TimestampSchema),\n accountId: PublicIdSchema,\n username: v.string(),\n});\n\nexport type LoginWithWalletResponse = v.InferOutput<typeof LoginWithWalletResponseSchema>;\n\nconst WalletChallengeSchema = v.object({\n message: WalletChallengeMessageSchema,\n expiresAt: OptionalTimestampMsSchema,\n});\n\nexport type WalletChallenge = v.InferOutput<typeof WalletChallengeSchema>;\n\n/**\n * Handles wallet-based authentication, caller introspection, and authenticated profile operations.\n */\nexport class AuthService {\n #publicClient: Client<typeof Proto.AuthService>;\n #authClient: Client<typeof Proto.AuthService>;\n profile: ProfileService;\n\n constructor(transports: AuthAndPublicApiTransports, realtime: PolyesterRealtime) {\n this.#publicClient = createClient(Proto.AuthService, transports.publicApi);\n this.#authClient = createClient(Proto.AuthService, transports.authApi);\n this.profile = new ProfileService(transports, realtime);\n }\n\n /**\n * Returns the authenticated caller's account context, including account ID, optional API key ID, username, and session assurance details from the presented token or API key.\n */\n async me(options?: PolyesterRequestOptions): Promise<Me> {\n const res = await this.#authClient.me({}, toConnectCallOptions(options));\n return parse(MeSchema, res);\n }\n\n /**\n * Records explicit consent to the current terms for the caller's root account.\n * Call only after the user consents. Requires an interactive JWT session;\n * API keys are not allowed. Repeated acceptance succeeds without changing\n * the first acceptance time. No MFA is required.\n */\n async acceptTerms(options?: PolyesterMutationOptions): Promise<void> {\n await this.#authClient.acceptTerms({}, toConnectCallOptions(options));\n }\n\n /**\n * Requests a server-issued SIWE login message. Sign its exact UTF-8 bytes with\n * personal_sign; do not hash or reconstruct it. Expiry is epoch milliseconds.\n * The backend sets SIWE Chain ID to Ethereum mainnet (1) and binds the\n * Polyester chain in Resources. Do not send a chain ID or rewrite either binding.\n * Wallet adapters must select Ethereum mainnet before signing if required by the wallet.\n * Subaccount creation uses `subaccounts.createChallenge` instead.\n */\n async createWalletChallenge(\n input: CreateWalletChallengeInput,\n options?: PolyesterRequestOptions,\n ): Promise<WalletChallenge> {\n const validated = parse(CreateWalletChallengeInputSchema, input);\n return parse(\n WalletChallengeSchema,\n await this.#publicClient.createWalletChallenge(\n { ...validated, purpose: Proto.WalletChallengePurpose.LOGIN },\n toConnectCallOptions(options),\n ),\n );\n }\n\n /**\n * Exchanges a signed SIWE message for an authenticated session token and account identity returned by the auth API.\n */\n protected async loginWithWallet(\n input: LoginWithWalletInput,\n options?: PolyesterMutationOptions,\n ): Promise<LoginWithWalletResponse> {\n const validatedInput = parse(LoginWithWalletInputSchema, input);\n const res = await this.#publicClient.loginWithWallet(\n validatedInput,\n toConnectCallOptions(options),\n );\n return parse(LoginWithWalletResponseSchema, res);\n }\n}\n"],"mappings":";;;;;;;;;;AAyBA,MAAa,mCAAmC,EAAE,aAAa;CAC3D,qBAAqB;CACrB,eAAe;CACf,KAAK;AACT,CAAC;;AAID,MAAM,0BAA0B,EAAE,KAC9B,EAAE,OAAO,GACT,EAAE,MACE,6BACA,8DACJ,CACJ;AAEA,MAAa,6BAA6B,EAAE,aAAa;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OACA,SACgC;EAChC,MAAM,iBAAiB,MAAM,4BAA4B,KAAK;EAC9D,MAAM,MAAM,MAAM,KAAKA,cAAc,gBACjC,gBACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,+BAA+B,GAAG;CACnD;AACJ"}
@@ -19,6 +19,7 @@ const SessionDataSchema = v.object({
19
19
  environmentFingerprint: v.string(),
20
20
  provider: v.picklist([
21
21
  "metamask",
22
+ "phantom",
22
23
  "turnkey",
23
24
  "other"
24
25
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"session.schemas.js","names":[],"sources":["../../../src/services/auth/session.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport type { SessionData } from \"./session.types.js\";\n\nexport const AuthLoginMethodSchema = v.picklist([\n \"google\",\n \"email\",\n \"metamask\",\n \"rabby\",\n \"phantom\",\n \"walletconnect\",\n]);\n\nexport const ActiveAccountInfoSchema = v.object({\n accountId: v.string(),\n isMain: v.boolean(),\n mainAccountId: v.string(),\n smartAccountAddress: v.optional(v.string()),\n label: v.optional(v.string()),\n});\n\nexport const SessionDataSchema = v.object({\n environmentFingerprint: v.string(),\n provider: v.picklist([\"metamask\", \"turnkey\", \"other\"]),\n loginMethod: v.nullable(AuthLoginMethodSchema),\n primaryWallet: v.string(),\n smartAccount: v.string(),\n activeAccount: v.optional(ActiveAccountInfoSchema),\n username: v.optional(v.string()),\n});\n\n/**\n * Parses raw session data into the SDK session shape.\n */\nexport function parseSessionData(value: unknown): SessionData | null {\n const parsed = v.safeParse(SessionDataSchema, value);\n return parsed.success ? parsed.output : null;\n}\n"],"mappings":";;AAGA,MAAa,wBAAwB,EAAE,SAAS;CAC5C;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC;AAED,MAAa,0BAA0B,EAAE,OAAO;CAC5C,WAAW,EAAE,OAAO;CACpB,QAAQ,EAAE,QAAQ;CAClB,eAAe,EAAE,OAAO;CACxB,qBAAqB,EAAE,SAAS,EAAE,OAAO,CAAC;CAC1C,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;AAChC,CAAC;AAED,MAAa,oBAAoB,EAAE,OAAO;CACtC,wBAAwB,EAAE,OAAO;CACjC,UAAU,EAAE,SAAS;EAAC;EAAY;EAAW;CAAO,CAAC;CACrD,aAAa,EAAE,SAAS,qBAAqB;CAC7C,eAAe,EAAE,OAAO;CACxB,cAAc,EAAE,OAAO;CACvB,eAAe,EAAE,SAAS,uBAAuB;CACjD,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC;AACnC,CAAC;;;;AAKD,SAAgB,iBAAiB,OAAoC;CACjE,MAAM,SAAS,EAAE,UAAU,mBAAmB,KAAK;CACnD,OAAO,OAAO,UAAU,OAAO,SAAS;AAC5C"}
1
+ {"version":3,"file":"session.schemas.js","names":[],"sources":["../../../src/services/auth/session.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport type { SessionData } from \"./session.types.js\";\n\nexport const AuthLoginMethodSchema = v.picklist([\n \"google\",\n \"email\",\n \"metamask\",\n \"rabby\",\n \"phantom\",\n \"walletconnect\",\n]);\n\nexport const ActiveAccountInfoSchema = v.object({\n accountId: v.string(),\n isMain: v.boolean(),\n mainAccountId: v.string(),\n smartAccountAddress: v.optional(v.string()),\n label: v.optional(v.string()),\n});\n\nexport const SessionDataSchema = v.object({\n environmentFingerprint: v.string(),\n provider: v.picklist([\"metamask\", \"phantom\", \"turnkey\", \"other\"]),\n loginMethod: v.nullable(AuthLoginMethodSchema),\n primaryWallet: v.string(),\n smartAccount: v.string(),\n activeAccount: v.optional(ActiveAccountInfoSchema),\n username: v.optional(v.string()),\n});\n\n/**\n * Parses raw session data into the SDK session shape.\n */\nexport function parseSessionData(value: unknown): SessionData | null {\n const parsed = v.safeParse(SessionDataSchema, value);\n return parsed.success ? parsed.output : null;\n}\n"],"mappings":";;AAGA,MAAa,wBAAwB,EAAE,SAAS;CAC5C;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC;AAED,MAAa,0BAA0B,EAAE,OAAO;CAC5C,WAAW,EAAE,OAAO;CACpB,QAAQ,EAAE,QAAQ;CAClB,eAAe,EAAE,OAAO;CACxB,qBAAqB,EAAE,SAAS,EAAE,OAAO,CAAC;CAC1C,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;AAChC,CAAC;AAED,MAAa,oBAAoB,EAAE,OAAO;CACtC,wBAAwB,EAAE,OAAO;CACjC,UAAU,EAAE,SAAS;EAAC;EAAY;EAAW;EAAW;CAAO,CAAC;CAChE,aAAa,EAAE,SAAS,qBAAqB;CAC7C,eAAe,EAAE,OAAO;CACxB,cAAc,EAAE,OAAO;CACvB,eAAe,EAAE,SAAS,uBAAuB;CACjD,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC;AACnC,CAAC;;;;AAKD,SAAgB,iBAAiB,OAAoC;CACjE,MAAM,SAAS,EAAE,UAAU,mBAAmB,KAAK;CACnD,OAAO,OAAO,UAAU,OAAO,SAAS;AAC5C"}
@@ -18,7 +18,7 @@ type AuthLoginMethod = "google" | "email" | "metamask" | "rabby" | "phantom" | "
18
18
  */
19
19
  interface SessionData {
20
20
  environmentFingerprint: string;
21
- provider: "metamask" | "turnkey" | "other";
21
+ provider: "metamask" | "phantom" | "turnkey" | "other";
22
22
  loginMethod: AuthLoginMethod | null;
23
23
  primaryWallet: string;
24
24
  smartAccount: string;
@@ -11,7 +11,7 @@ type TimestampInit = {
11
11
  };
12
12
  declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
13
13
  readonly symbolId: v.NumberSchema<undefined>;
14
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">>]>;
14
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">>]>;
15
15
  readonly tsSec: v.BigintSchema<undefined>;
16
16
  readonly open: v.BigintSchema<undefined>;
17
17
  readonly high: v.BigintSchema<undefined>;
@@ -22,7 +22,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
22
22
  readonly isClosed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
23
23
  }, undefined>, v.TransformAction<{
24
24
  symbolId: number;
25
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
25
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
26
26
  tsSec: bigint;
27
27
  open: bigint;
28
28
  high: bigint;
@@ -33,7 +33,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
33
33
  isClosed: boolean;
34
34
  }, {
35
35
  symbolId: number;
36
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
36
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
37
37
  time: number;
38
38
  open: string;
39
39
  high: string;
@@ -46,7 +46,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
46
46
  declare const createCandleRowIntSchema: typeof createCandleRowSchema;
47
47
  declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
48
48
  readonly symbolId: v.NumberSchema<undefined>;
49
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">>]>;
49
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">>]>;
50
50
  readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
51
51
  readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
52
52
  readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
@@ -63,7 +63,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
63
63
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
64
64
  }, undefined>, v.TransformAction<{
65
65
  symbolId: number;
66
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
66
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
67
67
  tsSec: bigint[];
68
68
  open: bigint[];
69
69
  high: bigint[];
@@ -80,7 +80,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
80
80
  nextPageToken: string;
81
81
  }, {
82
82
  symbolId: number;
83
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
83
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
84
84
  time: number[];
85
85
  open: string[];
86
86
  high: string[];
@@ -100,7 +100,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
100
100
  }>]>;
101
101
  declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
102
102
  readonly symbolId: v.NumberSchema<undefined>;
103
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">>]>;
103
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">>]>;
104
104
  readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
105
105
  readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
106
106
  readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
@@ -117,7 +117,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
117
117
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
118
118
  }, undefined>, v.TransformAction<{
119
119
  symbolId: number;
120
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
120
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
121
121
  tsSec: bigint[];
122
122
  open: bigint[];
123
123
  high: bigint[];
@@ -134,7 +134,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
134
134
  nextPageToken: string;
135
135
  }, {
136
136
  symbolId: number;
137
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
137
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
138
138
  tsSec: number[];
139
139
  open: string[];
140
140
  high: string[];
@@ -158,7 +158,7 @@ type CandleColumnar = v.InferOutput<ReturnType<typeof createCandleColumnarSchema
158
158
  type CandleColumnarInt = v.InferOutput<ReturnType<typeof createCandleColumnarIntSchema>>;
159
159
  declare function createListCandlesInputSchema(): v.SchemaWithPipe<readonly [v.ObjectSchema<{
160
160
  readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
161
- readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "5m", "15m", "30m", "1h", "4h", "12h", "1d", "1w", "1mo"], undefined>, v.TransformAction<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_4 | Timeframe$1.DAY_1 | Timeframe$1.HOUR_12 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
161
+ readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "5m", "15m", "30m", "1h", "4h", "12h", "1d", "1w", "1mo"], undefined>, v.TransformAction<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_4 | Timeframe$1.DAY_1 | Timeframe$1.HOUR_12 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
162
162
  readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 10000, undefined>]>, undefined>;
163
163
  readonly includeIncomplete: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
164
164
  readonly includeReference: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
@@ -1 +1 @@
1
- {"version":3,"file":"candles.schemas.d.ts","names":[],"sources":["../../../src/services/candles/candles.schemas.ts"],"mappings":";;;;;cAQa,iBAAe,EAAA;KA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