@uniswap/universal-router-sdk 1.8.1 → 1.9.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/dist/entities/protocols/uniswap.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/universal-router-sdk.cjs.development.js +151 -11
- package/dist/universal-router-sdk.cjs.development.js.map +1 -1
- package/dist/universal-router-sdk.cjs.production.min.js +1 -1
- package/dist/universal-router-sdk.cjs.production.min.js.map +1 -1
- package/dist/universal-router-sdk.esm.js +155 -16
- package/dist/universal-router-sdk.esm.js.map +1 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/routerTradeAdapter.d.ts +57 -0
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@ export declare const WETH_ADDRESS: (chainId: number) => string;
|
|
|
5
5
|
export declare const PERMIT2_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
6
6
|
export declare const CONTRACT_BALANCE: BigNumber;
|
|
7
7
|
export declare const ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
8
|
+
export declare const E_ETH_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
8
9
|
export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
9
10
|
export declare const MAX_UINT256: BigNumber;
|
|
10
11
|
export declare const MAX_UINT160: BigNumber;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Trade as RouterTrade } from '@uniswap/router-sdk';
|
|
2
|
+
import { Currency, TradeType } from '@uniswap/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
|
+
}
|
|
16
|
+
export declare type V2Reserve = {
|
|
17
|
+
token: TokenInRoute;
|
|
18
|
+
quotient: string;
|
|
19
|
+
};
|
|
20
|
+
export declare type V2PoolInRoute = {
|
|
21
|
+
type: PoolType.V2Pool;
|
|
22
|
+
address?: string;
|
|
23
|
+
tokenIn: TokenInRoute;
|
|
24
|
+
tokenOut: TokenInRoute;
|
|
25
|
+
reserve0: V2Reserve;
|
|
26
|
+
reserve1: V2Reserve;
|
|
27
|
+
amountIn?: string;
|
|
28
|
+
amountOut?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare type V3PoolInRoute = {
|
|
31
|
+
type: PoolType.V3Pool;
|
|
32
|
+
address?: string;
|
|
33
|
+
tokenIn: TokenInRoute;
|
|
34
|
+
tokenOut: TokenInRoute;
|
|
35
|
+
sqrtRatioX96: string;
|
|
36
|
+
liquidity: string;
|
|
37
|
+
tickCurrent: string;
|
|
38
|
+
fee: string;
|
|
39
|
+
amountIn?: string;
|
|
40
|
+
amountOut?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare type PartialClassicQuote = {
|
|
43
|
+
tokenIn: string;
|
|
44
|
+
tokenOut: string;
|
|
45
|
+
tradeType: TradeType;
|
|
46
|
+
route: Array<(V3PoolInRoute | V2PoolInRoute)[]>;
|
|
47
|
+
};
|
|
48
|
+
export declare const isNativeCurrency: (address: string) => boolean;
|
|
49
|
+
export declare class RouterTradeAdapter {
|
|
50
|
+
static fromClassicQuote(quote: PartialClassicQuote): RouterTrade<Currency, Currency, TradeType>;
|
|
51
|
+
private static toCurrency;
|
|
52
|
+
private static toPoolOrPair;
|
|
53
|
+
private static toToken;
|
|
54
|
+
private static toPool;
|
|
55
|
+
private static toPair;
|
|
56
|
+
private static isVersionedRoute;
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniswap/universal-router-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "sdk for integrating with the Universal Router contracts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@uniswap/router-sdk": "^1.9.0",
|
|
54
54
|
"@uniswap/sdk-core": "^4.2.0",
|
|
55
55
|
"@uniswap/universal-router": "1.6.0",
|
|
56
|
-
"@uniswap/v2-sdk": "^4.
|
|
56
|
+
"@uniswap/v2-sdk": "^4.3.0",
|
|
57
57
|
"@uniswap/v3-sdk": "^3.11.0",
|
|
58
58
|
"bignumber.js": "^9.0.2",
|
|
59
59
|
"ethers": "^5.3.1"
|