@ring-protocol/universal-router-sdk 0.1.8 → 0.1.9
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/dist/entities/Command.d.ts +12 -0
- package/dist/entities/actions/index.d.ts +2 -0
- package/dist/entities/actions/uniswap.d.ts +31 -0
- package/dist/entities/actions/unwrapWETH.d.ts +12 -0
- package/dist/entities/index.d.ts +2 -0
- package/dist/index.d.ts +11 -0
- package/dist/swapRouter.d.ts +37 -0
- package/dist/test/forge/writeInterop.d.ts +2 -0
- package/dist/test/utils/addresses.d.ts +5 -0
- package/dist/test/utils/hexToDecimalString.d.ts +2 -0
- package/dist/test/utils/permit2.d.ts +7 -0
- package/dist/test/utils/uniswapData.d.ts +24 -0
- package/dist/universal-router-sdk.cjs.development.js +1728 -0
- package/dist/universal-router-sdk.cjs.development.js.map +1 -0
- package/dist/universal-router-sdk.cjs.production.min.js +2 -0
- package/dist/universal-router-sdk.cjs.production.min.js.map +1 -0
- package/dist/universal-router-sdk.esm.js +1720 -0
- package/dist/universal-router-sdk.esm.js.map +1 -0
- package/dist/utils/commandParser.d.ts +34 -0
- package/dist/utils/constants.d.ts +30 -0
- package/dist/utils/getCurrencyAddress.d.ts +2 -0
- package/dist/utils/inputTokens.d.ts +23 -0
- package/dist/utils/numbers.d.ts +6 -0
- package/dist/utils/pathCurrency.d.ts +3 -0
- package/dist/utils/routerCommands.d.ts +68 -0
- package/dist/utils/routerTradeAdapter.d.ts +73 -0
- package/dist/utils/token.d.ts +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Trade as RouterTrade } from '@ring-protocol/router-sdk';
|
|
2
|
+
import { Currency, TradeType } from '@ring-protocol/sdk-core';
|
|
3
|
+
export declare type TokenInRoute = {
|
|
4
|
+
address: string;
|
|
5
|
+
chainId: number;
|
|
6
|
+
symbol: string;
|
|
7
|
+
decimals: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
buyFeeBps?: string;
|
|
10
|
+
sellFeeBps?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare enum PoolType {
|
|
13
|
+
V2Pool = "v2-pool",
|
|
14
|
+
V3Pool = "v3-pool",
|
|
15
|
+
V4Pool = "v4-pool"
|
|
16
|
+
}
|
|
17
|
+
export declare type V2Reserve = {
|
|
18
|
+
token: TokenInRoute;
|
|
19
|
+
quotient: string;
|
|
20
|
+
};
|
|
21
|
+
export declare type V2PoolInRoute = {
|
|
22
|
+
type: PoolType.V2Pool;
|
|
23
|
+
address?: string;
|
|
24
|
+
tokenIn: TokenInRoute;
|
|
25
|
+
tokenOut: TokenInRoute;
|
|
26
|
+
reserve0: V2Reserve;
|
|
27
|
+
reserve1: V2Reserve;
|
|
28
|
+
amountIn?: string;
|
|
29
|
+
amountOut?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare type V3PoolInRoute = {
|
|
32
|
+
type: PoolType.V3Pool;
|
|
33
|
+
address?: string;
|
|
34
|
+
tokenIn: TokenInRoute;
|
|
35
|
+
tokenOut: TokenInRoute;
|
|
36
|
+
sqrtRatioX96: string;
|
|
37
|
+
liquidity: string;
|
|
38
|
+
tickCurrent: string;
|
|
39
|
+
fee: string;
|
|
40
|
+
amountIn?: string;
|
|
41
|
+
amountOut?: string;
|
|
42
|
+
};
|
|
43
|
+
export declare type V4PoolInRoute = {
|
|
44
|
+
type: PoolType.V4Pool;
|
|
45
|
+
address?: string;
|
|
46
|
+
tokenIn: TokenInRoute;
|
|
47
|
+
tokenOut: TokenInRoute;
|
|
48
|
+
fee: string;
|
|
49
|
+
tickSpacing: string;
|
|
50
|
+
hooks: string;
|
|
51
|
+
liquidity: string;
|
|
52
|
+
sqrtRatioX96: string;
|
|
53
|
+
tickCurrent: string;
|
|
54
|
+
amountIn?: string;
|
|
55
|
+
amountOut?: string;
|
|
56
|
+
};
|
|
57
|
+
export declare type PartialClassicQuote = {
|
|
58
|
+
tokenIn: string;
|
|
59
|
+
tokenOut: string;
|
|
60
|
+
tradeType: TradeType;
|
|
61
|
+
route: Array<(V4PoolInRoute | V3PoolInRoute | V2PoolInRoute)[]>;
|
|
62
|
+
};
|
|
63
|
+
export declare const isNativeCurrency: (address: string) => boolean;
|
|
64
|
+
export declare class RouterTradeAdapter {
|
|
65
|
+
static fromClassicQuote(quote: PartialClassicQuote): RouterTrade<Currency, Currency, TradeType>;
|
|
66
|
+
private static toCurrency;
|
|
67
|
+
private static toPoolOrPair;
|
|
68
|
+
private static toToken;
|
|
69
|
+
private static toV3Pool;
|
|
70
|
+
private static toV4Pool;
|
|
71
|
+
private static toPair;
|
|
72
|
+
private static isVersionedRoute;
|
|
73
|
+
}
|
package/package.json
CHANGED
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@openzeppelin/contracts": "4.7.0",
|
|
36
|
+
"@ring-protocol/few-v2-sdk": "0.1.6",
|
|
36
37
|
"@ring-protocol/permit2-sdk": "0.1.0",
|
|
37
38
|
"@ring-protocol/router-sdk": "^0.1.7",
|
|
38
39
|
"@ring-protocol/sdk-core": "^0.1.1",
|
|
39
|
-
"@ring-protocol/few-v2-sdk": "0.1.6",
|
|
40
40
|
"@ring-protocol/v2-sdk": "0.1.0",
|
|
41
41
|
"@ring-protocol/v3-sdk": "0.1.0",
|
|
42
42
|
"@ring-protocol/v4-sdk": "0.1.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"hoistingLimits": "workspaces"
|
|
111
111
|
},
|
|
112
112
|
"sideEffects": false,
|
|
113
|
-
"version": "0.1.
|
|
113
|
+
"version": "0.1.9"
|
|
114
114
|
}
|