zklighter-perps 1.0.140 → 1.0.142
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.
- package/.openapi-generator/FILES +2 -0
- package/apis/CandlestickApi.ts +2 -1
- package/apis/TransactionApi.ts +12 -12
- package/models/Order.ts +2 -1
- package/models/ReqGetFundings.ts +2 -1
- package/models/RespSendTx.ts +87 -0
- package/models/RespSendTxBatch.ts +87 -0
- package/models/index.ts +2 -0
- package/openapi.json +66 -5
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -126,6 +126,8 @@ models/ReqIsWhitelisted.ts
|
|
|
126
126
|
models/RespChangeAccountTier.ts
|
|
127
127
|
models/RespGetFastBridgeInfo.ts
|
|
128
128
|
models/RespGetFastwithdrawalInfo.ts
|
|
129
|
+
models/RespSendTx.ts
|
|
130
|
+
models/RespSendTxBatch.ts
|
|
129
131
|
models/RespWithdrawalDelay.ts
|
|
130
132
|
models/ResultCode.ts
|
|
131
133
|
models/RiskInfo.ts
|
package/apis/CandlestickApi.ts
CHANGED
|
@@ -238,6 +238,7 @@ export type CandlesticksResolutionEnum = typeof CandlesticksResolutionEnum[keyof
|
|
|
238
238
|
* @export
|
|
239
239
|
*/
|
|
240
240
|
export const FundingsResolutionEnum = {
|
|
241
|
-
_1h: '1h'
|
|
241
|
+
_1h: '1h',
|
|
242
|
+
_1d: '1d'
|
|
242
243
|
} as const;
|
|
243
244
|
export type FundingsResolutionEnum = typeof FundingsResolutionEnum[keyof typeof FundingsResolutionEnum];
|
package/apis/TransactionApi.ts
CHANGED
|
@@ -18,10 +18,10 @@ import type {
|
|
|
18
18
|
DepositHistory,
|
|
19
19
|
EnrichedTx,
|
|
20
20
|
NextNonce,
|
|
21
|
+
RespSendTx,
|
|
22
|
+
RespSendTxBatch,
|
|
21
23
|
ResultCode,
|
|
22
24
|
TransferHistory,
|
|
23
|
-
TxHash,
|
|
24
|
-
TxHashes,
|
|
25
25
|
Txs,
|
|
26
26
|
WithdrawHistory,
|
|
27
27
|
} from '../models/index';
|
|
@@ -32,14 +32,14 @@ import {
|
|
|
32
32
|
EnrichedTxToJSON,
|
|
33
33
|
NextNonceFromJSON,
|
|
34
34
|
NextNonceToJSON,
|
|
35
|
+
RespSendTxFromJSON,
|
|
36
|
+
RespSendTxToJSON,
|
|
37
|
+
RespSendTxBatchFromJSON,
|
|
38
|
+
RespSendTxBatchToJSON,
|
|
35
39
|
ResultCodeFromJSON,
|
|
36
40
|
ResultCodeToJSON,
|
|
37
41
|
TransferHistoryFromJSON,
|
|
38
42
|
TransferHistoryToJSON,
|
|
39
|
-
TxHashFromJSON,
|
|
40
|
-
TxHashToJSON,
|
|
41
|
-
TxHashesFromJSON,
|
|
42
|
-
TxHashesToJSON,
|
|
43
43
|
TxsFromJSON,
|
|
44
44
|
TxsToJSON,
|
|
45
45
|
WithdrawHistoryFromJSON,
|
|
@@ -474,7 +474,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
474
474
|
* You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)
|
|
475
475
|
* sendTx
|
|
476
476
|
*/
|
|
477
|
-
async sendTxRaw(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
477
|
+
async sendTxRaw(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespSendTx>> {
|
|
478
478
|
if (requestParameters['tx_type'] == null) {
|
|
479
479
|
throw new runtime.RequiredError(
|
|
480
480
|
'tx_type',
|
|
@@ -527,14 +527,14 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
527
527
|
body: formParams,
|
|
528
528
|
}, initOverrides);
|
|
529
529
|
|
|
530
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
530
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespSendTxFromJSON(jsonValue));
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
/**
|
|
534
534
|
* You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)
|
|
535
535
|
* sendTx
|
|
536
536
|
*/
|
|
537
|
-
async sendTx(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
537
|
+
async sendTx(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespSendTx> {
|
|
538
538
|
const response = await this.sendTxRaw(requestParameters, initOverrides);
|
|
539
539
|
return await response.value();
|
|
540
540
|
}
|
|
@@ -543,7 +543,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
543
543
|
* You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)
|
|
544
544
|
* sendTxBatch
|
|
545
545
|
*/
|
|
546
|
-
async sendTxBatchRaw(requestParameters: SendTxBatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
546
|
+
async sendTxBatchRaw(requestParameters: SendTxBatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespSendTxBatch>> {
|
|
547
547
|
if (requestParameters['tx_types'] == null) {
|
|
548
548
|
throw new runtime.RequiredError(
|
|
549
549
|
'tx_types',
|
|
@@ -592,14 +592,14 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
592
592
|
body: formParams,
|
|
593
593
|
}, initOverrides);
|
|
594
594
|
|
|
595
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
595
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RespSendTxBatchFromJSON(jsonValue));
|
|
596
596
|
}
|
|
597
597
|
|
|
598
598
|
/**
|
|
599
599
|
* You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)
|
|
600
600
|
* sendTxBatch
|
|
601
601
|
*/
|
|
602
|
-
async sendTxBatch(requestParameters: SendTxBatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
602
|
+
async sendTxBatch(requestParameters: SendTxBatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespSendTxBatch> {
|
|
603
603
|
const response = await this.sendTxBatchRaw(requestParameters, initOverrides);
|
|
604
604
|
return await response.value();
|
|
605
605
|
}
|
package/models/Order.ts
CHANGED
|
@@ -253,7 +253,8 @@ export const OrderStatusEnum = {
|
|
|
253
253
|
CanceledSelfTrade: 'canceled-self-trade',
|
|
254
254
|
CanceledExpired: 'canceled-expired',
|
|
255
255
|
CanceledOco: 'canceled-oco',
|
|
256
|
-
CanceledChild: 'canceled-child'
|
|
256
|
+
CanceledChild: 'canceled-child',
|
|
257
|
+
CanceledLiquidation: 'canceled-liquidation'
|
|
257
258
|
} as const;
|
|
258
259
|
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
|
259
260
|
|
package/models/ReqGetFundings.ts
CHANGED
|
@@ -56,7 +56,8 @@ export interface ReqGetFundings {
|
|
|
56
56
|
* @export
|
|
57
57
|
*/
|
|
58
58
|
export const ReqGetFundingsResolutionEnum = {
|
|
59
|
-
_1h: '1h'
|
|
59
|
+
_1h: '1h',
|
|
60
|
+
_1d: '1d'
|
|
60
61
|
} as const;
|
|
61
62
|
export type ReqGetFundingsResolutionEnum = typeof ReqGetFundingsResolutionEnum[keyof typeof ReqGetFundingsResolutionEnum];
|
|
62
63
|
|
|
@@ -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 RespSendTx
|
|
20
|
+
*/
|
|
21
|
+
export interface RespSendTx {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof RespSendTx
|
|
26
|
+
*/
|
|
27
|
+
code: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof RespSendTx
|
|
32
|
+
*/
|
|
33
|
+
message?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof RespSendTx
|
|
38
|
+
*/
|
|
39
|
+
tx_hash: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof RespSendTx
|
|
44
|
+
*/
|
|
45
|
+
predicted_execution_time_ms: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the RespSendTx interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfRespSendTx(value: object): value is RespSendTx {
|
|
52
|
+
if (!('code' in value) || value['code'] === undefined) return false;
|
|
53
|
+
if (!('tx_hash' in value) || value['tx_hash'] === undefined) return false;
|
|
54
|
+
if (!('predicted_execution_time_ms' in value) || value['predicted_execution_time_ms'] === undefined) return false;
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function RespSendTxFromJSON(json: any): RespSendTx {
|
|
59
|
+
return RespSendTxFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function RespSendTxFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespSendTx {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'code': json['code'],
|
|
69
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
70
|
+
'tx_hash': json['tx_hash'],
|
|
71
|
+
'predicted_execution_time_ms': json['predicted_execution_time_ms'],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function RespSendTxToJSON(value?: RespSendTx | null): any {
|
|
76
|
+
if (value == null) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'code': value['code'],
|
|
82
|
+
'message': value['message'],
|
|
83
|
+
'tx_hash': value['tx_hash'],
|
|
84
|
+
'predicted_execution_time_ms': value['predicted_execution_time_ms'],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
@@ -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 RespSendTxBatch
|
|
20
|
+
*/
|
|
21
|
+
export interface RespSendTxBatch {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof RespSendTxBatch
|
|
26
|
+
*/
|
|
27
|
+
code: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof RespSendTxBatch
|
|
32
|
+
*/
|
|
33
|
+
message?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {Array<string>}
|
|
37
|
+
* @memberof RespSendTxBatch
|
|
38
|
+
*/
|
|
39
|
+
tx_hash: Array<string>;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof RespSendTxBatch
|
|
44
|
+
*/
|
|
45
|
+
predicted_execution_time_ms: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the RespSendTxBatch interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfRespSendTxBatch(value: object): value is RespSendTxBatch {
|
|
52
|
+
if (!('code' in value) || value['code'] === undefined) return false;
|
|
53
|
+
if (!('tx_hash' in value) || value['tx_hash'] === undefined) return false;
|
|
54
|
+
if (!('predicted_execution_time_ms' in value) || value['predicted_execution_time_ms'] === undefined) return false;
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function RespSendTxBatchFromJSON(json: any): RespSendTxBatch {
|
|
59
|
+
return RespSendTxBatchFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function RespSendTxBatchFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespSendTxBatch {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'code': json['code'],
|
|
69
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
70
|
+
'tx_hash': json['tx_hash'],
|
|
71
|
+
'predicted_execution_time_ms': json['predicted_execution_time_ms'],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function RespSendTxBatchToJSON(value?: RespSendTxBatch | null): any {
|
|
76
|
+
if (value == null) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'code': value['code'],
|
|
82
|
+
'message': value['message'],
|
|
83
|
+
'tx_hash': value['tx_hash'],
|
|
84
|
+
'predicted_execution_time_ms': value['predicted_execution_time_ms'],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
package/models/index.ts
CHANGED
|
@@ -114,6 +114,8 @@ export * from './ReqIsWhitelisted';
|
|
|
114
114
|
export * from './RespChangeAccountTier';
|
|
115
115
|
export * from './RespGetFastBridgeInfo';
|
|
116
116
|
export * from './RespGetFastwithdrawalInfo';
|
|
117
|
+
export * from './RespSendTx';
|
|
118
|
+
export * from './RespSendTxBatch';
|
|
117
119
|
export * from './RespWithdrawalDelay';
|
|
118
120
|
export * from './ResultCode';
|
|
119
121
|
export * from './RiskInfo';
|
package/openapi.json
CHANGED
|
@@ -1365,7 +1365,8 @@
|
|
|
1365
1365
|
"required": true,
|
|
1366
1366
|
"type": "string",
|
|
1367
1367
|
"enum": [
|
|
1368
|
-
"1h"
|
|
1368
|
+
"1h",
|
|
1369
|
+
"1d"
|
|
1369
1370
|
]
|
|
1370
1371
|
},
|
|
1371
1372
|
{
|
|
@@ -2395,7 +2396,7 @@
|
|
|
2395
2396
|
"200": {
|
|
2396
2397
|
"description": "A successful response.",
|
|
2397
2398
|
"schema": {
|
|
2398
|
-
"$ref": "#/definitions/
|
|
2399
|
+
"$ref": "#/definitions/RespSendTx"
|
|
2399
2400
|
}
|
|
2400
2401
|
},
|
|
2401
2402
|
"400": {
|
|
@@ -2432,7 +2433,7 @@
|
|
|
2432
2433
|
"200": {
|
|
2433
2434
|
"description": "A successful response.",
|
|
2434
2435
|
"schema": {
|
|
2435
|
-
"$ref": "#/definitions/
|
|
2436
|
+
"$ref": "#/definitions/RespSendTxBatch"
|
|
2436
2437
|
}
|
|
2437
2438
|
},
|
|
2438
2439
|
"400": {
|
|
@@ -5032,7 +5033,8 @@
|
|
|
5032
5033
|
"canceled-self-trade",
|
|
5033
5034
|
"canceled-expired",
|
|
5034
5035
|
"canceled-oco",
|
|
5035
|
-
"canceled-child"
|
|
5036
|
+
"canceled-child",
|
|
5037
|
+
"canceled-liquidation"
|
|
5036
5038
|
]
|
|
5037
5039
|
},
|
|
5038
5040
|
"trigger_status": {
|
|
@@ -6638,7 +6640,8 @@
|
|
|
6638
6640
|
"resolution": {
|
|
6639
6641
|
"type": "string",
|
|
6640
6642
|
"enum": [
|
|
6641
|
-
"1h"
|
|
6643
|
+
"1h",
|
|
6644
|
+
"1d"
|
|
6642
6645
|
]
|
|
6643
6646
|
},
|
|
6644
6647
|
"start_timestamp": {
|
|
@@ -7317,6 +7320,64 @@
|
|
|
7317
7320
|
"max_withdrawal_amount"
|
|
7318
7321
|
]
|
|
7319
7322
|
},
|
|
7323
|
+
"RespSendTx": {
|
|
7324
|
+
"type": "object",
|
|
7325
|
+
"properties": {
|
|
7326
|
+
"code": {
|
|
7327
|
+
"type": "integer",
|
|
7328
|
+
"format": "int32",
|
|
7329
|
+
"example": "200"
|
|
7330
|
+
},
|
|
7331
|
+
"message": {
|
|
7332
|
+
"type": "string"
|
|
7333
|
+
},
|
|
7334
|
+
"tx_hash": {
|
|
7335
|
+
"type": "string",
|
|
7336
|
+
"example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
|
7337
|
+
},
|
|
7338
|
+
"predicted_execution_time_ms": {
|
|
7339
|
+
"type": "integer",
|
|
7340
|
+
"format": "int64",
|
|
7341
|
+
"example": "1751465474"
|
|
7342
|
+
}
|
|
7343
|
+
},
|
|
7344
|
+
"title": "RespSendTx",
|
|
7345
|
+
"required": [
|
|
7346
|
+
"code",
|
|
7347
|
+
"tx_hash",
|
|
7348
|
+
"predicted_execution_time_ms"
|
|
7349
|
+
]
|
|
7350
|
+
},
|
|
7351
|
+
"RespSendTxBatch": {
|
|
7352
|
+
"type": "object",
|
|
7353
|
+
"properties": {
|
|
7354
|
+
"code": {
|
|
7355
|
+
"type": "integer",
|
|
7356
|
+
"format": "int32",
|
|
7357
|
+
"example": "200"
|
|
7358
|
+
},
|
|
7359
|
+
"message": {
|
|
7360
|
+
"type": "string"
|
|
7361
|
+
},
|
|
7362
|
+
"tx_hash": {
|
|
7363
|
+
"type": "array",
|
|
7364
|
+
"items": {
|
|
7365
|
+
"type": "string"
|
|
7366
|
+
}
|
|
7367
|
+
},
|
|
7368
|
+
"predicted_execution_time_ms": {
|
|
7369
|
+
"type": "integer",
|
|
7370
|
+
"format": "int64",
|
|
7371
|
+
"example": "1751465474"
|
|
7372
|
+
}
|
|
7373
|
+
},
|
|
7374
|
+
"title": "RespSendTxBatch",
|
|
7375
|
+
"required": [
|
|
7376
|
+
"code",
|
|
7377
|
+
"tx_hash",
|
|
7378
|
+
"predicted_execution_time_ms"
|
|
7379
|
+
]
|
|
7380
|
+
},
|
|
7320
7381
|
"RespWithdrawalDelay": {
|
|
7321
7382
|
"type": "object",
|
|
7322
7383
|
"properties": {
|