@aegis-engine/core 0.7.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 +215 -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 +8 -1
- package/dist/actions/kyberSwap.d.ts +1 -0
- package/dist/actions/types.d.ts +2 -0
- package/dist/actions/wallet.d.ts +1 -0
- package/dist/aegis-core.js +9654 -205
- 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 +8 -3
- package/dist/engine/adaptiveFee.d.ts +14 -0
- package/dist/engine/balancedLending.d.ts +82 -0
- package/dist/engine/dataSource.d.ts +2 -0
- package/dist/engine/index.d.ts +19 -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 +128 -14
- package/dist/engine/v4Quote.d.ts +5 -0
- package/dist/index.d.ts +11 -7
- package/dist/internal/guardedWalletTransaction.d.ts +31 -0
- package/dist/permit.d.ts +80 -7
- package/dist/quote/aggregatedSwapQuote.d.ts +5 -1
- package/dist/quote/kyberCalldata.d.ts +5 -1
- package/dist/{sdkRuntime-BE3ZMb5o.js → sdkRuntime-3aRt_g55.js} +3385 -2958
- 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/trustedMarket.d.ts +25 -0
- package/dist/transactionHistory-1Zl2KCcV.js +5915 -0
- package/dist/wallet.d.ts +4 -0
- package/package.json +12 -5
- package/dist/index-DofKgro2.js +0 -11201
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EngineLowerAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
3
|
+
export declare const EngineLowerHashSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
4
|
+
export declare const PositionHistoryPointSchema: z.ZodObject<{
|
|
5
|
+
observedAt: z.ZodString;
|
|
6
|
+
bucketStartedAt: z.ZodString;
|
|
7
|
+
frame: z.ZodObject<{
|
|
8
|
+
blockNumber: z.ZodString;
|
|
9
|
+
blockHash: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
10
|
+
blockTimestamp: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
shareBalanceRaw: z.ZodNullable<z.ZodString>;
|
|
13
|
+
principalRlRaw: z.ZodNullable<z.ZodString>;
|
|
14
|
+
idle: z.ZodNullable<z.ZodObject<{
|
|
15
|
+
amount0Raw: z.ZodString;
|
|
16
|
+
amount1Raw: z.ZodString;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
nftCount: z.ZodNullable<z.ZodNumber>;
|
|
19
|
+
supplyLWad: z.ZodObject<{
|
|
20
|
+
value: z.ZodNullable<z.ZodString>;
|
|
21
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
debtLWad: z.ZodObject<{
|
|
24
|
+
value: z.ZodNullable<z.ZodString>;
|
|
25
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
assetsQuoteToken1Raw: z.ZodObject<{
|
|
28
|
+
value: z.ZodNullable<z.ZodString>;
|
|
29
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
debtQuoteToken1Raw: z.ZodObject<{
|
|
32
|
+
value: z.ZodNullable<z.ZodString>;
|
|
33
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
equityQuoteToken1Raw: z.ZodObject<{
|
|
36
|
+
value: z.ZodNullable<z.ZodString>;
|
|
37
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
supplyUsd: z.ZodNullable<z.ZodString>;
|
|
40
|
+
debtUsd: z.ZodNullable<z.ZodString>;
|
|
41
|
+
equityUsd: z.ZodNullable<z.ZodString>;
|
|
42
|
+
token0Price: z.ZodObject<{
|
|
43
|
+
priceUsd: z.ZodNullable<z.ZodString>;
|
|
44
|
+
status: z.ZodEnum<{
|
|
45
|
+
unavailable: "unavailable";
|
|
46
|
+
observed: "observed";
|
|
47
|
+
assumed: "assumed";
|
|
48
|
+
}>;
|
|
49
|
+
source: z.ZodNullable<z.ZodString>;
|
|
50
|
+
effectiveObservedAt: z.ZodNullable<z.ZodString>;
|
|
51
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
52
|
+
assumptions: z.ZodArray<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
token1Price: z.ZodObject<{
|
|
55
|
+
priceUsd: z.ZodNullable<z.ZodString>;
|
|
56
|
+
status: z.ZodEnum<{
|
|
57
|
+
unavailable: "unavailable";
|
|
58
|
+
observed: "observed";
|
|
59
|
+
assumed: "assumed";
|
|
60
|
+
}>;
|
|
61
|
+
source: z.ZodNullable<z.ZodString>;
|
|
62
|
+
effectiveObservedAt: z.ZodNullable<z.ZodString>;
|
|
63
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
64
|
+
assumptions: z.ZodArray<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type EnginePositionHistoryPoint = z.infer<typeof PositionHistoryPointSchema>;
|
|
69
|
+
export declare const PositionHistoryResponseSchema: z.ZodObject<{
|
|
70
|
+
schemaVersion: z.ZodLiteral<"1">;
|
|
71
|
+
modelVersion: z.ZodLiteral<"engine-position-history-v1">;
|
|
72
|
+
position: z.ZodObject<{
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
kind: z.ZodEnum<{
|
|
75
|
+
lend_shares: "lend_shares";
|
|
76
|
+
borrow_vault: "borrow_vault";
|
|
77
|
+
}>;
|
|
78
|
+
chainId: z.ZodNumber;
|
|
79
|
+
account: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
80
|
+
engine: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
81
|
+
poolId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
82
|
+
vaultId: z.ZodNullable<z.ZodString>;
|
|
83
|
+
scope: z.ZodEnum<{
|
|
84
|
+
"account-lending": "account-lending";
|
|
85
|
+
"vault-lifetime": "vault-lifetime";
|
|
86
|
+
}>;
|
|
87
|
+
indexedOwner: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
88
|
+
createdOwner: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
89
|
+
burned: z.ZodNullable<z.ZodBoolean>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
requested: z.ZodObject<{
|
|
92
|
+
window: z.ZodEnum<{
|
|
93
|
+
"7d": "7d";
|
|
94
|
+
"30d": "30d";
|
|
95
|
+
"1d": "1d";
|
|
96
|
+
"since-open": "since-open";
|
|
97
|
+
}>;
|
|
98
|
+
from: z.ZodNullable<z.ZodString>;
|
|
99
|
+
to: z.ZodString;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
sampling: z.ZodObject<{
|
|
102
|
+
resolutionSeconds: z.ZodUnion<readonly [z.ZodLiteral<3600>, z.ZodLiteral<86400>]>;
|
|
103
|
+
semantics: z.ZodLiteral<"first-observation-in-bucket">;
|
|
104
|
+
interpolation: z.ZodLiteral<"none">;
|
|
105
|
+
canonicality: z.ZodLiteral<"checked-by-writer-at-capture">;
|
|
106
|
+
finality: z.ZodLiteral<"not-a-finality-verdict">;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
coverage: z.ZodObject<{
|
|
109
|
+
status: z.ZodEnum<{
|
|
110
|
+
unavailable: "unavailable";
|
|
111
|
+
partial: "partial";
|
|
112
|
+
complete: "complete";
|
|
113
|
+
}>;
|
|
114
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
115
|
+
from: z.ZodNullable<z.ZodString>;
|
|
116
|
+
to: z.ZodNullable<z.ZodString>;
|
|
117
|
+
pointCount: z.ZodNumber;
|
|
118
|
+
gapCount: z.ZodNumber;
|
|
119
|
+
ledgerComplete: z.ZodBoolean;
|
|
120
|
+
ledgerEventCount: z.ZodNumber;
|
|
121
|
+
ledgerFrame: z.ZodNullable<z.ZodObject<{
|
|
122
|
+
blockNumber: z.ZodNumber;
|
|
123
|
+
blockHash: z.ZodString;
|
|
124
|
+
blockTimestamp: z.ZodNumber;
|
|
125
|
+
deployment: z.ZodString;
|
|
126
|
+
}, z.core.$strict>>;
|
|
127
|
+
anchorEvidence: z.ZodEnum<{
|
|
128
|
+
unavailable: "unavailable";
|
|
129
|
+
"rpc-verified": "rpc-verified";
|
|
130
|
+
"indexed-terminal": "indexed-terminal";
|
|
131
|
+
}>;
|
|
132
|
+
markersTruncated: z.ZodBoolean;
|
|
133
|
+
nextBefore: z.ZodNullable<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
currency: z.ZodObject<{
|
|
136
|
+
token0: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
137
|
+
token1: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
138
|
+
decimals0: z.ZodNullable<z.ZodNumber>;
|
|
139
|
+
decimals1: z.ZodNullable<z.ZodNumber>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
performance: z.ZodObject<{
|
|
142
|
+
basis: z.ZodEnum<{
|
|
143
|
+
"native-net-supply-growth": "native-net-supply-growth";
|
|
144
|
+
"native-borrow-index-accrual": "native-borrow-index-accrual";
|
|
145
|
+
}>;
|
|
146
|
+
from: z.ZodNullable<z.ZodString>;
|
|
147
|
+
to: z.ZodNullable<z.ZodString>;
|
|
148
|
+
netSupplyGrowthLWad: z.ZodObject<{
|
|
149
|
+
value: z.ZodNullable<z.ZodString>;
|
|
150
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
borrowInterestLWad: z.ZodObject<{
|
|
153
|
+
value: z.ZodNullable<z.ZodString>;
|
|
154
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
historicalUsdPnl: z.ZodObject<{
|
|
157
|
+
value: z.ZodNullable<z.ZodString>;
|
|
158
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
includesGas: z.ZodLiteral<false>;
|
|
161
|
+
includesExecutionFees: z.ZodLiteral<false>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
points: z.ZodArray<z.ZodObject<{
|
|
164
|
+
observedAt: z.ZodString;
|
|
165
|
+
bucketStartedAt: z.ZodString;
|
|
166
|
+
frame: z.ZodObject<{
|
|
167
|
+
blockNumber: z.ZodString;
|
|
168
|
+
blockHash: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
169
|
+
blockTimestamp: z.ZodNumber;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
shareBalanceRaw: z.ZodNullable<z.ZodString>;
|
|
172
|
+
principalRlRaw: z.ZodNullable<z.ZodString>;
|
|
173
|
+
idle: z.ZodNullable<z.ZodObject<{
|
|
174
|
+
amount0Raw: z.ZodString;
|
|
175
|
+
amount1Raw: z.ZodString;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
nftCount: z.ZodNullable<z.ZodNumber>;
|
|
178
|
+
supplyLWad: z.ZodObject<{
|
|
179
|
+
value: z.ZodNullable<z.ZodString>;
|
|
180
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
debtLWad: z.ZodObject<{
|
|
183
|
+
value: z.ZodNullable<z.ZodString>;
|
|
184
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
assetsQuoteToken1Raw: z.ZodObject<{
|
|
187
|
+
value: z.ZodNullable<z.ZodString>;
|
|
188
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
debtQuoteToken1Raw: z.ZodObject<{
|
|
191
|
+
value: z.ZodNullable<z.ZodString>;
|
|
192
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
equityQuoteToken1Raw: z.ZodObject<{
|
|
195
|
+
value: z.ZodNullable<z.ZodString>;
|
|
196
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
supplyUsd: z.ZodNullable<z.ZodString>;
|
|
199
|
+
debtUsd: z.ZodNullable<z.ZodString>;
|
|
200
|
+
equityUsd: z.ZodNullable<z.ZodString>;
|
|
201
|
+
token0Price: z.ZodObject<{
|
|
202
|
+
priceUsd: z.ZodNullable<z.ZodString>;
|
|
203
|
+
status: z.ZodEnum<{
|
|
204
|
+
unavailable: "unavailable";
|
|
205
|
+
observed: "observed";
|
|
206
|
+
assumed: "assumed";
|
|
207
|
+
}>;
|
|
208
|
+
source: z.ZodNullable<z.ZodString>;
|
|
209
|
+
effectiveObservedAt: z.ZodNullable<z.ZodString>;
|
|
210
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
211
|
+
assumptions: z.ZodArray<z.ZodString>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
token1Price: z.ZodObject<{
|
|
214
|
+
priceUsd: z.ZodNullable<z.ZodString>;
|
|
215
|
+
status: z.ZodEnum<{
|
|
216
|
+
unavailable: "unavailable";
|
|
217
|
+
observed: "observed";
|
|
218
|
+
assumed: "assumed";
|
|
219
|
+
}>;
|
|
220
|
+
source: z.ZodNullable<z.ZodString>;
|
|
221
|
+
effectiveObservedAt: z.ZodNullable<z.ZodString>;
|
|
222
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
223
|
+
assumptions: z.ZodArray<z.ZodString>;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
226
|
+
}, z.core.$strip>>;
|
|
227
|
+
markers: z.ZodArray<z.ZodObject<{
|
|
228
|
+
id: z.ZodString;
|
|
229
|
+
kind: z.ZodString;
|
|
230
|
+
blockNumber: z.ZodString;
|
|
231
|
+
transactionHash: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
232
|
+
logIndex: z.ZodNumber;
|
|
233
|
+
observedAt: z.ZodString;
|
|
234
|
+
deltaIdle0Raw: z.ZodString;
|
|
235
|
+
deltaIdle1Raw: z.ZodString;
|
|
236
|
+
deltaPrincipalRlRaw: z.ZodString;
|
|
237
|
+
deltaSharesRaw: z.ZodString;
|
|
238
|
+
externalCapital: z.ZodEnum<{
|
|
239
|
+
unsupported: "unsupported";
|
|
240
|
+
"not-applicable": "not-applicable";
|
|
241
|
+
known: "known";
|
|
242
|
+
internal: "internal";
|
|
243
|
+
}>;
|
|
244
|
+
referencePrice: z.ZodNullable<z.ZodObject<{
|
|
245
|
+
basis: z.ZodLiteral<"debt-action-token-ratio">;
|
|
246
|
+
numeratorRaw: z.ZodString;
|
|
247
|
+
denominatorRaw: z.ZodString;
|
|
248
|
+
}, z.core.$strip>>;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
export type EnginePositionHistoryResponse = z.infer<typeof PositionHistoryResponseSchema>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AegisEngineMarket, AegisEnginePositionsHydration, AegisEnginePositionsSnapshot, AegisEnginePositionTarget } from '../types.js';
|
|
2
|
+
import type { AegisEnginePortfolioPosition } from './types.js';
|
|
3
|
+
/** Adapts the account API identity to the existing live position manager.
|
|
4
|
+
* A server snapshot alone never establishes current ownership or action readiness. */
|
|
5
|
+
export declare function resolveEngineAccountPositionTarget({ position, account, chainId, markets, snapshot, hydration, now }: {
|
|
6
|
+
position: AegisEnginePortfolioPosition;
|
|
7
|
+
account: string;
|
|
8
|
+
chainId: number;
|
|
9
|
+
markets: readonly AegisEngineMarket[];
|
|
10
|
+
snapshot: AegisEnginePositionsSnapshot | null;
|
|
11
|
+
hydration: AegisEnginePositionsHydration | null;
|
|
12
|
+
now?: number;
|
|
13
|
+
}): AegisEnginePositionTarget | null;
|