zklighter-perps 1.0.209 → 1.0.211

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.
@@ -75,6 +75,8 @@ models/L1ProviderInfo.ts
75
75
  models/Layer1BasicInfo.ts
76
76
  models/Leaderboard.ts
77
77
  models/LeaderboardEntry.ts
78
+ models/LeaseEntry.ts
79
+ models/LeaseOptionEntry.ts
78
80
  models/LiqTrade.ts
79
81
  models/Liquidation.ts
80
82
  models/LiquidationInfo.ts
@@ -134,6 +136,7 @@ models/ReqGetL1Metadata.ts
134
136
  models/ReqGetL1Tx.ts
135
137
  models/ReqGetLatestDeposit.ts
136
138
  models/ReqGetLeaderboard.ts
139
+ models/ReqGetLeases.ts
137
140
  models/ReqGetLiquidationInfos.ts
138
141
  models/ReqGetNextNonce.ts
139
142
  models/ReqGetOrderBookDetails.ts
@@ -162,6 +165,8 @@ models/RespGetExecuteStats.ts
162
165
  models/RespGetFastBridgeInfo.ts
163
166
  models/RespGetFastwithdrawalInfo.ts
164
167
  models/RespGetIsNextBridgeFast.ts
168
+ models/RespGetLeaseOptions.ts
169
+ models/RespGetLeases.ts
165
170
  models/RespPostApiToken.ts
166
171
  models/RespPublicPoolsMetadata.ts
167
172
  models/RespRevokeApiToken.ts
@@ -176,6 +181,7 @@ models/RiskParameters.ts
176
181
  models/SharePrice.ts
177
182
  models/SimpleOrder.ts
178
183
  models/SlippageResult.ts
184
+ models/SpotAvgEntryPrice.ts
179
185
  models/SpotMarketStats.ts
180
186
  models/SpotOrderBookDetail.ts
181
187
  models/Status.ts
@@ -28,11 +28,14 @@ import type {
28
28
  PositionFundings,
29
29
  RespChangeAccountTier,
30
30
  RespGetApiTokens,
31
+ RespGetLeaseOptions,
32
+ RespGetLeases,
31
33
  RespPostApiToken,
32
34
  RespPublicPoolsMetadata,
33
35
  RespRevokeApiToken,
34
36
  ResultCode,
35
37
  SubAccounts,
38
+ TxHash,
36
39
  } from '../models/index';
37
40
  import {
38
41
  AccountApiKeysFromJSON,
@@ -61,6 +64,10 @@ import {
61
64
  RespChangeAccountTierToJSON,
62
65
  RespGetApiTokensFromJSON,
63
66
  RespGetApiTokensToJSON,
67
+ RespGetLeaseOptionsFromJSON,
68
+ RespGetLeaseOptionsToJSON,
69
+ RespGetLeasesFromJSON,
70
+ RespGetLeasesToJSON,
64
71
  RespPostApiTokenFromJSON,
65
72
  RespPostApiTokenToJSON,
66
73
  RespPublicPoolsMetadataFromJSON,
@@ -71,6 +78,8 @@ import {
71
78
  ResultCodeToJSON,
72
79
  SubAccountsFromJSON,
73
80
  SubAccountsToJSON,
81
+ TxHashFromJSON,
82
+ TxHashToJSON,
74
83
  } from '../models/index';
75
84
 
76
85
  export interface AccountRequest {
@@ -144,6 +153,14 @@ export interface LeaderboardRequest {
144
153
  auth?: string;
145
154
  }
146
155
 
156
+ export interface LeasesRequest {
157
+ account_index: number;
158
+ authorization?: string;
159
+ auth?: string;
160
+ cursor?: string;
161
+ limit?: number;
162
+ }
163
+
147
164
  export interface LiquidationsRequest {
148
165
  account_index: number;
149
166
  limit: number;
@@ -153,6 +170,13 @@ export interface LiquidationsRequest {
153
170
  cursor?: string;
154
171
  }
155
172
 
173
+ export interface LitLeaseRequest {
174
+ tx_info: string;
175
+ lease_amount: string;
176
+ duration_days: number;
177
+ authorization?: string;
178
+ }
179
+
156
180
  export interface PnlRequest {
157
181
  by: PnlByEnum;
158
182
  value: string;
@@ -841,6 +865,89 @@ export class AccountApi extends runtime.BaseAPI {
841
865
  return await response.value();
842
866
  }
843
867
 
868
+ /**
869
+ * Get lease options
870
+ * leaseOptions
871
+ */
872
+ async leaseOptionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetLeaseOptions>> {
873
+ const queryParameters: any = {};
874
+
875
+ const headerParameters: runtime.HTTPHeaders = {};
876
+
877
+ const response = await this.request({
878
+ path: `/api/v1/leaseOptions`,
879
+ method: 'GET',
880
+ headers: headerParameters,
881
+ query: queryParameters,
882
+ }, initOverrides);
883
+
884
+ return new runtime.JSONApiResponse(response, (jsonValue) => RespGetLeaseOptionsFromJSON(jsonValue));
885
+ }
886
+
887
+ /**
888
+ * Get lease options
889
+ * leaseOptions
890
+ */
891
+ async leaseOptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetLeaseOptions> {
892
+ const response = await this.leaseOptionsRaw(initOverrides);
893
+ return await response.value();
894
+ }
895
+
896
+ /**
897
+ * Get leases
898
+ * leases
899
+ */
900
+ async leasesRaw(requestParameters: LeasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetLeases>> {
901
+ if (requestParameters['account_index'] == null) {
902
+ throw new runtime.RequiredError(
903
+ 'account_index',
904
+ 'Required parameter "account_index" was null or undefined when calling leases().'
905
+ );
906
+ }
907
+
908
+ const queryParameters: any = {};
909
+
910
+ if (requestParameters['authorization'] != null) {
911
+ queryParameters['authorization'] = requestParameters['authorization'];
912
+ }
913
+
914
+ if (requestParameters['auth'] != null) {
915
+ queryParameters['auth'] = requestParameters['auth'];
916
+ }
917
+
918
+ if (requestParameters['account_index'] != null) {
919
+ queryParameters['account_index'] = requestParameters['account_index'];
920
+ }
921
+
922
+ if (requestParameters['cursor'] != null) {
923
+ queryParameters['cursor'] = requestParameters['cursor'];
924
+ }
925
+
926
+ if (requestParameters['limit'] != null) {
927
+ queryParameters['limit'] = requestParameters['limit'];
928
+ }
929
+
930
+ const headerParameters: runtime.HTTPHeaders = {};
931
+
932
+ const response = await this.request({
933
+ path: `/api/v1/leases`,
934
+ method: 'GET',
935
+ headers: headerParameters,
936
+ query: queryParameters,
937
+ }, initOverrides);
938
+
939
+ return new runtime.JSONApiResponse(response, (jsonValue) => RespGetLeasesFromJSON(jsonValue));
940
+ }
941
+
942
+ /**
943
+ * Get leases
944
+ * leases
945
+ */
946
+ async leases(requestParameters: LeasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetLeases> {
947
+ const response = await this.leasesRaw(requestParameters, initOverrides);
948
+ return await response.value();
949
+ }
950
+
844
951
  /**
845
952
  * Get liquidation infos
846
953
  * liquidations
@@ -907,6 +1014,86 @@ export class AccountApi extends runtime.BaseAPI {
907
1014
  return await response.value();
908
1015
  }
909
1016
 
1017
+ /**
1018
+ * Submit LIT lease transfer
1019
+ * litLease
1020
+ */
1021
+ async litLeaseRaw(requestParameters: LitLeaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TxHash>> {
1022
+ if (requestParameters['tx_info'] == null) {
1023
+ throw new runtime.RequiredError(
1024
+ 'tx_info',
1025
+ 'Required parameter "tx_info" was null or undefined when calling litLease().'
1026
+ );
1027
+ }
1028
+
1029
+ if (requestParameters['lease_amount'] == null) {
1030
+ throw new runtime.RequiredError(
1031
+ 'lease_amount',
1032
+ 'Required parameter "lease_amount" was null or undefined when calling litLease().'
1033
+ );
1034
+ }
1035
+
1036
+ if (requestParameters['duration_days'] == null) {
1037
+ throw new runtime.RequiredError(
1038
+ 'duration_days',
1039
+ 'Required parameter "duration_days" was null or undefined when calling litLease().'
1040
+ );
1041
+ }
1042
+
1043
+ const queryParameters: any = {};
1044
+
1045
+ const headerParameters: runtime.HTTPHeaders = {};
1046
+
1047
+ if (requestParameters['authorization'] != null) {
1048
+ headerParameters['authorization'] = String(requestParameters['authorization']);
1049
+ }
1050
+
1051
+ const consumes: runtime.Consume[] = [
1052
+ { contentType: 'multipart/form-data' },
1053
+ ];
1054
+ // @ts-ignore: canConsumeForm may be unused
1055
+ const canConsumeForm = runtime.canConsumeForm(consumes);
1056
+
1057
+ let formParams: { append(param: string, value: any): any };
1058
+ let useForm = false;
1059
+ if (useForm) {
1060
+ formParams = new FormData();
1061
+ } else {
1062
+ formParams = new URLSearchParams();
1063
+ }
1064
+
1065
+ if (requestParameters['tx_info'] != null) {
1066
+ formParams.append('tx_info', requestParameters['tx_info'] as any);
1067
+ }
1068
+
1069
+ if (requestParameters['lease_amount'] != null) {
1070
+ formParams.append('lease_amount', requestParameters['lease_amount'] as any);
1071
+ }
1072
+
1073
+ if (requestParameters['duration_days'] != null) {
1074
+ formParams.append('duration_days', requestParameters['duration_days'] as any);
1075
+ }
1076
+
1077
+ const response = await this.request({
1078
+ path: `/api/v1/litLease`,
1079
+ method: 'POST',
1080
+ headers: headerParameters,
1081
+ query: queryParameters,
1082
+ body: formParams,
1083
+ }, initOverrides);
1084
+
1085
+ return new runtime.JSONApiResponse(response, (jsonValue) => TxHashFromJSON(jsonValue));
1086
+ }
1087
+
1088
+ /**
1089
+ * Submit LIT lease transfer
1090
+ * litLease
1091
+ */
1092
+ async litLease(requestParameters: LitLeaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHash> {
1093
+ const response = await this.litLeaseRaw(requestParameters, initOverrides);
1094
+ return await response.value();
1095
+ }
1096
+
910
1097
  /**
911
1098
  * Get account PnL chart
912
1099
  * pnl
@@ -67,6 +67,18 @@ export interface AccountLimits {
67
67
  * @memberof AccountLimits
68
68
  */
69
69
  current_taker_fee_tick: number;
70
+ /**
71
+ *
72
+ * @type {string}
73
+ * @memberof AccountLimits
74
+ */
75
+ leased_lit: string;
76
+ /**
77
+ *
78
+ * @type {string}
79
+ * @memberof AccountLimits
80
+ */
81
+ effective_lit_stakes: string;
70
82
  }
71
83
 
72
84
  /**
@@ -80,6 +92,8 @@ export function instanceOfAccountLimits(value: object): value is AccountLimits {
80
92
  if (!('can_create_public_pool' in value) || value['can_create_public_pool'] === undefined) return false;
81
93
  if (!('current_maker_fee_tick' in value) || value['current_maker_fee_tick'] === undefined) return false;
82
94
  if (!('current_taker_fee_tick' in value) || value['current_taker_fee_tick'] === undefined) return false;
95
+ if (!('leased_lit' in value) || value['leased_lit'] === undefined) return false;
96
+ if (!('effective_lit_stakes' in value) || value['effective_lit_stakes'] === undefined) return false;
83
97
  return true;
84
98
  }
85
99
 
@@ -101,6 +115,8 @@ export function AccountLimitsFromJSONTyped(json: any, ignoreDiscriminator: boole
101
115
  'can_create_public_pool': json['can_create_public_pool'],
102
116
  'current_maker_fee_tick': json['current_maker_fee_tick'],
103
117
  'current_taker_fee_tick': json['current_taker_fee_tick'],
118
+ 'leased_lit': json['leased_lit'],
119
+ 'effective_lit_stakes': json['effective_lit_stakes'],
104
120
  };
105
121
  }
106
122
 
@@ -118,6 +134,8 @@ export function AccountLimitsToJSON(value?: AccountLimits | null): any {
118
134
  'can_create_public_pool': value['can_create_public_pool'],
119
135
  'current_maker_fee_tick': value['current_maker_fee_tick'],
120
136
  'current_taker_fee_tick': value['current_taker_fee_tick'],
137
+ 'leased_lit': value['leased_lit'],
138
+ 'effective_lit_stakes': value['effective_lit_stakes'],
121
139
  };
122
140
  }
123
141
 
@@ -0,0 +1,124 @@
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 LeaseEntry
20
+ */
21
+ export interface LeaseEntry {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof LeaseEntry
26
+ */
27
+ id: number;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof LeaseEntry
32
+ */
33
+ master_account_index: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof LeaseEntry
38
+ */
39
+ lease_amount: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof LeaseEntry
44
+ */
45
+ fee_amount: number;
46
+ /**
47
+ *
48
+ * @type {number}
49
+ * @memberof LeaseEntry
50
+ */
51
+ start: number;
52
+ /**
53
+ *
54
+ * @type {number}
55
+ * @memberof LeaseEntry
56
+ */
57
+ end: number;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof LeaseEntry
62
+ */
63
+ status: string;
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof LeaseEntry
68
+ */
69
+ error: string;
70
+ }
71
+
72
+ /**
73
+ * Check if a given object implements the LeaseEntry interface.
74
+ */
75
+ export function instanceOfLeaseEntry(value: object): value is LeaseEntry {
76
+ if (!('id' in value) || value['id'] === undefined) return false;
77
+ if (!('master_account_index' in value) || value['master_account_index'] === undefined) return false;
78
+ if (!('lease_amount' in value) || value['lease_amount'] === undefined) return false;
79
+ if (!('fee_amount' in value) || value['fee_amount'] === undefined) return false;
80
+ if (!('start' in value) || value['start'] === undefined) return false;
81
+ if (!('end' in value) || value['end'] === undefined) return false;
82
+ if (!('status' in value) || value['status'] === undefined) return false;
83
+ if (!('error' in value) || value['error'] === undefined) return false;
84
+ return true;
85
+ }
86
+
87
+ export function LeaseEntryFromJSON(json: any): LeaseEntry {
88
+ return LeaseEntryFromJSONTyped(json, false);
89
+ }
90
+
91
+ export function LeaseEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): LeaseEntry {
92
+ if (json == null) {
93
+ return json;
94
+ }
95
+ return {
96
+
97
+ 'id': json['id'],
98
+ 'master_account_index': json['master_account_index'],
99
+ 'lease_amount': json['lease_amount'],
100
+ 'fee_amount': json['fee_amount'],
101
+ 'start': json['start'],
102
+ 'end': json['end'],
103
+ 'status': json['status'],
104
+ 'error': json['error'],
105
+ };
106
+ }
107
+
108
+ export function LeaseEntryToJSON(value?: LeaseEntry | null): any {
109
+ if (value == null) {
110
+ return value;
111
+ }
112
+ return {
113
+
114
+ 'id': value['id'],
115
+ 'master_account_index': value['master_account_index'],
116
+ 'lease_amount': value['lease_amount'],
117
+ 'fee_amount': value['fee_amount'],
118
+ 'start': value['start'],
119
+ 'end': value['end'],
120
+ 'status': value['status'],
121
+ 'error': value['error'],
122
+ };
123
+ }
124
+
@@ -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 LeaseOptionEntry
20
+ */
21
+ export interface LeaseOptionEntry {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof LeaseOptionEntry
26
+ */
27
+ duration_days: number;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof LeaseOptionEntry
32
+ */
33
+ annual_rate: number;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the LeaseOptionEntry interface.
38
+ */
39
+ export function instanceOfLeaseOptionEntry(value: object): value is LeaseOptionEntry {
40
+ if (!('duration_days' in value) || value['duration_days'] === undefined) return false;
41
+ if (!('annual_rate' in value) || value['annual_rate'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function LeaseOptionEntryFromJSON(json: any): LeaseOptionEntry {
46
+ return LeaseOptionEntryFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function LeaseOptionEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): LeaseOptionEntry {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'duration_days': json['duration_days'],
56
+ 'annual_rate': json['annual_rate'],
57
+ };
58
+ }
59
+
60
+ export function LeaseOptionEntryToJSON(value?: LeaseOptionEntry | null): any {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+
66
+ 'duration_days': value['duration_days'],
67
+ 'annual_rate': value['annual_rate'],
68
+ };
69
+ }
70
+
@@ -0,0 +1,85 @@
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 ReqGetLeases
20
+ */
21
+ export interface ReqGetLeases {
22
+ /**
23
+ * made optional to support header auth clients
24
+ * @type {string}
25
+ * @memberof ReqGetLeases
26
+ */
27
+ auth?: string;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ReqGetLeases
32
+ */
33
+ account_index: number;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof ReqGetLeases
38
+ */
39
+ cursor?: string;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof ReqGetLeases
44
+ */
45
+ limit?: number;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the ReqGetLeases interface.
50
+ */
51
+ export function instanceOfReqGetLeases(value: object): value is ReqGetLeases {
52
+ if (!('account_index' in value) || value['account_index'] === undefined) return false;
53
+ return true;
54
+ }
55
+
56
+ export function ReqGetLeasesFromJSON(json: any): ReqGetLeases {
57
+ return ReqGetLeasesFromJSONTyped(json, false);
58
+ }
59
+
60
+ export function ReqGetLeasesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetLeases {
61
+ if (json == null) {
62
+ return json;
63
+ }
64
+ return {
65
+
66
+ 'auth': json['auth'] == null ? undefined : json['auth'],
67
+ 'account_index': json['account_index'],
68
+ 'cursor': json['cursor'] == null ? undefined : json['cursor'],
69
+ 'limit': json['limit'] == null ? undefined : json['limit'],
70
+ };
71
+ }
72
+
73
+ export function ReqGetLeasesToJSON(value?: ReqGetLeases | null): any {
74
+ if (value == null) {
75
+ return value;
76
+ }
77
+ return {
78
+
79
+ 'auth': value['auth'],
80
+ 'account_index': value['account_index'],
81
+ 'cursor': value['cursor'],
82
+ 'limit': value['limit'],
83
+ };
84
+ }
85
+
@@ -0,0 +1,85 @@
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 { LeaseOptionEntry } from './LeaseOptionEntry';
17
+ import {
18
+ LeaseOptionEntryFromJSON,
19
+ LeaseOptionEntryFromJSONTyped,
20
+ LeaseOptionEntryToJSON,
21
+ } from './LeaseOptionEntry';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface RespGetLeaseOptions
27
+ */
28
+ export interface RespGetLeaseOptions {
29
+ /**
30
+ *
31
+ * @type {number}
32
+ * @memberof RespGetLeaseOptions
33
+ */
34
+ code: number;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof RespGetLeaseOptions
39
+ */
40
+ message?: string;
41
+ /**
42
+ *
43
+ * @type {Array<LeaseOptionEntry>}
44
+ * @memberof RespGetLeaseOptions
45
+ */
46
+ options: Array<LeaseOptionEntry>;
47
+ }
48
+
49
+ /**
50
+ * Check if a given object implements the RespGetLeaseOptions interface.
51
+ */
52
+ export function instanceOfRespGetLeaseOptions(value: object): value is RespGetLeaseOptions {
53
+ if (!('code' in value) || value['code'] === undefined) return false;
54
+ if (!('options' in value) || value['options'] === undefined) return false;
55
+ return true;
56
+ }
57
+
58
+ export function RespGetLeaseOptionsFromJSON(json: any): RespGetLeaseOptions {
59
+ return RespGetLeaseOptionsFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function RespGetLeaseOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespGetLeaseOptions {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'code': json['code'],
69
+ 'message': json['message'] == null ? undefined : json['message'],
70
+ 'options': ((json['options'] as Array<any>).map(LeaseOptionEntryFromJSON)),
71
+ };
72
+ }
73
+
74
+ export function RespGetLeaseOptionsToJSON(value?: RespGetLeaseOptions | null): any {
75
+ if (value == null) {
76
+ return value;
77
+ }
78
+ return {
79
+
80
+ 'code': value['code'],
81
+ 'message': value['message'],
82
+ 'options': ((value['options'] as Array<any>).map(LeaseOptionEntryToJSON)),
83
+ };
84
+ }
85
+
@@ -0,0 +1,93 @@
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 { LeaseEntry } from './LeaseEntry';
17
+ import {
18
+ LeaseEntryFromJSON,
19
+ LeaseEntryFromJSONTyped,
20
+ LeaseEntryToJSON,
21
+ } from './LeaseEntry';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface RespGetLeases
27
+ */
28
+ export interface RespGetLeases {
29
+ /**
30
+ *
31
+ * @type {number}
32
+ * @memberof RespGetLeases
33
+ */
34
+ code: number;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof RespGetLeases
39
+ */
40
+ message?: string;
41
+ /**
42
+ *
43
+ * @type {Array<LeaseEntry>}
44
+ * @memberof RespGetLeases
45
+ */
46
+ leases: Array<LeaseEntry>;
47
+ /**
48
+ *
49
+ * @type {string}
50
+ * @memberof RespGetLeases
51
+ */
52
+ next_cursor?: string;
53
+ }
54
+
55
+ /**
56
+ * Check if a given object implements the RespGetLeases interface.
57
+ */
58
+ export function instanceOfRespGetLeases(value: object): value is RespGetLeases {
59
+ if (!('code' in value) || value['code'] === undefined) return false;
60
+ if (!('leases' in value) || value['leases'] === undefined) return false;
61
+ return true;
62
+ }
63
+
64
+ export function RespGetLeasesFromJSON(json: any): RespGetLeases {
65
+ return RespGetLeasesFromJSONTyped(json, false);
66
+ }
67
+
68
+ export function RespGetLeasesFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespGetLeases {
69
+ if (json == null) {
70
+ return json;
71
+ }
72
+ return {
73
+
74
+ 'code': json['code'],
75
+ 'message': json['message'] == null ? undefined : json['message'],
76
+ 'leases': ((json['leases'] as Array<any>).map(LeaseEntryFromJSON)),
77
+ 'next_cursor': json['next_cursor'] == null ? undefined : json['next_cursor'],
78
+ };
79
+ }
80
+
81
+ export function RespGetLeasesToJSON(value?: RespGetLeases | null): any {
82
+ if (value == null) {
83
+ return value;
84
+ }
85
+ return {
86
+
87
+ 'code': value['code'],
88
+ 'message': value['message'],
89
+ 'leases': ((value['leases'] as Array<any>).map(LeaseEntryToJSON)),
90
+ 'next_cursor': value['next_cursor'],
91
+ };
92
+ }
93
+
@@ -0,0 +1,88 @@
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 SpotAvgEntryPrice
20
+ */
21
+ export interface SpotAvgEntryPrice {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof SpotAvgEntryPrice
26
+ */
27
+ asset_id: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof SpotAvgEntryPrice
32
+ */
33
+ avg_entry_price: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof SpotAvgEntryPrice
38
+ */
39
+ asset_size: string;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof SpotAvgEntryPrice
44
+ */
45
+ last_trade_id: number;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the SpotAvgEntryPrice interface.
50
+ */
51
+ export function instanceOfSpotAvgEntryPrice(value: object): value is SpotAvgEntryPrice {
52
+ if (!('asset_id' in value) || value['asset_id'] === undefined) return false;
53
+ if (!('avg_entry_price' in value) || value['avg_entry_price'] === undefined) return false;
54
+ if (!('asset_size' in value) || value['asset_size'] === undefined) return false;
55
+ if (!('last_trade_id' in value) || value['last_trade_id'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function SpotAvgEntryPriceFromJSON(json: any): SpotAvgEntryPrice {
60
+ return SpotAvgEntryPriceFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function SpotAvgEntryPriceFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpotAvgEntryPrice {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'asset_id': json['asset_id'],
70
+ 'avg_entry_price': json['avg_entry_price'],
71
+ 'asset_size': json['asset_size'],
72
+ 'last_trade_id': json['last_trade_id'],
73
+ };
74
+ }
75
+
76
+ export function SpotAvgEntryPriceToJSON(value?: SpotAvgEntryPrice | null): any {
77
+ if (value == null) {
78
+ return value;
79
+ }
80
+ return {
81
+
82
+ 'asset_id': value['asset_id'],
83
+ 'avg_entry_price': value['avg_entry_price'],
84
+ 'asset_size': value['asset_size'],
85
+ 'last_trade_id': value['last_trade_id'],
86
+ };
87
+ }
88
+
package/models/Trade.ts CHANGED
@@ -181,6 +181,18 @@ export interface Trade {
181
181
  * @memberof Trade
182
182
  */
183
183
  transaction_time: number;
184
+ /**
185
+ *
186
+ * @type {string}
187
+ * @memberof Trade
188
+ */
189
+ ask_account_pnl: string;
190
+ /**
191
+ *
192
+ * @type {string}
193
+ * @memberof Trade
194
+ */
195
+ bid_account_pnl: string;
184
196
  }
185
197
 
186
198
 
@@ -225,6 +237,8 @@ export function instanceOfTrade(value: object): value is Trade {
225
237
  if (!('maker_initial_margin_fraction_before' in value) || value['maker_initial_margin_fraction_before'] === undefined) return false;
226
238
  if (!('maker_position_sign_changed' in value) || value['maker_position_sign_changed'] === undefined) return false;
227
239
  if (!('transaction_time' in value) || value['transaction_time'] === undefined) return false;
240
+ if (!('ask_account_pnl' in value) || value['ask_account_pnl'] === undefined) return false;
241
+ if (!('bid_account_pnl' in value) || value['bid_account_pnl'] === undefined) return false;
228
242
  return true;
229
243
  }
230
244
 
@@ -265,6 +279,8 @@ export function TradeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tra
265
279
  'maker_initial_margin_fraction_before': json['maker_initial_margin_fraction_before'],
266
280
  'maker_position_sign_changed': json['maker_position_sign_changed'],
267
281
  'transaction_time': json['transaction_time'],
282
+ 'ask_account_pnl': json['ask_account_pnl'],
283
+ 'bid_account_pnl': json['bid_account_pnl'],
268
284
  };
269
285
  }
270
286
 
@@ -301,6 +317,8 @@ export function TradeToJSON(value?: Trade | null): any {
301
317
  'maker_initial_margin_fraction_before': value['maker_initial_margin_fraction_before'],
302
318
  'maker_position_sign_changed': value['maker_position_sign_changed'],
303
319
  'transaction_time': value['transaction_time'],
320
+ 'ask_account_pnl': value['ask_account_pnl'],
321
+ 'bid_account_pnl': value['bid_account_pnl'],
304
322
  };
305
323
  }
306
324
 
package/models/index.ts CHANGED
@@ -61,6 +61,8 @@ export * from './L1ProviderInfo';
61
61
  export * from './Layer1BasicInfo';
62
62
  export * from './Leaderboard';
63
63
  export * from './LeaderboardEntry';
64
+ export * from './LeaseEntry';
65
+ export * from './LeaseOptionEntry';
64
66
  export * from './LiqTrade';
65
67
  export * from './Liquidation';
66
68
  export * from './LiquidationInfo';
@@ -120,6 +122,7 @@ export * from './ReqGetL1Metadata';
120
122
  export * from './ReqGetL1Tx';
121
123
  export * from './ReqGetLatestDeposit';
122
124
  export * from './ReqGetLeaderboard';
125
+ export * from './ReqGetLeases';
123
126
  export * from './ReqGetLiquidationInfos';
124
127
  export * from './ReqGetNextNonce';
125
128
  export * from './ReqGetOrderBookDetails';
@@ -148,6 +151,8 @@ export * from './RespGetExecuteStats';
148
151
  export * from './RespGetFastBridgeInfo';
149
152
  export * from './RespGetFastwithdrawalInfo';
150
153
  export * from './RespGetIsNextBridgeFast';
154
+ export * from './RespGetLeaseOptions';
155
+ export * from './RespGetLeases';
151
156
  export * from './RespPostApiToken';
152
157
  export * from './RespPublicPoolsMetadata';
153
158
  export * from './RespRevokeApiToken';
@@ -162,6 +167,7 @@ export * from './RiskParameters';
162
167
  export * from './SharePrice';
163
168
  export * from './SimpleOrder';
164
169
  export * from './SlippageResult';
170
+ export * from './SpotAvgEntryPrice';
165
171
  export * from './SpotMarketStats';
166
172
  export * from './SpotOrderBookDetail';
167
173
  export * from './Status';
package/openapi.json CHANGED
@@ -2069,6 +2069,94 @@
2069
2069
  "description": "Get points leaderboard"
2070
2070
  }
2071
2071
  },
2072
+ "/api/v1/leaseOptions": {
2073
+ "get": {
2074
+ "summary": "leaseOptions",
2075
+ "operationId": "leaseOptions",
2076
+ "responses": {
2077
+ "200": {
2078
+ "description": "A successful response.",
2079
+ "schema": {
2080
+ "$ref": "#/definitions/RespGetLeaseOptions"
2081
+ }
2082
+ },
2083
+ "400": {
2084
+ "description": "Bad request",
2085
+ "schema": {
2086
+ "$ref": "#/definitions/ResultCode"
2087
+ }
2088
+ }
2089
+ },
2090
+ "tags": [
2091
+ "account"
2092
+ ],
2093
+ "description": "Get lease options"
2094
+ }
2095
+ },
2096
+ "/api/v1/leases": {
2097
+ "get": {
2098
+ "summary": "leases",
2099
+ "operationId": "leases",
2100
+ "responses": {
2101
+ "200": {
2102
+ "description": "A successful response.",
2103
+ "schema": {
2104
+ "$ref": "#/definitions/RespGetLeases"
2105
+ }
2106
+ },
2107
+ "400": {
2108
+ "description": "Bad request",
2109
+ "schema": {
2110
+ "$ref": "#/definitions/ResultCode"
2111
+ }
2112
+ }
2113
+ },
2114
+ "parameters": [
2115
+ {
2116
+ "name": "authorization",
2117
+ "description": " make required after integ is done",
2118
+ "in": "query",
2119
+ "required": false,
2120
+ "type": "string"
2121
+ },
2122
+ {
2123
+ "name": "auth",
2124
+ "description": " made optional to support header auth clients",
2125
+ "in": "query",
2126
+ "required": false,
2127
+ "type": "string"
2128
+ },
2129
+ {
2130
+ "name": "account_index",
2131
+ "in": "query",
2132
+ "required": true,
2133
+ "type": "integer",
2134
+ "format": "int64"
2135
+ },
2136
+ {
2137
+ "name": "cursor",
2138
+ "in": "query",
2139
+ "required": false,
2140
+ "type": "string"
2141
+ },
2142
+ {
2143
+ "name": "limit",
2144
+ "in": "query",
2145
+ "required": false,
2146
+ "type": "integer",
2147
+ "format": "int64",
2148
+ "default": "20"
2149
+ }
2150
+ ],
2151
+ "tags": [
2152
+ "account"
2153
+ ],
2154
+ "consumes": [
2155
+ "multipart/form-data"
2156
+ ],
2157
+ "description": "Get leases"
2158
+ }
2159
+ },
2072
2160
  "/api/v1/liquidations": {
2073
2161
  "get": {
2074
2162
  "summary": "liquidations",
@@ -2142,6 +2230,49 @@
2142
2230
  "description": "Get liquidation infos"
2143
2231
  }
2144
2232
  },
2233
+ "/api/v1/litLease": {
2234
+ "post": {
2235
+ "summary": "litLease",
2236
+ "operationId": "litLease",
2237
+ "responses": {
2238
+ "200": {
2239
+ "description": "A successful response.",
2240
+ "schema": {
2241
+ "$ref": "#/definitions/TxHash"
2242
+ }
2243
+ },
2244
+ "400": {
2245
+ "description": "Bad request",
2246
+ "schema": {
2247
+ "$ref": "#/definitions/ResultCode"
2248
+ }
2249
+ }
2250
+ },
2251
+ "parameters": [
2252
+ {
2253
+ "name": "authorization",
2254
+ "in": "header",
2255
+ "required": false,
2256
+ "type": "string"
2257
+ },
2258
+ {
2259
+ "name": "body",
2260
+ "in": "body",
2261
+ "required": true,
2262
+ "schema": {
2263
+ "$ref": "#/definitions/ReqLITLease"
2264
+ }
2265
+ }
2266
+ ],
2267
+ "tags": [
2268
+ "account"
2269
+ ],
2270
+ "consumes": [
2271
+ "multipart/form-data"
2272
+ ],
2273
+ "description": "Submit LIT lease transfer"
2274
+ }
2275
+ },
2145
2276
  "/api/v1/nextNonce": {
2146
2277
  "get": {
2147
2278
  "summary": "nextNonce",
@@ -3987,6 +4118,12 @@
3987
4118
  "type": "integer",
3988
4119
  "format": "int32",
3989
4120
  "example": "0"
4121
+ },
4122
+ "leased_lit": {
4123
+ "type": "string"
4124
+ },
4125
+ "effective_lit_stakes": {
4126
+ "type": "string"
3990
4127
  }
3991
4128
  },
3992
4129
  "title": "AccountLimits",
@@ -3997,7 +4134,9 @@
3997
4134
  "user_tier",
3998
4135
  "can_create_public_pool",
3999
4136
  "current_maker_fee_tick",
4000
- "current_taker_fee_tick"
4137
+ "current_taker_fee_tick",
4138
+ "leased_lit",
4139
+ "effective_lit_stakes"
4001
4140
  ]
4002
4141
  },
4003
4142
  "AccountMarginStats": {
@@ -6447,6 +6586,70 @@
6447
6586
  "metadata"
6448
6587
  ]
6449
6588
  },
6589
+ "LeaseEntry": {
6590
+ "type": "object",
6591
+ "properties": {
6592
+ "id": {
6593
+ "type": "integer",
6594
+ "format": "int64"
6595
+ },
6596
+ "master_account_index": {
6597
+ "type": "integer",
6598
+ "format": "int64"
6599
+ },
6600
+ "lease_amount": {
6601
+ "type": "integer",
6602
+ "format": "int64"
6603
+ },
6604
+ "fee_amount": {
6605
+ "type": "integer",
6606
+ "format": "int64"
6607
+ },
6608
+ "start": {
6609
+ "type": "integer",
6610
+ "format": "int64"
6611
+ },
6612
+ "end": {
6613
+ "type": "integer",
6614
+ "format": "int64"
6615
+ },
6616
+ "status": {
6617
+ "type": "string"
6618
+ },
6619
+ "error": {
6620
+ "type": "string"
6621
+ }
6622
+ },
6623
+ "title": "LeaseEntry",
6624
+ "required": [
6625
+ "id",
6626
+ "master_account_index",
6627
+ "lease_amount",
6628
+ "fee_amount",
6629
+ "start",
6630
+ "end",
6631
+ "status",
6632
+ "error"
6633
+ ]
6634
+ },
6635
+ "LeaseOptionEntry": {
6636
+ "type": "object",
6637
+ "properties": {
6638
+ "duration_days": {
6639
+ "type": "integer",
6640
+ "format": "int32"
6641
+ },
6642
+ "annual_rate": {
6643
+ "type": "number",
6644
+ "format": "double"
6645
+ }
6646
+ },
6647
+ "title": "LeaseOptionEntry",
6648
+ "required": [
6649
+ "duration_days",
6650
+ "annual_rate"
6651
+ ]
6652
+ },
6450
6653
  "LiqTrade": {
6451
6654
  "type": "object",
6452
6655
  "properties": {
@@ -8985,6 +9188,31 @@
8985
9188
  "type"
8986
9189
  ]
8987
9190
  },
9191
+ "ReqGetLeases": {
9192
+ "type": "object",
9193
+ "properties": {
9194
+ "auth": {
9195
+ "type": "string",
9196
+ "description": " made optional to support header auth clients"
9197
+ },
9198
+ "account_index": {
9199
+ "type": "integer",
9200
+ "format": "int64"
9201
+ },
9202
+ "cursor": {
9203
+ "type": "string"
9204
+ },
9205
+ "limit": {
9206
+ "type": "integer",
9207
+ "format": "int64",
9208
+ "default": "20"
9209
+ }
9210
+ },
9211
+ "title": "ReqGetLeases",
9212
+ "required": [
9213
+ "account_index"
9214
+ ]
9215
+ },
8988
9216
  "ReqGetLiquidationInfos": {
8989
9217
  "type": "object",
8990
9218
  "properties": {
@@ -9510,6 +9738,27 @@
9510
9738
  "l1_address"
9511
9739
  ]
9512
9740
  },
9741
+ "ReqLITLease": {
9742
+ "type": "object",
9743
+ "properties": {
9744
+ "tx_info": {
9745
+ "type": "string"
9746
+ },
9747
+ "lease_amount": {
9748
+ "type": "string"
9749
+ },
9750
+ "duration_days": {
9751
+ "type": "integer",
9752
+ "format": "int32"
9753
+ }
9754
+ },
9755
+ "title": "ReqLITLease",
9756
+ "required": [
9757
+ "tx_info",
9758
+ "lease_amount",
9759
+ "duration_days"
9760
+ ]
9761
+ },
9513
9762
  "ReqPostApiToken": {
9514
9763
  "type": "object",
9515
9764
  "properties": {
@@ -9894,6 +10143,57 @@
9894
10143
  "is_next_bridge_fast"
9895
10144
  ]
9896
10145
  },
10146
+ "RespGetLeaseOptions": {
10147
+ "type": "object",
10148
+ "properties": {
10149
+ "code": {
10150
+ "type": "integer",
10151
+ "format": "int32",
10152
+ "example": "200"
10153
+ },
10154
+ "message": {
10155
+ "type": "string"
10156
+ },
10157
+ "options": {
10158
+ "type": "array",
10159
+ "items": {
10160
+ "$ref": "#/definitions/LeaseOptionEntry"
10161
+ }
10162
+ }
10163
+ },
10164
+ "title": "RespGetLeaseOptions",
10165
+ "required": [
10166
+ "code",
10167
+ "options"
10168
+ ]
10169
+ },
10170
+ "RespGetLeases": {
10171
+ "type": "object",
10172
+ "properties": {
10173
+ "code": {
10174
+ "type": "integer",
10175
+ "format": "int32",
10176
+ "example": "200"
10177
+ },
10178
+ "message": {
10179
+ "type": "string"
10180
+ },
10181
+ "leases": {
10182
+ "type": "array",
10183
+ "items": {
10184
+ "$ref": "#/definitions/LeaseEntry"
10185
+ }
10186
+ },
10187
+ "next_cursor": {
10188
+ "type": "string"
10189
+ }
10190
+ },
10191
+ "title": "RespGetLeases",
10192
+ "required": [
10193
+ "code",
10194
+ "leases"
10195
+ ]
10196
+ },
9897
10197
  "RespPostApiToken": {
9898
10198
  "type": "object",
9899
10199
  "properties": {
@@ -10304,6 +10604,32 @@
10304
10604
  "data_count"
10305
10605
  ]
10306
10606
  },
10607
+ "SpotAvgEntryPrice": {
10608
+ "type": "object",
10609
+ "properties": {
10610
+ "asset_id": {
10611
+ "type": "integer",
10612
+ "format": "int16"
10613
+ },
10614
+ "avg_entry_price": {
10615
+ "type": "string"
10616
+ },
10617
+ "asset_size": {
10618
+ "type": "string"
10619
+ },
10620
+ "last_trade_id": {
10621
+ "type": "integer",
10622
+ "format": "int64"
10623
+ }
10624
+ },
10625
+ "title": "SpotAvgEntryPrice",
10626
+ "required": [
10627
+ "asset_id",
10628
+ "avg_entry_price",
10629
+ "asset_size",
10630
+ "last_trade_id"
10631
+ ]
10632
+ },
10307
10633
  "SpotMarketStats": {
10308
10634
  "type": "object",
10309
10635
  "properties": {
@@ -10799,6 +11125,14 @@
10799
11125
  "type": "integer",
10800
11126
  "format": "int64",
10801
11127
  "example": "1257894000000000"
11128
+ },
11129
+ "ask_account_pnl": {
11130
+ "type": "string",
11131
+ "example": "1967"
11132
+ },
11133
+ "bid_account_pnl": {
11134
+ "type": "string",
11135
+ "example": "1967"
10802
11136
  }
10803
11137
  },
10804
11138
  "title": "Trade",
@@ -10827,7 +11161,9 @@
10827
11161
  "maker_entry_quote_before",
10828
11162
  "maker_initial_margin_fraction_before",
10829
11163
  "maker_position_sign_changed",
10830
- "transaction_time"
11164
+ "transaction_time",
11165
+ "ask_account_pnl",
11166
+ "bid_account_pnl"
10831
11167
  ]
10832
11168
  },
10833
11169
  "Trades": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.209",
3
+ "version": "1.0.211",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {