zklighter-perps 1.0.129 → 1.0.130

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.
@@ -125,6 +125,7 @@ models/RespGetFastBridgeInfo.ts
125
125
  models/RespGetFastwithdrawalInfo.ts
126
126
  models/ResultCode.ts
127
127
  models/RiskInfo.ts
128
+ models/RiskParameters.ts
128
129
  models/SimpleOrder.ts
129
130
  models/Status.ts
130
131
  models/SubAccounts.ts
package/models/Account.ts CHANGED
@@ -61,6 +61,12 @@ export interface Account {
61
61
  * @memberof Account
62
62
  */
63
63
  total_order_count: number;
64
+ /**
65
+ *
66
+ * @type {number}
67
+ * @memberof Account
68
+ */
69
+ total_isolated_order_count: number;
64
70
  /**
65
71
  *
66
72
  * @type {number}
@@ -91,6 +97,7 @@ export function instanceOfAccount(value: object): value is Account {
91
97
  if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
92
98
  if (!('cancel_all_time' in value) || value['cancel_all_time'] === undefined) return false;
93
99
  if (!('total_order_count' in value) || value['total_order_count'] === undefined) return false;
100
+ if (!('total_isolated_order_count' in value) || value['total_isolated_order_count'] === undefined) return false;
94
101
  if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
95
102
  if (!('status' in value) || value['status'] === undefined) return false;
96
103
  if (!('collateral' in value) || value['collateral'] === undefined) return false;
@@ -114,6 +121,7 @@ export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): A
114
121
  'l1_address': json['l1_address'],
115
122
  'cancel_all_time': json['cancel_all_time'],
116
123
  'total_order_count': json['total_order_count'],
124
+ 'total_isolated_order_count': json['total_isolated_order_count'],
117
125
  'pending_order_count': json['pending_order_count'],
118
126
  'status': json['status'],
119
127
  'collateral': json['collateral'],
@@ -133,6 +141,7 @@ export function AccountToJSON(value?: Account | null): any {
133
141
  'l1_address': value['l1_address'],
134
142
  'cancel_all_time': value['cancel_all_time'],
135
143
  'total_order_count': value['total_order_count'],
144
+ 'total_isolated_order_count': value['total_isolated_order_count'],
136
145
  'pending_order_count': value['pending_order_count'],
137
146
  'status': value['status'],
138
147
  'collateral': value['collateral'],
@@ -97,6 +97,18 @@ export interface AccountPosition {
97
97
  * @memberof AccountPosition
98
98
  */
99
99
  total_funding_paid_out?: string;
100
+ /**
101
+ *
102
+ * @type {number}
103
+ * @memberof AccountPosition
104
+ */
105
+ margin_mode: number;
106
+ /**
107
+ *
108
+ * @type {string}
109
+ * @memberof AccountPosition
110
+ */
111
+ allocated_margin: string;
100
112
  }
101
113
 
102
114
  /**
@@ -115,6 +127,8 @@ export function instanceOfAccountPosition(value: object): value is AccountPositi
115
127
  if (!('position_value' in value) || value['position_value'] === undefined) return false;
116
128
  if (!('unrealized_pnl' in value) || value['unrealized_pnl'] === undefined) return false;
117
129
  if (!('realized_pnl' in value) || value['realized_pnl'] === undefined) return false;
130
+ if (!('margin_mode' in value) || value['margin_mode'] === undefined) return false;
131
+ if (!('allocated_margin' in value) || value['allocated_margin'] === undefined) return false;
118
132
  return true;
119
133
  }
120
134
 
@@ -141,6 +155,8 @@ export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boo
141
155
  'unrealized_pnl': json['unrealized_pnl'],
142
156
  'realized_pnl': json['realized_pnl'],
143
157
  'total_funding_paid_out': json['total_funding_paid_out'] == null ? undefined : json['total_funding_paid_out'],
158
+ 'margin_mode': json['margin_mode'],
159
+ 'allocated_margin': json['allocated_margin'],
144
160
  };
145
161
  }
146
162
 
@@ -163,6 +179,8 @@ export function AccountPositionToJSON(value?: AccountPosition | null): any {
163
179
  'unrealized_pnl': value['unrealized_pnl'],
164
180
  'realized_pnl': value['realized_pnl'],
165
181
  'total_funding_paid_out': value['total_funding_paid_out'],
182
+ 'margin_mode': value['margin_mode'],
183
+ 'allocated_margin': value['allocated_margin'],
166
184
  };
167
185
  }
168
186
 
@@ -80,6 +80,12 @@ export interface DetailedAccount {
80
80
  * @memberof DetailedAccount
81
81
  */
82
82
  total_order_count: number;
83
+ /**
84
+ *
85
+ * @type {number}
86
+ * @memberof DetailedAccount
87
+ */
88
+ total_isolated_order_count: number;
83
89
  /**
84
90
  *
85
91
  * @type {number}
@@ -164,6 +170,7 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
164
170
  if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
165
171
  if (!('cancel_all_time' in value) || value['cancel_all_time'] === undefined) return false;
166
172
  if (!('total_order_count' in value) || value['total_order_count'] === undefined) return false;
173
+ if (!('total_isolated_order_count' in value) || value['total_isolated_order_count'] === undefined) return false;
167
174
  if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
168
175
  if (!('status' in value) || value['status'] === undefined) return false;
169
176
  if (!('collateral' in value) || value['collateral'] === undefined) return false;
@@ -196,6 +203,7 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
196
203
  'l1_address': json['l1_address'],
197
204
  'cancel_all_time': json['cancel_all_time'],
198
205
  'total_order_count': json['total_order_count'],
206
+ 'total_isolated_order_count': json['total_isolated_order_count'],
199
207
  'pending_order_count': json['pending_order_count'],
200
208
  'status': json['status'],
201
209
  'collateral': json['collateral'],
@@ -224,6 +232,7 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
224
232
  'l1_address': value['l1_address'],
225
233
  'cancel_all_time': value['cancel_all_time'],
226
234
  'total_order_count': value['total_order_count'],
235
+ 'total_isolated_order_count': value['total_isolated_order_count'],
227
236
  'pending_order_count': value['pending_order_count'],
228
237
  'status': value['status'],
229
238
  'collateral': value['collateral'],
@@ -74,6 +74,12 @@ export interface PublicPool {
74
74
  * @memberof PublicPool
75
75
  */
76
76
  total_order_count: number;
77
+ /**
78
+ *
79
+ * @type {number}
80
+ * @memberof PublicPool
81
+ */
82
+ total_isolated_order_count: number;
77
83
  /**
78
84
  *
79
85
  * @type {number}
@@ -152,6 +158,7 @@ export function instanceOfPublicPool(value: object): value is PublicPool {
152
158
  if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
153
159
  if (!('cancel_all_time' in value) || value['cancel_all_time'] === undefined) return false;
154
160
  if (!('total_order_count' in value) || value['total_order_count'] === undefined) return false;
161
+ if (!('total_isolated_order_count' in value) || value['total_isolated_order_count'] === undefined) return false;
155
162
  if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
156
163
  if (!('status' in value) || value['status'] === undefined) return false;
157
164
  if (!('collateral' in value) || value['collateral'] === undefined) return false;
@@ -182,6 +189,7 @@ export function PublicPoolFromJSONTyped(json: any, ignoreDiscriminator: boolean)
182
189
  'l1_address': json['l1_address'],
183
190
  'cancel_all_time': json['cancel_all_time'],
184
191
  'total_order_count': json['total_order_count'],
192
+ 'total_isolated_order_count': json['total_isolated_order_count'],
185
193
  'pending_order_count': json['pending_order_count'],
186
194
  'status': json['status'],
187
195
  'collateral': json['collateral'],
@@ -209,6 +217,7 @@ export function PublicPoolToJSON(value?: PublicPool | null): any {
209
217
  'l1_address': value['l1_address'],
210
218
  'cancel_all_time': value['cancel_all_time'],
211
219
  'total_order_count': value['total_order_count'],
220
+ 'total_isolated_order_count': value['total_isolated_order_count'],
212
221
  'pending_order_count': value['pending_order_count'],
213
222
  'status': value['status'],
214
223
  'collateral': value['collateral'],
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { RiskParameters } from './RiskParameters';
17
+ import {
18
+ RiskParametersFromJSON,
19
+ RiskParametersFromJSONTyped,
20
+ RiskParametersToJSON,
21
+ } from './RiskParameters';
22
+
16
23
  /**
17
24
  *
18
25
  * @export
@@ -21,45 +28,24 @@ import { mapValues } from '../runtime';
21
28
  export interface RiskInfo {
22
29
  /**
23
30
  *
24
- * @type {string}
25
- * @memberof RiskInfo
26
- */
27
- collateral: string;
28
- /**
29
- *
30
- * @type {string}
31
- * @memberof RiskInfo
32
- */
33
- total_account_value: string;
34
- /**
35
- *
36
- * @type {string}
37
- * @memberof RiskInfo
38
- */
39
- initial_margin_req: string;
40
- /**
41
- *
42
- * @type {string}
31
+ * @type {RiskParameters}
43
32
  * @memberof RiskInfo
44
33
  */
45
- maintenance_margin_req: string;
34
+ cross_risk_parameters: RiskParameters;
46
35
  /**
47
36
  *
48
- * @type {string}
37
+ * @type {Array<RiskParameters>}
49
38
  * @memberof RiskInfo
50
39
  */
51
- close_out_margin_req: string;
40
+ isolated_risk_parameters: Array<RiskParameters>;
52
41
  }
53
42
 
54
43
  /**
55
44
  * Check if a given object implements the RiskInfo interface.
56
45
  */
57
46
  export function instanceOfRiskInfo(value: object): value is RiskInfo {
58
- if (!('collateral' in value) || value['collateral'] === undefined) return false;
59
- if (!('total_account_value' in value) || value['total_account_value'] === undefined) return false;
60
- if (!('initial_margin_req' in value) || value['initial_margin_req'] === undefined) return false;
61
- if (!('maintenance_margin_req' in value) || value['maintenance_margin_req'] === undefined) return false;
62
- if (!('close_out_margin_req' in value) || value['close_out_margin_req'] === undefined) return false;
47
+ if (!('cross_risk_parameters' in value) || value['cross_risk_parameters'] === undefined) return false;
48
+ if (!('isolated_risk_parameters' in value) || value['isolated_risk_parameters'] === undefined) return false;
63
49
  return true;
64
50
  }
65
51
 
@@ -73,11 +59,8 @@ export function RiskInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean):
73
59
  }
74
60
  return {
75
61
 
76
- 'collateral': json['collateral'],
77
- 'total_account_value': json['total_account_value'],
78
- 'initial_margin_req': json['initial_margin_req'],
79
- 'maintenance_margin_req': json['maintenance_margin_req'],
80
- 'close_out_margin_req': json['close_out_margin_req'],
62
+ 'cross_risk_parameters': RiskParametersFromJSON(json['cross_risk_parameters']),
63
+ 'isolated_risk_parameters': ((json['isolated_risk_parameters'] as Array<any>).map(RiskParametersFromJSON)),
81
64
  };
82
65
  }
83
66
 
@@ -87,11 +70,8 @@ export function RiskInfoToJSON(value?: RiskInfo | null): any {
87
70
  }
88
71
  return {
89
72
 
90
- 'collateral': value['collateral'],
91
- 'total_account_value': value['total_account_value'],
92
- 'initial_margin_req': value['initial_margin_req'],
93
- 'maintenance_margin_req': value['maintenance_margin_req'],
94
- 'close_out_margin_req': value['close_out_margin_req'],
73
+ 'cross_risk_parameters': RiskParametersToJSON(value['cross_risk_parameters']),
74
+ 'isolated_risk_parameters': ((value['isolated_risk_parameters'] as Array<any>).map(RiskParametersToJSON)),
95
75
  };
96
76
  }
97
77
 
package/models/index.ts CHANGED
@@ -113,6 +113,7 @@ export * from './RespGetFastBridgeInfo';
113
113
  export * from './RespGetFastwithdrawalInfo';
114
114
  export * from './ResultCode';
115
115
  export * from './RiskInfo';
116
+ export * from './RiskParameters';
116
117
  export * from './SimpleOrder';
117
118
  export * from './Status';
118
119
  export * from './SubAccounts';
package/openapi.json CHANGED
@@ -2830,6 +2830,11 @@
2830
2830
  "format": "int64",
2831
2831
  "example": "100"
2832
2832
  },
2833
+ "total_isolated_order_count": {
2834
+ "type": "integer",
2835
+ "format": "int64",
2836
+ "example": "100"
2837
+ },
2833
2838
  "pending_order_count": {
2834
2839
  "type": "integer",
2835
2840
  "format": "int64",
@@ -2853,6 +2858,7 @@
2853
2858
  "l1_address",
2854
2859
  "cancel_all_time",
2855
2860
  "total_order_count",
2861
+ "total_isolated_order_count",
2856
2862
  "pending_order_count",
2857
2863
  "status",
2858
2864
  "collateral"
@@ -3135,6 +3141,15 @@
3135
3141
  "total_funding_paid_out": {
3136
3142
  "type": "string",
3137
3143
  "example": "34.2"
3144
+ },
3145
+ "margin_mode": {
3146
+ "type": "integer",
3147
+ "format": "int32",
3148
+ "example": "1"
3149
+ },
3150
+ "allocated_margin": {
3151
+ "type": "string",
3152
+ "example": "46342"
3138
3153
  }
3139
3154
  },
3140
3155
  "title": "AccountPosition",
@@ -3150,7 +3165,9 @@
3150
3165
  "avg_entry_price",
3151
3166
  "position_value",
3152
3167
  "unrealized_pnl",
3153
- "realized_pnl"
3168
+ "realized_pnl",
3169
+ "margin_mode",
3170
+ "allocated_margin"
3154
3171
  ]
3155
3172
  },
3156
3173
  "AccountStats": {
@@ -3821,6 +3838,11 @@
3821
3838
  "format": "int64",
3822
3839
  "example": "100"
3823
3840
  },
3841
+ "total_isolated_order_count": {
3842
+ "type": "integer",
3843
+ "format": "int64",
3844
+ "example": "100"
3845
+ },
3824
3846
  "pending_order_count": {
3825
3847
  "type": "integer",
3826
3848
  "format": "int64",
@@ -3882,6 +3904,7 @@
3882
3904
  "l1_address",
3883
3905
  "cancel_all_time",
3884
3906
  "total_order_count",
3907
+ "total_isolated_order_count",
3885
3908
  "pending_order_count",
3886
3909
  "status",
3887
3910
  "collateral",
@@ -5523,6 +5546,11 @@
5523
5546
  "format": "int64",
5524
5547
  "example": "100"
5525
5548
  },
5549
+ "total_isolated_order_count": {
5550
+ "type": "integer",
5551
+ "format": "int64",
5552
+ "example": "100"
5553
+ },
5526
5554
  "pending_order_count": {
5527
5555
  "type": "integer",
5528
5556
  "format": "int64",
@@ -5575,6 +5603,7 @@
5575
5603
  "l1_address",
5576
5604
  "cancel_all_time",
5577
5605
  "total_order_count",
5606
+ "total_isolated_order_count",
5578
5607
  "pending_order_count",
5579
5608
  "status",
5580
5609
  "collateral",
@@ -7055,6 +7084,29 @@
7055
7084
  "RiskInfo": {
7056
7085
  "type": "object",
7057
7086
  "properties": {
7087
+ "cross_risk_parameters": {
7088
+ "$ref": "#/definitions/RiskParameters"
7089
+ },
7090
+ "isolated_risk_parameters": {
7091
+ "type": "array",
7092
+ "items": {
7093
+ "$ref": "#/definitions/RiskParameters"
7094
+ }
7095
+ }
7096
+ },
7097
+ "title": "RiskInfo",
7098
+ "required": [
7099
+ "cross_risk_parameters",
7100
+ "isolated_risk_parameters"
7101
+ ]
7102
+ },
7103
+ "RiskParameters": {
7104
+ "type": "object",
7105
+ "properties": {
7106
+ "market_id": {
7107
+ "type": "integer",
7108
+ "format": "uint8"
7109
+ },
7058
7110
  "collateral": {
7059
7111
  "type": "string"
7060
7112
  },
@@ -7071,8 +7123,9 @@
7071
7123
  "type": "string"
7072
7124
  }
7073
7125
  },
7074
- "title": "RiskInfo",
7126
+ "title": "RiskParameters",
7075
7127
  "required": [
7128
+ "market_id",
7076
7129
  "collateral",
7077
7130
  "total_account_value",
7078
7131
  "initial_margin_req",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.129",
3
+ "version": "1.0.130",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {