@lifi/perps-types 4.0.0 → 4.0.1

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 (78) hide show
  1. package/dist/cjs/account.d.ts.map +1 -1
  2. package/dist/cjs/action.d.ts +1 -0
  3. package/dist/cjs/action.d.ts.map +1 -1
  4. package/dist/cjs/asset.d.ts.map +1 -1
  5. package/dist/cjs/enums.d.ts.map +1 -1
  6. package/dist/cjs/enums.js.map +1 -1
  7. package/dist/cjs/errors.d.ts.map +1 -1
  8. package/dist/cjs/market.d.ts.map +1 -1
  9. package/dist/cjs/primitives.d.ts.map +1 -1
  10. package/dist/cjs/providers.d.ts.map +1 -1
  11. package/dist/cjs/subscriptions.d.ts.map +1 -1
  12. package/dist/cjs/typedData.d.ts.map +1 -1
  13. package/dist/cjs/vote.d.ts.map +1 -1
  14. package/dist/cjs/vote.js.map +1 -1
  15. package/dist/esm/account.d.ts +194 -31
  16. package/dist/esm/account.d.ts.map +1 -1
  17. package/dist/esm/action.d.ts +205 -37
  18. package/dist/esm/action.d.ts.map +1 -1
  19. package/dist/esm/asset.d.ts +1 -4
  20. package/dist/esm/asset.d.ts.map +1 -1
  21. package/dist/esm/enums.d.ts +34 -20
  22. package/dist/esm/enums.d.ts.map +1 -1
  23. package/dist/esm/enums.js +33 -19
  24. package/dist/esm/enums.js.map +1 -1
  25. package/dist/esm/errors.d.ts +6 -1
  26. package/dist/esm/errors.d.ts.map +1 -1
  27. package/dist/esm/market.d.ts +47 -14
  28. package/dist/esm/market.d.ts.map +1 -1
  29. package/dist/esm/primitives.d.ts +12 -2
  30. package/dist/esm/primitives.d.ts.map +1 -1
  31. package/dist/esm/providers.d.ts +19 -6
  32. package/dist/esm/providers.d.ts.map +1 -1
  33. package/dist/esm/quote.d.ts +2 -2
  34. package/dist/esm/quote.d.ts.map +1 -1
  35. package/dist/esm/subscriptions.d.ts +27 -19
  36. package/dist/esm/subscriptions.d.ts.map +1 -1
  37. package/dist/esm/typedData.d.ts +15 -5
  38. package/dist/esm/typedData.d.ts.map +1 -1
  39. package/dist/esm/vote.d.ts +1 -3
  40. package/dist/esm/vote.d.ts.map +1 -1
  41. package/dist/esm/vote.js.map +1 -1
  42. package/dist/types/account.d.ts +194 -31
  43. package/dist/types/account.d.ts.map +1 -1
  44. package/dist/types/action.d.ts +205 -37
  45. package/dist/types/action.d.ts.map +1 -1
  46. package/dist/types/asset.d.ts +1 -4
  47. package/dist/types/asset.d.ts.map +1 -1
  48. package/dist/types/enums.d.ts +34 -20
  49. package/dist/types/enums.d.ts.map +1 -1
  50. package/dist/types/errors.d.ts +6 -1
  51. package/dist/types/errors.d.ts.map +1 -1
  52. package/dist/types/market.d.ts +47 -14
  53. package/dist/types/market.d.ts.map +1 -1
  54. package/dist/types/primitives.d.ts +12 -2
  55. package/dist/types/primitives.d.ts.map +1 -1
  56. package/dist/types/providers.d.ts +19 -6
  57. package/dist/types/providers.d.ts.map +1 -1
  58. package/dist/types/quote.d.ts +2 -2
  59. package/dist/types/quote.d.ts.map +1 -1
  60. package/dist/types/subscriptions.d.ts +27 -19
  61. package/dist/types/subscriptions.d.ts.map +1 -1
  62. package/dist/types/typedData.d.ts +15 -5
  63. package/dist/types/typedData.d.ts.map +1 -1
  64. package/dist/types/vote.d.ts +1 -3
  65. package/dist/types/vote.d.ts.map +1 -1
  66. package/package.json +1 -1
  67. package/src/account.ts +194 -36
  68. package/src/action.ts +205 -37
  69. package/src/asset.ts +1 -4
  70. package/src/enums.ts +34 -20
  71. package/src/errors.ts +6 -1
  72. package/src/market.ts +47 -14
  73. package/src/primitives.ts +12 -2
  74. package/src/providers.ts +19 -6
  75. package/src/quote.ts +2 -2
  76. package/src/subscriptions.ts +27 -19
  77. package/src/typedData.ts +15 -5
  78. package/src/vote.ts +1 -3
@@ -1,5 +1,10 @@
1
1
  import type { Address, Hex } from './primitives.js';
2
- /** @public */
2
+ /**
3
+ * EIP-712 domain fields used to identify a signing domain. `chainId` is the
4
+ * numeric EVM chain id when present.
5
+ *
6
+ * @public
7
+ */
3
8
  export interface TypedDataDomain {
4
9
  name?: string;
5
10
  version?: string;
@@ -7,21 +12,26 @@ export interface TypedDataDomain {
7
12
  verifyingContract?: Address;
8
13
  salt?: Hex;
9
14
  }
10
- /** @public */
15
+ /** One named field in an EIP-712 primary type definition. @public */
11
16
  export interface TypedDataParameter {
12
17
  name: string;
13
18
  type: string;
14
19
  }
15
- /** @public */
20
+ /** Primary-type name used by a perps EIP-712 payload. @public */
16
21
  export type PerpsPrimaryType = string;
17
- /** @public */
22
+ /**
23
+ * Provider-neutral EIP-712 payload passed between backend and SDK. `message`
24
+ * intentionally remains open because each action defines its own fields.
25
+ *
26
+ * @public
27
+ */
18
28
  export type PerpsTypedData = {
19
29
  domain: TypedDataDomain;
20
30
  types: Record<string, readonly TypedDataParameter[]>;
21
31
  primaryType: PerpsPrimaryType;
22
32
  message: Record<string, any>;
23
33
  };
24
- /** @public */
34
+ /** EIP-712 payload accompanied by its client-produced signature. @public */
25
35
  export type PerpsSignedTypedData = PerpsTypedData & {
26
36
  signature: Hex;
27
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../src/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAEnD,cAAc;AACd,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,GAAG,CAAA;CACX;AAED,cAAc;AACd,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,cAAc;AACd,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAErC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AAA"}
@@ -7,7 +7,7 @@ import type { PerpsTypedData, TypedDataParameter } from './typedData.js';
7
7
  * @public
8
8
  */
9
9
  export declare const META_PROVIDER = "meta";
10
- /** @public */
10
+ /** Type alias for the {@link META_PROVIDER} provider-independent sentinel. @public */
11
11
  export type MetaProvider = typeof META_PROVIDER;
12
12
  /**
13
13
  * Vote direction. `up` endorses the subject; `down` opposes it.
@@ -29,7 +29,6 @@ export type VoteType = 'provider';
29
29
  * @public
30
30
  */
31
31
  export interface VoteParams {
32
- /** Key of the inactive provider being voted on (the voted-on subject). */
33
32
  targetProvider: string;
34
33
  direction: VoteDirection;
35
34
  voteType: VoteType;
@@ -39,7 +38,6 @@ export interface VoteParams {
39
38
  * @public
40
39
  */
41
40
  export interface VoteMessage {
42
- /** Key of the inactive provider being voted on. */
43
41
  targetProvider: string;
44
42
  direction: VoteDirection;
45
43
  voteType: VoteType;
@@ -1 +1 @@
1
- {"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../src/vote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAS,CAAA;AAEnC,cAAc;AACd,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAA;AAE/C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,MAAM,CAAA;AAEzC;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAA;AAEjC;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EAAE,QAAQ,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,cAAc,EAAE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AA;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,kBAAkB,EAMvD,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE;QAAE,IAAI,EAAE,SAAS,kBAAkB,EAAE,CAAA;KAAE,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;IACxE,OAAO,EAAE,WAAW,CAAA;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/perps-types",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "Shared types for the LI.FI perps stack",
5
5
  "keywords": [
6
6
  "lifi",
package/src/account.ts CHANGED
@@ -13,23 +13,44 @@ import type {
13
13
  import type { MarketDisplay, PerpsMarketDisplay } from './market.js'
14
14
  import type { Address } from './primitives.js'
15
15
 
16
- /** @public */
16
+ /**
17
+ * Maker and taker fee rates for the account's current venue tier.
18
+ * Values are decimal fractions represented as strings (for example, `"0.0002"`).
19
+ *
20
+ * @public
21
+ */
17
22
  export interface FeeTier {
23
+ /** Decimal fraction charged to maker fills, represented as a string. */
18
24
  maker: string
25
+ /** Decimal fraction charged to taker fills, represented as a string. */
19
26
  taker: string
20
27
  }
21
28
 
22
- /** @public */
29
+ /**
30
+ * Normalized open perpetual position with prices, margin, and PnL expressed as
31
+ * decimal strings to preserve provider precision.
32
+ *
33
+ * @public
34
+ */
23
35
  export interface Position {
24
36
  market: PerpsMarketDisplay
25
37
  side: PositionSide
38
+ /** Position quantity in base-asset units. */
26
39
  size: string
40
+ /** Average entry price in quote-asset units. */
27
41
  entryPrice: string
42
+ /** Current provider mark price in quote-asset units. */
28
43
  markPrice: string
44
+ /** Estimated liquidation price in quote-asset units. */
29
45
  liquidationPrice: string
46
+ /** Unrealized PnL in quote-currency units. */
30
47
  unrealizedPnl: string
48
+ /** Position leverage as a numeric multiple. */
31
49
  leverage: number
32
- /** Margin allocated to the position, excluding unrealized PnL. */
50
+ /**
51
+ * Margin allocated and reserved by this position as a decimal string,
52
+ * excluding unrealized PnL.
53
+ */
33
54
  marginUsed: string
34
55
  /**
35
56
  * Exact initial margin the venue currently requires for this position.
@@ -52,21 +73,34 @@ export interface PositionMarginConstraints {
52
73
  amountIncrement: string
53
74
  }
54
75
 
55
- /** @public */
76
+ /**
77
+ * Normalized non-trigger order currently open at a provider.
78
+ *
79
+ * @public
80
+ */
56
81
  export interface OpenOrder {
57
82
  orderId: string
58
83
  market: MarketDisplay
59
84
  side: OrderSide
60
85
  type: OrderType
86
+ /** Remaining order quantity in base-asset units. */
61
87
  size: string
88
+ /** Limit/order price in quote-asset units. */
62
89
  price: string
90
+ /** Quantity already filled in base-asset units. */
63
91
  filledSize: string
64
92
  reduceOnly: boolean
65
93
  label?: string
94
+ /** ISO-8601 creation timestamp. */
66
95
  createdAt: string
67
96
  }
68
97
 
69
- /** @public */
98
+ /**
99
+ * Asset balance normalized across providers. `units` and `valueUsd` are
100
+ * decimal strings; `valueUsd` is the balance's USD valuation.
101
+ *
102
+ * @public
103
+ */
70
104
  export interface Balance {
71
105
  /** Which category/venue this balance sits in — references a {@link ProviderCategory}. */
72
106
  categoryId: string
@@ -82,7 +116,12 @@ export interface Balance {
82
116
  collateralWeight?: number
83
117
  }
84
118
 
85
- /** @public */
119
+ /**
120
+ * Account snapshot returned by a provider, including balances, positions,
121
+ * aggregate margin/PnL, and provider-specific configuration.
122
+ *
123
+ * @public
124
+ */
86
125
  export interface AccountResponse {
87
126
  provider: string
88
127
  address: Address
@@ -92,17 +131,28 @@ export interface AccountResponse {
92
131
  collateralBalances: Balance[]
93
132
  /** Open positions the snapshot already computed; equals the unfiltered `getPositions` output. */
94
133
  positions: Position[]
134
+ /** Margin reserved across the account, represented as a decimal string. */
95
135
  marginUsed: string
136
+ /** Unrealized account PnL, represented as a decimal string. */
96
137
  unrealizedPnl: string
97
138
  feeTier: FeeTier
98
139
  config: AccountConfig
99
140
  }
100
141
 
101
- /** @public */
142
+ /**
143
+ * Aggregate account values for a provider stream or response. Monetary values
144
+ * are decimal strings in USD.
145
+ *
146
+ * @public
147
+ */
102
148
  export interface AccountSummary {
149
+ /** Total account portfolio value in USD. */
103
150
  portfolioValue: string
151
+ /** Margin currently available for new orders in USD. */
104
152
  availableMargin: string
153
+ /** Margin currently reserved by open positions/orders in USD. */
105
154
  marginUsed: string
155
+ /** Aggregate unrealized PnL in USD. */
106
156
  unrealizedPnl: string
107
157
  }
108
158
 
@@ -117,26 +167,41 @@ export interface MarketSettings {
117
167
  leverage: number
118
168
  }
119
169
 
120
- /** @public */
170
+ /**
171
+ * Normalized take-profit or stop-loss order waiting for its trigger condition.
172
+ *
173
+ * @public
174
+ */
121
175
  export interface TriggerOrder {
122
176
  orderId: string
123
177
  market: MarketDisplay
124
178
  type: OrderType
179
+ /** Triggered quantity in base-asset units. */
125
180
  size: string
181
+ /** Price at which the trigger activates, in quote-asset units. */
126
182
  triggerPrice: string
183
+ /** Optional limit price submitted after activation, in quote-asset units. */
127
184
  limitPrice?: string
128
185
  label?: string
129
186
  createdAt: string
130
187
  }
131
188
 
132
- /** @public */
189
+ /**
190
+ * Paginated open-position response for one provider and account.
191
+ *
192
+ * @public
193
+ */
133
194
  export interface PositionsResponse {
134
195
  provider: string
135
196
  positions: Position[]
136
197
  pagination: Pagination
137
198
  }
138
199
 
139
- /** @public */
200
+ /**
201
+ * Paginated open-order response containing regular and trigger orders.
202
+ *
203
+ * @public
204
+ */
140
205
  export interface OrdersResponse {
141
206
  provider: string
142
207
  openOrders: OpenOrder[]
@@ -144,7 +209,11 @@ export interface OrdersResponse {
144
209
  pagination: Pagination
145
210
  }
146
211
 
147
- /** @public */
212
+ /**
213
+ * Normalized execution/fill record for an order.
214
+ *
215
+ * @public
216
+ */
148
217
  export interface Fill {
149
218
  id: string
150
219
  orderId: string
@@ -166,12 +235,17 @@ export interface Fill {
166
235
  startPosition?: string
167
236
  classification: FillClassification
168
237
  createdAt: string
169
- // Fully-resolved block-explorer URL for the settling on-chain tx. Absent when
170
- // the fill has no on-chain settlement tx.
238
+ /** Fully-resolved block-explorer URL for the settling on-chain tx. Absent when
239
+ * the fill has no on-chain settlement tx. */
171
240
  explorerLink?: string
172
241
  }
173
242
 
174
- /** @public */
243
+ /**
244
+ * Cursor pagination metadata. `cursor` and `nextUrl` are provider-specific
245
+ * continuation values and are absent when no further page exists.
246
+ *
247
+ * @public
248
+ */
175
249
  export interface Pagination {
176
250
  limit: number
177
251
  hasMore: boolean
@@ -179,44 +253,70 @@ export interface Pagination {
179
253
  nextUrl?: string
180
254
  }
181
255
 
182
- /** @public */
256
+ /**
257
+ * Paginated fill response for one provider and account.
258
+ *
259
+ * @public
260
+ */
183
261
  export interface FillsResponse {
184
262
  provider: string
185
263
  items: Fill[]
186
264
  pagination: Pagination
187
265
  }
188
266
 
189
- /** @public */
267
+ /**
268
+ * Common identity and timestamp fields shared by account activity records.
269
+ * `timestamp` is an ISO-8601 timestamp string.
270
+ *
271
+ * @public
272
+ */
190
273
  export interface BaseActivity {
191
274
  id: string
192
275
  provider: string
193
276
  timestamp: string
194
277
  }
195
278
 
196
- /** @public */
279
+ /**
280
+ * Account activity representing a completed deposit.
281
+ *
282
+ * @public
283
+ */
197
284
  export interface DepositActivity extends BaseActivity {
198
285
  type: ActivityType.DEPOSIT
199
286
  amount: string
200
- // Fully-resolved block-explorer URL for the on-chain deposit tx.
287
+ /** Fully-resolved block-explorer URL for the on-chain deposit tx. */
201
288
  explorerLink?: string
202
289
  }
203
290
 
204
- /** @public */
291
+ /**
292
+ * Account activity representing a completed withdrawal. `amount` and `fee`
293
+ * are decimal strings in the transferred asset's units.
294
+ *
295
+ * @public
296
+ */
205
297
  export interface WithdrawalActivity extends BaseActivity {
206
298
  type: ActivityType.WITHDRAWAL
207
299
  amount: string
208
300
  fee: string
209
- // Fully-resolved block-explorer URL for the on-chain withdrawal tx.
301
+ /** Fully-resolved block-explorer URL for the on-chain withdrawal tx. */
210
302
  explorerLink?: string
211
303
  }
212
304
 
213
- /** @public */
305
+ /**
306
+ * Position details attached to a liquidation activity.
307
+ *
308
+ * @public
309
+ */
214
310
  export interface LiquidatedPosition {
215
311
  market: MarketDisplay
216
312
  size: string
217
313
  }
218
314
 
219
- /** @public */
315
+ /**
316
+ * Account activity representing a liquidation event.
317
+ *
318
+ * @public
319
+ */
220
320
  export interface LiquidationActivity extends BaseActivity {
221
321
  type: ActivityType.LIQUIDATION
222
322
  liquidatedNotionalPosition: string
@@ -225,7 +325,12 @@ export interface LiquidationActivity extends BaseActivity {
225
325
  liquidatedPositions: LiquidatedPosition[]
226
326
  }
227
327
 
228
- /** @public */
328
+ /**
329
+ * Account activity representing a periodic funding payment. Amount and rate
330
+ * retain provider precision as decimal strings.
331
+ *
332
+ * @public
333
+ */
229
334
  export interface FundingActivity extends BaseActivity {
230
335
  type: ActivityType.FUNDING
231
336
  market: MarketDisplay
@@ -236,21 +341,30 @@ export interface FundingActivity extends BaseActivity {
236
341
 
237
342
  // At least one of `counterpartyAccountIndex` / `counterpartyAddress` is always
238
343
  // present; both may appear together.
239
- /** @public */
344
+ /**
345
+ * Account activity representing an inbound or outbound transfer. At least one
346
+ * counterparty identifier is required by the type-level union below.
347
+ *
348
+ * @public
349
+ */
240
350
  export type TransferActivity = BaseActivity & {
241
351
  type: ActivityType.TRANSFER
242
352
  direction: 'IN' | 'OUT'
243
353
  asset: string
244
354
  amount: string
245
355
  meta?: Record<string, unknown>
246
- // Fully-resolved block-explorer URL for the on-chain transfer tx.
356
+ /** Fully-resolved block-explorer URL for the on-chain transfer tx. */
247
357
  explorerLink?: string
248
358
  } & (
249
359
  | { counterpartyAccountIndex: number; counterpartyAddress?: string }
250
360
  | { counterpartyAccountIndex?: number; counterpartyAddress: string }
251
361
  )
252
362
 
253
- /** @public */
363
+ /**
364
+ * Discriminated union of all activity records returned by a provider.
365
+ *
366
+ * @public
367
+ */
254
368
  export type ActivityItem =
255
369
  | DepositActivity
256
370
  | WithdrawalActivity
@@ -258,7 +372,11 @@ export type ActivityItem =
258
372
  | FundingActivity
259
373
  | TransferActivity
260
374
 
261
- /** @public */
375
+ /**
376
+ * Paginated account-activity response for one provider and account.
377
+ *
378
+ * @public
379
+ */
262
380
  export interface ActivitiesResponse {
263
381
  provider: string
264
382
  items: ActivityItem[]
@@ -267,10 +385,19 @@ export interface ActivitiesResponse {
267
385
 
268
386
  // Account configuration state — typed `AccountResponse.config`.
269
387
 
270
- /** @public */
388
+ /**
389
+ * Provider-specific Hyperliquid agent configuration. The record contents are
390
+ * provider-defined and intentionally left opaque to the shared type package.
391
+ *
392
+ * @public
393
+ */
271
394
  export type HyperliquidAgent = Record<string, unknown>
272
395
 
273
- /** @public */
396
+ /**
397
+ * Hyperliquid builder-fee approval state for an account.
398
+ *
399
+ * @public
400
+ */
274
401
  export interface HyperliquidBuilderFeeApproval {
275
402
  builderAddress: string
276
403
  /** Basis points as a string. */
@@ -278,7 +405,11 @@ export interface HyperliquidBuilderFeeApproval {
278
405
  approved: boolean
279
406
  }
280
407
 
281
- /** @public */
408
+ /**
409
+ * Hyperliquid account configuration returned in {@link AccountResponse.config}.
410
+ *
411
+ * @public
412
+ */
282
413
  export interface HyperliquidAccountConfig {
283
414
  provider: 'hyperliquid'
284
415
  /** `null` means abstraction has never been set. */
@@ -287,7 +418,11 @@ export interface HyperliquidAccountConfig {
287
418
  builderFeeApproval?: HyperliquidBuilderFeeApproval
288
419
  }
289
420
 
290
- /** @public */
421
+ /**
422
+ * Lighter spot-asset collateral setting for a single asset.
423
+ *
424
+ * @public
425
+ */
291
426
  export interface LighterAssetCollateral {
292
427
  /** Provider-native spot asset id (matches `Asset.id`). */
293
428
  assetId: string
@@ -305,7 +440,12 @@ export interface LighterAssetCollateral {
305
440
  */
306
441
  export type LighterProviderKey = 'lighter' | 'lighter-rh'
307
442
 
308
- /** @public */
443
+ /**
444
+ * Lighter account configuration returned in {@link AccountResponse.config}.
445
+ * Numeric identifiers and account modes use the provider's wire values.
446
+ *
447
+ * @public
448
+ */
309
449
  export interface LighterAccountConfig {
310
450
  provider: LighterProviderKey
311
451
  accountIndex: number
@@ -336,7 +476,12 @@ export interface LighterAccountConfig {
336
476
  referralPresent: boolean
337
477
  }
338
478
 
339
- /** @public */
479
+ /**
480
+ * Ondo account/session configuration returned in {@link AccountResponse.config}.
481
+ * Expiry values are Unix timestamps in seconds.
482
+ *
483
+ * @public
484
+ */
340
485
  export interface OndoAccountConfig {
341
486
  provider: 'ondo'
342
487
  loggedIn: boolean
@@ -352,20 +497,33 @@ export interface OndoAccountConfig {
352
497
  depositAddress: string | null
353
498
  }
354
499
 
355
- /** @public */
500
+ /**
501
+ * Provider-specific account configuration discriminated by its `provider` key.
502
+ *
503
+ * @public
504
+ */
356
505
  export type AccountConfig =
357
506
  | HyperliquidAccountConfig
358
507
  | LighterAccountConfig
359
508
  | OndoAccountConfig
360
509
 
361
- /** @public */
510
+ /**
511
+ * Named account-configuration value exposed to clients.
512
+ *
513
+ * @public
514
+ */
362
515
  export interface AccountConfigValue {
363
516
  name: string
364
517
  /** `null` means no current value — consumers fall back to the descriptor default. */
365
518
  value: string | number | boolean | null
366
519
  }
367
520
 
368
- /** @public */
521
+ /**
522
+ * Account-configuration action and its available values, optionally including
523
+ * whether the setting is currently satisfied.
524
+ *
525
+ * @public
526
+ */
369
527
  export interface AccountConfigSetting {
370
528
  type: ActionType
371
529
  values: AccountConfigValue[]