@luxexchange/config 1.0.2 → 1.0.3

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/src/contracts.ts DELETED
@@ -1,193 +0,0 @@
1
- import type { Address } from 'viem'
2
-
3
- /**
4
- * Contract addresses for Lux Mainnet (96369)
5
- */
6
- export const LUX_MAINNET_CONTRACTS = {
7
- // Core — verified on-chain 2026-03-05 (149M supply)
8
- WLUX: '0x4888e4a2ee0f03051c72d2bd3acf755ed3498b3e' as Address,
9
- MULTICALL: '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F' as Address,
10
-
11
- // Bridge tokens — verified on-chain via V3 pools and bridge MPC
12
- LETH: '0x60E0a8167FC13dE89348978860466C9ceC24B9ba' as Address,
13
- LBTC: '0x1E48D32a4F5e9f08DB9aE4959163300FaF8A6C8e' as Address,
14
- LUSD: '0x848Cff46eb323f323b6Bbe1Df274E40793d7f2c2' as Address,
15
- LSOL: '0x26B40f650156C7EbF9e087Dd0dca181Fe87625B7' as Address,
16
- LTON: '0x3141b94b89691009b950c96e97Bff48e0C543E3C' as Address,
17
- LAVAX: '0x0e4bD0DD67c15dECfBBBdbbE07FC9d51D737693D' as Address,
18
-
19
- // AMM V2 (CREATE2) — 1 pair on-chain
20
- V2_FACTORY: '0xD173926A10A0C4eCd3A51B1422270b65Df0551c1' as Address,
21
- V2_ROUTER: '0xAe2cf1E403aAFE6C05A5b8Ef63EB19ba591d8511' as Address,
22
-
23
- // AMM V3 (CREATE2) — 8+ pools, active trading, verified on-chain
24
- V3_FACTORY: '0x80bBc7C4C7a59C899D1B37BC14539A22D5830a84' as Address,
25
- V3_SWAP_ROUTER: '0xE8fb25086C8652c92f5AF90D730Bac7C63Fc9A58' as Address,
26
- V3_SWAP_ROUTER_02: '0x939bC0Bca6F9B9c52E6e3AD8A3C590b5d9B9D10E' as Address,
27
- V3_QUOTER: '0x12e2B76FaF4dDA5a173a4532916bb6Bfa3645275' as Address,
28
- V3_QUOTER_V2: '0x15C729fdd833Ba675edd466Dfc63E1B737925A4c' as Address,
29
- V3_NFT_POSITION_MANAGER: '0x7a4C48B9dae0b7c396569b34042fcA604150Ee28' as Address,
30
-
31
- // Governance
32
- STAKED_LUX: '0xc606302cd0722DD42c460B09930477d09993F913' as Address,
33
- VLUX: '0x55833074AD22E2aAE81ad377A600340eC0bc7cbd' as Address,
34
- KARMA: '0xc3d1efb6Eaedd048dDfE7066F1c719C7B6Ca43ad' as Address,
35
- DLUX: '0xAAbD65c4Fe3d3f9d54A7C3C7B95B9eD359CC52A8' as Address,
36
-
37
- // DeFi
38
- MARKETS: '0x308EBD39eB5E27980944630A0af6F8B0d19e31C6' as Address,
39
- PERP: '0x82312E295533Ab5167B306d5aBF7F3eB2C0D95fD' as Address,
40
- } as const
41
-
42
- /**
43
- * Contract addresses for Lux Testnet (96368)
44
- */
45
- export const LUX_TESTNET_CONTRACTS = {
46
- // Core — deployed via DeployMultiNetwork.s.sol 2026-02-27
47
- WLUX: '0xDe5310d0Eccc04C8987cB66Ff6b89Ee793442C91' as Address,
48
- MULTICALL: '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F' as Address,
49
-
50
- // Bridge tokens — deployed via DeployMultiNetwork.s.sol 2026-02-27
51
- LETH: '0xA695a8A66fbe3E32d15a531db04185313595771A' as Address,
52
- LBTC: '0x5a88986958ea76Dd043f834542724F081cA1443B' as Address,
53
- LUSDC: '0x8a3fad1c7FB94461621351aa6A983B6f814F039c' as Address,
54
-
55
- // AMM V2 — deployed via DeployMultiNetwork.s.sol 2026-02-27
56
- V2_FACTORY: '0x1DD4e6cbC6B8FD032fCAD5A3B0a45e446A014637' as Address,
57
- V2_ROUTER: '0xb06B31521Afc434F87Fe4852c98FC15A26c92aE8' as Address,
58
- } as const
59
-
60
- /**
61
- * DEX Precompile addresses (native AMM - Lux v4 style singleton PoolManager)
62
- * These provide sub-microsecond execution via native Go implementation
63
- *
64
- * Address format: 0x0000...00LPNUMBER (addresses end with LP number)
65
- * LP-9010: DEX Precompile - Native HFT Order Book (PoolManager)
66
- * LP-9011: Oracle Precompile - Multi-Source Price Aggregation
67
- *
68
- * @see ~/work/lux/precompile/registry/registry.go for the full address scheme
69
- * @see ~/work/lux/dex/pkg/gateway/lux/provider.go for gateway implementation
70
- */
71
- export const DEX_PRECOMPILES = {
72
- // Core DEX (LP-9010 series - Lux v4 style)
73
- POOL_MANAGER: '0x0000000000000000000000000000000000009010' as Address, // LP-9010
74
- SWAP_ROUTER: '0x0000000000000000000000000000000000009012' as Address, // LP-9012
75
- HOOKS_REGISTRY: '0x0000000000000000000000000000000000009013' as Address, // LP-9013
76
- FLASH_LOAN: '0x0000000000000000000000000000000000009014' as Address, // LP-9014
77
-
78
- // DeFi Extensions
79
- ORACLE_HUB: '0x0000000000000000000000000000000000009011' as Address, // LP-9011
80
- CLOB: '0x0000000000000000000000000000000000009020' as Address, // LP-9020
81
- VAULT: '0x0000000000000000000000000000000000009030' as Address, // LP-9030
82
-
83
- // Bridges (LP-6xxx)
84
- TELEPORT: '0x0000000000000000000000000000000000006010' as Address, // LP-6010
85
- } as const
86
-
87
- /**
88
- * Contract addresses for Zoo Mainnet (200200)
89
- */
90
- export const ZOO_MAINNET_CONTRACTS = {
91
- // Core — deployed via DeployMultiNetwork.s.sol 2026-03-04
92
- WLUX: '0x5491216406daB99b7032b83765F36790E27F8A61' as Address,
93
- LETH: '0x4870621EA8be7a383eFCfdA225249d35888bD9f2' as Address,
94
- LBTC: '0x6fc44509a32E513bE1aa00d27bb298e63830C6A8' as Address,
95
- LUSDC: '0xb2ee1CE7b84853b83AA08702aD0aD4D79711882D' as Address,
96
- V2_FACTORY: '0xF034942c1140125b5c278aE9cEE1B488e915B2FE' as Address,
97
- V2_ROUTER: '0x2cd306913e6546C59249b48d7c786A6D1d7ebE08' as Address,
98
- MARKETS: '0x6B7D3c38A3e030B95E101927Ee6ff9913ef626d4' as Address,
99
- } as const
100
-
101
- /**
102
- * Contract addresses for Hanzo Mainnet (36963)
103
- * Shared subnet deployment addresses (nonce 0)
104
- */
105
- export const HANZO_MAINNET_CONTRACTS = {
106
- // Deployed via DeployMultiNetwork.s.sol 2026-03-04
107
- WLUX: '0xc65ea8882020Af7CDa7854d590C6Fcd34BF364ec' as Address,
108
- LETH: '0x9378b62fC172d2A4f715d7ecF49DE0362f1BB702' as Address,
109
- LBTC: '0x7fC4f8a926E47Fa3587C0d7658C00E7489e67916' as Address,
110
- LUSDC: '0x51c3408B9A6a0B2446CCB78c72C846CEB76201FA' as Address,
111
- V2_FACTORY: '0xDc384E006BAec602b0b2B2fe6f2712646EFb1e9D' as Address,
112
- V2_ROUTER: '0x191067f88d61f9506555E88CEab9CF71deeD61A9' as Address,
113
- MARKETS: '0x9BC44B0De1aBe2e436C8fA5Cd5cA519026b9D8fD' as Address,
114
- } as const
115
-
116
- /**
117
- * Contract addresses for SPC Mainnet (36911)
118
- * Shared subnet deployment addresses (nonce 0)
119
- */
120
- export const SPC_MAINNET_CONTRACTS = {
121
- // NOT DEPLOYED — genesis key unknown, deployment blocked
122
- WLUX: '0x0000000000000000000000000000000000000000' as Address,
123
- LETH: '0x0000000000000000000000000000000000000000' as Address,
124
- LBTC: '0x0000000000000000000000000000000000000000' as Address,
125
- LUSDC: '0x0000000000000000000000000000000000000000' as Address,
126
- V2_FACTORY: '0x0000000000000000000000000000000000000000' as Address,
127
- V2_ROUTER: '0x0000000000000000000000000000000000000000' as Address,
128
- MARKETS: '0x0000000000000000000000000000000000000000' as Address,
129
- } as const
130
-
131
- /**
132
- * Contract addresses for Pars Mainnet (494949)
133
- * Shared subnet deployment addresses (nonce 0)
134
- */
135
- export const PARS_MAINNET_CONTRACTS = {
136
- // Deployed via DeployMultiNetwork.s.sol 2026-03-04
137
- WLUX: '0x548F54Dfb32ea6cE4fa3515236696CF3d1b7D26a' as Address,
138
- LETH: '0xe0f7E9A0cB1688ccA453995fd6e19AE4fbD9cBfd' as Address,
139
- LBTC: '0x7d7cC8D05BB0F38D80b5Ce44b4b069A6FB769468' as Address,
140
- LUSDC: '0xC5e4A6f54Be469551a342872C1aB83AB46f61b22' as Address,
141
- V2_FACTORY: '0x84CF0A13db1be8e1F0676405cfcBC8b09692FD1C' as Address,
142
- V2_ROUTER: '0x2382F7A49FA48E1F91Bec466c32e1D7F13ec8206' as Address,
143
- MARKETS: '0x3589fd09e7dfF3f7653fc4965B7CE1b8d8fdA9Bd' as Address,
144
- } as const
145
-
146
- /**
147
- * Contract addresses for Lux Dev (1337)
148
- * Deterministic CREATE addresses from DeployFullStack.s.sol deployed by anvil account 0
149
- * Account 0: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
150
- */
151
- export const LUX_DEV_CONTRACTS = {
152
- // Core - Nonce 0
153
- WLUX: '0x5FbDB2315678afecb367f032d93F642f64180aa3' as Address,
154
- MULTICALL: '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F' as Address,
155
-
156
- // Bridged tokens (deterministic deployment nonces 1-3)
157
- LETH: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512' as Address, // Nonce 1
158
- LBTC: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0' as Address, // Nonce 2
159
- LUSD: '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9' as Address, // Nonce 3
160
-
161
- // AMM V2
162
- V2_FACTORY: '0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1' as Address,
163
- V2_ROUTER: '0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE' as Address,
164
-
165
- // Staking
166
- STAKED_LUX: '0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0' as Address,
167
- } as const
168
-
169
- /**
170
- * Get contracts for a specific chain
171
- */
172
- export function getContracts(chainId: number) {
173
- switch (chainId) {
174
- case 96369:
175
- return LUX_MAINNET_CONTRACTS
176
- case 96368:
177
- return LUX_TESTNET_CONTRACTS
178
- case 200200:
179
- return ZOO_MAINNET_CONTRACTS
180
- case 36963:
181
- return HANZO_MAINNET_CONTRACTS
182
- case 36911:
183
- return SPC_MAINNET_CONTRACTS
184
- case 494949:
185
- return PARS_MAINNET_CONTRACTS
186
- case 1337:
187
- return LUX_DEV_CONTRACTS
188
- default:
189
- return LUX_MAINNET_CONTRACTS
190
- }
191
- }
192
-
193
- export type ContractAddresses = typeof LUX_MAINNET_CONTRACTS
package/src/env.ts DELETED
@@ -1,27 +0,0 @@
1
- /**
2
- * Environment configuration
3
- */
4
-
5
- export const ENV = {
6
- // Chain IDs
7
- DEFAULT_CHAIN_ID: parseInt(process.env['NEXT_PUBLIC_DEFAULT_CHAIN_ID'] || '96369'),
8
-
9
- // API URLs
10
- API_URL: process.env['NEXT_PUBLIC_API_URL'] || 'https://api.lux.exchange',
11
-
12
- // RPC URLs
13
- LUX_MAINNET_RPC: process.env['NEXT_PUBLIC_LUX_MAINNET_RPC'] || 'https://api.lux.network/rpc',
14
- LUX_TESTNET_RPC: process.env['NEXT_PUBLIC_LUX_TESTNET_RPC'] || 'https://api.lux-test.network/rpc',
15
- ZOO_MAINNET_RPC: process.env['NEXT_PUBLIC_ZOO_MAINNET_RPC'] || 'https://api.zoo.network/rpc',
16
- ZOO_TESTNET_RPC: process.env['NEXT_PUBLIC_ZOO_TESTNET_RPC'] || 'https://api.zoo-test.network/rpc',
17
-
18
- // Feature flags
19
- ENABLE_TESTNET: process.env['NEXT_PUBLIC_ENABLE_TESTNET'] === 'true',
20
- ENABLE_DEX_PRECOMPILES: process.env['NEXT_PUBLIC_ENABLE_DEX_PRECOMPILES'] === 'true',
21
- ENABLE_CROSS_CHAIN: process.env['NEXT_PUBLIC_ENABLE_CROSS_CHAIN'] === 'true',
22
-
23
- // WalletConnect
24
- WALLETCONNECT_PROJECT_ID: process.env['NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID'] || '',
25
- } as const
26
-
27
- export type Env = typeof ENV
package/src/wagmi.ts DELETED
@@ -1,27 +0,0 @@
1
- import { http, createConfig } from 'wagmi'
2
- import { mainnet, sepolia } from 'wagmi/chains'
3
- import { luxMainnet, luxTestnet, zooMainnet, zooTestnet, hanzoMainnet, spcMainnet, parsMainnet, liquidEvm } from './chains'
4
-
5
- /**
6
- * Wagmi configuration for Lux Exchange
7
- */
8
- export const wagmiConfig = createConfig({
9
- chains: [luxMainnet, zooMainnet, hanzoMainnet, spcMainnet, parsMainnet, liquidEvm, luxTestnet, zooTestnet, mainnet, sepolia],
10
- transports: {
11
- // Lux C-Chain
12
- [luxMainnet.id]: http(luxMainnet.rpcUrls.default.http[0]),
13
- [luxTestnet.id]: http(luxTestnet.rpcUrls.default.http[0]),
14
- // Subnet chains
15
- [zooMainnet.id]: http(zooMainnet.rpcUrls.default.http[0]),
16
- [zooTestnet.id]: http(zooTestnet.rpcUrls.default.http[0]),
17
- [hanzoMainnet.id]: http(hanzoMainnet.rpcUrls.default.http[0]),
18
- [spcMainnet.id]: http(spcMainnet.rpcUrls.default.http[0]),
19
- [parsMainnet.id]: http(parsMainnet.rpcUrls.default.http[0]),
20
- [liquidEvm.id]: http(liquidEvm.rpcUrls.default.http[0]),
21
- // Ethereum (for bridging)
22
- [mainnet.id]: http(),
23
- [sepolia.id]: http(),
24
- },
25
- })
26
-
27
- export type WagmiConfig = typeof wagmiConfig