@aegis-engine/core 0.7.0 → 0.8.1
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 +9657 -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 +132 -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-BLOOWtPv.js} +3644 -3155
- 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
package/dist/contract/index.d.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class AegisResponseBodyTooLargeError extends Error {
|
|
2
|
+
readonly resource: string;
|
|
3
|
+
readonly maximumBytes: number;
|
|
4
|
+
constructor(resource: string, maximumBytes: number);
|
|
5
|
+
}
|
|
6
|
+
/** Returns an equivalent response whose body was bounded before JSON parsing. */
|
|
7
|
+
export declare function bufferBoundedResponse(response: Response, maximumBytes: number, resource: string): Promise<Response>;
|
|
8
|
+
/** Reads JSON only after both declared and streamed byte budgets pass. */
|
|
9
|
+
export declare function readBoundedJson(response: Response, maximumBytes: number, resource: string): Promise<unknown>;
|
|
@@ -16,7 +16,7 @@ export declare const aegisBackendMarketStatusSchema: z.ZodEnum<{
|
|
|
16
16
|
enabled: "enabled";
|
|
17
17
|
disabled: "disabled";
|
|
18
18
|
}>;
|
|
19
|
-
export declare const aegisBackendChainIdSchema: z.ZodLiteral<1 | 130 | 8453>;
|
|
19
|
+
export declare const aegisBackendChainIdSchema: z.ZodLiteral<1 | 56 | 130 | 8453>;
|
|
20
20
|
export declare const aegisBackendChainSchema: z.ZodObject<{
|
|
21
21
|
chainId: z.ZodNumber;
|
|
22
22
|
slug: z.ZodString;
|
|
@@ -34,6 +34,7 @@ export declare const aegisBackendAddressAllowlistSchema: z.ZodObject<{
|
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
export declare const aegisBackendContractsByChainSchema: z.ZodObject<{
|
|
36
36
|
'1': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
37
|
+
'56': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
37
38
|
'130': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
38
39
|
'8453': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
39
40
|
}, z.core.$strip>;
|
|
@@ -42,6 +43,10 @@ export declare const aegisBackendAllowlistsByChainSchema: z.ZodObject<{
|
|
|
42
43
|
routers: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
43
44
|
spenders: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
44
45
|
}, z.core.$strip>;
|
|
46
|
+
'56': z.ZodObject<{
|
|
47
|
+
routers: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
48
|
+
spenders: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
45
50
|
'130': z.ZodObject<{
|
|
46
51
|
routers: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
47
52
|
spenders: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
@@ -73,6 +78,7 @@ export declare const aegisBackendConfigSchema: z.ZodObject<{
|
|
|
73
78
|
}, z.core.$strip>;
|
|
74
79
|
contracts: z.ZodObject<{
|
|
75
80
|
'1': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
81
|
+
'56': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
76
82
|
'130': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
77
83
|
'8453': z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
78
84
|
}, z.core.$strip>;
|
|
@@ -81,6 +87,10 @@ export declare const aegisBackendConfigSchema: z.ZodObject<{
|
|
|
81
87
|
routers: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
82
88
|
spenders: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
83
89
|
}, z.core.$strip>;
|
|
90
|
+
'56': z.ZodObject<{
|
|
91
|
+
routers: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
92
|
+
spenders: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
84
94
|
'130': z.ZodObject<{
|
|
85
95
|
routers: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
86
96
|
spenders: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
@@ -152,7 +162,7 @@ export declare const aegisBackendMarketSchema: z.ZodObject<{
|
|
|
152
162
|
export declare const aegisBackendSwapQuoteRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
153
163
|
mode: z.ZodLiteral<"exactIn">;
|
|
154
164
|
amountIn: z.ZodString;
|
|
155
|
-
chainId: z.ZodLiteral<1 | 130 | 8453>;
|
|
165
|
+
chainId: z.ZodLiteral<1 | 56 | 130 | 8453>;
|
|
156
166
|
provider: z.ZodEnum<{
|
|
157
167
|
"aegis-direct-v4": "aegis-direct-v4";
|
|
158
168
|
kyber: "kyber";
|
|
@@ -165,7 +175,7 @@ export declare const aegisBackendSwapQuoteRequestSchema: z.ZodDiscriminatedUnion
|
|
|
165
175
|
}, z.core.$loose>, z.ZodObject<{
|
|
166
176
|
mode: z.ZodLiteral<"exactOut">;
|
|
167
177
|
amountOut: z.ZodString;
|
|
168
|
-
chainId: z.ZodLiteral<1 | 130 | 8453>;
|
|
178
|
+
chainId: z.ZodLiteral<1 | 56 | 130 | 8453>;
|
|
169
179
|
provider: z.ZodEnum<{
|
|
170
180
|
"aegis-direct-v4": "aegis-direct-v4";
|
|
171
181
|
kyber: "kyber";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { AegisEngineRestSource } from '../types.js';
|
|
4
|
+
import { AccountingResponseSchema } from './accountingSchemas.js';
|
|
5
|
+
export type AegisEnginePositionAccounting = z.infer<typeof AccountingResponseSchema>;
|
|
6
|
+
export type AegisEngineAccountingRecord = AegisEnginePositionAccounting['page']['records'][number];
|
|
7
|
+
export type AegisEnginePositionAccountingInput = {
|
|
8
|
+
source: AegisEngineRestSource;
|
|
9
|
+
account: Address;
|
|
10
|
+
chainId: number;
|
|
11
|
+
poolId: Hex;
|
|
12
|
+
/** Use only nextCursor from this position's preceding response. */
|
|
13
|
+
cursor?: string;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
} & ({
|
|
16
|
+
kind: 'lend_shares';
|
|
17
|
+
vaultId?: never;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'borrow_vault';
|
|
20
|
+
vaultId: string;
|
|
21
|
+
});
|
|
22
|
+
/** One immutable evidence page. No chart interpolation, source replay, polling
|
|
23
|
+
* or inference of financial completeness from receipt/history availability. */
|
|
24
|
+
export declare function fetchEnginePositionAccounting(input: AegisEnginePositionAccountingInput): Promise<AegisEnginePositionAccounting>;
|