@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.
Files changed (40) hide show
  1. package/dist/entities/Command.d.ts +13 -13
  2. package/dist/entities/NFTTrade.d.ts +44 -50
  3. package/dist/entities/index.d.ts +3 -3
  4. package/dist/entities/protocols/cryptopunk.d.ts +16 -16
  5. package/dist/entities/protocols/element-market.d.ts +44 -0
  6. package/dist/entities/protocols/foundation.d.ts +19 -19
  7. package/dist/entities/protocols/index.d.ts +10 -10
  8. package/dist/entities/protocols/looksRare.d.ts +44 -44
  9. package/dist/entities/protocols/nft20.d.ts +21 -21
  10. package/dist/entities/protocols/nftx.d.ts +20 -20
  11. package/dist/entities/protocols/seaport.d.ts +68 -63
  12. package/dist/entities/protocols/sudoswap.d.ts +27 -27
  13. package/dist/entities/protocols/uniswap.d.ts +15 -15
  14. package/dist/entities/protocols/unwrapWETH.d.ts +12 -13
  15. package/dist/entities/protocols/x2y2.d.ts +28 -28
  16. package/dist/index.d.ts +3 -3
  17. package/dist/swapRouter.d.ts +38 -41
  18. package/dist/test/forge/writeInterop.d.ts +1 -1
  19. package/dist/test/orders/element.d.ts +7 -0
  20. package/dist/test/orders/looksRare.d.ts +12 -15
  21. package/dist/test/orders/seaport.d.ts +5 -4
  22. package/dist/test/orders/seaportV1_4.d.ts +4 -4
  23. package/dist/test/orders/x2y2.d.ts +6 -6
  24. package/dist/test/utils/addresses.d.ts +7 -2
  25. package/dist/test/utils/hexToDecimalString.d.ts +2 -2
  26. package/dist/test/utils/permit2.d.ts +7 -17
  27. package/dist/test/utils/uniswapData.d.ts +23 -30
  28. package/dist/universal-router-sdk.cjs.development.js +124 -41
  29. package/dist/universal-router-sdk.cjs.development.js.map +1 -1
  30. package/dist/universal-router-sdk.cjs.production.min.js +1 -1
  31. package/dist/universal-router-sdk.cjs.production.min.js.map +1 -1
  32. package/dist/universal-router-sdk.esm.js +125 -43
  33. package/dist/universal-router-sdk.esm.js.map +1 -1
  34. package/dist/utils/constants.d.ts +13 -8
  35. package/dist/utils/expandTo18Decimals.d.ts +4 -4
  36. package/dist/utils/getNativeCurrencyValue.d.ts +2 -2
  37. package/dist/utils/inputTokens.d.ts +21 -0
  38. package/dist/utils/routerCommands.d.ts +51 -44
  39. package/package.json +4 -2
  40. 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
- 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
- PERMIT = 10,
17
- WRAP_ETH = 11,
18
- UNWRAP_WETH = 12,
19
- PERMIT2_TRANSFER_FROM_BATCH = 13,
20
- SEAPORT_V1_4 = 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
- X2Y2_721 = 24,
29
- SUDOSWAP = 25,
30
- NFT20 = 26,
31
- X2Y2_1155 = 27,
32
- FOUNDATION = 28,
33
- }
34
- export declare class RoutePlanner {
35
- commands: string
36
- inputs: string[]
37
- constructor()
38
- addCommand(type: CommandType, parameters: any[], allowRevert?: boolean): void
39
- }
40
- export declare type RouterCommand = {
41
- type: CommandType
42
- encodedInput: string
43
- }
44
- export declare function createCommand(type: CommandType, parameters: any[]): RouterCommand
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.4.2",
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.3.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",
@@ -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