@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.
- package/dist/bridge/__tests__/use-private-teleport.test.d.ts +2 -0
- package/dist/bridge/__tests__/use-private-teleport.test.d.ts.map +1 -0
- package/dist/bridge/__tests__/use-private-teleport.test.js +272 -0
- package/dist/bridge/cross-chain-store.d.ts +57 -0
- package/dist/bridge/cross-chain-store.d.ts.map +1 -0
- package/dist/bridge/cross-chain-store.js +158 -0
- package/dist/bridge/index.d.ts +78 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +79 -0
- package/dist/bridge/private-teleport-types.d.ts +634 -0
- package/dist/bridge/private-teleport-types.d.ts.map +1 -0
- package/dist/bridge/private-teleport-types.js +308 -0
- package/dist/bridge/types.d.ts +84 -0
- package/dist/bridge/types.d.ts.map +1 -0
- package/dist/bridge/types.js +37 -0
- package/dist/bridge/use-cross-chain-mint.d.ts +34 -0
- package/dist/bridge/use-cross-chain-mint.d.ts.map +1 -0
- package/dist/bridge/use-cross-chain-mint.js +228 -0
- package/dist/bridge/use-private-teleport.d.ts +69 -0
- package/dist/bridge/use-private-teleport.d.ts.map +1 -0
- package/dist/bridge/use-private-teleport.js +666 -0
- package/dist/chains/index.d.ts +6 -0
- package/dist/chains/index.d.ts.map +1 -0
- package/dist/chains/index.js +6 -0
- package/dist/chains/lux.d.ts +508 -0
- package/dist/chains/lux.d.ts.map +1 -0
- package/dist/chains/lux.js +131 -0
- package/dist/contracts/abis/dex-swap-router.d.ts +137 -0
- package/dist/contracts/abis/dex-swap-router.d.ts.map +1 -0
- package/dist/contracts/abis/dex-swap-router.js +95 -0
- package/dist/contracts/abis/erc20.d.ts +136 -0
- package/dist/contracts/abis/erc20.d.ts.map +1 -0
- package/dist/contracts/abis/erc20.js +96 -0
- package/dist/contracts/abis/index.d.ts +15 -0
- package/dist/contracts/abis/index.d.ts.map +1 -0
- package/dist/contracts/abis/index.js +15 -0
- package/dist/contracts/abis/nft-position-manager.d.ts +235 -0
- package/dist/contracts/abis/nft-position-manager.d.ts.map +1 -0
- package/dist/contracts/abis/nft-position-manager.js +146 -0
- package/dist/contracts/abis/pool-manager.d.ts +315 -0
- package/dist/contracts/abis/pool-manager.d.ts.map +1 -0
- package/dist/contracts/abis/pool-manager.js +191 -0
- package/dist/contracts/abis/quoter-v2.d.ts +103 -0
- package/dist/contracts/abis/quoter-v2.d.ts.map +1 -0
- package/dist/contracts/abis/quoter-v2.js +68 -0
- package/dist/contracts/abis/swap-router.d.ts +119 -0
- package/dist/contracts/abis/swap-router.d.ts.map +1 -0
- package/dist/contracts/abis/swap-router.js +75 -0
- package/dist/contracts/abis/uniswap-v2-factory.d.ts +75 -0
- package/dist/contracts/abis/uniswap-v2-factory.d.ts.map +1 -0
- package/dist/contracts/abis/uniswap-v2-factory.js +49 -0
- package/dist/contracts/abis/uniswap-v2-pair.d.ts +119 -0
- package/dist/contracts/abis/uniswap-v2-pair.d.ts.map +1 -0
- package/dist/contracts/abis/uniswap-v2-pair.js +85 -0
- package/dist/contracts/abis/uniswap-v2-router.d.ts +249 -0
- package/dist/contracts/abis/uniswap-v2-router.d.ts.map +1 -0
- package/dist/contracts/abis/uniswap-v2-router.js +146 -0
- package/dist/contracts/abis/uniswap-v3-factory.d.ts +77 -0
- package/dist/contracts/abis/uniswap-v3-factory.d.ts.map +1 -0
- package/dist/contracts/abis/uniswap-v3-factory.js +45 -0
- package/dist/contracts/abis/uniswap-v3-pool.d.ts +128 -0
- package/dist/contracts/abis/uniswap-v3-pool.d.ts.map +1 -0
- package/dist/contracts/abis/uniswap-v3-pool.js +81 -0
- package/dist/contracts/addresses.d.ts +141 -0
- package/dist/contracts/addresses.d.ts.map +1 -0
- package/dist/contracts/addresses.js +108 -0
- package/dist/contracts/index.d.ts +6 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +5 -0
- package/dist/dex/balance-delta.d.ts +27 -0
- package/dist/dex/balance-delta.d.ts.map +1 -0
- package/dist/dex/balance-delta.js +45 -0
- package/dist/dex/index.d.ts +7 -0
- package/dist/dex/index.d.ts.map +1 -0
- package/dist/dex/index.js +6 -0
- package/dist/dex/pool-key.d.ts +19 -0
- package/dist/dex/pool-key.d.ts.map +1 -0
- package/dist/dex/pool-key.js +44 -0
- package/dist/dex/types.d.ts +71 -0
- package/dist/dex/types.d.ts.map +1 -0
- package/dist/dex/types.js +28 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/use-pools.d.ts +24 -0
- package/dist/hooks/use-pools.d.ts.map +1 -0
- package/dist/hooks/use-pools.js +85 -0
- package/dist/hooks/use-positions.d.ts +17 -0
- package/dist/hooks/use-positions.d.ts.map +1 -0
- package/dist/hooks/use-positions.js +65 -0
- package/dist/hooks/use-swap-quote.d.ts +19 -0
- package/dist/hooks/use-swap-quote.d.ts.map +1 -0
- package/dist/hooks/use-swap-quote.js +54 -0
- package/dist/hooks/use-swap.d.ts +22 -0
- package/dist/hooks/use-swap.d.ts.map +1 -0
- package/dist/hooks/use-swap.js +46 -0
- package/dist/hooks/use-token-allowance.d.ts +27 -0
- package/dist/hooks/use-token-allowance.d.ts.map +1 -0
- package/dist/hooks/use-token-allowance.js +59 -0
- package/dist/hooks/use-token-balance.d.ts +17 -0
- package/dist/hooks/use-token-balance.d.ts.map +1 -0
- package/dist/hooks/use-token-balance.js +58 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/stores/index.d.ts +7 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/index.js +6 -0
- package/dist/stores/settings-store.d.ts +25 -0
- package/dist/stores/settings-store.d.ts.map +1 -0
- package/dist/stores/settings-store.js +16 -0
- package/dist/stores/swap-store.d.ts +38 -0
- package/dist/stores/swap-store.d.ts.map +1 -0
- package/dist/stores/swap-store.js +58 -0
- package/dist/stores/token-store.d.ts +21 -0
- package/dist/stores/token-store.d.ts.map +1 -0
- package/dist/stores/token-store.js +32 -0
- package/dist/tokens/index.d.ts +65 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +185 -0
- package/package.json +78 -0
- package/src/chains/index.ts +21 -0
- package/src/chains/lux.ts +141 -0
- package/src/contracts/abis/dex-swap-router.ts +98 -0
- package/src/contracts/abis/erc20.ts +96 -0
- package/src/contracts/abis/index.ts +17 -0
- package/src/contracts/abis/nft-position-manager.ts +146 -0
- package/src/contracts/abis/pool-manager.ts +198 -0
- package/src/contracts/abis/quoter-v2.ts +68 -0
- package/src/contracts/abis/swap-router.ts +75 -0
- package/src/contracts/abis/uniswap-v2-factory.ts +49 -0
- package/src/contracts/abis/uniswap-v2-pair.ts +85 -0
- package/src/contracts/abis/uniswap-v2-router.ts +146 -0
- package/src/contracts/abis/uniswap-v3-factory.ts +45 -0
- package/src/contracts/abis/uniswap-v3-pool.ts +81 -0
- package/src/contracts/addresses.ts +128 -0
- package/src/contracts/index.ts +14 -0
- package/src/dex/balance-delta.ts +52 -0
- package/src/dex/index.ts +7 -0
- package/src/dex/pool-key.ts +62 -0
- package/src/dex/types.ts +87 -0
- package/src/hooks/index.ts +10 -0
- package/src/hooks/use-pools.ts +116 -0
- package/src/hooks/use-positions.ts +90 -0
- package/src/hooks/use-swap-quote.ts +81 -0
- package/src/hooks/use-swap.ts +64 -0
- package/src/hooks/use-token-allowance.ts +74 -0
- package/src/hooks/use-token-balance.ts +71 -0
- package/src/index.ts +31 -0
- package/src/stores/index.ts +7 -0
- package/src/stores/settings-store.ts +54 -0
- package/src/stores/swap-store.ts +112 -0
- package/src/stores/token-store.ts +62 -0
- package/src/tokens/index.ts +220 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UniswapV2Pair ABI
|
|
3
|
+
*/
|
|
4
|
+
export declare const UNISWAP_V2_PAIR_ABI: readonly [{
|
|
5
|
+
readonly type: "function";
|
|
6
|
+
readonly name: "token0";
|
|
7
|
+
readonly inputs: readonly [];
|
|
8
|
+
readonly outputs: readonly [{
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
}];
|
|
11
|
+
readonly stateMutability: "view";
|
|
12
|
+
}, {
|
|
13
|
+
readonly type: "function";
|
|
14
|
+
readonly name: "token1";
|
|
15
|
+
readonly inputs: readonly [];
|
|
16
|
+
readonly outputs: readonly [{
|
|
17
|
+
readonly type: "address";
|
|
18
|
+
}];
|
|
19
|
+
readonly stateMutability: "view";
|
|
20
|
+
}, {
|
|
21
|
+
readonly type: "function";
|
|
22
|
+
readonly name: "getReserves";
|
|
23
|
+
readonly inputs: readonly [];
|
|
24
|
+
readonly outputs: readonly [{
|
|
25
|
+
readonly name: "reserve0";
|
|
26
|
+
readonly type: "uint112";
|
|
27
|
+
}, {
|
|
28
|
+
readonly name: "reserve1";
|
|
29
|
+
readonly type: "uint112";
|
|
30
|
+
}, {
|
|
31
|
+
readonly name: "blockTimestampLast";
|
|
32
|
+
readonly type: "uint32";
|
|
33
|
+
}];
|
|
34
|
+
readonly stateMutability: "view";
|
|
35
|
+
}, {
|
|
36
|
+
readonly type: "function";
|
|
37
|
+
readonly name: "totalSupply";
|
|
38
|
+
readonly inputs: readonly [];
|
|
39
|
+
readonly outputs: readonly [{
|
|
40
|
+
readonly type: "uint256";
|
|
41
|
+
}];
|
|
42
|
+
readonly stateMutability: "view";
|
|
43
|
+
}, {
|
|
44
|
+
readonly type: "function";
|
|
45
|
+
readonly name: "balanceOf";
|
|
46
|
+
readonly inputs: readonly [{
|
|
47
|
+
readonly name: "owner";
|
|
48
|
+
readonly type: "address";
|
|
49
|
+
}];
|
|
50
|
+
readonly outputs: readonly [{
|
|
51
|
+
readonly type: "uint256";
|
|
52
|
+
}];
|
|
53
|
+
readonly stateMutability: "view";
|
|
54
|
+
}, {
|
|
55
|
+
readonly type: "function";
|
|
56
|
+
readonly name: "price0CumulativeLast";
|
|
57
|
+
readonly inputs: readonly [];
|
|
58
|
+
readonly outputs: readonly [{
|
|
59
|
+
readonly type: "uint256";
|
|
60
|
+
}];
|
|
61
|
+
readonly stateMutability: "view";
|
|
62
|
+
}, {
|
|
63
|
+
readonly type: "function";
|
|
64
|
+
readonly name: "price1CumulativeLast";
|
|
65
|
+
readonly inputs: readonly [];
|
|
66
|
+
readonly outputs: readonly [{
|
|
67
|
+
readonly type: "uint256";
|
|
68
|
+
}];
|
|
69
|
+
readonly stateMutability: "view";
|
|
70
|
+
}, {
|
|
71
|
+
readonly type: "function";
|
|
72
|
+
readonly name: "kLast";
|
|
73
|
+
readonly inputs: readonly [];
|
|
74
|
+
readonly outputs: readonly [{
|
|
75
|
+
readonly type: "uint256";
|
|
76
|
+
}];
|
|
77
|
+
readonly stateMutability: "view";
|
|
78
|
+
}, {
|
|
79
|
+
readonly type: "event";
|
|
80
|
+
readonly name: "Swap";
|
|
81
|
+
readonly inputs: readonly [{
|
|
82
|
+
readonly name: "sender";
|
|
83
|
+
readonly type: "address";
|
|
84
|
+
readonly indexed: true;
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "amount0In";
|
|
87
|
+
readonly type: "uint256";
|
|
88
|
+
readonly indexed: false;
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "amount1In";
|
|
91
|
+
readonly type: "uint256";
|
|
92
|
+
readonly indexed: false;
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "amount0Out";
|
|
95
|
+
readonly type: "uint256";
|
|
96
|
+
readonly indexed: false;
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "amount1Out";
|
|
99
|
+
readonly type: "uint256";
|
|
100
|
+
readonly indexed: false;
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "to";
|
|
103
|
+
readonly type: "address";
|
|
104
|
+
readonly indexed: true;
|
|
105
|
+
}];
|
|
106
|
+
}, {
|
|
107
|
+
readonly type: "event";
|
|
108
|
+
readonly name: "Sync";
|
|
109
|
+
readonly inputs: readonly [{
|
|
110
|
+
readonly name: "reserve0";
|
|
111
|
+
readonly type: "uint112";
|
|
112
|
+
readonly indexed: false;
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "reserve1";
|
|
115
|
+
readonly type: "uint112";
|
|
116
|
+
readonly indexed: false;
|
|
117
|
+
}];
|
|
118
|
+
}];
|
|
119
|
+
//# sourceMappingURL=uniswap-v2-pair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniswap-v2-pair.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/uniswap-v2-pair.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFtB,CAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UniswapV2Pair ABI
|
|
3
|
+
*/
|
|
4
|
+
export const UNISWAP_V2_PAIR_ABI = [
|
|
5
|
+
{
|
|
6
|
+
type: 'function',
|
|
7
|
+
name: 'token0',
|
|
8
|
+
inputs: [],
|
|
9
|
+
outputs: [{ type: 'address' }],
|
|
10
|
+
stateMutability: 'view',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
type: 'function',
|
|
14
|
+
name: 'token1',
|
|
15
|
+
inputs: [],
|
|
16
|
+
outputs: [{ type: 'address' }],
|
|
17
|
+
stateMutability: 'view',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'function',
|
|
21
|
+
name: 'getReserves',
|
|
22
|
+
inputs: [],
|
|
23
|
+
outputs: [
|
|
24
|
+
{ name: 'reserve0', type: 'uint112' },
|
|
25
|
+
{ name: 'reserve1', type: 'uint112' },
|
|
26
|
+
{ name: 'blockTimestampLast', type: 'uint32' },
|
|
27
|
+
],
|
|
28
|
+
stateMutability: 'view',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'function',
|
|
32
|
+
name: 'totalSupply',
|
|
33
|
+
inputs: [],
|
|
34
|
+
outputs: [{ type: 'uint256' }],
|
|
35
|
+
stateMutability: 'view',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'function',
|
|
39
|
+
name: 'balanceOf',
|
|
40
|
+
inputs: [{ name: 'owner', type: 'address' }],
|
|
41
|
+
outputs: [{ type: 'uint256' }],
|
|
42
|
+
stateMutability: 'view',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: 'function',
|
|
46
|
+
name: 'price0CumulativeLast',
|
|
47
|
+
inputs: [],
|
|
48
|
+
outputs: [{ type: 'uint256' }],
|
|
49
|
+
stateMutability: 'view',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'function',
|
|
53
|
+
name: 'price1CumulativeLast',
|
|
54
|
+
inputs: [],
|
|
55
|
+
outputs: [{ type: 'uint256' }],
|
|
56
|
+
stateMutability: 'view',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: 'function',
|
|
60
|
+
name: 'kLast',
|
|
61
|
+
inputs: [],
|
|
62
|
+
outputs: [{ type: 'uint256' }],
|
|
63
|
+
stateMutability: 'view',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: 'event',
|
|
67
|
+
name: 'Swap',
|
|
68
|
+
inputs: [
|
|
69
|
+
{ name: 'sender', type: 'address', indexed: true },
|
|
70
|
+
{ name: 'amount0In', type: 'uint256', indexed: false },
|
|
71
|
+
{ name: 'amount1In', type: 'uint256', indexed: false },
|
|
72
|
+
{ name: 'amount0Out', type: 'uint256', indexed: false },
|
|
73
|
+
{ name: 'amount1Out', type: 'uint256', indexed: false },
|
|
74
|
+
{ name: 'to', type: 'address', indexed: true },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'event',
|
|
79
|
+
name: 'Sync',
|
|
80
|
+
inputs: [
|
|
81
|
+
{ name: 'reserve0', type: 'uint112', indexed: false },
|
|
82
|
+
{ name: 'reserve1', type: 'uint112', indexed: false },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
];
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UniswapV2Router02 ABI (used by Lux AMM V2)
|
|
3
|
+
*/
|
|
4
|
+
export declare const UNISWAP_V2_ROUTER_ABI: readonly [{
|
|
5
|
+
readonly type: "function";
|
|
6
|
+
readonly name: "factory";
|
|
7
|
+
readonly inputs: readonly [];
|
|
8
|
+
readonly outputs: readonly [{
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
}];
|
|
11
|
+
readonly stateMutability: "view";
|
|
12
|
+
}, {
|
|
13
|
+
readonly type: "function";
|
|
14
|
+
readonly name: "WETH";
|
|
15
|
+
readonly inputs: readonly [];
|
|
16
|
+
readonly outputs: readonly [{
|
|
17
|
+
readonly type: "address";
|
|
18
|
+
}];
|
|
19
|
+
readonly stateMutability: "view";
|
|
20
|
+
}, {
|
|
21
|
+
readonly type: "function";
|
|
22
|
+
readonly name: "getAmountsOut";
|
|
23
|
+
readonly inputs: readonly [{
|
|
24
|
+
readonly name: "amountIn";
|
|
25
|
+
readonly type: "uint256";
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "path";
|
|
28
|
+
readonly type: "address[]";
|
|
29
|
+
}];
|
|
30
|
+
readonly outputs: readonly [{
|
|
31
|
+
readonly name: "amounts";
|
|
32
|
+
readonly type: "uint256[]";
|
|
33
|
+
}];
|
|
34
|
+
readonly stateMutability: "view";
|
|
35
|
+
}, {
|
|
36
|
+
readonly type: "function";
|
|
37
|
+
readonly name: "getAmountsIn";
|
|
38
|
+
readonly inputs: readonly [{
|
|
39
|
+
readonly name: "amountOut";
|
|
40
|
+
readonly type: "uint256";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "path";
|
|
43
|
+
readonly type: "address[]";
|
|
44
|
+
}];
|
|
45
|
+
readonly outputs: readonly [{
|
|
46
|
+
readonly name: "amounts";
|
|
47
|
+
readonly type: "uint256[]";
|
|
48
|
+
}];
|
|
49
|
+
readonly stateMutability: "view";
|
|
50
|
+
}, {
|
|
51
|
+
readonly type: "function";
|
|
52
|
+
readonly name: "swapExactTokensForTokens";
|
|
53
|
+
readonly inputs: readonly [{
|
|
54
|
+
readonly name: "amountIn";
|
|
55
|
+
readonly type: "uint256";
|
|
56
|
+
}, {
|
|
57
|
+
readonly name: "amountOutMin";
|
|
58
|
+
readonly type: "uint256";
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "path";
|
|
61
|
+
readonly type: "address[]";
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "to";
|
|
64
|
+
readonly type: "address";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "deadline";
|
|
67
|
+
readonly type: "uint256";
|
|
68
|
+
}];
|
|
69
|
+
readonly outputs: readonly [{
|
|
70
|
+
readonly name: "amounts";
|
|
71
|
+
readonly type: "uint256[]";
|
|
72
|
+
}];
|
|
73
|
+
readonly stateMutability: "nonpayable";
|
|
74
|
+
}, {
|
|
75
|
+
readonly type: "function";
|
|
76
|
+
readonly name: "swapTokensForExactTokens";
|
|
77
|
+
readonly inputs: readonly [{
|
|
78
|
+
readonly name: "amountOut";
|
|
79
|
+
readonly type: "uint256";
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "amountInMax";
|
|
82
|
+
readonly type: "uint256";
|
|
83
|
+
}, {
|
|
84
|
+
readonly name: "path";
|
|
85
|
+
readonly type: "address[]";
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "to";
|
|
88
|
+
readonly type: "address";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "deadline";
|
|
91
|
+
readonly type: "uint256";
|
|
92
|
+
}];
|
|
93
|
+
readonly outputs: readonly [{
|
|
94
|
+
readonly name: "amounts";
|
|
95
|
+
readonly type: "uint256[]";
|
|
96
|
+
}];
|
|
97
|
+
readonly stateMutability: "nonpayable";
|
|
98
|
+
}, {
|
|
99
|
+
readonly type: "function";
|
|
100
|
+
readonly name: "swapExactETHForTokens";
|
|
101
|
+
readonly inputs: readonly [{
|
|
102
|
+
readonly name: "amountOutMin";
|
|
103
|
+
readonly type: "uint256";
|
|
104
|
+
}, {
|
|
105
|
+
readonly name: "path";
|
|
106
|
+
readonly type: "address[]";
|
|
107
|
+
}, {
|
|
108
|
+
readonly name: "to";
|
|
109
|
+
readonly type: "address";
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "deadline";
|
|
112
|
+
readonly type: "uint256";
|
|
113
|
+
}];
|
|
114
|
+
readonly outputs: readonly [{
|
|
115
|
+
readonly name: "amounts";
|
|
116
|
+
readonly type: "uint256[]";
|
|
117
|
+
}];
|
|
118
|
+
readonly stateMutability: "payable";
|
|
119
|
+
}, {
|
|
120
|
+
readonly type: "function";
|
|
121
|
+
readonly name: "swapExactTokensForETH";
|
|
122
|
+
readonly inputs: readonly [{
|
|
123
|
+
readonly name: "amountIn";
|
|
124
|
+
readonly type: "uint256";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "amountOutMin";
|
|
127
|
+
readonly type: "uint256";
|
|
128
|
+
}, {
|
|
129
|
+
readonly name: "path";
|
|
130
|
+
readonly type: "address[]";
|
|
131
|
+
}, {
|
|
132
|
+
readonly name: "to";
|
|
133
|
+
readonly type: "address";
|
|
134
|
+
}, {
|
|
135
|
+
readonly name: "deadline";
|
|
136
|
+
readonly type: "uint256";
|
|
137
|
+
}];
|
|
138
|
+
readonly outputs: readonly [{
|
|
139
|
+
readonly name: "amounts";
|
|
140
|
+
readonly type: "uint256[]";
|
|
141
|
+
}];
|
|
142
|
+
readonly stateMutability: "nonpayable";
|
|
143
|
+
}, {
|
|
144
|
+
readonly type: "function";
|
|
145
|
+
readonly name: "addLiquidity";
|
|
146
|
+
readonly inputs: readonly [{
|
|
147
|
+
readonly name: "tokenA";
|
|
148
|
+
readonly type: "address";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "tokenB";
|
|
151
|
+
readonly type: "address";
|
|
152
|
+
}, {
|
|
153
|
+
readonly name: "amountADesired";
|
|
154
|
+
readonly type: "uint256";
|
|
155
|
+
}, {
|
|
156
|
+
readonly name: "amountBDesired";
|
|
157
|
+
readonly type: "uint256";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "amountAMin";
|
|
160
|
+
readonly type: "uint256";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "amountBMin";
|
|
163
|
+
readonly type: "uint256";
|
|
164
|
+
}, {
|
|
165
|
+
readonly name: "to";
|
|
166
|
+
readonly type: "address";
|
|
167
|
+
}, {
|
|
168
|
+
readonly name: "deadline";
|
|
169
|
+
readonly type: "uint256";
|
|
170
|
+
}];
|
|
171
|
+
readonly outputs: readonly [{
|
|
172
|
+
readonly name: "amountA";
|
|
173
|
+
readonly type: "uint256";
|
|
174
|
+
}, {
|
|
175
|
+
readonly name: "amountB";
|
|
176
|
+
readonly type: "uint256";
|
|
177
|
+
}, {
|
|
178
|
+
readonly name: "liquidity";
|
|
179
|
+
readonly type: "uint256";
|
|
180
|
+
}];
|
|
181
|
+
readonly stateMutability: "nonpayable";
|
|
182
|
+
}, {
|
|
183
|
+
readonly type: "function";
|
|
184
|
+
readonly name: "addLiquidityETH";
|
|
185
|
+
readonly inputs: readonly [{
|
|
186
|
+
readonly name: "token";
|
|
187
|
+
readonly type: "address";
|
|
188
|
+
}, {
|
|
189
|
+
readonly name: "amountTokenDesired";
|
|
190
|
+
readonly type: "uint256";
|
|
191
|
+
}, {
|
|
192
|
+
readonly name: "amountTokenMin";
|
|
193
|
+
readonly type: "uint256";
|
|
194
|
+
}, {
|
|
195
|
+
readonly name: "amountETHMin";
|
|
196
|
+
readonly type: "uint256";
|
|
197
|
+
}, {
|
|
198
|
+
readonly name: "to";
|
|
199
|
+
readonly type: "address";
|
|
200
|
+
}, {
|
|
201
|
+
readonly name: "deadline";
|
|
202
|
+
readonly type: "uint256";
|
|
203
|
+
}];
|
|
204
|
+
readonly outputs: readonly [{
|
|
205
|
+
readonly name: "amountToken";
|
|
206
|
+
readonly type: "uint256";
|
|
207
|
+
}, {
|
|
208
|
+
readonly name: "amountETH";
|
|
209
|
+
readonly type: "uint256";
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "liquidity";
|
|
212
|
+
readonly type: "uint256";
|
|
213
|
+
}];
|
|
214
|
+
readonly stateMutability: "payable";
|
|
215
|
+
}, {
|
|
216
|
+
readonly type: "function";
|
|
217
|
+
readonly name: "removeLiquidity";
|
|
218
|
+
readonly inputs: readonly [{
|
|
219
|
+
readonly name: "tokenA";
|
|
220
|
+
readonly type: "address";
|
|
221
|
+
}, {
|
|
222
|
+
readonly name: "tokenB";
|
|
223
|
+
readonly type: "address";
|
|
224
|
+
}, {
|
|
225
|
+
readonly name: "liquidity";
|
|
226
|
+
readonly type: "uint256";
|
|
227
|
+
}, {
|
|
228
|
+
readonly name: "amountAMin";
|
|
229
|
+
readonly type: "uint256";
|
|
230
|
+
}, {
|
|
231
|
+
readonly name: "amountBMin";
|
|
232
|
+
readonly type: "uint256";
|
|
233
|
+
}, {
|
|
234
|
+
readonly name: "to";
|
|
235
|
+
readonly type: "address";
|
|
236
|
+
}, {
|
|
237
|
+
readonly name: "deadline";
|
|
238
|
+
readonly type: "uint256";
|
|
239
|
+
}];
|
|
240
|
+
readonly outputs: readonly [{
|
|
241
|
+
readonly name: "amountA";
|
|
242
|
+
readonly type: "uint256";
|
|
243
|
+
}, {
|
|
244
|
+
readonly name: "amountB";
|
|
245
|
+
readonly type: "uint256";
|
|
246
|
+
}];
|
|
247
|
+
readonly stateMutability: "nonpayable";
|
|
248
|
+
}];
|
|
249
|
+
//# sourceMappingURL=uniswap-v2-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniswap-v2-router.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/uniswap-v2-router.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8IxB,CAAA"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UniswapV2Router02 ABI (used by Lux AMM V2)
|
|
3
|
+
*/
|
|
4
|
+
export const UNISWAP_V2_ROUTER_ABI = [
|
|
5
|
+
{
|
|
6
|
+
type: 'function',
|
|
7
|
+
name: 'factory',
|
|
8
|
+
inputs: [],
|
|
9
|
+
outputs: [{ type: 'address' }],
|
|
10
|
+
stateMutability: 'view',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
type: 'function',
|
|
14
|
+
name: 'WETH',
|
|
15
|
+
inputs: [],
|
|
16
|
+
outputs: [{ type: 'address' }],
|
|
17
|
+
stateMutability: 'view',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'function',
|
|
21
|
+
name: 'getAmountsOut',
|
|
22
|
+
inputs: [
|
|
23
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
24
|
+
{ name: 'path', type: 'address[]' },
|
|
25
|
+
],
|
|
26
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
27
|
+
stateMutability: 'view',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'function',
|
|
31
|
+
name: 'getAmountsIn',
|
|
32
|
+
inputs: [
|
|
33
|
+
{ name: 'amountOut', type: 'uint256' },
|
|
34
|
+
{ name: 'path', type: 'address[]' },
|
|
35
|
+
],
|
|
36
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
37
|
+
stateMutability: 'view',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 'function',
|
|
41
|
+
name: 'swapExactTokensForTokens',
|
|
42
|
+
inputs: [
|
|
43
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
44
|
+
{ name: 'amountOutMin', type: 'uint256' },
|
|
45
|
+
{ name: 'path', type: 'address[]' },
|
|
46
|
+
{ name: 'to', type: 'address' },
|
|
47
|
+
{ name: 'deadline', type: 'uint256' },
|
|
48
|
+
],
|
|
49
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
50
|
+
stateMutability: 'nonpayable',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: 'function',
|
|
54
|
+
name: 'swapTokensForExactTokens',
|
|
55
|
+
inputs: [
|
|
56
|
+
{ name: 'amountOut', type: 'uint256' },
|
|
57
|
+
{ name: 'amountInMax', type: 'uint256' },
|
|
58
|
+
{ name: 'path', type: 'address[]' },
|
|
59
|
+
{ name: 'to', type: 'address' },
|
|
60
|
+
{ name: 'deadline', type: 'uint256' },
|
|
61
|
+
],
|
|
62
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
63
|
+
stateMutability: 'nonpayable',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: 'function',
|
|
67
|
+
name: 'swapExactETHForTokens',
|
|
68
|
+
inputs: [
|
|
69
|
+
{ name: 'amountOutMin', type: 'uint256' },
|
|
70
|
+
{ name: 'path', type: 'address[]' },
|
|
71
|
+
{ name: 'to', type: 'address' },
|
|
72
|
+
{ name: 'deadline', type: 'uint256' },
|
|
73
|
+
],
|
|
74
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
75
|
+
stateMutability: 'payable',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'function',
|
|
79
|
+
name: 'swapExactTokensForETH',
|
|
80
|
+
inputs: [
|
|
81
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
82
|
+
{ name: 'amountOutMin', type: 'uint256' },
|
|
83
|
+
{ name: 'path', type: 'address[]' },
|
|
84
|
+
{ name: 'to', type: 'address' },
|
|
85
|
+
{ name: 'deadline', type: 'uint256' },
|
|
86
|
+
],
|
|
87
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
88
|
+
stateMutability: 'nonpayable',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'function',
|
|
92
|
+
name: 'addLiquidity',
|
|
93
|
+
inputs: [
|
|
94
|
+
{ name: 'tokenA', type: 'address' },
|
|
95
|
+
{ name: 'tokenB', type: 'address' },
|
|
96
|
+
{ name: 'amountADesired', type: 'uint256' },
|
|
97
|
+
{ name: 'amountBDesired', type: 'uint256' },
|
|
98
|
+
{ name: 'amountAMin', type: 'uint256' },
|
|
99
|
+
{ name: 'amountBMin', type: 'uint256' },
|
|
100
|
+
{ name: 'to', type: 'address' },
|
|
101
|
+
{ name: 'deadline', type: 'uint256' },
|
|
102
|
+
],
|
|
103
|
+
outputs: [
|
|
104
|
+
{ name: 'amountA', type: 'uint256' },
|
|
105
|
+
{ name: 'amountB', type: 'uint256' },
|
|
106
|
+
{ name: 'liquidity', type: 'uint256' },
|
|
107
|
+
],
|
|
108
|
+
stateMutability: 'nonpayable',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: 'function',
|
|
112
|
+
name: 'addLiquidityETH',
|
|
113
|
+
inputs: [
|
|
114
|
+
{ name: 'token', type: 'address' },
|
|
115
|
+
{ name: 'amountTokenDesired', type: 'uint256' },
|
|
116
|
+
{ name: 'amountTokenMin', type: 'uint256' },
|
|
117
|
+
{ name: 'amountETHMin', type: 'uint256' },
|
|
118
|
+
{ name: 'to', type: 'address' },
|
|
119
|
+
{ name: 'deadline', type: 'uint256' },
|
|
120
|
+
],
|
|
121
|
+
outputs: [
|
|
122
|
+
{ name: 'amountToken', type: 'uint256' },
|
|
123
|
+
{ name: 'amountETH', type: 'uint256' },
|
|
124
|
+
{ name: 'liquidity', type: 'uint256' },
|
|
125
|
+
],
|
|
126
|
+
stateMutability: 'payable',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: 'function',
|
|
130
|
+
name: 'removeLiquidity',
|
|
131
|
+
inputs: [
|
|
132
|
+
{ name: 'tokenA', type: 'address' },
|
|
133
|
+
{ name: 'tokenB', type: 'address' },
|
|
134
|
+
{ name: 'liquidity', type: 'uint256' },
|
|
135
|
+
{ name: 'amountAMin', type: 'uint256' },
|
|
136
|
+
{ name: 'amountBMin', type: 'uint256' },
|
|
137
|
+
{ name: 'to', type: 'address' },
|
|
138
|
+
{ name: 'deadline', type: 'uint256' },
|
|
139
|
+
],
|
|
140
|
+
outputs: [
|
|
141
|
+
{ name: 'amountA', type: 'uint256' },
|
|
142
|
+
{ name: 'amountB', type: 'uint256' },
|
|
143
|
+
],
|
|
144
|
+
stateMutability: 'nonpayable',
|
|
145
|
+
},
|
|
146
|
+
];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UniswapV3Factory ABI
|
|
3
|
+
*/
|
|
4
|
+
export declare const UNISWAP_V3_FACTORY_ABI: readonly [{
|
|
5
|
+
readonly type: "function";
|
|
6
|
+
readonly name: "getPool";
|
|
7
|
+
readonly inputs: readonly [{
|
|
8
|
+
readonly name: "tokenA";
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: "tokenB";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "fee";
|
|
15
|
+
readonly type: "uint24";
|
|
16
|
+
}];
|
|
17
|
+
readonly outputs: readonly [{
|
|
18
|
+
readonly name: "pool";
|
|
19
|
+
readonly type: "address";
|
|
20
|
+
}];
|
|
21
|
+
readonly stateMutability: "view";
|
|
22
|
+
}, {
|
|
23
|
+
readonly type: "function";
|
|
24
|
+
readonly name: "createPool";
|
|
25
|
+
readonly inputs: readonly [{
|
|
26
|
+
readonly name: "tokenA";
|
|
27
|
+
readonly type: "address";
|
|
28
|
+
}, {
|
|
29
|
+
readonly name: "tokenB";
|
|
30
|
+
readonly type: "address";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "fee";
|
|
33
|
+
readonly type: "uint24";
|
|
34
|
+
}];
|
|
35
|
+
readonly outputs: readonly [{
|
|
36
|
+
readonly name: "pool";
|
|
37
|
+
readonly type: "address";
|
|
38
|
+
}];
|
|
39
|
+
readonly stateMutability: "nonpayable";
|
|
40
|
+
}, {
|
|
41
|
+
readonly type: "function";
|
|
42
|
+
readonly name: "feeAmountTickSpacing";
|
|
43
|
+
readonly inputs: readonly [{
|
|
44
|
+
readonly name: "fee";
|
|
45
|
+
readonly type: "uint24";
|
|
46
|
+
}];
|
|
47
|
+
readonly outputs: readonly [{
|
|
48
|
+
readonly name: "tickSpacing";
|
|
49
|
+
readonly type: "int24";
|
|
50
|
+
}];
|
|
51
|
+
readonly stateMutability: "view";
|
|
52
|
+
}, {
|
|
53
|
+
readonly type: "event";
|
|
54
|
+
readonly name: "PoolCreated";
|
|
55
|
+
readonly inputs: readonly [{
|
|
56
|
+
readonly name: "token0";
|
|
57
|
+
readonly type: "address";
|
|
58
|
+
readonly indexed: true;
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "token1";
|
|
61
|
+
readonly type: "address";
|
|
62
|
+
readonly indexed: true;
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "fee";
|
|
65
|
+
readonly type: "uint24";
|
|
66
|
+
readonly indexed: true;
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "tickSpacing";
|
|
69
|
+
readonly type: "int24";
|
|
70
|
+
readonly indexed: false;
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "pool";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
readonly indexed: false;
|
|
75
|
+
}];
|
|
76
|
+
}];
|
|
77
|
+
//# sourceMappingURL=uniswap-v3-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniswap-v3-factory.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/uniswap-v3-factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCzB,CAAA"}
|