@pendle/sdk-boros 0.3.45 → 0.3.46
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/common/types.d.ts +155 -0
- package/dist/common/types.js +16 -0
- package/dist/common/types.js.map +1 -0
- package/dist/contracts/abis/distributorAbi.js.map +1 -0
- package/dist/contracts/abis/multiTokenMerkleDistributorAbi.js.map +1 -0
- package/dist/contracts/abis/viemAbis.js.map +1 -0
- package/dist/contracts/base-contract-helper.d.ts +15 -0
- package/dist/contracts/base-contract-helper.js +36 -0
- package/dist/contracts/base-contract-helper.js.map +1 -0
- package/dist/contracts/contracts.factory.d.ts +21 -0
- package/dist/contracts/contracts.factory.js +65 -0
- package/dist/contracts/contracts.factory.js.map +1 -0
- package/dist/contracts/explorer.d.ts +582 -0
- package/dist/contracts/explorer.js +53 -0
- package/dist/contracts/explorer.js.map +1 -0
- package/dist/contracts/index.d.ts +3 -3
- package/dist/contracts/index.js +3 -3
- package/dist/contracts/index.js.map +1 -1
- package/dist/entities/accManager/accManager.js +1 -1
- package/dist/entities/accManager/accManager.js.map +1 -1
- package/dist/entities/agent/agent.js +1 -1
- package/dist/entities/agent/agent.js.map +1 -1
- package/dist/entities/exchange/exchange.d.ts +21 -2
- package/dist/entities/exchange/exchange.js +40 -2
- package/dist/entities/exchange/exchange.js.map +1 -1
- package/dist/entities/exchange/types.d.ts +5 -3
- package/dist/entities/exchange/utils.js +2 -2
- package/dist/entities/exchange/utils.js.map +1 -1
- package/dist/entities/marketHub.d.ts +1 -1
- package/dist/entities/marketHub.js +1 -1
- package/dist/entities/marketHub.js.map +1 -1
- package/dist/entities/multiTokenMerkleDistributor/multiTokenMerkleDistributorContract.js +1 -1
- package/dist/entities/multiTokenMerkleDistributor/multiTokenMerkleDistributorContract.js.map +1 -1
- package/dist/multicall/constants.d.ts +27 -0
- package/dist/multicall/constants.js +31 -0
- package/dist/multicall/constants.js.map +1 -0
- package/dist/multicall/helpers.d.ts +9 -0
- package/dist/multicall/helpers.js +40 -0
- package/dist/multicall/helpers.js.map +1 -0
- package/dist/multicall/multicall.d.ts +71 -0
- package/dist/multicall/multicall.js +250 -0
- package/dist/multicall/multicall.js.map +1 -0
- package/dist/types/encoders.js +1 -1
- package/dist/types/encoders.js.map +1 -1
- package/dist/utils/signing/agent.js +1 -1
- package/dist/utils/signing/agent.js.map +1 -1
- package/package.json +1 -1
- package/dist/contracts/distributorAbi.js.map +0 -1
- package/dist/contracts/multiTokenMerkleDistributorAbi.js.map +0 -1
- package/dist/contracts/viemAbis.js.map +0 -1
- /package/dist/contracts/{distributorAbi.d.ts → abis/distributorAbi.d.ts} +0 -0
- /package/dist/contracts/{distributorAbi.js → abis/distributorAbi.js} +0 -0
- /package/dist/contracts/{multiTokenMerkleDistributorAbi.d.ts → abis/multiTokenMerkleDistributorAbi.d.ts} +0 -0
- /package/dist/contracts/{multiTokenMerkleDistributorAbi.js → abis/multiTokenMerkleDistributorAbi.js} +0 -0
- /package/dist/contracts/{viemAbis.d.ts → abis/viemAbis.d.ts} +0 -0
- /package/dist/contracts/{viemAbis.js → abis/viemAbis.js} +0 -0
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
import { FixedX18 } from '@pendle/boros-offchain-math';
|
|
2
|
+
import { MarketAcc, Side, TimeInForce } from '../types';
|
|
3
|
+
import { iExplorerAbi } from './abis/viemAbis';
|
|
4
|
+
import { BaseContractHelper } from './base-contract-helper';
|
|
5
|
+
import { MulticallOptions } from '../multicall/multicall';
|
|
6
|
+
import { ContractUserInfo } from '../common/types';
|
|
7
|
+
export declare class Explorer extends BaseContractHelper<typeof iExplorerAbi> {
|
|
8
|
+
abi(): readonly [{
|
|
9
|
+
readonly inputs: readonly [];
|
|
10
|
+
readonly name: "MARKET_HUB";
|
|
11
|
+
readonly outputs: readonly [{
|
|
12
|
+
readonly internalType: "address";
|
|
13
|
+
readonly name: "";
|
|
14
|
+
readonly type: "address";
|
|
15
|
+
}];
|
|
16
|
+
readonly stateMutability: "view";
|
|
17
|
+
readonly type: "function";
|
|
18
|
+
}, {
|
|
19
|
+
readonly inputs: readonly [];
|
|
20
|
+
readonly name: "ROUTER";
|
|
21
|
+
readonly outputs: readonly [{
|
|
22
|
+
readonly internalType: "address";
|
|
23
|
+
readonly name: "";
|
|
24
|
+
readonly type: "address";
|
|
25
|
+
}];
|
|
26
|
+
readonly stateMutability: "view";
|
|
27
|
+
readonly type: "function";
|
|
28
|
+
}, {
|
|
29
|
+
readonly inputs: readonly [{
|
|
30
|
+
readonly internalType: "MarketId";
|
|
31
|
+
readonly name: "marketId";
|
|
32
|
+
readonly type: "uint24";
|
|
33
|
+
}];
|
|
34
|
+
readonly name: "getMarketInfo";
|
|
35
|
+
readonly outputs: readonly [{
|
|
36
|
+
readonly components: readonly [{
|
|
37
|
+
readonly internalType: "string";
|
|
38
|
+
readonly name: "name";
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
}, {
|
|
41
|
+
readonly internalType: "string";
|
|
42
|
+
readonly name: "symbol";
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
}, {
|
|
45
|
+
readonly internalType: "bool";
|
|
46
|
+
readonly name: "isIsolatedOnly";
|
|
47
|
+
readonly type: "bool";
|
|
48
|
+
}, {
|
|
49
|
+
readonly internalType: "TokenId";
|
|
50
|
+
readonly name: "tokenId";
|
|
51
|
+
readonly type: "uint16";
|
|
52
|
+
}, {
|
|
53
|
+
readonly internalType: "MarketId";
|
|
54
|
+
readonly name: "marketId";
|
|
55
|
+
readonly type: "uint24";
|
|
56
|
+
}, {
|
|
57
|
+
readonly internalType: "uint32";
|
|
58
|
+
readonly name: "maturity";
|
|
59
|
+
readonly type: "uint32";
|
|
60
|
+
}, {
|
|
61
|
+
readonly internalType: "uint8";
|
|
62
|
+
readonly name: "tickStep";
|
|
63
|
+
readonly type: "uint8";
|
|
64
|
+
}, {
|
|
65
|
+
readonly internalType: "uint16";
|
|
66
|
+
readonly name: "iTickThresh";
|
|
67
|
+
readonly type: "uint16";
|
|
68
|
+
}, {
|
|
69
|
+
readonly internalType: "bool";
|
|
70
|
+
readonly name: "isMatured";
|
|
71
|
+
readonly type: "bool";
|
|
72
|
+
}, {
|
|
73
|
+
readonly internalType: "int256";
|
|
74
|
+
readonly name: "impliedApr";
|
|
75
|
+
readonly type: "int256";
|
|
76
|
+
}, {
|
|
77
|
+
readonly internalType: "int256";
|
|
78
|
+
readonly name: "markApr";
|
|
79
|
+
readonly type: "int256";
|
|
80
|
+
}, {
|
|
81
|
+
readonly internalType: "int256";
|
|
82
|
+
readonly name: "underlyingApr";
|
|
83
|
+
readonly type: "int256";
|
|
84
|
+
}, {
|
|
85
|
+
readonly internalType: "uint32";
|
|
86
|
+
readonly name: "nextSettleTime";
|
|
87
|
+
readonly type: "uint32";
|
|
88
|
+
}];
|
|
89
|
+
readonly internalType: "struct IExplorer.MarketInfo";
|
|
90
|
+
readonly name: "info";
|
|
91
|
+
readonly type: "tuple";
|
|
92
|
+
}];
|
|
93
|
+
readonly stateMutability: "view";
|
|
94
|
+
readonly type: "function";
|
|
95
|
+
}, {
|
|
96
|
+
readonly inputs: readonly [{
|
|
97
|
+
readonly internalType: "MarketId";
|
|
98
|
+
readonly name: "marketId";
|
|
99
|
+
readonly type: "uint24";
|
|
100
|
+
}, {
|
|
101
|
+
readonly internalType: "enum Side";
|
|
102
|
+
readonly name: "side";
|
|
103
|
+
readonly type: "uint8";
|
|
104
|
+
}, {
|
|
105
|
+
readonly internalType: "int16";
|
|
106
|
+
readonly name: "from";
|
|
107
|
+
readonly type: "int16";
|
|
108
|
+
}, {
|
|
109
|
+
readonly internalType: "int16";
|
|
110
|
+
readonly name: "to";
|
|
111
|
+
readonly type: "int16";
|
|
112
|
+
}];
|
|
113
|
+
readonly name: "getMarketOrderBook";
|
|
114
|
+
readonly outputs: readonly [{
|
|
115
|
+
readonly internalType: "uint256[]";
|
|
116
|
+
readonly name: "size";
|
|
117
|
+
readonly type: "uint256[]";
|
|
118
|
+
}];
|
|
119
|
+
readonly stateMutability: "view";
|
|
120
|
+
readonly type: "function";
|
|
121
|
+
}, {
|
|
122
|
+
readonly inputs: readonly [{
|
|
123
|
+
readonly internalType: "MarketAcc";
|
|
124
|
+
readonly name: "user";
|
|
125
|
+
readonly type: "bytes26";
|
|
126
|
+
}];
|
|
127
|
+
readonly name: "getUserInfo";
|
|
128
|
+
readonly outputs: readonly [{
|
|
129
|
+
readonly components: readonly [{
|
|
130
|
+
readonly internalType: "int256";
|
|
131
|
+
readonly name: "totalCash";
|
|
132
|
+
readonly type: "int256";
|
|
133
|
+
}, {
|
|
134
|
+
readonly components: readonly [{
|
|
135
|
+
readonly internalType: "MarketId";
|
|
136
|
+
readonly name: "marketId";
|
|
137
|
+
readonly type: "uint24";
|
|
138
|
+
}, {
|
|
139
|
+
readonly internalType: "int256";
|
|
140
|
+
readonly name: "signedSize";
|
|
141
|
+
readonly type: "int256";
|
|
142
|
+
}, {
|
|
143
|
+
readonly internalType: "int256";
|
|
144
|
+
readonly name: "positionValue";
|
|
145
|
+
readonly type: "int256";
|
|
146
|
+
}, {
|
|
147
|
+
readonly internalType: "int256";
|
|
148
|
+
readonly name: "liquidationApr";
|
|
149
|
+
readonly type: "int256";
|
|
150
|
+
}, {
|
|
151
|
+
readonly internalType: "uint256";
|
|
152
|
+
readonly name: "initialMargin";
|
|
153
|
+
readonly type: "uint256";
|
|
154
|
+
}, {
|
|
155
|
+
readonly internalType: "uint256";
|
|
156
|
+
readonly name: "maintMargin";
|
|
157
|
+
readonly type: "uint256";
|
|
158
|
+
}, {
|
|
159
|
+
readonly components: readonly [{
|
|
160
|
+
readonly internalType: "enum OrderStatus";
|
|
161
|
+
readonly name: "status";
|
|
162
|
+
readonly type: "uint8";
|
|
163
|
+
}, {
|
|
164
|
+
readonly internalType: "OrderId";
|
|
165
|
+
readonly name: "id";
|
|
166
|
+
readonly type: "uint64";
|
|
167
|
+
}, {
|
|
168
|
+
readonly internalType: "MarketAcc";
|
|
169
|
+
readonly name: "maker";
|
|
170
|
+
readonly type: "bytes26";
|
|
171
|
+
}, {
|
|
172
|
+
readonly internalType: "uint256";
|
|
173
|
+
readonly name: "size";
|
|
174
|
+
readonly type: "uint256";
|
|
175
|
+
}, {
|
|
176
|
+
readonly internalType: "int256";
|
|
177
|
+
readonly name: "rate";
|
|
178
|
+
readonly type: "int256";
|
|
179
|
+
}];
|
|
180
|
+
readonly internalType: "struct IMarketOffViewOnly.Order[]";
|
|
181
|
+
readonly name: "orders";
|
|
182
|
+
readonly type: "tuple[]";
|
|
183
|
+
}];
|
|
184
|
+
readonly internalType: "struct IExplorer.PositionInfo[]";
|
|
185
|
+
readonly name: "positions";
|
|
186
|
+
readonly type: "tuple[]";
|
|
187
|
+
}, {
|
|
188
|
+
readonly internalType: "int256";
|
|
189
|
+
readonly name: "availableInitialMargin";
|
|
190
|
+
readonly type: "int256";
|
|
191
|
+
}, {
|
|
192
|
+
readonly internalType: "int256";
|
|
193
|
+
readonly name: "availableMaintMargin";
|
|
194
|
+
readonly type: "int256";
|
|
195
|
+
}];
|
|
196
|
+
readonly internalType: "struct IExplorer.UserInfo";
|
|
197
|
+
readonly name: "userInfo";
|
|
198
|
+
readonly type: "tuple";
|
|
199
|
+
}];
|
|
200
|
+
readonly stateMutability: "nonpayable";
|
|
201
|
+
readonly type: "function";
|
|
202
|
+
}, {
|
|
203
|
+
readonly inputs: readonly [{
|
|
204
|
+
readonly internalType: "MarketAcc";
|
|
205
|
+
readonly name: "user";
|
|
206
|
+
readonly type: "bytes26";
|
|
207
|
+
}, {
|
|
208
|
+
readonly internalType: "MarketId";
|
|
209
|
+
readonly name: "marketId";
|
|
210
|
+
readonly type: "uint24";
|
|
211
|
+
}, {
|
|
212
|
+
readonly internalType: "bool";
|
|
213
|
+
readonly name: "cancelAll";
|
|
214
|
+
readonly type: "bool";
|
|
215
|
+
}, {
|
|
216
|
+
readonly internalType: "OrderId[]";
|
|
217
|
+
readonly name: "orderIds";
|
|
218
|
+
readonly type: "uint64[]";
|
|
219
|
+
}];
|
|
220
|
+
readonly name: "getUserInfoAfterBulkCancels";
|
|
221
|
+
readonly outputs: readonly [{
|
|
222
|
+
readonly components: readonly [{
|
|
223
|
+
readonly internalType: "int256";
|
|
224
|
+
readonly name: "totalCash";
|
|
225
|
+
readonly type: "int256";
|
|
226
|
+
}, {
|
|
227
|
+
readonly components: readonly [{
|
|
228
|
+
readonly internalType: "MarketId";
|
|
229
|
+
readonly name: "marketId";
|
|
230
|
+
readonly type: "uint24";
|
|
231
|
+
}, {
|
|
232
|
+
readonly internalType: "int256";
|
|
233
|
+
readonly name: "signedSize";
|
|
234
|
+
readonly type: "int256";
|
|
235
|
+
}, {
|
|
236
|
+
readonly internalType: "int256";
|
|
237
|
+
readonly name: "positionValue";
|
|
238
|
+
readonly type: "int256";
|
|
239
|
+
}, {
|
|
240
|
+
readonly internalType: "int256";
|
|
241
|
+
readonly name: "liquidationApr";
|
|
242
|
+
readonly type: "int256";
|
|
243
|
+
}, {
|
|
244
|
+
readonly internalType: "uint256";
|
|
245
|
+
readonly name: "initialMargin";
|
|
246
|
+
readonly type: "uint256";
|
|
247
|
+
}, {
|
|
248
|
+
readonly internalType: "uint256";
|
|
249
|
+
readonly name: "maintMargin";
|
|
250
|
+
readonly type: "uint256";
|
|
251
|
+
}, {
|
|
252
|
+
readonly components: readonly [{
|
|
253
|
+
readonly internalType: "enum OrderStatus";
|
|
254
|
+
readonly name: "status";
|
|
255
|
+
readonly type: "uint8";
|
|
256
|
+
}, {
|
|
257
|
+
readonly internalType: "OrderId";
|
|
258
|
+
readonly name: "id";
|
|
259
|
+
readonly type: "uint64";
|
|
260
|
+
}, {
|
|
261
|
+
readonly internalType: "MarketAcc";
|
|
262
|
+
readonly name: "maker";
|
|
263
|
+
readonly type: "bytes26";
|
|
264
|
+
}, {
|
|
265
|
+
readonly internalType: "uint256";
|
|
266
|
+
readonly name: "size";
|
|
267
|
+
readonly type: "uint256";
|
|
268
|
+
}, {
|
|
269
|
+
readonly internalType: "int256";
|
|
270
|
+
readonly name: "rate";
|
|
271
|
+
readonly type: "int256";
|
|
272
|
+
}];
|
|
273
|
+
readonly internalType: "struct IMarketOffViewOnly.Order[]";
|
|
274
|
+
readonly name: "orders";
|
|
275
|
+
readonly type: "tuple[]";
|
|
276
|
+
}];
|
|
277
|
+
readonly internalType: "struct IExplorer.PositionInfo[]";
|
|
278
|
+
readonly name: "positions";
|
|
279
|
+
readonly type: "tuple[]";
|
|
280
|
+
}, {
|
|
281
|
+
readonly internalType: "int256";
|
|
282
|
+
readonly name: "availableInitialMargin";
|
|
283
|
+
readonly type: "int256";
|
|
284
|
+
}, {
|
|
285
|
+
readonly internalType: "int256";
|
|
286
|
+
readonly name: "availableMaintMargin";
|
|
287
|
+
readonly type: "int256";
|
|
288
|
+
}];
|
|
289
|
+
readonly internalType: "struct IExplorer.UserInfo";
|
|
290
|
+
readonly name: "preUserInfo";
|
|
291
|
+
readonly type: "tuple";
|
|
292
|
+
}, {
|
|
293
|
+
readonly components: readonly [{
|
|
294
|
+
readonly internalType: "int256";
|
|
295
|
+
readonly name: "totalCash";
|
|
296
|
+
readonly type: "int256";
|
|
297
|
+
}, {
|
|
298
|
+
readonly components: readonly [{
|
|
299
|
+
readonly internalType: "MarketId";
|
|
300
|
+
readonly name: "marketId";
|
|
301
|
+
readonly type: "uint24";
|
|
302
|
+
}, {
|
|
303
|
+
readonly internalType: "int256";
|
|
304
|
+
readonly name: "signedSize";
|
|
305
|
+
readonly type: "int256";
|
|
306
|
+
}, {
|
|
307
|
+
readonly internalType: "int256";
|
|
308
|
+
readonly name: "positionValue";
|
|
309
|
+
readonly type: "int256";
|
|
310
|
+
}, {
|
|
311
|
+
readonly internalType: "int256";
|
|
312
|
+
readonly name: "liquidationApr";
|
|
313
|
+
readonly type: "int256";
|
|
314
|
+
}, {
|
|
315
|
+
readonly internalType: "uint256";
|
|
316
|
+
readonly name: "initialMargin";
|
|
317
|
+
readonly type: "uint256";
|
|
318
|
+
}, {
|
|
319
|
+
readonly internalType: "uint256";
|
|
320
|
+
readonly name: "maintMargin";
|
|
321
|
+
readonly type: "uint256";
|
|
322
|
+
}, {
|
|
323
|
+
readonly components: readonly [{
|
|
324
|
+
readonly internalType: "enum OrderStatus";
|
|
325
|
+
readonly name: "status";
|
|
326
|
+
readonly type: "uint8";
|
|
327
|
+
}, {
|
|
328
|
+
readonly internalType: "OrderId";
|
|
329
|
+
readonly name: "id";
|
|
330
|
+
readonly type: "uint64";
|
|
331
|
+
}, {
|
|
332
|
+
readonly internalType: "MarketAcc";
|
|
333
|
+
readonly name: "maker";
|
|
334
|
+
readonly type: "bytes26";
|
|
335
|
+
}, {
|
|
336
|
+
readonly internalType: "uint256";
|
|
337
|
+
readonly name: "size";
|
|
338
|
+
readonly type: "uint256";
|
|
339
|
+
}, {
|
|
340
|
+
readonly internalType: "int256";
|
|
341
|
+
readonly name: "rate";
|
|
342
|
+
readonly type: "int256";
|
|
343
|
+
}];
|
|
344
|
+
readonly internalType: "struct IMarketOffViewOnly.Order[]";
|
|
345
|
+
readonly name: "orders";
|
|
346
|
+
readonly type: "tuple[]";
|
|
347
|
+
}];
|
|
348
|
+
readonly internalType: "struct IExplorer.PositionInfo[]";
|
|
349
|
+
readonly name: "positions";
|
|
350
|
+
readonly type: "tuple[]";
|
|
351
|
+
}, {
|
|
352
|
+
readonly internalType: "int256";
|
|
353
|
+
readonly name: "availableInitialMargin";
|
|
354
|
+
readonly type: "int256";
|
|
355
|
+
}, {
|
|
356
|
+
readonly internalType: "int256";
|
|
357
|
+
readonly name: "availableMaintMargin";
|
|
358
|
+
readonly type: "int256";
|
|
359
|
+
}];
|
|
360
|
+
readonly internalType: "struct IExplorer.UserInfo";
|
|
361
|
+
readonly name: "postUserInfo";
|
|
362
|
+
readonly type: "tuple";
|
|
363
|
+
}];
|
|
364
|
+
readonly stateMutability: "nonpayable";
|
|
365
|
+
readonly type: "function";
|
|
366
|
+
}, {
|
|
367
|
+
readonly inputs: readonly [{
|
|
368
|
+
readonly internalType: "MarketAcc";
|
|
369
|
+
readonly name: "user";
|
|
370
|
+
readonly type: "bytes26";
|
|
371
|
+
}, {
|
|
372
|
+
readonly internalType: "MarketId";
|
|
373
|
+
readonly name: "marketId";
|
|
374
|
+
readonly type: "uint24";
|
|
375
|
+
}, {
|
|
376
|
+
readonly internalType: "AMMId";
|
|
377
|
+
readonly name: "ammId";
|
|
378
|
+
readonly type: "uint24";
|
|
379
|
+
}, {
|
|
380
|
+
readonly internalType: "enum Side";
|
|
381
|
+
readonly name: "side";
|
|
382
|
+
readonly type: "uint8";
|
|
383
|
+
}, {
|
|
384
|
+
readonly internalType: "enum TimeInForce";
|
|
385
|
+
readonly name: "tif";
|
|
386
|
+
readonly type: "uint8";
|
|
387
|
+
}, {
|
|
388
|
+
readonly internalType: "uint256";
|
|
389
|
+
readonly name: "size";
|
|
390
|
+
readonly type: "uint256";
|
|
391
|
+
}, {
|
|
392
|
+
readonly internalType: "int16";
|
|
393
|
+
readonly name: "tick";
|
|
394
|
+
readonly type: "int16";
|
|
395
|
+
}, {
|
|
396
|
+
readonly internalType: "int128";
|
|
397
|
+
readonly name: "desiredMatchRate";
|
|
398
|
+
readonly type: "int128";
|
|
399
|
+
}];
|
|
400
|
+
readonly name: "getUserInfoAfterPlaceOrder";
|
|
401
|
+
readonly outputs: readonly [{
|
|
402
|
+
readonly components: readonly [{
|
|
403
|
+
readonly internalType: "int256";
|
|
404
|
+
readonly name: "totalCash";
|
|
405
|
+
readonly type: "int256";
|
|
406
|
+
}, {
|
|
407
|
+
readonly components: readonly [{
|
|
408
|
+
readonly internalType: "MarketId";
|
|
409
|
+
readonly name: "marketId";
|
|
410
|
+
readonly type: "uint24";
|
|
411
|
+
}, {
|
|
412
|
+
readonly internalType: "int256";
|
|
413
|
+
readonly name: "signedSize";
|
|
414
|
+
readonly type: "int256";
|
|
415
|
+
}, {
|
|
416
|
+
readonly internalType: "int256";
|
|
417
|
+
readonly name: "positionValue";
|
|
418
|
+
readonly type: "int256";
|
|
419
|
+
}, {
|
|
420
|
+
readonly internalType: "int256";
|
|
421
|
+
readonly name: "liquidationApr";
|
|
422
|
+
readonly type: "int256";
|
|
423
|
+
}, {
|
|
424
|
+
readonly internalType: "uint256";
|
|
425
|
+
readonly name: "initialMargin";
|
|
426
|
+
readonly type: "uint256";
|
|
427
|
+
}, {
|
|
428
|
+
readonly internalType: "uint256";
|
|
429
|
+
readonly name: "maintMargin";
|
|
430
|
+
readonly type: "uint256";
|
|
431
|
+
}, {
|
|
432
|
+
readonly components: readonly [{
|
|
433
|
+
readonly internalType: "enum OrderStatus";
|
|
434
|
+
readonly name: "status";
|
|
435
|
+
readonly type: "uint8";
|
|
436
|
+
}, {
|
|
437
|
+
readonly internalType: "OrderId";
|
|
438
|
+
readonly name: "id";
|
|
439
|
+
readonly type: "uint64";
|
|
440
|
+
}, {
|
|
441
|
+
readonly internalType: "MarketAcc";
|
|
442
|
+
readonly name: "maker";
|
|
443
|
+
readonly type: "bytes26";
|
|
444
|
+
}, {
|
|
445
|
+
readonly internalType: "uint256";
|
|
446
|
+
readonly name: "size";
|
|
447
|
+
readonly type: "uint256";
|
|
448
|
+
}, {
|
|
449
|
+
readonly internalType: "int256";
|
|
450
|
+
readonly name: "rate";
|
|
451
|
+
readonly type: "int256";
|
|
452
|
+
}];
|
|
453
|
+
readonly internalType: "struct IMarketOffViewOnly.Order[]";
|
|
454
|
+
readonly name: "orders";
|
|
455
|
+
readonly type: "tuple[]";
|
|
456
|
+
}];
|
|
457
|
+
readonly internalType: "struct IExplorer.PositionInfo[]";
|
|
458
|
+
readonly name: "positions";
|
|
459
|
+
readonly type: "tuple[]";
|
|
460
|
+
}, {
|
|
461
|
+
readonly internalType: "int256";
|
|
462
|
+
readonly name: "availableInitialMargin";
|
|
463
|
+
readonly type: "int256";
|
|
464
|
+
}, {
|
|
465
|
+
readonly internalType: "int256";
|
|
466
|
+
readonly name: "availableMaintMargin";
|
|
467
|
+
readonly type: "int256";
|
|
468
|
+
}];
|
|
469
|
+
readonly internalType: "struct IExplorer.UserInfo";
|
|
470
|
+
readonly name: "preUserInfo";
|
|
471
|
+
readonly type: "tuple";
|
|
472
|
+
}, {
|
|
473
|
+
readonly components: readonly [{
|
|
474
|
+
readonly internalType: "int256";
|
|
475
|
+
readonly name: "totalCash";
|
|
476
|
+
readonly type: "int256";
|
|
477
|
+
}, {
|
|
478
|
+
readonly components: readonly [{
|
|
479
|
+
readonly internalType: "MarketId";
|
|
480
|
+
readonly name: "marketId";
|
|
481
|
+
readonly type: "uint24";
|
|
482
|
+
}, {
|
|
483
|
+
readonly internalType: "int256";
|
|
484
|
+
readonly name: "signedSize";
|
|
485
|
+
readonly type: "int256";
|
|
486
|
+
}, {
|
|
487
|
+
readonly internalType: "int256";
|
|
488
|
+
readonly name: "positionValue";
|
|
489
|
+
readonly type: "int256";
|
|
490
|
+
}, {
|
|
491
|
+
readonly internalType: "int256";
|
|
492
|
+
readonly name: "liquidationApr";
|
|
493
|
+
readonly type: "int256";
|
|
494
|
+
}, {
|
|
495
|
+
readonly internalType: "uint256";
|
|
496
|
+
readonly name: "initialMargin";
|
|
497
|
+
readonly type: "uint256";
|
|
498
|
+
}, {
|
|
499
|
+
readonly internalType: "uint256";
|
|
500
|
+
readonly name: "maintMargin";
|
|
501
|
+
readonly type: "uint256";
|
|
502
|
+
}, {
|
|
503
|
+
readonly components: readonly [{
|
|
504
|
+
readonly internalType: "enum OrderStatus";
|
|
505
|
+
readonly name: "status";
|
|
506
|
+
readonly type: "uint8";
|
|
507
|
+
}, {
|
|
508
|
+
readonly internalType: "OrderId";
|
|
509
|
+
readonly name: "id";
|
|
510
|
+
readonly type: "uint64";
|
|
511
|
+
}, {
|
|
512
|
+
readonly internalType: "MarketAcc";
|
|
513
|
+
readonly name: "maker";
|
|
514
|
+
readonly type: "bytes26";
|
|
515
|
+
}, {
|
|
516
|
+
readonly internalType: "uint256";
|
|
517
|
+
readonly name: "size";
|
|
518
|
+
readonly type: "uint256";
|
|
519
|
+
}, {
|
|
520
|
+
readonly internalType: "int256";
|
|
521
|
+
readonly name: "rate";
|
|
522
|
+
readonly type: "int256";
|
|
523
|
+
}];
|
|
524
|
+
readonly internalType: "struct IMarketOffViewOnly.Order[]";
|
|
525
|
+
readonly name: "orders";
|
|
526
|
+
readonly type: "tuple[]";
|
|
527
|
+
}];
|
|
528
|
+
readonly internalType: "struct IExplorer.PositionInfo[]";
|
|
529
|
+
readonly name: "positions";
|
|
530
|
+
readonly type: "tuple[]";
|
|
531
|
+
}, {
|
|
532
|
+
readonly internalType: "int256";
|
|
533
|
+
readonly name: "availableInitialMargin";
|
|
534
|
+
readonly type: "int256";
|
|
535
|
+
}, {
|
|
536
|
+
readonly internalType: "int256";
|
|
537
|
+
readonly name: "availableMaintMargin";
|
|
538
|
+
readonly type: "int256";
|
|
539
|
+
}];
|
|
540
|
+
readonly internalType: "struct IExplorer.UserInfo";
|
|
541
|
+
readonly name: "postUserInfo";
|
|
542
|
+
readonly type: "tuple";
|
|
543
|
+
}, {
|
|
544
|
+
readonly internalType: "Trade";
|
|
545
|
+
readonly name: "matched";
|
|
546
|
+
readonly type: "uint256";
|
|
547
|
+
}, {
|
|
548
|
+
readonly internalType: "uint256";
|
|
549
|
+
readonly name: "marginRequired";
|
|
550
|
+
readonly type: "uint256";
|
|
551
|
+
}];
|
|
552
|
+
readonly stateMutability: "nonpayable";
|
|
553
|
+
readonly type: "function";
|
|
554
|
+
}];
|
|
555
|
+
getUserInfo(marketAcc: MarketAcc, multicallOptions?: MulticallOptions): Promise<ContractUserInfo>;
|
|
556
|
+
getMarketInfo(marketId: number, multicallOptions?: MulticallOptions): Promise<{
|
|
557
|
+
impliedApr: bigint;
|
|
558
|
+
underlyingApr: bigint;
|
|
559
|
+
nextSettlementTime: number;
|
|
560
|
+
name: string;
|
|
561
|
+
symbol: string;
|
|
562
|
+
isIsolatedOnly: boolean;
|
|
563
|
+
tokenId: number;
|
|
564
|
+
marketId: number;
|
|
565
|
+
maturity: number;
|
|
566
|
+
tickStep: number;
|
|
567
|
+
iTickThresh: number;
|
|
568
|
+
isMatured: boolean;
|
|
569
|
+
markApr: bigint;
|
|
570
|
+
}>;
|
|
571
|
+
getMarketOrderBook(marketId: number, Side: Side, fromTick: number, toTick: number, multicallOptions?: MulticallOptions): Promise<readonly bigint[]>;
|
|
572
|
+
getUserInfoAfterPlaceOrder(marketAcc: MarketAcc, marketId: number, ammId: number, side: number, timeInForce: TimeInForce, size: bigint, limitTick: number, desiredMatchRate: FixedX18, multicallOptions?: MulticallOptions): Promise<{
|
|
573
|
+
preUserInfo: ContractUserInfo;
|
|
574
|
+
postUserInfo: ContractUserInfo;
|
|
575
|
+
matched: bigint;
|
|
576
|
+
marginRequired: bigint;
|
|
577
|
+
}>;
|
|
578
|
+
getUserInfoAfterBulkCancels(marketAcc: MarketAcc, marketId: number, cancelAll: boolean, orderIds: bigint[], multicallOptions?: MulticallOptions): Promise<{
|
|
579
|
+
preUserInfo: ContractUserInfo;
|
|
580
|
+
postUserInfo: ContractUserInfo;
|
|
581
|
+
}>;
|
|
582
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Explorer = void 0;
|
|
4
|
+
const viemAbis_1 = require("./abis/viemAbis");
|
|
5
|
+
const base_contract_helper_1 = require("./base-contract-helper");
|
|
6
|
+
class Explorer extends base_contract_helper_1.BaseContractHelper {
|
|
7
|
+
abi() {
|
|
8
|
+
return viemAbis_1.iExplorerAbi;
|
|
9
|
+
}
|
|
10
|
+
async getUserInfo(marketAcc, multicallOptions) {
|
|
11
|
+
const userInfo = await this.contract.simulate.getUserInfo(marketAcc, multicallOptions);
|
|
12
|
+
return userInfo;
|
|
13
|
+
}
|
|
14
|
+
async getMarketInfo(marketId, multicallOptions) {
|
|
15
|
+
const marketInfo = await this.contract.read.getMarketInfo(marketId, multicallOptions);
|
|
16
|
+
return {
|
|
17
|
+
impliedApr: marketInfo.impliedApr,
|
|
18
|
+
underlyingApr: marketInfo.underlyingApr,
|
|
19
|
+
nextSettlementTime: marketInfo.nextSettleTime,
|
|
20
|
+
name: marketInfo.name,
|
|
21
|
+
symbol: marketInfo.symbol,
|
|
22
|
+
isIsolatedOnly: marketInfo.isIsolatedOnly,
|
|
23
|
+
tokenId: marketInfo.tokenId,
|
|
24
|
+
marketId: marketInfo.marketId,
|
|
25
|
+
maturity: marketInfo.maturity,
|
|
26
|
+
tickStep: marketInfo.tickStep,
|
|
27
|
+
iTickThresh: marketInfo.iTickThresh,
|
|
28
|
+
isMatured: marketInfo.isMatured,
|
|
29
|
+
markApr: marketInfo.markApr,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async getMarketOrderBook(marketId, Side, fromTick, toTick, multicallOptions) {
|
|
33
|
+
return await this.contract.read.getMarketOrderBook(marketId, Side, fromTick, toTick, multicallOptions);
|
|
34
|
+
}
|
|
35
|
+
async getUserInfoAfterPlaceOrder(marketAcc, marketId, ammId, side, timeInForce, size, limitTick, desiredMatchRate, multicallOptions) {
|
|
36
|
+
const [preUserInfo, postUserInfo, matched, marginRequired] = await this.contract.simulate.getUserInfoAfterPlaceOrder(marketAcc, marketId, ammId, side, timeInForce, size, limitTick, desiredMatchRate.value, multicallOptions);
|
|
37
|
+
return {
|
|
38
|
+
preUserInfo: preUserInfo,
|
|
39
|
+
postUserInfo: postUserInfo,
|
|
40
|
+
matched,
|
|
41
|
+
marginRequired,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async getUserInfoAfterBulkCancels(marketAcc, marketId, cancelAll, orderIds, multicallOptions) {
|
|
45
|
+
const [preUserInfo, postUserInfo] = await this.contract.simulate.getUserInfoAfterBulkCancels(marketAcc, marketId, cancelAll, orderIds, multicallOptions);
|
|
46
|
+
return {
|
|
47
|
+
preUserInfo: preUserInfo,
|
|
48
|
+
postUserInfo: postUserInfo,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.Explorer = Explorer;
|
|
53
|
+
//# sourceMappingURL=explorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explorer.js","sourceRoot":"","sources":["../../src/contracts/explorer.ts"],"names":[],"mappings":";;;AAEA,8CAA+C;AAC/C,iEAA4D;AAI5D,MAAa,QAAS,SAAQ,yCAAuC;IACnE,GAAG;QACD,OAAO,uBAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,SAAoB,EAAE,gBAAmC;QACzE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QACvF,OAAO,QAA4B,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAAgB,EAAE,gBAAmC;QACvE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QACtF,OAAO;YACL,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,aAAa,EAAE,UAAU,CAAC,aAAa;YACvC,kBAAkB,EAAE,UAAU,CAAC,cAAc;YAC7C,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,cAAc,EAAE,UAAU,CAAC,cAAc;YACzC,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,OAAO,EAAE,UAAU,CAAC,OAAO;SAC5B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,QAAgB,EAChB,IAAU,EACV,QAAgB,EAChB,MAAc,EACd,gBAAmC;QAEnC,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACzG,CAAC;IAED,KAAK,CAAC,0BAA0B,CAC9B,SAAoB,EACpB,QAAgB,EAChB,KAAa,EACb,IAAY,EACZ,WAAwB,EACxB,IAAY,EACZ,SAAiB,EACjB,gBAA0B,EAC1B,gBAAmC;QAEnC,MAAM,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC,GACxD,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,0BAA0B,CACrD,SAAS,EACT,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,SAAS,EACT,gBAAgB,CAAC,KAAK,EACtB,gBAAgB,CACjB,CAAC;QACJ,OAAO;YACL,WAAW,EAAE,WAA+B;YAC5C,YAAY,EAAE,YAAgC;YAC9C,OAAO;YACP,cAAc;SACf,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,2BAA2B,CAC/B,SAAoB,EACpB,QAAgB,EAChB,SAAkB,EAClB,QAAkB,EAClB,gBAAmC;QAEnC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,2BAA2B,CAC1F,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,gBAAgB,CACjB,CAAC;QACF,OAAO;YACL,WAAW,EAAE,WAA+B;YAC5C,YAAY,EAAE,YAAgC;SAC/C,CAAC;IACJ,CAAC;CACF;AAzFD,4BAyFC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { abi as PendleContractErrorsAbi } from '@pendle/core-v3/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.json';
|
|
2
|
-
export { naiveDistributorAbi } from './distributorAbi';
|
|
3
|
-
export { multiTokenMerkleDistributorAbi } from './multiTokenMerkleDistributorAbi';
|
|
4
|
-
export * from './viemAbis';
|
|
2
|
+
export { naiveDistributorAbi } from './abis/distributorAbi';
|
|
3
|
+
export { multiTokenMerkleDistributorAbi } from './abis/multiTokenMerkleDistributorAbi';
|
|
4
|
+
export * from './abis/viemAbis';
|
package/dist/contracts/index.js
CHANGED
|
@@ -17,9 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.multiTokenMerkleDistributorAbi = exports.naiveDistributorAbi = exports.PendleContractErrorsAbi = void 0;
|
|
18
18
|
var SDKErrorsDirectory_json_1 = require("@pendle/core-v3/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.json");
|
|
19
19
|
Object.defineProperty(exports, "PendleContractErrorsAbi", { enumerable: true, get: function () { return SDKErrorsDirectory_json_1.abi; } });
|
|
20
|
-
var distributorAbi_1 = require("./distributorAbi");
|
|
20
|
+
var distributorAbi_1 = require("./abis/distributorAbi");
|
|
21
21
|
Object.defineProperty(exports, "naiveDistributorAbi", { enumerable: true, get: function () { return distributorAbi_1.naiveDistributorAbi; } });
|
|
22
|
-
var multiTokenMerkleDistributorAbi_1 = require("./multiTokenMerkleDistributorAbi");
|
|
22
|
+
var multiTokenMerkleDistributorAbi_1 = require("./abis/multiTokenMerkleDistributorAbi");
|
|
23
23
|
Object.defineProperty(exports, "multiTokenMerkleDistributorAbi", { enumerable: true, get: function () { return multiTokenMerkleDistributorAbi_1.multiTokenMerkleDistributorAbi; } });
|
|
24
|
-
__exportStar(require("./viemAbis"), exports);
|
|
24
|
+
__exportStar(require("./abis/viemAbis"), exports);
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sJAA4J;AAAnJ,kIAAA,GAAG,OAA2B;AACvC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sJAA4J;AAAnJ,kIAAA,GAAG,OAA2B;AACvC,wDAA2D;AAAlD,qHAAA,mBAAmB,OAAA;AAC5B,wFAAuF;AAA9E,gJAAA,8BAA8B,OAAA;AACvC,kDAAgC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AccManager = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const addresses_1 = require("../../addresses");
|
|
6
|
-
const viemAbis_1 = require("../../contracts/viemAbis");
|
|
6
|
+
const viemAbis_1 = require("../../contracts/abis/viemAbis");
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
8
|
const publicClient_1 = require("../publicClient");
|
|
9
9
|
class AccManager {
|