@aegis-engine/core 0.6.0 → 0.8.0
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/README.md +232 -7
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/account.d.ts +11 -0
- package/dist/account.js +129 -0
- package/dist/actions/allowance.d.ts +94 -0
- package/dist/actions/directPoolSwap.d.ts +10 -1
- package/dist/actions/kyberSwap.d.ts +2 -0
- package/dist/actions/types.d.ts +10 -3
- package/dist/actions/wallet.d.ts +1 -0
- package/dist/aegis-core.js +9653 -200
- package/dist/backendAdapters.d.ts +3 -1
- package/dist/config/chains.d.ts +1 -0
- package/dist/config/constants.d.ts +4 -0
- package/dist/config/tokens.d.ts +2 -1
- package/dist/config/types.d.ts +8 -0
- package/dist/contract/backendClient.d.ts +3 -1
- package/dist/contract/generated/aegis-swap.d.ts +6337 -1377
- package/dist/contract/generated/market-data.d.ts +8286 -0
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/responseBudget.d.ts +9 -0
- package/dist/contract/schemas.d.ts +13 -3
- package/dist/engine/account/accounting.d.ts +24 -0
- package/dist/engine/account/accountingSchemas.d.ts +2056 -0
- package/dist/engine/account/activity.d.ts +42 -0
- package/dist/engine/account/activitySchemas.d.ts +327 -0
- package/dist/engine/account/amountSchemas.d.ts +9 -0
- package/dist/engine/account/catalogSchemas.d.ts +108 -0
- package/dist/engine/account/client.d.ts +14 -0
- package/dist/engine/account/history.d.ts +40 -0
- package/dist/engine/account/historySchemas.d.ts +251 -0
- package/dist/engine/account/management.d.ts +13 -0
- package/dist/engine/account/portfolioSchemas.d.ts +712 -0
- package/dist/engine/account/positionPerformance.d.ts +18 -0
- package/dist/engine/account/positionPerformanceSchemas.d.ts +101 -0
- package/dist/engine/account/positionPnl.d.ts +18 -0
- package/dist/engine/account/positionPnlSchemas.d.ts +149 -0
- package/dist/engine/account/transactionHistory.d.ts +50 -0
- package/dist/engine/account/transactionSchemas.d.ts +101 -0
- package/dist/engine/account/transactions.d.ts +26 -0
- package/dist/engine/account/transport.d.ts +31 -0
- package/dist/engine/account/types.d.ts +39 -0
- package/dist/engine/actions.d.ts +14 -4
- package/dist/engine/adaptiveFee.d.ts +14 -0
- package/dist/engine/balancedLending.d.ts +82 -0
- package/dist/engine/borrowCollateralFloor.d.ts +3 -0
- package/dist/engine/borrowLimits.d.ts +18 -0
- package/dist/engine/dataSource.d.ts +2 -0
- package/dist/engine/index.d.ts +20 -0
- package/dist/engine/marketAdapter.d.ts +3 -0
- package/dist/engine/marketSeries.d.ts +61 -0
- package/dist/engine/marketSeriesSchemas.d.ts +312 -0
- package/dist/engine/marketTrust.d.ts +26 -0
- package/dist/engine/openingEntry.d.ts +41 -0
- package/dist/engine/rateHistorySchemas.d.ts +88 -0
- package/dist/engine/reads.d.ts +1 -1
- package/dist/engine/registry.d.ts +1 -1
- package/dist/engine/restSchemas.d.ts +59 -1
- package/dist/engine/tradeExecutionSession.d.ts +155 -0
- package/dist/engine/types.d.ts +169 -15
- package/dist/engine/v4Quote.d.ts +5 -0
- package/dist/index.d.ts +13 -8
- package/dist/internal/guardedWalletTransaction.d.ts +31 -0
- package/dist/permit.d.ts +80 -6
- package/dist/quote/aggregatedSwapQuote.d.ts +5 -1
- package/dist/quote/kyberCalldata.d.ts +5 -1
- package/dist/{sdkRuntime-C_vaU-0g.js → sdkRuntime-3aRt_g55.js} +3385 -2957
- package/dist/services/kyberSwap.d.ts +12 -0
- package/dist/swap/authorizePermit.d.ts +11 -9
- package/dist/swap/executeSwapTransaction.d.ts +5 -1
- package/dist/swap/receiptWait.d.ts +9 -0
- package/dist/swap/sendSwapTransaction.d.ts +7 -0
- package/dist/swap/settlement.d.ts +4 -0
- package/dist/swap/trustedMarket.d.ts +25 -0
- package/dist/transactionHistory-1Zl2KCcV.js +5915 -0
- package/dist/transactionProgress.d.ts +41 -2
- package/dist/wallet.d.ts +5 -1
- package/package.json +12 -5
- package/dist/index-D9EfUokZ.js +0 -11031
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AegisEngineAccountActivityEvent, AegisEnginePortfolioPosition, AegisEnginePortfolioPrice } from './types.js';
|
|
2
|
+
export type AegisEngineActivityMovement = {
|
|
3
|
+
positionId: string;
|
|
4
|
+
poolId: string;
|
|
5
|
+
/** Vault balance changes are not wallet receipts. Lending uses Engine settlement signs. */
|
|
6
|
+
scope: 'vault-idle' | 'lending-settlement';
|
|
7
|
+
amount0Raw: string;
|
|
8
|
+
amount1Raw: string;
|
|
9
|
+
};
|
|
10
|
+
export type AegisEngineAccountActivityTransaction = {
|
|
11
|
+
id: string;
|
|
12
|
+
chainId: number;
|
|
13
|
+
txHash: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
blockNumber: number;
|
|
16
|
+
transactionIndex: number;
|
|
17
|
+
status: 'indexed';
|
|
18
|
+
kinds: AegisEngineAccountActivityEvent['action']['kind'][];
|
|
19
|
+
events: AegisEngineAccountActivityEvent[];
|
|
20
|
+
movements: AegisEngineActivityMovement[];
|
|
21
|
+
/** Raw Engine principal, deliberately not labeled as a single-token loan amount. */
|
|
22
|
+
principalChanges: {
|
|
23
|
+
positionId: string;
|
|
24
|
+
deltaRlRaw: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
/** Deduplicates event identities before transaction grouping. A transaction
|
|
28
|
+
* split across page boundaries accumulates its events instead of losing one. */
|
|
29
|
+
export declare function groupEngineAccountActivity(events: readonly AegisEngineAccountActivityEvent[]): AegisEngineAccountActivityTransaction[];
|
|
30
|
+
/** Exact human units; metadata absence is explicit and never assumes 18 decimals. */
|
|
31
|
+
export declare function formatEngineAccountTokenAmount(raw: string, decimals: number | null, maximumFractionDigits?: number): {
|
|
32
|
+
text: string;
|
|
33
|
+
exact: string;
|
|
34
|
+
available: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare function enginePortfolioPriceFor(prices: readonly AegisEnginePortfolioPrice[], chainId: number, address: string | null): AegisEnginePortfolioPrice | null;
|
|
37
|
+
/** Classification uses protocol position kind; it does not infer Long/Short
|
|
38
|
+
* intent from collateral ratios or fabricate historical performance. */
|
|
39
|
+
export declare function groupEnginePortfolioPositions(positions: readonly AegisEnginePortfolioPosition[]): {
|
|
40
|
+
borrowing: AegisEnginePortfolioPosition[];
|
|
41
|
+
lending: AegisEnginePortfolioPosition[];
|
|
42
|
+
};
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ActivityCollectionSchema: z.ZodEnum<{
|
|
3
|
+
vaultCreatedActions: "vaultCreatedActions";
|
|
4
|
+
vaultBurnedActions: "vaultBurnedActions";
|
|
5
|
+
vaultLockedActions: "vaultLockedActions";
|
|
6
|
+
debtModifiedActions: "debtModifiedActions";
|
|
7
|
+
idleModifiedActions: "idleModifiedActions";
|
|
8
|
+
vaultMicroLiquidatedActions: "vaultMicroLiquidatedActions";
|
|
9
|
+
liquidityModifiedActions: "liquidityModifiedActions";
|
|
10
|
+
marketShareTransfers: "marketShareTransfers";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const ActivityActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
kind: z.ZodLiteral<"vault_created">;
|
|
14
|
+
owner: z.ZodString;
|
|
15
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
16
|
+
kind: z.ZodLiteral<"vault_burned">;
|
|
17
|
+
caller: z.ZodString;
|
|
18
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
19
|
+
kind: z.ZodLiteral<"vault_locked">;
|
|
20
|
+
ltvPips: z.ZodNumber;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"debt_modified">;
|
|
23
|
+
principalDeltaRequestedRaw: z.ZodString;
|
|
24
|
+
principalDeltaActualRaw: z.ZodString;
|
|
25
|
+
borrowIndexWad: z.ZodString;
|
|
26
|
+
deltaIdle0Raw: z.ZodString;
|
|
27
|
+
deltaIdle1Raw: z.ZodString;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
kind: z.ZodLiteral<"idle_modified">;
|
|
30
|
+
deltaAmount0Raw: z.ZodString;
|
|
31
|
+
deltaAmount1Raw: z.ZodString;
|
|
32
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
33
|
+
kind: z.ZodLiteral<"vault_micro_liquidated">;
|
|
34
|
+
caller: z.ZodString;
|
|
35
|
+
zeroForOne: z.ZodBoolean;
|
|
36
|
+
swapDelta0Raw: z.ZodString;
|
|
37
|
+
swapDelta1Raw: z.ZodString;
|
|
38
|
+
debtRepaidRlRaw: z.ZodString;
|
|
39
|
+
idleDelta0Raw: z.ZodString;
|
|
40
|
+
idleDelta1Raw: z.ZodString;
|
|
41
|
+
keeperFee0Raw: z.ZodString;
|
|
42
|
+
keeperFee1Raw: z.ZodString;
|
|
43
|
+
initialLtvPips: z.ZodNumber;
|
|
44
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
45
|
+
kind: z.ZodEnum<{
|
|
46
|
+
deposit: "deposit";
|
|
47
|
+
withdraw: "withdraw";
|
|
48
|
+
}>;
|
|
49
|
+
deltaSharesRaw: z.ZodString;
|
|
50
|
+
deltaAmount0Raw: z.ZodString;
|
|
51
|
+
deltaAmount1Raw: z.ZodString;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
kind: z.ZodEnum<{
|
|
54
|
+
transfer_in: "transfer_in";
|
|
55
|
+
transfer_out: "transfer_out";
|
|
56
|
+
transfer_self: "transfer_self";
|
|
57
|
+
}>;
|
|
58
|
+
sharesRaw: z.ZodString;
|
|
59
|
+
counterparty: z.ZodString;
|
|
60
|
+
}, z.core.$strict>], "kind">;
|
|
61
|
+
export declare const ActivityEventSchema: z.ZodObject<{
|
|
62
|
+
id: z.ZodString;
|
|
63
|
+
chainId: z.ZodNumber;
|
|
64
|
+
engine: z.ZodString;
|
|
65
|
+
sourceId: z.ZodString;
|
|
66
|
+
sourceCollection: z.ZodEnum<{
|
|
67
|
+
vaultCreatedActions: "vaultCreatedActions";
|
|
68
|
+
vaultBurnedActions: "vaultBurnedActions";
|
|
69
|
+
vaultLockedActions: "vaultLockedActions";
|
|
70
|
+
debtModifiedActions: "debtModifiedActions";
|
|
71
|
+
idleModifiedActions: "idleModifiedActions";
|
|
72
|
+
vaultMicroLiquidatedActions: "vaultMicroLiquidatedActions";
|
|
73
|
+
liquidityModifiedActions: "liquidityModifiedActions";
|
|
74
|
+
marketShareTransfers: "marketShareTransfers";
|
|
75
|
+
}>;
|
|
76
|
+
txHash: z.ZodString;
|
|
77
|
+
blockNumber: z.ZodNumber;
|
|
78
|
+
transactionIndex: z.ZodNumber;
|
|
79
|
+
logIndex: z.ZodNumber;
|
|
80
|
+
timestamp: z.ZodNumber;
|
|
81
|
+
positionId: z.ZodString;
|
|
82
|
+
vaultId: z.ZodNullable<z.ZodString>;
|
|
83
|
+
poolId: z.ZodString;
|
|
84
|
+
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
85
|
+
kind: z.ZodLiteral<"vault_created">;
|
|
86
|
+
owner: z.ZodString;
|
|
87
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
88
|
+
kind: z.ZodLiteral<"vault_burned">;
|
|
89
|
+
caller: z.ZodString;
|
|
90
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
91
|
+
kind: z.ZodLiteral<"vault_locked">;
|
|
92
|
+
ltvPips: z.ZodNumber;
|
|
93
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
+
kind: z.ZodLiteral<"debt_modified">;
|
|
95
|
+
principalDeltaRequestedRaw: z.ZodString;
|
|
96
|
+
principalDeltaActualRaw: z.ZodString;
|
|
97
|
+
borrowIndexWad: z.ZodString;
|
|
98
|
+
deltaIdle0Raw: z.ZodString;
|
|
99
|
+
deltaIdle1Raw: z.ZodString;
|
|
100
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
101
|
+
kind: z.ZodLiteral<"idle_modified">;
|
|
102
|
+
deltaAmount0Raw: z.ZodString;
|
|
103
|
+
deltaAmount1Raw: z.ZodString;
|
|
104
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
105
|
+
kind: z.ZodLiteral<"vault_micro_liquidated">;
|
|
106
|
+
caller: z.ZodString;
|
|
107
|
+
zeroForOne: z.ZodBoolean;
|
|
108
|
+
swapDelta0Raw: z.ZodString;
|
|
109
|
+
swapDelta1Raw: z.ZodString;
|
|
110
|
+
debtRepaidRlRaw: z.ZodString;
|
|
111
|
+
idleDelta0Raw: z.ZodString;
|
|
112
|
+
idleDelta1Raw: z.ZodString;
|
|
113
|
+
keeperFee0Raw: z.ZodString;
|
|
114
|
+
keeperFee1Raw: z.ZodString;
|
|
115
|
+
initialLtvPips: z.ZodNumber;
|
|
116
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
117
|
+
kind: z.ZodEnum<{
|
|
118
|
+
deposit: "deposit";
|
|
119
|
+
withdraw: "withdraw";
|
|
120
|
+
}>;
|
|
121
|
+
deltaSharesRaw: z.ZodString;
|
|
122
|
+
deltaAmount0Raw: z.ZodString;
|
|
123
|
+
deltaAmount1Raw: z.ZodString;
|
|
124
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
125
|
+
kind: z.ZodEnum<{
|
|
126
|
+
transfer_in: "transfer_in";
|
|
127
|
+
transfer_out: "transfer_out";
|
|
128
|
+
transfer_self: "transfer_self";
|
|
129
|
+
}>;
|
|
130
|
+
sharesRaw: z.ZodString;
|
|
131
|
+
counterparty: z.ZodString;
|
|
132
|
+
}, z.core.$strict>], "kind">;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
export type ActivityEvent = z.infer<typeof ActivityEventSchema>;
|
|
135
|
+
export declare const ActivityPageQuerySchema: z.ZodObject<{
|
|
136
|
+
account: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
137
|
+
chainIds: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<number[], string>>, z.ZodTransform<number[], number[]>>;
|
|
138
|
+
limit: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
139
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
export type ActivityPageQuery = z.infer<typeof ActivityPageQuerySchema>;
|
|
142
|
+
export declare const ActivityChainCursorSchema: z.ZodObject<{
|
|
143
|
+
chainId: z.ZodNumber;
|
|
144
|
+
engine: z.ZodString;
|
|
145
|
+
vaultRegistry: z.ZodString;
|
|
146
|
+
version: z.ZodString;
|
|
147
|
+
frame: z.ZodNullable<z.ZodObject<{
|
|
148
|
+
blockNumber: z.ZodNumber;
|
|
149
|
+
blockHash: z.ZodString;
|
|
150
|
+
blockTimestamp: z.ZodNumber;
|
|
151
|
+
deployment: z.ZodString;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
beforeBlock: z.ZodNumber;
|
|
154
|
+
eventBlock: z.ZodNullable<z.ZodNumber>;
|
|
155
|
+
beforeLog: z.ZodNullable<z.ZodNumber>;
|
|
156
|
+
eventTimestamp: z.ZodNullable<z.ZodNumber>;
|
|
157
|
+
done: z.ZodBoolean;
|
|
158
|
+
unavailable: z.ZodBoolean;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
export declare const ActivityCursorSchema: z.ZodObject<{
|
|
161
|
+
version: z.ZodLiteral<1>;
|
|
162
|
+
account: z.ZodString;
|
|
163
|
+
chainIds: z.ZodArray<z.ZodNumber>;
|
|
164
|
+
limit: z.ZodNumber;
|
|
165
|
+
expiresAt: z.ZodString;
|
|
166
|
+
chains: z.ZodArray<z.ZodObject<{
|
|
167
|
+
chainId: z.ZodNumber;
|
|
168
|
+
engine: z.ZodString;
|
|
169
|
+
vaultRegistry: z.ZodString;
|
|
170
|
+
version: z.ZodString;
|
|
171
|
+
frame: z.ZodNullable<z.ZodObject<{
|
|
172
|
+
blockNumber: z.ZodNumber;
|
|
173
|
+
blockHash: z.ZodString;
|
|
174
|
+
blockTimestamp: z.ZodNumber;
|
|
175
|
+
deployment: z.ZodString;
|
|
176
|
+
}, z.core.$strict>>;
|
|
177
|
+
beforeBlock: z.ZodNumber;
|
|
178
|
+
eventBlock: z.ZodNullable<z.ZodNumber>;
|
|
179
|
+
beforeLog: z.ZodNullable<z.ZodNumber>;
|
|
180
|
+
eventTimestamp: z.ZodNullable<z.ZodNumber>;
|
|
181
|
+
done: z.ZodBoolean;
|
|
182
|
+
unavailable: z.ZodBoolean;
|
|
183
|
+
}, z.core.$strict>>;
|
|
184
|
+
rejectedRows: z.ZodNumber;
|
|
185
|
+
}, z.core.$strict>;
|
|
186
|
+
export type ActivityCursor = z.infer<typeof ActivityCursorSchema>;
|
|
187
|
+
export type ActivityChainCursor = z.infer<typeof ActivityChainCursorSchema>;
|
|
188
|
+
export declare const ActivityPageResponseSchema: z.ZodObject<{
|
|
189
|
+
schemaVersion: z.ZodLiteral<"2">;
|
|
190
|
+
account: z.ZodString;
|
|
191
|
+
chainIds: z.ZodArray<z.ZodNumber>;
|
|
192
|
+
scope: z.ZodLiteral<"currently-owned-vaults-and-account-lending">;
|
|
193
|
+
ordering: z.ZodLiteral<"chain-execution-order-merged-by-timestamp">;
|
|
194
|
+
events: z.ZodArray<z.ZodObject<{
|
|
195
|
+
id: z.ZodString;
|
|
196
|
+
chainId: z.ZodNumber;
|
|
197
|
+
engine: z.ZodString;
|
|
198
|
+
sourceId: z.ZodString;
|
|
199
|
+
sourceCollection: z.ZodEnum<{
|
|
200
|
+
vaultCreatedActions: "vaultCreatedActions";
|
|
201
|
+
vaultBurnedActions: "vaultBurnedActions";
|
|
202
|
+
vaultLockedActions: "vaultLockedActions";
|
|
203
|
+
debtModifiedActions: "debtModifiedActions";
|
|
204
|
+
idleModifiedActions: "idleModifiedActions";
|
|
205
|
+
vaultMicroLiquidatedActions: "vaultMicroLiquidatedActions";
|
|
206
|
+
liquidityModifiedActions: "liquidityModifiedActions";
|
|
207
|
+
marketShareTransfers: "marketShareTransfers";
|
|
208
|
+
}>;
|
|
209
|
+
txHash: z.ZodString;
|
|
210
|
+
blockNumber: z.ZodNumber;
|
|
211
|
+
transactionIndex: z.ZodNumber;
|
|
212
|
+
logIndex: z.ZodNumber;
|
|
213
|
+
timestamp: z.ZodNumber;
|
|
214
|
+
positionId: z.ZodString;
|
|
215
|
+
vaultId: z.ZodNullable<z.ZodString>;
|
|
216
|
+
poolId: z.ZodString;
|
|
217
|
+
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
218
|
+
kind: z.ZodLiteral<"vault_created">;
|
|
219
|
+
owner: z.ZodString;
|
|
220
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
221
|
+
kind: z.ZodLiteral<"vault_burned">;
|
|
222
|
+
caller: z.ZodString;
|
|
223
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
224
|
+
kind: z.ZodLiteral<"vault_locked">;
|
|
225
|
+
ltvPips: z.ZodNumber;
|
|
226
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
227
|
+
kind: z.ZodLiteral<"debt_modified">;
|
|
228
|
+
principalDeltaRequestedRaw: z.ZodString;
|
|
229
|
+
principalDeltaActualRaw: z.ZodString;
|
|
230
|
+
borrowIndexWad: z.ZodString;
|
|
231
|
+
deltaIdle0Raw: z.ZodString;
|
|
232
|
+
deltaIdle1Raw: z.ZodString;
|
|
233
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
234
|
+
kind: z.ZodLiteral<"idle_modified">;
|
|
235
|
+
deltaAmount0Raw: z.ZodString;
|
|
236
|
+
deltaAmount1Raw: z.ZodString;
|
|
237
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
238
|
+
kind: z.ZodLiteral<"vault_micro_liquidated">;
|
|
239
|
+
caller: z.ZodString;
|
|
240
|
+
zeroForOne: z.ZodBoolean;
|
|
241
|
+
swapDelta0Raw: z.ZodString;
|
|
242
|
+
swapDelta1Raw: z.ZodString;
|
|
243
|
+
debtRepaidRlRaw: z.ZodString;
|
|
244
|
+
idleDelta0Raw: z.ZodString;
|
|
245
|
+
idleDelta1Raw: z.ZodString;
|
|
246
|
+
keeperFee0Raw: z.ZodString;
|
|
247
|
+
keeperFee1Raw: z.ZodString;
|
|
248
|
+
initialLtvPips: z.ZodNumber;
|
|
249
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
250
|
+
kind: z.ZodEnum<{
|
|
251
|
+
deposit: "deposit";
|
|
252
|
+
withdraw: "withdraw";
|
|
253
|
+
}>;
|
|
254
|
+
deltaSharesRaw: z.ZodString;
|
|
255
|
+
deltaAmount0Raw: z.ZodString;
|
|
256
|
+
deltaAmount1Raw: z.ZodString;
|
|
257
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
258
|
+
kind: z.ZodEnum<{
|
|
259
|
+
transfer_in: "transfer_in";
|
|
260
|
+
transfer_out: "transfer_out";
|
|
261
|
+
transfer_self: "transfer_self";
|
|
262
|
+
}>;
|
|
263
|
+
sharesRaw: z.ZodString;
|
|
264
|
+
counterparty: z.ZodString;
|
|
265
|
+
}, z.core.$strict>], "kind">;
|
|
266
|
+
}, z.core.$strict>>;
|
|
267
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
268
|
+
expiresAt: z.ZodString;
|
|
269
|
+
coverage: z.ZodObject<{
|
|
270
|
+
status: z.ZodEnum<{
|
|
271
|
+
partial: "partial";
|
|
272
|
+
complete: "complete";
|
|
273
|
+
}>;
|
|
274
|
+
categories: z.ZodArray<z.ZodEnum<{
|
|
275
|
+
vaultCreatedActions: "vaultCreatedActions";
|
|
276
|
+
vaultBurnedActions: "vaultBurnedActions";
|
|
277
|
+
vaultLockedActions: "vaultLockedActions";
|
|
278
|
+
debtModifiedActions: "debtModifiedActions";
|
|
279
|
+
idleModifiedActions: "idleModifiedActions";
|
|
280
|
+
vaultMicroLiquidatedActions: "vaultMicroLiquidatedActions";
|
|
281
|
+
liquidityModifiedActions: "liquidityModifiedActions";
|
|
282
|
+
marketShareTransfers: "marketShareTransfers";
|
|
283
|
+
}>>;
|
|
284
|
+
returnedEvents: z.ZodNumber;
|
|
285
|
+
candidateRowsRead: z.ZodNumber;
|
|
286
|
+
evaluatedRows: z.ZodNumber;
|
|
287
|
+
rejectedRows: z.ZodNumber;
|
|
288
|
+
rejectedRowsSinceStart: z.ZodNumber;
|
|
289
|
+
exhausted: z.ZodBoolean;
|
|
290
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
chains: z.ZodArray<z.ZodObject<{
|
|
293
|
+
chainId: z.ZodNumber;
|
|
294
|
+
engine: z.ZodString;
|
|
295
|
+
vaultRegistry: z.ZodString;
|
|
296
|
+
frame: z.ZodNullable<z.ZodObject<{
|
|
297
|
+
blockNumber: z.ZodNumber;
|
|
298
|
+
blockHash: z.ZodString;
|
|
299
|
+
blockTimestamp: z.ZodNumber;
|
|
300
|
+
deployment: z.ZodString;
|
|
301
|
+
}, z.core.$strict>>;
|
|
302
|
+
status: z.ZodEnum<{
|
|
303
|
+
unavailable: "unavailable";
|
|
304
|
+
available: "available";
|
|
305
|
+
}>;
|
|
306
|
+
exhausted: z.ZodBoolean;
|
|
307
|
+
range: z.ZodNullable<z.ZodObject<{
|
|
308
|
+
start: z.ZodObject<{
|
|
309
|
+
done: z.ZodBoolean;
|
|
310
|
+
beforeBlock: z.ZodNumber;
|
|
311
|
+
eventBlock: z.ZodNullable<z.ZodNumber>;
|
|
312
|
+
beforeLog: z.ZodNullable<z.ZodNumber>;
|
|
313
|
+
}, z.core.$strict>;
|
|
314
|
+
end: z.ZodObject<{
|
|
315
|
+
done: z.ZodBoolean;
|
|
316
|
+
beforeBlock: z.ZodNumber;
|
|
317
|
+
eventBlock: z.ZodNullable<z.ZodNumber>;
|
|
318
|
+
beforeLog: z.ZodNullable<z.ZodNumber>;
|
|
319
|
+
}, z.core.$strict>;
|
|
320
|
+
}, z.core.$strict>>;
|
|
321
|
+
canonicality: z.ZodLiteral<"indexer-only-not-rpc-verified">;
|
|
322
|
+
}, z.core.$strict>>;
|
|
323
|
+
}, z.core.$strict>;
|
|
324
|
+
export declare const ActivityPageErrorSchema: z.ZodObject<{
|
|
325
|
+
error: z.ZodLiteral<"Engine activity unavailable">;
|
|
326
|
+
code: z.ZodString;
|
|
327
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EngineRawAmountSchema: z.ZodString;
|
|
3
|
+
export declare const EngineIndexedFrameSchema: z.ZodObject<{
|
|
4
|
+
blockNumber: z.ZodNumber;
|
|
5
|
+
blockHash: z.ZodString;
|
|
6
|
+
blockTimestamp: z.ZodNumber;
|
|
7
|
+
deployment: z.ZodString;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type EngineIndexedFrame = z.infer<typeof EngineIndexedFrameSchema>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EngineHistoryCatalogDeploymentSchema: z.ZodObject<{
|
|
3
|
+
version: z.ZodEnum<{
|
|
4
|
+
"v1.0.2": "v1.0.2";
|
|
5
|
+
"v1.0.3": "v1.0.3";
|
|
6
|
+
"v0.4.0": "v0.4.0";
|
|
7
|
+
}>;
|
|
8
|
+
engine: z.ZodString;
|
|
9
|
+
vaultRegistry: z.ZodString;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export declare const EngineHistoryCatalogPositionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
kind: z.ZodLiteral<"lend_shares">;
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
poolId: z.ZodString;
|
|
15
|
+
status: z.ZodEnum<{
|
|
16
|
+
open: "open";
|
|
17
|
+
closed: "closed";
|
|
18
|
+
}>;
|
|
19
|
+
indexedBalanceRaw: z.ZodString;
|
|
20
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
21
|
+
kind: z.ZodLiteral<"borrow_vault">;
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
poolId: z.ZodString;
|
|
24
|
+
vaultId: z.ZodString;
|
|
25
|
+
status: z.ZodEnum<{
|
|
26
|
+
open: "open";
|
|
27
|
+
closed: "closed";
|
|
28
|
+
}>;
|
|
29
|
+
indexedOwner: z.ZodString;
|
|
30
|
+
createdAt: z.ZodString;
|
|
31
|
+
burnedAt: z.ZodNullable<z.ZodString>;
|
|
32
|
+
burnedAtBlockNumber: z.ZodNullable<z.ZodNumber>;
|
|
33
|
+
}, z.core.$strict>], "kind">;
|
|
34
|
+
export type EngineHistoryCatalogPosition = z.infer<typeof EngineHistoryCatalogPositionSchema>;
|
|
35
|
+
export declare const EngineHistoryCatalogResponseSchema: z.ZodObject<{
|
|
36
|
+
schemaVersion: z.ZodLiteral<"1">;
|
|
37
|
+
chainId: z.ZodNumber;
|
|
38
|
+
account: z.ZodString;
|
|
39
|
+
deployment: z.ZodObject<{
|
|
40
|
+
version: z.ZodEnum<{
|
|
41
|
+
"v1.0.2": "v1.0.2";
|
|
42
|
+
"v1.0.3": "v1.0.3";
|
|
43
|
+
"v0.4.0": "v0.4.0";
|
|
44
|
+
}>;
|
|
45
|
+
engine: z.ZodString;
|
|
46
|
+
vaultRegistry: z.ZodString;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
scope: z.ZodEnum<{
|
|
49
|
+
"account-lending-and-current-or-last-owned-vaults": "account-lending-and-current-or-last-owned-vaults";
|
|
50
|
+
"account-lending-and-ever-owned-vaults": "account-lending-and-ever-owned-vaults";
|
|
51
|
+
}>;
|
|
52
|
+
ownershipEpochs: z.ZodLiteral<"unavailable">;
|
|
53
|
+
ordering: z.ZodLiteral<"vaults-then-lending-by-source-id">;
|
|
54
|
+
positions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
55
|
+
kind: z.ZodLiteral<"lend_shares">;
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
poolId: z.ZodString;
|
|
58
|
+
status: z.ZodEnum<{
|
|
59
|
+
open: "open";
|
|
60
|
+
closed: "closed";
|
|
61
|
+
}>;
|
|
62
|
+
indexedBalanceRaw: z.ZodString;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
kind: z.ZodLiteral<"borrow_vault">;
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
poolId: z.ZodString;
|
|
67
|
+
vaultId: z.ZodString;
|
|
68
|
+
status: z.ZodEnum<{
|
|
69
|
+
open: "open";
|
|
70
|
+
closed: "closed";
|
|
71
|
+
}>;
|
|
72
|
+
indexedOwner: z.ZodString;
|
|
73
|
+
createdAt: z.ZodString;
|
|
74
|
+
burnedAt: z.ZodNullable<z.ZodString>;
|
|
75
|
+
burnedAtBlockNumber: z.ZodNullable<z.ZodNumber>;
|
|
76
|
+
}, z.core.$strict>], "kind">>;
|
|
77
|
+
pagination: z.ZodObject<{
|
|
78
|
+
limit: z.ZodNumber;
|
|
79
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
80
|
+
expiresAt: z.ZodString;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
coverage: z.ZodObject<{
|
|
83
|
+
status: z.ZodEnum<{
|
|
84
|
+
partial: "partial";
|
|
85
|
+
complete: "complete";
|
|
86
|
+
}>;
|
|
87
|
+
exhausted: z.ZodBoolean;
|
|
88
|
+
evaluatedRowCount: z.ZodNumber;
|
|
89
|
+
returnedPositionCount: z.ZodNumber;
|
|
90
|
+
reasons: z.ZodArray<z.ZodLiteral<"more-positions">>;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
freshness: z.ZodObject<{
|
|
93
|
+
source: z.ZodLiteral<"engine-subgraph">;
|
|
94
|
+
frame: z.ZodObject<{
|
|
95
|
+
blockNumber: z.ZodNumber;
|
|
96
|
+
blockHash: z.ZodString;
|
|
97
|
+
blockTimestamp: z.ZodNumber;
|
|
98
|
+
deployment: z.ZodString;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
fetchedAt: z.ZodString;
|
|
101
|
+
canonicality: z.ZodLiteral<"indexer-only-not-rpc-verified">;
|
|
102
|
+
}, z.core.$strict>;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
export type EngineHistoryCatalogResponse = z.infer<typeof EngineHistoryCatalogResponseSchema>;
|
|
105
|
+
export declare const EngineHistoryCatalogErrorSchema: z.ZodObject<{
|
|
106
|
+
error: z.ZodLiteral<"Engine history position catalog unavailable">;
|
|
107
|
+
code: z.ZodString;
|
|
108
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { AegisEngineAccountReadError } from './transport.js';
|
|
2
|
+
import { type AegisEngineAccountActivityPage, type AegisEngineAccountPortfolio, type AegisEngineAccountReadInput, type AegisEngineTransactionStatus, type AegisEngineTransactionStatusInput } from './types.js';
|
|
3
|
+
/** Loads one complete, bounded snapshot. Failed/expired pagination discards
|
|
4
|
+
* the whole result, so positions and totals never come from different reads. */
|
|
5
|
+
export declare function fetchEngineAccountPortfolio(input: AegisEngineAccountReadInput): Promise<AegisEngineAccountPortfolio>;
|
|
6
|
+
/** One bounded activity page. A continuation always belongs to the same
|
|
7
|
+
* account/chain set and limit. Indexer observations are not receipt finality. */
|
|
8
|
+
export declare function fetchEngineAccountActivity(input: AegisEngineAccountReadInput & {
|
|
9
|
+
cursor?: string;
|
|
10
|
+
limit?: number;
|
|
11
|
+
}): Promise<AegisEngineAccountActivityPage>;
|
|
12
|
+
/** Read-only acknowledgement. Even `ready` is checked-at-read, not finalized;
|
|
13
|
+
* no returned status authorizes submitting a transaction again. */
|
|
14
|
+
export declare function fetchEngineTransactionStatus(input: AegisEngineTransactionStatusInput): Promise<AegisEngineTransactionStatus>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { AegisEngineRestSource } from '../types.js';
|
|
3
|
+
import { type EnginePositionHistoryResponse } from './historySchemas.js';
|
|
4
|
+
import { type EngineHistoryCatalogResponse } from './catalogSchemas.js';
|
|
5
|
+
export { EngineHistoryCatalogResponseSchema as engineHistoryCatalogResponseSchema } from './catalogSchemas.js';
|
|
6
|
+
export { PositionHistoryResponseSchema as enginePositionHistoryResponseSchema } from './historySchemas.js';
|
|
7
|
+
export type AegisEnginePositionHistory = EnginePositionHistoryResponse;
|
|
8
|
+
export type AegisEnginePositionHistoryInput = {
|
|
9
|
+
source: AegisEngineRestSource;
|
|
10
|
+
account: Address;
|
|
11
|
+
chainId: number;
|
|
12
|
+
poolId: Hex;
|
|
13
|
+
window?: '1d' | '7d' | '30d' | 'since-open';
|
|
14
|
+
/** Exclusive older-page boundary returned as coverage.nextBefore. */
|
|
15
|
+
before?: string;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
} & ({
|
|
18
|
+
kind: 'lend_shares';
|
|
19
|
+
vaultId?: never;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'borrow_vault';
|
|
22
|
+
vaultId: string;
|
|
23
|
+
});
|
|
24
|
+
/** One bounded page of actual observations. The consumer retains coverage,
|
|
25
|
+
* missing values and native units; it does not interpolate or sum page PnL. */
|
|
26
|
+
export declare function fetchEnginePositionHistory(input: AegisEnginePositionHistoryInput): Promise<AegisEnginePositionHistory>;
|
|
27
|
+
export type AegisEngineHistoryPositions = EngineHistoryCatalogResponse;
|
|
28
|
+
export type AegisEngineHistoryPositionsInput = {
|
|
29
|
+
source: AegisEngineRestSource;
|
|
30
|
+
account: Address;
|
|
31
|
+
chainId: number;
|
|
32
|
+
limit?: number;
|
|
33
|
+
cursor?: string;
|
|
34
|
+
/** Requires a deployed ownership index; never silently falls back to current owners. */
|
|
35
|
+
ownerScope?: 'current-or-last' | 'ever-owned';
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
};
|
|
38
|
+
/** Includes zero-share lending records and burned vaults at one indexed frame.
|
|
39
|
+
* A catalog entry does not guarantee observed chart points or personal PnL. */
|
|
40
|
+
export declare function fetchEngineHistoryPositions(input: AegisEngineHistoryPositionsInput): Promise<AegisEngineHistoryPositions>;
|