zklighter-perps 1.0.328 → 1.0.330
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/apis/AccountApi.ts +0 -127
- package/models/UpDownPrice.ts +24 -24
- package/openapi.json +12 -103
- package/package.json +1 -1
package/apis/AccountApi.ts
CHANGED
|
@@ -164,16 +164,6 @@ export interface ChangeAccountTierRequest {
|
|
|
164
164
|
auth?: string;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
export interface EquityHistoryPnlRequest {
|
|
168
|
-
by: EquityHistoryPnlByEnum;
|
|
169
|
-
value: string;
|
|
170
|
-
resolution: EquityHistoryPnlResolutionEnum;
|
|
171
|
-
start_timestamp: number;
|
|
172
|
-
end_timestamp: number;
|
|
173
|
-
count_back: number;
|
|
174
|
-
ignore_transfers?: boolean;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
167
|
export interface FaucetRequest {
|
|
178
168
|
l1_address: string;
|
|
179
169
|
do_l1_transfer: boolean;
|
|
@@ -814,104 +804,6 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
814
804
|
return await response.value();
|
|
815
805
|
}
|
|
816
806
|
|
|
817
|
-
/**
|
|
818
|
-
* Shadow account PnL chart computed from equity_history
|
|
819
|
-
* equity_history_pnl
|
|
820
|
-
*/
|
|
821
|
-
async equityHistoryPnlRaw(requestParameters: EquityHistoryPnlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountPnL>> {
|
|
822
|
-
if (requestParameters['by'] == null) {
|
|
823
|
-
throw new runtime.RequiredError(
|
|
824
|
-
'by',
|
|
825
|
-
'Required parameter "by" was null or undefined when calling equityHistoryPnl().'
|
|
826
|
-
);
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
if (requestParameters['value'] == null) {
|
|
830
|
-
throw new runtime.RequiredError(
|
|
831
|
-
'value',
|
|
832
|
-
'Required parameter "value" was null or undefined when calling equityHistoryPnl().'
|
|
833
|
-
);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
if (requestParameters['resolution'] == null) {
|
|
837
|
-
throw new runtime.RequiredError(
|
|
838
|
-
'resolution',
|
|
839
|
-
'Required parameter "resolution" was null or undefined when calling equityHistoryPnl().'
|
|
840
|
-
);
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
if (requestParameters['start_timestamp'] == null) {
|
|
844
|
-
throw new runtime.RequiredError(
|
|
845
|
-
'start_timestamp',
|
|
846
|
-
'Required parameter "start_timestamp" was null or undefined when calling equityHistoryPnl().'
|
|
847
|
-
);
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
if (requestParameters['end_timestamp'] == null) {
|
|
851
|
-
throw new runtime.RequiredError(
|
|
852
|
-
'end_timestamp',
|
|
853
|
-
'Required parameter "end_timestamp" was null or undefined when calling equityHistoryPnl().'
|
|
854
|
-
);
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
if (requestParameters['count_back'] == null) {
|
|
858
|
-
throw new runtime.RequiredError(
|
|
859
|
-
'count_back',
|
|
860
|
-
'Required parameter "count_back" was null or undefined when calling equityHistoryPnl().'
|
|
861
|
-
);
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
const queryParameters: any = {};
|
|
865
|
-
|
|
866
|
-
if (requestParameters['by'] != null) {
|
|
867
|
-
queryParameters['by'] = requestParameters['by'];
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
if (requestParameters['value'] != null) {
|
|
871
|
-
queryParameters['value'] = requestParameters['value'];
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
if (requestParameters['resolution'] != null) {
|
|
875
|
-
queryParameters['resolution'] = requestParameters['resolution'];
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
if (requestParameters['start_timestamp'] != null) {
|
|
879
|
-
queryParameters['start_timestamp'] = requestParameters['start_timestamp'];
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
if (requestParameters['end_timestamp'] != null) {
|
|
883
|
-
queryParameters['end_timestamp'] = requestParameters['end_timestamp'];
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
if (requestParameters['count_back'] != null) {
|
|
887
|
-
queryParameters['count_back'] = requestParameters['count_back'];
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
if (requestParameters['ignore_transfers'] != null) {
|
|
891
|
-
queryParameters['ignore_transfers'] = requestParameters['ignore_transfers'];
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
895
|
-
|
|
896
|
-
const response = await this.request({
|
|
897
|
-
path: `/api/v1/equity_history/pnl`,
|
|
898
|
-
method: 'GET',
|
|
899
|
-
headers: headerParameters,
|
|
900
|
-
query: queryParameters,
|
|
901
|
-
}, initOverrides);
|
|
902
|
-
|
|
903
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => AccountPnLFromJSON(jsonValue));
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
/**
|
|
907
|
-
* Shadow account PnL chart computed from equity_history
|
|
908
|
-
* equity_history_pnl
|
|
909
|
-
*/
|
|
910
|
-
async equityHistoryPnl(requestParameters: EquityHistoryPnlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountPnL> {
|
|
911
|
-
const response = await this.equityHistoryPnlRaw(requestParameters, initOverrides);
|
|
912
|
-
return await response.value();
|
|
913
|
-
}
|
|
914
|
-
|
|
915
807
|
/**
|
|
916
808
|
* Request funds from faucet
|
|
917
809
|
* faucet
|
|
@@ -2486,25 +2378,6 @@ export const AccountMetadataByEnum = {
|
|
|
2486
2378
|
L1Address: 'l1_address'
|
|
2487
2379
|
} as const;
|
|
2488
2380
|
export type AccountMetadataByEnum = typeof AccountMetadataByEnum[keyof typeof AccountMetadataByEnum];
|
|
2489
|
-
/**
|
|
2490
|
-
* @export
|
|
2491
|
-
*/
|
|
2492
|
-
export const EquityHistoryPnlByEnum = {
|
|
2493
|
-
Index: 'index'
|
|
2494
|
-
} as const;
|
|
2495
|
-
export type EquityHistoryPnlByEnum = typeof EquityHistoryPnlByEnum[keyof typeof EquityHistoryPnlByEnum];
|
|
2496
|
-
/**
|
|
2497
|
-
* @export
|
|
2498
|
-
*/
|
|
2499
|
-
export const EquityHistoryPnlResolutionEnum = {
|
|
2500
|
-
_1m: '1m',
|
|
2501
|
-
_5m: '5m',
|
|
2502
|
-
_15m: '15m',
|
|
2503
|
-
_1h: '1h',
|
|
2504
|
-
_4h: '4h',
|
|
2505
|
-
_1d: '1d'
|
|
2506
|
-
} as const;
|
|
2507
|
-
export type EquityHistoryPnlResolutionEnum = typeof EquityHistoryPnlResolutionEnum[keyof typeof EquityHistoryPnlResolutionEnum];
|
|
2508
2381
|
/**
|
|
2509
2382
|
* @export
|
|
2510
2383
|
*/
|
package/models/UpDownPrice.ts
CHANGED
|
@@ -24,49 +24,49 @@ export interface UpDownPrice {
|
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof UpDownPrice
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
symbol: string;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @memberof UpDownPrice
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
duration: string;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {number}
|
|
37
37
|
* @memberof UpDownPrice
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
timestamp: number;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @type {string}
|
|
43
43
|
* @memberof UpDownPrice
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
price: string;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
48
|
* @type {string}
|
|
49
49
|
* @memberof UpDownPrice
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
provider: string;
|
|
52
52
|
/**
|
|
53
53
|
*
|
|
54
54
|
* @type {string}
|
|
55
55
|
* @memberof UpDownPrice
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
feed_id: string;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Check if a given object implements the UpDownPrice interface.
|
|
62
62
|
*/
|
|
63
63
|
export function instanceOfUpDownPrice(value: object): value is UpDownPrice {
|
|
64
|
-
if (!('
|
|
65
|
-
if (!('
|
|
66
|
-
if (!('
|
|
67
|
-
if (!('
|
|
68
|
-
if (!('
|
|
69
|
-
if (!('
|
|
64
|
+
if (!('symbol' in value) || value['symbol'] === undefined) return false;
|
|
65
|
+
if (!('duration' in value) || value['duration'] === undefined) return false;
|
|
66
|
+
if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
|
|
67
|
+
if (!('price' in value) || value['price'] === undefined) return false;
|
|
68
|
+
if (!('provider' in value) || value['provider'] === undefined) return false;
|
|
69
|
+
if (!('feed_id' in value) || value['feed_id'] === undefined) return false;
|
|
70
70
|
return true;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -80,12 +80,12 @@ export function UpDownPriceFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
80
80
|
}
|
|
81
81
|
return {
|
|
82
82
|
|
|
83
|
-
'
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
'
|
|
88
|
-
'
|
|
83
|
+
'symbol': json['symbol'],
|
|
84
|
+
'duration': json['duration'],
|
|
85
|
+
'timestamp': json['timestamp'],
|
|
86
|
+
'price': json['price'],
|
|
87
|
+
'provider': json['provider'],
|
|
88
|
+
'feed_id': json['feed_id'],
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -95,12 +95,12 @@ export function UpDownPriceToJSON(value?: UpDownPrice | null): any {
|
|
|
95
95
|
}
|
|
96
96
|
return {
|
|
97
97
|
|
|
98
|
-
'
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
98
|
+
'symbol': value['symbol'],
|
|
99
|
+
'duration': value['duration'],
|
|
100
|
+
'timestamp': value['timestamp'],
|
|
101
|
+
'price': value['price'],
|
|
102
|
+
'provider': value['provider'],
|
|
103
|
+
'feed_id': value['feed_id'],
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
|
package/openapi.json
CHANGED
|
@@ -1544,97 +1544,6 @@
|
|
|
1544
1544
|
"description": "Get deposit supporting networks"
|
|
1545
1545
|
}
|
|
1546
1546
|
},
|
|
1547
|
-
"/api/v1/equity_history/pnl": {
|
|
1548
|
-
"get": {
|
|
1549
|
-
"summary": "equity_history_pnl",
|
|
1550
|
-
"operationId": "equity_history_pnl",
|
|
1551
|
-
"responses": {
|
|
1552
|
-
"200": {
|
|
1553
|
-
"description": "A successful response.",
|
|
1554
|
-
"schema": {
|
|
1555
|
-
"$ref": "#/definitions/AccountPnL"
|
|
1556
|
-
}
|
|
1557
|
-
},
|
|
1558
|
-
"400": {
|
|
1559
|
-
"description": "Bad request",
|
|
1560
|
-
"schema": {
|
|
1561
|
-
"$ref": "#/definitions/ResultCode"
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
},
|
|
1565
|
-
"parameters": [
|
|
1566
|
-
{
|
|
1567
|
-
"name": "by",
|
|
1568
|
-
"in": "query",
|
|
1569
|
-
"required": true,
|
|
1570
|
-
"type": "string",
|
|
1571
|
-
"enum": [
|
|
1572
|
-
"index"
|
|
1573
|
-
]
|
|
1574
|
-
},
|
|
1575
|
-
{
|
|
1576
|
-
"name": "value",
|
|
1577
|
-
"in": "query",
|
|
1578
|
-
"required": true,
|
|
1579
|
-
"type": "string"
|
|
1580
|
-
},
|
|
1581
|
-
{
|
|
1582
|
-
"name": "resolution",
|
|
1583
|
-
"in": "query",
|
|
1584
|
-
"required": true,
|
|
1585
|
-
"type": "string",
|
|
1586
|
-
"enum": [
|
|
1587
|
-
"1m",
|
|
1588
|
-
"5m",
|
|
1589
|
-
"15m",
|
|
1590
|
-
"1h",
|
|
1591
|
-
"4h",
|
|
1592
|
-
"1d"
|
|
1593
|
-
]
|
|
1594
|
-
},
|
|
1595
|
-
{
|
|
1596
|
-
"name": "start_timestamp",
|
|
1597
|
-
"in": "query",
|
|
1598
|
-
"required": true,
|
|
1599
|
-
"type": "integer",
|
|
1600
|
-
"format": "int64",
|
|
1601
|
-
"minimum": 0,
|
|
1602
|
-
"maximum": 5000000000000
|
|
1603
|
-
},
|
|
1604
|
-
{
|
|
1605
|
-
"name": "end_timestamp",
|
|
1606
|
-
"in": "query",
|
|
1607
|
-
"required": true,
|
|
1608
|
-
"type": "integer",
|
|
1609
|
-
"format": "int64",
|
|
1610
|
-
"minimum": 0,
|
|
1611
|
-
"maximum": 5000000000000
|
|
1612
|
-
},
|
|
1613
|
-
{
|
|
1614
|
-
"name": "count_back",
|
|
1615
|
-
"in": "query",
|
|
1616
|
-
"required": true,
|
|
1617
|
-
"type": "integer",
|
|
1618
|
-
"format": "int64"
|
|
1619
|
-
},
|
|
1620
|
-
{
|
|
1621
|
-
"name": "ignore_transfers",
|
|
1622
|
-
"in": "query",
|
|
1623
|
-
"required": false,
|
|
1624
|
-
"type": "boolean",
|
|
1625
|
-
"format": "boolean",
|
|
1626
|
-
"default": "false"
|
|
1627
|
-
}
|
|
1628
|
-
],
|
|
1629
|
-
"tags": [
|
|
1630
|
-
"account"
|
|
1631
|
-
],
|
|
1632
|
-
"consumes": [
|
|
1633
|
-
"multipart/form-data"
|
|
1634
|
-
],
|
|
1635
|
-
"description": "Shadow account PnL chart computed from equity_history"
|
|
1636
|
-
}
|
|
1637
|
-
},
|
|
1638
1547
|
"/api/v1/event/create": {
|
|
1639
1548
|
"post": {
|
|
1640
1549
|
"summary": "event_create",
|
|
@@ -21868,34 +21777,34 @@
|
|
|
21868
21777
|
"UpDownPrice": {
|
|
21869
21778
|
"type": "object",
|
|
21870
21779
|
"properties": {
|
|
21871
|
-
"
|
|
21780
|
+
"symbol": {
|
|
21872
21781
|
"type": "string"
|
|
21873
21782
|
},
|
|
21874
|
-
"
|
|
21783
|
+
"duration": {
|
|
21875
21784
|
"type": "string"
|
|
21876
21785
|
},
|
|
21877
|
-
"
|
|
21786
|
+
"timestamp": {
|
|
21878
21787
|
"type": "integer",
|
|
21879
21788
|
"format": "int64"
|
|
21880
21789
|
},
|
|
21881
|
-
"
|
|
21790
|
+
"price": {
|
|
21882
21791
|
"type": "string"
|
|
21883
21792
|
},
|
|
21884
|
-
"
|
|
21793
|
+
"provider": {
|
|
21885
21794
|
"type": "string"
|
|
21886
21795
|
},
|
|
21887
|
-
"
|
|
21796
|
+
"feed_id": {
|
|
21888
21797
|
"type": "string"
|
|
21889
21798
|
}
|
|
21890
21799
|
},
|
|
21891
21800
|
"title": "UpDownPrice",
|
|
21892
21801
|
"required": [
|
|
21893
|
-
"
|
|
21894
|
-
"
|
|
21895
|
-
"
|
|
21896
|
-
"
|
|
21897
|
-
"
|
|
21898
|
-
"
|
|
21802
|
+
"symbol",
|
|
21803
|
+
"duration",
|
|
21804
|
+
"timestamp",
|
|
21805
|
+
"price",
|
|
21806
|
+
"provider",
|
|
21807
|
+
"feed_id"
|
|
21899
21808
|
]
|
|
21900
21809
|
},
|
|
21901
21810
|
"UpcomingEarning": {
|