@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,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chain definitions for Lux Exchange
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
luxMainnet,
|
|
7
|
+
luxTestnet,
|
|
8
|
+
zooMainnet,
|
|
9
|
+
zooTestnet,
|
|
10
|
+
luxDev,
|
|
11
|
+
supportedChains,
|
|
12
|
+
LUX_MAINNET_ID,
|
|
13
|
+
LUX_TESTNET_ID,
|
|
14
|
+
ZOO_MAINNET_ID,
|
|
15
|
+
ZOO_TESTNET_ID,
|
|
16
|
+
LUX_DEV_ID,
|
|
17
|
+
type SupportedChainId,
|
|
18
|
+
} from './lux'
|
|
19
|
+
|
|
20
|
+
// Re-export common chains from wagmi for external chain support
|
|
21
|
+
export { mainnet, sepolia, arbitrum, optimism, polygon, base } from 'wagmi/chains'
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lux Chain Definitions
|
|
3
|
+
* Native chain definitions for Lux Exchange
|
|
4
|
+
*/
|
|
5
|
+
import { defineChain } from 'viem'
|
|
6
|
+
import type { Chain } from 'viem'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Lux Mainnet Chain Definition
|
|
10
|
+
*/
|
|
11
|
+
export const luxMainnet = defineChain({
|
|
12
|
+
id: 96369,
|
|
13
|
+
name: 'Lux Mainnet',
|
|
14
|
+
nativeCurrency: {
|
|
15
|
+
name: 'LUX',
|
|
16
|
+
symbol: 'LUX',
|
|
17
|
+
decimals: 18,
|
|
18
|
+
},
|
|
19
|
+
rpcUrls: {
|
|
20
|
+
default: { http: ['https://api.lux.network/rpc'] },
|
|
21
|
+
public: { http: ['https://api.lux.network/rpc'] },
|
|
22
|
+
},
|
|
23
|
+
blockExplorers: {
|
|
24
|
+
default: { name: 'Lux Explorer', url: 'https://explore.lux.network' },
|
|
25
|
+
},
|
|
26
|
+
contracts: {
|
|
27
|
+
multicall3: {
|
|
28
|
+
address: '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Lux Testnet Chain Definition
|
|
35
|
+
*/
|
|
36
|
+
export const luxTestnet = defineChain({
|
|
37
|
+
id: 96368,
|
|
38
|
+
name: 'Lux Testnet',
|
|
39
|
+
nativeCurrency: {
|
|
40
|
+
name: 'LUX',
|
|
41
|
+
symbol: 'LUX',
|
|
42
|
+
decimals: 18,
|
|
43
|
+
},
|
|
44
|
+
rpcUrls: {
|
|
45
|
+
default: { http: ['https://api.lux-test.network/rpc'] },
|
|
46
|
+
public: { http: ['https://api.lux-test.network/rpc'] },
|
|
47
|
+
},
|
|
48
|
+
blockExplorers: {
|
|
49
|
+
default: { name: 'Lux Testnet Explorer', url: 'https://explore.lux-test.network' },
|
|
50
|
+
},
|
|
51
|
+
contracts: {
|
|
52
|
+
multicall3: {
|
|
53
|
+
address: '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
testnet: true,
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Zoo Mainnet Chain Definition
|
|
61
|
+
*/
|
|
62
|
+
export const zooMainnet = defineChain({
|
|
63
|
+
id: 200200,
|
|
64
|
+
name: 'Zoo Network',
|
|
65
|
+
nativeCurrency: {
|
|
66
|
+
name: 'ZOO',
|
|
67
|
+
symbol: 'ZOO',
|
|
68
|
+
decimals: 18,
|
|
69
|
+
},
|
|
70
|
+
rpcUrls: {
|
|
71
|
+
default: { http: ['https://api.zoo.network/rpc'] },
|
|
72
|
+
public: { http: ['https://api.zoo.network/rpc'] },
|
|
73
|
+
},
|
|
74
|
+
blockExplorers: {
|
|
75
|
+
default: { name: 'Zoo Explorer', url: 'https://explore.zoo.network' },
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Zoo Testnet Chain Definition
|
|
81
|
+
*/
|
|
82
|
+
export const zooTestnet = defineChain({
|
|
83
|
+
id: 200201,
|
|
84
|
+
name: 'Zoo Testnet',
|
|
85
|
+
nativeCurrency: {
|
|
86
|
+
name: 'ZOO',
|
|
87
|
+
symbol: 'ZOO',
|
|
88
|
+
decimals: 18,
|
|
89
|
+
},
|
|
90
|
+
rpcUrls: {
|
|
91
|
+
default: { http: ['https://api.zoo-test.network/rpc'] },
|
|
92
|
+
public: { http: ['https://api.zoo-test.network/rpc'] },
|
|
93
|
+
},
|
|
94
|
+
blockExplorers: {
|
|
95
|
+
default: { name: 'Zoo Testnet Explorer', url: 'https://explore.zoo-test.network' },
|
|
96
|
+
},
|
|
97
|
+
testnet: true,
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Dev Chain Definition (for running local node with --dev)
|
|
102
|
+
*/
|
|
103
|
+
export const luxDev = defineChain({
|
|
104
|
+
id: 1337,
|
|
105
|
+
name: 'Lux Dev',
|
|
106
|
+
nativeCurrency: {
|
|
107
|
+
name: 'LUX',
|
|
108
|
+
symbol: 'LUX',
|
|
109
|
+
decimals: 18,
|
|
110
|
+
},
|
|
111
|
+
rpcUrls: {
|
|
112
|
+
default: { http: ['http://localhost:8545/ext/bc/C/rpc'] },
|
|
113
|
+
public: { http: ['http://localhost:8545/ext/bc/C/rpc'] },
|
|
114
|
+
},
|
|
115
|
+
blockExplorers: {
|
|
116
|
+
default: { name: 'Dev', url: 'http://localhost:8545' },
|
|
117
|
+
},
|
|
118
|
+
testnet: false,
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Chain IDs
|
|
123
|
+
*/
|
|
124
|
+
export const LUX_MAINNET_ID = 96369
|
|
125
|
+
export const LUX_TESTNET_ID = 96368
|
|
126
|
+
export const ZOO_MAINNET_ID = 200200
|
|
127
|
+
export const ZOO_TESTNET_ID = 200201
|
|
128
|
+
export const LUX_DEV_ID = 1337
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* All supported chains
|
|
132
|
+
*/
|
|
133
|
+
export const supportedChains = [
|
|
134
|
+
luxMainnet,
|
|
135
|
+
luxTestnet,
|
|
136
|
+
zooMainnet,
|
|
137
|
+
zooTestnet,
|
|
138
|
+
luxDev,
|
|
139
|
+
] as const
|
|
140
|
+
|
|
141
|
+
export type SupportedChainId = typeof supportedChains[number]['id']
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DEX SwapRouter Precompile ABI (0x0401)
|
|
3
|
+
* Optimized swap routing via native precompile
|
|
4
|
+
*/
|
|
5
|
+
export const DEX_SWAP_ROUTER_ABI = [
|
|
6
|
+
// Exact input single swap
|
|
7
|
+
{
|
|
8
|
+
type: 'function',
|
|
9
|
+
name: 'exactInputSingle',
|
|
10
|
+
inputs: [
|
|
11
|
+
{
|
|
12
|
+
name: 'params',
|
|
13
|
+
type: 'tuple',
|
|
14
|
+
components: [
|
|
15
|
+
{
|
|
16
|
+
name: 'poolKey',
|
|
17
|
+
type: 'tuple',
|
|
18
|
+
components: [
|
|
19
|
+
{ name: 'currency0', type: 'address' },
|
|
20
|
+
{ name: 'currency1', type: 'address' },
|
|
21
|
+
{ name: 'fee', type: 'uint24' },
|
|
22
|
+
{ name: 'tickSpacing', type: 'int24' },
|
|
23
|
+
{ name: 'hooks', type: 'address' },
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{ name: 'zeroForOne', type: 'bool' },
|
|
27
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
28
|
+
{ name: 'amountOutMinimum', type: 'uint256' },
|
|
29
|
+
{ name: 'sqrtPriceLimitX96', type: 'uint160' },
|
|
30
|
+
{ name: 'hookData', type: 'bytes' },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
outputs: [{ name: 'amountOut', type: 'uint256' }],
|
|
35
|
+
stateMutability: 'payable',
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
// Exact output single swap
|
|
39
|
+
{
|
|
40
|
+
type: 'function',
|
|
41
|
+
name: 'exactOutputSingle',
|
|
42
|
+
inputs: [
|
|
43
|
+
{
|
|
44
|
+
name: 'params',
|
|
45
|
+
type: 'tuple',
|
|
46
|
+
components: [
|
|
47
|
+
{
|
|
48
|
+
name: 'poolKey',
|
|
49
|
+
type: 'tuple',
|
|
50
|
+
components: [
|
|
51
|
+
{ name: 'currency0', type: 'address' },
|
|
52
|
+
{ name: 'currency1', type: 'address' },
|
|
53
|
+
{ name: 'fee', type: 'uint24' },
|
|
54
|
+
{ name: 'tickSpacing', type: 'int24' },
|
|
55
|
+
{ name: 'hooks', type: 'address' },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{ name: 'zeroForOne', type: 'bool' },
|
|
59
|
+
{ name: 'amountOut', type: 'uint256' },
|
|
60
|
+
{ name: 'amountInMaximum', type: 'uint256' },
|
|
61
|
+
{ name: 'sqrtPriceLimitX96', type: 'uint160' },
|
|
62
|
+
{ name: 'hookData', type: 'bytes' },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
outputs: [{ name: 'amountIn', type: 'uint256' }],
|
|
67
|
+
stateMutability: 'payable',
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
// Multi-hop exact input
|
|
71
|
+
{
|
|
72
|
+
type: 'function',
|
|
73
|
+
name: 'exactInput',
|
|
74
|
+
inputs: [
|
|
75
|
+
{
|
|
76
|
+
name: 'params',
|
|
77
|
+
type: 'tuple',
|
|
78
|
+
components: [
|
|
79
|
+
{ name: 'path', type: 'bytes' },
|
|
80
|
+
{ name: 'recipient', type: 'address' },
|
|
81
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
82
|
+
{ name: 'amountOutMinimum', type: 'uint256' },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
outputs: [{ name: 'amountOut', type: 'uint256' }],
|
|
87
|
+
stateMutability: 'payable',
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
// Swap callback (called by PoolManager)
|
|
91
|
+
{
|
|
92
|
+
type: 'function',
|
|
93
|
+
name: 'lockAcquired',
|
|
94
|
+
inputs: [{ name: 'data', type: 'bytes' }],
|
|
95
|
+
outputs: [{ name: 'result', type: 'bytes' }],
|
|
96
|
+
stateMutability: 'nonpayable',
|
|
97
|
+
},
|
|
98
|
+
] as const
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export const ERC20_ABI = [
|
|
2
|
+
{
|
|
3
|
+
type: 'function',
|
|
4
|
+
name: 'name',
|
|
5
|
+
inputs: [],
|
|
6
|
+
outputs: [{ type: 'string' }],
|
|
7
|
+
stateMutability: 'view',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: 'function',
|
|
11
|
+
name: 'symbol',
|
|
12
|
+
inputs: [],
|
|
13
|
+
outputs: [{ type: 'string' }],
|
|
14
|
+
stateMutability: 'view',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'function',
|
|
18
|
+
name: 'decimals',
|
|
19
|
+
inputs: [],
|
|
20
|
+
outputs: [{ type: 'uint8' }],
|
|
21
|
+
stateMutability: 'view',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'function',
|
|
25
|
+
name: 'totalSupply',
|
|
26
|
+
inputs: [],
|
|
27
|
+
outputs: [{ type: 'uint256' }],
|
|
28
|
+
stateMutability: 'view',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'function',
|
|
32
|
+
name: 'balanceOf',
|
|
33
|
+
inputs: [{ name: 'account', type: 'address' }],
|
|
34
|
+
outputs: [{ type: 'uint256' }],
|
|
35
|
+
stateMutability: 'view',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'function',
|
|
39
|
+
name: 'allowance',
|
|
40
|
+
inputs: [
|
|
41
|
+
{ name: 'owner', type: 'address' },
|
|
42
|
+
{ name: 'spender', type: 'address' },
|
|
43
|
+
],
|
|
44
|
+
outputs: [{ type: 'uint256' }],
|
|
45
|
+
stateMutability: 'view',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: 'function',
|
|
49
|
+
name: 'approve',
|
|
50
|
+
inputs: [
|
|
51
|
+
{ name: 'spender', type: 'address' },
|
|
52
|
+
{ name: 'amount', type: 'uint256' },
|
|
53
|
+
],
|
|
54
|
+
outputs: [{ type: 'bool' }],
|
|
55
|
+
stateMutability: 'nonpayable',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: 'function',
|
|
59
|
+
name: 'transfer',
|
|
60
|
+
inputs: [
|
|
61
|
+
{ name: 'to', type: 'address' },
|
|
62
|
+
{ name: 'amount', type: 'uint256' },
|
|
63
|
+
],
|
|
64
|
+
outputs: [{ type: 'bool' }],
|
|
65
|
+
stateMutability: 'nonpayable',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'function',
|
|
69
|
+
name: 'transferFrom',
|
|
70
|
+
inputs: [
|
|
71
|
+
{ name: 'from', type: 'address' },
|
|
72
|
+
{ name: 'to', type: 'address' },
|
|
73
|
+
{ name: 'amount', type: 'uint256' },
|
|
74
|
+
],
|
|
75
|
+
outputs: [{ type: 'bool' }],
|
|
76
|
+
stateMutability: 'nonpayable',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'event',
|
|
80
|
+
name: 'Transfer',
|
|
81
|
+
inputs: [
|
|
82
|
+
{ name: 'from', type: 'address', indexed: true },
|
|
83
|
+
{ name: 'to', type: 'address', indexed: true },
|
|
84
|
+
{ name: 'value', type: 'uint256', indexed: false },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'event',
|
|
89
|
+
name: 'Approval',
|
|
90
|
+
inputs: [
|
|
91
|
+
{ name: 'owner', type: 'address', indexed: true },
|
|
92
|
+
{ name: 'spender', type: 'address', indexed: true },
|
|
93
|
+
{ name: 'value', type: 'uint256', indexed: false },
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
] as const
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract ABIs for Lux Exchange
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { UNISWAP_V2_ROUTER_ABI } from './uniswap-v2-router'
|
|
6
|
+
export { UNISWAP_V2_FACTORY_ABI } from './uniswap-v2-factory'
|
|
7
|
+
export { UNISWAP_V2_PAIR_ABI } from './uniswap-v2-pair'
|
|
8
|
+
export { UNISWAP_V3_FACTORY_ABI } from './uniswap-v3-factory'
|
|
9
|
+
export { UNISWAP_V3_POOL_ABI } from './uniswap-v3-pool'
|
|
10
|
+
export { SWAP_ROUTER_ABI } from './swap-router'
|
|
11
|
+
export { QUOTER_V2_ABI } from './quoter-v2'
|
|
12
|
+
export { NFT_POSITION_MANAGER_ABI } from './nft-position-manager'
|
|
13
|
+
export { ERC20_ABI } from './erc20'
|
|
14
|
+
|
|
15
|
+
// DEX Precompile ABIs
|
|
16
|
+
export { POOL_MANAGER_ABI } from './pool-manager'
|
|
17
|
+
export { DEX_SWAP_ROUTER_ABI } from './dex-swap-router'
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NonfungiblePositionManager ABI
|
|
3
|
+
*/
|
|
4
|
+
export const NFT_POSITION_MANAGER_ABI = [
|
|
5
|
+
{
|
|
6
|
+
type: 'function',
|
|
7
|
+
name: 'positions',
|
|
8
|
+
inputs: [{ name: 'tokenId', type: 'uint256' }],
|
|
9
|
+
outputs: [
|
|
10
|
+
{ name: 'nonce', type: 'uint96' },
|
|
11
|
+
{ name: 'operator', type: 'address' },
|
|
12
|
+
{ name: 'token0', type: 'address' },
|
|
13
|
+
{ name: 'token1', type: 'address' },
|
|
14
|
+
{ name: 'fee', type: 'uint24' },
|
|
15
|
+
{ name: 'tickLower', type: 'int24' },
|
|
16
|
+
{ name: 'tickUpper', type: 'int24' },
|
|
17
|
+
{ name: 'liquidity', type: 'uint128' },
|
|
18
|
+
{ name: 'feeGrowthInside0LastX128', type: 'uint256' },
|
|
19
|
+
{ name: 'feeGrowthInside1LastX128', type: 'uint256' },
|
|
20
|
+
{ name: 'tokensOwed0', type: 'uint128' },
|
|
21
|
+
{ name: 'tokensOwed1', type: 'uint128' },
|
|
22
|
+
],
|
|
23
|
+
stateMutability: 'view',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'function',
|
|
27
|
+
name: 'mint',
|
|
28
|
+
inputs: [
|
|
29
|
+
{
|
|
30
|
+
name: 'params',
|
|
31
|
+
type: 'tuple',
|
|
32
|
+
components: [
|
|
33
|
+
{ name: 'token0', type: 'address' },
|
|
34
|
+
{ name: 'token1', type: 'address' },
|
|
35
|
+
{ name: 'fee', type: 'uint24' },
|
|
36
|
+
{ name: 'tickLower', type: 'int24' },
|
|
37
|
+
{ name: 'tickUpper', type: 'int24' },
|
|
38
|
+
{ name: 'amount0Desired', type: 'uint256' },
|
|
39
|
+
{ name: 'amount1Desired', type: 'uint256' },
|
|
40
|
+
{ name: 'amount0Min', type: 'uint256' },
|
|
41
|
+
{ name: 'amount1Min', type: 'uint256' },
|
|
42
|
+
{ name: 'recipient', type: 'address' },
|
|
43
|
+
{ name: 'deadline', type: 'uint256' },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
outputs: [
|
|
48
|
+
{ name: 'tokenId', type: 'uint256' },
|
|
49
|
+
{ name: 'liquidity', type: 'uint128' },
|
|
50
|
+
{ name: 'amount0', type: 'uint256' },
|
|
51
|
+
{ name: 'amount1', type: 'uint256' },
|
|
52
|
+
],
|
|
53
|
+
stateMutability: 'payable',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: 'function',
|
|
57
|
+
name: 'increaseLiquidity',
|
|
58
|
+
inputs: [
|
|
59
|
+
{
|
|
60
|
+
name: 'params',
|
|
61
|
+
type: 'tuple',
|
|
62
|
+
components: [
|
|
63
|
+
{ name: 'tokenId', type: 'uint256' },
|
|
64
|
+
{ name: 'amount0Desired', type: 'uint256' },
|
|
65
|
+
{ name: 'amount1Desired', type: 'uint256' },
|
|
66
|
+
{ name: 'amount0Min', type: 'uint256' },
|
|
67
|
+
{ name: 'amount1Min', type: 'uint256' },
|
|
68
|
+
{ name: 'deadline', type: 'uint256' },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
outputs: [
|
|
73
|
+
{ name: 'liquidity', type: 'uint128' },
|
|
74
|
+
{ name: 'amount0', type: 'uint256' },
|
|
75
|
+
{ name: 'amount1', type: 'uint256' },
|
|
76
|
+
],
|
|
77
|
+
stateMutability: 'payable',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'function',
|
|
81
|
+
name: 'decreaseLiquidity',
|
|
82
|
+
inputs: [
|
|
83
|
+
{
|
|
84
|
+
name: 'params',
|
|
85
|
+
type: 'tuple',
|
|
86
|
+
components: [
|
|
87
|
+
{ name: 'tokenId', type: 'uint256' },
|
|
88
|
+
{ name: 'liquidity', type: 'uint128' },
|
|
89
|
+
{ name: 'amount0Min', type: 'uint256' },
|
|
90
|
+
{ name: 'amount1Min', type: 'uint256' },
|
|
91
|
+
{ name: 'deadline', type: 'uint256' },
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
outputs: [
|
|
96
|
+
{ name: 'amount0', type: 'uint256' },
|
|
97
|
+
{ name: 'amount1', type: 'uint256' },
|
|
98
|
+
],
|
|
99
|
+
stateMutability: 'payable',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: 'function',
|
|
103
|
+
name: 'collect',
|
|
104
|
+
inputs: [
|
|
105
|
+
{
|
|
106
|
+
name: 'params',
|
|
107
|
+
type: 'tuple',
|
|
108
|
+
components: [
|
|
109
|
+
{ name: 'tokenId', type: 'uint256' },
|
|
110
|
+
{ name: 'recipient', type: 'address' },
|
|
111
|
+
{ name: 'amount0Max', type: 'uint128' },
|
|
112
|
+
{ name: 'amount1Max', type: 'uint128' },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
outputs: [
|
|
117
|
+
{ name: 'amount0', type: 'uint256' },
|
|
118
|
+
{ name: 'amount1', type: 'uint256' },
|
|
119
|
+
],
|
|
120
|
+
stateMutability: 'payable',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
type: 'function',
|
|
124
|
+
name: 'burn',
|
|
125
|
+
inputs: [{ name: 'tokenId', type: 'uint256' }],
|
|
126
|
+
outputs: [],
|
|
127
|
+
stateMutability: 'payable',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
type: 'function',
|
|
131
|
+
name: 'balanceOf',
|
|
132
|
+
inputs: [{ name: 'owner', type: 'address' }],
|
|
133
|
+
outputs: [{ type: 'uint256' }],
|
|
134
|
+
stateMutability: 'view',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
type: 'function',
|
|
138
|
+
name: 'tokenOfOwnerByIndex',
|
|
139
|
+
inputs: [
|
|
140
|
+
{ name: 'owner', type: 'address' },
|
|
141
|
+
{ name: 'index', type: 'uint256' },
|
|
142
|
+
],
|
|
143
|
+
outputs: [{ type: 'uint256' }],
|
|
144
|
+
stateMutability: 'view',
|
|
145
|
+
},
|
|
146
|
+
] as const
|