@uniswap/universal-router-sdk 4.19.3 → 4.19.4

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 (118) hide show
  1. package/dist/{cjs/src/entities → entities}/Command.d.ts +12 -12
  2. package/dist/{types/src/entities → entities}/actions/index.d.ts +2 -2
  3. package/dist/{cjs/src/entities → entities}/actions/uniswap.d.ts +30 -30
  4. package/dist/{esm/src/entities → entities}/actions/unwrapWETH.d.ts +12 -12
  5. package/dist/{cjs/src/entities → entities}/index.d.ts +2 -2
  6. package/dist/{esm/src/index.d.ts → index.d.ts} +10 -10
  7. package/dist/index.js +8 -0
  8. package/dist/{esm/src/swapRouter.d.ts → swapRouter.d.ts} +37 -37
  9. package/dist/test/forge/writeInterop.d.ts +2 -0
  10. package/dist/test/utils/addresses.d.ts +5 -0
  11. package/dist/test/utils/hexToDecimalString.d.ts +2 -0
  12. package/dist/test/utils/permit2.d.ts +7 -0
  13. package/dist/test/utils/uniswapData.d.ts +24 -0
  14. package/dist/universal-router-sdk.cjs.development.js +1424 -0
  15. package/dist/universal-router-sdk.cjs.development.js.map +1 -0
  16. package/dist/universal-router-sdk.cjs.production.min.js +2 -0
  17. package/dist/universal-router-sdk.cjs.production.min.js.map +1 -0
  18. package/dist/universal-router-sdk.esm.js +1417 -0
  19. package/dist/universal-router-sdk.esm.js.map +1 -0
  20. package/dist/{esm/src/utils → utils}/commandParser.d.ts +34 -34
  21. package/dist/{types/src/utils → utils}/constants.d.ts +30 -30
  22. package/dist/{cjs/src/utils → utils}/getCurrencyAddress.d.ts +2 -2
  23. package/dist/{types/src/utils → utils}/inputTokens.d.ts +23 -23
  24. package/dist/{cjs/src/utils → utils}/numbers.d.ts +6 -6
  25. package/dist/{types/src/utils → utils}/pathCurrency.d.ts +3 -3
  26. package/dist/{cjs/src/utils → utils}/routerCommands.d.ts +64 -64
  27. package/dist/{types/src/utils → utils}/routerTradeAdapter.d.ts +73 -73
  28. package/package.json +10 -21
  29. package/dist/cjs/src/entities/Command.js +0 -9
  30. package/dist/cjs/src/entities/Command.js.map +0 -1
  31. package/dist/cjs/src/entities/actions/index.d.ts +0 -2
  32. package/dist/cjs/src/entities/actions/index.js +0 -6
  33. package/dist/cjs/src/entities/actions/index.js.map +0 -1
  34. package/dist/cjs/src/entities/actions/uniswap.js +0 -365
  35. package/dist/cjs/src/entities/actions/uniswap.js.map +0 -1
  36. package/dist/cjs/src/entities/actions/unwrapWETH.d.ts +0 -12
  37. package/dist/cjs/src/entities/actions/unwrapWETH.js +0 -33
  38. package/dist/cjs/src/entities/actions/unwrapWETH.js.map +0 -1
  39. package/dist/cjs/src/entities/index.js +0 -6
  40. package/dist/cjs/src/entities/index.js.map +0 -1
  41. package/dist/cjs/src/index.d.ts +0 -10
  42. package/dist/cjs/src/index.js +0 -24
  43. package/dist/cjs/src/index.js.map +0 -1
  44. package/dist/cjs/src/swapRouter.d.ts +0 -37
  45. package/dist/cjs/src/swapRouter.js +0 -120
  46. package/dist/cjs/src/swapRouter.js.map +0 -1
  47. package/dist/cjs/src/utils/commandParser.d.ts +0 -34
  48. package/dist/cjs/src/utils/commandParser.js +0 -144
  49. package/dist/cjs/src/utils/commandParser.js.map +0 -1
  50. package/dist/cjs/src/utils/constants.d.ts +0 -30
  51. package/dist/cjs/src/utils/constants.js +0 -373
  52. package/dist/cjs/src/utils/constants.js.map +0 -1
  53. package/dist/cjs/src/utils/getCurrencyAddress.js +0 -9
  54. package/dist/cjs/src/utils/getCurrencyAddress.js.map +0 -1
  55. package/dist/cjs/src/utils/inputTokens.d.ts +0 -23
  56. package/dist/cjs/src/utils/inputTokens.js +0 -58
  57. package/dist/cjs/src/utils/inputTokens.js.map +0 -1
  58. package/dist/cjs/src/utils/numbers.js +0 -22
  59. package/dist/cjs/src/utils/numbers.js.map +0 -1
  60. package/dist/cjs/src/utils/pathCurrency.d.ts +0 -3
  61. package/dist/cjs/src/utils/pathCurrency.js +0 -27
  62. package/dist/cjs/src/utils/pathCurrency.js.map +0 -1
  63. package/dist/cjs/src/utils/routerCommands.js +0 -231
  64. package/dist/cjs/src/utils/routerCommands.js.map +0 -1
  65. package/dist/cjs/src/utils/routerTradeAdapter.d.ts +0 -73
  66. package/dist/cjs/src/utils/routerTradeAdapter.js +0 -139
  67. package/dist/cjs/src/utils/routerTradeAdapter.js.map +0 -1
  68. package/dist/esm/src/entities/Command.d.ts +0 -12
  69. package/dist/esm/src/entities/Command.js +0 -6
  70. package/dist/esm/src/entities/Command.js.map +0 -1
  71. package/dist/esm/src/entities/actions/index.d.ts +0 -2
  72. package/dist/esm/src/entities/actions/index.js +0 -3
  73. package/dist/esm/src/entities/actions/index.js.map +0 -1
  74. package/dist/esm/src/entities/actions/uniswap.d.ts +0 -30
  75. package/dist/esm/src/entities/actions/uniswap.js +0 -361
  76. package/dist/esm/src/entities/actions/uniswap.js.map +0 -1
  77. package/dist/esm/src/entities/actions/unwrapWETH.js +0 -28
  78. package/dist/esm/src/entities/actions/unwrapWETH.js.map +0 -1
  79. package/dist/esm/src/entities/index.d.ts +0 -2
  80. package/dist/esm/src/entities/index.js +0 -3
  81. package/dist/esm/src/entities/index.js.map +0 -1
  82. package/dist/esm/src/index.js +0 -7
  83. package/dist/esm/src/index.js.map +0 -1
  84. package/dist/esm/src/swapRouter.js +0 -115
  85. package/dist/esm/src/swapRouter.js.map +0 -1
  86. package/dist/esm/src/utils/commandParser.js +0 -137
  87. package/dist/esm/src/utils/commandParser.js.map +0 -1
  88. package/dist/esm/src/utils/constants.d.ts +0 -30
  89. package/dist/esm/src/utils/constants.js +0 -367
  90. package/dist/esm/src/utils/constants.js.map +0 -1
  91. package/dist/esm/src/utils/getCurrencyAddress.d.ts +0 -2
  92. package/dist/esm/src/utils/getCurrencyAddress.js +0 -5
  93. package/dist/esm/src/utils/getCurrencyAddress.js.map +0 -1
  94. package/dist/esm/src/utils/inputTokens.d.ts +0 -23
  95. package/dist/esm/src/utils/inputTokens.js +0 -51
  96. package/dist/esm/src/utils/inputTokens.js.map +0 -1
  97. package/dist/esm/src/utils/numbers.d.ts +0 -6
  98. package/dist/esm/src/utils/numbers.js +0 -15
  99. package/dist/esm/src/utils/numbers.js.map +0 -1
  100. package/dist/esm/src/utils/pathCurrency.d.ts +0 -3
  101. package/dist/esm/src/utils/pathCurrency.js +0 -23
  102. package/dist/esm/src/utils/pathCurrency.js.map +0 -1
  103. package/dist/esm/src/utils/routerCommands.d.ts +0 -64
  104. package/dist/esm/src/utils/routerCommands.js +0 -226
  105. package/dist/esm/src/utils/routerCommands.js.map +0 -1
  106. package/dist/esm/src/utils/routerTradeAdapter.d.ts +0 -73
  107. package/dist/esm/src/utils/routerTradeAdapter.js +0 -134
  108. package/dist/esm/src/utils/routerTradeAdapter.js.map +0 -1
  109. package/dist/types/src/entities/Command.d.ts +0 -12
  110. package/dist/types/src/entities/actions/uniswap.d.ts +0 -30
  111. package/dist/types/src/entities/actions/unwrapWETH.d.ts +0 -12
  112. package/dist/types/src/entities/index.d.ts +0 -2
  113. package/dist/types/src/index.d.ts +0 -10
  114. package/dist/types/src/swapRouter.d.ts +0 -37
  115. package/dist/types/src/utils/commandParser.d.ts +0 -34
  116. package/dist/types/src/utils/getCurrencyAddress.d.ts +0 -2
  117. package/dist/types/src/utils/numbers.d.ts +0 -6
  118. package/dist/types/src/utils/routerCommands.d.ts +0 -64
@@ -1,15 +0,0 @@
1
- import { BigNumber } from 'ethers';
2
- import JSBI from 'jsbi';
3
- import bn from 'bignumber.js';
4
- import { toHex } from '@uniswap/v3-sdk';
5
- export function expandTo18DecimalsBN(n) {
6
- // use bn intermediately to allow decimals in intermediate calculations
7
- return BigNumber.from(new bn(n).times(new bn(10).pow(18)).toFixed());
8
- }
9
- export function expandTo18Decimals(n) {
10
- return JSBI.BigInt(BigNumber.from(n).mul(BigNumber.from(10).pow(18)).toString());
11
- }
12
- export function encodeFeeBips(fee) {
13
- return toHex(fee.multiply(10000).quotient);
14
- }
15
- //# sourceMappingURL=numbers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../../../src/utils/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,cAAc,CAAA;AAE7B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,UAAU,oBAAoB,CAAC,CAAS;IAC5C,uEAAuE;IACvE,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;AACtE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,CAAS;IAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;AAClF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAM,CAAC,CAAC,QAAQ,CAAC,CAAA;AAC7C,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Currency } from '@uniswap/sdk-core';
2
- import { TPool } from '@uniswap/router-sdk';
3
- export declare function getPathCurrency(currency: Currency, pool: TPool): Currency;
@@ -1,23 +0,0 @@
1
- import { Pool as V4Pool } from '@uniswap/v4-sdk';
2
- export function getPathCurrency(currency, pool) {
3
- // return currency if the currency matches a currency of the pool
4
- if (pool.involvesToken(currency)) {
5
- return currency;
6
- // return if currency.wrapped if pool involves wrapped currency
7
- }
8
- else if (pool.involvesToken(currency.wrapped)) {
9
- return currency.wrapped;
10
- // return native currency if pool involves native version of wrapped currency (only applies to V4)
11
- }
12
- else if (pool instanceof V4Pool && pool.token0.wrapped.equals(currency)) {
13
- return pool.token0;
14
- }
15
- else if (pool instanceof V4Pool && pool.token1.wrapped.equals(currency)) {
16
- return pool.token1;
17
- }
18
- else {
19
- throw new Error(`Expected currency ${currency.symbol} to be either ${pool.token0.symbol} or ${pool.token1.symbol}`);
20
- }
21
- return currency; // this line needed for typescript to compile
22
- }
23
- //# sourceMappingURL=pathCurrency.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathCurrency.js","sourceRoot":"","sources":["../../../../src/utils/pathCurrency.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAGhD,MAAM,UAAU,eAAe,CAAC,QAAkB,EAAE,IAAW;IAC7D,iEAAiE;IACjE,IAAI,IAAI,CAAC,aAAa,CAAC,QAAiB,CAAC,EAAE;QACzC,OAAO,QAAQ,CAAA;QAEf,+DAA+D;KAChE;SAAM,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAgB,CAAC,EAAE;QACxD,OAAO,QAAQ,CAAC,OAAO,CAAA;QAEvB,kGAAkG;KACnG;SAAM,IAAI,IAAI,YAAY,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QACzE,OAAO,IAAI,CAAC,MAAM,CAAA;KACnB;SAAM,IAAI,IAAI,YAAY,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QACzE,OAAO,IAAI,CAAC,MAAM,CAAA;KACnB;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,CAAC,MAAM,iBAAiB,IAAI,CAAC,MAAM,CAAC,MAAM,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;KACpH;IAED,OAAO,QAAQ,CAAA,CAAC,6CAA6C;AAC/D,CAAC"}
@@ -1,64 +0,0 @@
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
- V4_SWAP = 16,
22
- V3_POSITION_MANAGER_PERMIT = 17,
23
- V3_POSITION_MANAGER_CALL = 18,
24
- V4_INITIALIZE_POOL = 19,
25
- V4_POSITION_MANAGER_CALL = 20,
26
- EXECUTE_SUB_PLAN = 33
27
- }
28
- export declare enum Subparser {
29
- V3PathExactIn = 0,
30
- V3PathExactOut = 1
31
- }
32
- export declare enum Parser {
33
- Abi = 0,
34
- V4Actions = 1,
35
- V3Actions = 2
36
- }
37
- export type ParamType = {
38
- readonly name: string;
39
- readonly type: string;
40
- readonly subparser?: Subparser;
41
- };
42
- export type CommandDefinition = {
43
- parser: Parser.Abi;
44
- params: ParamType[];
45
- } | {
46
- parser: Parser.V4Actions;
47
- } | {
48
- parser: Parser.V3Actions;
49
- };
50
- export declare const COMMAND_DEFINITION: {
51
- [key in CommandType]: CommandDefinition;
52
- };
53
- export declare class RoutePlanner {
54
- commands: string;
55
- inputs: string[];
56
- constructor();
57
- addSubPlan(subplan: RoutePlanner): RoutePlanner;
58
- addCommand(type: CommandType, parameters: any[], allowRevert?: boolean): RoutePlanner;
59
- }
60
- export type RouterCommand = {
61
- type: CommandType;
62
- encodedInput: string;
63
- };
64
- export declare function createCommand(type: CommandType, parameters: any[]): RouterCommand;
@@ -1,226 +0,0 @@
1
- import { defaultAbiCoder } from 'ethers/lib/utils';
2
- /**
3
- * CommandTypes
4
- * @description Flags that modify a command's execution
5
- * @enum {number}
6
- */
7
- export var CommandType;
8
- (function (CommandType) {
9
- CommandType[CommandType["V3_SWAP_EXACT_IN"] = 0] = "V3_SWAP_EXACT_IN";
10
- CommandType[CommandType["V3_SWAP_EXACT_OUT"] = 1] = "V3_SWAP_EXACT_OUT";
11
- CommandType[CommandType["PERMIT2_TRANSFER_FROM"] = 2] = "PERMIT2_TRANSFER_FROM";
12
- CommandType[CommandType["PERMIT2_PERMIT_BATCH"] = 3] = "PERMIT2_PERMIT_BATCH";
13
- CommandType[CommandType["SWEEP"] = 4] = "SWEEP";
14
- CommandType[CommandType["TRANSFER"] = 5] = "TRANSFER";
15
- CommandType[CommandType["PAY_PORTION"] = 6] = "PAY_PORTION";
16
- CommandType[CommandType["V2_SWAP_EXACT_IN"] = 8] = "V2_SWAP_EXACT_IN";
17
- CommandType[CommandType["V2_SWAP_EXACT_OUT"] = 9] = "V2_SWAP_EXACT_OUT";
18
- CommandType[CommandType["PERMIT2_PERMIT"] = 10] = "PERMIT2_PERMIT";
19
- CommandType[CommandType["WRAP_ETH"] = 11] = "WRAP_ETH";
20
- CommandType[CommandType["UNWRAP_WETH"] = 12] = "UNWRAP_WETH";
21
- CommandType[CommandType["PERMIT2_TRANSFER_FROM_BATCH"] = 13] = "PERMIT2_TRANSFER_FROM_BATCH";
22
- CommandType[CommandType["BALANCE_CHECK_ERC20"] = 14] = "BALANCE_CHECK_ERC20";
23
- CommandType[CommandType["V4_SWAP"] = 16] = "V4_SWAP";
24
- CommandType[CommandType["V3_POSITION_MANAGER_PERMIT"] = 17] = "V3_POSITION_MANAGER_PERMIT";
25
- CommandType[CommandType["V3_POSITION_MANAGER_CALL"] = 18] = "V3_POSITION_MANAGER_CALL";
26
- CommandType[CommandType["V4_INITIALIZE_POOL"] = 19] = "V4_INITIALIZE_POOL";
27
- CommandType[CommandType["V4_POSITION_MANAGER_CALL"] = 20] = "V4_POSITION_MANAGER_CALL";
28
- CommandType[CommandType["EXECUTE_SUB_PLAN"] = 33] = "EXECUTE_SUB_PLAN";
29
- })(CommandType || (CommandType = {}));
30
- export var Subparser;
31
- (function (Subparser) {
32
- Subparser[Subparser["V3PathExactIn"] = 0] = "V3PathExactIn";
33
- Subparser[Subparser["V3PathExactOut"] = 1] = "V3PathExactOut";
34
- })(Subparser || (Subparser = {}));
35
- export var Parser;
36
- (function (Parser) {
37
- Parser[Parser["Abi"] = 0] = "Abi";
38
- Parser[Parser["V4Actions"] = 1] = "V4Actions";
39
- Parser[Parser["V3Actions"] = 2] = "V3Actions";
40
- })(Parser || (Parser = {}));
41
- const ALLOW_REVERT_FLAG = 0x80;
42
- const REVERTIBLE_COMMANDS = new Set([CommandType.EXECUTE_SUB_PLAN]);
43
- const PERMIT_STRUCT = '((address token,uint160 amount,uint48 expiration,uint48 nonce) details,address spender,uint256 sigDeadline)';
44
- const PERMIT_BATCH_STRUCT = '((address token,uint160 amount,uint48 expiration,uint48 nonce)[] details,address spender,uint256 sigDeadline)';
45
- const POOL_KEY_STRUCT = '(address currency0,address currency1,uint24 fee,int24 tickSpacing,address hooks)';
46
- const PERMIT2_TRANSFER_FROM_STRUCT = '(address from,address to,uint160 amount,address token)';
47
- const PERMIT2_TRANSFER_FROM_BATCH_STRUCT = PERMIT2_TRANSFER_FROM_STRUCT + '[]';
48
- export const COMMAND_DEFINITION = {
49
- // Batch Reverts
50
- [CommandType.EXECUTE_SUB_PLAN]: {
51
- parser: Parser.Abi,
52
- params: [
53
- { name: 'commands', type: 'bytes' },
54
- { name: 'inputs', type: 'bytes[]' },
55
- ],
56
- },
57
- // Permit2 Actions
58
- [CommandType.PERMIT2_PERMIT]: {
59
- parser: Parser.Abi,
60
- params: [
61
- { name: 'permit', type: PERMIT_STRUCT },
62
- { name: 'signature', type: 'bytes' },
63
- ],
64
- },
65
- [CommandType.PERMIT2_PERMIT_BATCH]: {
66
- parser: Parser.Abi,
67
- params: [
68
- { name: 'permit', type: PERMIT_BATCH_STRUCT },
69
- { name: 'signature', type: 'bytes' },
70
- ],
71
- },
72
- [CommandType.PERMIT2_TRANSFER_FROM]: {
73
- parser: Parser.Abi,
74
- params: [
75
- { name: 'token', type: 'address' },
76
- { name: 'recipient', type: 'address' },
77
- { name: 'amount', type: 'uint160' },
78
- ],
79
- },
80
- [CommandType.PERMIT2_TRANSFER_FROM_BATCH]: {
81
- parser: Parser.Abi,
82
- params: [
83
- {
84
- name: 'transferFrom',
85
- type: PERMIT2_TRANSFER_FROM_BATCH_STRUCT,
86
- },
87
- ],
88
- },
89
- // Uniswap Actions
90
- [CommandType.V3_SWAP_EXACT_IN]: {
91
- parser: Parser.Abi,
92
- params: [
93
- { name: 'recipient', type: 'address' },
94
- { name: 'amountIn', type: 'uint256' },
95
- { name: 'amountOutMin', type: 'uint256' },
96
- { name: 'path', subparser: Subparser.V3PathExactIn, type: 'bytes' },
97
- { name: 'payerIsUser', type: 'bool' },
98
- ],
99
- },
100
- [CommandType.V3_SWAP_EXACT_OUT]: {
101
- parser: Parser.Abi,
102
- params: [
103
- { name: 'recipient', type: 'address' },
104
- { name: 'amountOut', type: 'uint256' },
105
- { name: 'amountInMax', type: 'uint256' },
106
- { name: 'path', subparser: Subparser.V3PathExactOut, type: 'bytes' },
107
- { name: 'payerIsUser', type: 'bool' },
108
- ],
109
- },
110
- [CommandType.V2_SWAP_EXACT_IN]: {
111
- parser: Parser.Abi,
112
- params: [
113
- { name: 'recipient', type: 'address' },
114
- { name: 'amountIn', type: 'uint256' },
115
- { name: 'amountOutMin', type: 'uint256' },
116
- { name: 'path', type: 'address[]' },
117
- { name: 'payerIsUser', type: 'bool' },
118
- ],
119
- },
120
- [CommandType.V2_SWAP_EXACT_OUT]: {
121
- parser: Parser.Abi,
122
- params: [
123
- { name: 'recipient', type: 'address' },
124
- { name: 'amountOut', type: 'uint256' },
125
- { name: 'amountInMax', type: 'uint256' },
126
- { name: 'path', type: 'address[]' },
127
- { name: 'payerIsUser', type: 'bool' },
128
- ],
129
- },
130
- [CommandType.V4_SWAP]: { parser: Parser.V4Actions },
131
- // Token Actions and Checks
132
- [CommandType.WRAP_ETH]: {
133
- parser: Parser.Abi,
134
- params: [
135
- { name: 'recipient', type: 'address' },
136
- { name: 'amount', type: 'uint256' },
137
- ],
138
- },
139
- [CommandType.UNWRAP_WETH]: {
140
- parser: Parser.Abi,
141
- params: [
142
- { name: 'recipient', type: 'address' },
143
- { name: 'amountMin', type: 'uint256' },
144
- ],
145
- },
146
- [CommandType.SWEEP]: {
147
- parser: Parser.Abi,
148
- params: [
149
- { name: 'token', type: 'address' },
150
- { name: 'recipient', type: 'address' },
151
- { name: 'amountMin', type: 'uint256' },
152
- ],
153
- },
154
- [CommandType.TRANSFER]: {
155
- parser: Parser.Abi,
156
- params: [
157
- { name: 'token', type: 'address' },
158
- { name: 'recipient', type: 'address' },
159
- { name: 'value', type: 'uint256' },
160
- ],
161
- },
162
- [CommandType.PAY_PORTION]: {
163
- parser: Parser.Abi,
164
- params: [
165
- { name: 'token', type: 'address' },
166
- { name: 'recipient', type: 'address' },
167
- { name: 'bips', type: 'uint256' },
168
- ],
169
- },
170
- [CommandType.BALANCE_CHECK_ERC20]: {
171
- parser: Parser.Abi,
172
- params: [
173
- { name: 'owner', type: 'address' },
174
- { name: 'token', type: 'address' },
175
- { name: 'minBalance', type: 'uint256' },
176
- ],
177
- },
178
- [CommandType.V4_INITIALIZE_POOL]: {
179
- parser: Parser.Abi,
180
- params: [
181
- { name: 'poolKey', type: POOL_KEY_STRUCT },
182
- { name: 'sqrtPriceX96', type: 'uint160' },
183
- ],
184
- },
185
- // Position Actions
186
- [CommandType.V3_POSITION_MANAGER_PERMIT]: { parser: Parser.V3Actions },
187
- [CommandType.V3_POSITION_MANAGER_CALL]: { parser: Parser.V3Actions },
188
- [CommandType.V4_POSITION_MANAGER_CALL]: { parser: Parser.V4Actions },
189
- };
190
- export class RoutePlanner {
191
- constructor() {
192
- this.commands = '0x';
193
- this.inputs = [];
194
- }
195
- addSubPlan(subplan) {
196
- this.addCommand(CommandType.EXECUTE_SUB_PLAN, [subplan.commands, subplan.inputs], true);
197
- return this;
198
- }
199
- addCommand(type, parameters, allowRevert = false) {
200
- let command = createCommand(type, parameters);
201
- this.inputs.push(command.encodedInput);
202
- if (allowRevert) {
203
- if (!REVERTIBLE_COMMANDS.has(command.type)) {
204
- throw new Error(`command type: ${command.type} cannot be allowed to revert`);
205
- }
206
- command.type = command.type | ALLOW_REVERT_FLAG;
207
- }
208
- this.commands = this.commands.concat(command.type.toString(16).padStart(2, '0'));
209
- return this;
210
- }
211
- }
212
- export function createCommand(type, parameters) {
213
- const commandDef = COMMAND_DEFINITION[type];
214
- switch (commandDef.parser) {
215
- case Parser.Abi:
216
- const encodedInput = defaultAbiCoder.encode(commandDef.params.map((abi) => abi.type), parameters);
217
- return { type, encodedInput };
218
- case Parser.V4Actions:
219
- // v4 swap data comes pre-encoded at index 0
220
- return { type, encodedInput: parameters[0] };
221
- case Parser.V3Actions:
222
- // v4 swap data comes pre-encoded at index 0
223
- return { type, encodedInput: parameters[0] };
224
- }
225
- }
226
- //# sourceMappingURL=routerCommands.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routerCommands.js","sourceRoot":"","sources":["../../../../src/utils/routerCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAwBX;AAxBD,WAAY,WAAW;IACrB,qEAAuB,CAAA;IACvB,uEAAwB,CAAA;IACxB,+EAA4B,CAAA;IAC5B,6EAA2B,CAAA;IAC3B,+CAAY,CAAA;IACZ,qDAAe,CAAA;IACf,2DAAkB,CAAA;IAElB,qEAAuB,CAAA;IACvB,uEAAwB,CAAA;IACxB,kEAAqB,CAAA;IACrB,sDAAe,CAAA;IACf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AM,CAAC,SAAS;YACnB,4CAA4C;YAC5C,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAA;QAC9C,KAAK,MAAM,CAAC,SAAS;YACnB,4CAA4C;YAC5C,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAA;KAC/C;AACH,CAAC"}
@@ -1,73 +0,0 @@
1
- import { Trade as RouterTrade } from '@uniswap/router-sdk';
2
- import { Currency, TradeType } from '@uniswap/sdk-core';
3
- export 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 type V2Reserve = {
18
- token: TokenInRoute;
19
- quotient: string;
20
- };
21
- export 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 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 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 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
- }
@@ -1,134 +0,0 @@
1
- import { MixedRouteSDK, Trade as RouterTrade } from '@uniswap/router-sdk';
2
- import { CurrencyAmount, Ether, Token } from '@uniswap/sdk-core';
3
- import { Pair, Route as V2Route } from '@uniswap/v2-sdk';
4
- import { Pool as V3Pool, Route as V3Route } from '@uniswap/v3-sdk';
5
- import { Pool as V4Pool, Route as V4Route } from '@uniswap/v4-sdk';
6
- import { BigNumber } from 'ethers';
7
- import { ETH_ADDRESS, E_ETH_ADDRESS } from './constants';
8
- export var PoolType;
9
- (function (PoolType) {
10
- PoolType["V2Pool"] = "v2-pool";
11
- PoolType["V3Pool"] = "v3-pool";
12
- PoolType["V4Pool"] = "v4-pool";
13
- })(PoolType || (PoolType = {}));
14
- export const isNativeCurrency = (address) => address.toLowerCase() === ETH_ADDRESS.toLowerCase() || address.toLowerCase() === E_ETH_ADDRESS.toLowerCase();
15
- // Helper class to convert routing-specific quote entities to RouterTrade entities
16
- // the returned RouterTrade can then be used to build the UniswapTrade entity in this package
17
- export class RouterTradeAdapter {
18
- // Generate a RouterTrade using fields from a classic quote response
19
- static fromClassicQuote(quote) {
20
- const { route, tokenIn, tokenOut } = quote;
21
- if (!route)
22
- throw new Error('Expected route to be present');
23
- if (!route.length)
24
- throw new Error('Expected there to be at least one route');
25
- if (route.some((r) => !r.length))
26
- throw new Error('Expected all routes to have at least one pool');
27
- const firstRoute = route[0];
28
- const tokenInData = firstRoute[0].tokenIn;
29
- const tokenOutData = firstRoute[firstRoute.length - 1].tokenOut;
30
- if (!tokenInData || !tokenOutData)
31
- throw new Error('Expected both tokenIn and tokenOut to be present');
32
- if (tokenInData.chainId !== tokenOutData.chainId)
33
- throw new Error('Expected tokenIn and tokenOut to be have same chainId');
34
- const parsedCurrencyIn = RouterTradeAdapter.toCurrency(isNativeCurrency(tokenIn), tokenInData);
35
- const parsedCurrencyOut = RouterTradeAdapter.toCurrency(isNativeCurrency(tokenOut), tokenOutData);
36
- const typedRoutes = route.map((subRoute) => {
37
- const rawAmountIn = subRoute[0].amountIn;
38
- const rawAmountOut = subRoute[subRoute.length - 1].amountOut;
39
- if (!rawAmountIn || !rawAmountOut) {
40
- throw new Error('Expected both raw amountIn and raw amountOut to be present');
41
- }
42
- const inputAmount = CurrencyAmount.fromRawAmount(parsedCurrencyIn, rawAmountIn);
43
- const outputAmount = CurrencyAmount.fromRawAmount(parsedCurrencyOut, rawAmountOut);
44
- const isOnlyV2 = RouterTradeAdapter.isVersionedRoute(PoolType.V2Pool, subRoute);
45
- const isOnlyV3 = RouterTradeAdapter.isVersionedRoute(PoolType.V3Pool, subRoute);
46
- const isOnlyV4 = RouterTradeAdapter.isVersionedRoute(PoolType.V4Pool, subRoute);
47
- return {
48
- routev4: isOnlyV4
49
- ? new V4Route(subRoute.map(RouterTradeAdapter.toV4Pool), parsedCurrencyIn, parsedCurrencyOut)
50
- : null,
51
- routev3: isOnlyV3
52
- ? new V3Route(subRoute.map(RouterTradeAdapter.toV3Pool), parsedCurrencyIn, parsedCurrencyOut)
53
- : null,
54
- routev2: isOnlyV2
55
- ? new V2Route(subRoute.map(RouterTradeAdapter.toPair), parsedCurrencyIn, parsedCurrencyOut)
56
- : null,
57
- mixedRoute: !isOnlyV4 && !isOnlyV3 && !isOnlyV2
58
- ? new MixedRouteSDK(subRoute.map(RouterTradeAdapter.toPoolOrPair), parsedCurrencyIn, parsedCurrencyOut)
59
- : null,
60
- inputAmount,
61
- outputAmount,
62
- };
63
- });
64
- return new RouterTrade({
65
- v2Routes: typedRoutes
66
- .filter((route) => route.routev2)
67
- .map((route) => ({
68
- routev2: route.routev2,
69
- inputAmount: route.inputAmount,
70
- outputAmount: route.outputAmount,
71
- })),
72
- v3Routes: typedRoutes
73
- .filter((route) => route.routev3)
74
- .map((route) => ({
75
- routev3: route.routev3,
76
- inputAmount: route.inputAmount,
77
- outputAmount: route.outputAmount,
78
- })),
79
- v4Routes: typedRoutes
80
- .filter((route) => route.routev4)
81
- .map((route) => ({
82
- routev4: route.routev4,
83
- inputAmount: route.inputAmount,
84
- outputAmount: route.outputAmount,
85
- })),
86
- mixedRoutes: typedRoutes
87
- .filter((route) => route.mixedRoute)
88
- .map((route) => ({
89
- mixedRoute: route.mixedRoute,
90
- inputAmount: route.inputAmount,
91
- outputAmount: route.outputAmount,
92
- })),
93
- tradeType: quote.tradeType,
94
- });
95
- }
96
- static toCurrency(isNative, token) {
97
- if (isNative) {
98
- return Ether.onChain(token.chainId);
99
- }
100
- return this.toToken(token);
101
- }
102
- static toToken(token) {
103
- const { chainId, address, decimals, symbol, buyFeeBps, sellFeeBps } = token;
104
- return new Token(chainId, address, parseInt(decimals.toString()), symbol,
105
- /* name */ undefined, false, buyFeeBps ? BigNumber.from(buyFeeBps) : undefined, sellFeeBps ? BigNumber.from(sellFeeBps) : undefined);
106
- }
107
- static toV3Pool({ fee, sqrtRatioX96, liquidity, tickCurrent, tokenIn, tokenOut }) {
108
- return new V3Pool(RouterTradeAdapter.toToken(tokenIn), RouterTradeAdapter.toToken(tokenOut), parseInt(fee), sqrtRatioX96, liquidity, parseInt(tickCurrent));
109
- }
110
- static toV4Pool(pool) {
111
- const parsedCurrencyIn = RouterTradeAdapter.toCurrency(isNativeCurrency(pool.tokenIn.address), pool.tokenIn);
112
- const parsedCurrencyOut = RouterTradeAdapter.toCurrency(isNativeCurrency(pool.tokenOut.address), pool.tokenOut);
113
- return new V4Pool(parsedCurrencyIn, parsedCurrencyOut, parseInt(pool.fee), parseInt(pool.tickSpacing), pool.hooks, pool.sqrtRatioX96, pool.liquidity, parseInt(pool.tickCurrent));
114
- }
115
- static isVersionedRoute(type, route) {
116
- return route.every((pool) => pool.type === type);
117
- }
118
- }
119
- RouterTradeAdapter.toPoolOrPair = (pool) => {
120
- switch (pool.type) {
121
- case PoolType.V4Pool:
122
- return RouterTradeAdapter.toV4Pool(pool);
123
- case PoolType.V3Pool:
124
- return RouterTradeAdapter.toV3Pool(pool);
125
- case PoolType.V2Pool:
126
- return RouterTradeAdapter.toPair(pool);
127
- default:
128
- throw new Error('Invalid pool type');
129
- }
130
- };
131
- RouterTradeAdapter.toPair = ({ reserve0, reserve1 }) => {
132
- return new Pair(CurrencyAmount.fromRawAmount(RouterTradeAdapter.toToken(reserve0.token), reserve0.quotient), CurrencyAmount.fromRawAmount(RouterTradeAdapter.toToken(reserve1.token), reserve1.quotient));
133
- };
134
- //# sourceMappingURL=routerTradeAdapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routerTradeAdapter.js","sourceRoot":"","sources":["../../../../src/utils/routerTradeAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAY,cAAc,EAAE,KAAK,EAAE,KAAK,EAAa,MAAM,mBAAmB,CAAA;AACrF,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,KAAK,IAAI,OAAO,EAAa,MAAM,iBAAiB,CAAA;AAC7E,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAYxD,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,8BAAkB,CAAA;IAClB,8BAAkB,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AM;YAClB,OAAO,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC1C,KAAK,QAAQ,CAAC,MAAM;YAClB,OAAO,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC1C,KAAK,QAAQ,CAAC,MAAM;YAClB,OAAO,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACxC;YACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;KACvC;AACH,CAAC,CAAA;AA0Cc,yBAAM,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAiB,EAAQ,EAAE;IACtE,OAAO,IAAI,IAAI,CACb,cAAc,CAAC,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAC3F,cAAc,CAAC,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAC5F,CAAA;AACH,CAAC,CAAA"}
@@ -1,12 +0,0 @@
1
- import { RoutePlanner } from '../utils/routerCommands';
2
- export type TradeConfig = {
3
- allowRevert: boolean;
4
- };
5
- export declare enum RouterActionType {
6
- UniswapTrade = "UniswapTrade",
7
- UnwrapWETH = "UnwrapWETH"
8
- }
9
- export interface Command {
10
- tradeType: RouterActionType;
11
- encode(planner: RoutePlanner, config: TradeConfig): void;
12
- }
@@ -1,30 +0,0 @@
1
- import { RoutePlanner } from '../../utils/routerCommands';
2
- import { Trade as RouterTrade, SwapOptions as RouterSwapOptions } from '@uniswap/router-sdk';
3
- import { Permit2Permit } from '../../utils/inputTokens';
4
- import { Currency, TradeType } from '@uniswap/sdk-core';
5
- import { Command, RouterActionType, TradeConfig } from '../Command';
6
- import { BigNumberish } from 'ethers';
7
- export type FlatFeeOptions = {
8
- amount: BigNumberish;
9
- recipient: string;
10
- };
11
- export type SwapOptions = Omit<RouterSwapOptions, 'inputTokenPermit'> & {
12
- useRouterBalance?: boolean;
13
- inputTokenPermit?: Permit2Permit;
14
- flatFee?: FlatFeeOptions;
15
- safeMode?: boolean;
16
- };
17
- export declare class UniswapTrade implements Command {
18
- trade: RouterTrade<Currency, Currency, TradeType>;
19
- options: SwapOptions;
20
- readonly tradeType: RouterActionType;
21
- readonly payerIsUser: boolean;
22
- constructor(trade: RouterTrade<Currency, Currency, TradeType>, options: SwapOptions);
23
- get isAllV4(): boolean;
24
- get inputRequiresWrap(): boolean;
25
- get inputRequiresUnwrap(): boolean;
26
- get outputRequiresWrap(): boolean;
27
- get outputRequiresUnwrap(): boolean;
28
- get outputRequiresTransition(): boolean;
29
- encode(planner: RoutePlanner, _config: TradeConfig): void;
30
- }
@@ -1,12 +0,0 @@
1
- import { BigNumberish } from 'ethers';
2
- import { RoutePlanner } from '../../utils/routerCommands';
3
- import { Permit2Permit } from '../../utils/inputTokens';
4
- import { Command, RouterActionType, TradeConfig } from '../Command';
5
- export declare class UnwrapWETH implements Command {
6
- readonly tradeType: RouterActionType;
7
- readonly permit2Data?: Permit2Permit;
8
- readonly wethAddress: string;
9
- readonly amount: BigNumberish;
10
- constructor(amount: BigNumberish, chainId: number, permit2?: Permit2Permit);
11
- encode(planner: RoutePlanner, _: TradeConfig): void;
12
- }
@@ -1,2 +0,0 @@
1
- export * from './actions';
2
- export * from './Command';
@@ -1,10 +0,0 @@
1
- export { SwapRouter } from './swapRouter';
2
- export type { MigrateV3ToV4Options } from './swapRouter';
3
- export * from './entities';
4
- export * from './utils/routerTradeAdapter';
5
- export { RoutePlanner, CommandType, COMMAND_DEFINITION, Parser, Subparser } from './utils/routerCommands';
6
- export type { CommandDefinition, ParamType } from './utils/routerCommands';
7
- export { UNIVERSAL_ROUTER_CREATION_BLOCK, UNIVERSAL_ROUTER_ADDRESS, ROUTER_AS_RECIPIENT, WETH_ADDRESS, UniversalRouterVersion, } from './utils/constants';
8
- export { CommandParser, GenericCommandParser } from './utils/commandParser';
9
- export type { UniversalRouterCommand, UniversalRouterCall, Param, CommandsDefinition } from './utils/commandParser';
10
- export type { Permit2Permit } from './utils/inputTokens';