zklighter-perps 1.0.67 → 1.0.69

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.
@@ -32,6 +32,7 @@ models/ExchangeStats.ts
32
32
  models/FeeBucket.ts
33
33
  models/Funding.ts
34
34
  models/Fundings.ts
35
+ models/IsWhitelisted.ts
35
36
  models/L1ProviderInfo.ts
36
37
  models/Layer1BasicInfo.ts
37
38
  models/Layer2BasicInfo.ts
@@ -85,6 +86,7 @@ models/ReqGetRangeWithIndexSortable.ts
85
86
  models/ReqGetRecentTrades.ts
86
87
  models/ReqGetTrades.ts
87
88
  models/ReqGetTx.ts
89
+ models/ReqIsWhitelisted.ts
88
90
  models/ResultCode.ts
89
91
  models/SimpleOrder.ts
90
92
  models/Status.ts
@@ -20,6 +20,7 @@ import type {
20
20
  Accounts,
21
21
  DetailedAccounts,
22
22
  FeeBucket,
23
+ IsWhitelisted,
23
24
  Leaderboard,
24
25
  PublicPools,
25
26
  ResultCode,
@@ -36,6 +37,8 @@ import {
36
37
  DetailedAccountsToJSON,
37
38
  FeeBucketFromJSON,
38
39
  FeeBucketToJSON,
40
+ IsWhitelistedFromJSON,
41
+ IsWhitelistedToJSON,
39
42
  LeaderboardFromJSON,
40
43
  LeaderboardToJSON,
41
44
  PublicPoolsFromJSON,
@@ -74,6 +77,10 @@ export interface FeeBucketRequest {
74
77
  account_index: number;
75
78
  }
76
79
 
80
+ export interface IsWhitelistedRequest {
81
+ l1_address: string;
82
+ }
83
+
77
84
  export interface LeaderboardRequest {
78
85
  type: LeaderboardTypeEnum;
79
86
  l1_address?: string;
@@ -364,6 +371,45 @@ export class AccountApi extends runtime.BaseAPI {
364
371
  return await response.value();
365
372
  }
366
373
 
374
+ /**
375
+ * Get is account whitelisted
376
+ * isWhitelisted
377
+ */
378
+ async isWhitelistedRaw(requestParameters: IsWhitelistedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IsWhitelisted>> {
379
+ if (requestParameters['l1_address'] == null) {
380
+ throw new runtime.RequiredError(
381
+ 'l1_address',
382
+ 'Required parameter "l1_address" was null or undefined when calling isWhitelisted().'
383
+ );
384
+ }
385
+
386
+ const queryParameters: any = {};
387
+
388
+ if (requestParameters['l1_address'] != null) {
389
+ queryParameters['l1_address'] = requestParameters['l1_address'];
390
+ }
391
+
392
+ const headerParameters: runtime.HTTPHeaders = {};
393
+
394
+ const response = await this.request({
395
+ path: `/api/v1/isWhitelisted`,
396
+ method: 'GET',
397
+ headers: headerParameters,
398
+ query: queryParameters,
399
+ }, initOverrides);
400
+
401
+ return new runtime.JSONApiResponse(response, (jsonValue) => IsWhitelistedFromJSON(jsonValue));
402
+ }
403
+
404
+ /**
405
+ * Get is account whitelisted
406
+ * isWhitelisted
407
+ */
408
+ async isWhitelisted(requestParameters: IsWhitelistedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IsWhitelisted> {
409
+ const response = await this.isWhitelistedRaw(requestParameters, initOverrides);
410
+ return await response.value();
411
+ }
412
+
367
413
  /**
368
414
  * Get points leaderboard
369
415
  * leaderboard
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
19
19
  * @interface AccountStats
20
20
  */
21
21
  export interface AccountStats {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof AccountStats
26
+ */
27
+ collateral: string;
22
28
  /**
23
29
  *
24
30
  * @type {string}
@@ -55,6 +61,7 @@ export interface AccountStats {
55
61
  * Check if a given object implements the AccountStats interface.
56
62
  */
57
63
  export function instanceOfAccountStats(value: object): value is AccountStats {
64
+ if (!('collateral' in value) || value['collateral'] === undefined) return false;
58
65
  if (!('portfolio_value' in value) || value['portfolio_value'] === undefined) return false;
59
66
  if (!('leverage' in value) || value['leverage'] === undefined) return false;
60
67
  if (!('available_balance' in value) || value['available_balance'] === undefined) return false;
@@ -73,6 +80,7 @@ export function AccountStatsFromJSONTyped(json: any, ignoreDiscriminator: boolea
73
80
  }
74
81
  return {
75
82
 
83
+ 'collateral': json['collateral'],
76
84
  'portfolio_value': json['portfolio_value'],
77
85
  'leverage': json['leverage'],
78
86
  'available_balance': json['available_balance'],
@@ -87,6 +95,7 @@ export function AccountStatsToJSON(value?: AccountStats | null): any {
87
95
  }
88
96
  return {
89
97
 
98
+ 'collateral': value['collateral'],
90
99
  'portfolio_value': value['portfolio_value'],
91
100
  'leverage': value['leverage'],
92
101
  'available_balance': value['available_balance'],
@@ -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 IsWhitelisted
20
+ */
21
+ export interface IsWhitelisted {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof IsWhitelisted
26
+ */
27
+ code: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof IsWhitelisted
32
+ */
33
+ message?: string;
34
+ /**
35
+ *
36
+ * @type {boolean}
37
+ * @memberof IsWhitelisted
38
+ */
39
+ whitelisted: boolean;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof IsWhitelisted
44
+ */
45
+ deposit_amount_left: string;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the IsWhitelisted interface.
50
+ */
51
+ export function instanceOfIsWhitelisted(value: object): value is IsWhitelisted {
52
+ if (!('code' in value) || value['code'] === undefined) return false;
53
+ if (!('whitelisted' in value) || value['whitelisted'] === undefined) return false;
54
+ if (!('deposit_amount_left' in value) || value['deposit_amount_left'] === undefined) return false;
55
+ return true;
56
+ }
57
+
58
+ export function IsWhitelistedFromJSON(json: any): IsWhitelisted {
59
+ return IsWhitelistedFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function IsWhitelistedFromJSONTyped(json: any, ignoreDiscriminator: boolean): IsWhitelisted {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'code': json['code'],
69
+ 'message': json['message'] == null ? undefined : json['message'],
70
+ 'whitelisted': json['whitelisted'],
71
+ 'deposit_amount_left': json['deposit_amount_left'],
72
+ };
73
+ }
74
+
75
+ export function IsWhitelistedToJSON(value?: IsWhitelisted | null): any {
76
+ if (value == null) {
77
+ return value;
78
+ }
79
+ return {
80
+
81
+ 'code': value['code'],
82
+ 'message': value['message'],
83
+ 'whitelisted': value['whitelisted'],
84
+ 'deposit_amount_left': value['deposit_amount_left'],
85
+ };
86
+ }
87
+
@@ -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 ReqIsWhitelisted
20
+ */
21
+ export interface ReqIsWhitelisted {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqIsWhitelisted
26
+ */
27
+ l1_address: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ReqIsWhitelisted interface.
32
+ */
33
+ export function instanceOfReqIsWhitelisted(value: object): value is ReqIsWhitelisted {
34
+ if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function ReqIsWhitelistedFromJSON(json: any): ReqIsWhitelisted {
39
+ return ReqIsWhitelistedFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function ReqIsWhitelistedFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqIsWhitelisted {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'l1_address': json['l1_address'],
49
+ };
50
+ }
51
+
52
+ export function ReqIsWhitelistedToJSON(value?: ReqIsWhitelisted | 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
@@ -24,6 +24,7 @@ export * from './ExchangeStats';
24
24
  export * from './FeeBucket';
25
25
  export * from './Funding';
26
26
  export * from './Fundings';
27
+ export * from './IsWhitelisted';
27
28
  export * from './L1ProviderInfo';
28
29
  export * from './Layer1BasicInfo';
29
30
  export * from './Layer2BasicInfo';
@@ -77,6 +78,7 @@ export * from './ReqGetRangeWithIndexSortable';
77
78
  export * from './ReqGetRecentTrades';
78
79
  export * from './ReqGetTrades';
79
80
  export * from './ReqGetTx';
81
+ export * from './ReqIsWhitelisted';
80
82
  export * from './ResultCode';
81
83
  export * from './SimpleOrder';
82
84
  export * from './Status';
package/openapi.json CHANGED
@@ -924,6 +924,41 @@
924
924
  "description": "Get fundings"
925
925
  }
926
926
  },
927
+ "/api/v1/isWhitelisted": {
928
+ "get": {
929
+ "summary": "isWhitelisted",
930
+ "operationId": "isWhitelisted",
931
+ "responses": {
932
+ "200": {
933
+ "description": "A successful response.",
934
+ "schema": {
935
+ "$ref": "#/definitions/IsWhitelisted"
936
+ }
937
+ },
938
+ "400": {
939
+ "description": "Bad request",
940
+ "schema": {
941
+ "$ref": "#/definitions/ResultCode"
942
+ }
943
+ }
944
+ },
945
+ "parameters": [
946
+ {
947
+ "name": "l1_address",
948
+ "in": "query",
949
+ "required": true,
950
+ "type": "string"
951
+ }
952
+ ],
953
+ "tags": [
954
+ "account"
955
+ ],
956
+ "consumes": [
957
+ "multipart/form-data"
958
+ ],
959
+ "description": "Get is account whitelisted"
960
+ }
961
+ },
927
962
  "/api/v1/layer1BasicInfo": {
928
963
  "get": {
929
964
  "summary": "layer1BasicInfo",
@@ -2015,6 +2050,10 @@
2015
2050
  "AccountStats": {
2016
2051
  "type": "object",
2017
2052
  "properties": {
2053
+ "collateral": {
2054
+ "type": "string",
2055
+ "example": "199955"
2056
+ },
2018
2057
  "portfolio_value": {
2019
2058
  "type": "string",
2020
2059
  "example": "199955"
@@ -2038,6 +2077,7 @@
2038
2077
  },
2039
2078
  "title": "AccountStats",
2040
2079
  "required": [
2080
+ "collateral",
2041
2081
  "portfolio_value",
2042
2082
  "leverage",
2043
2083
  "available_balance",
@@ -2771,6 +2811,32 @@
2771
2811
  "fundings"
2772
2812
  ]
2773
2813
  },
2814
+ "IsWhitelisted": {
2815
+ "type": "object",
2816
+ "properties": {
2817
+ "code": {
2818
+ "type": "integer",
2819
+ "format": "int32",
2820
+ "example": "200"
2821
+ },
2822
+ "message": {
2823
+ "type": "string"
2824
+ },
2825
+ "whitelisted": {
2826
+ "type": "boolean",
2827
+ "format": "boolean"
2828
+ },
2829
+ "deposit_amount_left": {
2830
+ "type": "string"
2831
+ }
2832
+ },
2833
+ "title": "IsWhitelisted",
2834
+ "required": [
2835
+ "code",
2836
+ "whitelisted",
2837
+ "deposit_amount_left"
2838
+ ]
2839
+ },
2774
2840
  "L1ProviderInfo": {
2775
2841
  "type": "object",
2776
2842
  "properties": {
@@ -4624,6 +4690,18 @@
4624
4690
  "value"
4625
4691
  ]
4626
4692
  },
4693
+ "ReqIsWhitelisted": {
4694
+ "type": "object",
4695
+ "properties": {
4696
+ "l1_address": {
4697
+ "type": "string"
4698
+ }
4699
+ },
4700
+ "title": "ReqIsWhitelisted",
4701
+ "required": [
4702
+ "l1_address"
4703
+ ]
4704
+ },
4627
4705
  "ReqMarkNotifRead": {
4628
4706
  "type": "object",
4629
4707
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {