@luxfi/exchange 0.1.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 (154) hide show
  1. package/dist/bridge/__tests__/use-private-teleport.test.d.ts +2 -0
  2. package/dist/bridge/__tests__/use-private-teleport.test.d.ts.map +1 -0
  3. package/dist/bridge/__tests__/use-private-teleport.test.js +272 -0
  4. package/dist/bridge/cross-chain-store.d.ts +57 -0
  5. package/dist/bridge/cross-chain-store.d.ts.map +1 -0
  6. package/dist/bridge/cross-chain-store.js +158 -0
  7. package/dist/bridge/index.d.ts +78 -0
  8. package/dist/bridge/index.d.ts.map +1 -0
  9. package/dist/bridge/index.js +79 -0
  10. package/dist/bridge/private-teleport-types.d.ts +634 -0
  11. package/dist/bridge/private-teleport-types.d.ts.map +1 -0
  12. package/dist/bridge/private-teleport-types.js +308 -0
  13. package/dist/bridge/types.d.ts +84 -0
  14. package/dist/bridge/types.d.ts.map +1 -0
  15. package/dist/bridge/types.js +37 -0
  16. package/dist/bridge/use-cross-chain-mint.d.ts +34 -0
  17. package/dist/bridge/use-cross-chain-mint.d.ts.map +1 -0
  18. package/dist/bridge/use-cross-chain-mint.js +228 -0
  19. package/dist/bridge/use-private-teleport.d.ts +69 -0
  20. package/dist/bridge/use-private-teleport.d.ts.map +1 -0
  21. package/dist/bridge/use-private-teleport.js +666 -0
  22. package/dist/chains/index.d.ts +6 -0
  23. package/dist/chains/index.d.ts.map +1 -0
  24. package/dist/chains/index.js +6 -0
  25. package/dist/chains/lux.d.ts +508 -0
  26. package/dist/chains/lux.d.ts.map +1 -0
  27. package/dist/chains/lux.js +131 -0
  28. package/dist/contracts/abis/dex-swap-router.d.ts +137 -0
  29. package/dist/contracts/abis/dex-swap-router.d.ts.map +1 -0
  30. package/dist/contracts/abis/dex-swap-router.js +95 -0
  31. package/dist/contracts/abis/erc20.d.ts +136 -0
  32. package/dist/contracts/abis/erc20.d.ts.map +1 -0
  33. package/dist/contracts/abis/erc20.js +96 -0
  34. package/dist/contracts/abis/index.d.ts +15 -0
  35. package/dist/contracts/abis/index.d.ts.map +1 -0
  36. package/dist/contracts/abis/index.js +15 -0
  37. package/dist/contracts/abis/nft-position-manager.d.ts +235 -0
  38. package/dist/contracts/abis/nft-position-manager.d.ts.map +1 -0
  39. package/dist/contracts/abis/nft-position-manager.js +146 -0
  40. package/dist/contracts/abis/pool-manager.d.ts +315 -0
  41. package/dist/contracts/abis/pool-manager.d.ts.map +1 -0
  42. package/dist/contracts/abis/pool-manager.js +191 -0
  43. package/dist/contracts/abis/quoter-v2.d.ts +103 -0
  44. package/dist/contracts/abis/quoter-v2.d.ts.map +1 -0
  45. package/dist/contracts/abis/quoter-v2.js +68 -0
  46. package/dist/contracts/abis/swap-router.d.ts +119 -0
  47. package/dist/contracts/abis/swap-router.d.ts.map +1 -0
  48. package/dist/contracts/abis/swap-router.js +75 -0
  49. package/dist/contracts/abis/uniswap-v2-factory.d.ts +75 -0
  50. package/dist/contracts/abis/uniswap-v2-factory.d.ts.map +1 -0
  51. package/dist/contracts/abis/uniswap-v2-factory.js +49 -0
  52. package/dist/contracts/abis/uniswap-v2-pair.d.ts +119 -0
  53. package/dist/contracts/abis/uniswap-v2-pair.d.ts.map +1 -0
  54. package/dist/contracts/abis/uniswap-v2-pair.js +85 -0
  55. package/dist/contracts/abis/uniswap-v2-router.d.ts +249 -0
  56. package/dist/contracts/abis/uniswap-v2-router.d.ts.map +1 -0
  57. package/dist/contracts/abis/uniswap-v2-router.js +146 -0
  58. package/dist/contracts/abis/uniswap-v3-factory.d.ts +77 -0
  59. package/dist/contracts/abis/uniswap-v3-factory.d.ts.map +1 -0
  60. package/dist/contracts/abis/uniswap-v3-factory.js +45 -0
  61. package/dist/contracts/abis/uniswap-v3-pool.d.ts +128 -0
  62. package/dist/contracts/abis/uniswap-v3-pool.d.ts.map +1 -0
  63. package/dist/contracts/abis/uniswap-v3-pool.js +81 -0
  64. package/dist/contracts/addresses.d.ts +141 -0
  65. package/dist/contracts/addresses.d.ts.map +1 -0
  66. package/dist/contracts/addresses.js +108 -0
  67. package/dist/contracts/index.d.ts +6 -0
  68. package/dist/contracts/index.d.ts.map +1 -0
  69. package/dist/contracts/index.js +5 -0
  70. package/dist/dex/balance-delta.d.ts +27 -0
  71. package/dist/dex/balance-delta.d.ts.map +1 -0
  72. package/dist/dex/balance-delta.js +45 -0
  73. package/dist/dex/index.d.ts +7 -0
  74. package/dist/dex/index.d.ts.map +1 -0
  75. package/dist/dex/index.js +6 -0
  76. package/dist/dex/pool-key.d.ts +19 -0
  77. package/dist/dex/pool-key.d.ts.map +1 -0
  78. package/dist/dex/pool-key.js +44 -0
  79. package/dist/dex/types.d.ts +71 -0
  80. package/dist/dex/types.d.ts.map +1 -0
  81. package/dist/dex/types.js +28 -0
  82. package/dist/hooks/index.d.ts +10 -0
  83. package/dist/hooks/index.d.ts.map +1 -0
  84. package/dist/hooks/index.js +9 -0
  85. package/dist/hooks/use-pools.d.ts +24 -0
  86. package/dist/hooks/use-pools.d.ts.map +1 -0
  87. package/dist/hooks/use-pools.js +85 -0
  88. package/dist/hooks/use-positions.d.ts +17 -0
  89. package/dist/hooks/use-positions.d.ts.map +1 -0
  90. package/dist/hooks/use-positions.js +65 -0
  91. package/dist/hooks/use-swap-quote.d.ts +19 -0
  92. package/dist/hooks/use-swap-quote.d.ts.map +1 -0
  93. package/dist/hooks/use-swap-quote.js +54 -0
  94. package/dist/hooks/use-swap.d.ts +22 -0
  95. package/dist/hooks/use-swap.d.ts.map +1 -0
  96. package/dist/hooks/use-swap.js +46 -0
  97. package/dist/hooks/use-token-allowance.d.ts +27 -0
  98. package/dist/hooks/use-token-allowance.d.ts.map +1 -0
  99. package/dist/hooks/use-token-allowance.js +59 -0
  100. package/dist/hooks/use-token-balance.d.ts +17 -0
  101. package/dist/hooks/use-token-balance.d.ts.map +1 -0
  102. package/dist/hooks/use-token-balance.js +58 -0
  103. package/dist/index.d.ts +17 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +24 -0
  106. package/dist/stores/index.d.ts +7 -0
  107. package/dist/stores/index.d.ts.map +1 -0
  108. package/dist/stores/index.js +6 -0
  109. package/dist/stores/settings-store.d.ts +25 -0
  110. package/dist/stores/settings-store.d.ts.map +1 -0
  111. package/dist/stores/settings-store.js +16 -0
  112. package/dist/stores/swap-store.d.ts +38 -0
  113. package/dist/stores/swap-store.d.ts.map +1 -0
  114. package/dist/stores/swap-store.js +58 -0
  115. package/dist/stores/token-store.d.ts +21 -0
  116. package/dist/stores/token-store.d.ts.map +1 -0
  117. package/dist/stores/token-store.js +32 -0
  118. package/dist/tokens/index.d.ts +65 -0
  119. package/dist/tokens/index.d.ts.map +1 -0
  120. package/dist/tokens/index.js +185 -0
  121. package/package.json +78 -0
  122. package/src/chains/index.ts +21 -0
  123. package/src/chains/lux.ts +141 -0
  124. package/src/contracts/abis/dex-swap-router.ts +98 -0
  125. package/src/contracts/abis/erc20.ts +96 -0
  126. package/src/contracts/abis/index.ts +17 -0
  127. package/src/contracts/abis/nft-position-manager.ts +146 -0
  128. package/src/contracts/abis/pool-manager.ts +198 -0
  129. package/src/contracts/abis/quoter-v2.ts +68 -0
  130. package/src/contracts/abis/swap-router.ts +75 -0
  131. package/src/contracts/abis/uniswap-v2-factory.ts +49 -0
  132. package/src/contracts/abis/uniswap-v2-pair.ts +85 -0
  133. package/src/contracts/abis/uniswap-v2-router.ts +146 -0
  134. package/src/contracts/abis/uniswap-v3-factory.ts +45 -0
  135. package/src/contracts/abis/uniswap-v3-pool.ts +81 -0
  136. package/src/contracts/addresses.ts +128 -0
  137. package/src/contracts/index.ts +14 -0
  138. package/src/dex/balance-delta.ts +52 -0
  139. package/src/dex/index.ts +7 -0
  140. package/src/dex/pool-key.ts +62 -0
  141. package/src/dex/types.ts +87 -0
  142. package/src/hooks/index.ts +10 -0
  143. package/src/hooks/use-pools.ts +116 -0
  144. package/src/hooks/use-positions.ts +90 -0
  145. package/src/hooks/use-swap-quote.ts +81 -0
  146. package/src/hooks/use-swap.ts +64 -0
  147. package/src/hooks/use-token-allowance.ts +74 -0
  148. package/src/hooks/use-token-balance.ts +71 -0
  149. package/src/index.ts +31 -0
  150. package/src/stores/index.ts +7 -0
  151. package/src/stores/settings-store.ts +54 -0
  152. package/src/stores/swap-store.ts +112 -0
  153. package/src/stores/token-store.ts +62 -0
  154. package/src/tokens/index.ts +220 -0
@@ -0,0 +1,191 @@
1
+ /**
2
+ * PoolManager Precompile ABI (0x0400)
3
+ * Native Uniswap v4-style AMM implementation
4
+ */
5
+ export const POOL_MANAGER_ABI = [
6
+ // Pool initialization
7
+ {
8
+ type: 'function',
9
+ name: 'initialize',
10
+ inputs: [
11
+ {
12
+ name: 'key',
13
+ type: 'tuple',
14
+ components: [
15
+ { name: 'currency0', type: 'address' },
16
+ { name: 'currency1', type: 'address' },
17
+ { name: 'fee', type: 'uint24' },
18
+ { name: 'tickSpacing', type: 'int24' },
19
+ { name: 'hooks', type: 'address' },
20
+ ],
21
+ },
22
+ { name: 'sqrtPriceX96', type: 'uint160' },
23
+ { name: 'hookData', type: 'bytes' },
24
+ ],
25
+ outputs: [{ name: 'tick', type: 'int24' }],
26
+ stateMutability: 'nonpayable',
27
+ },
28
+ // Flash accounting lock
29
+ {
30
+ type: 'function',
31
+ name: 'lock',
32
+ inputs: [{ name: 'data', type: 'bytes' }],
33
+ outputs: [{ name: 'result', type: 'bytes' }],
34
+ stateMutability: 'nonpayable',
35
+ },
36
+ // Swap
37
+ {
38
+ type: 'function',
39
+ name: 'swap',
40
+ inputs: [
41
+ {
42
+ name: 'key',
43
+ type: 'tuple',
44
+ components: [
45
+ { name: 'currency0', type: 'address' },
46
+ { name: 'currency1', type: 'address' },
47
+ { name: 'fee', type: 'uint24' },
48
+ { name: 'tickSpacing', type: 'int24' },
49
+ { name: 'hooks', type: 'address' },
50
+ ],
51
+ },
52
+ {
53
+ name: 'params',
54
+ type: 'tuple',
55
+ components: [
56
+ { name: 'zeroForOne', type: 'bool' },
57
+ { name: 'amountSpecified', type: 'int256' },
58
+ { name: 'sqrtPriceLimitX96', type: 'uint160' },
59
+ ],
60
+ },
61
+ { name: 'hookData', type: 'bytes' },
62
+ ],
63
+ outputs: [{ name: 'delta', type: 'int256' }],
64
+ stateMutability: 'nonpayable',
65
+ },
66
+ // Modify liquidity
67
+ {
68
+ type: 'function',
69
+ name: 'modifyLiquidity',
70
+ inputs: [
71
+ {
72
+ name: 'key',
73
+ type: 'tuple',
74
+ components: [
75
+ { name: 'currency0', type: 'address' },
76
+ { name: 'currency1', type: 'address' },
77
+ { name: 'fee', type: 'uint24' },
78
+ { name: 'tickSpacing', type: 'int24' },
79
+ { name: 'hooks', type: 'address' },
80
+ ],
81
+ },
82
+ {
83
+ name: 'params',
84
+ type: 'tuple',
85
+ components: [
86
+ { name: 'tickLower', type: 'int24' },
87
+ { name: 'tickUpper', type: 'int24' },
88
+ { name: 'liquidityDelta', type: 'int256' },
89
+ { name: 'salt', type: 'bytes32' },
90
+ ],
91
+ },
92
+ { name: 'hookData', type: 'bytes' },
93
+ ],
94
+ outputs: [
95
+ { name: 'delta', type: 'int256' },
96
+ { name: 'feeDelta', type: 'int256' },
97
+ ],
98
+ stateMutability: 'nonpayable',
99
+ },
100
+ // Donate
101
+ {
102
+ type: 'function',
103
+ name: 'donate',
104
+ inputs: [
105
+ {
106
+ name: 'key',
107
+ type: 'tuple',
108
+ components: [
109
+ { name: 'currency0', type: 'address' },
110
+ { name: 'currency1', type: 'address' },
111
+ { name: 'fee', type: 'uint24' },
112
+ { name: 'tickSpacing', type: 'int24' },
113
+ { name: 'hooks', type: 'address' },
114
+ ],
115
+ },
116
+ { name: 'amount0', type: 'uint256' },
117
+ { name: 'amount1', type: 'uint256' },
118
+ { name: 'hookData', type: 'bytes' },
119
+ ],
120
+ outputs: [{ name: 'delta', type: 'int256' }],
121
+ stateMutability: 'nonpayable',
122
+ },
123
+ // Settle and take for flash accounting
124
+ {
125
+ type: 'function',
126
+ name: 'settle',
127
+ inputs: [{ name: 'currency', type: 'address' }],
128
+ outputs: [{ name: 'paid', type: 'uint256' }],
129
+ stateMutability: 'payable',
130
+ },
131
+ {
132
+ type: 'function',
133
+ name: 'take',
134
+ inputs: [
135
+ { name: 'currency', type: 'address' },
136
+ { name: 'to', type: 'address' },
137
+ { name: 'amount', type: 'uint256' },
138
+ ],
139
+ outputs: [],
140
+ stateMutability: 'nonpayable',
141
+ },
142
+ // Pool state queries
143
+ {
144
+ type: 'function',
145
+ name: 'getSlot0',
146
+ inputs: [{ name: 'poolId', type: 'bytes32' }],
147
+ outputs: [
148
+ { name: 'sqrtPriceX96', type: 'uint160' },
149
+ { name: 'tick', type: 'int24' },
150
+ { name: 'protocolFee', type: 'uint24' },
151
+ { name: 'lpFee', type: 'uint24' },
152
+ ],
153
+ stateMutability: 'view',
154
+ },
155
+ {
156
+ type: 'function',
157
+ name: 'getLiquidity',
158
+ inputs: [{ name: 'poolId', type: 'bytes32' }],
159
+ outputs: [{ name: 'liquidity', type: 'uint128' }],
160
+ stateMutability: 'view',
161
+ },
162
+ // Events
163
+ {
164
+ type: 'event',
165
+ name: 'Initialize',
166
+ inputs: [
167
+ { name: 'id', type: 'bytes32', indexed: true },
168
+ { name: 'currency0', type: 'address', indexed: true },
169
+ { name: 'currency1', type: 'address', indexed: true },
170
+ { name: 'fee', type: 'uint24', indexed: false },
171
+ { name: 'tickSpacing', type: 'int24', indexed: false },
172
+ { name: 'hooks', type: 'address', indexed: false },
173
+ { name: 'sqrtPriceX96', type: 'uint160', indexed: false },
174
+ { name: 'tick', type: 'int24', indexed: false },
175
+ ],
176
+ },
177
+ {
178
+ type: 'event',
179
+ name: 'Swap',
180
+ inputs: [
181
+ { name: 'id', type: 'bytes32', indexed: true },
182
+ { name: 'sender', type: 'address', indexed: true },
183
+ { name: 'amount0', type: 'int128', indexed: false },
184
+ { name: 'amount1', type: 'int128', indexed: false },
185
+ { name: 'sqrtPriceX96', type: 'uint160', indexed: false },
186
+ { name: 'liquidity', type: 'uint128', indexed: false },
187
+ { name: 'tick', type: 'int24', indexed: false },
188
+ { name: 'fee', type: 'uint24', indexed: false },
189
+ ],
190
+ },
191
+ ];
@@ -0,0 +1,103 @@
1
+ /**
2
+ * QuoterV2 ABI
3
+ */
4
+ export declare const QUOTER_V2_ABI: readonly [{
5
+ readonly type: "function";
6
+ readonly name: "quoteExactInputSingle";
7
+ readonly inputs: readonly [{
8
+ readonly name: "params";
9
+ readonly type: "tuple";
10
+ readonly components: readonly [{
11
+ readonly name: "tokenIn";
12
+ readonly type: "address";
13
+ }, {
14
+ readonly name: "tokenOut";
15
+ readonly type: "address";
16
+ }, {
17
+ readonly name: "amountIn";
18
+ readonly type: "uint256";
19
+ }, {
20
+ readonly name: "fee";
21
+ readonly type: "uint24";
22
+ }, {
23
+ readonly name: "sqrtPriceLimitX96";
24
+ readonly type: "uint160";
25
+ }];
26
+ }];
27
+ readonly outputs: readonly [{
28
+ readonly name: "amountOut";
29
+ readonly type: "uint256";
30
+ }, {
31
+ readonly name: "sqrtPriceX96After";
32
+ readonly type: "uint160";
33
+ }, {
34
+ readonly name: "initializedTicksCrossed";
35
+ readonly type: "uint32";
36
+ }, {
37
+ readonly name: "gasEstimate";
38
+ readonly type: "uint256";
39
+ }];
40
+ readonly stateMutability: "nonpayable";
41
+ }, {
42
+ readonly type: "function";
43
+ readonly name: "quoteExactOutputSingle";
44
+ readonly inputs: readonly [{
45
+ readonly name: "params";
46
+ readonly type: "tuple";
47
+ readonly components: readonly [{
48
+ readonly name: "tokenIn";
49
+ readonly type: "address";
50
+ }, {
51
+ readonly name: "tokenOut";
52
+ readonly type: "address";
53
+ }, {
54
+ readonly name: "amount";
55
+ readonly type: "uint256";
56
+ }, {
57
+ readonly name: "fee";
58
+ readonly type: "uint24";
59
+ }, {
60
+ readonly name: "sqrtPriceLimitX96";
61
+ readonly type: "uint160";
62
+ }];
63
+ }];
64
+ readonly outputs: readonly [{
65
+ readonly name: "amountIn";
66
+ readonly type: "uint256";
67
+ }, {
68
+ readonly name: "sqrtPriceX96After";
69
+ readonly type: "uint160";
70
+ }, {
71
+ readonly name: "initializedTicksCrossed";
72
+ readonly type: "uint32";
73
+ }, {
74
+ readonly name: "gasEstimate";
75
+ readonly type: "uint256";
76
+ }];
77
+ readonly stateMutability: "nonpayable";
78
+ }, {
79
+ readonly type: "function";
80
+ readonly name: "quoteExactInput";
81
+ readonly inputs: readonly [{
82
+ readonly name: "path";
83
+ readonly type: "bytes";
84
+ }, {
85
+ readonly name: "amountIn";
86
+ readonly type: "uint256";
87
+ }];
88
+ readonly outputs: readonly [{
89
+ readonly name: "amountOut";
90
+ readonly type: "uint256";
91
+ }, {
92
+ readonly name: "sqrtPriceX96AfterList";
93
+ readonly type: "uint160[]";
94
+ }, {
95
+ readonly name: "initializedTicksCrossedList";
96
+ readonly type: "uint32[]";
97
+ }, {
98
+ readonly name: "gasEstimate";
99
+ readonly type: "uint256";
100
+ }];
101
+ readonly stateMutability: "nonpayable";
102
+ }];
103
+ //# sourceMappingURL=quoter-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quoter-v2.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/quoter-v2.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEhB,CAAA"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * QuoterV2 ABI
3
+ */
4
+ export const QUOTER_V2_ABI = [
5
+ {
6
+ type: 'function',
7
+ name: 'quoteExactInputSingle',
8
+ inputs: [
9
+ {
10
+ name: 'params',
11
+ type: 'tuple',
12
+ components: [
13
+ { name: 'tokenIn', type: 'address' },
14
+ { name: 'tokenOut', type: 'address' },
15
+ { name: 'amountIn', type: 'uint256' },
16
+ { name: 'fee', type: 'uint24' },
17
+ { name: 'sqrtPriceLimitX96', type: 'uint160' },
18
+ ],
19
+ },
20
+ ],
21
+ outputs: [
22
+ { name: 'amountOut', type: 'uint256' },
23
+ { name: 'sqrtPriceX96After', type: 'uint160' },
24
+ { name: 'initializedTicksCrossed', type: 'uint32' },
25
+ { name: 'gasEstimate', type: 'uint256' },
26
+ ],
27
+ stateMutability: 'nonpayable',
28
+ },
29
+ {
30
+ type: 'function',
31
+ name: 'quoteExactOutputSingle',
32
+ inputs: [
33
+ {
34
+ name: 'params',
35
+ type: 'tuple',
36
+ components: [
37
+ { name: 'tokenIn', type: 'address' },
38
+ { name: 'tokenOut', type: 'address' },
39
+ { name: 'amount', type: 'uint256' },
40
+ { name: 'fee', type: 'uint24' },
41
+ { name: 'sqrtPriceLimitX96', type: 'uint160' },
42
+ ],
43
+ },
44
+ ],
45
+ outputs: [
46
+ { name: 'amountIn', type: 'uint256' },
47
+ { name: 'sqrtPriceX96After', type: 'uint160' },
48
+ { name: 'initializedTicksCrossed', type: 'uint32' },
49
+ { name: 'gasEstimate', type: 'uint256' },
50
+ ],
51
+ stateMutability: 'nonpayable',
52
+ },
53
+ {
54
+ type: 'function',
55
+ name: 'quoteExactInput',
56
+ inputs: [
57
+ { name: 'path', type: 'bytes' },
58
+ { name: 'amountIn', type: 'uint256' },
59
+ ],
60
+ outputs: [
61
+ { name: 'amountOut', type: 'uint256' },
62
+ { name: 'sqrtPriceX96AfterList', type: 'uint160[]' },
63
+ { name: 'initializedTicksCrossedList', type: 'uint32[]' },
64
+ { name: 'gasEstimate', type: 'uint256' },
65
+ ],
66
+ stateMutability: 'nonpayable',
67
+ },
68
+ ];
@@ -0,0 +1,119 @@
1
+ /**
2
+ * SwapRouter ABI (V3)
3
+ */
4
+ export declare const SWAP_ROUTER_ABI: readonly [{
5
+ readonly type: "function";
6
+ readonly name: "exactInputSingle";
7
+ readonly inputs: readonly [{
8
+ readonly name: "params";
9
+ readonly type: "tuple";
10
+ readonly components: readonly [{
11
+ readonly name: "tokenIn";
12
+ readonly type: "address";
13
+ }, {
14
+ readonly name: "tokenOut";
15
+ readonly type: "address";
16
+ }, {
17
+ readonly name: "fee";
18
+ readonly type: "uint24";
19
+ }, {
20
+ readonly name: "recipient";
21
+ readonly type: "address";
22
+ }, {
23
+ readonly name: "deadline";
24
+ readonly type: "uint256";
25
+ }, {
26
+ readonly name: "amountIn";
27
+ readonly type: "uint256";
28
+ }, {
29
+ readonly name: "amountOutMinimum";
30
+ readonly type: "uint256";
31
+ }, {
32
+ readonly name: "sqrtPriceLimitX96";
33
+ readonly type: "uint160";
34
+ }];
35
+ }];
36
+ readonly outputs: readonly [{
37
+ readonly name: "amountOut";
38
+ readonly type: "uint256";
39
+ }];
40
+ readonly stateMutability: "payable";
41
+ }, {
42
+ readonly type: "function";
43
+ readonly name: "exactOutputSingle";
44
+ readonly inputs: readonly [{
45
+ readonly name: "params";
46
+ readonly type: "tuple";
47
+ readonly components: readonly [{
48
+ readonly name: "tokenIn";
49
+ readonly type: "address";
50
+ }, {
51
+ readonly name: "tokenOut";
52
+ readonly type: "address";
53
+ }, {
54
+ readonly name: "fee";
55
+ readonly type: "uint24";
56
+ }, {
57
+ readonly name: "recipient";
58
+ readonly type: "address";
59
+ }, {
60
+ readonly name: "deadline";
61
+ readonly type: "uint256";
62
+ }, {
63
+ readonly name: "amountOut";
64
+ readonly type: "uint256";
65
+ }, {
66
+ readonly name: "amountInMaximum";
67
+ readonly type: "uint256";
68
+ }, {
69
+ readonly name: "sqrtPriceLimitX96";
70
+ readonly type: "uint160";
71
+ }];
72
+ }];
73
+ readonly outputs: readonly [{
74
+ readonly name: "amountIn";
75
+ readonly type: "uint256";
76
+ }];
77
+ readonly stateMutability: "payable";
78
+ }, {
79
+ readonly type: "function";
80
+ readonly name: "exactInput";
81
+ readonly inputs: readonly [{
82
+ readonly name: "params";
83
+ readonly type: "tuple";
84
+ readonly components: readonly [{
85
+ readonly name: "path";
86
+ readonly type: "bytes";
87
+ }, {
88
+ readonly name: "recipient";
89
+ readonly type: "address";
90
+ }, {
91
+ readonly name: "deadline";
92
+ readonly type: "uint256";
93
+ }, {
94
+ readonly name: "amountIn";
95
+ readonly type: "uint256";
96
+ }, {
97
+ readonly name: "amountOutMinimum";
98
+ readonly type: "uint256";
99
+ }];
100
+ }];
101
+ readonly outputs: readonly [{
102
+ readonly name: "amountOut";
103
+ readonly type: "uint256";
104
+ }];
105
+ readonly stateMutability: "payable";
106
+ }, {
107
+ readonly type: "function";
108
+ readonly name: "multicall";
109
+ readonly inputs: readonly [{
110
+ readonly name: "data";
111
+ readonly type: "bytes[]";
112
+ }];
113
+ readonly outputs: readonly [{
114
+ readonly name: "results";
115
+ readonly type: "bytes[]";
116
+ }];
117
+ readonly stateMutability: "payable";
118
+ }];
119
+ //# sourceMappingURL=swap-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swap-router.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/swap-router.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuElB,CAAA"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * SwapRouter ABI (V3)
3
+ */
4
+ export const SWAP_ROUTER_ABI = [
5
+ {
6
+ type: 'function',
7
+ name: 'exactInputSingle',
8
+ inputs: [
9
+ {
10
+ name: 'params',
11
+ type: 'tuple',
12
+ components: [
13
+ { name: 'tokenIn', type: 'address' },
14
+ { name: 'tokenOut', type: 'address' },
15
+ { name: 'fee', type: 'uint24' },
16
+ { name: 'recipient', type: 'address' },
17
+ { name: 'deadline', type: 'uint256' },
18
+ { name: 'amountIn', type: 'uint256' },
19
+ { name: 'amountOutMinimum', type: 'uint256' },
20
+ { name: 'sqrtPriceLimitX96', type: 'uint160' },
21
+ ],
22
+ },
23
+ ],
24
+ outputs: [{ name: 'amountOut', type: 'uint256' }],
25
+ stateMutability: 'payable',
26
+ },
27
+ {
28
+ type: 'function',
29
+ name: 'exactOutputSingle',
30
+ inputs: [
31
+ {
32
+ name: 'params',
33
+ type: 'tuple',
34
+ components: [
35
+ { name: 'tokenIn', type: 'address' },
36
+ { name: 'tokenOut', type: 'address' },
37
+ { name: 'fee', type: 'uint24' },
38
+ { name: 'recipient', type: 'address' },
39
+ { name: 'deadline', type: 'uint256' },
40
+ { name: 'amountOut', type: 'uint256' },
41
+ { name: 'amountInMaximum', type: 'uint256' },
42
+ { name: 'sqrtPriceLimitX96', type: 'uint160' },
43
+ ],
44
+ },
45
+ ],
46
+ outputs: [{ name: 'amountIn', type: 'uint256' }],
47
+ stateMutability: 'payable',
48
+ },
49
+ {
50
+ type: 'function',
51
+ name: 'exactInput',
52
+ inputs: [
53
+ {
54
+ name: 'params',
55
+ type: 'tuple',
56
+ components: [
57
+ { name: 'path', type: 'bytes' },
58
+ { name: 'recipient', type: 'address' },
59
+ { name: 'deadline', type: 'uint256' },
60
+ { name: 'amountIn', type: 'uint256' },
61
+ { name: 'amountOutMinimum', type: 'uint256' },
62
+ ],
63
+ },
64
+ ],
65
+ outputs: [{ name: 'amountOut', type: 'uint256' }],
66
+ stateMutability: 'payable',
67
+ },
68
+ {
69
+ type: 'function',
70
+ name: 'multicall',
71
+ inputs: [{ name: 'data', type: 'bytes[]' }],
72
+ outputs: [{ name: 'results', type: 'bytes[]' }],
73
+ stateMutability: 'payable',
74
+ },
75
+ ];
@@ -0,0 +1,75 @@
1
+ /**
2
+ * UniswapV2Factory ABI
3
+ */
4
+ export declare const UNISWAP_V2_FACTORY_ABI: readonly [{
5
+ readonly type: "function";
6
+ readonly name: "getPair";
7
+ readonly inputs: readonly [{
8
+ readonly name: "tokenA";
9
+ readonly type: "address";
10
+ }, {
11
+ readonly name: "tokenB";
12
+ readonly type: "address";
13
+ }];
14
+ readonly outputs: readonly [{
15
+ readonly name: "pair";
16
+ readonly type: "address";
17
+ }];
18
+ readonly stateMutability: "view";
19
+ }, {
20
+ readonly type: "function";
21
+ readonly name: "allPairs";
22
+ readonly inputs: readonly [{
23
+ readonly name: "index";
24
+ readonly type: "uint256";
25
+ }];
26
+ readonly outputs: readonly [{
27
+ readonly name: "pair";
28
+ readonly type: "address";
29
+ }];
30
+ readonly stateMutability: "view";
31
+ }, {
32
+ readonly type: "function";
33
+ readonly name: "allPairsLength";
34
+ readonly inputs: readonly [];
35
+ readonly outputs: readonly [{
36
+ readonly type: "uint256";
37
+ }];
38
+ readonly stateMutability: "view";
39
+ }, {
40
+ readonly type: "function";
41
+ readonly name: "createPair";
42
+ readonly inputs: readonly [{
43
+ readonly name: "tokenA";
44
+ readonly type: "address";
45
+ }, {
46
+ readonly name: "tokenB";
47
+ readonly type: "address";
48
+ }];
49
+ readonly outputs: readonly [{
50
+ readonly name: "pair";
51
+ readonly type: "address";
52
+ }];
53
+ readonly stateMutability: "nonpayable";
54
+ }, {
55
+ readonly type: "event";
56
+ readonly name: "PairCreated";
57
+ readonly inputs: readonly [{
58
+ readonly name: "token0";
59
+ readonly type: "address";
60
+ readonly indexed: true;
61
+ }, {
62
+ readonly name: "token1";
63
+ readonly type: "address";
64
+ readonly indexed: true;
65
+ }, {
66
+ readonly name: "pair";
67
+ readonly type: "address";
68
+ readonly indexed: false;
69
+ }, {
70
+ readonly name: "index";
71
+ readonly type: "uint256";
72
+ readonly indexed: false;
73
+ }];
74
+ }];
75
+ //# sourceMappingURL=uniswap-v2-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uniswap-v2-factory.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/uniswap-v2-factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CzB,CAAA"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * UniswapV2Factory ABI
3
+ */
4
+ export const UNISWAP_V2_FACTORY_ABI = [
5
+ {
6
+ type: 'function',
7
+ name: 'getPair',
8
+ inputs: [
9
+ { name: 'tokenA', type: 'address' },
10
+ { name: 'tokenB', type: 'address' },
11
+ ],
12
+ outputs: [{ name: 'pair', type: 'address' }],
13
+ stateMutability: 'view',
14
+ },
15
+ {
16
+ type: 'function',
17
+ name: 'allPairs',
18
+ inputs: [{ name: 'index', type: 'uint256' }],
19
+ outputs: [{ name: 'pair', type: 'address' }],
20
+ stateMutability: 'view',
21
+ },
22
+ {
23
+ type: 'function',
24
+ name: 'allPairsLength',
25
+ inputs: [],
26
+ outputs: [{ type: 'uint256' }],
27
+ stateMutability: 'view',
28
+ },
29
+ {
30
+ type: 'function',
31
+ name: 'createPair',
32
+ inputs: [
33
+ { name: 'tokenA', type: 'address' },
34
+ { name: 'tokenB', type: 'address' },
35
+ ],
36
+ outputs: [{ name: 'pair', type: 'address' }],
37
+ stateMutability: 'nonpayable',
38
+ },
39
+ {
40
+ type: 'event',
41
+ name: 'PairCreated',
42
+ inputs: [
43
+ { name: 'token0', type: 'address', indexed: true },
44
+ { name: 'token1', type: 'address', indexed: true },
45
+ { name: 'pair', type: 'address', indexed: false },
46
+ { name: 'index', type: 'uint256', indexed: false },
47
+ ],
48
+ },
49
+ ];