zklighter-perps 1.0.90 → 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.
- package/.openapi-generator/FILES +3 -0
- package/apis/AccountApi.ts +2 -2
- package/apis/InfoApi.ts +2 -2
- package/apis/OrderApi.ts +4 -4
- package/apis/ReferralApi.ts +238 -0
- package/apis/TransactionApi.ts +2 -2
- package/apis/index.ts +1 -0
- package/models/ReferralCode.ts +87 -0
- package/models/ReqGetReferralCode.ts +70 -0
- package/models/index.ts +2 -0
- package/openapi.json +205 -5
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -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
|
package/apis/AccountApi.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
+
}
|
package/apis/TransactionApi.ts
CHANGED
|
@@ -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
|
@@ -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
|
+
|
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
|
|
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
|
|
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",
|
|
@@ -4642,6 +4758,34 @@
|
|
|
4642
4758
|
"public_pools"
|
|
4643
4759
|
]
|
|
4644
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
|
+
},
|
|
4645
4789
|
"ReqCancelDeposit": {
|
|
4646
4790
|
"type": "object",
|
|
4647
4791
|
"properties": {
|
|
@@ -4682,6 +4826,23 @@
|
|
|
4682
4826
|
"amount"
|
|
4683
4827
|
]
|
|
4684
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
|
+
},
|
|
4685
4846
|
"ReqDoFaucet": {
|
|
4686
4847
|
"type": "object",
|
|
4687
4848
|
"properties": {
|
|
@@ -5352,6 +5513,23 @@
|
|
|
5352
5513
|
"limit"
|
|
5353
5514
|
]
|
|
5354
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
|
+
},
|
|
5355
5533
|
"ReqGetTrades": {
|
|
5356
5534
|
"type": "object",
|
|
5357
5535
|
"properties": {
|
|
@@ -5569,6 +5747,28 @@
|
|
|
5569
5747
|
"auth"
|
|
5570
5748
|
]
|
|
5571
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
|
+
},
|
|
5572
5772
|
"RespGetFastwithdrawalInfo": {
|
|
5573
5773
|
"type": "object",
|
|
5574
5774
|
"properties": {
|