zklighter-perps 1.0.349 → 1.0.350

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.
@@ -283,6 +283,7 @@ models/ReqTvHistory.ts
283
283
  models/ReqTvSymbolInfo.ts
284
284
  models/RespAtomicOrder.ts
285
285
  models/RespAtomicOrderList.ts
286
+ models/RespBuyVolumeQuota.ts
286
287
  models/RespChangeAccountTier.ts
287
288
  models/RespConnectX.ts
288
289
  models/RespConnectXCallback.ts
@@ -30,6 +30,7 @@ import type {
30
30
  PartnerStats,
31
31
  PnlLeaderboard,
32
32
  PositionFundings,
33
+ RespBuyVolumeQuota,
33
34
  RespChangeAccountTier,
34
35
  RespConnectX,
35
36
  RespConnectXCallback,
@@ -82,6 +83,8 @@ import {
82
83
  PnlLeaderboardToJSON,
83
84
  PositionFundingsFromJSON,
84
85
  PositionFundingsToJSON,
86
+ RespBuyVolumeQuotaFromJSON,
87
+ RespBuyVolumeQuotaToJSON,
85
88
  RespChangeAccountTierFromJSON,
86
89
  RespChangeAccountTierToJSON,
87
90
  RespConnectXFromJSON,
@@ -169,6 +172,14 @@ export interface ApikeysRequest {
169
172
  api_key_index?: number;
170
173
  }
171
174
 
175
+ export interface BuyVolumeQuotaRequest {
176
+ quota: number;
177
+ authorization?: string;
178
+ tx_info?: string;
179
+ tx_hash?: string;
180
+ destination_l1_address?: string;
181
+ }
182
+
172
183
  export interface ChangeAccountTierRequest {
173
184
  account_index: number;
174
185
  new_tier: string;
@@ -772,6 +783,76 @@ export class AccountApi extends runtime.BaseAPI {
772
783
  return await response.value();
773
784
  }
774
785
 
786
+ /**
787
+ * Buy volume quota with USDC
788
+ * buyVolumeQuota
789
+ */
790
+ async buyVolumeQuotaRaw(requestParameters: BuyVolumeQuotaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespBuyVolumeQuota>> {
791
+ if (requestParameters['quota'] == null) {
792
+ throw new runtime.RequiredError(
793
+ 'quota',
794
+ 'Required parameter "quota" was null or undefined when calling buyVolumeQuota().'
795
+ );
796
+ }
797
+
798
+ const queryParameters: any = {};
799
+
800
+ const headerParameters: runtime.HTTPHeaders = {};
801
+
802
+ if (requestParameters['authorization'] != null) {
803
+ headerParameters['authorization'] = String(requestParameters['authorization']);
804
+ }
805
+
806
+ const consumes: runtime.Consume[] = [
807
+ { contentType: 'multipart/form-data' },
808
+ ];
809
+ // @ts-ignore: canConsumeForm may be unused
810
+ const canConsumeForm = runtime.canConsumeForm(consumes);
811
+
812
+ let formParams: { append(param: string, value: any): any };
813
+ let useForm = false;
814
+ if (useForm) {
815
+ formParams = new FormData();
816
+ } else {
817
+ formParams = new URLSearchParams();
818
+ }
819
+
820
+ if (requestParameters['tx_info'] != null) {
821
+ formParams.append('tx_info', requestParameters['tx_info'] as any);
822
+ }
823
+
824
+ if (requestParameters['tx_hash'] != null) {
825
+ formParams.append('tx_hash', requestParameters['tx_hash'] as any);
826
+ }
827
+
828
+ if (requestParameters['quota'] != null) {
829
+ formParams.append('quota', requestParameters['quota'] as any);
830
+ }
831
+
832
+ if (requestParameters['destination_l1_address'] != null) {
833
+ formParams.append('destination_l1_address', requestParameters['destination_l1_address'] as any);
834
+ }
835
+
836
+ const response = await this.request({
837
+ path: `/api/v1/buyVolumeQuota`,
838
+ method: 'POST',
839
+ headers: headerParameters,
840
+ query: queryParameters,
841
+ body: formParams,
842
+ }, initOverrides);
843
+
844
+ return new runtime.JSONApiResponse(response, (jsonValue) => RespBuyVolumeQuotaFromJSON(jsonValue));
845
+ }
846
+
847
+ /**
848
+ * Buy volume quota with USDC
849
+ * buyVolumeQuota
850
+ */
851
+ async buyVolumeQuota(requestParameters: BuyVolumeQuotaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespBuyVolumeQuota> {
852
+ const response = await this.buyVolumeQuotaRaw(requestParameters, initOverrides);
853
+ return await response.value();
854
+ }
855
+
775
856
  /**
776
857
  * Change account tier
777
858
  * changeAccountTier
@@ -103,6 +103,24 @@ export interface AccountLimits {
103
103
  * @memberof AccountLimits
104
104
  */
105
105
  user_tier_last_update?: number;
106
+ /**
107
+ *
108
+ * @type {string}
109
+ * @memberof AccountLimits
110
+ */
111
+ volume_quota_remaining: string;
112
+ /**
113
+ *
114
+ * @type {string}
115
+ * @memberof AccountLimits
116
+ */
117
+ volume_quota_cap: string;
118
+ /**
119
+ *
120
+ * @type {string}
121
+ * @memberof AccountLimits
122
+ */
123
+ volume_quota_purchase_cap: string;
106
124
  }
107
125
 
108
126
  /**
@@ -121,6 +139,9 @@ export function instanceOfAccountLimits(value: object): value is AccountLimits {
121
139
  if (!('current_taker_fee_tick' in value) || value['current_taker_fee_tick'] === undefined) return false;
122
140
  if (!('leased_lit' in value) || value['leased_lit'] === undefined) return false;
123
141
  if (!('effective_lit_stakes' in value) || value['effective_lit_stakes'] === undefined) return false;
142
+ if (!('volume_quota_remaining' in value) || value['volume_quota_remaining'] === undefined) return false;
143
+ if (!('volume_quota_cap' in value) || value['volume_quota_cap'] === undefined) return false;
144
+ if (!('volume_quota_purchase_cap' in value) || value['volume_quota_purchase_cap'] === undefined) return false;
124
145
  return true;
125
146
  }
126
147
 
@@ -148,6 +169,9 @@ export function AccountLimitsFromJSONTyped(json: any, ignoreDiscriminator: boole
148
169
  'leased_lit': json['leased_lit'],
149
170
  'effective_lit_stakes': json['effective_lit_stakes'],
150
171
  'user_tier_last_update': json['user_tier_last_update'] == null ? undefined : json['user_tier_last_update'],
172
+ 'volume_quota_remaining': json['volume_quota_remaining'],
173
+ 'volume_quota_cap': json['volume_quota_cap'],
174
+ 'volume_quota_purchase_cap': json['volume_quota_purchase_cap'],
151
175
  };
152
176
  }
153
177
 
@@ -171,6 +195,9 @@ export function AccountLimitsToJSON(value?: AccountLimits | null): any {
171
195
  'leased_lit': value['leased_lit'],
172
196
  'effective_lit_stakes': value['effective_lit_stakes'],
173
197
  'user_tier_last_update': value['user_tier_last_update'],
198
+ 'volume_quota_remaining': value['volume_quota_remaining'],
199
+ 'volume_quota_cap': value['volume_quota_cap'],
200
+ 'volume_quota_purchase_cap': value['volume_quota_purchase_cap'],
174
201
  };
175
202
  }
176
203
 
@@ -0,0 +1,125 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface RespBuyVolumeQuota
20
+ */
21
+ export interface RespBuyVolumeQuota {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof RespBuyVolumeQuota
26
+ */
27
+ code: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof RespBuyVolumeQuota
32
+ */
33
+ message?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof RespBuyVolumeQuota
38
+ */
39
+ tx_hash: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof RespBuyVolumeQuota
44
+ */
45
+ l1_address: string;
46
+ /**
47
+ *
48
+ * @type {number}
49
+ * @memberof RespBuyVolumeQuota
50
+ */
51
+ quota: number;
52
+ /**
53
+ *
54
+ * @type {number}
55
+ * @memberof RespBuyVolumeQuota
56
+ */
57
+ volume_quota_remaining: number;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof RespBuyVolumeQuota
62
+ */
63
+ status: RespBuyVolumeQuotaStatusEnum;
64
+ }
65
+
66
+
67
+ /**
68
+ * @export
69
+ */
70
+ export const RespBuyVolumeQuotaStatusEnum = {
71
+ Credited: 'credited',
72
+ Pending: 'pending'
73
+ } as const;
74
+ export type RespBuyVolumeQuotaStatusEnum = typeof RespBuyVolumeQuotaStatusEnum[keyof typeof RespBuyVolumeQuotaStatusEnum];
75
+
76
+
77
+ /**
78
+ * Check if a given object implements the RespBuyVolumeQuota interface.
79
+ */
80
+ export function instanceOfRespBuyVolumeQuota(value: object): value is RespBuyVolumeQuota {
81
+ if (!('code' in value) || value['code'] === undefined) return false;
82
+ if (!('tx_hash' in value) || value['tx_hash'] === undefined) return false;
83
+ if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
84
+ if (!('quota' in value) || value['quota'] === undefined) return false;
85
+ if (!('volume_quota_remaining' in value) || value['volume_quota_remaining'] === undefined) return false;
86
+ if (!('status' in value) || value['status'] === undefined) return false;
87
+ return true;
88
+ }
89
+
90
+ export function RespBuyVolumeQuotaFromJSON(json: any): RespBuyVolumeQuota {
91
+ return RespBuyVolumeQuotaFromJSONTyped(json, false);
92
+ }
93
+
94
+ export function RespBuyVolumeQuotaFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespBuyVolumeQuota {
95
+ if (json == null) {
96
+ return json;
97
+ }
98
+ return {
99
+
100
+ 'code': json['code'],
101
+ 'message': json['message'] == null ? undefined : json['message'],
102
+ 'tx_hash': json['tx_hash'],
103
+ 'l1_address': json['l1_address'],
104
+ 'quota': json['quota'],
105
+ 'volume_quota_remaining': json['volume_quota_remaining'],
106
+ 'status': json['status'],
107
+ };
108
+ }
109
+
110
+ export function RespBuyVolumeQuotaToJSON(value?: RespBuyVolumeQuota | null): any {
111
+ if (value == null) {
112
+ return value;
113
+ }
114
+ return {
115
+
116
+ 'code': value['code'],
117
+ 'message': value['message'],
118
+ 'tx_hash': value['tx_hash'],
119
+ 'l1_address': value['l1_address'],
120
+ 'quota': value['quota'],
121
+ 'volume_quota_remaining': value['volume_quota_remaining'],
122
+ 'status': value['status'],
123
+ };
124
+ }
125
+
package/models/index.ts CHANGED
@@ -254,6 +254,7 @@ export * from './ReqTvHistory';
254
254
  export * from './ReqTvSymbolInfo';
255
255
  export * from './RespAtomicOrder';
256
256
  export * from './RespAtomicOrderList';
257
+ export * from './RespBuyVolumeQuota';
257
258
  export * from './RespChangeAccountTier';
258
259
  export * from './RespConnectX';
259
260
  export * from './RespConnectXCallback';
package/openapi.json CHANGED
@@ -1318,6 +1318,49 @@
1318
1318
  "description": "Get if next bridge is fast"
1319
1319
  }
1320
1320
  },
1321
+ "/api/v1/buyVolumeQuota": {
1322
+ "post": {
1323
+ "summary": "buyVolumeQuota",
1324
+ "operationId": "buyVolumeQuota",
1325
+ "responses": {
1326
+ "200": {
1327
+ "description": "A successful response.",
1328
+ "schema": {
1329
+ "$ref": "#/definitions/RespBuyVolumeQuota"
1330
+ }
1331
+ },
1332
+ "400": {
1333
+ "description": "Bad request",
1334
+ "schema": {
1335
+ "$ref": "#/definitions/ResultCode"
1336
+ }
1337
+ }
1338
+ },
1339
+ "parameters": [
1340
+ {
1341
+ "name": "authorization",
1342
+ "in": "header",
1343
+ "required": false,
1344
+ "type": "string"
1345
+ },
1346
+ {
1347
+ "name": "body",
1348
+ "in": "body",
1349
+ "required": true,
1350
+ "schema": {
1351
+ "$ref": "#/definitions/ReqBuyVolumeQuota"
1352
+ }
1353
+ }
1354
+ ],
1355
+ "tags": [
1356
+ "account"
1357
+ ],
1358
+ "consumes": [
1359
+ "multipart/form-data"
1360
+ ],
1361
+ "description": "Buy volume quota with USDC"
1362
+ }
1363
+ },
1321
1364
  "/api/v1/candles": {
1322
1365
  "get": {
1323
1366
  "summary": "candles",
@@ -8602,6 +8645,18 @@
8602
8645
  "user_tier_last_update": {
8603
8646
  "type": "integer",
8604
8647
  "format": "int64"
8648
+ },
8649
+ "volume_quota_remaining": {
8650
+ "type": "string",
8651
+ "example": "1010780"
8652
+ },
8653
+ "volume_quota_cap": {
8654
+ "type": "string",
8655
+ "example": "15000000"
8656
+ },
8657
+ "volume_quota_purchase_cap": {
8658
+ "type": "string",
8659
+ "example": "30000000"
8605
8660
  }
8606
8661
  },
8607
8662
  "title": "AccountLimits",
@@ -8617,7 +8672,10 @@
8617
8672
  "current_maker_fee_tick",
8618
8673
  "current_taker_fee_tick",
8619
8674
  "leased_lit",
8620
- "effective_lit_stakes"
8675
+ "effective_lit_stakes",
8676
+ "volume_quota_remaining",
8677
+ "volume_quota_cap",
8678
+ "volume_quota_purchase_cap"
8621
8679
  ]
8622
8680
  },
8623
8681
  "AccountMarginStats": {
@@ -16932,6 +16990,28 @@
16932
16990
  "account_index"
16933
16991
  ]
16934
16992
  },
16993
+ "ReqBuyVolumeQuota": {
16994
+ "type": "object",
16995
+ "properties": {
16996
+ "tx_info": {
16997
+ "type": "string"
16998
+ },
16999
+ "tx_hash": {
17000
+ "type": "string"
17001
+ },
17002
+ "quota": {
17003
+ "type": "integer",
17004
+ "format": "int64"
17005
+ },
17006
+ "destination_l1_address": {
17007
+ "type": "string"
17008
+ }
17009
+ },
17010
+ "title": "ReqBuyVolumeQuota",
17011
+ "required": [
17012
+ "quota"
17013
+ ]
17014
+ },
16935
17015
  "ReqChangeAccountTier": {
16936
17016
  "type": "object",
16937
17017
  "properties": {
@@ -20707,6 +20787,54 @@
20707
20787
  "atomic_orders"
20708
20788
  ]
20709
20789
  },
20790
+ "RespBuyVolumeQuota": {
20791
+ "type": "object",
20792
+ "properties": {
20793
+ "code": {
20794
+ "type": "integer",
20795
+ "format": "int32",
20796
+ "example": "200"
20797
+ },
20798
+ "message": {
20799
+ "type": "string"
20800
+ },
20801
+ "tx_hash": {
20802
+ "type": "string",
20803
+ "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
20804
+ },
20805
+ "l1_address": {
20806
+ "type": "string",
20807
+ "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
20808
+ },
20809
+ "quota": {
20810
+ "type": "integer",
20811
+ "format": "int64",
20812
+ "example": "1000000"
20813
+ },
20814
+ "volume_quota_remaining": {
20815
+ "type": "integer",
20816
+ "format": "int64",
20817
+ "example": "1010780"
20818
+ },
20819
+ "status": {
20820
+ "type": "string",
20821
+ "example": "credited",
20822
+ "enum": [
20823
+ "credited",
20824
+ "pending"
20825
+ ]
20826
+ }
20827
+ },
20828
+ "title": "RespBuyVolumeQuota",
20829
+ "required": [
20830
+ "code",
20831
+ "tx_hash",
20832
+ "l1_address",
20833
+ "quota",
20834
+ "volume_quota_remaining",
20835
+ "status"
20836
+ ]
20837
+ },
20710
20838
  "RespChangeAccountTier": {
20711
20839
  "type": "object",
20712
20840
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.349",
3
+ "version": "1.0.350",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {