@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
|
@@ -31,10 +31,12 @@ export type AegisBackendChainOptions = {
|
|
|
31
31
|
export declare function backendTokenToAegisSwapToken(token: AegisBackendToken): AegisSwapToken;
|
|
32
32
|
export declare function backendTokensToAegisSwapTokens(tokens: readonly AegisBackendToken[]): AegisSwapToken[];
|
|
33
33
|
export declare function createAegisSwapChainsFromBackendConfig(config: AegisBackendConfig, hostChains?: Partial<Record<number, AegisSwapChainConfigInput>>, options?: AegisBackendChainOptions): Record<number, AegisSwapChainConfig>;
|
|
34
|
-
export declare function createAegisSwapPoolsFromBackendMarkets({ config, markets, tokens, enabledOnly, onSkip }: {
|
|
34
|
+
export declare function createAegisSwapPoolsFromBackendMarkets({ config, markets, tokens, trustedPools, enabledOnly, onSkip }: {
|
|
35
35
|
config: AegisBackendConfig;
|
|
36
36
|
markets: readonly AegisBackendMarket[];
|
|
37
37
|
tokens: readonly AegisBackendToken[];
|
|
38
|
+
/** SDK/host-shipped catalogue. Backend discovery can only activate these pools. */
|
|
39
|
+
trustedPools?: readonly AegisSwapPoolConfig[];
|
|
38
40
|
enabledOnly?: boolean;
|
|
39
41
|
/** Structured diagnostics for every market the adapter drops. */
|
|
40
42
|
onSkip?: AegisBackendAdapterSkipHandler;
|
package/dist/config/chains.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type Hex } from 'viem';
|
|
|
2
2
|
import type { AegisSwapChainConfig, AegisSwapChainConfigInput } from './types.js';
|
|
3
3
|
export declare function getExplorerUrl(hash: Hex, chain: AegisSwapChainConfig): string;
|
|
4
4
|
export declare const AEGIS_SWAP_MAINNET_CHAIN: AegisSwapChainConfig;
|
|
5
|
+
export declare const AEGIS_SWAP_BSC_CHAIN: AegisSwapChainConfig;
|
|
5
6
|
export declare const AEGIS_SWAP_CHAINS: Record<number, AegisSwapChainConfig>;
|
|
6
7
|
export declare function createAegisSwapChainConfig(input: AegisSwapChainConfigInput & {
|
|
7
8
|
chainId: number;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { type Address } from 'viem';
|
|
2
2
|
export declare const AEGIS_SWAP_CHAIN_ID = 1;
|
|
3
|
+
export declare const AEGIS_SWAP_BSC_CHAIN_ID = 56;
|
|
3
4
|
export declare const AEGIS_SWAP_ROUTER: `0x${string}`;
|
|
5
|
+
export declare const AEGIS_SWAP_BSC_ROUTER: `0x${string}`;
|
|
4
6
|
export declare const AEGIS_SWAP_TRUSTED_ROUTERS_BY_CHAIN: Partial<Record<number, readonly Address[]>>;
|
|
5
7
|
export declare const AEGIS_SWAP_HOOK: `0x${string}`;
|
|
8
|
+
export declare const AEGIS_SWAP_BSC_HOOK: `0x${string}`;
|
|
6
9
|
export declare const AEGIS_DYNAMIC_FEE_FLAG = 8388608;
|
|
7
10
|
export declare const AEGIS_SWAP_DEFAULT_FEE_BPS = 50;
|
|
8
11
|
export declare const AEGIS_SWAP_DEFAULT_FEE_RECIPIENT: `0x${string}`;
|
|
9
12
|
export declare const AEGIS_SWAP_DEFAULT_RPC_URLS: string[];
|
|
13
|
+
export declare const AEGIS_SWAP_BSC_RPC_URLS: string[];
|
|
10
14
|
export declare const AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT = "https://aegis.markets/graphql/meta";
|
|
11
15
|
export declare const AGGREGATED_SWAP_FEE_BPS = 50;
|
|
12
16
|
export declare const AGGREGATED_SWAP_FEE_RECIPIENT: `0x${string}`;
|
package/dist/config/tokens.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { AegisSwapBuiltInTokenSymbol, AegisSwapToken, AggregatedSwapDefaultTokenSymbol, AggregatedSwapToken, AggregatedSwapWolfGameTokenSymbol } from './types.js';
|
|
1
|
+
import type { AegisSwapBscTokenSymbol, AegisSwapBuiltInTokenSymbol, AegisSwapToken, AggregatedSwapDefaultTokenSymbol, AggregatedSwapToken, AggregatedSwapWolfGameTokenSymbol } from './types.js';
|
|
2
2
|
export declare const AEGIS_SWAP_TOKENS: Record<AegisSwapBuiltInTokenSymbol, AegisSwapToken>;
|
|
3
|
+
export declare const AEGIS_SWAP_BSC_TOKENS: Record<AegisSwapBscTokenSymbol, AegisSwapToken>;
|
|
3
4
|
export declare const AGGREGATED_SWAP_DEFAULT_TOKENS: Record<AggregatedSwapDefaultTokenSymbol, AggregatedSwapToken>;
|
|
4
5
|
export declare const AGGREGATED_SWAP_WOLFGAME_TOKENS: Record<AggregatedSwapWolfGameTokenSymbol, AggregatedSwapToken>;
|
|
5
6
|
export declare const AGGREGATED_SWAP_DEFAULT_TOKEN_LIST: AegisSwapToken[];
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Address, Chain, Hex } from 'viem';
|
|
2
2
|
export type AegisSwapBuiltInTokenSymbol = 'USDC' | 'WATER' | 'WOOD' | 'GRASS' | 'STONE';
|
|
3
|
+
export type AegisSwapBscTokenSymbol = 'BNB' | 'BNCB' | 'QQQB' | 'NVDAB' | 'USDC';
|
|
3
4
|
export type AegisSwapTokenSymbol = string;
|
|
4
5
|
export type AegisSwapFeeConfig = {
|
|
5
6
|
bps: number;
|
|
@@ -17,6 +18,13 @@ export type AegisSwapToken = {
|
|
|
17
18
|
priceUsd?: number;
|
|
18
19
|
/** Marks a USD-pegged stablecoin (from the backend); presentational only. */
|
|
19
20
|
stable?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Some legacy ERC-20 implementations (notably Ethereum USDT) require
|
|
23
|
+
* approve(0) before replacing a non-zero allowance. Leave this false/absent
|
|
24
|
+
* for ordinary tokens: a finite allowance alone is not evidence that a reset
|
|
25
|
+
* transaction is required.
|
|
26
|
+
*/
|
|
27
|
+
requiresApprovalReset?: boolean;
|
|
20
28
|
};
|
|
21
29
|
export type AegisPoolKey = {
|
|
22
30
|
currency0: Address;
|
|
@@ -81,10 +81,12 @@ export declare class AegisBackendApiError extends Error {
|
|
|
81
81
|
readonly status: number;
|
|
82
82
|
readonly statusText: string;
|
|
83
83
|
readonly body: unknown;
|
|
84
|
-
|
|
84
|
+
readonly retryAfterSeconds: number | null;
|
|
85
|
+
constructor({ status, statusText, body, retryAfterSeconds }: {
|
|
85
86
|
status: number;
|
|
86
87
|
statusText: string;
|
|
87
88
|
body: unknown;
|
|
89
|
+
retryAfterSeconds?: number | null;
|
|
88
90
|
});
|
|
89
91
|
}
|
|
90
92
|
export declare class AegisBackendContractError extends Error {
|