@aegis-engine/core 0.1.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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/abis.d.ts +205 -0
- package/dist/actions/directPoolSwap.d.ts +39 -0
- package/dist/actions/kyberSwap.d.ts +38 -0
- package/dist/actions/types.d.ts +17 -0
- package/dist/actions/wallet.d.ts +17 -0
- package/dist/address.d.ts +5 -0
- package/dist/aegis-core.js +2043 -0
- package/dist/config.d.ts +119 -0
- package/dist/encoding.d.ts +57 -0
- package/dist/errors.d.ts +3 -0
- package/dist/index.d.ts +28 -0
- package/dist/metadata.d.ts +25 -0
- package/dist/permit.d.ts +70 -0
- package/dist/polling.d.ts +3 -0
- package/dist/quote/aggregatedSwapQuote.d.ts +5 -0
- package/dist/quote.d.ts +59 -0
- package/dist/services/kyberSwap.d.ts +84 -0
- package/dist/swap/authorizePermit.d.ts +29 -0
- package/dist/swap/executeSwapTransaction.d.ts +38 -0
- package/dist/swap/gas.d.ts +8 -0
- package/dist/swap/types.d.ts +28 -0
- package/dist/transactionProgress.d.ts +55 -0
- package/dist/types/aggregatedSwap.d.ts +29 -0
- package/dist/wallet.d.ts +34 -0
- package/package.json +38 -0
package/dist/wallet.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Address, type Chain, type PublicClient } from 'viem';
|
|
2
|
+
export type Eip1193Provider = {
|
|
3
|
+
request<T = unknown>(args: {
|
|
4
|
+
method: string;
|
|
5
|
+
params?: unknown[] | Record<string, unknown>;
|
|
6
|
+
}): Promise<T>;
|
|
7
|
+
};
|
|
8
|
+
export type ProviderChainConfig = {
|
|
9
|
+
chainId: number;
|
|
10
|
+
name?: string;
|
|
11
|
+
rpcUrls?: string[];
|
|
12
|
+
chain?: Pick<Chain, 'name' | 'nativeCurrency' | 'rpcUrls' | 'blockExplorers'>;
|
|
13
|
+
};
|
|
14
|
+
export type AegisSwapProviderResolver = () => Eip1193Provider | null | Promise<Eip1193Provider | null>;
|
|
15
|
+
export type AegisSwapWalletConnection = Eip1193Provider | {
|
|
16
|
+
provider?: Eip1193Provider | null;
|
|
17
|
+
account?: Address | string | null;
|
|
18
|
+
} | null;
|
|
19
|
+
export declare function getInjectedProvider(): Eip1193Provider | null;
|
|
20
|
+
export declare function normalizeAccount(value: unknown): Address | null;
|
|
21
|
+
export declare function isEip1193Provider(value: unknown): value is Eip1193Provider;
|
|
22
|
+
export declare function normalizeWalletConnection(connection: AegisSwapWalletConnection | void): {
|
|
23
|
+
provider: Eip1193Provider | null;
|
|
24
|
+
account: Address | null;
|
|
25
|
+
};
|
|
26
|
+
export declare function getProviderAccount(provider: Eip1193Provider): Promise<Address | null>;
|
|
27
|
+
export declare function requestProviderAccount(provider: Eip1193Provider): Promise<Address | null>;
|
|
28
|
+
export declare function getProviderChainId(provider: Eip1193Provider): Promise<number | null>;
|
|
29
|
+
export declare function switchProviderChain(provider: Eip1193Provider, chain: number | ProviderChainConfig): Promise<void>;
|
|
30
|
+
export declare function createSwapPublicClient(chain: Chain, rpcUrls: readonly string[]): PublicClient;
|
|
31
|
+
export declare function subscribeProvider(provider: Eip1193Provider, handlers: {
|
|
32
|
+
onAccountsChanged?: () => void;
|
|
33
|
+
onChainChanged?: () => void;
|
|
34
|
+
}): () => void;
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aegis-engine/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React-free Aegis swap operations for direct Uniswap v4 pools and KyberSwap routes.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/aegis-core.js",
|
|
8
|
+
"module": "./dist/aegis-core.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/aegis-core.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|
|
23
|
+
"typecheck:test": "tsc -p tsconfig.test.json --noEmit",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
26
|
+
"prepack": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"viem": "^2"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^25.9.1",
|
|
33
|
+
"typescript": "~5.6.2",
|
|
34
|
+
"viem": "^2.52.0",
|
|
35
|
+
"vite": "^6.0.1",
|
|
36
|
+
"vitest": "^4.1.8"
|
|
37
|
+
}
|
|
38
|
+
}
|