zklighter-perps 1.0.147 → 1.0.148

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.
@@ -123,6 +123,7 @@ models/ReqGetTransferFeeInfo.ts
123
123
  models/ReqGetTransferHistory.ts
124
124
  models/ReqGetTx.ts
125
125
  models/ReqGetWithdrawHistory.ts
126
+ models/ReqHasReferralCodeByL1Address.ts
126
127
  models/ReqIsWhitelisted.ts
127
128
  models/RespChangeAccountTier.ts
128
129
  models/RespGetFastBridgeInfo.ts
@@ -15,11 +15,14 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ Bool,
18
19
  ReferralCode,
19
20
  ReferralPoints,
20
21
  ResultCode,
21
22
  } from '../models/index';
22
23
  import {
24
+ BoolFromJSON,
25
+ BoolToJSON,
23
26
  ReferralCodeFromJSON,
24
27
  ReferralCodeToJSON,
25
28
  ReferralPointsFromJSON,
@@ -40,6 +43,10 @@ export interface ReferralGetRequest {
40
43
  auth?: string;
41
44
  }
42
45
 
46
+ export interface ReferralHasCodeByAddressRequest {
47
+ l1_address: string;
48
+ }
49
+
43
50
  export interface ReferralPointsRequest {
44
51
  account_index: number;
45
52
  authorization?: string;
@@ -168,6 +175,45 @@ export class ReferralApi extends runtime.BaseAPI {
168
175
  return await response.value();
169
176
  }
170
177
 
178
+ /**
179
+ * Does L1 address have referral code?
180
+ * referral_hasCodeByAddress
181
+ */
182
+ async referralHasCodeByAddressRaw(requestParameters: ReferralHasCodeByAddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Bool>> {
183
+ if (requestParameters['l1_address'] == null) {
184
+ throw new runtime.RequiredError(
185
+ 'l1_address',
186
+ 'Required parameter "l1_address" was null or undefined when calling referralHasCodeByAddress().'
187
+ );
188
+ }
189
+
190
+ const queryParameters: any = {};
191
+
192
+ if (requestParameters['l1_address'] != null) {
193
+ queryParameters['l1_address'] = requestParameters['l1_address'];
194
+ }
195
+
196
+ const headerParameters: runtime.HTTPHeaders = {};
197
+
198
+ const response = await this.request({
199
+ path: `/api/v1/referral/hasCodeByAddress`,
200
+ method: 'GET',
201
+ headers: headerParameters,
202
+ query: queryParameters,
203
+ }, initOverrides);
204
+
205
+ return new runtime.JSONApiResponse(response, (jsonValue) => BoolFromJSON(jsonValue));
206
+ }
207
+
208
+ /**
209
+ * Does L1 address have referral code?
210
+ * referral_hasCodeByAddress
211
+ */
212
+ async referralHasCodeByAddress(requestParameters: ReferralHasCodeByAddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Bool> {
213
+ const response = await this.referralHasCodeByAddressRaw(requestParameters, initOverrides);
214
+ return await response.value();
215
+ }
216
+
171
217
  /**
172
218
  * Get referral points
173
219
  * referral_points
package/models/Account.ts CHANGED
@@ -85,6 +85,12 @@ export interface Account {
85
85
  * @memberof Account
86
86
  */
87
87
  collateral: string;
88
+ /**
89
+ *
90
+ * @type {string}
91
+ * @memberof Account
92
+ */
93
+ referral_code: string;
88
94
  }
89
95
 
90
96
  /**
@@ -101,6 +107,7 @@ export function instanceOfAccount(value: object): value is Account {
101
107
  if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
102
108
  if (!('status' in value) || value['status'] === undefined) return false;
103
109
  if (!('collateral' in value) || value['collateral'] === undefined) return false;
110
+ if (!('referral_code' in value) || value['referral_code'] === undefined) return false;
104
111
  return true;
105
112
  }
106
113
 
@@ -125,6 +132,7 @@ export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): A
125
132
  'pending_order_count': json['pending_order_count'],
126
133
  'status': json['status'],
127
134
  'collateral': json['collateral'],
135
+ 'referral_code': json['referral_code'],
128
136
  };
129
137
  }
130
138
 
@@ -145,6 +153,7 @@ export function AccountToJSON(value?: Account | null): any {
145
153
  'pending_order_count': value['pending_order_count'],
146
154
  'status': value['status'],
147
155
  'collateral': value['collateral'],
156
+ 'referral_code': value['referral_code'],
148
157
  };
149
158
  }
150
159
 
@@ -104,6 +104,12 @@ export interface DetailedAccount {
104
104
  * @memberof DetailedAccount
105
105
  */
106
106
  collateral: string;
107
+ /**
108
+ *
109
+ * @type {string}
110
+ * @memberof DetailedAccount
111
+ */
112
+ referral_code: string;
107
113
  /**
108
114
  *
109
115
  * @type {number}
@@ -180,6 +186,7 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
180
186
  if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
181
187
  if (!('status' in value) || value['status'] === undefined) return false;
182
188
  if (!('collateral' in value) || value['collateral'] === undefined) return false;
189
+ if (!('referral_code' in value) || value['referral_code'] === undefined) return false;
183
190
  if (!('account_index' in value) || value['account_index'] === undefined) return false;
184
191
  if (!('name' in value) || value['name'] === undefined) return false;
185
192
  if (!('description' in value) || value['description'] === undefined) return false;
@@ -214,6 +221,7 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
214
221
  'pending_order_count': json['pending_order_count'],
215
222
  'status': json['status'],
216
223
  'collateral': json['collateral'],
224
+ 'referral_code': json['referral_code'],
217
225
  'account_index': json['account_index'],
218
226
  'name': json['name'],
219
227
  'description': json['description'],
@@ -244,6 +252,7 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
244
252
  'pending_order_count': value['pending_order_count'],
245
253
  'status': value['status'],
246
254
  'collateral': value['collateral'],
255
+ 'referral_code': value['referral_code'],
247
256
  'account_index': value['account_index'],
248
257
  'name': value['name'],
249
258
  'description': value['description'],
@@ -98,6 +98,12 @@ export interface PublicPool {
98
98
  * @memberof PublicPool
99
99
  */
100
100
  collateral: string;
101
+ /**
102
+ *
103
+ * @type {string}
104
+ * @memberof PublicPool
105
+ */
106
+ referral_code: string;
101
107
  /**
102
108
  *
103
109
  * @type {number}
@@ -168,6 +174,7 @@ export function instanceOfPublicPool(value: object): value is PublicPool {
168
174
  if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
169
175
  if (!('status' in value) || value['status'] === undefined) return false;
170
176
  if (!('collateral' in value) || value['collateral'] === undefined) return false;
177
+ if (!('referral_code' in value) || value['referral_code'] === undefined) return false;
171
178
  if (!('account_index' in value) || value['account_index'] === undefined) return false;
172
179
  if (!('name' in value) || value['name'] === undefined) return false;
173
180
  if (!('description' in value) || value['description'] === undefined) return false;
@@ -200,6 +207,7 @@ export function PublicPoolFromJSONTyped(json: any, ignoreDiscriminator: boolean)
200
207
  'pending_order_count': json['pending_order_count'],
201
208
  'status': json['status'],
202
209
  'collateral': json['collateral'],
210
+ 'referral_code': json['referral_code'],
203
211
  'account_index': json['account_index'],
204
212
  'name': json['name'],
205
213
  'description': json['description'],
@@ -229,6 +237,7 @@ export function PublicPoolToJSON(value?: PublicPool | null): any {
229
237
  'pending_order_count': value['pending_order_count'],
230
238
  'status': value['status'],
231
239
  'collateral': value['collateral'],
240
+ 'referral_code': value['referral_code'],
232
241
  'account_index': value['account_index'],
233
242
  'name': value['name'],
234
243
  'description': value['description'],
@@ -0,0 +1,61 @@
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 ReqHasReferralCodeByL1Address
20
+ */
21
+ export interface ReqHasReferralCodeByL1Address {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqHasReferralCodeByL1Address
26
+ */
27
+ l1_address: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ReqHasReferralCodeByL1Address interface.
32
+ */
33
+ export function instanceOfReqHasReferralCodeByL1Address(value: object): value is ReqHasReferralCodeByL1Address {
34
+ if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function ReqHasReferralCodeByL1AddressFromJSON(json: any): ReqHasReferralCodeByL1Address {
39
+ return ReqHasReferralCodeByL1AddressFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function ReqHasReferralCodeByL1AddressFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqHasReferralCodeByL1Address {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'l1_address': json['l1_address'],
49
+ };
50
+ }
51
+
52
+ export function ReqHasReferralCodeByL1AddressToJSON(value?: ReqHasReferralCodeByL1Address | null): any {
53
+ if (value == null) {
54
+ return value;
55
+ }
56
+ return {
57
+
58
+ 'l1_address': value['l1_address'],
59
+ };
60
+ }
61
+
package/models/index.ts CHANGED
@@ -111,6 +111,7 @@ export * from './ReqGetTransferFeeInfo';
111
111
  export * from './ReqGetTransferHistory';
112
112
  export * from './ReqGetTx';
113
113
  export * from './ReqGetWithdrawHistory';
114
+ export * from './ReqHasReferralCodeByL1Address';
114
115
  export * from './ReqIsWhitelisted';
115
116
  export * from './RespChangeAccountTier';
116
117
  export * from './RespGetFastBridgeInfo';
package/openapi.json CHANGED
@@ -2301,6 +2301,41 @@
2301
2301
  "description": "Get referral code"
2302
2302
  }
2303
2303
  },
2304
+ "/api/v1/referral/hasCodeByAddress": {
2305
+ "get": {
2306
+ "summary": "referral_hasCodeByAddress",
2307
+ "operationId": "referral_hasCodeByAddress",
2308
+ "responses": {
2309
+ "200": {
2310
+ "description": "A successful response.",
2311
+ "schema": {
2312
+ "$ref": "#/definitions/bool"
2313
+ }
2314
+ },
2315
+ "400": {
2316
+ "description": "Bad request",
2317
+ "schema": {
2318
+ "$ref": "#/definitions/ResultCode"
2319
+ }
2320
+ }
2321
+ },
2322
+ "parameters": [
2323
+ {
2324
+ "name": "l1_address",
2325
+ "in": "query",
2326
+ "required": true,
2327
+ "type": "string"
2328
+ }
2329
+ ],
2330
+ "tags": [
2331
+ "referral"
2332
+ ],
2333
+ "consumes": [
2334
+ "multipart/form-data"
2335
+ ],
2336
+ "description": "Does L1 address have referral code?"
2337
+ }
2338
+ },
2304
2339
  "/api/v1/referral/points": {
2305
2340
  "get": {
2306
2341
  "summary": "referral_points",
@@ -3029,6 +3064,10 @@
3029
3064
  "collateral": {
3030
3065
  "type": "string",
3031
3066
  "example": "46342"
3067
+ },
3068
+ "referral_code": {
3069
+ "type": "string",
3070
+ "example": "ABC123"
3032
3071
  }
3033
3072
  },
3034
3073
  "title": "Account",
@@ -3042,7 +3081,8 @@
3042
3081
  "total_isolated_order_count",
3043
3082
  "pending_order_count",
3044
3083
  "status",
3045
- "collateral"
3084
+ "collateral",
3085
+ "referral_code"
3046
3086
  ]
3047
3087
  },
3048
3088
  "AccountApiKeys": {
@@ -4094,6 +4134,10 @@
4094
4134
  "type": "string",
4095
4135
  "example": "46342"
4096
4136
  },
4137
+ "referral_code": {
4138
+ "type": "string",
4139
+ "example": "ABC123"
4140
+ },
4097
4141
  "account_index": {
4098
4142
  "type": "integer",
4099
4143
  "format": "int64"
@@ -4149,6 +4193,7 @@
4149
4193
  "pending_order_count",
4150
4194
  "status",
4151
4195
  "collateral",
4196
+ "referral_code",
4152
4197
  "account_index",
4153
4198
  "name",
4154
4199
  "description",
@@ -5814,6 +5859,10 @@
5814
5859
  "type": "string",
5815
5860
  "example": "46342"
5816
5861
  },
5862
+ "referral_code": {
5863
+ "type": "string",
5864
+ "example": "ABC123"
5865
+ },
5817
5866
  "account_index": {
5818
5867
  "type": "integer",
5819
5868
  "format": "int64"
@@ -5860,6 +5909,7 @@
5860
5909
  "pending_order_count",
5861
5910
  "status",
5862
5911
  "collateral",
5912
+ "referral_code",
5863
5913
  "account_index",
5864
5914
  "name",
5865
5915
  "description",
@@ -7223,6 +7273,18 @@
7223
7273
  "account_index"
7224
7274
  ]
7225
7275
  },
7276
+ "ReqHasReferralCodeByL1Address": {
7277
+ "type": "object",
7278
+ "properties": {
7279
+ "l1_address": {
7280
+ "type": "string"
7281
+ }
7282
+ },
7283
+ "title": "ReqHasReferralCodeByL1Address",
7284
+ "required": [
7285
+ "l1_address"
7286
+ ]
7287
+ },
7226
7288
  "ReqIsWhitelisted": {
7227
7289
  "type": "object",
7228
7290
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.147",
3
+ "version": "1.0.148",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {