@aegis-engine/core 0.2.0 → 0.3.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 +109 -4
- package/THIRD_PARTY_NOTICES.md +211 -0
- package/dist/actions/kyberSwap.d.ts +3 -2
- package/dist/address.d.ts +3 -1
- package/dist/aegis-core.js +8421 -5279
- package/dist/backendAdapters.d.ts +25 -1
- package/dist/config/constants.d.ts +4 -0
- package/dist/config/types.d.ts +5 -0
- package/dist/contract/backendClient.d.ts +16 -6
- package/dist/contract/generated/aegis-swap.d.ts +2682 -96
- package/dist/contract/schemas.d.ts +27 -20
- package/dist/engine/actions.d.ts +56 -0
- package/dist/engine/borrowCostProjection.d.ts +1 -0
- package/dist/engine/dataSource.d.ts +63 -0
- package/dist/engine/index.d.ts +7 -0
- package/dist/engine/marketAdapter.d.ts +8 -0
- package/dist/engine/quotes.d.ts +8 -0
- package/dist/engine/reads.d.ts +41 -0
- package/dist/engine/registry.d.ts +27 -0
- package/dist/engine/restSchemas.d.ts +409 -0
- package/dist/engine/sdk.d.ts +1 -0
- package/dist/engine/sdkRuntime.d.ts +1 -0
- package/dist/engine/types.d.ts +992 -0
- package/dist/errors.d.ts +10 -0
- package/dist/historicalPrices.d.ts +78 -0
- package/dist/index.d.ts +13 -8
- package/dist/internal/requestSignal.d.ts +9 -0
- package/dist/internal/ttlCache.d.ts +19 -0
- package/dist/metadata.d.ts +4 -0
- package/dist/permit.d.ts +1 -0
- package/dist/quote/aggregatedSwapQuote.d.ts +12 -0
- package/dist/quote/kyberCalldata.d.ts +211 -0
- package/dist/quote.d.ts +1 -0
- package/dist/sdkRuntime-CCRVvSwD.js +16052 -0
- package/dist/services/kyberSwap.d.ts +22 -2
- package/dist/swap/receiptWait.d.ts +17 -0
- package/dist/swap/sendSwapTransaction.d.ts +40 -6
- package/dist/swap/settlement.d.ts +15 -0
- package/dist/transactionProgress.d.ts +8 -1
- package/dist/types/aggregatedSwap.d.ts +18 -0
- package/package.json +15 -7
|
@@ -16,16 +16,16 @@ export declare const aegisBackendMarketStatusSchema: z.ZodEnum<{
|
|
|
16
16
|
enabled: "enabled";
|
|
17
17
|
disabled: "disabled";
|
|
18
18
|
}>;
|
|
19
|
-
export declare const aegisBackendChainIdSchema: z.
|
|
19
|
+
export declare const aegisBackendChainIdSchema: z.ZodLiteral<1 | 130 | 8453>;
|
|
20
20
|
export declare const aegisBackendChainSchema: z.ZodObject<{
|
|
21
|
-
chainId: z.
|
|
21
|
+
chainId: z.ZodNumber;
|
|
22
22
|
slug: z.ZodString;
|
|
23
23
|
name: z.ZodString;
|
|
24
24
|
}, z.core.$strip>;
|
|
25
25
|
export declare const aegisBackendQuoteDefaultsSchema: z.ZodObject<{
|
|
26
|
-
ttlSeconds: z.
|
|
27
|
-
defaultSlippageBps: z.
|
|
28
|
-
maxSlippageBps: z.
|
|
26
|
+
ttlSeconds: z.ZodNumber;
|
|
27
|
+
defaultSlippageBps: z.ZodNumber;
|
|
28
|
+
maxSlippageBps: z.ZodNumber;
|
|
29
29
|
}, z.core.$strip>;
|
|
30
30
|
export declare const aegisBackendContractRegistrySchema: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
31
31
|
export declare const aegisBackendAddressAllowlistSchema: z.ZodObject<{
|
|
@@ -52,13 +52,13 @@ export declare const aegisBackendAllowlistsByChainSchema: z.ZodObject<{
|
|
|
52
52
|
}, z.core.$strip>;
|
|
53
53
|
}, z.core.$strip>;
|
|
54
54
|
export declare const aegisBackendFeeConfigSchema: z.ZodObject<{
|
|
55
|
-
outputFeeBps: z.
|
|
55
|
+
outputFeeBps: z.ZodNumber;
|
|
56
56
|
recipient: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
57
57
|
}, z.core.$strip>;
|
|
58
58
|
export declare const aegisBackendConfigSchema: z.ZodObject<{
|
|
59
59
|
schemaVersion: z.ZodLiteral<"1">;
|
|
60
60
|
chains: z.ZodArray<z.ZodObject<{
|
|
61
|
-
chainId: z.
|
|
61
|
+
chainId: z.ZodNumber;
|
|
62
62
|
slug: z.ZodString;
|
|
63
63
|
name: z.ZodString;
|
|
64
64
|
}, z.core.$strip>>;
|
|
@@ -67,9 +67,9 @@ export declare const aegisBackendConfigSchema: z.ZodObject<{
|
|
|
67
67
|
kyber: "kyber";
|
|
68
68
|
}>>;
|
|
69
69
|
quote: z.ZodObject<{
|
|
70
|
-
ttlSeconds: z.
|
|
71
|
-
defaultSlippageBps: z.
|
|
72
|
-
maxSlippageBps: z.
|
|
70
|
+
ttlSeconds: z.ZodNumber;
|
|
71
|
+
defaultSlippageBps: z.ZodNumber;
|
|
72
|
+
maxSlippageBps: z.ZodNumber;
|
|
73
73
|
}, z.core.$strip>;
|
|
74
74
|
contracts: z.ZodObject<{
|
|
75
75
|
'1': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
@@ -91,13 +91,13 @@ export declare const aegisBackendConfigSchema: z.ZodObject<{
|
|
|
91
91
|
}, z.core.$strip>;
|
|
92
92
|
}, z.core.$strip>;
|
|
93
93
|
fee: z.ZodObject<{
|
|
94
|
-
outputFeeBps: z.
|
|
94
|
+
outputFeeBps: z.ZodNumber;
|
|
95
95
|
recipient: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
96
96
|
}, z.core.$strip>;
|
|
97
97
|
}, z.core.$strip>;
|
|
98
98
|
export declare const aegisBackendTokenSchema: z.ZodObject<{
|
|
99
99
|
id: z.ZodString;
|
|
100
|
-
chainId: z.
|
|
100
|
+
chainId: z.ZodNumber;
|
|
101
101
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
102
102
|
symbol: z.ZodString;
|
|
103
103
|
displayName: z.ZodString;
|
|
@@ -120,8 +120,8 @@ export declare const aegisPoolKeySchema: z.ZodObject<{
|
|
|
120
120
|
hooks: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
121
121
|
}, z.core.$strip>;
|
|
122
122
|
export declare const aegisBackendMarketSchema: z.ZodObject<{
|
|
123
|
-
id: z.ZodString
|
|
124
|
-
chainId: z.
|
|
123
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
124
|
+
chainId: z.ZodNumber;
|
|
125
125
|
status: z.ZodEnum<{
|
|
126
126
|
enabled: "enabled";
|
|
127
127
|
disabled: "disabled";
|
|
@@ -152,7 +152,7 @@ export declare const aegisBackendMarketSchema: z.ZodObject<{
|
|
|
152
152
|
export declare const aegisBackendSwapQuoteRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
153
153
|
mode: z.ZodLiteral<"exactIn">;
|
|
154
154
|
amountIn: z.ZodString;
|
|
155
|
-
chainId: z.
|
|
155
|
+
chainId: z.ZodLiteral<1 | 130 | 8453>;
|
|
156
156
|
provider: z.ZodEnum<{
|
|
157
157
|
"aegis-direct-v4": "aegis-direct-v4";
|
|
158
158
|
kyber: "kyber";
|
|
@@ -165,7 +165,7 @@ export declare const aegisBackendSwapQuoteRequestSchema: z.ZodDiscriminatedUnion
|
|
|
165
165
|
}, z.core.$loose>, z.ZodObject<{
|
|
166
166
|
mode: z.ZodLiteral<"exactOut">;
|
|
167
167
|
amountOut: z.ZodString;
|
|
168
|
-
chainId: z.
|
|
168
|
+
chainId: z.ZodLiteral<1 | 130 | 8453>;
|
|
169
169
|
provider: z.ZodEnum<{
|
|
170
170
|
"aegis-direct-v4": "aegis-direct-v4";
|
|
171
171
|
kyber: "kyber";
|
|
@@ -190,7 +190,7 @@ export declare const aegisBackendSwapQuoteResponseSchema: z.ZodObject<{
|
|
|
190
190
|
price: z.ZodNumber;
|
|
191
191
|
slippageBps: z.ZodNumber;
|
|
192
192
|
fee: z.ZodObject<{
|
|
193
|
-
outputFeeBps: z.
|
|
193
|
+
outputFeeBps: z.ZodNumber;
|
|
194
194
|
recipient: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
195
195
|
}, z.core.$strip>;
|
|
196
196
|
asOf: z.ZodISODateTime;
|
|
@@ -201,7 +201,7 @@ export declare const aegisBackendHealthResponseSchema: z.ZodObject<{
|
|
|
201
201
|
}, z.core.$strip>;
|
|
202
202
|
export declare const aegisBackendTokensResponseSchema: z.ZodArray<z.ZodObject<{
|
|
203
203
|
id: z.ZodString;
|
|
204
|
-
chainId: z.
|
|
204
|
+
chainId: z.ZodNumber;
|
|
205
205
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
206
206
|
symbol: z.ZodString;
|
|
207
207
|
displayName: z.ZodString;
|
|
@@ -212,8 +212,8 @@ export declare const aegisBackendTokensResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
212
212
|
stable: z.ZodBoolean;
|
|
213
213
|
}, z.core.$strip>>;
|
|
214
214
|
export declare const aegisBackendMarketsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
215
|
-
id: z.ZodString
|
|
216
|
-
chainId: z.
|
|
215
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
216
|
+
chainId: z.ZodNumber;
|
|
217
217
|
status: z.ZodEnum<{
|
|
218
218
|
enabled: "enabled";
|
|
219
219
|
disabled: "disabled";
|
|
@@ -241,3 +241,10 @@ export declare const aegisBackendMarketsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
241
241
|
"cap-event": "cap-event";
|
|
242
242
|
}>>;
|
|
243
243
|
}, z.core.$strip>>;
|
|
244
|
+
export declare function refineHistorySeries(value: {
|
|
245
|
+
status: 'ready' | 'warming_up' | 'no_data';
|
|
246
|
+
pointCount: number;
|
|
247
|
+
points: ReadonlyArray<{
|
|
248
|
+
t: number;
|
|
249
|
+
}>;
|
|
250
|
+
}, context: z.RefinementCtx): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { AegisEngineActionCallbacks, AegisEngineApprovalInput, AegisEngineMarket, AegisEnginePositionTarget, AegisEngineSendInput, AegisEngineSignedPermitBatch, AegisEngineTransactionResult } from './types.js';
|
|
3
|
+
export type AegisEnginePositionRouterAuthorizationInput = {
|
|
4
|
+
wallet: AegisEngineSendInput['wallet'];
|
|
5
|
+
publicClient: AegisEngineSendInput['publicClient'];
|
|
6
|
+
activeChain: AegisEngineSendInput['activeChain'];
|
|
7
|
+
market: AegisEngineMarket;
|
|
8
|
+
target: AegisEnginePositionTarget;
|
|
9
|
+
/** Exact ERC-6909 share allowance required for a lender-position action. */
|
|
10
|
+
amount?: bigint;
|
|
11
|
+
onStatus?: AegisEngineActionCallbacks['onStatus'];
|
|
12
|
+
onTxHash?: AegisEngineActionCallbacks['onTxHash'];
|
|
13
|
+
};
|
|
14
|
+
export declare function prepareEnginePermit(args: AegisEngineApprovalInput): Promise<{
|
|
15
|
+
approvalHash: Hex | null;
|
|
16
|
+
permit: AegisEngineSignedPermitBatch | null;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Authorize the trusted Engine router to manage an already-open position.
|
|
20
|
+
*
|
|
21
|
+
* Borrow vaults use a per-vault ERC-721 approval; lender positions use a
|
|
22
|
+
* per-pool, amount-bounded ERC-6909 allowance. The helper deliberately
|
|
23
|
+
* does not accept `onSubmitted`: authorization is a prerequisite transaction,
|
|
24
|
+
* not the host's requested position action.
|
|
25
|
+
*/
|
|
26
|
+
export declare function authorizeEnginePositionRouter(args: AegisEnginePositionRouterAuthorizationInput): Promise<AegisEngineTransactionResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the trusted router may already move this borrow vault — either a
|
|
29
|
+
* per-vault approval or a blanket operator approval. Lets a borrow into an
|
|
30
|
+
* existing vault skip a redundant ERC-721 approval on repeat borrows. Without
|
|
31
|
+
* a `vaultId` (createVault path) only the blanket operator approval can
|
|
32
|
+
* exist, so only that is read.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readEngineVaultRouterApproved(args: {
|
|
35
|
+
publicClient: AegisEngineSendInput['publicClient'];
|
|
36
|
+
market: AegisEngineMarket;
|
|
37
|
+
owner: Address;
|
|
38
|
+
vaultId?: bigint;
|
|
39
|
+
}): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Blanket operator approval for the trusted router on the vault registry.
|
|
42
|
+
* A first borrow (createVault) has no vault to approve per-token, and the
|
|
43
|
+
* SDK's execution evidence for a fresh vault checks `isApprovedForAll` only —
|
|
44
|
+
* this is the only authorization that can satisfy its router gate. Existing
|
|
45
|
+
* vaults should keep the narrower per-vault approval via
|
|
46
|
+
* `authorizeEnginePositionRouter`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function authorizeEngineVaultOperator(args: Omit<AegisEnginePositionRouterAuthorizationInput, 'target' | 'amount'>): Promise<AegisEngineTransactionResult>;
|
|
49
|
+
export declare function sendEngineTransaction(args: AegisEngineSendInput): Promise<AegisEngineTransactionResult>;
|
|
50
|
+
export declare function missingEngineExecutionReason(market: {
|
|
51
|
+
router?: Address;
|
|
52
|
+
permit2?: Address;
|
|
53
|
+
stateView?: Address;
|
|
54
|
+
v4StateView?: Address;
|
|
55
|
+
v4Quoter?: Address;
|
|
56
|
+
}): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { AegisEngineDataSource, AegisEngineHistoryWindow, AegisEngineMarket, AegisEngineMetricHistory, AegisEnginePositionActivitySnapshot, AegisEngineVaultActivityEntry, AegisEnginePositionsSnapshot } from './types.js';
|
|
3
|
+
export declare function clearEngineMarketsCache(): void;
|
|
4
|
+
export declare function clearEngineMarketHistoryCache(): void;
|
|
5
|
+
export declare function clearEnginePositionsCache(): void;
|
|
6
|
+
export declare function clearEnginePositionActivityCache(): void;
|
|
7
|
+
export declare function clearEnginePositionsV2ProbeCache(): void;
|
|
8
|
+
export declare function fetchEngineMarkets(args: {
|
|
9
|
+
source: AegisEngineDataSource;
|
|
10
|
+
chainId: number;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
defaultV4Quoter?: Address;
|
|
13
|
+
}): Promise<AegisEngineMarket[]>;
|
|
14
|
+
export declare function fetchEngineMarketHistory(args: {
|
|
15
|
+
source: AegisEngineDataSource;
|
|
16
|
+
marketId: string;
|
|
17
|
+
window?: AegisEngineHistoryWindow;
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
}): Promise<AegisEngineMetricHistory | null>;
|
|
20
|
+
export declare function fetchEnginePositionsSnapshot(args: {
|
|
21
|
+
source: AegisEngineDataSource;
|
|
22
|
+
chainId: number;
|
|
23
|
+
account: Address;
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
/** Explicit user refresh and post-transaction reconciliation bypass the
|
|
26
|
+
* short display cache; normal tab re-entry does not. */
|
|
27
|
+
force?: boolean;
|
|
28
|
+
}): Promise<AegisEnginePositionsSnapshot>;
|
|
29
|
+
/** Loads the complete account-scoped Engine action ledger. Static sources have
|
|
30
|
+
* no activity plane and return null rather than presenting fixture data as
|
|
31
|
+
* indexed history. */
|
|
32
|
+
export declare function fetchEnginePositionActivitySnapshot(args: {
|
|
33
|
+
source: AegisEngineDataSource;
|
|
34
|
+
chainId: number;
|
|
35
|
+
account: Address;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
/** Explicit refresh and post-transaction reconciliation bypass the cache. */
|
|
38
|
+
force?: boolean;
|
|
39
|
+
}): Promise<AegisEnginePositionActivitySnapshot | null>;
|
|
40
|
+
/** Convenience view for the latest debt/idle transaction of one vault. The
|
|
41
|
+
* full REST ledger remains available through fetchEnginePositionActivitySnapshot. */
|
|
42
|
+
export declare function fetchEngineVaultActivity(args: {
|
|
43
|
+
source: AegisEngineDataSource;
|
|
44
|
+
chainId: number;
|
|
45
|
+
account: Address;
|
|
46
|
+
vaultId: bigint | string;
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
force?: boolean;
|
|
49
|
+
}): Promise<AegisEngineVaultActivityEntry | null>;
|
|
50
|
+
/** Convenience view for the wallet's latest lend transaction in one market.
|
|
51
|
+
* Deposit/withdraw only: share transfers move pool shares between wallets
|
|
52
|
+
* without a token leg, so presenting one as the market's latest transaction
|
|
53
|
+
* would misstate what the wallet last did with tokens. Rides the shared
|
|
54
|
+
* wallet activity snapshot cache — no extra request beyond
|
|
55
|
+
* fetchEnginePositionActivitySnapshot. */
|
|
56
|
+
export declare function fetchEngineLendActivity(args: {
|
|
57
|
+
source: AegisEngineDataSource;
|
|
58
|
+
chainId: number;
|
|
59
|
+
account: Address;
|
|
60
|
+
poolId: string;
|
|
61
|
+
signal?: AbortSignal;
|
|
62
|
+
force?: boolean;
|
|
63
|
+
}): Promise<AegisEngineVaultActivityEntry | null>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { AegisEngineMarket, AegisEngineMarketSource } from './types.js';
|
|
3
|
+
export declare function normalizeEngineMarkets(args: {
|
|
4
|
+
chainId: number;
|
|
5
|
+
markets: readonly unknown[];
|
|
6
|
+
source?: AegisEngineMarketSource;
|
|
7
|
+
defaultV4Quoter?: Address;
|
|
8
|
+
}): AegisEngineMarket[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AegisEngineBorrowCapacity, AegisEngineBorrowCapacityInput, AegisEngineBorrowQuote, AegisEngineBorrowQuoteInput, AegisEngineCloseQuoteInput, AegisEngineDepositQuote, AegisEngineDepositQuoteInput, AegisEngineIdleWithdrawQuoteInput, AegisEnginePositionActionQuote, AegisEngineRedeemQuoteInput, AegisEngineRepayQuoteInput } from './types.js';
|
|
2
|
+
export declare function quoteEngineDeposit(input: AegisEngineDepositQuoteInput): Promise<AegisEngineDepositQuote>;
|
|
3
|
+
export declare function quoteEngineBorrow(input: AegisEngineBorrowQuoteInput): Promise<AegisEngineBorrowQuote>;
|
|
4
|
+
export declare function quoteEngineBorrowCapacity(input: AegisEngineBorrowCapacityInput): Promise<AegisEngineBorrowCapacity>;
|
|
5
|
+
export declare function quoteEngineRepay(input: AegisEngineRepayQuoteInput): Promise<AegisEnginePositionActionQuote>;
|
|
6
|
+
export declare function quoteEngineCloseVault(input: AegisEngineCloseQuoteInput): Promise<AegisEnginePositionActionQuote>;
|
|
7
|
+
export declare function quoteEngineIdleWithdraw(input: AegisEngineIdleWithdrawQuoteInput): Promise<AegisEnginePositionActionQuote>;
|
|
8
|
+
export declare function quoteEngineRedeem(input: AegisEngineRedeemQuoteInput): Promise<AegisEnginePositionActionQuote>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { AegisEngineBorrowQuoteContext, AegisEngineMarket, AegisEngineMarketReadInput, AegisEngineMarketSnapshot, AegisEnginePositionsHydration, AegisEnginePositionsHydrationInput, AegisEngineVaultActivityEntry } from './types.js';
|
|
3
|
+
export declare class AegisEngineMarketNotReadyError extends Error {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
/** Test-only reset for the module-owned, weakly client-scoped read caches. */
|
|
7
|
+
export declare function clearEngineReadCaches(): void;
|
|
8
|
+
export declare function readEngineMarketSnapshot(input: AegisEngineMarketReadInput): Promise<AegisEngineMarketSnapshot>;
|
|
9
|
+
export declare function readEngineBorrowQuoteContext(input: AegisEngineMarketReadInput, execution?: {
|
|
10
|
+
owner: Address;
|
|
11
|
+
vaultId?: bigint;
|
|
12
|
+
}): Promise<AegisEngineBorrowQuoteContext>;
|
|
13
|
+
/**
|
|
14
|
+
* Hydrates REST/subgraph-discovered borrow and lender positions in one
|
|
15
|
+
* block-pinned SDK frame. Results remain one-to-one with the discovery arrays
|
|
16
|
+
* and carry their stable position ids so consumers can merge without relying
|
|
17
|
+
* on list order after the read completes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readEnginePositionsHydration(input: AegisEnginePositionsHydrationInput): Promise<AegisEnginePositionsHydration>;
|
|
20
|
+
/** Classifies one transaction's vault actions into a ledger entry: the shared
|
|
21
|
+
* grammar for turning a group of debt/idle action rows into a
|
|
22
|
+
* {@link AegisEngineVaultActivityEntry}. Public so hosts rendering their own
|
|
23
|
+
* activity list classify transactions the same way core does. */
|
|
24
|
+
export declare function classifyEngineVaultActivity(group: {
|
|
25
|
+
txHash: `0x${string}`;
|
|
26
|
+
timestamp: number;
|
|
27
|
+
debt: readonly {
|
|
28
|
+
principalDeltaActual: bigint;
|
|
29
|
+
}[];
|
|
30
|
+
idle: readonly {
|
|
31
|
+
deltaAmount0: bigint;
|
|
32
|
+
deltaAmount1: bigint;
|
|
33
|
+
}[];
|
|
34
|
+
}): AegisEngineVaultActivityEntry;
|
|
35
|
+
/** Latest transaction that touched a vault, from the public Engine subgraph.
|
|
36
|
+
* Read-only and wallet-free; returns null for an untraceable vault (no
|
|
37
|
+
* trusted deployment, empty ledger, or subgraph outage — callers degrade). */
|
|
38
|
+
export declare function readEngineVaultActivity(input: {
|
|
39
|
+
market: AegisEngineMarket;
|
|
40
|
+
vaultId: bigint;
|
|
41
|
+
}): Promise<AegisEngineVaultActivityEntry | null>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { AegisEngineVersion } from './types.js';
|
|
3
|
+
/** Engine hard utilization cap as a percentage of supplied liquidity.
|
|
4
|
+
* Mirrors the SDK's UTILIZATION_CAP_PIPS (950_000/1_000_000), inlined so
|
|
5
|
+
* sync widget code can read cap state off REST `utilizationPct` without
|
|
6
|
+
* loading the SDK. Drift-guarded by engineRegistry.test.ts. */
|
|
7
|
+
export declare const ENGINE_UTILIZATION_CAP_PCT = 95;
|
|
8
|
+
export type AegisEngineChainAddresses = {
|
|
9
|
+
aegisEngine: Address;
|
|
10
|
+
aegisHook: Address;
|
|
11
|
+
aegisRouterV1: Address;
|
|
12
|
+
aegisStateView: Address;
|
|
13
|
+
vaultRegistry: Address;
|
|
14
|
+
variableInterestRate: Address;
|
|
15
|
+
oracleManager: Address;
|
|
16
|
+
limitOrderManager: Address;
|
|
17
|
+
dynamicFeeManager: Address;
|
|
18
|
+
poolManager: Address;
|
|
19
|
+
positionManager: Address;
|
|
20
|
+
stateView: Address;
|
|
21
|
+
uniswapV4Quoter: Address;
|
|
22
|
+
permit2: Address;
|
|
23
|
+
weth9: Address;
|
|
24
|
+
};
|
|
25
|
+
export declare function trustedEngineVersionForChain(chainId: number): AegisEngineVersion | null;
|
|
26
|
+
export declare function trustedEngineRegistryForChain(chainId: number): AegisEngineChainAddresses | null;
|
|
27
|
+
export declare function engineRouterForChain(chainId: number): Address;
|