zklighter-perps 1.0.77 → 1.0.78

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.
@@ -97,6 +97,7 @@ models/ReqGetTrades.ts
97
97
  models/ReqGetTx.ts
98
98
  models/ReqGetWithdrawHistory.ts
99
99
  models/ReqIsWhitelisted.ts
100
+ models/RespGetFastwithdrawalInfo.ts
100
101
  models/ResultCode.ts
101
102
  models/SimpleOrder.ts
102
103
  models/Status.ts
package/apis/BridgeApi.ts CHANGED
@@ -18,6 +18,7 @@ import type {
18
18
  BridgeSupportedNetworks,
19
19
  CreateIntentAddressResp,
20
20
  Deposit,
21
+ RespGetFastwithdrawalInfo,
21
22
  ResultCode,
22
23
  } from '../models/index';
23
24
  import {
@@ -27,6 +28,8 @@ import {
27
28
  CreateIntentAddressRespToJSON,
28
29
  DepositFromJSON,
29
30
  DepositToJSON,
31
+ RespGetFastwithdrawalInfoFromJSON,
32
+ RespGetFastwithdrawalInfoToJSON,
30
33
  ResultCodeFromJSON,
31
34
  ResultCodeToJSON,
32
35
  } from '../models/index';
@@ -47,6 +50,12 @@ export interface DepositLatestRequest {
47
50
  l1_address: string;
48
51
  }
49
52
 
53
+ export interface FastwithdrawRequest {
54
+ tx_info: string;
55
+ to_address: string;
56
+ auth: string;
57
+ }
58
+
50
59
  /**
51
60
  *
52
61
  */
@@ -264,4 +273,108 @@ export class BridgeApi extends runtime.BaseAPI {
264
273
  return await response.value();
265
274
  }
266
275
 
276
+ /**
277
+ * Fast withdraw
278
+ * fastwithdraw
279
+ */
280
+ async fastwithdrawRaw(requestParameters: FastwithdrawRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
281
+ if (requestParameters['tx_info'] == null) {
282
+ throw new runtime.RequiredError(
283
+ 'tx_info',
284
+ 'Required parameter "tx_info" was null or undefined when calling fastwithdraw().'
285
+ );
286
+ }
287
+
288
+ if (requestParameters['to_address'] == null) {
289
+ throw new runtime.RequiredError(
290
+ 'to_address',
291
+ 'Required parameter "to_address" was null or undefined when calling fastwithdraw().'
292
+ );
293
+ }
294
+
295
+ if (requestParameters['auth'] == null) {
296
+ throw new runtime.RequiredError(
297
+ 'auth',
298
+ 'Required parameter "auth" was null or undefined when calling fastwithdraw().'
299
+ );
300
+ }
301
+
302
+ const queryParameters: any = {};
303
+
304
+ const headerParameters: runtime.HTTPHeaders = {};
305
+
306
+ const consumes: runtime.Consume[] = [
307
+ { contentType: 'multipart/form-data' },
308
+ ];
309
+ // @ts-ignore: canConsumeForm may be unused
310
+ const canConsumeForm = runtime.canConsumeForm(consumes);
311
+
312
+ let formParams: { append(param: string, value: any): any };
313
+ let useForm = false;
314
+ if (useForm) {
315
+ formParams = new FormData();
316
+ } else {
317
+ formParams = new URLSearchParams();
318
+ }
319
+
320
+ if (requestParameters['tx_info'] != null) {
321
+ formParams.append('tx_info', requestParameters['tx_info'] as any);
322
+ }
323
+
324
+ if (requestParameters['to_address'] != null) {
325
+ formParams.append('to_address', requestParameters['to_address'] as any);
326
+ }
327
+
328
+ if (requestParameters['auth'] != null) {
329
+ formParams.append('auth', requestParameters['auth'] as any);
330
+ }
331
+
332
+ const response = await this.request({
333
+ path: `/api/v1/fastwithdraw`,
334
+ method: 'POST',
335
+ headers: headerParameters,
336
+ query: queryParameters,
337
+ body: formParams,
338
+ }, initOverrides);
339
+
340
+ return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
341
+ }
342
+
343
+ /**
344
+ * Fast withdraw
345
+ * fastwithdraw
346
+ */
347
+ async fastwithdraw(requestParameters: FastwithdrawRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
348
+ const response = await this.fastwithdrawRaw(requestParameters, initOverrides);
349
+ return await response.value();
350
+ }
351
+
352
+ /**
353
+ * Get fast withdraw info
354
+ * fastwithdraw_info
355
+ */
356
+ async fastwithdrawInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetFastwithdrawalInfo>> {
357
+ const queryParameters: any = {};
358
+
359
+ const headerParameters: runtime.HTTPHeaders = {};
360
+
361
+ const response = await this.request({
362
+ path: `/api/v1/fastwithdraw/info`,
363
+ method: 'GET',
364
+ headers: headerParameters,
365
+ query: queryParameters,
366
+ }, initOverrides);
367
+
368
+ return new runtime.JSONApiResponse(response, (jsonValue) => RespGetFastwithdrawalInfoFromJSON(jsonValue));
369
+ }
370
+
371
+ /**
372
+ * Get fast withdraw info
373
+ * fastwithdraw_info
374
+ */
375
+ async fastwithdrawInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetFastwithdrawalInfo> {
376
+ const response = await this.fastwithdrawInfoRaw(initOverrides);
377
+ return await response.value();
378
+ }
379
+
267
380
  }
@@ -42,9 +42,21 @@ export interface DepositHistoryItem {
42
42
  * @type {string}
43
43
  * @memberof DepositHistoryItem
44
44
  */
45
- status: string;
45
+ status: DepositHistoryItemStatusEnum;
46
46
  }
47
47
 
48
+
49
+ /**
50
+ * @export
51
+ */
52
+ export const DepositHistoryItemStatusEnum = {
53
+ Failed: 'failed',
54
+ Pending: 'pending',
55
+ Completed: 'completed'
56
+ } as const;
57
+ export type DepositHistoryItemStatusEnum = typeof DepositHistoryItemStatusEnum[keyof typeof DepositHistoryItemStatusEnum];
58
+
59
+
48
60
  /**
49
61
  * Check if a given object implements the DepositHistoryItem interface.
50
62
  */
@@ -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 RespGetFastwithdrawalInfo
20
+ */
21
+ export interface RespGetFastwithdrawalInfo {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof RespGetFastwithdrawalInfo
26
+ */
27
+ code: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof RespGetFastwithdrawalInfo
32
+ */
33
+ message?: string;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof RespGetFastwithdrawalInfo
38
+ */
39
+ to_account_index: number;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof RespGetFastwithdrawalInfo
44
+ */
45
+ withdraw_limit: string;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the RespGetFastwithdrawalInfo interface.
50
+ */
51
+ export function instanceOfRespGetFastwithdrawalInfo(value: object): value is RespGetFastwithdrawalInfo {
52
+ if (!('code' in value) || value['code'] === undefined) return false;
53
+ if (!('to_account_index' in value) || value['to_account_index'] === undefined) return false;
54
+ if (!('withdraw_limit' in value) || value['withdraw_limit'] === undefined) return false;
55
+ return true;
56
+ }
57
+
58
+ export function RespGetFastwithdrawalInfoFromJSON(json: any): RespGetFastwithdrawalInfo {
59
+ return RespGetFastwithdrawalInfoFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function RespGetFastwithdrawalInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespGetFastwithdrawalInfo {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'code': json['code'],
69
+ 'message': json['message'] == null ? undefined : json['message'],
70
+ 'to_account_index': json['to_account_index'],
71
+ 'withdraw_limit': json['withdraw_limit'],
72
+ };
73
+ }
74
+
75
+ export function RespGetFastwithdrawalInfoToJSON(value?: RespGetFastwithdrawalInfo | null): any {
76
+ if (value == null) {
77
+ return value;
78
+ }
79
+ return {
80
+
81
+ 'code': value['code'],
82
+ 'message': value['message'],
83
+ 'to_account_index': value['to_account_index'],
84
+ 'withdraw_limit': value['withdraw_limit'],
85
+ };
86
+ }
87
+
@@ -42,9 +42,21 @@ export interface WithdrawHistoryItem {
42
42
  * @type {string}
43
43
  * @memberof WithdrawHistoryItem
44
44
  */
45
- status: string;
45
+ status: WithdrawHistoryItemStatusEnum;
46
46
  }
47
47
 
48
+
49
+ /**
50
+ * @export
51
+ */
52
+ export const WithdrawHistoryItemStatusEnum = {
53
+ Failed: 'failed',
54
+ Pending: 'pending',
55
+ Claimable: 'claimable'
56
+ } as const;
57
+ export type WithdrawHistoryItemStatusEnum = typeof WithdrawHistoryItemStatusEnum[keyof typeof WithdrawHistoryItemStatusEnum];
58
+
59
+
48
60
  /**
49
61
  * Check if a given object implements the WithdrawHistoryItem interface.
50
62
  */
package/models/index.ts CHANGED
@@ -88,6 +88,7 @@ export * from './ReqGetTrades';
88
88
  export * from './ReqGetTx';
89
89
  export * from './ReqGetWithdrawHistory';
90
90
  export * from './ReqIsWhitelisted';
91
+ export * from './RespGetFastwithdrawalInfo';
91
92
  export * from './ResultCode';
92
93
  export * from './SimpleOrder';
93
94
  export * from './Status';
package/openapi.json CHANGED
@@ -975,6 +975,67 @@
975
975
  "description": "Get exchange stats"
976
976
  }
977
977
  },
978
+ "/api/v1/fastwithdraw": {
979
+ "post": {
980
+ "summary": "fastwithdraw",
981
+ "operationId": "fastwithdraw",
982
+ "responses": {
983
+ "200": {
984
+ "description": "A successful response.",
985
+ "schema": {
986
+ "$ref": "#/definitions/ResultCode"
987
+ }
988
+ },
989
+ "400": {
990
+ "description": "Bad request",
991
+ "schema": {
992
+ "$ref": "#/definitions/ResultCode"
993
+ }
994
+ }
995
+ },
996
+ "parameters": [
997
+ {
998
+ "name": "body",
999
+ "in": "body",
1000
+ "required": true,
1001
+ "schema": {
1002
+ "$ref": "#/definitions/ReqFastwithdraw"
1003
+ }
1004
+ }
1005
+ ],
1006
+ "tags": [
1007
+ "bridge"
1008
+ ],
1009
+ "consumes": [
1010
+ "multipart/form-data"
1011
+ ],
1012
+ "description": "Fast withdraw"
1013
+ }
1014
+ },
1015
+ "/api/v1/fastwithdraw/info": {
1016
+ "get": {
1017
+ "summary": "fastwithdraw_info",
1018
+ "operationId": "fastwithdraw_info",
1019
+ "responses": {
1020
+ "200": {
1021
+ "description": "A successful response.",
1022
+ "schema": {
1023
+ "$ref": "#/definitions/RespGetFastwithdrawalInfo"
1024
+ }
1025
+ },
1026
+ "400": {
1027
+ "description": "Bad request",
1028
+ "schema": {
1029
+ "$ref": "#/definitions/ResultCode"
1030
+ }
1031
+ }
1032
+ },
1033
+ "tags": [
1034
+ "bridge"
1035
+ ],
1036
+ "description": "Get fast withdraw info"
1037
+ }
1038
+ },
978
1039
  "/api/v1/faucet": {
979
1040
  "get": {
980
1041
  "summary": "faucet",
@@ -2851,7 +2912,11 @@
2851
2912
  },
2852
2913
  "status": {
2853
2914
  "type": "string",
2854
- "example": "pending|executed|failed"
2915
+ "enum": [
2916
+ "failed",
2917
+ "pending",
2918
+ "completed"
2919
+ ]
2855
2920
  }
2856
2921
  },
2857
2922
  "title": "DepositHistoryItem",
@@ -4557,6 +4622,26 @@
4557
4622
  "l1_address"
4558
4623
  ]
4559
4624
  },
4625
+ "ReqFastwithdraw": {
4626
+ "type": "object",
4627
+ "properties": {
4628
+ "tx_info": {
4629
+ "type": "string"
4630
+ },
4631
+ "to_address": {
4632
+ "type": "string"
4633
+ },
4634
+ "auth": {
4635
+ "type": "string"
4636
+ }
4637
+ },
4638
+ "title": "ReqFastwithdraw",
4639
+ "required": [
4640
+ "tx_info",
4641
+ "to_address",
4642
+ "auth"
4643
+ ]
4644
+ },
4560
4645
  "ReqGetAccount": {
4561
4646
  "type": "object",
4562
4647
  "properties": {
@@ -5408,6 +5493,32 @@
5408
5493
  "auth"
5409
5494
  ]
5410
5495
  },
5496
+ "RespGetFastwithdrawalInfo": {
5497
+ "type": "object",
5498
+ "properties": {
5499
+ "code": {
5500
+ "type": "integer",
5501
+ "format": "int32",
5502
+ "example": "200"
5503
+ },
5504
+ "message": {
5505
+ "type": "string"
5506
+ },
5507
+ "to_account_index": {
5508
+ "type": "integer",
5509
+ "format": "int64"
5510
+ },
5511
+ "withdraw_limit": {
5512
+ "type": "string"
5513
+ }
5514
+ },
5515
+ "title": "RespGetFastwithdrawalInfo",
5516
+ "required": [
5517
+ "code",
5518
+ "to_account_index",
5519
+ "withdraw_limit"
5520
+ ]
5521
+ },
5411
5522
  "ResultCode": {
5412
5523
  "type": "object",
5413
5524
  "properties": {
@@ -5885,7 +5996,11 @@
5885
5996
  },
5886
5997
  "status": {
5887
5998
  "type": "string",
5888
- "example": "pending|executed|failed"
5999
+ "enum": [
6000
+ "failed",
6001
+ "pending",
6002
+ "claimable"
6003
+ ]
5889
6004
  }
5890
6005
  },
5891
6006
  "title": "WithdrawHistoryItem",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.77",
3
+ "version": "1.0.78",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {