@ghostchain1/ghost-config 0.0.0-stage → 1.0.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAE7B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0JtB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkB/B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;KAMjC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCtC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;EAyB9B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCzB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;EAMpB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqG9B,CAAC;AAEH,eAAO,MAAM,eAAe;YAgDO,MAAM;YAAU,MAAM;gBAAc,OAAO;iBAAe,MAAM;SAAO,MAAM;GAG/G,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,OAAO,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM7D;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,OAAO,WAAW,4lBAEhE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,OAAO,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMtE;AAED,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AASpD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,OAAO,WAAW,EACjC,GAAG,GAAE,SAA2B,EAChC,SAAS,GAAE,SAAc;;;;;;;;;;;;;;EAoB1B;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,OAAO,WAAW,EACjC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,SAAS,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;EAY5D"}
package/dist/index.js ADDED
@@ -0,0 +1,495 @@
1
+ export * from "./env.js";
2
+ export * from "./contracts.js";
3
+ export * from "./ghostos.js";
4
+ export const GHOST_SITES = Object.freeze({
5
+ main: Object.freeze({
6
+ key: "main",
7
+ label: "Main Site",
8
+ siteName: "GhostChain",
9
+ domain: "ghostchain.cloud",
10
+ url: "https://ghostchain.cloud",
11
+ description: "Network overview, architecture, and ecosystem entry point.",
12
+ gnsEnabled: true,
13
+ }),
14
+ investor: Object.freeze({
15
+ key: "investor",
16
+ label: "Investor Portal",
17
+ siteName: "GhostChain Investors",
18
+ domain: "investor.ghostchain.cloud",
19
+ url: "https://investor.ghostchain.cloud",
20
+ description: "Treasury, tokenomics, and financial reporting.",
21
+ gnsEnabled: true,
22
+ }),
23
+ dev: Object.freeze({
24
+ key: "dev",
25
+ label: "Developer Portal",
26
+ siteName: "GhostChain Developers",
27
+ domain: "dev.ghostchain.cloud",
28
+ url: "https://dev.ghostchain.cloud",
29
+ description: "SDKs, docs, RPC onboarding, and grants.",
30
+ gnsEnabled: true,
31
+ }),
32
+ apps: Object.freeze({
33
+ key: "apps",
34
+ label: "Ecosystem Apps",
35
+ siteName: "GhostChain Apps",
36
+ domain: "apps.ghostchain.cloud",
37
+ url: "https://apps.ghostchain.cloud",
38
+ description: "Ghost-native app directory and launch surfaces.",
39
+ gnsEnabled: true,
40
+ }),
41
+ explorer: Object.freeze({
42
+ key: "explorer",
43
+ label: "GhostScan",
44
+ siteName: "GhostChain Explorer",
45
+ domain: "explorer.ghostchain.cloud",
46
+ url: "https://explorer.ghostchain.cloud",
47
+ description: "L1, L2, and L3 transaction and contract exploration.",
48
+ gnsEnabled: true,
49
+ }),
50
+ governance: Object.freeze({
51
+ key: "governance",
52
+ label: "Governance",
53
+ siteName: "GhostChain Governance",
54
+ domain: "governance.ghostchain.cloud",
55
+ url: "https://governance.ghostchain.cloud",
56
+ description: "DAO proposals, constitutional policy, and voting.",
57
+ gnsEnabled: true,
58
+ }),
59
+ nodes: Object.freeze({
60
+ key: "nodes",
61
+ label: "Node Operators",
62
+ siteName: "GhostChain Nodes",
63
+ domain: "nodes.ghostchain.cloud",
64
+ url: "https://nodes.ghostchain.cloud",
65
+ description: "Validator setup, rewards, and network operations.",
66
+ gnsEnabled: true,
67
+ }),
68
+ exchange: Object.freeze({
69
+ key: "exchange",
70
+ label: "GhostXchange",
71
+ siteName: "GhostChain Exchange",
72
+ domain: "exchange.ghostchain.cloud",
73
+ url: "https://exchange.ghostchain.cloud",
74
+ description: "Institutional OTC and exchange workflows.",
75
+ gnsEnabled: true,
76
+ }),
77
+ company: Object.freeze({
78
+ key: "company",
79
+ label: "Company",
80
+ siteName: "GhostChain Company",
81
+ domain: "company.ghostchain.cloud",
82
+ url: "https://company.ghostchain.cloud",
83
+ description: "Press, careers, and company information.",
84
+ gnsEnabled: true,
85
+ }),
86
+ status: Object.freeze({
87
+ key: "status",
88
+ label: "Status",
89
+ siteName: "GhostChain Status",
90
+ domain: "status.ghostchain.cloud",
91
+ url: "https://status.ghostchain.cloud",
92
+ description: "Network health, incidents, and uptime status.",
93
+ gnsEnabled: true,
94
+ }),
95
+ portal: Object.freeze({
96
+ key: "portal",
97
+ label: "Portal",
98
+ siteName: "GhostStack Portal",
99
+ domain: "portal.ghostchain.cloud",
100
+ url: "https://portal.ghostchain.cloud",
101
+ description: "Unified GhostChain operations and service mesh portal.",
102
+ gnsEnabled: true,
103
+ }),
104
+ wallet: Object.freeze({
105
+ key: "wallet",
106
+ label: "GhostWallet",
107
+ siteName: "GhostWallet",
108
+ domain: "wallet.ghostchain.cloud",
109
+ url: "https://wallet.ghostchain.cloud",
110
+ description: "Multi-layer GST wallet and GNS identity hub.",
111
+ gnsEnabled: true,
112
+ }),
113
+ bridge: Object.freeze({
114
+ key: "bridge",
115
+ label: "Bridge",
116
+ siteName: "GhostChain Bridge",
117
+ domain: "bridge.ghostchain.cloud",
118
+ url: "https://bridge.ghostchain.cloud",
119
+ description: "Canonical L1 to L2 to L3 asset and message routing.",
120
+ gnsEnabled: true,
121
+ }),
122
+ docs: Object.freeze({
123
+ key: "docs",
124
+ label: "Docs",
125
+ siteName: "GhostChain Docs",
126
+ domain: "docs.ghostchain.cloud",
127
+ url: "https://docs.ghostchain.cloud",
128
+ description: "Structured GhostChain documentation and guides.",
129
+ gnsEnabled: true,
130
+ }),
131
+ live: Object.freeze({
132
+ key: "live",
133
+ label: "LitVyb Live",
134
+ siteName: "LitVyb Live",
135
+ domain: "apps.ghostchain.cloud",
136
+ url: "https://apps.ghostchain.cloud/vyb",
137
+ description: "Creator economy and live social surfaces for LitVyb Live.",
138
+ gnsEnabled: true,
139
+ }),
140
+ ai: Object.freeze({
141
+ key: "ai",
142
+ label: "GhostBrain",
143
+ siteName: "GhostBrain",
144
+ domain: "ai.ghostchain.cloud",
145
+ url: "https://ai.ghostchain.cloud",
146
+ description: "AI monitoring, automation, and incident intelligence.",
147
+ gnsEnabled: true,
148
+ }),
149
+ rpc: Object.freeze({
150
+ key: "rpc",
151
+ label: "RPC Portal",
152
+ siteName: "GhostChain RPC Portal",
153
+ domain: "rpc.ghostchain.cloud",
154
+ url: "https://rpc.ghostchain.cloud",
155
+ description: "Managed GhostChain RPC access and key management.",
156
+ gnsEnabled: true,
157
+ }),
158
+ });
159
+ export const GHOST_SITE_DIRECTORY = Object.freeze([
160
+ GHOST_SITES.main,
161
+ GHOST_SITES.investor,
162
+ GHOST_SITES.dev,
163
+ GHOST_SITES.apps,
164
+ GHOST_SITES.explorer,
165
+ GHOST_SITES.governance,
166
+ GHOST_SITES.nodes,
167
+ GHOST_SITES.exchange,
168
+ GHOST_SITES.company,
169
+ GHOST_SITES.status,
170
+ GHOST_SITES.portal,
171
+ GHOST_SITES.wallet,
172
+ GHOST_SITES.bridge,
173
+ GHOST_SITES.docs,
174
+ GHOST_SITES.live,
175
+ GHOST_SITES.ai,
176
+ GHOST_SITES.rpc,
177
+ ]);
178
+ export const GHOST_PUBLIC_NAV_LINKS = Object.freeze([
179
+ Object.freeze({ label: "Technology", href: `${GHOST_SITES.main.url}/technology` }),
180
+ Object.freeze({ label: "Ecosystem", href: `${GHOST_SITES.main.url}/ecosystem` }),
181
+ Object.freeze({ label: "Developers", href: GHOST_SITES.dev.url }),
182
+ Object.freeze({ label: "Investors", href: GHOST_SITES.investor.url }),
183
+ Object.freeze({ label: "Portal", href: GHOST_SITES.portal.url }),
184
+ ]);
185
+ export const GHOST_PUBLIC_FOOTER_COLUMNS = Object.freeze([
186
+ Object.freeze({
187
+ title: "Platform",
188
+ links: Object.freeze([
189
+ Object.freeze({ label: "GhostChain L1", href: `${GHOST_SITES.main.url}/technology` }),
190
+ Object.freeze({ label: "GhostL2", href: `${GHOST_SITES.main.url}/technology#l2` }),
191
+ Object.freeze({ label: "GhostL3", href: `${GHOST_SITES.main.url}/technology#l3` }),
192
+ Object.freeze({ label: "Tokenomics", href: `${GHOST_SITES.investor.url}/tokenomics` }),
193
+ ]),
194
+ }),
195
+ Object.freeze({
196
+ title: "Developers",
197
+ links: Object.freeze([
198
+ Object.freeze({ label: "Documentation", href: GHOST_SITES.docs.url }),
199
+ Object.freeze({ label: "SDK", href: `${GHOST_SITES.dev.url}/docs/quickstart` }),
200
+ Object.freeze({ label: "RPC Endpoints", href: GHOST_SITES.rpc.url }),
201
+ Object.freeze({ label: "Grants", href: `${GHOST_SITES.dev.url}/grants` }),
202
+ ]),
203
+ }),
204
+ Object.freeze({
205
+ title: "Ecosystem",
206
+ links: Object.freeze([
207
+ Object.freeze({ label: "App Directory", href: GHOST_SITES.apps.url }),
208
+ Object.freeze({ label: "GhostScan", href: GHOST_SITES.explorer.url }),
209
+ Object.freeze({ label: "Governance", href: GHOST_SITES.governance.url }),
210
+ Object.freeze({ label: "Node Operators", href: GHOST_SITES.nodes.url }),
211
+ ]),
212
+ }),
213
+ Object.freeze({
214
+ title: "Company",
215
+ links: Object.freeze([
216
+ Object.freeze({ label: "About", href: GHOST_SITES.company.url }),
217
+ Object.freeze({ label: "Careers", href: `${GHOST_SITES.company.url}/careers` }),
218
+ Object.freeze({ label: "Press", href: `${GHOST_SITES.company.url}/press` }),
219
+ Object.freeze({ label: "Contact", href: `${GHOST_SITES.company.url}/contact` }),
220
+ ]),
221
+ }),
222
+ ]);
223
+ export const GHOST_RPC_ENDPOINTS = Object.freeze({
224
+ l1: Object.freeze({
225
+ layer: "L1",
226
+ chainId: 14000101,
227
+ publicUrl: "https://rpc.ghostchain.cloud",
228
+ localUrl: "http://localhost:18555",
229
+ port: 18555,
230
+ explorerUrl: GHOST_SITES.explorer.url,
231
+ }),
232
+ l2: Object.freeze({
233
+ layer: "L2",
234
+ chainId: 14000102,
235
+ publicUrl: "https://l2rpc.ghostchain.cloud",
236
+ localUrl: "http://localhost:29545",
237
+ port: 29545,
238
+ explorerUrl: `${GHOST_SITES.explorer.url}?layer=2`,
239
+ }),
240
+ l3: Object.freeze({
241
+ layer: "L3",
242
+ chainId: 14000103,
243
+ publicUrl: "https://l3rpc.ghostchain.cloud",
244
+ localUrl: "http://localhost:39545",
245
+ port: 39545,
246
+ explorerUrl: `${GHOST_SITES.explorer.url}?layer=3`,
247
+ }),
248
+ });
249
+ export const GHOST_SERVICES = Object.freeze({
250
+ api: Object.freeze({
251
+ publicUrl: "https://api.ghostchain.cloud",
252
+ localUrl: "http://localhost:4000",
253
+ internalUrl: "http://ghostl-api:4000",
254
+ }),
255
+ compliance: Object.freeze({
256
+ localUrl: "http://localhost:7647",
257
+ internalUrl: "http://ghost-compliance:7647",
258
+ }),
259
+ aiCore: Object.freeze({
260
+ localUrl: "http://localhost:3210",
261
+ internalUrl: "http://ghost-gas-engine:3210",
262
+ }),
263
+ pil: Object.freeze({
264
+ localUrl: "http://localhost:3220",
265
+ internalUrl: "http://ghost-pil:3220",
266
+ }),
267
+ dnsIndexer: Object.freeze({
268
+ localUrl: "http://localhost:7811",
269
+ internalUrl: "http://ghostdns-indexer:7811",
270
+ }),
271
+ dnsResolver: Object.freeze({
272
+ localUrl: "http://localhost:7812",
273
+ internalUrl: "http://ghostdns-resolver:7812",
274
+ }),
275
+ prometheus: Object.freeze({
276
+ localUrl: "http://localhost:9090",
277
+ }),
278
+ devops: Object.freeze({
279
+ localUrl: "http://localhost:7623",
280
+ }),
281
+ ghostxApi: Object.freeze({
282
+ localUrl: "http://localhost:4100",
283
+ internalUrl: "http://ghostx-api:4100",
284
+ }),
285
+ ghostxWs: Object.freeze({
286
+ localUrl: "ws://localhost:4100",
287
+ internalUrl: "ws://ghostx-api:4100",
288
+ }),
289
+ });
290
+ export const GHOST_GNS = Object.freeze({
291
+ label: "Ghost Name System",
292
+ shortLabel: "GNS",
293
+ registryPath: "contracts/src/gns/",
294
+ supportedLayers: Object.freeze(["GhostChain L1", "GhostL2"]),
295
+ tlds: Object.freeze([".ghost", ".ghostchain"]),
296
+ });
297
+ export const GHOST_OWNED_DOMAINS = Object.freeze([
298
+ Object.freeze({
299
+ domain: "ghostchain.cloud",
300
+ gnsEnabled: true,
301
+ status: "healthy",
302
+ label: "Canonical network",
303
+ surface: "web-main",
304
+ canonicalUrl: "https://ghostchain.cloud",
305
+ description: "Primary GhostChain landing, ecosystem entry, and network overview.",
306
+ }),
307
+ Object.freeze({
308
+ domain: "ghostchain.info",
309
+ gnsEnabled: true,
310
+ status: "healthy",
311
+ label: "Knowledge base",
312
+ surface: "web-docs",
313
+ canonicalUrl: "https://docs.ghostchain.cloud",
314
+ description: "Documentation, architecture briefs, and public network references.",
315
+ }),
316
+ Object.freeze({
317
+ domain: "ghostchain.life",
318
+ gnsEnabled: true,
319
+ status: "healthy",
320
+ label: "Creator economy",
321
+ surface: "web-live",
322
+ canonicalUrl: "https://ghostchain.live",
323
+ description: "LitVyb Live social layer and GhostL3 creator monetization entry point.",
324
+ }),
325
+ Object.freeze({
326
+ domain: "ghostchain.live",
327
+ gnsEnabled: true,
328
+ status: "healthy",
329
+ label: "Broadcast network",
330
+ surface: "web-live",
331
+ canonicalUrl: "https://ghostchain.live",
332
+ description: "Live streaming, events, and LitVyb-powered audience surfaces.",
333
+ }),
334
+ Object.freeze({
335
+ domain: "ghostchain.online",
336
+ gnsEnabled: true,
337
+ status: "healthy",
338
+ label: "Service manual",
339
+ surface: "web-docs",
340
+ canonicalUrl: "https://docs.ghostchain.cloud",
341
+ description: "Operational docs, public service entry points, and online references.",
342
+ }),
343
+ Object.freeze({
344
+ domain: "ghostchain.space",
345
+ gnsEnabled: true,
346
+ status: "healthy",
347
+ label: "GhostBrain access",
348
+ surface: "web-ai",
349
+ canonicalUrl: "https://ai.ghostchain.cloud",
350
+ description: "GhostBrain network intelligence, monitoring, and AI control surfaces.",
351
+ }),
352
+ Object.freeze({
353
+ domain: "ghostchain.store",
354
+ gnsEnabled: true,
355
+ status: "healthy",
356
+ label: "GST markets",
357
+ surface: "web-exchange",
358
+ canonicalUrl: "https://exchange.ghostchain.cloud",
359
+ description: "GhostXchange market access, GST acquisition, and settlement workflows.",
360
+ }),
361
+ Object.freeze({
362
+ domain: "ghostchain.world",
363
+ gnsEnabled: true,
364
+ status: "healthy",
365
+ label: "Global network",
366
+ surface: "web-main",
367
+ canonicalUrl: "https://ghostchain.world",
368
+ description: "Global validator footprint, regional routing, and world-scale GhostChain story.",
369
+ }),
370
+ Object.freeze({
371
+ domain: "ghostchainlink.com",
372
+ gnsEnabled: false,
373
+ status: "healthy",
374
+ label: "Bridge alias",
375
+ surface: "web-bridge",
376
+ canonicalUrl: "https://bridge.ghostchain.cloud",
377
+ description: "Bridge and link layer for canonical GhostChain L1, L2, and L3 routing.",
378
+ }),
379
+ Object.freeze({
380
+ domain: "ghostchainsolutions.com",
381
+ gnsEnabled: false,
382
+ status: "healthy",
383
+ label: "Enterprise solutions",
384
+ surface: "web-company",
385
+ canonicalUrl: "https://company.ghostchain.cloud",
386
+ description: "Enterprise services, sovereign rollout support, and branded infrastructure delivery.",
387
+ }),
388
+ Object.freeze({
389
+ domain: "ghostschain.com",
390
+ gnsEnabled: false,
391
+ status: "healthy",
392
+ label: "Defensive alias",
393
+ surface: "web-bridge",
394
+ canonicalUrl: "https://bridge.ghostchain.cloud",
395
+ description: "GhostChain defensive alias that lands on the canonical bridge and link surface.",
396
+ }),
397
+ ]);
398
+ export const GHOST_DNS_ZONES = Object.freeze(Array.from([
399
+ GHOST_SITES.main,
400
+ GHOST_SITES.apps,
401
+ GHOST_SITES.portal,
402
+ GHOST_SITES.dev,
403
+ GHOST_SITES.explorer,
404
+ GHOST_SITES.governance,
405
+ GHOST_SITES.nodes,
406
+ GHOST_SITES.exchange,
407
+ GHOST_SITES.company,
408
+ GHOST_SITES.status,
409
+ GHOST_SITES.wallet,
410
+ GHOST_SITES.bridge,
411
+ GHOST_SITES.docs,
412
+ GHOST_SITES.live,
413
+ GHOST_SITES.ai,
414
+ GHOST_SITES.rpc,
415
+ Object.freeze({ domain: "app.ghostchain.cloud", gnsEnabled: true, status: "healthy" }),
416
+ Object.freeze({ domain: "admin.ghostchain.cloud", gnsEnabled: true, status: "healthy" }),
417
+ Object.freeze({ domain: "validator.ghostchain.cloud", gnsEnabled: true, status: "healthy" }),
418
+ Object.freeze({ domain: "l2rpc.ghostchain.cloud", gnsEnabled: true, status: "healthy" }),
419
+ Object.freeze({ domain: "l3rpc.ghostchain.cloud", gnsEnabled: true, status: "healthy" }),
420
+ ...GHOST_OWNED_DOMAINS,
421
+ ]
422
+ .reduce((zones, site) => {
423
+ const siteStatus = "status" in site ? site.status : undefined;
424
+ const current = zones.get(site.domain) ||
425
+ Object.freeze({
426
+ domain: site.domain,
427
+ status: siteStatus || "healthy",
428
+ gnsEnabled: Boolean(site.gnsEnabled),
429
+ recordCount: 0,
430
+ ttl: 300,
431
+ });
432
+ zones.set(site.domain, Object.freeze({
433
+ domain: site.domain,
434
+ status: siteStatus || current.status || "healthy",
435
+ gnsEnabled: current.gnsEnabled || Boolean(site.gnsEnabled),
436
+ recordCount: current.recordCount + 1,
437
+ ttl: 300,
438
+ }));
439
+ return zones;
440
+ }, new Map())
441
+ .values()).sort((left, right) => left.domain.localeCompare(right.domain)));
442
+ export function getGhostSite(siteKey) {
443
+ const site = GHOST_SITES[siteKey];
444
+ if (!site) {
445
+ throw new Error(`unknown_ghost_site:${String(siteKey)}`);
446
+ }
447
+ return site;
448
+ }
449
+ export function getGhostSiteUrl(siteKey) {
450
+ return getGhostSite(siteKey).url;
451
+ }
452
+ export function getGhostService(serviceKey) {
453
+ const service = GHOST_SERVICES[serviceKey];
454
+ if (!service) {
455
+ throw new Error(`unknown_ghost_service:${String(serviceKey)}`);
456
+ }
457
+ return service;
458
+ }
459
+ function getDefaultEnv() {
460
+ if (typeof process === "undefined") {
461
+ return {};
462
+ }
463
+ return process.env;
464
+ }
465
+ export function createPublicSiteEnv(siteKey, env = getDefaultEnv(), overrides = {}) {
466
+ const site = getGhostSite(siteKey);
467
+ return {
468
+ NEXT_PUBLIC_SITE_NAME: env.NEXT_PUBLIC_SITE_NAME || site.siteName,
469
+ NEXT_PUBLIC_DOMAIN: env.NEXT_PUBLIC_DOMAIN || site.domain,
470
+ NEXT_PUBLIC_API_URL: env.NEXT_PUBLIC_API_URL || GHOST_SERVICES.api.publicUrl,
471
+ NEXT_PUBLIC_RPC_L1: env.NEXT_PUBLIC_RPC_L1 || GHOST_RPC_ENDPOINTS.l1.publicUrl,
472
+ NEXT_PUBLIC_RPC_L2: env.NEXT_PUBLIC_RPC_L2 || GHOST_RPC_ENDPOINTS.l2.publicUrl,
473
+ NEXT_PUBLIC_RPC_L3: env.NEXT_PUBLIC_RPC_L3 || GHOST_RPC_ENDPOINTS.l3.publicUrl,
474
+ NEXT_PUBLIC_GHOSTSCAN_URL: env.NEXT_PUBLIC_GHOSTSCAN_URL || GHOST_SITES.explorer.url,
475
+ NEXT_PUBLIC_GHOSTWALLET_URL: env.NEXT_PUBLIC_GHOSTWALLET_URL || GHOST_SITES.wallet.url,
476
+ NEXT_PUBLIC_GHOSTBRIDGE_URL: env.NEXT_PUBLIC_GHOSTBRIDGE_URL || GHOST_SITES.bridge.url,
477
+ NEXT_PUBLIC_GHOSTPORTAL_URL: env.NEXT_PUBLIC_GHOSTPORTAL_URL || GHOST_SITES.portal.url,
478
+ NEXT_PUBLIC_GHOSTDOCS_URL: env.NEXT_PUBLIC_GHOSTDOCS_URL || GHOST_SITES.docs.url,
479
+ NEXT_PUBLIC_GHOSTDNS_INDEXER_URL: env.NEXT_PUBLIC_GHOSTDNS_INDEXER_URL || GHOST_SERVICES.dnsIndexer.localUrl,
480
+ NEXT_PUBLIC_GNS_TLDS: env.NEXT_PUBLIC_GNS_TLDS || GHOST_GNS.tlds.join(","),
481
+ ...overrides,
482
+ };
483
+ }
484
+ export function createPublicSiteNextConfig(siteKey, options = {}) {
485
+ const { env = {}, ...rest } = options;
486
+ return {
487
+ typescript: { ignoreBuildErrors: true },
488
+ reactStrictMode: true,
489
+ output: "standalone",
490
+ ...rest,
491
+ env: {
492
+ ...createPublicSiteEnv(siteKey, getDefaultEnv(), env),
493
+ },
494
+ };
495
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Canonical network descriptors — MAINNET identity of each chain.
3
+ *
4
+ * GhostOS assigns a dedicated chain identity per environment × layer (the
5
+ * nine-network matrix in `GHOST_TARGET_CHAIN_IDS`, re-exported below). Use
6
+ * `resolveNetworks(environment)` when the chain identity must follow the
7
+ * active environment; the flat `NETWORKS` map documents the mainnet /
8
+ * public-endpoint identity and never changes.
9
+ */
10
+ import { type GhostChainEnvironment } from "@ghostchain1/ghost-chain-registry";
11
+ export declare const NETWORKS: {
12
+ readonly ghostchain: {
13
+ readonly chainId: 14000101;
14
+ readonly rpcEnv: "GHOSTCHAIN_RPC_URL";
15
+ readonly wsEnv: "GHOSTCHAIN_WS_URL";
16
+ readonly explorerEnv: "GHOSTCHAIN_EXPLORER_URL";
17
+ };
18
+ readonly ghostl2: {
19
+ readonly chainId: 14000102;
20
+ readonly rpcEnv: "GHOSTL2_RPC_URL";
21
+ readonly wsEnv: "GHOSTL2_WS_URL";
22
+ readonly explorerEnv: "GHOSTL2_EXPLORER_URL";
23
+ };
24
+ readonly ghostl3: {
25
+ readonly chainId: 14000103;
26
+ readonly rpcEnv: "GHOSTL3_RPC_URL";
27
+ readonly wsEnv: "GHOSTL3_WS_URL";
28
+ readonly explorerEnv: "GHOSTL3_EXPLORER_URL";
29
+ };
30
+ /** LitVybz Live — app-specific L3 partition (chain ID 9031). */
31
+ readonly litvybz: {
32
+ readonly chainId: 9031;
33
+ readonly rpcEnv: "LITVYBZ_RPC_URL";
34
+ readonly wsEnv: "LITVYBZ_WS_URL";
35
+ readonly explorerEnv: "LITVYBZ_EXPLORER_URL";
36
+ };
37
+ };
38
+ /** The nine-network chain-ID matrix (environment → native layer → chain ID). */
39
+ export declare const NETWORK_CHAIN_IDS: Record<GhostChainEnvironment, Record<import("@ghostchain1/ghost-chain-registry").GhostNativeLayerKey, number>>;
40
+ /**
41
+ * Chain IDs for one environment (devnet/testnet/mainnet), keyed by native
42
+ * chain. This is the environment-aware replacement for reading
43
+ * `NETWORKS[chain].chainId` when the identity must follow the deployment.
44
+ */
45
+ export declare function resolveNetworks(environment: GhostChainEnvironment): {
46
+ ghostchain: number;
47
+ ghostl2: number;
48
+ ghostl3: number;
49
+ };
50
+ //# sourceMappingURL=networks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networks.d.ts","sourceRoot":"","sources":["../src/networks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,mCAAmC,CAAC;AAE3C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;IAmBnB,gEAAgE;;;;;;;CAOxD,CAAC;AAEX,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,gHAAyB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,qBAAqB,GAAG;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAOA"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Canonical network descriptors — MAINNET identity of each chain.
3
+ *
4
+ * GhostOS assigns a dedicated chain identity per environment × layer (the
5
+ * nine-network matrix in `GHOST_TARGET_CHAIN_IDS`, re-exported below). Use
6
+ * `resolveNetworks(environment)` when the chain identity must follow the
7
+ * active environment; the flat `NETWORKS` map documents the mainnet /
8
+ * public-endpoint identity and never changes.
9
+ */
10
+ import { GHOST_TARGET_CHAIN_IDS, } from "@ghostchain1/ghost-chain-registry";
11
+ export const NETWORKS = {
12
+ ghostchain: {
13
+ chainId: 14000101,
14
+ rpcEnv: "GHOSTCHAIN_RPC_URL",
15
+ wsEnv: "GHOSTCHAIN_WS_URL",
16
+ explorerEnv: "GHOSTCHAIN_EXPLORER_URL",
17
+ },
18
+ ghostl2: {
19
+ chainId: 14000102,
20
+ rpcEnv: "GHOSTL2_RPC_URL",
21
+ wsEnv: "GHOSTL2_WS_URL",
22
+ explorerEnv: "GHOSTL2_EXPLORER_URL",
23
+ },
24
+ ghostl3: {
25
+ chainId: 14000103,
26
+ rpcEnv: "GHOSTL3_RPC_URL",
27
+ wsEnv: "GHOSTL3_WS_URL",
28
+ explorerEnv: "GHOSTL3_EXPLORER_URL",
29
+ },
30
+ /** LitVybz Live — app-specific L3 partition (chain ID 9031). */
31
+ litvybz: {
32
+ chainId: 9031,
33
+ rpcEnv: "LITVYBZ_RPC_URL",
34
+ wsEnv: "LITVYBZ_WS_URL",
35
+ explorerEnv: "LITVYBZ_EXPLORER_URL",
36
+ },
37
+ };
38
+ /** The nine-network chain-ID matrix (environment → native layer → chain ID). */
39
+ export const NETWORK_CHAIN_IDS = GHOST_TARGET_CHAIN_IDS;
40
+ /**
41
+ * Chain IDs for one environment (devnet/testnet/mainnet), keyed by native
42
+ * chain. This is the environment-aware replacement for reading
43
+ * `NETWORKS[chain].chainId` when the identity must follow the deployment.
44
+ */
45
+ export function resolveNetworks(environment) {
46
+ const matrix = GHOST_TARGET_CHAIN_IDS[environment];
47
+ return {
48
+ ghostchain: matrix.ghostchain,
49
+ ghostl2: matrix.ghostl2,
50
+ ghostl3: matrix.ghostl3,
51
+ };
52
+ }
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@ghostchain1/ghost-config",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./env": {
13
+ "types": "./dist/env.d.ts",
14
+ "default": "./dist/env.js"
15
+ },
16
+ "./networks": {
17
+ "types": "./dist/networks.d.ts",
18
+ "default": "./dist/networks.js"
19
+ },
20
+ "./*": {
21
+ "types": "./dist/*.d.ts",
22
+ "default": "./dist/*.js"
23
+ }
24
+ },
25
+ "dependencies": {
26
+ "@ghostchain1/ghost-chain-registry": "0.0.1"
27
+ },
28
+ "engines": {
29
+ "node": ">=22.21.0 <23"
30
+ },
31
+ "devDependencies": {
32
+ "vitest": "^3.2.4",
33
+ "@ghostchain1/ghostl-config": "0.0.1"
34
+ },
35
+ "publishConfig": {
36
+ "registry": "https://registry.npmjs.org/",
37
+ "access": "public"
38
+ },
39
+ "license": "MIT",
40
+ "files": [
41
+ "dist"
42
+ ],
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/ghostmode25/GhostOS.git",
46
+ "directory": "packages/ghost-config"
47
+ },
48
+ "homepage": "https://github.com/ghostmode25/GhostOS/tree/main/packages/ghost-config",
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.build.json",
51
+ "test": "vitest run --passWithNoTests",
52
+ "typecheck": "tsc --noEmit",
53
+ "lint": "eslint src/"
54
+ }
6
55
  }