@uniswap/universal-router-sdk 1.4.2 → 1.5.0-beta.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/Command.d.ts +13 -13
- package/dist/entities/NFTTrade.d.ts +44 -50
- package/dist/entities/index.d.ts +3 -3
- package/dist/entities/protocols/cryptopunk.d.ts +16 -16
- package/dist/entities/protocols/element-market.d.ts +44 -0
- package/dist/entities/protocols/foundation.d.ts +19 -19
- package/dist/entities/protocols/index.d.ts +10 -10
- package/dist/entities/protocols/looksRare.d.ts +44 -44
- package/dist/entities/protocols/nft20.d.ts +21 -21
- package/dist/entities/protocols/nftx.d.ts +20 -20
- package/dist/entities/protocols/seaport.d.ts +68 -63
- package/dist/entities/protocols/sudoswap.d.ts +27 -27
- package/dist/entities/protocols/uniswap.d.ts +15 -15
- package/dist/entities/protocols/unwrapWETH.d.ts +12 -13
- package/dist/entities/protocols/x2y2.d.ts +28 -28
- package/dist/index.d.ts +3 -3
- package/dist/swapRouter.d.ts +38 -41
- package/dist/test/forge/writeInterop.d.ts +1 -1
- package/dist/test/orders/element.d.ts +7 -0
- package/dist/test/orders/looksRare.d.ts +12 -15
- package/dist/test/orders/seaport.d.ts +5 -4
- package/dist/test/orders/seaportV1_4.d.ts +4 -4
- package/dist/test/orders/x2y2.d.ts +6 -6
- package/dist/test/utils/addresses.d.ts +7 -2
- package/dist/test/utils/hexToDecimalString.d.ts +2 -2
- package/dist/test/utils/permit2.d.ts +7 -17
- package/dist/test/utils/uniswapData.d.ts +23 -30
- package/dist/universal-router-sdk.cjs.development.js +124 -41
- 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 +125 -43
- package/dist/universal-router-sdk.esm.js.map +1 -1
- package/dist/utils/constants.d.ts +13 -8
- package/dist/utils/expandTo18Decimals.d.ts +4 -4
- package/dist/utils/getNativeCurrencyValue.d.ts +2 -2
- package/dist/utils/inputTokens.d.ts +21 -0
- package/dist/utils/routerCommands.d.ts +51 -44
- package/package.json +4 -2
- package/dist/utils/permit2.d.ts +0 -6
|
@@ -1,44 +1,51 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CommandTypes
|
|
3
|
-
* @description Flags that modify a command's execution
|
|
4
|
-
* @enum {number}
|
|
5
|
-
*/
|
|
6
|
-
export declare enum CommandType {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
export declare
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
/**
|
|
2
|
+
* CommandTypes
|
|
3
|
+
* @description Flags that modify a command's execution
|
|
4
|
+
* @enum {number}
|
|
5
|
+
*/
|
|
6
|
+
export declare enum CommandType {
|
|
7
|
+
V3_SWAP_EXACT_IN = 0,
|
|
8
|
+
V3_SWAP_EXACT_OUT = 1,
|
|
9
|
+
PERMIT2_TRANSFER_FROM = 2,
|
|
10
|
+
PERMIT2_PERMIT_BATCH = 3,
|
|
11
|
+
SWEEP = 4,
|
|
12
|
+
TRANSFER = 5,
|
|
13
|
+
PAY_PORTION = 6,
|
|
14
|
+
V2_SWAP_EXACT_IN = 8,
|
|
15
|
+
V2_SWAP_EXACT_OUT = 9,
|
|
16
|
+
PERMIT2_PERMIT = 10,
|
|
17
|
+
WRAP_ETH = 11,
|
|
18
|
+
UNWRAP_WETH = 12,
|
|
19
|
+
PERMIT2_TRANSFER_FROM_BATCH = 13,
|
|
20
|
+
BALANCE_CHECK_ERC20 = 14,
|
|
21
|
+
SEAPORT = 16,
|
|
22
|
+
LOOKS_RARE_721 = 17,
|
|
23
|
+
NFTX = 18,
|
|
24
|
+
CRYPTOPUNKS = 19,
|
|
25
|
+
LOOKS_RARE_1155 = 20,
|
|
26
|
+
OWNER_CHECK_721 = 21,
|
|
27
|
+
OWNER_CHECK_1155 = 22,
|
|
28
|
+
SWEEP_ERC721 = 23,
|
|
29
|
+
X2Y2_721 = 24,
|
|
30
|
+
SUDOSWAP = 25,
|
|
31
|
+
NFT20 = 26,
|
|
32
|
+
X2Y2_1155 = 27,
|
|
33
|
+
FOUNDATION = 28,
|
|
34
|
+
SWEEP_ERC1155 = 29,
|
|
35
|
+
ELEMENT_MARKET = 30,
|
|
36
|
+
EXECUTE_SUB_PLAN = 32,
|
|
37
|
+
SEAPORT_V1_4 = 33,
|
|
38
|
+
APPROVE_ERC20 = 34
|
|
39
|
+
}
|
|
40
|
+
export declare class RoutePlanner {
|
|
41
|
+
commands: string;
|
|
42
|
+
inputs: string[];
|
|
43
|
+
constructor();
|
|
44
|
+
addSubPlan(subplan: RoutePlanner): void;
|
|
45
|
+
addCommand(type: CommandType, parameters: any[], allowRevert?: boolean): void;
|
|
46
|
+
}
|
|
47
|
+
export declare type RouterCommand = {
|
|
48
|
+
type: CommandType;
|
|
49
|
+
encodedInput: string;
|
|
50
|
+
};
|
|
51
|
+
export declare function createCommand(type: CommandType, parameters: any[]): RouterCommand;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniswap/universal-router-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0-beta.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",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"install:ur": "cd node_modules/@uniswap/universal-router && forge install",
|
|
21
21
|
"build": "tsdx build",
|
|
22
22
|
"prettier:fix": "prettier --write '**/*.ts' && prettier --write '**/*.json'",
|
|
23
|
+
"forge:fix": "forge fmt",
|
|
24
|
+
"lint:fix": "yarn prettier:fix && yarn forge:fix",
|
|
23
25
|
"prettier": "prettier --check '**/*.ts' && prettier --check '**/*.json'",
|
|
24
26
|
"docs": "typedoc"
|
|
25
27
|
},
|
|
@@ -47,7 +49,7 @@
|
|
|
47
49
|
"typescript": "^4.3.3"
|
|
48
50
|
},
|
|
49
51
|
"dependencies": {
|
|
50
|
-
"@uniswap/universal-router": "1.
|
|
52
|
+
"@uniswap/universal-router": "1.4.0-beta.0",
|
|
51
53
|
"@uniswap/permit2-sdk": "^1.2.0",
|
|
52
54
|
"@uniswap/router-sdk": "^1.4.0",
|
|
53
55
|
"@uniswap/sdk-core": "^3.1.0",
|
package/dist/utils/permit2.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PermitSingle } from '@uniswap/permit2-sdk'
|
|
2
|
-
import { RoutePlanner } from './routerCommands'
|
|
3
|
-
export interface Permit2Permit extends PermitSingle {
|
|
4
|
-
signature: string
|
|
5
|
-
}
|
|
6
|
-
export declare function encodePermit(planner: RoutePlanner, permit: Permit2Permit): void
|