zklighter-perps 1.0.239 → 1.0.241

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.
@@ -37,6 +37,7 @@ models/ApiToken.ts
37
37
  models/ApprovedIntegrator.ts
38
38
  models/Asset.ts
39
39
  models/AssetDetails.ts
40
+ models/AssetStats.ts
40
41
  models/Auth.ts
41
42
  models/Block.ts
42
43
  models/Blocks.ts
@@ -43,8 +43,31 @@ export interface AccountAsset {
43
43
  * @memberof AccountAsset
44
44
  */
45
45
  locked_balance: string;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof AccountAsset
50
+ */
51
+ margin_mode: AccountAssetMarginModeEnum;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof AccountAsset
56
+ */
57
+ margin_balance: string;
46
58
  }
47
59
 
60
+
61
+ /**
62
+ * @export
63
+ */
64
+ export const AccountAssetMarginModeEnum = {
65
+ Enabled: 'enabled',
66
+ Disabled: 'disabled'
67
+ } as const;
68
+ export type AccountAssetMarginModeEnum = typeof AccountAssetMarginModeEnum[keyof typeof AccountAssetMarginModeEnum];
69
+
70
+
48
71
  /**
49
72
  * Check if a given object implements the AccountAsset interface.
50
73
  */
@@ -53,6 +76,8 @@ export function instanceOfAccountAsset(value: object): value is AccountAsset {
53
76
  if (!('asset_id' in value) || value['asset_id'] === undefined) return false;
54
77
  if (!('balance' in value) || value['balance'] === undefined) return false;
55
78
  if (!('locked_balance' in value) || value['locked_balance'] === undefined) return false;
79
+ if (!('margin_mode' in value) || value['margin_mode'] === undefined) return false;
80
+ if (!('margin_balance' in value) || value['margin_balance'] === undefined) return false;
56
81
  return true;
57
82
  }
58
83
 
@@ -70,6 +95,8 @@ export function AccountAssetFromJSONTyped(json: any, ignoreDiscriminator: boolea
70
95
  'asset_id': json['asset_id'],
71
96
  'balance': json['balance'],
72
97
  'locked_balance': json['locked_balance'],
98
+ 'margin_mode': json['margin_mode'],
99
+ 'margin_balance': json['margin_balance'],
73
100
  };
74
101
  }
75
102
 
@@ -83,6 +110,8 @@ export function AccountAssetToJSON(value?: AccountAsset | null): any {
83
110
  'asset_id': value['asset_id'],
84
111
  'balance': value['balance'],
85
112
  'locked_balance': value['locked_balance'],
113
+ 'margin_mode': value['margin_mode'],
114
+ 'margin_balance': value['margin_balance'],
86
115
  };
87
116
  }
88
117
 
package/models/Asset.ts CHANGED
@@ -67,12 +67,60 @@ export interface Asset {
67
67
  * @memberof Asset
68
68
  */
69
69
  index_price: string;
70
+ /**
71
+ *
72
+ * @type {number}
73
+ * @memberof Asset
74
+ */
75
+ price_decimals: number;
70
76
  /**
71
77
  *
72
78
  * @type {string}
73
79
  * @memberof Asset
74
80
  */
75
81
  l1_address: string;
82
+ /**
83
+ *
84
+ * @type {string}
85
+ * @memberof Asset
86
+ */
87
+ loan_to_value: string;
88
+ /**
89
+ *
90
+ * @type {string}
91
+ * @memberof Asset
92
+ */
93
+ liquidation_threshold: string;
94
+ /**
95
+ *
96
+ * @type {string}
97
+ * @memberof Asset
98
+ */
99
+ liquidation_factor: string;
100
+ /**
101
+ *
102
+ * @type {string}
103
+ * @memberof Asset
104
+ */
105
+ liquidation_fee: string;
106
+ /**
107
+ *
108
+ * @type {string}
109
+ * @memberof Asset
110
+ */
111
+ global_supply_cap: string;
112
+ /**
113
+ *
114
+ * @type {string}
115
+ * @memberof Asset
116
+ */
117
+ user_supply_cap: string;
118
+ /**
119
+ *
120
+ * @type {string}
121
+ * @memberof Asset
122
+ */
123
+ total_supplied: string;
76
124
  }
77
125
 
78
126
 
@@ -98,7 +146,15 @@ export function instanceOfAsset(value: object): value is Asset {
98
146
  if (!('min_withdrawal_amount' in value) || value['min_withdrawal_amount'] === undefined) return false;
99
147
  if (!('margin_mode' in value) || value['margin_mode'] === undefined) return false;
100
148
  if (!('index_price' in value) || value['index_price'] === undefined) return false;
149
+ if (!('price_decimals' in value) || value['price_decimals'] === undefined) return false;
101
150
  if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
151
+ if (!('loan_to_value' in value) || value['loan_to_value'] === undefined) return false;
152
+ if (!('liquidation_threshold' in value) || value['liquidation_threshold'] === undefined) return false;
153
+ if (!('liquidation_factor' in value) || value['liquidation_factor'] === undefined) return false;
154
+ if (!('liquidation_fee' in value) || value['liquidation_fee'] === undefined) return false;
155
+ if (!('global_supply_cap' in value) || value['global_supply_cap'] === undefined) return false;
156
+ if (!('user_supply_cap' in value) || value['user_supply_cap'] === undefined) return false;
157
+ if (!('total_supplied' in value) || value['total_supplied'] === undefined) return false;
102
158
  return true;
103
159
  }
104
160
 
@@ -120,7 +176,15 @@ export function AssetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ass
120
176
  'min_withdrawal_amount': json['min_withdrawal_amount'],
121
177
  'margin_mode': json['margin_mode'],
122
178
  'index_price': json['index_price'],
179
+ 'price_decimals': json['price_decimals'],
123
180
  'l1_address': json['l1_address'],
181
+ 'loan_to_value': json['loan_to_value'],
182
+ 'liquidation_threshold': json['liquidation_threshold'],
183
+ 'liquidation_factor': json['liquidation_factor'],
184
+ 'liquidation_fee': json['liquidation_fee'],
185
+ 'global_supply_cap': json['global_supply_cap'],
186
+ 'user_supply_cap': json['user_supply_cap'],
187
+ 'total_supplied': json['total_supplied'],
124
188
  };
125
189
  }
126
190
 
@@ -138,7 +202,15 @@ export function AssetToJSON(value?: Asset | null): any {
138
202
  'min_withdrawal_amount': value['min_withdrawal_amount'],
139
203
  'margin_mode': value['margin_mode'],
140
204
  'index_price': value['index_price'],
205
+ 'price_decimals': value['price_decimals'],
141
206
  'l1_address': value['l1_address'],
207
+ 'loan_to_value': value['loan_to_value'],
208
+ 'liquidation_threshold': value['liquidation_threshold'],
209
+ 'liquidation_factor': value['liquidation_factor'],
210
+ 'liquidation_fee': value['liquidation_fee'],
211
+ 'global_supply_cap': value['global_supply_cap'],
212
+ 'user_supply_cap': value['user_supply_cap'],
213
+ 'total_supplied': value['total_supplied'],
142
214
  };
143
215
  }
144
216
 
@@ -31,6 +31,12 @@ export interface AssetStats {
31
31
  * @memberof AssetStats
32
32
  */
33
33
  index_price: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof AssetStats
38
+ */
39
+ total_supplied: string;
34
40
  }
35
41
 
36
42
  /**
@@ -39,6 +45,7 @@ export interface AssetStats {
39
45
  export function instanceOfAssetStats(value: object): value is AssetStats {
40
46
  if (!('asset_id' in value) || value['asset_id'] === undefined) return false;
41
47
  if (!('index_price' in value) || value['index_price'] === undefined) return false;
48
+ if (!('total_supplied' in value) || value['total_supplied'] === undefined) return false;
42
49
  return true;
43
50
  }
44
51
 
@@ -54,6 +61,7 @@ export function AssetStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean)
54
61
 
55
62
  'asset_id': json['asset_id'],
56
63
  'index_price': json['index_price'],
64
+ 'total_supplied': json['total_supplied'],
57
65
  };
58
66
  }
59
67
 
@@ -65,6 +73,7 @@ export function AssetStatsToJSON(value?: AssetStats | null): any {
65
73
 
66
74
  'asset_id': value['asset_id'],
67
75
  'index_price': value['index_price'],
76
+ 'total_supplied': value['total_supplied'],
68
77
  };
69
78
  }
70
79
 
@@ -30,31 +30,49 @@ export interface RiskParameters {
30
30
  * @type {string}
31
31
  * @memberof RiskParameters
32
32
  */
33
- collateral: string;
33
+ total_account_value: string;
34
34
  /**
35
35
  *
36
36
  * @type {string}
37
37
  * @memberof RiskParameters
38
38
  */
39
- total_account_value: string;
39
+ initial_margin_req: string;
40
40
  /**
41
41
  *
42
42
  * @type {string}
43
43
  * @memberof RiskParameters
44
44
  */
45
- initial_margin_req: string;
45
+ maintenance_margin_req: string;
46
46
  /**
47
47
  *
48
48
  * @type {string}
49
49
  * @memberof RiskParameters
50
50
  */
51
- maintenance_margin_req: string;
51
+ close_out_margin_req: string;
52
52
  /**
53
53
  *
54
54
  * @type {string}
55
55
  * @memberof RiskParameters
56
56
  */
57
- close_out_margin_req: string;
57
+ total_account_liquidation_threshold: string;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof RiskParameters
62
+ */
63
+ collateral: string;
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof RiskParameters
68
+ */
69
+ usdc_collateral_with_funding: string;
70
+ /**
71
+ *
72
+ * @type {string}
73
+ * @memberof RiskParameters
74
+ */
75
+ usdc_portfolio_value: string;
58
76
  }
59
77
 
60
78
  /**
@@ -62,11 +80,14 @@ export interface RiskParameters {
62
80
  */
63
81
  export function instanceOfRiskParameters(value: object): value is RiskParameters {
64
82
  if (!('market_id' in value) || value['market_id'] === undefined) return false;
65
- if (!('collateral' in value) || value['collateral'] === undefined) return false;
66
83
  if (!('total_account_value' in value) || value['total_account_value'] === undefined) return false;
67
84
  if (!('initial_margin_req' in value) || value['initial_margin_req'] === undefined) return false;
68
85
  if (!('maintenance_margin_req' in value) || value['maintenance_margin_req'] === undefined) return false;
69
86
  if (!('close_out_margin_req' in value) || value['close_out_margin_req'] === undefined) return false;
87
+ if (!('total_account_liquidation_threshold' in value) || value['total_account_liquidation_threshold'] === undefined) return false;
88
+ if (!('collateral' in value) || value['collateral'] === undefined) return false;
89
+ if (!('usdc_collateral_with_funding' in value) || value['usdc_collateral_with_funding'] === undefined) return false;
90
+ if (!('usdc_portfolio_value' in value) || value['usdc_portfolio_value'] === undefined) return false;
70
91
  return true;
71
92
  }
72
93
 
@@ -81,11 +102,14 @@ export function RiskParametersFromJSONTyped(json: any, ignoreDiscriminator: bool
81
102
  return {
82
103
 
83
104
  'market_id': json['market_id'],
84
- 'collateral': json['collateral'],
85
105
  'total_account_value': json['total_account_value'],
86
106
  'initial_margin_req': json['initial_margin_req'],
87
107
  'maintenance_margin_req': json['maintenance_margin_req'],
88
108
  'close_out_margin_req': json['close_out_margin_req'],
109
+ 'total_account_liquidation_threshold': json['total_account_liquidation_threshold'],
110
+ 'collateral': json['collateral'],
111
+ 'usdc_collateral_with_funding': json['usdc_collateral_with_funding'],
112
+ 'usdc_portfolio_value': json['usdc_portfolio_value'],
89
113
  };
90
114
  }
91
115
 
@@ -96,11 +120,14 @@ export function RiskParametersToJSON(value?: RiskParameters | null): any {
96
120
  return {
97
121
 
98
122
  'market_id': value['market_id'],
99
- 'collateral': value['collateral'],
100
123
  'total_account_value': value['total_account_value'],
101
124
  'initial_margin_req': value['initial_margin_req'],
102
125
  'maintenance_margin_req': value['maintenance_margin_req'],
103
126
  'close_out_margin_req': value['close_out_margin_req'],
127
+ 'total_account_liquidation_threshold': value['total_account_liquidation_threshold'],
128
+ 'collateral': value['collateral'],
129
+ 'usdc_collateral_with_funding': value['usdc_collateral_with_funding'],
130
+ 'usdc_portfolio_value': value['usdc_portfolio_value'],
104
131
  };
105
132
  }
106
133
 
package/models/index.ts CHANGED
@@ -21,6 +21,7 @@ export * from './ApiToken';
21
21
  export * from './ApprovedIntegrator';
22
22
  export * from './Asset';
23
23
  export * from './AssetDetails';
24
+ export * from './AssetStats';
24
25
  export * from './Auth';
25
26
  export * from './Block';
26
27
  export * from './Blocks';
package/openapi.json CHANGED
@@ -689,8 +689,7 @@
689
689
  "in": "query",
690
690
  "required": false,
691
691
  "type": "integer",
692
- "format": "int16",
693
- "default": "0"
692
+ "format": "int16"
694
693
  }
695
694
  ],
696
695
  "tags": [
@@ -4812,6 +4811,18 @@
4812
4811
  "locked_balance": {
4813
4812
  "type": "string",
4814
4813
  "example": "1000"
4814
+ },
4815
+ "margin_mode": {
4816
+ "type": "string",
4817
+ "example": "enabled",
4818
+ "enum": [
4819
+ "enabled",
4820
+ "disabled"
4821
+ ]
4822
+ },
4823
+ "margin_balance": {
4824
+ "type": "string",
4825
+ "example": "1000"
4815
4826
  }
4816
4827
  },
4817
4828
  "title": "AccountAsset",
@@ -4819,7 +4830,9 @@
4819
4830
  "symbol",
4820
4831
  "asset_id",
4821
4832
  "balance",
4822
- "locked_balance"
4833
+ "locked_balance",
4834
+ "margin_mode",
4835
+ "margin_balance"
4823
4836
  ]
4824
4837
  },
4825
4838
  "AccountLimits": {
@@ -5571,9 +5584,42 @@
5571
5584
  "type": "string",
5572
5585
  "example": "3024.66"
5573
5586
  },
5587
+ "price_decimals": {
5588
+ "type": "integer",
5589
+ "format": "uint8",
5590
+ "example": "4"
5591
+ },
5574
5592
  "l1_address": {
5575
5593
  "type": "string",
5576
5594
  "example": "0x0000000000000000000000000000000000000000"
5595
+ },
5596
+ "loan_to_value": {
5597
+ "type": "string",
5598
+ "example": "0.5"
5599
+ },
5600
+ "liquidation_threshold": {
5601
+ "type": "string",
5602
+ "example": "0.8"
5603
+ },
5604
+ "liquidation_factor": {
5605
+ "type": "string",
5606
+ "example": "0.9"
5607
+ },
5608
+ "liquidation_fee": {
5609
+ "type": "string",
5610
+ "example": "0.01"
5611
+ },
5612
+ "global_supply_cap": {
5613
+ "type": "string",
5614
+ "example": "1000000"
5615
+ },
5616
+ "user_supply_cap": {
5617
+ "type": "string",
5618
+ "example": "1000"
5619
+ },
5620
+ "total_supplied": {
5621
+ "type": "string",
5622
+ "example": "100"
5577
5623
  }
5578
5624
  },
5579
5625
  "title": "Asset",
@@ -5586,7 +5632,15 @@
5586
5632
  "min_withdrawal_amount",
5587
5633
  "margin_mode",
5588
5634
  "index_price",
5589
- "l1_address"
5635
+ "price_decimals",
5636
+ "l1_address",
5637
+ "loan_to_value",
5638
+ "liquidation_threshold",
5639
+ "liquidation_factor",
5640
+ "liquidation_fee",
5641
+ "global_supply_cap",
5642
+ "user_supply_cap",
5643
+ "total_supplied"
5590
5644
  ]
5591
5645
  },
5592
5646
  "AssetDetails": {
@@ -5613,6 +5667,30 @@
5613
5667
  "asset_details"
5614
5668
  ]
5615
5669
  },
5670
+ "AssetStats": {
5671
+ "type": "object",
5672
+ "properties": {
5673
+ "asset_id": {
5674
+ "type": "integer",
5675
+ "format": "int16",
5676
+ "example": "1"
5677
+ },
5678
+ "index_price": {
5679
+ "type": "string",
5680
+ "example": "3024.66"
5681
+ },
5682
+ "total_supplied": {
5683
+ "type": "string",
5684
+ "example": "100"
5685
+ }
5686
+ },
5687
+ "title": "AssetStats",
5688
+ "required": [
5689
+ "asset_id",
5690
+ "index_price",
5691
+ "total_supplied"
5692
+ ]
5693
+ },
5616
5694
  "Auth": {
5617
5695
  "type": "object",
5618
5696
  "properties": {
@@ -9989,8 +10067,7 @@
9989
10067
  "properties": {
9990
10068
  "asset_id": {
9991
10069
  "type": "integer",
9992
- "format": "int16",
9993
- "default": "0"
10070
+ "format": "int16"
9994
10071
  }
9995
10072
  },
9996
10073
  "title": "ReqGetAssetDetails"
@@ -12416,9 +12493,6 @@
12416
12493
  "type": "integer",
12417
12494
  "format": "int16"
12418
12495
  },
12419
- "collateral": {
12420
- "type": "string"
12421
- },
12422
12496
  "total_account_value": {
12423
12497
  "type": "string"
12424
12498
  },
@@ -12430,16 +12504,31 @@
12430
12504
  },
12431
12505
  "close_out_margin_req": {
12432
12506
  "type": "string"
12507
+ },
12508
+ "total_account_liquidation_threshold": {
12509
+ "type": "string"
12510
+ },
12511
+ "collateral": {
12512
+ "type": "string"
12513
+ },
12514
+ "usdc_collateral_with_funding": {
12515
+ "type": "string"
12516
+ },
12517
+ "usdc_portfolio_value": {
12518
+ "type": "string"
12433
12519
  }
12434
12520
  },
12435
12521
  "title": "RiskParameters",
12436
12522
  "required": [
12437
12523
  "market_id",
12438
- "collateral",
12439
12524
  "total_account_value",
12440
12525
  "initial_margin_req",
12441
12526
  "maintenance_margin_req",
12442
- "close_out_margin_req"
12527
+ "close_out_margin_req",
12528
+ "total_account_liquidation_threshold",
12529
+ "collateral",
12530
+ "usdc_collateral_with_funding",
12531
+ "usdc_portfolio_value"
12443
12532
  ]
12444
12533
  },
12445
12534
  "SharePrice": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.239",
3
+ "version": "1.0.241",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {