@luxexchange/config 1.0.1 → 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/.depcheckrc +9 -0
- package/.eslintrc.js +20 -0
- package/env.d.ts +2 -2
- package/env.native.d.ts +2 -3
- package/package.json +1 -1
- package/project.json +2 -2
- package/src/brand.ts +165 -0
- package/src/config-types.ts +2 -4
- package/src/getConfig.native.ts +6 -12
- package/src/getConfig.ts +1 -1
- package/src/getConfig.web.ts +3 -11
- package/src/index.ts +2 -35
- package/src/legal.ts +55 -0
- package/tsconfig.json +17 -3
- package/dist/chains.d.ts +0 -405
- package/dist/chains.d.ts.map +0 -1
- package/dist/chains.js +0 -105
- package/dist/contracts.d.ts +0 -85
- package/dist/contracts.d.ts.map +0 -1
- package/dist/contracts.js +0 -68
- package/dist/env.d.ts +0 -17
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js +0 -20
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/wagmi.d.ts +0 -297
- package/dist/wagmi.d.ts.map +0 -1
- package/dist/wagmi.js +0 -19
- package/src/chains.ts +0 -224
- package/src/contracts.ts +0 -193
- package/src/env.ts +0 -27
- package/src/wagmi.ts +0 -27
package/.depcheckrc
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['@luxamm/eslint-config/lib'],
|
|
3
|
+
parserOptions: {
|
|
4
|
+
tsconfigRootDir: __dirname,
|
|
5
|
+
},
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: ['*.ts', '*.tsx'],
|
|
9
|
+
rules: {
|
|
10
|
+
'no-relative-import-paths/no-relative-import-paths': [
|
|
11
|
+
'error',
|
|
12
|
+
{
|
|
13
|
+
allowSameFolder: false,
|
|
14
|
+
prefix: '@luxexchange/config',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
}
|
package/env.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ declare global {
|
|
|
48
48
|
STATSIG_PROXY_URL_OVERRIDE?: string
|
|
49
49
|
TRADING_API_KEY?: string
|
|
50
50
|
TRADING_API_URL_OVERRIDE?: string
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
LX_API_KEY?: string
|
|
52
|
+
LX_NOTIF_API_BASE_URL_OVERRIDE?: string
|
|
53
53
|
UNITAGS_API_URL_OVERRIDE?: string
|
|
54
54
|
VERSION?: string
|
|
55
55
|
VERCEL?: string
|
package/env.native.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ declare module 'react-native-dotenv' {
|
|
|
22
22
|
export const IS_E2E_TEST: string
|
|
23
23
|
export const JUPITER_PROXY_URL: string
|
|
24
24
|
export const LIQUIDITY_SERVICE_URL_OVERRIDE: string
|
|
25
|
-
export const LUX_GATEWAY_URL: string
|
|
26
25
|
export const ONESIGNAL_APP_ID: string
|
|
27
26
|
export const QUICKNODE_ENDPOINT_NAME: string
|
|
28
27
|
export const QUICKNODE_ENDPOINT_TOKEN: string
|
|
@@ -31,8 +30,8 @@ declare module 'react-native-dotenv' {
|
|
|
31
30
|
export const STATSIG_PROXY_URL_OVERRIDE: string
|
|
32
31
|
export const TRADING_API_KEY: string
|
|
33
32
|
export const TRADING_API_URL_OVERRIDE: string
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
33
|
+
export const LX_API_KEY: string
|
|
34
|
+
export const LX_NOTIF_API_BASE_URL_OVERRIDE: string
|
|
36
35
|
export const UNITAGS_API_URL_OVERRIDE: string
|
|
37
36
|
export const WALLETCONNECT_PROJECT_ID: string
|
|
38
37
|
export const WALLETCONNECT_PROJECT_ID_BETA: string
|
package/package.json
CHANGED
package/project.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@
|
|
2
|
+
"name": "@luxexchange/config",
|
|
3
3
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "
|
|
4
|
+
"sourceRoot": "pkgs/config/src",
|
|
5
5
|
"projectType": "library",
|
|
6
6
|
"tags": ["scope:config", "type:lib"],
|
|
7
7
|
"targets": {
|
package/src/brand.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime brand configuration for white-label exchange deployments.
|
|
3
|
+
* Zero baked-in brands — everything loaded from /config.json at runtime.
|
|
4
|
+
*
|
|
5
|
+
* How it works:
|
|
6
|
+
* 1. Default config.json ships in the Docker image (Lux defaults)
|
|
7
|
+
* 2. K8s mounts a ConfigMap over /config.json per deployment
|
|
8
|
+
* 3. SPA calls loadBrandConfig() before first render
|
|
9
|
+
* 4. All brand references use the `brand` export which updates in place
|
|
10
|
+
*
|
|
11
|
+
* For zoo.exchange: mount a ConfigMap with Zoo branding over /config.json
|
|
12
|
+
* For any L2: same image, different ConfigMap
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export interface BrandConfig {
|
|
16
|
+
name: string
|
|
17
|
+
title: string
|
|
18
|
+
description: string
|
|
19
|
+
appDomain: string
|
|
20
|
+
docsDomain: string
|
|
21
|
+
infoDomain: string
|
|
22
|
+
gatewayDomain: string
|
|
23
|
+
wsDomain: string
|
|
24
|
+
helpUrl: string
|
|
25
|
+
termsUrl: string
|
|
26
|
+
privacyUrl: string
|
|
27
|
+
downloadUrl: string
|
|
28
|
+
complianceEmail: string
|
|
29
|
+
supportEmail: string
|
|
30
|
+
twitter: string
|
|
31
|
+
github: string
|
|
32
|
+
discord: string
|
|
33
|
+
logoUrl: string
|
|
34
|
+
faviconUrl: string
|
|
35
|
+
primaryColor: string
|
|
36
|
+
defaultChainId: number
|
|
37
|
+
supportedChainIds: number[]
|
|
38
|
+
walletConnectProjectId: string
|
|
39
|
+
insightsHost: string
|
|
40
|
+
insightsApiKey: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface RuntimeConfig {
|
|
44
|
+
brand: Partial<BrandConfig>
|
|
45
|
+
chains: {
|
|
46
|
+
defaultChainId: number
|
|
47
|
+
supported: number[]
|
|
48
|
+
}
|
|
49
|
+
rpc: Record<string, string>
|
|
50
|
+
api: {
|
|
51
|
+
graphql: string
|
|
52
|
+
gateway: string
|
|
53
|
+
insights: string
|
|
54
|
+
}
|
|
55
|
+
walletConnect: {
|
|
56
|
+
projectId: string
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Mutable brand — updated by loadBrandConfig()
|
|
61
|
+
export const brand: BrandConfig = {
|
|
62
|
+
name: 'Exchange',
|
|
63
|
+
title: 'Exchange | Trade',
|
|
64
|
+
description: 'Swap, earn, and build on the leading decentralized exchange',
|
|
65
|
+
appDomain: 'lux.exchange',
|
|
66
|
+
docsDomain: 'docs.lux.exchange',
|
|
67
|
+
infoDomain: 'info.lux.exchange',
|
|
68
|
+
gatewayDomain: 'gw.lux.exchange',
|
|
69
|
+
wsDomain: 'ws.lux.exchange',
|
|
70
|
+
helpUrl: 'https://docs.lux.exchange/help',
|
|
71
|
+
termsUrl: 'https://lux.exchange/terms',
|
|
72
|
+
privacyUrl: 'https://lux.exchange/privacy',
|
|
73
|
+
downloadUrl: 'https://lux.exchange/wallet',
|
|
74
|
+
complianceEmail: 'compliance@lux.exchange',
|
|
75
|
+
supportEmail: 'hi@lux.exchange',
|
|
76
|
+
twitter: 'https://x.com/luxfi',
|
|
77
|
+
github: 'https://github.com/luxfi',
|
|
78
|
+
discord: 'https://discord.gg/lux',
|
|
79
|
+
logoUrl: '',
|
|
80
|
+
faviconUrl: '/favicon.ico',
|
|
81
|
+
primaryColor: '#FC72FF',
|
|
82
|
+
defaultChainId: 96369,
|
|
83
|
+
supportedChainIds: [96369, 96368, 96367],
|
|
84
|
+
walletConnectProjectId: '',
|
|
85
|
+
insightsHost: 'https://insights.hanzo.ai',
|
|
86
|
+
insightsApiKey: '',
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Full runtime config (includes RPC, API endpoints, etc.)
|
|
90
|
+
export let runtimeConfig: RuntimeConfig | null = null
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Load brand config from /config.json. Call once before React renders.
|
|
94
|
+
* The config.json is either the default shipped in the image, or a
|
|
95
|
+
* ConfigMap mounted by K8s for white-label deployments.
|
|
96
|
+
*/
|
|
97
|
+
export async function loadBrandConfig(): Promise<RuntimeConfig> {
|
|
98
|
+
try {
|
|
99
|
+
const res = await fetch('/config.json')
|
|
100
|
+
if (!res.ok) throw new Error(`${res.status}`)
|
|
101
|
+
const config: RuntimeConfig = await res.json()
|
|
102
|
+
|
|
103
|
+
// Apply brand overrides
|
|
104
|
+
if (config.brand) {
|
|
105
|
+
Object.assign(brand, config.brand)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Apply chain config
|
|
109
|
+
if (config.chains) {
|
|
110
|
+
brand.defaultChainId = config.chains.defaultChainId ?? brand.defaultChainId
|
|
111
|
+
brand.supportedChainIds = config.chains.supported ?? brand.supportedChainIds
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Apply walletconnect
|
|
115
|
+
if (config.walletConnect?.projectId) {
|
|
116
|
+
brand.walletConnectProjectId = config.walletConnect.projectId
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Apply analytics
|
|
120
|
+
if (config.api?.insights) {
|
|
121
|
+
brand.insightsHost = config.api.insights
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Update document title
|
|
125
|
+
if (typeof document !== 'undefined' && config.brand?.title) {
|
|
126
|
+
document.title = config.brand.title
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
runtimeConfig = config
|
|
130
|
+
return config
|
|
131
|
+
} catch {
|
|
132
|
+
// Config fetch failed — use defaults (works for local dev)
|
|
133
|
+
return {
|
|
134
|
+
brand: {},
|
|
135
|
+
chains: { defaultChainId: brand.defaultChainId, supported: brand.supportedChainIds },
|
|
136
|
+
rpc: {},
|
|
137
|
+
api: { graphql: '', gateway: '', insights: brand.insightsHost },
|
|
138
|
+
walletConnect: { projectId: '' },
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function getBrandUrl(path: string): string {
|
|
144
|
+
return `https://${brand.appDomain}${path}`
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function getDocsUrl(path: string): string {
|
|
148
|
+
return `https://${brand.docsDomain}${path}`
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function getGatewayUrl(path: string): string {
|
|
152
|
+
return `https://${brand.gatewayDomain}${path}`
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function getWsUrl(path: string): string {
|
|
156
|
+
return `wss://${brand.wsDomain}${path}`
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function getRpcUrl(chainId: number): string | undefined {
|
|
160
|
+
return runtimeConfig?.rpc?.[String(chainId)]
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function getApiUrl(key: keyof RuntimeConfig['api']): string {
|
|
164
|
+
return runtimeConfig?.api?.[key] ?? ''
|
|
165
|
+
}
|
package/src/config-types.ts
CHANGED
|
@@ -21,7 +21,6 @@ export interface Config {
|
|
|
21
21
|
isE2ETest: boolean
|
|
22
22
|
forApiUrlOverride: string
|
|
23
23
|
graphqlUrlOverride: string
|
|
24
|
-
gChainGraphqlUrl: string
|
|
25
24
|
includePrototypeFeatures: string
|
|
26
25
|
infuraKey: string
|
|
27
26
|
isVercelEnvironment: boolean
|
|
@@ -36,11 +35,10 @@ export interface Config {
|
|
|
36
35
|
tradingApiUrlOverride: string
|
|
37
36
|
tradingApiWebTestEnv: string
|
|
38
37
|
liquidityServiceUrlOverride: string
|
|
39
|
-
|
|
38
|
+
lxApiKey: string
|
|
40
39
|
unitagsApiUrlOverride: string
|
|
41
|
-
|
|
40
|
+
lxNotifApiBaseUrlOverride: string
|
|
42
41
|
entryGatewayApiUrlOverride: string
|
|
43
|
-
luxGatewayUrlOverride: string
|
|
44
42
|
walletConnectProjectId: string
|
|
45
43
|
walletConnectProjectIdBeta: string
|
|
46
44
|
walletConnectProjectIdDev: string
|
package/src/getConfig.native.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from '@
|
|
1
|
+
import type { Config } from '@luxexchange/config/src/config-types'
|
|
2
2
|
import {
|
|
3
3
|
ALCHEMY_API_KEY,
|
|
4
4
|
AMPLITUDE_PROXY_URL_OVERRIDE,
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
ENABLE_SESSION_SERVICE,
|
|
14
14
|
ENABLE_SESSION_UPGRADE_AUTO,
|
|
15
15
|
ENTRY_GATEWAY_API_URL_OVERRIDE,
|
|
16
|
-
LUX_GATEWAY_URL,
|
|
17
16
|
FOR_API_URL_OVERRIDE,
|
|
18
17
|
GRAPHQL_URL_OVERRIDE,
|
|
19
18
|
INCLUDE_PROTOTYPE_FEATURES,
|
|
@@ -29,8 +28,8 @@ import {
|
|
|
29
28
|
STATSIG_PROXY_URL_OVERRIDE,
|
|
30
29
|
TRADING_API_KEY,
|
|
31
30
|
TRADING_API_URL_OVERRIDE,
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
LX_API_KEY,
|
|
32
|
+
LX_NOTIF_API_BASE_URL_OVERRIDE,
|
|
34
33
|
UNITAGS_API_URL_OVERRIDE,
|
|
35
34
|
WALLETCONNECT_PROJECT_ID,
|
|
36
35
|
WALLETCONNECT_PROJECT_ID_BETA,
|
|
@@ -77,10 +76,6 @@ export const getConfig = (): Config => {
|
|
|
77
76
|
isE2ETest: process.env.IS_E2E_TEST?.toLowerCase() === 'true' || IS_E2E_TEST?.toLowerCase() === 'true',
|
|
78
77
|
forApiUrlOverride: process.env.FOR_API_URL_OVERRIDE || FOR_API_URL_OVERRIDE,
|
|
79
78
|
graphqlUrlOverride: process.env.GRAPHQL_URL_OVERRIDE || GRAPHQL_URL_OVERRIDE,
|
|
80
|
-
// G-Chain GraphQL: testnet=9650, mainnet=9630
|
|
81
|
-
gChainGraphqlUrl:
|
|
82
|
-
process.env['GCHAIN_GRAPHQL_URL'] ||
|
|
83
|
-
(isNonTestDev ? 'http://localhost:9650/ext/bc/G/graphql' : 'http://localhost:9630/ext/bc/G/graphql'),
|
|
84
79
|
infuraKey: process.env.REACT_APP_INFURA_KEY || INFURA_KEY,
|
|
85
80
|
includePrototypeFeatures: process.env.INCLUDE_PROTOTYPE_FEATURES || INCLUDE_PROTOTYPE_FEATURES,
|
|
86
81
|
isVercelEnvironment: false, // never set to true for native
|
|
@@ -105,12 +100,11 @@ export const getConfig = (): Config => {
|
|
|
105
100
|
process.env.REACT_APP_LIQUIDITY_SERVICE_URL_OVERRIDE ||
|
|
106
101
|
process.env.LIQUIDITY_SERVICE_URL_OVERRIDE ||
|
|
107
102
|
LIQUIDITY_SERVICE_URL_OVERRIDE,
|
|
108
|
-
|
|
103
|
+
lxApiKey: process.env.LX_API_KEY || LX_API_KEY,
|
|
109
104
|
unitagsApiUrlOverride: process.env.UNITAGS_API_URL_OVERRIDE || UNITAGS_API_URL_OVERRIDE,
|
|
110
|
-
|
|
111
|
-
process.env.
|
|
105
|
+
lxNotifApiBaseUrlOverride:
|
|
106
|
+
process.env.LX_NOTIF_API_BASE_URL_OVERRIDE || LX_NOTIF_API_BASE_URL_OVERRIDE,
|
|
112
107
|
entryGatewayApiUrlOverride: process.env.ENTRY_GATEWAY_API_URL_OVERRIDE || ENTRY_GATEWAY_API_URL_OVERRIDE,
|
|
113
|
-
luxGatewayUrlOverride: process.env['LUX_GATEWAY_URL'] || LUX_GATEWAY_URL || '',
|
|
114
108
|
walletConnectProjectId:
|
|
115
109
|
process.env.REACT_APP_WALLET_CONNECT_PROJECT_ID ||
|
|
116
110
|
process.env.WALLETCONNECT_PROJECT_ID ||
|
package/src/getConfig.ts
CHANGED
package/src/getConfig.web.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from '@
|
|
1
|
+
import type { Config } from '@luxexchange/config/src/config-types'
|
|
2
2
|
import { isNonTestDev } from 'utilities/src/environment/constants'
|
|
3
3
|
|
|
4
4
|
// Module-level cache for config to avoid recomputing on every call
|
|
@@ -34,13 +34,6 @@ export const getConfig = (): Config => {
|
|
|
34
34
|
isE2ETest: process.env.IS_E2E_TEST?.toLowerCase() === 'true',
|
|
35
35
|
forApiUrlOverride: process.env.FOR_API_URL_OVERRIDE || '',
|
|
36
36
|
graphqlUrlOverride: process.env.GRAPHQL_URL_OVERRIDE || '',
|
|
37
|
-
// G-Chain GraphQL: testnet=9650, mainnet=9630, devnet=9650
|
|
38
|
-
gChainGraphqlUrl:
|
|
39
|
-
process.env['REACT_APP_GCHAIN_GRAPHQL_URL'] ||
|
|
40
|
-
process.env['GCHAIN_GRAPHQL_URL'] ||
|
|
41
|
-
(process.env.NODE_ENV === 'production'
|
|
42
|
-
? 'http://localhost:9630/ext/bc/G/graphql'
|
|
43
|
-
: 'http://localhost:9650/ext/bc/G/graphql'),
|
|
44
37
|
infuraKey: process.env.REACT_APP_INFURA_KEY || '',
|
|
45
38
|
includePrototypeFeatures: process.env.INCLUDE_PROTOTYPE_FEATURES || '',
|
|
46
39
|
isVercelEnvironment: process.env.VERCEL === '1',
|
|
@@ -57,11 +50,10 @@ export const getConfig = (): Config => {
|
|
|
57
50
|
tradingApiWebTestEnv: process.env.REACT_APP_TRADING_API_TEST_ENV || '',
|
|
58
51
|
liquidityServiceUrlOverride:
|
|
59
52
|
process.env.REACT_APP_LIQUIDITY_SERVICE_URL_OVERRIDE || process.env.LIQUIDITY_SERVICE_URL_OVERRIDE || '',
|
|
60
|
-
|
|
53
|
+
lxApiKey: process.env.LX_API_KEY || '',
|
|
61
54
|
unitagsApiUrlOverride: process.env.UNITAGS_API_URL_OVERRIDE || '',
|
|
62
|
-
|
|
55
|
+
lxNotifApiBaseUrlOverride: process.env.LX_NOTIF_API_BASE_URL_OVERRIDE || '',
|
|
63
56
|
entryGatewayApiUrlOverride: process.env.ENTRY_GATEWAY_API_URL_OVERRIDE || '',
|
|
64
|
-
luxGatewayUrlOverride: process.env['REACT_APP_LUX_GATEWAY_URL'] || process.env['LUX_GATEWAY_URL'] || '',
|
|
65
57
|
walletConnectProjectId:
|
|
66
58
|
process.env.REACT_APP_WALLET_CONNECT_PROJECT_ID || process.env.WALLETCONNECT_PROJECT_ID || '',
|
|
67
59
|
walletConnectProjectIdBeta: process.env.WALLETCONNECT_PROJECT_ID_BETA || '',
|
package/src/index.ts
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
export type { Config } from './config-types'
|
|
2
2
|
export { getConfig } from './getConfig'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
luxMainnet,
|
|
7
|
-
luxTestnet,
|
|
8
|
-
zooMainnet,
|
|
9
|
-
zooTestnet,
|
|
10
|
-
hanzoMainnet,
|
|
11
|
-
spcMainnet,
|
|
12
|
-
parsMainnet,
|
|
13
|
-
liquidEvm,
|
|
14
|
-
LUX_MAINNET_ID,
|
|
15
|
-
LUX_TESTNET_ID,
|
|
16
|
-
ZOO_MAINNET_ID,
|
|
17
|
-
ZOO_TESTNET_ID,
|
|
18
|
-
HANZO_MAINNET_ID,
|
|
19
|
-
SPC_MAINNET_ID,
|
|
20
|
-
PARS_MAINNET_ID,
|
|
21
|
-
LIQUID_EVM_ID,
|
|
22
|
-
supportedChains,
|
|
23
|
-
type SupportedChainId,
|
|
24
|
-
} from './chains'
|
|
25
|
-
|
|
26
|
-
// Contract addresses
|
|
27
|
-
export {
|
|
28
|
-
LUX_MAINNET_CONTRACTS,
|
|
29
|
-
LUX_TESTNET_CONTRACTS,
|
|
30
|
-
ZOO_MAINNET_CONTRACTS,
|
|
31
|
-
HANZO_MAINNET_CONTRACTS,
|
|
32
|
-
SPC_MAINNET_CONTRACTS,
|
|
33
|
-
PARS_MAINNET_CONTRACTS,
|
|
34
|
-
DEX_PRECOMPILES,
|
|
35
|
-
getContracts,
|
|
36
|
-
type ContractAddresses,
|
|
37
|
-
} from './contracts'
|
|
3
|
+
export { brand, getBrandUrl, getDocsUrl, getGatewayUrl, getWsUrl } from './brand'
|
|
4
|
+
export type { BrandConfig } from './brand'
|
package/src/legal.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared legal content for all Lux ecosystem apps.
|
|
3
|
+
*
|
|
4
|
+
* Every app (lux.exchange, zoo.exchange, pars.market, bridge.lux.network,
|
|
5
|
+
* explore.lux.network, etc.) serves /terms and /privacy using this content.
|
|
6
|
+
*
|
|
7
|
+
* The brand name is injected from the runtime brand config.
|
|
8
|
+
* The content is the same across all white-label deployments.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const LEGAL_UPDATED = '2026-03-25'
|
|
12
|
+
|
|
13
|
+
export const LEGAL_URLS = {
|
|
14
|
+
terms: '/terms',
|
|
15
|
+
privacy: '/privacy',
|
|
16
|
+
regulatory: 'https://lps.lux.network/legal/regulatory-status',
|
|
17
|
+
compliance: 'mailto:compliance@lux.exchange',
|
|
18
|
+
legal: 'mailto:legal@lux.network',
|
|
19
|
+
privacyEmail: 'mailto:privacy@lux.network',
|
|
20
|
+
security: 'mailto:security@lux.network',
|
|
21
|
+
lp3103: 'https://lps.lux.network/docs/lp-3103-us-regulatory-classification',
|
|
22
|
+
lp3104: 'https://lps.lux.network/docs/lp-3104-genius-act-stablecoin-compliance',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Short disclaimer text for footers */
|
|
26
|
+
export const FOOTER_DISCLAIMER =
|
|
27
|
+
'Experimental research software. Not legal, tax, or financial advice. Non-custodial — we never have access to your keys or funds. Use at your own risk.'
|
|
28
|
+
|
|
29
|
+
/** Regulatory notice for inline display */
|
|
30
|
+
export const REGULATORY_NOTICE =
|
|
31
|
+
'LUX is classified as a digital commodity under the SEC/CFTC joint interpretive release of March 17, 2026. ' +
|
|
32
|
+
'Protocol staking, liquidity provision, and no-consideration airdrops are administrative activities outside the Howey test. ' +
|
|
33
|
+
'This interface is experimental research software provided "as is" without warranty.'
|
|
34
|
+
|
|
35
|
+
/** Cookie/analytics notice text */
|
|
36
|
+
export const COOKIE_NOTICE =
|
|
37
|
+
'This interface uses minimal cookies for functionality (theme, preferences) and privacy-respecting analytics. ' +
|
|
38
|
+
'No tracking cookies. No behavioral profiling. No data sold to third parties.'
|
|
39
|
+
|
|
40
|
+
/** Non-custodial notice text */
|
|
41
|
+
export const NON_CUSTODIAL_NOTICE =
|
|
42
|
+
'This protocol is fully non-custodial. We never have access to, custody of, or control over your private keys, ' +
|
|
43
|
+
'seed phrases, passwords, or funds. All transactions are executed directly by you on the blockchain and are irreversible. ' +
|
|
44
|
+
'Your keys, your assets, your responsibility.'
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Generate brand-specific legal URLs
|
|
48
|
+
*/
|
|
49
|
+
export function getLegalUrls(appDomain: string) {
|
|
50
|
+
return {
|
|
51
|
+
terms: `https://${appDomain}/terms`,
|
|
52
|
+
privacy: `https://${appDomain}/privacy`,
|
|
53
|
+
regulatory: LEGAL_URLS.regulatory,
|
|
54
|
+
}
|
|
55
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../config/tsconfig/app.json",
|
|
3
|
-
"include": [
|
|
4
|
-
|
|
3
|
+
"include": [
|
|
4
|
+
"src/**/*.ts",
|
|
5
|
+
"src/**/*.tsx",
|
|
6
|
+
"src/**/*.json",
|
|
7
|
+
"env.native.d.ts",
|
|
8
|
+
"env.d.ts"
|
|
9
|
+
],
|
|
10
|
+
"exclude": [
|
|
11
|
+
"src/**/*.spec.ts",
|
|
12
|
+
"src/**/*.spec.tsx",
|
|
13
|
+
"src/**/*.test.ts",
|
|
14
|
+
"src/**/*.test.tsx"
|
|
15
|
+
],
|
|
5
16
|
"compilerOptions": {
|
|
6
17
|
"emitDeclarationOnly": true,
|
|
7
18
|
"noEmit": false,
|
|
8
19
|
"types": ["node"],
|
|
9
20
|
"paths": {
|
|
10
|
-
"@
|
|
21
|
+
"@luxexchange/config/*": ["./src/*"]
|
|
11
22
|
}
|
|
12
23
|
},
|
|
13
24
|
"references": [
|
|
14
25
|
{
|
|
15
26
|
"path": "../utilities"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"path": "../eslint-config"
|
|
16
30
|
}
|
|
17
31
|
]
|
|
18
32
|
}
|