zklighter-perps 1.0.154 → 1.0.155

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.
@@ -50,6 +50,7 @@ models/Funding.ts
50
50
  models/FundingRate.ts
51
51
  models/FundingRates.ts
52
52
  models/Fundings.ts
53
+ models/HasRefereeCode.ts
53
54
  models/IsWhitelisted.ts
54
55
  models/L1Metadata.ts
55
56
  models/L1ProviderInfo.ts
@@ -123,6 +124,7 @@ models/ReqGetTransferFeeInfo.ts
123
124
  models/ReqGetTransferHistory.ts
124
125
  models/ReqGetTx.ts
125
126
  models/ReqGetWithdrawHistory.ts
127
+ models/ReqHasRefereeByL1Address.ts
126
128
  models/ReqIsWhitelisted.ts
127
129
  models/RespChangeAccountTier.ts
128
130
  models/RespGetFastBridgeInfo.ts
@@ -15,11 +15,14 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ HasRefereeCode,
18
19
  ReferralCode,
19
20
  ReferralPoints,
20
21
  ResultCode,
21
22
  } from '../models/index';
22
23
  import {
24
+ HasRefereeCodeFromJSON,
25
+ HasRefereeCodeToJSON,
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 ReferralHasRefereeByAddressRequest {
47
+ l1_address: string;
48
+ }
49
+
43
50
  export interface ReferralPointsRequest {
44
51
  account_index: number;
45
52
  authorization?: string;
@@ -169,6 +176,45 @@ export class ReferralApi extends runtime.BaseAPI {
169
176
  return await response.value();
170
177
  }
171
178
 
179
+ /**
180
+ * Does L1 address have referee code?
181
+ * referral_hasRefereeByAddress
182
+ */
183
+ async referralHasRefereeByAddressRaw(requestParameters: ReferralHasRefereeByAddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HasRefereeCode>> {
184
+ if (requestParameters['l1_address'] == null) {
185
+ throw new runtime.RequiredError(
186
+ 'l1_address',
187
+ 'Required parameter "l1_address" was null or undefined when calling referralHasRefereeByAddress().'
188
+ );
189
+ }
190
+
191
+ const queryParameters: any = {};
192
+
193
+ if (requestParameters['l1_address'] != null) {
194
+ queryParameters['l1_address'] = requestParameters['l1_address'];
195
+ }
196
+
197
+ const headerParameters: runtime.HTTPHeaders = {};
198
+
199
+ const response = await this.request({
200
+ path: `/api/v1/referral/hasRefereeByAddress`,
201
+ method: 'GET',
202
+ headers: headerParameters,
203
+ query: queryParameters,
204
+ }, initOverrides);
205
+
206
+ return new runtime.JSONApiResponse(response, (jsonValue) => HasRefereeCodeFromJSON(jsonValue));
207
+ }
208
+
209
+ /**
210
+ * Does L1 address have referee code?
211
+ * referral_hasRefereeByAddress
212
+ */
213
+ async referralHasRefereeByAddress(requestParameters: ReferralHasRefereeByAddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HasRefereeCode> {
214
+ const response = await this.referralHasRefereeByAddressRaw(requestParameters, initOverrides);
215
+ return await response.value();
216
+ }
217
+
172
218
  /**
173
219
  * Get referral points
174
220
  * referral_points
@@ -91,6 +91,12 @@ export interface AccountPosition {
91
91
  * @memberof AccountPosition
92
92
  */
93
93
  realized_pnl: string;
94
+ /**
95
+ *
96
+ * @type {string}
97
+ * @memberof AccountPosition
98
+ */
99
+ liquidation_price: string;
94
100
  /**
95
101
  *
96
102
  * @type {string}
@@ -127,6 +133,7 @@ export function instanceOfAccountPosition(value: object): value is AccountPositi
127
133
  if (!('position_value' in value) || value['position_value'] === undefined) return false;
128
134
  if (!('unrealized_pnl' in value) || value['unrealized_pnl'] === undefined) return false;
129
135
  if (!('realized_pnl' in value) || value['realized_pnl'] === undefined) return false;
136
+ if (!('liquidation_price' in value) || value['liquidation_price'] === undefined) return false;
130
137
  if (!('margin_mode' in value) || value['margin_mode'] === undefined) return false;
131
138
  if (!('allocated_margin' in value) || value['allocated_margin'] === undefined) return false;
132
139
  return true;
@@ -154,6 +161,7 @@ export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boo
154
161
  'position_value': json['position_value'],
155
162
  'unrealized_pnl': json['unrealized_pnl'],
156
163
  'realized_pnl': json['realized_pnl'],
164
+ 'liquidation_price': json['liquidation_price'],
157
165
  'total_funding_paid_out': json['total_funding_paid_out'] == null ? undefined : json['total_funding_paid_out'],
158
166
  'margin_mode': json['margin_mode'],
159
167
  'allocated_margin': json['allocated_margin'],
@@ -178,6 +186,7 @@ export function AccountPositionToJSON(value?: AccountPosition | null): any {
178
186
  'position_value': value['position_value'],
179
187
  'unrealized_pnl': value['unrealized_pnl'],
180
188
  'realized_pnl': value['realized_pnl'],
189
+ 'liquidation_price': value['liquidation_price'],
181
190
  'total_funding_paid_out': value['total_funding_paid_out'],
182
191
  'margin_mode': value['margin_mode'],
183
192
  'allocated_margin': value['allocated_margin'],
package/models/index.ts CHANGED
@@ -38,6 +38,7 @@ export * from './Funding';
38
38
  export * from './FundingRate';
39
39
  export * from './FundingRates';
40
40
  export * from './Fundings';
41
+ export * from './HasRefereeCode';
41
42
  export * from './IsWhitelisted';
42
43
  export * from './L1Metadata';
43
44
  export * from './L1ProviderInfo';
@@ -111,6 +112,7 @@ export * from './ReqGetTransferFeeInfo';
111
112
  export * from './ReqGetTransferHistory';
112
113
  export * from './ReqGetTx';
113
114
  export * from './ReqGetWithdrawHistory';
115
+ export * from './ReqHasRefereeByL1Address';
114
116
  export * from './ReqIsWhitelisted';
115
117
  export * from './RespChangeAccountTier';
116
118
  export * from './RespGetFastBridgeInfo';
package/openapi.json CHANGED
@@ -2313,6 +2313,41 @@
2313
2313
  "description": "Get referral code"
2314
2314
  }
2315
2315
  },
2316
+ "/api/v1/referral/hasRefereeByAddress": {
2317
+ "get": {
2318
+ "summary": "referral_hasRefereeByAddress",
2319
+ "operationId": "referral_hasRefereeByAddress",
2320
+ "responses": {
2321
+ "200": {
2322
+ "description": "A successful response.",
2323
+ "schema": {
2324
+ "$ref": "#/definitions/HasRefereeCode"
2325
+ }
2326
+ },
2327
+ "400": {
2328
+ "description": "Bad request",
2329
+ "schema": {
2330
+ "$ref": "#/definitions/ResultCode"
2331
+ }
2332
+ }
2333
+ },
2334
+ "parameters": [
2335
+ {
2336
+ "name": "l1_address",
2337
+ "in": "query",
2338
+ "required": true,
2339
+ "type": "string"
2340
+ }
2341
+ ],
2342
+ "tags": [
2343
+ "referral"
2344
+ ],
2345
+ "consumes": [
2346
+ "multipart/form-data"
2347
+ ],
2348
+ "description": "Does L1 address have referee code?"
2349
+ }
2350
+ },
2316
2351
  "/api/v1/referral/points": {
2317
2352
  "get": {
2318
2353
  "summary": "referral_points",
@@ -3379,6 +3414,10 @@
3379
3414
  "type": "string",
3380
3415
  "example": "2.000000"
3381
3416
  },
3417
+ "liquidation_price": {
3418
+ "type": "string",
3419
+ "example": "3024.66"
3420
+ },
3382
3421
  "total_funding_paid_out": {
3383
3422
  "type": "string",
3384
3423
  "example": "34.2"
@@ -3407,6 +3446,7 @@
3407
3446
  "position_value",
3408
3447
  "unrealized_pnl",
3409
3448
  "realized_pnl",
3449
+ "liquidation_price",
3410
3450
  "margin_mode",
3411
3451
  "allocated_margin"
3412
3452
  ]
@@ -4569,6 +4609,28 @@
4569
4609
  "fundings"
4570
4610
  ]
4571
4611
  },
4612
+ "HasRefereeCode": {
4613
+ "type": "object",
4614
+ "properties": {
4615
+ "code": {
4616
+ "type": "integer",
4617
+ "format": "int32",
4618
+ "example": "200"
4619
+ },
4620
+ "message": {
4621
+ "type": "string"
4622
+ },
4623
+ "has_referee": {
4624
+ "type": "boolean",
4625
+ "format": "boolean"
4626
+ }
4627
+ },
4628
+ "title": "HasRefereeCode",
4629
+ "required": [
4630
+ "code",
4631
+ "has_referee"
4632
+ ]
4633
+ },
4572
4634
  "IsWhitelisted": {
4573
4635
  "type": "object",
4574
4636
  "properties": {
@@ -7248,6 +7310,18 @@
7248
7310
  "account_index"
7249
7311
  ]
7250
7312
  },
7313
+ "ReqHasRefereeByL1Address": {
7314
+ "type": "object",
7315
+ "properties": {
7316
+ "l1_address": {
7317
+ "type": "string"
7318
+ }
7319
+ },
7320
+ "title": "ReqHasRefereeByL1Address",
7321
+ "required": [
7322
+ "l1_address"
7323
+ ]
7324
+ },
7251
7325
  "ReqIsWhitelisted": {
7252
7326
  "type": "object",
7253
7327
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.154",
3
+ "version": "1.0.155",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {