@pendle/sdk-boros 0.1.24 → 0.1.25
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/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +18 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/secrettune/BorosBackendSDK.d.ts +656 -0
- package/dist/backend/secrettune/BorosBackendSDK.js +384 -0
- package/dist/backend/secrettune/BorosBackendSDK.js.map +1 -0
- package/dist/backend/secrettune/index.d.ts +1 -0
- package/dist/backend/secrettune/index.js +38 -0
- package/dist/backend/secrettune/index.js.map +1 -0
- package/dist/backend/secrettune/module.d.ts +6 -0
- package/dist/backend/secrettune/module.js +33 -0
- package/dist/backend/secrettune/module.js.map +1 -0
- package/dist/contracts/viemAbis.d.ts +155 -0
- package/dist/contracts/viemAbis.js +4 -3
- package/dist/contracts/viemAbis.js.map +1 -1
- package/dist/entities/exchange/exchange.d.ts +1070 -0
- package/dist/entities/exchange/exchange.js +354 -0
- package/dist/entities/exchange/exchange.js.map +1 -0
- package/dist/entities/exchange/index.d.ts +2 -0
- package/dist/entities/exchange/index.js +19 -0
- package/dist/entities/exchange/index.js.map +1 -0
- package/dist/entities/exchange/types.d.ts +73 -0
- package/dist/entities/exchange/types.js +3 -0
- package/dist/entities/exchange/types.js.map +1 -0
- package/dist/entities/exchange/utils.d.ts +2126 -0
- package/dist/entities/exchange/utils.js +28 -0
- package/dist/entities/exchange/utils.js.map +1 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/index.js.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './secrettune';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./secrettune"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
export interface MarketFIndexConfigResponse {
|
|
2
|
+
oracle: string;
|
|
3
|
+
paymentPeriod: number;
|
|
4
|
+
maxUpdateDelay: number;
|
|
5
|
+
}
|
|
6
|
+
export interface MarketConfigResponse {
|
|
7
|
+
openInterestCap: string;
|
|
8
|
+
orderBookFeesFactor: string;
|
|
9
|
+
otcFeesFactor: string;
|
|
10
|
+
settlementFeesFactor: string;
|
|
11
|
+
imFactor: string;
|
|
12
|
+
mmFactor: string;
|
|
13
|
+
maxMarginIndexRate: string;
|
|
14
|
+
minMarginIndexRate: string;
|
|
15
|
+
minMarginIndexDuration: number;
|
|
16
|
+
}
|
|
17
|
+
export interface MarketDataResponse {
|
|
18
|
+
volume24h?: number;
|
|
19
|
+
notionalOI?: number;
|
|
20
|
+
markApr: number;
|
|
21
|
+
lastTradedApr: number;
|
|
22
|
+
impliedApr: number;
|
|
23
|
+
floatingApr: number;
|
|
24
|
+
longYieldApr?: number;
|
|
25
|
+
nextSettlementTime?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface MarketMetadataResponse {
|
|
28
|
+
name: string;
|
|
29
|
+
platformIcon: string;
|
|
30
|
+
platformName: string;
|
|
31
|
+
maxLeverage: number;
|
|
32
|
+
defaultLeverage: number;
|
|
33
|
+
icon: string;
|
|
34
|
+
isWhitelisted: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface MarketResponse {
|
|
37
|
+
marketId: number;
|
|
38
|
+
address: string;
|
|
39
|
+
maturity: number;
|
|
40
|
+
collateralAddress: string;
|
|
41
|
+
isIsolatedOnly: boolean;
|
|
42
|
+
fIndexCfg: MarketFIndexConfigResponse;
|
|
43
|
+
config: MarketConfigResponse;
|
|
44
|
+
data?: MarketDataResponse;
|
|
45
|
+
metadata?: MarketMetadataResponse;
|
|
46
|
+
block: number;
|
|
47
|
+
timestamp: number;
|
|
48
|
+
isWhitelisted: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface MarketsResponse {
|
|
51
|
+
results: MarketResponse[];
|
|
52
|
+
total: number;
|
|
53
|
+
skip: number;
|
|
54
|
+
}
|
|
55
|
+
export interface MarketTradeResponse {
|
|
56
|
+
size: number;
|
|
57
|
+
rate: number;
|
|
58
|
+
txHash: string;
|
|
59
|
+
blockTimestamp: number;
|
|
60
|
+
}
|
|
61
|
+
export interface MarketTradesResponse {
|
|
62
|
+
results: MarketTradeResponse[];
|
|
63
|
+
total: number;
|
|
64
|
+
skip: number;
|
|
65
|
+
}
|
|
66
|
+
export interface CandleResponse {
|
|
67
|
+
ts: number;
|
|
68
|
+
t: number;
|
|
69
|
+
o: number;
|
|
70
|
+
h: number;
|
|
71
|
+
l: number;
|
|
72
|
+
c: number;
|
|
73
|
+
v: number;
|
|
74
|
+
u: number;
|
|
75
|
+
i: number;
|
|
76
|
+
}
|
|
77
|
+
export interface ChartResponse {
|
|
78
|
+
results: CandleResponse[];
|
|
79
|
+
}
|
|
80
|
+
export interface TickResponse {
|
|
81
|
+
ia: number;
|
|
82
|
+
sz: string;
|
|
83
|
+
}
|
|
84
|
+
export interface OrderBooksResponse {
|
|
85
|
+
long: TickResponse[];
|
|
86
|
+
short: TickResponse[];
|
|
87
|
+
}
|
|
88
|
+
export interface DepositStateResponse {
|
|
89
|
+
collateralBalance: string;
|
|
90
|
+
marginRatio: number;
|
|
91
|
+
}
|
|
92
|
+
export interface DepositSimulationResponse {
|
|
93
|
+
minReceived: string;
|
|
94
|
+
preUserState: DepositStateResponse;
|
|
95
|
+
postUserState: DepositStateResponse;
|
|
96
|
+
}
|
|
97
|
+
export interface WithdrawStateResponse {
|
|
98
|
+
collateralBalance: string;
|
|
99
|
+
marginRatio: number;
|
|
100
|
+
}
|
|
101
|
+
export interface WithdrawSimulationResponse {
|
|
102
|
+
preUserState: WithdrawStateResponse;
|
|
103
|
+
postUserState: WithdrawStateResponse;
|
|
104
|
+
}
|
|
105
|
+
export interface CashTransferStateResponse {
|
|
106
|
+
collateralBalance: string;
|
|
107
|
+
marginRatio: number;
|
|
108
|
+
}
|
|
109
|
+
export interface CashTransferPrePostSimulationResponse {
|
|
110
|
+
preUserState: CashTransferStateResponse;
|
|
111
|
+
postUserState: CashTransferStateResponse;
|
|
112
|
+
}
|
|
113
|
+
export interface CashTransferSimulationResponse {
|
|
114
|
+
crossAccState: CashTransferPrePostSimulationResponse;
|
|
115
|
+
isolatedAccState: CashTransferPrePostSimulationResponse;
|
|
116
|
+
}
|
|
117
|
+
export interface PlaceOrderStateResponse {
|
|
118
|
+
totalCash: string;
|
|
119
|
+
availableInitialMargin: string;
|
|
120
|
+
availableMaintMargin: string;
|
|
121
|
+
marginRatio: number;
|
|
122
|
+
activePositionSize: string;
|
|
123
|
+
activePositionValue: string;
|
|
124
|
+
}
|
|
125
|
+
export interface ContractSwapPositionResponse {
|
|
126
|
+
size: string;
|
|
127
|
+
cost: string;
|
|
128
|
+
rate: number;
|
|
129
|
+
}
|
|
130
|
+
export interface PlaceOrderSimulationResponse {
|
|
131
|
+
preUserInfo: PlaceOrderStateResponse;
|
|
132
|
+
postUserInfo: PlaceOrderStateResponse;
|
|
133
|
+
matched: ContractSwapPositionResponse;
|
|
134
|
+
marginRequired: string;
|
|
135
|
+
liquidationApr: number;
|
|
136
|
+
profit25PercentApr: number;
|
|
137
|
+
priceImpact: number;
|
|
138
|
+
fee: string;
|
|
139
|
+
limitOrderValue: string;
|
|
140
|
+
actualLeverage: number;
|
|
141
|
+
}
|
|
142
|
+
export interface UserInfoResponse {
|
|
143
|
+
totalCash: string;
|
|
144
|
+
availableInitialMargin: string;
|
|
145
|
+
availableMaintMargin: string;
|
|
146
|
+
marginRatio: number;
|
|
147
|
+
}
|
|
148
|
+
export interface CancelOrderSimulationResponse {
|
|
149
|
+
preUserInfo: UserInfoResponse;
|
|
150
|
+
postUserInfo: UserInfoResponse;
|
|
151
|
+
}
|
|
152
|
+
export interface ModifyOrderSimulationResponse {
|
|
153
|
+
preUserInfo: PlaceOrderStateResponse;
|
|
154
|
+
postUserInfo: PlaceOrderStateResponse;
|
|
155
|
+
marginRequired: string;
|
|
156
|
+
liquidationApr: number;
|
|
157
|
+
profit25PercentApr: number;
|
|
158
|
+
priceImpact: number;
|
|
159
|
+
fee: string;
|
|
160
|
+
}
|
|
161
|
+
export interface CloseActivePositionSimulationResponse {
|
|
162
|
+
preUserInfo: PlaceOrderStateResponse;
|
|
163
|
+
postUserInfo: PlaceOrderStateResponse;
|
|
164
|
+
matched: ContractSwapPositionResponse;
|
|
165
|
+
marginRequired: string;
|
|
166
|
+
liquidationApr: number;
|
|
167
|
+
profit25PercentApr: number;
|
|
168
|
+
priceImpact: number;
|
|
169
|
+
fee: string;
|
|
170
|
+
limitOrderValue: string;
|
|
171
|
+
actualLeverage: number;
|
|
172
|
+
}
|
|
173
|
+
export interface AssetMetadataResponse {
|
|
174
|
+
proSymbol: string;
|
|
175
|
+
icon: string;
|
|
176
|
+
accentColor: string;
|
|
177
|
+
isWhiteListed: boolean;
|
|
178
|
+
}
|
|
179
|
+
export interface AssetResponse {
|
|
180
|
+
address: string;
|
|
181
|
+
tokenId: number;
|
|
182
|
+
name: string;
|
|
183
|
+
symbol: string;
|
|
184
|
+
decimals: number;
|
|
185
|
+
usdPrice: string;
|
|
186
|
+
metadata: AssetMetadataResponse;
|
|
187
|
+
isWhiteListed: boolean;
|
|
188
|
+
}
|
|
189
|
+
export interface AssetsResponse {
|
|
190
|
+
assets: AssetResponse[];
|
|
191
|
+
}
|
|
192
|
+
export interface GetCalldataResponse {
|
|
193
|
+
data: string;
|
|
194
|
+
from: string;
|
|
195
|
+
to: string;
|
|
196
|
+
gas: string;
|
|
197
|
+
}
|
|
198
|
+
export interface AgentExecuteParamsResponse {
|
|
199
|
+
tag: string;
|
|
200
|
+
data: string;
|
|
201
|
+
}
|
|
202
|
+
export interface PlaceOrderQueryDto {
|
|
203
|
+
marketAcc: string;
|
|
204
|
+
marketAddress: string;
|
|
205
|
+
ammAddresses?: string;
|
|
206
|
+
side: 0 | 1;
|
|
207
|
+
size: string;
|
|
208
|
+
limitTick: number;
|
|
209
|
+
tif: 0 | 1 | 2 | 3;
|
|
210
|
+
useOrderBook: boolean;
|
|
211
|
+
}
|
|
212
|
+
export interface BulkPlaceOrderQueryDto {
|
|
213
|
+
orders: PlaceOrderQueryDto[];
|
|
214
|
+
}
|
|
215
|
+
export interface PendleSignTxDto {
|
|
216
|
+
account: string;
|
|
217
|
+
connectionId: string;
|
|
218
|
+
nonce: string;
|
|
219
|
+
}
|
|
220
|
+
export interface AgentExecuteDto {
|
|
221
|
+
agent: string;
|
|
222
|
+
message: PendleSignTxDto;
|
|
223
|
+
signature: string;
|
|
224
|
+
calldata: string;
|
|
225
|
+
}
|
|
226
|
+
export interface TxResponse {
|
|
227
|
+
status: string;
|
|
228
|
+
txHash: string;
|
|
229
|
+
index: number;
|
|
230
|
+
}
|
|
231
|
+
export interface BulkAgentExecuteDto {
|
|
232
|
+
datas: AgentExecuteDto[];
|
|
233
|
+
}
|
|
234
|
+
export interface ApproveAgentQueryDto {
|
|
235
|
+
calldata: string;
|
|
236
|
+
}
|
|
237
|
+
export interface SettingsByMarketResponse {
|
|
238
|
+
marketAddress: string;
|
|
239
|
+
crossLeverage?: number;
|
|
240
|
+
isolatedLeverage?: number;
|
|
241
|
+
}
|
|
242
|
+
export interface AccountSettingsResponse {
|
|
243
|
+
settingsByMarket: SettingsByMarketResponse[];
|
|
244
|
+
}
|
|
245
|
+
export interface UpdateAccountSettingBodyDto {
|
|
246
|
+
marketAcc: string;
|
|
247
|
+
marketAddress: string;
|
|
248
|
+
leverage: number;
|
|
249
|
+
signature: string;
|
|
250
|
+
agent: string;
|
|
251
|
+
timestamp: number;
|
|
252
|
+
}
|
|
253
|
+
export interface PositionValueResponse {
|
|
254
|
+
settledPosition: string;
|
|
255
|
+
remainingPosition: string;
|
|
256
|
+
}
|
|
257
|
+
export interface PositionPnlResponse {
|
|
258
|
+
rateSettlementPnl: string;
|
|
259
|
+
unrealisedPnl: string;
|
|
260
|
+
}
|
|
261
|
+
export interface ActivePnlPositionResponse {
|
|
262
|
+
id: string;
|
|
263
|
+
marketAddress: string;
|
|
264
|
+
side: 0 | 1;
|
|
265
|
+
notionalSize: string;
|
|
266
|
+
positionValue: PositionValueResponse;
|
|
267
|
+
underlyingApy: number;
|
|
268
|
+
fixedApr: number;
|
|
269
|
+
impliedApr: number;
|
|
270
|
+
liquidationApr: number;
|
|
271
|
+
pnl: PositionPnlResponse;
|
|
272
|
+
initialMargin: string;
|
|
273
|
+
marketAcc: string;
|
|
274
|
+
accountId: number;
|
|
275
|
+
profit25PercentApr: number;
|
|
276
|
+
}
|
|
277
|
+
export interface ClosedPnlPositionResponse {
|
|
278
|
+
id: string;
|
|
279
|
+
marketAddress: string;
|
|
280
|
+
side: 0 | 1;
|
|
281
|
+
timeClosed: number;
|
|
282
|
+
positionSize: string;
|
|
283
|
+
avgFixedApr: number;
|
|
284
|
+
avgUnderlyingApr: number;
|
|
285
|
+
pnl: string;
|
|
286
|
+
marketAcc: string;
|
|
287
|
+
accountId: number;
|
|
288
|
+
}
|
|
289
|
+
export interface ClosedPnlPositionsResponse {
|
|
290
|
+
results: ClosedPnlPositionResponse[];
|
|
291
|
+
total: number;
|
|
292
|
+
}
|
|
293
|
+
export interface PnlTransactionResponse {
|
|
294
|
+
id: string;
|
|
295
|
+
marketAddress: string;
|
|
296
|
+
time: number;
|
|
297
|
+
side: 0 | 1;
|
|
298
|
+
txType: 'normal' | 'liquidate' | 'force_deleverage';
|
|
299
|
+
notionalSize: string;
|
|
300
|
+
tradeValue: string;
|
|
301
|
+
fixedApr: number;
|
|
302
|
+
fee: string;
|
|
303
|
+
pnl: string;
|
|
304
|
+
marketAcc: string;
|
|
305
|
+
accountId: number;
|
|
306
|
+
}
|
|
307
|
+
export interface PnlTransactionsResponse {
|
|
308
|
+
results: PnlTransactionResponse[];
|
|
309
|
+
total: number;
|
|
310
|
+
}
|
|
311
|
+
export interface HistoricalPnlChartResponse {
|
|
312
|
+
time: number;
|
|
313
|
+
underlyingApr: number;
|
|
314
|
+
avgFixedApr: number;
|
|
315
|
+
settledVolume: string;
|
|
316
|
+
realisedPnl: string;
|
|
317
|
+
}
|
|
318
|
+
export interface LimitOrderResponse {
|
|
319
|
+
side: 0 | 1;
|
|
320
|
+
placedSize: string;
|
|
321
|
+
unfilledSize: string;
|
|
322
|
+
impliedApr: number;
|
|
323
|
+
orderValue: string;
|
|
324
|
+
marginRequired: string;
|
|
325
|
+
orderId: string;
|
|
326
|
+
root: string;
|
|
327
|
+
marketAddress: string;
|
|
328
|
+
accountId: number;
|
|
329
|
+
isCross: boolean;
|
|
330
|
+
status: 0 | 1 | 2;
|
|
331
|
+
blockTimestamp: number;
|
|
332
|
+
marketAcc: string;
|
|
333
|
+
}
|
|
334
|
+
export interface LimitOrdersResponseV2 {
|
|
335
|
+
results: LimitOrderResponse[];
|
|
336
|
+
total: number;
|
|
337
|
+
}
|
|
338
|
+
export interface SettlementResponse {
|
|
339
|
+
id: string;
|
|
340
|
+
timestamp: number;
|
|
341
|
+
marketAcc: string;
|
|
342
|
+
marketAddress: string;
|
|
343
|
+
side: 0 | 1;
|
|
344
|
+
positionSize: string;
|
|
345
|
+
positionValue: string;
|
|
346
|
+
yieldPaid: string;
|
|
347
|
+
yieldReceived: string;
|
|
348
|
+
settlement: string;
|
|
349
|
+
settlementRate: number;
|
|
350
|
+
}
|
|
351
|
+
export interface SettlementsResponse {
|
|
352
|
+
results: SettlementResponse[];
|
|
353
|
+
total: number;
|
|
354
|
+
}
|
|
355
|
+
export interface PnlResponse {
|
|
356
|
+
rateSettlementPnl: string;
|
|
357
|
+
unrealisedPnl: string;
|
|
358
|
+
}
|
|
359
|
+
export interface MarketPositionResponse {
|
|
360
|
+
marketAddress: string;
|
|
361
|
+
markApr: number;
|
|
362
|
+
lastTradedApr: number;
|
|
363
|
+
impliedApr: number;
|
|
364
|
+
liquidationApr: number;
|
|
365
|
+
fixedApr: number;
|
|
366
|
+
positionValue: PositionValueResponse;
|
|
367
|
+
pnl: PnlResponse;
|
|
368
|
+
maintMargin: string;
|
|
369
|
+
side: 0 | 1;
|
|
370
|
+
notionalSize: string;
|
|
371
|
+
initialMargin: string;
|
|
372
|
+
profit25PercentApr: number;
|
|
373
|
+
}
|
|
374
|
+
export interface MarketAccCollateralResponse {
|
|
375
|
+
marketAcc: string;
|
|
376
|
+
marketPositions: MarketPositionResponse[];
|
|
377
|
+
isCross: boolean;
|
|
378
|
+
netBalance: string;
|
|
379
|
+
availableBalance: string;
|
|
380
|
+
initialMargin: string;
|
|
381
|
+
maintMargin: string;
|
|
382
|
+
marginRatio: number;
|
|
383
|
+
}
|
|
384
|
+
export interface CollateralSummaryResponse {
|
|
385
|
+
collateralAddress: string;
|
|
386
|
+
isolatedPositions: MarketAccCollateralResponse[];
|
|
387
|
+
crossPosition: MarketAccCollateralResponse;
|
|
388
|
+
totalNetBalance: string;
|
|
389
|
+
startDayNetBalance: string;
|
|
390
|
+
oneMonthAgoNetBalance: string;
|
|
391
|
+
oneMonthAgoAggregatedVaultTransfer: string;
|
|
392
|
+
}
|
|
393
|
+
export interface AllCollateralSummaryResponse {
|
|
394
|
+
collaterals: CollateralSummaryResponse[];
|
|
395
|
+
}
|
|
396
|
+
export interface BalanceResponse {
|
|
397
|
+
b: string;
|
|
398
|
+
u: number;
|
|
399
|
+
t: number;
|
|
400
|
+
}
|
|
401
|
+
export interface BalanceChartResponse {
|
|
402
|
+
historicalBalances: BalanceResponse[];
|
|
403
|
+
currentBalance: BalanceResponse;
|
|
404
|
+
}
|
|
405
|
+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';
|
|
406
|
+
export type QueryParamsType = Record<string | number, any>;
|
|
407
|
+
export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
|
|
408
|
+
secure?: boolean;
|
|
409
|
+
path: string;
|
|
410
|
+
type?: ContentType;
|
|
411
|
+
query?: QueryParamsType;
|
|
412
|
+
format?: ResponseType;
|
|
413
|
+
body?: unknown;
|
|
414
|
+
}
|
|
415
|
+
export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
|
|
416
|
+
export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
|
|
417
|
+
securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
|
|
418
|
+
secure?: boolean;
|
|
419
|
+
format?: ResponseType;
|
|
420
|
+
}
|
|
421
|
+
export declare enum ContentType {
|
|
422
|
+
Json = "application/json",
|
|
423
|
+
FormData = "multipart/form-data",
|
|
424
|
+
UrlEncoded = "application/x-www-form-urlencoded",
|
|
425
|
+
Text = "text/plain"
|
|
426
|
+
}
|
|
427
|
+
export declare class HttpClient<SecurityDataType = unknown> {
|
|
428
|
+
instance: AxiosInstance;
|
|
429
|
+
private securityData;
|
|
430
|
+
private securityWorker?;
|
|
431
|
+
private secure?;
|
|
432
|
+
private format?;
|
|
433
|
+
constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
|
|
434
|
+
setSecurityData: (data: SecurityDataType | null) => void;
|
|
435
|
+
protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
|
|
436
|
+
protected stringifyFormItem(formItem: unknown): string;
|
|
437
|
+
protected createFormData(input: Record<string, unknown>): FormData;
|
|
438
|
+
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<AxiosResponse<T>>;
|
|
439
|
+
}
|
|
440
|
+
export declare class Sdk<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
441
|
+
markets: {
|
|
442
|
+
marketsControllerGetMarketInfo: (address: string, params?: RequestParams) => Promise<AxiosResponse<MarketResponse, any>>;
|
|
443
|
+
marketsControllerGetMarkets: (query?: {
|
|
444
|
+
skip?: number;
|
|
445
|
+
limit?: number;
|
|
446
|
+
isWhitelisted?: boolean;
|
|
447
|
+
}, params?: RequestParams) => Promise<AxiosResponse<MarketsResponse, any>>;
|
|
448
|
+
marketsControllerGetMarketTrades: (query: {
|
|
449
|
+
skip?: number;
|
|
450
|
+
limit?: number;
|
|
451
|
+
marketAddress: string;
|
|
452
|
+
}, params?: RequestParams) => Promise<AxiosResponse<MarketTradesResponse, any>>;
|
|
453
|
+
marketsControllerGetChartData: (query: {
|
|
454
|
+
marketAddress: string;
|
|
455
|
+
timeFrame: "5m" | "1h" | "1d" | "1w";
|
|
456
|
+
startTimestamp?: number;
|
|
457
|
+
endTimestamp?: number;
|
|
458
|
+
}, params?: RequestParams) => Promise<AxiosResponse<ChartResponse, any>>;
|
|
459
|
+
};
|
|
460
|
+
orderBooks: {
|
|
461
|
+
orderBooksControllerGetOrderBooks: (query: {
|
|
462
|
+
marketAddress: string;
|
|
463
|
+
nSigFigs?: number;
|
|
464
|
+
}, params?: RequestParams) => Promise<AxiosResponse<OrderBooksResponse, any>>;
|
|
465
|
+
orderBooksControllerGetOrderBooksV2: (query: {
|
|
466
|
+
marketAddress: string;
|
|
467
|
+
tickSize: 0.00001 | 0.0001 | 0.001 | 0.01 | 0.1;
|
|
468
|
+
}, params?: RequestParams) => Promise<AxiosResponse<OrderBooksResponse, any>>;
|
|
469
|
+
};
|
|
470
|
+
simulations: {
|
|
471
|
+
simulationsControllerGetDeposit: (query: {
|
|
472
|
+
userAddress: string;
|
|
473
|
+
collateralAddress: string;
|
|
474
|
+
amount: string;
|
|
475
|
+
}, params?: RequestParams) => Promise<AxiosResponse<DepositSimulationResponse, any>>;
|
|
476
|
+
simulationsControllerGetWithdraw: (query: {
|
|
477
|
+
userAddress: string;
|
|
478
|
+
collateralAddress: string;
|
|
479
|
+
amount: string;
|
|
480
|
+
}, params?: RequestParams) => Promise<AxiosResponse<WithdrawSimulationResponse, any>>;
|
|
481
|
+
simulationsControllerGetCashTransfer: (query: {
|
|
482
|
+
userAddress: string;
|
|
483
|
+
marketId: number;
|
|
484
|
+
isDeposit: boolean;
|
|
485
|
+
amount: string;
|
|
486
|
+
}, params?: RequestParams) => Promise<AxiosResponse<CashTransferSimulationResponse, any>>;
|
|
487
|
+
simulationsControllerGetPlaceOrder: (query: {
|
|
488
|
+
marketAcc: string;
|
|
489
|
+
marketAddress: string;
|
|
490
|
+
ammAddresses?: string;
|
|
491
|
+
side: 0 | 1;
|
|
492
|
+
size: string;
|
|
493
|
+
limitTick: number;
|
|
494
|
+
tif: 0 | 1 | 2 | 3;
|
|
495
|
+
useOrderBook: boolean;
|
|
496
|
+
}, params?: RequestParams) => Promise<AxiosResponse<PlaceOrderSimulationResponse, any>>;
|
|
497
|
+
simulationsControllerGetCancelOrder: (query: {
|
|
498
|
+
marketAcc: string;
|
|
499
|
+
marketAddress: string;
|
|
500
|
+
cancelAll: boolean;
|
|
501
|
+
orderIds?: string[];
|
|
502
|
+
}, params?: RequestParams) => Promise<AxiosResponse<CancelOrderSimulationResponse, any>>;
|
|
503
|
+
simulationsControllerGetModifyOrder: (query: {
|
|
504
|
+
marketAcc: string;
|
|
505
|
+
marketAddress: string;
|
|
506
|
+
orderId: string;
|
|
507
|
+
ammAddresses?: string;
|
|
508
|
+
side: 0 | 1;
|
|
509
|
+
size: string;
|
|
510
|
+
limitTick: number;
|
|
511
|
+
tif: 0 | 1 | 2 | 3;
|
|
512
|
+
useOrderBook: boolean;
|
|
513
|
+
}, params?: RequestParams) => Promise<AxiosResponse<ModifyOrderSimulationResponse, any>>;
|
|
514
|
+
simulationsControllerCloseActiveMarketPosition: (query: {
|
|
515
|
+
marketAcc: string;
|
|
516
|
+
marketAddress: string;
|
|
517
|
+
type: "limit" | "market";
|
|
518
|
+
size: string;
|
|
519
|
+
rate?: number;
|
|
520
|
+
}, params?: RequestParams) => Promise<AxiosResponse<CloseActivePositionSimulationResponse, any>>;
|
|
521
|
+
};
|
|
522
|
+
assets: {
|
|
523
|
+
assetsControllerGetAllAssets: (params?: RequestParams) => Promise<AxiosResponse<AssetsResponse, any>>;
|
|
524
|
+
};
|
|
525
|
+
calldata: {
|
|
526
|
+
calldataControllerGetDepositCalldata: (query: {
|
|
527
|
+
userAddress: string;
|
|
528
|
+
collateralAddress: string;
|
|
529
|
+
amount: string;
|
|
530
|
+
}, params?: RequestParams) => Promise<AxiosResponse<GetCalldataResponse, any>>;
|
|
531
|
+
calldataControllerGetWithdrawCalldata: (query: {
|
|
532
|
+
userAddress: string;
|
|
533
|
+
collateralAddress: string;
|
|
534
|
+
amount: string;
|
|
535
|
+
}, params?: RequestParams) => Promise<AxiosResponse<GetCalldataResponse, any>>;
|
|
536
|
+
calldataControllerGetPositionTransferCalldata: (query: {
|
|
537
|
+
marketId: number;
|
|
538
|
+
isDeposit: boolean;
|
|
539
|
+
amount: string;
|
|
540
|
+
}, params?: RequestParams) => Promise<AxiosResponse<AgentExecuteParamsResponse, any>>;
|
|
541
|
+
calldataControllerGetPlaceOrderCalldata: (query: {
|
|
542
|
+
marketAcc: string;
|
|
543
|
+
marketAddress: string;
|
|
544
|
+
ammAddresses?: string;
|
|
545
|
+
side: 0 | 1;
|
|
546
|
+
size: string;
|
|
547
|
+
limitTick: number;
|
|
548
|
+
tif: 0 | 1 | 2 | 3;
|
|
549
|
+
useOrderBook: boolean;
|
|
550
|
+
}, params?: RequestParams) => Promise<AxiosResponse<AgentExecuteParamsResponse, any>>;
|
|
551
|
+
calldataControllerGetBulkPlaceOrderCalldata: (data: BulkPlaceOrderQueryDto, params?: RequestParams) => Promise<AxiosResponse<AgentExecuteParamsResponse[], any>>;
|
|
552
|
+
calldataControllerGetCancelOrderCalldata: (query: {
|
|
553
|
+
marketAcc: string;
|
|
554
|
+
marketAddress: string;
|
|
555
|
+
cancelAll: boolean;
|
|
556
|
+
orderIds?: string;
|
|
557
|
+
}, params?: RequestParams) => Promise<AxiosResponse<AgentExecuteParamsResponse, any>>;
|
|
558
|
+
calldataControllerGetCloseActiveMarketPosition: (query: {
|
|
559
|
+
marketAcc: string;
|
|
560
|
+
marketAddress: string;
|
|
561
|
+
type: "limit" | "market";
|
|
562
|
+
size: string;
|
|
563
|
+
rate?: number;
|
|
564
|
+
}, params?: RequestParams) => Promise<AxiosResponse<AgentExecuteParamsResponse, any>>;
|
|
565
|
+
calldataControllerGetModifyOrderCalldata: (query: {
|
|
566
|
+
marketAcc: string;
|
|
567
|
+
marketAddress: string;
|
|
568
|
+
orderId: string;
|
|
569
|
+
size: string;
|
|
570
|
+
tick: number;
|
|
571
|
+
tif: 0 | 1 | 2 | 3;
|
|
572
|
+
}, params?: RequestParams) => Promise<AxiosResponse<AgentExecuteParamsResponse, any>>;
|
|
573
|
+
calldataControllerEnterAllMarkets: (query: {
|
|
574
|
+
userAddress: string;
|
|
575
|
+
isCross?: boolean;
|
|
576
|
+
}, params?: RequestParams) => Promise<AxiosResponse<AgentExecuteParamsResponse, any>>;
|
|
577
|
+
calldataControllerDirectCall: (data: AgentExecuteDto, params?: RequestParams) => Promise<AxiosResponse<TxResponse, any>>;
|
|
578
|
+
calldataControllerBulkAgentDirectCall: (data: BulkAgentExecuteDto, params?: RequestParams) => Promise<AxiosResponse<TxResponse[], any>>;
|
|
579
|
+
calldataControllerRouterDirectCall: (data: ApproveAgentQueryDto, params?: RequestParams) => Promise<AxiosResponse<TxResponse, any>>;
|
|
580
|
+
calldataControllerApproveAgent: (data: ApproveAgentQueryDto, params?: RequestParams) => Promise<AxiosResponse<TxResponse, any>>;
|
|
581
|
+
};
|
|
582
|
+
accounts: {
|
|
583
|
+
accountsControllerGetUserSettings: (query: {
|
|
584
|
+
userAddress: string;
|
|
585
|
+
accountId: number;
|
|
586
|
+
}, params?: RequestParams) => Promise<AxiosResponse<AccountSettingsResponse, any>>;
|
|
587
|
+
accountsControllerUpdateAccountSettings: (data: UpdateAccountSettingBodyDto, params?: RequestParams) => Promise<AxiosResponse<void, any>>;
|
|
588
|
+
};
|
|
589
|
+
pnL: {
|
|
590
|
+
pnlControllerGetActivePnlPositions: (query: {
|
|
591
|
+
userAddress: string;
|
|
592
|
+
accountId: number;
|
|
593
|
+
marketAddress?: string;
|
|
594
|
+
}, params?: RequestParams) => Promise<AxiosResponse<ActivePnlPositionResponse[], any>>;
|
|
595
|
+
pnlControllerGetClosedPnlPositions: (query: {
|
|
596
|
+
userAddress: string;
|
|
597
|
+
accountId: number;
|
|
598
|
+
marketAddress?: string;
|
|
599
|
+
limit?: number;
|
|
600
|
+
skip?: number;
|
|
601
|
+
orderBy?: string;
|
|
602
|
+
}, params?: RequestParams) => Promise<AxiosResponse<ClosedPnlPositionsResponse, any>>;
|
|
603
|
+
pnlControllerGetPnlTransactions: (query: {
|
|
604
|
+
userAddress: string;
|
|
605
|
+
accountId: number;
|
|
606
|
+
marketAddress?: string;
|
|
607
|
+
limit?: number;
|
|
608
|
+
skip?: number;
|
|
609
|
+
}, params?: RequestParams) => Promise<AxiosResponse<PnlTransactionsResponse, any>>;
|
|
610
|
+
pnlControllerGetHistoricalPnlChart: (query: {
|
|
611
|
+
userAddress: string;
|
|
612
|
+
marketAddress: string;
|
|
613
|
+
accountId: number;
|
|
614
|
+
timeFrame?: "5m" | "1h" | "1d" | "1w";
|
|
615
|
+
startTimestamp?: number;
|
|
616
|
+
endTimestamp?: number;
|
|
617
|
+
}, params?: RequestParams) => Promise<AxiosResponse<HistoricalPnlChartResponse[], any>>;
|
|
618
|
+
pnlControllerGetLimitOrders: (query: {
|
|
619
|
+
userAddress: string;
|
|
620
|
+
accountId: number;
|
|
621
|
+
marketAddress?: string;
|
|
622
|
+
skip?: number;
|
|
623
|
+
limit?: number;
|
|
624
|
+
isActive?: boolean;
|
|
625
|
+
orderBy?: string;
|
|
626
|
+
}, params?: RequestParams) => Promise<AxiosResponse<LimitOrdersResponseV2, any>>;
|
|
627
|
+
};
|
|
628
|
+
settlement: {
|
|
629
|
+
settlementControllerGetSettlements: (query: {
|
|
630
|
+
limit?: number;
|
|
631
|
+
skip?: number;
|
|
632
|
+
userAddress: string;
|
|
633
|
+
accountId: number;
|
|
634
|
+
marketAddress?: string;
|
|
635
|
+
}, params?: RequestParams) => Promise<AxiosResponse<SettlementsResponse, any>>;
|
|
636
|
+
};
|
|
637
|
+
collaterals: {
|
|
638
|
+
collateralControllerGetAllCollateralSummary: (query: {
|
|
639
|
+
userAddress: string;
|
|
640
|
+
accountId: number;
|
|
641
|
+
}, params?: RequestParams) => Promise<AxiosResponse<AllCollateralSummaryResponse, any>>;
|
|
642
|
+
collateralControllerGetSingleCollateral: (query: {
|
|
643
|
+
userAddress: string;
|
|
644
|
+
accountId: number;
|
|
645
|
+
collateralAddress: string;
|
|
646
|
+
}, params?: RequestParams) => Promise<AxiosResponse<CollateralSummaryResponse, any>>;
|
|
647
|
+
};
|
|
648
|
+
portfolio: {
|
|
649
|
+
portfolioControllerGetBalanceChart: (query: {
|
|
650
|
+
userAddress: string;
|
|
651
|
+
accountId: number;
|
|
652
|
+
collateralAddress?: string;
|
|
653
|
+
time: "7d" | "30d" | "60d" | "90d" | "all";
|
|
654
|
+
}, params?: RequestParams) => Promise<AxiosResponse<BalanceChartResponse, any>>;
|
|
655
|
+
};
|
|
656
|
+
}
|