zklighter-perps 1.0.304 → 1.0.306
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 +19 -0
- package/apis/AccountApi.ts +119 -0
- package/apis/EventApi.ts +558 -0
- package/apis/OrderApi.ts +4 -2
- package/apis/PortfolioApi.ts +101 -0
- package/apis/index.ts +2 -0
- package/models/AccountBinaryOptionsPosition.ts +97 -0
- package/models/AccountPnLV2.ts +118 -0
- package/models/BinaryOptionMarketStats.ts +209 -0
- package/models/BoEventPnL.ts +104 -0
- package/models/BoOutcomePnL.ts +115 -0
- package/models/DetailedAccount.ts +15 -0
- package/models/EventDetail.ts +187 -0
- package/models/EventOrderBookEntry.ts +359 -0
- package/models/Order.ts +19 -0
- package/models/OrderBook.ts +92 -1
- package/models/PerpsOrderBookDetail.ts +92 -10
- package/models/PnLV2Entry.ts +214 -0
- package/models/PnLV2Summary.ts +106 -0
- package/models/ReqGetAccountEvents.ts +85 -0
- package/models/ReqGetAccountPnLV2.ts +124 -0
- package/models/ReqGetBoPnL.ts +93 -0
- package/models/ReqGetEvents.ts +169 -0
- package/models/ReqGetOrderBookDetails.ts +2 -1
- package/models/ReqGetOrderBooks.ts +2 -1
- package/models/RespCreateEvent.ts +78 -0
- package/models/RespGetBoPnL.ts +93 -0
- package/models/RespGetEvents.ts +93 -0
- package/models/RespRegisterEventOrderBook.ts +78 -0
- package/models/SpotOrderBookDetail.ts +92 -1
- package/models/StockFinancialDividendEvent.ts +14 -21
- package/models/StockFinancialDividends.ts +6 -8
- package/models/Trade.ts +19 -0
- package/models/index.ts +17 -0
- package/openapi.json +2003 -256
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -5,6 +5,7 @@ apis/BlockApi.ts
|
|
|
5
5
|
apis/BridgeApi.ts
|
|
6
6
|
apis/CandlestickApi.ts
|
|
7
7
|
apis/EarningsApi.ts
|
|
8
|
+
apis/EventApi.ts
|
|
8
9
|
apis/FundingApi.ts
|
|
9
10
|
apis/GeckoApi.ts
|
|
10
11
|
apis/GeoApi.ts
|
|
@@ -13,6 +14,7 @@ apis/LivepointsApi.ts
|
|
|
13
14
|
apis/MarketnewsApi.ts
|
|
14
15
|
apis/NotificationApi.ts
|
|
15
16
|
apis/OrderApi.ts
|
|
17
|
+
apis/PortfolioApi.ts
|
|
16
18
|
apis/PushnotifApi.ts
|
|
17
19
|
apis/ReferralApi.ts
|
|
18
20
|
apis/RootApi.ts
|
|
@@ -25,12 +27,14 @@ index.ts
|
|
|
25
27
|
models/Account.ts
|
|
26
28
|
models/AccountApiKeys.ts
|
|
27
29
|
models/AccountAsset.ts
|
|
30
|
+
models/AccountBinaryOptionsPosition.ts
|
|
28
31
|
models/AccountLimits.ts
|
|
29
32
|
models/AccountMarginStats.ts
|
|
30
33
|
models/AccountMarketStats.ts
|
|
31
34
|
models/AccountMetadata.ts
|
|
32
35
|
models/AccountMetadatas.ts
|
|
33
36
|
models/AccountPnL.ts
|
|
37
|
+
models/AccountPnLV2.ts
|
|
34
38
|
models/AccountPosition.ts
|
|
35
39
|
models/AccountStats.ts
|
|
36
40
|
models/AccountTradeStats.ts
|
|
@@ -48,8 +52,11 @@ models/AssetStats.ts
|
|
|
48
52
|
models/AtomicOrder.ts
|
|
49
53
|
models/AtomicOrderLeg.ts
|
|
50
54
|
models/Auth.ts
|
|
55
|
+
models/BinaryOptionMarketStats.ts
|
|
51
56
|
models/Block.ts
|
|
52
57
|
models/Blocks.ts
|
|
58
|
+
models/BoEventPnL.ts
|
|
59
|
+
models/BoOutcomePnL.ts
|
|
53
60
|
models/Bridge.ts
|
|
54
61
|
models/BridgeSupportedNetwork.ts
|
|
55
62
|
models/BridgeSupportedNetworks.ts
|
|
@@ -68,6 +75,8 @@ models/DepositHistoryItem.ts
|
|
|
68
75
|
models/DetailedAccount.ts
|
|
69
76
|
models/DetailedAccounts.ts
|
|
70
77
|
models/EnrichedTx.ts
|
|
78
|
+
models/EventDetail.ts
|
|
79
|
+
models/EventOrderBookEntry.ts
|
|
71
80
|
models/ExchangeMetric.ts
|
|
72
81
|
models/ExchangeStats.ts
|
|
73
82
|
models/ExecuteStat.ts
|
|
@@ -118,6 +127,8 @@ models/PendingUnlock.ts
|
|
|
118
127
|
models/PerpsMarketStats.ts
|
|
119
128
|
models/PerpsOrderBookDetail.ts
|
|
120
129
|
models/PnLEntry.ts
|
|
130
|
+
models/PnLV2Entry.ts
|
|
131
|
+
models/PnLV2Summary.ts
|
|
121
132
|
models/PnlLeaderboard.ts
|
|
122
133
|
models/PnlLeaderboardEntry.ts
|
|
123
134
|
models/PositionFunding.ts
|
|
@@ -147,11 +158,13 @@ models/ReqGetAccount.ts
|
|
|
147
158
|
models/ReqGetAccountActiveOrders.ts
|
|
148
159
|
models/ReqGetAccountApiKeys.ts
|
|
149
160
|
models/ReqGetAccountByL1Address.ts
|
|
161
|
+
models/ReqGetAccountEvents.ts
|
|
150
162
|
models/ReqGetAccountInactiveOrders.ts
|
|
151
163
|
models/ReqGetAccountLimits.ts
|
|
152
164
|
models/ReqGetAccountMetadata.ts
|
|
153
165
|
models/ReqGetAccountOrders.ts
|
|
154
166
|
models/ReqGetAccountPnL.ts
|
|
167
|
+
models/ReqGetAccountPnLV2.ts
|
|
155
168
|
models/ReqGetAccountTxs.ts
|
|
156
169
|
models/ReqGetAirdropAllocations.ts
|
|
157
170
|
models/ReqGetApiTokens.ts
|
|
@@ -159,10 +172,12 @@ models/ReqGetAssetDetails.ts
|
|
|
159
172
|
models/ReqGetAtomicOrder.ts
|
|
160
173
|
models/ReqGetBlock.ts
|
|
161
174
|
models/ReqGetBlockTxs.ts
|
|
175
|
+
models/ReqGetBoPnL.ts
|
|
162
176
|
models/ReqGetBridgesByL1Addr.ts
|
|
163
177
|
models/ReqGetByAccount.ts
|
|
164
178
|
models/ReqGetCandles.ts
|
|
165
179
|
models/ReqGetDepositHistory.ts
|
|
180
|
+
models/ReqGetEvents.ts
|
|
166
181
|
models/ReqGetExchangeMetrics.ts
|
|
167
182
|
models/ReqGetExecuteStats.ts
|
|
168
183
|
models/ReqGetFastWithdrawInfo.ts
|
|
@@ -214,10 +229,13 @@ models/ReqTvSymbolInfo.ts
|
|
|
214
229
|
models/RespAtomicOrder.ts
|
|
215
230
|
models/RespAtomicOrderList.ts
|
|
216
231
|
models/RespChangeAccountTier.ts
|
|
232
|
+
models/RespCreateEvent.ts
|
|
217
233
|
models/RespCreateRFQ.ts
|
|
218
234
|
models/RespGaslessDeposit.ts
|
|
219
235
|
models/RespGetApiTokens.ts
|
|
236
|
+
models/RespGetBoPnL.ts
|
|
220
237
|
models/RespGetBridgesByL1Addr.ts
|
|
238
|
+
models/RespGetEvents.ts
|
|
221
239
|
models/RespGetExchangeMetrics.ts
|
|
222
240
|
models/RespGetExecuteStats.ts
|
|
223
241
|
models/RespGetFastBridgeInfo.ts
|
|
@@ -233,6 +251,7 @@ models/RespListMarketNews.ts
|
|
|
233
251
|
models/RespListRFQs.ts
|
|
234
252
|
models/RespPostApiToken.ts
|
|
235
253
|
models/RespPublicPoolsMetadata.ts
|
|
254
|
+
models/RespRegisterEventOrderBook.ts
|
|
236
255
|
models/RespRespondToRFQ.ts
|
|
237
256
|
models/RespRevokeApiToken.ts
|
|
238
257
|
models/RespRollingInfo.ts
|
package/apis/AccountApi.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
AccountLimits,
|
|
20
20
|
AccountMetadatas,
|
|
21
21
|
AccountPnL,
|
|
22
|
+
AccountPnLV2,
|
|
22
23
|
AirdropAllocations,
|
|
23
24
|
DetailedAccounts,
|
|
24
25
|
IsWhitelisted,
|
|
@@ -55,6 +56,8 @@ import {
|
|
|
55
56
|
AccountMetadatasToJSON,
|
|
56
57
|
AccountPnLFromJSON,
|
|
57
58
|
AccountPnLToJSON,
|
|
59
|
+
AccountPnLV2FromJSON,
|
|
60
|
+
AccountPnLV2ToJSON,
|
|
58
61
|
AirdropAllocationsFromJSON,
|
|
59
62
|
AirdropAllocationsToJSON,
|
|
60
63
|
DetailedAccountsFromJSON,
|
|
@@ -254,6 +257,16 @@ export interface PnlLeaderboardRequest {
|
|
|
254
257
|
search?: string;
|
|
255
258
|
}
|
|
256
259
|
|
|
260
|
+
export interface PnlV2Request {
|
|
261
|
+
by: PnlV2ByEnum;
|
|
262
|
+
value: string;
|
|
263
|
+
resolution: PnlV2ResolutionEnum;
|
|
264
|
+
start_timestamp: number;
|
|
265
|
+
end_timestamp: number;
|
|
266
|
+
authorization?: string;
|
|
267
|
+
auth?: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
257
270
|
export interface PositionFundingRequest {
|
|
258
271
|
account_index: number;
|
|
259
272
|
limit: number;
|
|
@@ -1621,6 +1634,97 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
1621
1634
|
return await response.value();
|
|
1622
1635
|
}
|
|
1623
1636
|
|
|
1637
|
+
/**
|
|
1638
|
+
* Trade, pool, staking and total equity, interval and window PnL in USD. Total ROI is a fraction (0.0088 = 0.88%). The latest sample strictly before start is a hidden baseline; intervals use available sample boundaries. Missing baseline produces zero first PnL and zero cumulative PnL. Historical queries never append current data.
|
|
1639
|
+
* pnl_v2
|
|
1640
|
+
*/
|
|
1641
|
+
async pnlV2Raw(requestParameters: PnlV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountPnLV2>> {
|
|
1642
|
+
if (requestParameters['by'] == null) {
|
|
1643
|
+
throw new runtime.RequiredError(
|
|
1644
|
+
'by',
|
|
1645
|
+
'Required parameter "by" was null or undefined when calling pnlV2().'
|
|
1646
|
+
);
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
if (requestParameters['value'] == null) {
|
|
1650
|
+
throw new runtime.RequiredError(
|
|
1651
|
+
'value',
|
|
1652
|
+
'Required parameter "value" was null or undefined when calling pnlV2().'
|
|
1653
|
+
);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
if (requestParameters['resolution'] == null) {
|
|
1657
|
+
throw new runtime.RequiredError(
|
|
1658
|
+
'resolution',
|
|
1659
|
+
'Required parameter "resolution" was null or undefined when calling pnlV2().'
|
|
1660
|
+
);
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
if (requestParameters['start_timestamp'] == null) {
|
|
1664
|
+
throw new runtime.RequiredError(
|
|
1665
|
+
'start_timestamp',
|
|
1666
|
+
'Required parameter "start_timestamp" was null or undefined when calling pnlV2().'
|
|
1667
|
+
);
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
if (requestParameters['end_timestamp'] == null) {
|
|
1671
|
+
throw new runtime.RequiredError(
|
|
1672
|
+
'end_timestamp',
|
|
1673
|
+
'Required parameter "end_timestamp" was null or undefined when calling pnlV2().'
|
|
1674
|
+
);
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
const queryParameters: any = {};
|
|
1678
|
+
|
|
1679
|
+
if (requestParameters['authorization'] != null) {
|
|
1680
|
+
queryParameters['authorization'] = requestParameters['authorization'];
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
if (requestParameters['auth'] != null) {
|
|
1684
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
if (requestParameters['by'] != null) {
|
|
1688
|
+
queryParameters['by'] = requestParameters['by'];
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
if (requestParameters['value'] != null) {
|
|
1692
|
+
queryParameters['value'] = requestParameters['value'];
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
if (requestParameters['resolution'] != null) {
|
|
1696
|
+
queryParameters['resolution'] = requestParameters['resolution'];
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
if (requestParameters['start_timestamp'] != null) {
|
|
1700
|
+
queryParameters['start_timestamp'] = requestParameters['start_timestamp'];
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
if (requestParameters['end_timestamp'] != null) {
|
|
1704
|
+
queryParameters['end_timestamp'] = requestParameters['end_timestamp'];
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1708
|
+
|
|
1709
|
+
const response = await this.request({
|
|
1710
|
+
path: `/api/v2/pnl`,
|
|
1711
|
+
method: 'GET',
|
|
1712
|
+
headers: headerParameters,
|
|
1713
|
+
query: queryParameters,
|
|
1714
|
+
}, initOverrides);
|
|
1715
|
+
|
|
1716
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AccountPnLV2FromJSON(jsonValue));
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
/**
|
|
1720
|
+
* Trade, pool, staking and total equity, interval and window PnL in USD. Total ROI is a fraction (0.0088 = 0.88%). The latest sample strictly before start is a hidden baseline; intervals use available sample boundaries. Missing baseline produces zero first PnL and zero cumulative PnL. Historical queries never append current data.
|
|
1721
|
+
* pnl_v2
|
|
1722
|
+
*/
|
|
1723
|
+
async pnlV2(requestParameters: PnlV2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountPnLV2> {
|
|
1724
|
+
const response = await this.pnlV2Raw(requestParameters, initOverrides);
|
|
1725
|
+
return await response.value();
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1624
1728
|
/**
|
|
1625
1729
|
* Get accounts position fundings
|
|
1626
1730
|
* positionFunding
|
|
@@ -2472,6 +2576,21 @@ export const PnlLeaderboardSortDirEnum = {
|
|
|
2472
2576
|
Desc: 'desc'
|
|
2473
2577
|
} as const;
|
|
2474
2578
|
export type PnlLeaderboardSortDirEnum = typeof PnlLeaderboardSortDirEnum[keyof typeof PnlLeaderboardSortDirEnum];
|
|
2579
|
+
/**
|
|
2580
|
+
* @export
|
|
2581
|
+
*/
|
|
2582
|
+
export const PnlV2ByEnum = {
|
|
2583
|
+
Index: 'index'
|
|
2584
|
+
} as const;
|
|
2585
|
+
export type PnlV2ByEnum = typeof PnlV2ByEnum[keyof typeof PnlV2ByEnum];
|
|
2586
|
+
/**
|
|
2587
|
+
* @export
|
|
2588
|
+
*/
|
|
2589
|
+
export const PnlV2ResolutionEnum = {
|
|
2590
|
+
_1h: '1h',
|
|
2591
|
+
_1d: '1d'
|
|
2592
|
+
} as const;
|
|
2593
|
+
export type PnlV2ResolutionEnum = typeof PnlV2ResolutionEnum[keyof typeof PnlV2ResolutionEnum];
|
|
2475
2594
|
/**
|
|
2476
2595
|
* @export
|
|
2477
2596
|
*/
|