@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 +1 @@
1
- {"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OA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AS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC;;;;;;;;;GASG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,EAAE,SAAS,CAAA;IACf,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,oGAAoG;IACpG,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAA;IACzB,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAA;IACtB,oEAAoE;IACpE,OAAO,EAAE,OAAO,CAAA;IAChB,uFAAuF;IACvF,gBAAgB,EAAE,OAAO,CAAA;IACzB,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAC3B,4GAA4G;IAC5G,qBAAqB,EAAE,OAAO,CAAA;IAC9B,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAA;CAClB"}
@@ -1,18 +1,18 @@
1
1
  import type { AccountSummary, Balance, Fill, OpenOrder, Position, TriggerOrder } from './account.js';
2
2
  import type { Candle, MarketContext, OhlcvInterval, OrderbookResponse, Trade } from './market.js';
3
3
  import type { Address } from './primitives.js';
4
- /** @public */
4
+ /** Subscription for the provider's aggregate market-context stream. @public */
5
5
  export type MarketsContextSubscription = {
6
6
  channel: 'marketsContext';
7
7
  dex: string;
8
8
  };
9
- /** @public */
9
+ /** Subscription for one market's live context stream. @public */
10
10
  export type MarketContextSubscription = {
11
11
  channel: 'marketContext';
12
12
  dex: string;
13
13
  marketId: string;
14
14
  };
15
- /** @public */
15
+ /** Subscription for streamed order-book updates for one market. @public */
16
16
  export type OrderbookSubscription = {
17
17
  channel: 'orderbook';
18
18
  dex: string;
@@ -26,77 +26,81 @@ export type OrderbookSubscription = {
26
26
  */
27
27
  priceStep?: number;
28
28
  };
29
- /** @public */
29
+ /** Subscription for OHLCV candle updates for one market and interval. @public */
30
30
  export type CandleSubscription = {
31
31
  channel: 'candle';
32
32
  dex: string;
33
33
  marketId: string;
34
34
  interval: OhlcvInterval;
35
35
  };
36
- /** @public */
36
+ /** Subscription for recent trade updates for one market. @public */
37
37
  export type TradesSubscription = {
38
38
  channel: 'trades';
39
39
  dex: string;
40
40
  marketId: string;
41
41
  };
42
- /** @public */
42
+ /** Subscription for order lifecycle updates for one account. @public */
43
43
  export type OrderUpdatesSubscription = {
44
44
  channel: 'orderUpdates';
45
45
  dex: string;
46
46
  address: Address;
47
47
  };
48
- /** @public */
48
+ /** Subscription for execution/fill updates for one account. @public */
49
49
  export type FillsSubscription = {
50
50
  channel: 'fills';
51
51
  dex: string;
52
52
  address: Address;
53
53
  };
54
- /** @public */
54
+ /** Subscription for the full open-position set for one account. @public */
55
55
  export type PositionsSubscription = {
56
56
  channel: 'positions';
57
57
  dex: string;
58
58
  address: Address;
59
59
  };
60
- /** @public */
60
+ /** Subscription for spot-balance updates for one account. @public */
61
61
  export type SpotBalancesSubscription = {
62
62
  channel: 'spotBalances';
63
63
  dex: string;
64
64
  address: Address;
65
65
  };
66
- /** @public */
66
+ /** Subscription for aggregate account-summary updates for one account. @public */
67
67
  export type AccountSummarySubscription = {
68
68
  channel: 'accountSummary';
69
69
  dex: string;
70
70
  address: Address;
71
71
  };
72
- /** @public */
72
+ /**
73
+ * Union of all websocket subscription request shapes.
74
+ *
75
+ * @public
76
+ */
73
77
  export type Subscription = MarketsContextSubscription | MarketContextSubscription | OrderbookSubscription | CandleSubscription | TradesSubscription | OrderUpdatesSubscription | FillsSubscription | PositionsSubscription | SpotBalancesSubscription | AccountSummarySubscription;
74
- /** @public */
78
+ /** Event containing the provider's aggregate market contexts. @public */
75
79
  export type MarketsContextEvent = {
76
80
  channel: 'marketsContext';
77
81
  data: Record<string, MarketContext>;
78
82
  };
79
- /** @public */
83
+ /** Event containing one market's live context. @public */
80
84
  export type MarketContextEvent = {
81
85
  channel: 'marketContext';
82
86
  data: MarketContext;
83
87
  };
84
- /** @public */
88
+ /** Event containing an order-book snapshot or update. @public */
85
89
  export type OrderbookEvent = {
86
90
  channel: 'orderbook';
87
91
  data: OrderbookResponse;
88
92
  };
89
- /** @public */
93
+ /** Event containing one OHLCV candle. @public */
90
94
  export type CandleEvent = {
91
95
  channel: 'candle';
92
96
  data: Candle;
93
97
  };
94
- /** @public */
98
+ /** Event containing recent trades. @public */
95
99
  export type TradesEvent = {
96
100
  channel: 'trades';
97
101
  data: Trade[];
98
102
  };
99
- /** @public */
103
+ /** Event containing order upserts and terminal order ids. @public */
100
104
  export type OrderUpdatesEvent = {
101
105
  channel: 'orderUpdates';
102
106
  data: {
@@ -111,7 +115,7 @@ export type OrderUpdatesEvent = {
111
115
  terminated: string[];
112
116
  };
113
117
  };
114
- /** @public */
118
+ /** Event containing newly observed executions/fills. @public */
115
119
  export type FillsEvent = {
116
120
  channel: 'fills';
117
121
  data: Fill[];
@@ -148,6 +152,10 @@ export type AccountSummaryEvent = {
148
152
  channel: 'accountSummary';
149
153
  data: AccountSummary;
150
154
  };
151
- /** @public */
155
+ /**
156
+ * Union of all websocket event frame shapes emitted for subscriptions.
157
+ *
158
+ * @public
159
+ */
152
160
  export type SubscriptionEvent = MarketsContextEvent | MarketContextEvent | OrderbookEvent | CandleEvent | TradesEvent | OrderUpdatesEvent | FillsEvent | PositionsEvent | SpotBalancesEvent | AccountSummaryEvent;
153
161
  //# sourceMappingURL=subscriptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,YAAY,EACb,MAAM,cAAc,CAAA;AAC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AE,QAAQ,CAAC;IAAC,IAAI,EAAE,KAAK,EAAE,CAAA;CAAE,CAAA;AAC9D,qEAAqE;AACrE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE;QACJ,4CAA4C;QAC5C,UAAU,EAAE,SAAS,EAAE,CAAA;QACvB,8DAA8D;QAC9D,aAAa,EAAE,YAAY,EAAE,CAAA;QAC7B;;;WAGG;QACH,UAAU,EAAE,MAAM,EAAE,CAAA;KACrB,CAAA;CACF,CAAA;AACD,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,IAAI,EAAE,CAAA;CAAE,CAAA;AAC3D;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAA;AACvE;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,CAAC,OAAO,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAA;CACvC,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,gBAAgB,CAAA;IACzB,IAAI,EAAE,cAAc,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,WAAW,GACX,iBAAiB,GACjB,UAAU,GACV,cAAc,GACd,iBAAiB,GACjB,mBAAmB,CAAA"}
@@ -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,cAAc;AACd,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC,CAAA;IACpD,WAAW,EAAE,gBAAgB,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC7B,CAAA;AAED,cAAc;AACd,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG;IAClD,SAAS,EAAE,GAAG,CAAA;CACf,CAAA"}
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;;;;;GAKG;AACH,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,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,iEAAiE;AACjE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAErC;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC,CAAA;IACpD,WAAW,EAAE,gBAAgB,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC7B,CAAA;AAED,4EAA4E;AAC5E,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG;IAClD,SAAS,EAAE,GAAG,CAAA;CACf,CAAA"}
@@ -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,MAAM,CAAA;IACtB,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EA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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"}
@@ -1 +1 @@
1
- {"version":3,"file":"vote.js","sourceRoot":"","sources":["../../src/vote.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAA;AA+CnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkC;IAC3D,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1C,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IAClC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;CACvC,CAAA"}
1
+ {"version":3,"file":"vote.js","sourceRoot":"","sources":["../../src/vote.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAA;AA6CnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAkC;IAC3D,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1C,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IAClC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;CACvC,CAAA"}
@@ -2,22 +2,43 @@ import type { Asset } from './asset.js';
2
2
  import type { ActionType, ActivityType, FillClassification, FillStatus, LiquidityRole, MarginMode, OrderSide, OrderType, PositionSide } from './enums.js';
3
3
  import type { MarketDisplay, PerpsMarketDisplay } from './market.js';
4
4
  import type { Address } from './primitives.js';
5
- /** @public */
5
+ /**
6
+ * Maker and taker fee rates for the account's current venue tier.
7
+ * Values are decimal fractions represented as strings (for example, `"0.0002"`).
8
+ *
9
+ * @public
10
+ */
6
11
  export interface FeeTier {
12
+ /** Decimal fraction charged to maker fills, represented as a string. */
7
13
  maker: string;
14
+ /** Decimal fraction charged to taker fills, represented as a string. */
8
15
  taker: string;
9
16
  }
10
- /** @public */
17
+ /**
18
+ * Normalized open perpetual position with prices, margin, and PnL expressed as
19
+ * decimal strings to preserve provider precision.
20
+ *
21
+ * @public
22
+ */
11
23
  export interface Position {
12
24
  market: PerpsMarketDisplay;
13
25
  side: PositionSide;
26
+ /** Position quantity in base-asset units. */
14
27
  size: string;
28
+ /** Average entry price in quote-asset units. */
15
29
  entryPrice: string;
30
+ /** Current provider mark price in quote-asset units. */
16
31
  markPrice: string;
32
+ /** Estimated liquidation price in quote-asset units. */
17
33
  liquidationPrice: string;
34
+ /** Unrealized PnL in quote-currency units. */
18
35
  unrealizedPnl: string;
36
+ /** Position leverage as a numeric multiple. */
19
37
  leverage: number;
20
- /** Margin allocated to the position, excluding unrealized PnL. */
38
+ /**
39
+ * Margin allocated and reserved by this position as a decimal string,
40
+ * excluding unrealized PnL.
41
+ */
21
42
  marginUsed: string;
22
43
  /**
23
44
  * Exact initial margin the venue currently requires for this position.
@@ -38,20 +59,33 @@ export interface PositionMarginConstraints {
38
59
  /** Smallest accepted margin amount, as an exact decimal string. */
39
60
  amountIncrement: string;
40
61
  }
41
- /** @public */
62
+ /**
63
+ * Normalized non-trigger order currently open at a provider.
64
+ *
65
+ * @public
66
+ */
42
67
  export interface OpenOrder {
43
68
  orderId: string;
44
69
  market: MarketDisplay;
45
70
  side: OrderSide;
46
71
  type: OrderType;
72
+ /** Remaining order quantity in base-asset units. */
47
73
  size: string;
74
+ /** Limit/order price in quote-asset units. */
48
75
  price: string;
76
+ /** Quantity already filled in base-asset units. */
49
77
  filledSize: string;
50
78
  reduceOnly: boolean;
51
79
  label?: string;
80
+ /** ISO-8601 creation timestamp. */
52
81
  createdAt: string;
53
82
  }
54
- /** @public */
83
+ /**
84
+ * Asset balance normalized across providers. `units` and `valueUsd` are
85
+ * decimal strings; `valueUsd` is the balance's USD valuation.
86
+ *
87
+ * @public
88
+ */
55
89
  export interface Balance {
56
90
  /** Which category/venue this balance sits in — references a {@link ProviderCategory}. */
57
91
  categoryId: string;
@@ -66,7 +100,12 @@ export interface Balance {
66
100
  */
67
101
  collateralWeight?: number;
68
102
  }
69
- /** @public */
103
+ /**
104
+ * Account snapshot returned by a provider, including balances, positions,
105
+ * aggregate margin/PnL, and provider-specific configuration.
106
+ *
107
+ * @public
108
+ */
70
109
  export interface AccountResponse {
71
110
  provider: string;
72
111
  address: Address;
@@ -76,16 +115,27 @@ export interface AccountResponse {
76
115
  collateralBalances: Balance[];
77
116
  /** Open positions the snapshot already computed; equals the unfiltered `getPositions` output. */
78
117
  positions: Position[];
118
+ /** Margin reserved across the account, represented as a decimal string. */
79
119
  marginUsed: string;
120
+ /** Unrealized account PnL, represented as a decimal string. */
80
121
  unrealizedPnl: string;
81
122
  feeTier: FeeTier;
82
123
  config: AccountConfig;
83
124
  }
84
- /** @public */
125
+ /**
126
+ * Aggregate account values for a provider stream or response. Monetary values
127
+ * are decimal strings in USD.
128
+ *
129
+ * @public
130
+ */
85
131
  export interface AccountSummary {
132
+ /** Total account portfolio value in USD. */
86
133
  portfolioValue: string;
134
+ /** Margin currently available for new orders in USD. */
87
135
  availableMargin: string;
136
+ /** Margin currently reserved by open positions/orders in USD. */
88
137
  marginUsed: string;
138
+ /** Aggregate unrealized PnL in USD. */
89
139
  unrealizedPnl: string;
90
140
  }
91
141
  /**
@@ -98,31 +148,50 @@ export interface MarketSettings {
98
148
  marginMode: MarginMode;
99
149
  leverage: number;
100
150
  }
101
- /** @public */
151
+ /**
152
+ * Normalized take-profit or stop-loss order waiting for its trigger condition.
153
+ *
154
+ * @public
155
+ */
102
156
  export interface TriggerOrder {
103
157
  orderId: string;
104
158
  market: MarketDisplay;
105
159
  type: OrderType;
160
+ /** Triggered quantity in base-asset units. */
106
161
  size: string;
162
+ /** Price at which the trigger activates, in quote-asset units. */
107
163
  triggerPrice: string;
164
+ /** Optional limit price submitted after activation, in quote-asset units. */
108
165
  limitPrice?: string;
109
166
  label?: string;
110
167
  createdAt: string;
111
168
  }
112
- /** @public */
169
+ /**
170
+ * Paginated open-position response for one provider and account.
171
+ *
172
+ * @public
173
+ */
113
174
  export interface PositionsResponse {
114
175
  provider: string;
115
176
  positions: Position[];
116
177
  pagination: Pagination;
117
178
  }
118
- /** @public */
179
+ /**
180
+ * Paginated open-order response containing regular and trigger orders.
181
+ *
182
+ * @public
183
+ */
119
184
  export interface OrdersResponse {
120
185
  provider: string;
121
186
  openOrders: OpenOrder[];
122
187
  triggerOrders: TriggerOrder[];
123
188
  pagination: Pagination;
124
189
  }
125
- /** @public */
190
+ /**
191
+ * Normalized execution/fill record for an order.
192
+ *
193
+ * @public
194
+ */
126
195
  export interface Fill {
127
196
  id: string;
128
197
  orderId: string;
@@ -144,46 +213,81 @@ export interface Fill {
144
213
  startPosition?: string;
145
214
  classification: FillClassification;
146
215
  createdAt: string;
216
+ /** Fully-resolved block-explorer URL for the settling on-chain tx. Absent when
217
+ * the fill has no on-chain settlement tx. */
147
218
  explorerLink?: string;
148
219
  }
149
- /** @public */
220
+ /**
221
+ * Cursor pagination metadata. `cursor` and `nextUrl` are provider-specific
222
+ * continuation values and are absent when no further page exists.
223
+ *
224
+ * @public
225
+ */
150
226
  export interface Pagination {
151
227
  limit: number;
152
228
  hasMore: boolean;
153
229
  cursor?: string;
154
230
  nextUrl?: string;
155
231
  }
156
- /** @public */
232
+ /**
233
+ * Paginated fill response for one provider and account.
234
+ *
235
+ * @public
236
+ */
157
237
  export interface FillsResponse {
158
238
  provider: string;
159
239
  items: Fill[];
160
240
  pagination: Pagination;
161
241
  }
162
- /** @public */
242
+ /**
243
+ * Common identity and timestamp fields shared by account activity records.
244
+ * `timestamp` is an ISO-8601 timestamp string.
245
+ *
246
+ * @public
247
+ */
163
248
  export interface BaseActivity {
164
249
  id: string;
165
250
  provider: string;
166
251
  timestamp: string;
167
252
  }
168
- /** @public */
253
+ /**
254
+ * Account activity representing a completed deposit.
255
+ *
256
+ * @public
257
+ */
169
258
  export interface DepositActivity extends BaseActivity {
170
259
  type: ActivityType.DEPOSIT;
171
260
  amount: string;
261
+ /** Fully-resolved block-explorer URL for the on-chain deposit tx. */
172
262
  explorerLink?: string;
173
263
  }
174
- /** @public */
264
+ /**
265
+ * Account activity representing a completed withdrawal. `amount` and `fee`
266
+ * are decimal strings in the transferred asset's units.
267
+ *
268
+ * @public
269
+ */
175
270
  export interface WithdrawalActivity extends BaseActivity {
176
271
  type: ActivityType.WITHDRAWAL;
177
272
  amount: string;
178
273
  fee: string;
274
+ /** Fully-resolved block-explorer URL for the on-chain withdrawal tx. */
179
275
  explorerLink?: string;
180
276
  }
181
- /** @public */
277
+ /**
278
+ * Position details attached to a liquidation activity.
279
+ *
280
+ * @public
281
+ */
182
282
  export interface LiquidatedPosition {
183
283
  market: MarketDisplay;
184
284
  size: string;
185
285
  }
186
- /** @public */
286
+ /**
287
+ * Account activity representing a liquidation event.
288
+ *
289
+ * @public
290
+ */
187
291
  export interface LiquidationActivity extends BaseActivity {
188
292
  type: ActivityType.LIQUIDATION;
189
293
  liquidatedNotionalPosition: string;
@@ -191,7 +295,12 @@ export interface LiquidationActivity extends BaseActivity {
191
295
  leverageType: string;
192
296
  liquidatedPositions: LiquidatedPosition[];
193
297
  }
194
- /** @public */
298
+ /**
299
+ * Account activity representing a periodic funding payment. Amount and rate
300
+ * retain provider precision as decimal strings.
301
+ *
302
+ * @public
303
+ */
195
304
  export interface FundingActivity extends BaseActivity {
196
305
  type: ActivityType.FUNDING;
197
306
  market: MarketDisplay;
@@ -199,13 +308,19 @@ export interface FundingActivity extends BaseActivity {
199
308
  positionSize: string;
200
309
  fundingRate: string;
201
310
  }
202
- /** @public */
311
+ /**
312
+ * Account activity representing an inbound or outbound transfer. At least one
313
+ * counterparty identifier is required by the type-level union below.
314
+ *
315
+ * @public
316
+ */
203
317
  export type TransferActivity = BaseActivity & {
204
318
  type: ActivityType.TRANSFER;
205
319
  direction: 'IN' | 'OUT';
206
320
  asset: string;
207
321
  amount: string;
208
322
  meta?: Record<string, unknown>;
323
+ /** Fully-resolved block-explorer URL for the on-chain transfer tx. */
209
324
  explorerLink?: string;
210
325
  } & ({
211
326
  counterpartyAccountIndex: number;
@@ -214,24 +329,45 @@ export type TransferActivity = BaseActivity & {
214
329
  counterpartyAccountIndex?: number;
215
330
  counterpartyAddress: string;
216
331
  });
217
- /** @public */
332
+ /**
333
+ * Discriminated union of all activity records returned by a provider.
334
+ *
335
+ * @public
336
+ */
218
337
  export type ActivityItem = DepositActivity | WithdrawalActivity | LiquidationActivity | FundingActivity | TransferActivity;
219
- /** @public */
338
+ /**
339
+ * Paginated account-activity response for one provider and account.
340
+ *
341
+ * @public
342
+ */
220
343
  export interface ActivitiesResponse {
221
344
  provider: string;
222
345
  items: ActivityItem[];
223
346
  pagination: Pagination;
224
347
  }
225
- /** @public */
348
+ /**
349
+ * Provider-specific Hyperliquid agent configuration. The record contents are
350
+ * provider-defined and intentionally left opaque to the shared type package.
351
+ *
352
+ * @public
353
+ */
226
354
  export type HyperliquidAgent = Record<string, unknown>;
227
- /** @public */
355
+ /**
356
+ * Hyperliquid builder-fee approval state for an account.
357
+ *
358
+ * @public
359
+ */
228
360
  export interface HyperliquidBuilderFeeApproval {
229
361
  builderAddress: string;
230
362
  /** Basis points as a string. */
231
363
  maxFeeRate: string;
232
364
  approved: boolean;
233
365
  }
234
- /** @public */
366
+ /**
367
+ * Hyperliquid account configuration returned in {@link AccountResponse.config}.
368
+ *
369
+ * @public
370
+ */
235
371
  export interface HyperliquidAccountConfig {
236
372
  provider: 'hyperliquid';
237
373
  /** `null` means abstraction has never been set. */
@@ -239,7 +375,11 @@ export interface HyperliquidAccountConfig {
239
375
  agents: HyperliquidAgent[];
240
376
  builderFeeApproval?: HyperliquidBuilderFeeApproval;
241
377
  }
242
- /** @public */
378
+ /**
379
+ * Lighter spot-asset collateral setting for a single asset.
380
+ *
381
+ * @public
382
+ */
243
383
  export interface LighterAssetCollateral {
244
384
  /** Provider-native spot asset id (matches `Asset.id`). */
245
385
  assetId: string;
@@ -255,7 +395,12 @@ export interface LighterAssetCollateral {
255
395
  * @public
256
396
  */
257
397
  export type LighterProviderKey = 'lighter' | 'lighter-rh';
258
- /** @public */
398
+ /**
399
+ * Lighter account configuration returned in {@link AccountResponse.config}.
400
+ * Numeric identifiers and account modes use the provider's wire values.
401
+ *
402
+ * @public
403
+ */
259
404
  export interface LighterAccountConfig {
260
405
  provider: LighterProviderKey;
261
406
  accountIndex: number;
@@ -285,7 +430,12 @@ export interface LighterAccountConfig {
285
430
  */
286
431
  referralPresent: boolean;
287
432
  }
288
- /** @public */
433
+ /**
434
+ * Ondo account/session configuration returned in {@link AccountResponse.config}.
435
+ * Expiry values are Unix timestamps in seconds.
436
+ *
437
+ * @public
438
+ */
289
439
  export interface OndoAccountConfig {
290
440
  provider: 'ondo';
291
441
  loggedIn: boolean;
@@ -300,15 +450,28 @@ export interface OndoAccountConfig {
300
450
  /** Canonical Ethereum USDC deposit address, or `null` when none is provisioned. */
301
451
  depositAddress: string | null;
302
452
  }
303
- /** @public */
453
+ /**
454
+ * Provider-specific account configuration discriminated by its `provider` key.
455
+ *
456
+ * @public
457
+ */
304
458
  export type AccountConfig = HyperliquidAccountConfig | LighterAccountConfig | OndoAccountConfig;
305
- /** @public */
459
+ /**
460
+ * Named account-configuration value exposed to clients.
461
+ *
462
+ * @public
463
+ */
306
464
  export interface AccountConfigValue {
307
465
  name: string;
308
466
  /** `null` means no current value — consumers fall back to the descriptor default. */
309
467
  value: string | number | boolean | null;
310
468
  }
311
- /** @public */
469
+ /**
470
+ * Account-configuration action and its available values, optionally including
471
+ * whether the setting is currently satisfied.
472
+ *
473
+ * @public
474
+ */
312
475
  export interface AccountConfigSetting {
313
476
  type: ActionType;
314
477
  values: AccountConfigValue[];