zklighter-perps 1.0.89 → 1.0.91

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.
@@ -14,6 +14,7 @@ jobs:
14
14
  name: Clone zklighter-perps repository
15
15
  command: |
16
16
  git clone https://${GITHUB_TOKEN}@github.com/elliottech/zklighter-perps.git
17
+ git checkout << pipeline.parameters.BE_BRANCH >>
17
18
 
18
19
  - run:
19
20
  name: Download goctl-swagger binary
@@ -64,7 +65,7 @@ jobs:
64
65
  name: Get openapi.json from workspace
65
66
  command: |
66
67
  cp /tmp/workspace/openapi.json ./.circleci
67
-
68
+
68
69
  - run:
69
70
  name: Run postprocess script
70
71
  command: |
@@ -98,7 +99,7 @@ jobs:
98
99
  name: Download OpenAPI Generator JAR
99
100
  command: |
100
101
  wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.7.0/openapi-generator-cli-7.7.0.jar -O openapi-generator-cli.jar
101
-
102
+
102
103
  - run:
103
104
  name: Generate TS client using OpenAPI Generator
104
105
  command: |
@@ -154,7 +155,9 @@ parameters:
154
155
  update_ts_sdk:
155
156
  default: false
156
157
  type: boolean
157
-
158
+ BE_BRANCH:
159
+ type: string
160
+ default: "main"
158
161
 
159
162
  workflows:
160
163
  version: 2
@@ -185,4 +188,5 @@ workflows:
185
188
  - update_npm_package:
186
189
  filters:
187
190
  branches:
188
- only: main
191
+ only: main
192
+
@@ -5,6 +5,7 @@ apis/CandlestickApi.ts
5
5
  apis/InfoApi.ts
6
6
  apis/LiquidationApi.ts
7
7
  apis/OrderApi.ts
8
+ apis/ReferralApi.ts
8
9
  apis/RootApi.ts
9
10
  apis/TransactionApi.ts
10
11
  apis/index.ts
@@ -65,6 +66,7 @@ models/PublicPool.ts
65
66
  models/PublicPoolInfo.ts
66
67
  models/PublicPoolShare.ts
67
68
  models/PublicPools.ts
69
+ models/ReferralCode.ts
68
70
  models/ReqDoFaucet.ts
69
71
  models/ReqGetAccount.ts
70
72
  models/ReqGetAccountActiveOrders.ts
@@ -94,6 +96,7 @@ models/ReqGetRangeWithCursor.ts
94
96
  models/ReqGetRangeWithIndex.ts
95
97
  models/ReqGetRangeWithIndexSortable.ts
96
98
  models/ReqGetRecentTrades.ts
99
+ models/ReqGetReferralCode.ts
97
100
  models/ReqGetTrades.ts
98
101
  models/ReqGetTx.ts
99
102
  models/ReqGetWithdrawHistory.ts
@@ -245,7 +245,7 @@ export class AccountApi extends runtime.BaseAPI {
245
245
  }
246
246
 
247
247
  /**
248
- * Get account api key
248
+ * Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account.
249
249
  * apikeys
250
250
  */
251
251
  async apikeysRaw(requestParameters: ApikeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountApiKeys>> {
@@ -286,7 +286,7 @@ export class AccountApi extends runtime.BaseAPI {
286
286
  }
287
287
 
288
288
  /**
289
- * Get account api key
289
+ * Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account.
290
290
  * apikeys
291
291
  */
292
292
  async apikeys(requestParameters: ApikeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountApiKeys> {
package/apis/InfoApi.ts CHANGED
@@ -62,7 +62,7 @@ export class InfoApi extends runtime.BaseAPI {
62
62
  }
63
63
 
64
64
  /**
65
- * Get zklighter general info, including contract address, and count of transactions and active users
65
+ * Get zklighter general info, including transaction and block stats
66
66
  * layer2BasicInfo
67
67
  */
68
68
  async layer2BasicInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Layer2BasicInfo>> {
@@ -81,7 +81,7 @@ export class InfoApi extends runtime.BaseAPI {
81
81
  }
82
82
 
83
83
  /**
84
- * Get zklighter general info, including contract address, and count of transactions and active users
84
+ * Get zklighter general info, including transaction and block stats
85
85
  * layer2BasicInfo
86
86
  */
87
87
  async layer2BasicInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Layer2BasicInfo> {
package/apis/OrderApi.ts CHANGED
@@ -98,7 +98,7 @@ export interface TradesRequest {
98
98
  export class OrderApi extends runtime.BaseAPI {
99
99
 
100
100
  /**
101
- * Get account active orders
101
+ * Get account active orders. `auth` can be generated using the SDK.
102
102
  * accountActiveOrders
103
103
  */
104
104
  async accountActiveOrdersRaw(requestParameters: AccountActiveOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Orders>> {
@@ -150,7 +150,7 @@ export class OrderApi extends runtime.BaseAPI {
150
150
  }
151
151
 
152
152
  /**
153
- * Get account active orders
153
+ * Get account active orders. `auth` can be generated using the SDK.
154
154
  * accountActiveOrders
155
155
  */
156
156
  async accountActiveOrders(requestParameters: AccountActiveOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Orders> {
@@ -159,7 +159,7 @@ export class OrderApi extends runtime.BaseAPI {
159
159
  }
160
160
 
161
161
  /**
162
- * Get account active orders
162
+ * Get account inactive orders
163
163
  * accountInactiveOrders
164
164
  */
165
165
  async accountInactiveOrdersRaw(requestParameters: AccountInactiveOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Orders>> {
@@ -216,7 +216,7 @@ export class OrderApi extends runtime.BaseAPI {
216
216
  }
217
217
 
218
218
  /**
219
- * Get account active orders
219
+ * Get account inactive orders
220
220
  * accountInactiveOrders
221
221
  */
222
222
  async accountInactiveOrders(requestParameters: AccountInactiveOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Orders> {
@@ -0,0 +1,238 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ ReferralCode,
19
+ ResultCode,
20
+ } from '../models/index';
21
+ import {
22
+ ReferralCodeFromJSON,
23
+ ReferralCodeToJSON,
24
+ ResultCodeFromJSON,
25
+ ResultCodeToJSON,
26
+ } from '../models/index';
27
+
28
+ export interface ReferralCreateRequest {
29
+ auth: string;
30
+ account_index: number;
31
+ }
32
+
33
+ export interface ReferralGetRequest {
34
+ auth: string;
35
+ account_index: number;
36
+ }
37
+
38
+ export interface ReferralUseRequest {
39
+ l1_address: string;
40
+ referral_code: string;
41
+ discord?: string;
42
+ telegram?: string;
43
+ }
44
+
45
+ /**
46
+ *
47
+ */
48
+ export class ReferralApi extends runtime.BaseAPI {
49
+
50
+ /**
51
+ * Create referral code
52
+ * referral_create
53
+ */
54
+ async referralCreateRaw(requestParameters: ReferralCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReferralCode>> {
55
+ if (requestParameters['auth'] == null) {
56
+ throw new runtime.RequiredError(
57
+ 'auth',
58
+ 'Required parameter "auth" was null or undefined when calling referralCreate().'
59
+ );
60
+ }
61
+
62
+ if (requestParameters['account_index'] == null) {
63
+ throw new runtime.RequiredError(
64
+ 'account_index',
65
+ 'Required parameter "account_index" was null or undefined when calling referralCreate().'
66
+ );
67
+ }
68
+
69
+ const queryParameters: any = {};
70
+
71
+ const headerParameters: runtime.HTTPHeaders = {};
72
+
73
+ const consumes: runtime.Consume[] = [
74
+ { contentType: 'multipart/form-data' },
75
+ ];
76
+ // @ts-ignore: canConsumeForm may be unused
77
+ const canConsumeForm = runtime.canConsumeForm(consumes);
78
+
79
+ let formParams: { append(param: string, value: any): any };
80
+ let useForm = false;
81
+ if (useForm) {
82
+ formParams = new FormData();
83
+ } else {
84
+ formParams = new URLSearchParams();
85
+ }
86
+
87
+ if (requestParameters['auth'] != null) {
88
+ formParams.append('auth', requestParameters['auth'] as any);
89
+ }
90
+
91
+ if (requestParameters['account_index'] != null) {
92
+ formParams.append('account_index', requestParameters['account_index'] as any);
93
+ }
94
+
95
+ const response = await this.request({
96
+ path: `/api/v1/referral/create`,
97
+ method: 'POST',
98
+ headers: headerParameters,
99
+ query: queryParameters,
100
+ body: formParams,
101
+ }, initOverrides);
102
+
103
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReferralCodeFromJSON(jsonValue));
104
+ }
105
+
106
+ /**
107
+ * Create referral code
108
+ * referral_create
109
+ */
110
+ async referralCreate(requestParameters: ReferralCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReferralCode> {
111
+ const response = await this.referralCreateRaw(requestParameters, initOverrides);
112
+ return await response.value();
113
+ }
114
+
115
+ /**
116
+ * Get referral code
117
+ * referral_get
118
+ */
119
+ async referralGetRaw(requestParameters: ReferralGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ReferralCode>> {
120
+ if (requestParameters['auth'] == null) {
121
+ throw new runtime.RequiredError(
122
+ 'auth',
123
+ 'Required parameter "auth" was null or undefined when calling referralGet().'
124
+ );
125
+ }
126
+
127
+ if (requestParameters['account_index'] == null) {
128
+ throw new runtime.RequiredError(
129
+ 'account_index',
130
+ 'Required parameter "account_index" was null or undefined when calling referralGet().'
131
+ );
132
+ }
133
+
134
+ const queryParameters: any = {};
135
+
136
+ if (requestParameters['auth'] != null) {
137
+ queryParameters['auth'] = requestParameters['auth'];
138
+ }
139
+
140
+ if (requestParameters['account_index'] != null) {
141
+ queryParameters['account_index'] = requestParameters['account_index'];
142
+ }
143
+
144
+ const headerParameters: runtime.HTTPHeaders = {};
145
+
146
+ const response = await this.request({
147
+ path: `/api/v1/referral/get`,
148
+ method: 'GET',
149
+ headers: headerParameters,
150
+ query: queryParameters,
151
+ }, initOverrides);
152
+
153
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReferralCodeFromJSON(jsonValue));
154
+ }
155
+
156
+ /**
157
+ * Get referral code
158
+ * referral_get
159
+ */
160
+ async referralGet(requestParameters: ReferralGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ReferralCode> {
161
+ const response = await this.referralGetRaw(requestParameters, initOverrides);
162
+ return await response.value();
163
+ }
164
+
165
+ /**
166
+ * Use referral code
167
+ * referral_use
168
+ */
169
+ async referralUseRaw(requestParameters: ReferralUseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
170
+ if (requestParameters['l1_address'] == null) {
171
+ throw new runtime.RequiredError(
172
+ 'l1_address',
173
+ 'Required parameter "l1_address" was null or undefined when calling referralUse().'
174
+ );
175
+ }
176
+
177
+ if (requestParameters['referral_code'] == null) {
178
+ throw new runtime.RequiredError(
179
+ 'referral_code',
180
+ 'Required parameter "referral_code" was null or undefined when calling referralUse().'
181
+ );
182
+ }
183
+
184
+ const queryParameters: any = {};
185
+
186
+ const headerParameters: runtime.HTTPHeaders = {};
187
+
188
+ const consumes: runtime.Consume[] = [
189
+ { contentType: 'multipart/form-data' },
190
+ ];
191
+ // @ts-ignore: canConsumeForm may be unused
192
+ const canConsumeForm = runtime.canConsumeForm(consumes);
193
+
194
+ let formParams: { append(param: string, value: any): any };
195
+ let useForm = false;
196
+ if (useForm) {
197
+ formParams = new FormData();
198
+ } else {
199
+ formParams = new URLSearchParams();
200
+ }
201
+
202
+ if (requestParameters['l1_address'] != null) {
203
+ formParams.append('l1_address', requestParameters['l1_address'] as any);
204
+ }
205
+
206
+ if (requestParameters['referral_code'] != null) {
207
+ formParams.append('referral_code', requestParameters['referral_code'] as any);
208
+ }
209
+
210
+ if (requestParameters['discord'] != null) {
211
+ formParams.append('discord', requestParameters['discord'] as any);
212
+ }
213
+
214
+ if (requestParameters['telegram'] != null) {
215
+ formParams.append('telegram', requestParameters['telegram'] as any);
216
+ }
217
+
218
+ const response = await this.request({
219
+ path: `/api/v1/referral/use`,
220
+ method: 'POST',
221
+ headers: headerParameters,
222
+ query: queryParameters,
223
+ body: formParams,
224
+ }, initOverrides);
225
+
226
+ return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
227
+ }
228
+
229
+ /**
230
+ * Use referral code
231
+ * referral_use
232
+ */
233
+ async referralUse(requestParameters: ReferralUseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
234
+ const response = await this.referralUseRaw(requestParameters, initOverrides);
235
+ return await response.value();
236
+ }
237
+
238
+ }
@@ -343,7 +343,7 @@ export class TransactionApi extends runtime.BaseAPI {
343
343
  }
344
344
 
345
345
  /**
346
- * Get next nonce for a specific account
346
+ * Get next nonce for a specific account and api key
347
347
  * nextNonce
348
348
  */
349
349
  async nextNonceRaw(requestParameters: NextNonceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NextNonce>> {
@@ -384,7 +384,7 @@ export class TransactionApi extends runtime.BaseAPI {
384
384
  }
385
385
 
386
386
  /**
387
- * Get next nonce for a specific account
387
+ * Get next nonce for a specific account and api key
388
388
  * nextNonce
389
389
  */
390
390
  async nextNonce(requestParameters: NextNonceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NextNonce> {
package/apis/index.ts CHANGED
@@ -7,5 +7,6 @@ export * from './CandlestickApi';
7
7
  export * from './InfoApi';
8
8
  export * from './LiquidationApi';
9
9
  export * from './OrderApi';
10
+ export * from './ReferralApi';
10
11
  export * from './RootApi';
11
12
  export * from './TransactionApi';
@@ -43,6 +43,12 @@ export interface DepositHistoryItem {
43
43
  * @memberof DepositHistoryItem
44
44
  */
45
45
  status: DepositHistoryItemStatusEnum;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof DepositHistoryItem
50
+ */
51
+ l1_tx_hash: string;
46
52
  }
47
53
 
48
54
 
@@ -66,6 +72,7 @@ export function instanceOfDepositHistoryItem(value: object): value is DepositHis
66
72
  if (!('amount' in value) || value['amount'] === undefined) return false;
67
73
  if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
68
74
  if (!('status' in value) || value['status'] === undefined) return false;
75
+ if (!('l1_tx_hash' in value) || value['l1_tx_hash'] === undefined) return false;
69
76
  return true;
70
77
  }
71
78
 
@@ -83,6 +90,7 @@ export function DepositHistoryItemFromJSONTyped(json: any, ignoreDiscriminator:
83
90
  'amount': json['amount'],
84
91
  'timestamp': json['timestamp'],
85
92
  'status': json['status'],
93
+ 'l1_tx_hash': json['l1_tx_hash'],
86
94
  };
87
95
  }
88
96
 
@@ -96,6 +104,7 @@ export function DepositHistoryItemToJSON(value?: DepositHistoryItem | null): any
96
104
  'amount': value['amount'],
97
105
  'timestamp': value['timestamp'],
98
106
  'status': value['status'],
107
+ 'l1_tx_hash': value['l1_tx_hash'],
99
108
  };
100
109
  }
101
110
 
@@ -0,0 +1,87 @@
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 ReferralCode
20
+ */
21
+ export interface ReferralCode {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ReferralCode
26
+ */
27
+ code: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ReferralCode
32
+ */
33
+ message?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof ReferralCode
38
+ */
39
+ referral_code: string;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof ReferralCode
44
+ */
45
+ remaining_usage: number;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the ReferralCode interface.
50
+ */
51
+ export function instanceOfReferralCode(value: object): value is ReferralCode {
52
+ if (!('code' in value) || value['code'] === undefined) return false;
53
+ if (!('referral_code' in value) || value['referral_code'] === undefined) return false;
54
+ if (!('remaining_usage' in value) || value['remaining_usage'] === undefined) return false;
55
+ return true;
56
+ }
57
+
58
+ export function ReferralCodeFromJSON(json: any): ReferralCode {
59
+ return ReferralCodeFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function ReferralCodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReferralCode {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'code': json['code'],
69
+ 'message': json['message'] == null ? undefined : json['message'],
70
+ 'referral_code': json['referral_code'],
71
+ 'remaining_usage': json['remaining_usage'],
72
+ };
73
+ }
74
+
75
+ export function ReferralCodeToJSON(value?: ReferralCode | null): any {
76
+ if (value == null) {
77
+ return value;
78
+ }
79
+ return {
80
+
81
+ 'code': value['code'],
82
+ 'message': value['message'],
83
+ 'referral_code': value['referral_code'],
84
+ 'remaining_usage': value['remaining_usage'],
85
+ };
86
+ }
87
+
@@ -0,0 +1,70 @@
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 ReqGetReferralCode
20
+ */
21
+ export interface ReqGetReferralCode {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqGetReferralCode
26
+ */
27
+ auth: string;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ReqGetReferralCode
32
+ */
33
+ account_index: number;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ReqGetReferralCode interface.
38
+ */
39
+ export function instanceOfReqGetReferralCode(value: object): value is ReqGetReferralCode {
40
+ if (!('auth' in value) || value['auth'] === undefined) return false;
41
+ if (!('account_index' in value) || value['account_index'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function ReqGetReferralCodeFromJSON(json: any): ReqGetReferralCode {
46
+ return ReqGetReferralCodeFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ReqGetReferralCodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetReferralCode {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'auth': json['auth'],
56
+ 'account_index': json['account_index'],
57
+ };
58
+ }
59
+
60
+ export function ReqGetReferralCodeToJSON(value?: ReqGetReferralCode | null): any {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+
66
+ 'auth': value['auth'],
67
+ 'account_index': value['account_index'],
68
+ };
69
+ }
70
+
@@ -49,6 +49,12 @@ export interface WithdrawHistoryItem {
49
49
  * @memberof WithdrawHistoryItem
50
50
  */
51
51
  type: WithdrawHistoryItemTypeEnum;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof WithdrawHistoryItem
56
+ */
57
+ l1_tx_hash: string;
52
58
  }
53
59
 
54
60
 
@@ -83,6 +89,7 @@ export function instanceOfWithdrawHistoryItem(value: object): value is WithdrawH
83
89
  if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
84
90
  if (!('status' in value) || value['status'] === undefined) return false;
85
91
  if (!('type' in value) || value['type'] === undefined) return false;
92
+ if (!('l1_tx_hash' in value) || value['l1_tx_hash'] === undefined) return false;
86
93
  return true;
87
94
  }
88
95
 
@@ -101,6 +108,7 @@ export function WithdrawHistoryItemFromJSONTyped(json: any, ignoreDiscriminator:
101
108
  'timestamp': json['timestamp'],
102
109
  'status': json['status'],
103
110
  'type': json['type'],
111
+ 'l1_tx_hash': json['l1_tx_hash'],
104
112
  };
105
113
  }
106
114
 
@@ -115,6 +123,7 @@ export function WithdrawHistoryItemToJSON(value?: WithdrawHistoryItem | null): a
115
123
  'timestamp': value['timestamp'],
116
124
  'status': value['status'],
117
125
  'type': value['type'],
126
+ 'l1_tx_hash': value['l1_tx_hash'],
118
127
  };
119
128
  }
120
129
 
package/models/index.ts CHANGED
@@ -56,6 +56,7 @@ export * from './PublicPool';
56
56
  export * from './PublicPoolInfo';
57
57
  export * from './PublicPoolShare';
58
58
  export * from './PublicPools';
59
+ export * from './ReferralCode';
59
60
  export * from './ReqDoFaucet';
60
61
  export * from './ReqGetAccount';
61
62
  export * from './ReqGetAccountActiveOrders';
@@ -85,6 +86,7 @@ export * from './ReqGetRangeWithCursor';
85
86
  export * from './ReqGetRangeWithIndex';
86
87
  export * from './ReqGetRangeWithIndexSortable';
87
88
  export * from './ReqGetRecentTrades';
89
+ export * from './ReqGetReferralCode';
88
90
  export * from './ReqGetTrades';
89
91
  export * from './ReqGetTx';
90
92
  export * from './ReqGetWithdrawHistory';
package/openapi.json CHANGED
@@ -130,7 +130,7 @@
130
130
  "consumes": [
131
131
  "multipart/form-data"
132
132
  ],
133
- "description": "Get account active orders"
133
+ "description": "Get account active orders. `auth` can be generated using the SDK."
134
134
  }
135
135
  },
136
136
  "/api/v1/accountInactiveOrders": {
@@ -203,7 +203,7 @@
203
203
  "consumes": [
204
204
  "multipart/form-data"
205
205
  ],
206
- "description": "Get account active orders"
206
+ "description": "Get account inactive orders"
207
207
  }
208
208
  },
209
209
  "/api/v1/accountOrders": {
@@ -520,7 +520,7 @@
520
520
  "consumes": [
521
521
  "multipart/form-data"
522
522
  ],
523
- "description": "Get account api key"
523
+ "description": "Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account."
524
524
  }
525
525
  },
526
526
  "/api/v1/block": {
@@ -1259,7 +1259,7 @@
1259
1259
  "tags": [
1260
1260
  "info"
1261
1261
  ],
1262
- "description": "Get zklighter general info, including contract address, and count of transactions and active users"
1262
+ "description": "Get zklighter general info, including transaction and block stats"
1263
1263
  }
1264
1264
  },
1265
1265
  "/api/v1/leaderboard": {
@@ -1384,7 +1384,7 @@
1384
1384
  "consumes": [
1385
1385
  "multipart/form-data"
1386
1386
  ],
1387
- "description": "Get next nonce for a specific account"
1387
+ "description": "Get next nonce for a specific account and api key"
1388
1388
  }
1389
1389
  },
1390
1390
  "/api/v1/orderBookDetails": {
@@ -1747,6 +1747,122 @@
1747
1747
  "description": "Get recent trades"
1748
1748
  }
1749
1749
  },
1750
+ "/api/v1/referral/create": {
1751
+ "post": {
1752
+ "summary": "referral_create",
1753
+ "operationId": "referral_create",
1754
+ "responses": {
1755
+ "200": {
1756
+ "description": "A successful response.",
1757
+ "schema": {
1758
+ "$ref": "#/definitions/ReferralCode"
1759
+ }
1760
+ },
1761
+ "400": {
1762
+ "description": "Bad request",
1763
+ "schema": {
1764
+ "$ref": "#/definitions/ResultCode"
1765
+ }
1766
+ }
1767
+ },
1768
+ "parameters": [
1769
+ {
1770
+ "name": "body",
1771
+ "in": "body",
1772
+ "required": true,
1773
+ "schema": {
1774
+ "$ref": "#/definitions/ReqCreateReferralCode"
1775
+ }
1776
+ }
1777
+ ],
1778
+ "tags": [
1779
+ "referral"
1780
+ ],
1781
+ "consumes": [
1782
+ "multipart/form-data"
1783
+ ],
1784
+ "description": "Create referral code"
1785
+ }
1786
+ },
1787
+ "/api/v1/referral/get": {
1788
+ "get": {
1789
+ "summary": "referral_get",
1790
+ "operationId": "referral_get",
1791
+ "responses": {
1792
+ "200": {
1793
+ "description": "A successful response.",
1794
+ "schema": {
1795
+ "$ref": "#/definitions/ReferralCode"
1796
+ }
1797
+ },
1798
+ "400": {
1799
+ "description": "Bad request",
1800
+ "schema": {
1801
+ "$ref": "#/definitions/ResultCode"
1802
+ }
1803
+ }
1804
+ },
1805
+ "parameters": [
1806
+ {
1807
+ "name": "auth",
1808
+ "in": "query",
1809
+ "required": true,
1810
+ "type": "string"
1811
+ },
1812
+ {
1813
+ "name": "account_index",
1814
+ "in": "query",
1815
+ "required": true,
1816
+ "type": "integer",
1817
+ "format": "int64"
1818
+ }
1819
+ ],
1820
+ "tags": [
1821
+ "referral"
1822
+ ],
1823
+ "consumes": [
1824
+ "multipart/form-data"
1825
+ ],
1826
+ "description": "Get referral code"
1827
+ }
1828
+ },
1829
+ "/api/v1/referral/use": {
1830
+ "post": {
1831
+ "summary": "referral_use",
1832
+ "operationId": "referral_use",
1833
+ "responses": {
1834
+ "200": {
1835
+ "description": "A successful response.",
1836
+ "schema": {
1837
+ "$ref": "#/definitions/ResultCode"
1838
+ }
1839
+ },
1840
+ "400": {
1841
+ "description": "Bad request",
1842
+ "schema": {
1843
+ "$ref": "#/definitions/ResultCode"
1844
+ }
1845
+ }
1846
+ },
1847
+ "parameters": [
1848
+ {
1849
+ "name": "body",
1850
+ "in": "body",
1851
+ "required": true,
1852
+ "schema": {
1853
+ "$ref": "#/definitions/ReqUseReferralCode"
1854
+ }
1855
+ }
1856
+ ],
1857
+ "tags": [
1858
+ "referral"
1859
+ ],
1860
+ "consumes": [
1861
+ "multipart/form-data"
1862
+ ],
1863
+ "description": "Use referral code"
1864
+ }
1865
+ },
1750
1866
  "/api/v1/sendTx": {
1751
1867
  "post": {
1752
1868
  "summary": "sendTx",
@@ -2975,6 +3091,10 @@
2975
3091
  "completed",
2976
3092
  "claimable"
2977
3093
  ]
3094
+ },
3095
+ "l1_tx_hash": {
3096
+ "type": "string",
3097
+ "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
2978
3098
  }
2979
3099
  },
2980
3100
  "title": "DepositHistoryItem",
@@ -2982,7 +3102,8 @@
2982
3102
  "id",
2983
3103
  "amount",
2984
3104
  "timestamp",
2985
- "status"
3105
+ "status",
3106
+ "l1_tx_hash"
2986
3107
  ]
2987
3108
  },
2988
3109
  "DetailedAccount": {
@@ -4637,6 +4758,34 @@
4637
4758
  "public_pools"
4638
4759
  ]
4639
4760
  },
4761
+ "ReferralCode": {
4762
+ "type": "object",
4763
+ "properties": {
4764
+ "code": {
4765
+ "type": "integer",
4766
+ "format": "int32",
4767
+ "example": "200"
4768
+ },
4769
+ "message": {
4770
+ "type": "string"
4771
+ },
4772
+ "referral_code": {
4773
+ "type": "string",
4774
+ "example": "5V24K3MJ"
4775
+ },
4776
+ "remaining_usage": {
4777
+ "type": "integer",
4778
+ "format": "int32",
4779
+ "example": "3"
4780
+ }
4781
+ },
4782
+ "title": "ReferralCode",
4783
+ "required": [
4784
+ "code",
4785
+ "referral_code",
4786
+ "remaining_usage"
4787
+ ]
4788
+ },
4640
4789
  "ReqCancelDeposit": {
4641
4790
  "type": "object",
4642
4791
  "properties": {
@@ -4677,6 +4826,23 @@
4677
4826
  "amount"
4678
4827
  ]
4679
4828
  },
4829
+ "ReqCreateReferralCode": {
4830
+ "type": "object",
4831
+ "properties": {
4832
+ "auth": {
4833
+ "type": "string"
4834
+ },
4835
+ "account_index": {
4836
+ "type": "integer",
4837
+ "format": "int64"
4838
+ }
4839
+ },
4840
+ "title": "ReqCreateReferralCode",
4841
+ "required": [
4842
+ "auth",
4843
+ "account_index"
4844
+ ]
4845
+ },
4680
4846
  "ReqDoFaucet": {
4681
4847
  "type": "object",
4682
4848
  "properties": {
@@ -5347,6 +5513,23 @@
5347
5513
  "limit"
5348
5514
  ]
5349
5515
  },
5516
+ "ReqGetReferralCode": {
5517
+ "type": "object",
5518
+ "properties": {
5519
+ "auth": {
5520
+ "type": "string"
5521
+ },
5522
+ "account_index": {
5523
+ "type": "integer",
5524
+ "format": "int64"
5525
+ }
5526
+ },
5527
+ "title": "ReqGetReferralCode",
5528
+ "required": [
5529
+ "auth",
5530
+ "account_index"
5531
+ ]
5532
+ },
5350
5533
  "ReqGetTrades": {
5351
5534
  "type": "object",
5352
5535
  "properties": {
@@ -5564,6 +5747,28 @@
5564
5747
  "auth"
5565
5748
  ]
5566
5749
  },
5750
+ "ReqUseReferralCode": {
5751
+ "type": "object",
5752
+ "properties": {
5753
+ "l1_address": {
5754
+ "type": "string"
5755
+ },
5756
+ "referral_code": {
5757
+ "type": "string"
5758
+ },
5759
+ "discord": {
5760
+ "type": "string"
5761
+ },
5762
+ "telegram": {
5763
+ "type": "string"
5764
+ }
5765
+ },
5766
+ "title": "ReqUseReferralCode",
5767
+ "required": [
5768
+ "l1_address",
5769
+ "referral_code"
5770
+ ]
5771
+ },
5567
5772
  "RespGetFastwithdrawalInfo": {
5568
5773
  "type": "object",
5569
5774
  "properties": {
@@ -6081,6 +6286,10 @@
6081
6286
  "secure",
6082
6287
  "fast"
6083
6288
  ]
6289
+ },
6290
+ "l1_tx_hash": {
6291
+ "type": "string",
6292
+ "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
6084
6293
  }
6085
6294
  },
6086
6295
  "title": "WithdrawHistoryItem",
@@ -6089,7 +6298,8 @@
6089
6298
  "amount",
6090
6299
  "timestamp",
6091
6300
  "status",
6092
- "type"
6301
+ "type",
6302
+ "l1_tx_hash"
6093
6303
  ]
6094
6304
  },
6095
6305
  "ZkLighterInfo": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.89",
3
+ "version": "1.0.91",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {