zklighter-perps 1.0.185 → 1.0.186

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.
@@ -26,6 +26,8 @@ models/AccountPnL.ts
26
26
  models/AccountPosition.ts
27
27
  models/AccountStats.ts
28
28
  models/AccountTradeStats.ts
29
+ models/AirdropPercentageItem.ts
30
+ models/AirdropPercentages.ts
29
31
  models/Announcement.ts
30
32
  models/Announcements.ts
31
33
  models/ApiKey.ts
@@ -104,6 +106,7 @@ models/ReqGetAccountLimits.ts
104
106
  models/ReqGetAccountMetadata.ts
105
107
  models/ReqGetAccountPnL.ts
106
108
  models/ReqGetAccountTxs.ts
109
+ models/ReqGetAirdropPercentages.ts
107
110
  models/ReqGetApiTokens.ts
108
111
  models/ReqGetAssetDetails.ts
109
112
  models/ReqGetBlock.ts
@@ -19,6 +19,7 @@ import type {
19
19
  AccountLimits,
20
20
  AccountMetadatas,
21
21
  AccountPnL,
22
+ AirdropPercentages,
22
23
  DetailedAccounts,
23
24
  IsWhitelisted,
24
25
  L1Metadata,
@@ -42,6 +43,8 @@ import {
42
43
  AccountMetadatasToJSON,
43
44
  AccountPnLFromJSON,
44
45
  AccountPnLToJSON,
46
+ AirdropPercentagesFromJSON,
47
+ AirdropPercentagesToJSON,
45
48
  DetailedAccountsFromJSON,
46
49
  DetailedAccountsToJSON,
47
50
  IsWhitelistedFromJSON,
@@ -92,6 +95,20 @@ export interface AccountsByL1AddressRequest {
92
95
  l1_address: string;
93
96
  }
94
97
 
98
+ export interface AirdropRequest {
99
+ l1_address: string;
100
+ authorization?: string;
101
+ auth?: string;
102
+ }
103
+
104
+ export interface AirdropCreateRequest {
105
+ l1_address: string;
106
+ percentages: string;
107
+ signature: string;
108
+ authorization?: string;
109
+ auth?: string;
110
+ }
111
+
95
112
  export interface ApikeysRequest {
96
113
  account_index: number;
97
114
  api_key_index?: number;
@@ -386,6 +403,137 @@ export class AccountApi extends runtime.BaseAPI {
386
403
  return await response.value();
387
404
  }
388
405
 
406
+ /**
407
+ * Get airdrop percentages
408
+ * airdrop
409
+ */
410
+ async airdropRaw(requestParameters: AirdropRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AirdropPercentages>> {
411
+ if (requestParameters['l1_address'] == null) {
412
+ throw new runtime.RequiredError(
413
+ 'l1_address',
414
+ 'Required parameter "l1_address" was null or undefined when calling airdrop().'
415
+ );
416
+ }
417
+
418
+ const queryParameters: any = {};
419
+
420
+ if (requestParameters['l1_address'] != null) {
421
+ queryParameters['l1_address'] = requestParameters['l1_address'];
422
+ }
423
+
424
+ if (requestParameters['auth'] != null) {
425
+ queryParameters['auth'] = requestParameters['auth'];
426
+ }
427
+
428
+ const headerParameters: runtime.HTTPHeaders = {};
429
+
430
+ if (requestParameters['authorization'] != null) {
431
+ headerParameters['authorization'] = String(requestParameters['authorization']);
432
+ }
433
+
434
+ const response = await this.request({
435
+ path: `/api/v1/airdrop`,
436
+ method: 'GET',
437
+ headers: headerParameters,
438
+ query: queryParameters,
439
+ }, initOverrides);
440
+
441
+ return new runtime.JSONApiResponse(response, (jsonValue) => AirdropPercentagesFromJSON(jsonValue));
442
+ }
443
+
444
+ /**
445
+ * Get airdrop percentages
446
+ * airdrop
447
+ */
448
+ async airdrop(requestParameters: AirdropRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AirdropPercentages> {
449
+ const response = await this.airdropRaw(requestParameters, initOverrides);
450
+ return await response.value();
451
+ }
452
+
453
+ /**
454
+ * Create airdrop percentages
455
+ * airdrop_create
456
+ */
457
+ async airdropCreateRaw(requestParameters: AirdropCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
458
+ if (requestParameters['l1_address'] == null) {
459
+ throw new runtime.RequiredError(
460
+ 'l1_address',
461
+ 'Required parameter "l1_address" was null or undefined when calling airdropCreate().'
462
+ );
463
+ }
464
+
465
+ if (requestParameters['percentages'] == null) {
466
+ throw new runtime.RequiredError(
467
+ 'percentages',
468
+ 'Required parameter "percentages" was null or undefined when calling airdropCreate().'
469
+ );
470
+ }
471
+
472
+ if (requestParameters['signature'] == null) {
473
+ throw new runtime.RequiredError(
474
+ 'signature',
475
+ 'Required parameter "signature" was null or undefined when calling airdropCreate().'
476
+ );
477
+ }
478
+
479
+ const queryParameters: any = {};
480
+
481
+ const headerParameters: runtime.HTTPHeaders = {};
482
+
483
+ if (requestParameters['authorization'] != null) {
484
+ headerParameters['authorization'] = String(requestParameters['authorization']);
485
+ }
486
+
487
+ const consumes: runtime.Consume[] = [
488
+ { contentType: 'multipart/form-data' },
489
+ ];
490
+ // @ts-ignore: canConsumeForm may be unused
491
+ const canConsumeForm = runtime.canConsumeForm(consumes);
492
+
493
+ let formParams: { append(param: string, value: any): any };
494
+ let useForm = false;
495
+ if (useForm) {
496
+ formParams = new FormData();
497
+ } else {
498
+ formParams = new URLSearchParams();
499
+ }
500
+
501
+ if (requestParameters['l1_address'] != null) {
502
+ formParams.append('l1_address', requestParameters['l1_address'] as any);
503
+ }
504
+
505
+ if (requestParameters['percentages'] != null) {
506
+ formParams.append('percentages', requestParameters['percentages'] as any);
507
+ }
508
+
509
+ if (requestParameters['signature'] != null) {
510
+ formParams.append('signature', requestParameters['signature'] as any);
511
+ }
512
+
513
+ if (requestParameters['auth'] != null) {
514
+ formParams.append('auth', requestParameters['auth'] as any);
515
+ }
516
+
517
+ const response = await this.request({
518
+ path: `/api/v1/airdrop/create`,
519
+ method: 'POST',
520
+ headers: headerParameters,
521
+ query: queryParameters,
522
+ body: formParams,
523
+ }, initOverrides);
524
+
525
+ return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
526
+ }
527
+
528
+ /**
529
+ * Create airdrop percentages
530
+ * airdrop_create
531
+ */
532
+ async airdropCreate(requestParameters: AirdropCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
533
+ const response = await this.airdropCreateRaw(requestParameters, initOverrides);
534
+ return await response.value();
535
+ }
536
+
389
537
  /**
390
538
  * Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account.
391
539
  * apikeys
@@ -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 AirdropPercentageItem
20
+ */
21
+ export interface AirdropPercentageItem {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof AirdropPercentageItem
26
+ */
27
+ l1_address: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof AirdropPercentageItem
32
+ */
33
+ percentage: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the AirdropPercentageItem interface.
38
+ */
39
+ export function instanceOfAirdropPercentageItem(value: object): value is AirdropPercentageItem {
40
+ if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
41
+ if (!('percentage' in value) || value['percentage'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function AirdropPercentageItemFromJSON(json: any): AirdropPercentageItem {
46
+ return AirdropPercentageItemFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function AirdropPercentageItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): AirdropPercentageItem {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'l1_address': json['l1_address'],
56
+ 'percentage': json['percentage'],
57
+ };
58
+ }
59
+
60
+ export function AirdropPercentageItemToJSON(value?: AirdropPercentageItem | null): any {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+
66
+ 'l1_address': value['l1_address'],
67
+ 'percentage': value['percentage'],
68
+ };
69
+ }
70
+
@@ -0,0 +1,77 @@
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
+ import type { AirdropPercentageItem } from './AirdropPercentageItem';
17
+ import {
18
+ AirdropPercentageItemFromJSON,
19
+ AirdropPercentageItemFromJSONTyped,
20
+ AirdropPercentageItemToJSON,
21
+ } from './AirdropPercentageItem';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface AirdropPercentages
27
+ */
28
+ export interface AirdropPercentages {
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof AirdropPercentages
33
+ */
34
+ l1_address: string;
35
+ /**
36
+ *
37
+ * @type {Array<AirdropPercentageItem>}
38
+ * @memberof AirdropPercentages
39
+ */
40
+ percentages: Array<AirdropPercentageItem>;
41
+ }
42
+
43
+ /**
44
+ * Check if a given object implements the AirdropPercentages interface.
45
+ */
46
+ export function instanceOfAirdropPercentages(value: object): value is AirdropPercentages {
47
+ if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
48
+ if (!('percentages' in value) || value['percentages'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function AirdropPercentagesFromJSON(json: any): AirdropPercentages {
53
+ return AirdropPercentagesFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function AirdropPercentagesFromJSONTyped(json: any, ignoreDiscriminator: boolean): AirdropPercentages {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'l1_address': json['l1_address'],
63
+ 'percentages': ((json['percentages'] as Array<any>).map(AirdropPercentageItemFromJSON)),
64
+ };
65
+ }
66
+
67
+ export function AirdropPercentagesToJSON(value?: AirdropPercentages | null): any {
68
+ if (value == null) {
69
+ return value;
70
+ }
71
+ return {
72
+
73
+ 'l1_address': value['l1_address'],
74
+ 'percentages': ((value['percentages'] as Array<any>).map(AirdropPercentageItemToJSON)),
75
+ };
76
+ }
77
+
@@ -0,0 +1,69 @@
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 ReqGetAirdropPercentages
20
+ */
21
+ export interface ReqGetAirdropPercentages {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqGetAirdropPercentages
26
+ */
27
+ l1_address: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ReqGetAirdropPercentages
32
+ */
33
+ auth?: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ReqGetAirdropPercentages interface.
38
+ */
39
+ export function instanceOfReqGetAirdropPercentages(value: object): value is ReqGetAirdropPercentages {
40
+ if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
41
+ return true;
42
+ }
43
+
44
+ export function ReqGetAirdropPercentagesFromJSON(json: any): ReqGetAirdropPercentages {
45
+ return ReqGetAirdropPercentagesFromJSONTyped(json, false);
46
+ }
47
+
48
+ export function ReqGetAirdropPercentagesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetAirdropPercentages {
49
+ if (json == null) {
50
+ return json;
51
+ }
52
+ return {
53
+
54
+ 'l1_address': json['l1_address'],
55
+ 'auth': json['auth'] == null ? undefined : json['auth'],
56
+ };
57
+ }
58
+
59
+ export function ReqGetAirdropPercentagesToJSON(value?: ReqGetAirdropPercentages | null): any {
60
+ if (value == null) {
61
+ return value;
62
+ }
63
+ return {
64
+
65
+ 'l1_address': value['l1_address'],
66
+ 'auth': value['auth'],
67
+ };
68
+ }
69
+
package/models/index.ts CHANGED
@@ -12,6 +12,8 @@ export * from './AccountPnL';
12
12
  export * from './AccountPosition';
13
13
  export * from './AccountStats';
14
14
  export * from './AccountTradeStats';
15
+ export * from './AirdropPercentageItem';
16
+ export * from './AirdropPercentages';
15
17
  export * from './Announcement';
16
18
  export * from './Announcements';
17
19
  export * from './ApiKey';
@@ -90,6 +92,7 @@ export * from './ReqGetAccountLimits';
90
92
  export * from './ReqGetAccountMetadata';
91
93
  export * from './ReqGetAccountPnL';
92
94
  export * from './ReqGetAccountTxs';
95
+ export * from './ReqGetAirdropPercentages';
93
96
  export * from './ReqGetApiTokens';
94
97
  export * from './ReqGetAssetDetails';
95
98
  export * from './ReqGetBlock';
package/openapi.json CHANGED
@@ -454,6 +454,98 @@
454
454
  "description": "Get accounts by l1_address returns all accounts associated with the given L1 address"
455
455
  }
456
456
  },
457
+ "/api/v1/airdrop": {
458
+ "get": {
459
+ "summary": "airdrop",
460
+ "operationId": "airdrop",
461
+ "responses": {
462
+ "200": {
463
+ "description": "A successful response.",
464
+ "schema": {
465
+ "$ref": "#/definitions/AirdropPercentages"
466
+ }
467
+ },
468
+ "400": {
469
+ "description": "Bad request",
470
+ "schema": {
471
+ "$ref": "#/definitions/ResultCode"
472
+ }
473
+ }
474
+ },
475
+ "parameters": [
476
+ {
477
+ "name": "authorization",
478
+ "description": " make required after integ is done",
479
+ "in": "header",
480
+ "required": false,
481
+ "type": "string"
482
+ },
483
+ {
484
+ "name": "l1_address",
485
+ "in": "query",
486
+ "required": true,
487
+ "type": "string"
488
+ },
489
+ {
490
+ "name": "auth",
491
+ "in": "query",
492
+ "required": false,
493
+ "type": "string"
494
+ }
495
+ ],
496
+ "tags": [
497
+ "account"
498
+ ],
499
+ "consumes": [
500
+ "multipart/form-data"
501
+ ],
502
+ "description": "Get airdrop percentages"
503
+ }
504
+ },
505
+ "/api/v1/airdrop/create": {
506
+ "post": {
507
+ "summary": "airdrop_create",
508
+ "operationId": "airdrop_create",
509
+ "responses": {
510
+ "200": {
511
+ "description": "A successful response.",
512
+ "schema": {
513
+ "$ref": "#/definitions/ResultCode"
514
+ }
515
+ },
516
+ "400": {
517
+ "description": "Bad request",
518
+ "schema": {
519
+ "$ref": "#/definitions/ResultCode"
520
+ }
521
+ }
522
+ },
523
+ "parameters": [
524
+ {
525
+ "name": "authorization",
526
+ "description": " make required after integ is done",
527
+ "in": "header",
528
+ "required": false,
529
+ "type": "string"
530
+ },
531
+ {
532
+ "name": "body",
533
+ "in": "body",
534
+ "required": true,
535
+ "schema": {
536
+ "$ref": "#/definitions/ReqCreateAirdropPercentages"
537
+ }
538
+ }
539
+ ],
540
+ "tags": [
541
+ "account"
542
+ ],
543
+ "consumes": [
544
+ "multipart/form-data"
545
+ ],
546
+ "description": "Create airdrop percentages"
547
+ }
548
+ },
457
549
  "/api/v1/announcement": {
458
550
  "get": {
459
551
  "summary": "announcement",
@@ -3933,6 +4025,41 @@
3933
4025
  "total_volume"
3934
4026
  ]
3935
4027
  },
4028
+ "AirdropPercentageItem": {
4029
+ "type": "object",
4030
+ "properties": {
4031
+ "l1_address": {
4032
+ "type": "string"
4033
+ },
4034
+ "percentage": {
4035
+ "type": "string"
4036
+ }
4037
+ },
4038
+ "title": "AirdropPercentageItem",
4039
+ "required": [
4040
+ "l1_address",
4041
+ "percentage"
4042
+ ]
4043
+ },
4044
+ "AirdropPercentages": {
4045
+ "type": "object",
4046
+ "properties": {
4047
+ "l1_address": {
4048
+ "type": "string"
4049
+ },
4050
+ "percentages": {
4051
+ "type": "array",
4052
+ "items": {
4053
+ "$ref": "#/definitions/AirdropPercentageItem"
4054
+ }
4055
+ }
4056
+ },
4057
+ "title": "AirdropPercentages",
4058
+ "required": [
4059
+ "l1_address",
4060
+ "percentages"
4061
+ ]
4062
+ },
3936
4063
  "Announcement": {
3937
4064
  "type": "object",
3938
4065
  "properties": {
@@ -7164,6 +7291,29 @@
7164
7291
  "new_tier"
7165
7292
  ]
7166
7293
  },
7294
+ "ReqCreateAirdropPercentages": {
7295
+ "type": "object",
7296
+ "properties": {
7297
+ "l1_address": {
7298
+ "type": "string"
7299
+ },
7300
+ "percentages": {
7301
+ "type": "string"
7302
+ },
7303
+ "signature": {
7304
+ "type": "string"
7305
+ },
7306
+ "auth": {
7307
+ "type": "string"
7308
+ }
7309
+ },
7310
+ "title": "ReqCreateAirdropPercentages",
7311
+ "required": [
7312
+ "l1_address",
7313
+ "percentages",
7314
+ "signature"
7315
+ ]
7316
+ },
7167
7317
  "ReqCreateIntentAddress": {
7168
7318
  "type": "object",
7169
7319
  "properties": {
@@ -7518,6 +7668,21 @@
7518
7668
  },
7519
7669
  "title": "ReqGetAccountTxs"
7520
7670
  },
7671
+ "ReqGetAirdropPercentages": {
7672
+ "type": "object",
7673
+ "properties": {
7674
+ "l1_address": {
7675
+ "type": "string"
7676
+ },
7677
+ "auth": {
7678
+ "type": "string"
7679
+ }
7680
+ },
7681
+ "title": "ReqGetAirdropPercentages",
7682
+ "required": [
7683
+ "l1_address"
7684
+ ]
7685
+ },
7521
7686
  "ReqGetApiTokens": {
7522
7687
  "type": "object",
7523
7688
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.185",
3
+ "version": "1.0.186",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {