@basedone/core 0.2.6 → 0.2.8

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.
@@ -9,19 +9,6 @@ import { isHip3Symbol } from "../hip3/utils";
9
9
  import type { Hex } from "@nktkas/hyperliquid/types";
10
10
  import type { PerpsMeta } from "./types";
11
11
 
12
- export interface PerpDex {
13
- /** Short name of the perpetual dex. */
14
- name: string;
15
- /** Complete name of the perpetual dex. */
16
- fullName: string;
17
- /** Hex address of the dex deployer. */
18
- deployer: Hex;
19
- /** Hex address of the oracle updater, or null if not available. */
20
- oracleUpdater: Hex | null;
21
-
22
- feeRecipient: Hex | null;
23
- assetToStreamingOiCap: [string, string][];
24
- }
25
12
 
26
13
  /**
27
14
  * Market information for trading operations
@@ -132,656 +119,3 @@ interface MetadataClientConfig {
132
119
  */
133
120
  export const ROOT_DEX = "hyperliquid";
134
121
 
135
- /**@deprecated use react sdk instead */
136
- export class MetadataClient {
137
- private infoClient: InfoClient;
138
- private config: MetadataClientConfig;
139
- private isTestnet: boolean;
140
-
141
- // Core metadata
142
- private spotMeta: SpotMeta | null = null;
143
- private perpsMeta: PerpsMeta | null = null;
144
- private perpDexs: (PerpDex | null)[] = [];
145
- private staticMeta: StaticMetadata | null = null;
146
-
147
- // HIP-3 metadata cache
148
- private hip3DexsMeta: Map<string, DexInfo> = new Map();
149
-
150
- // Pre-computed lookup maps (populated on initialize)
151
- private perpsSymbolToIndex: Map<string, number> = new Map();
152
- private spotTokenNameToIndex: Map<string, number> = new Map();
153
- private spotPairToMarket: Map<string, MarketInfo> = new Map();
154
- private baseTokenToMarkets: Map<string, MarketInfo[]> = new Map();
155
- private quoteAssets: string[] = [];
156
-
157
- // Unified symbol lookup (used by getMarketBySymbol for O(1) access)
158
- // Maps symbol to MarketInfo for quick lookups
159
- private coinToMarket: Map<string, MarketInfo> = new Map();
160
-
161
- // HIP-3 optimized lookups
162
- // Maps "dex:coin" symbol to MarketInfo
163
- private hip3SymbolToMarket: Map<string, MarketInfo> = new Map();
164
- // Maps dex name to dex index for quick lookups
165
- private dexNameToIndex: Map<string, number> = new Map();
166
-
167
- // Lazy init flag
168
- private initialized: boolean = false;
169
- private initializing: Promise<void> | null = null;
170
-
171
- constructor(config: MetadataClientConfig = {}) {
172
- const transport = new HttpTransport({
173
- isTestnet: config.isTestnet ?? false,
174
- });
175
- this.infoClient = new InfoClient({ transport });
176
- this.config = {
177
- ...config,
178
- hip3Dexs: config.hip3Dexs?.filter((dex) => dex !== ROOT_DEX),
179
- useStaticFallback: config.useStaticFallback ?? true,
180
- };
181
- this.isTestnet = config.isTestnet ?? false;
182
-
183
- this.initialize();
184
- }
185
-
186
- /**
187
- * Initialize metadata by fetching from Hyperliquid
188
- */
189
- async initialize(): Promise<void> {
190
- if (this.initialized) return;
191
- if (this.initializing) return this.initializing;
192
- this.initializing = new Promise(async (resolve, reject) => {
193
- if (this.config.debug) {
194
- console.info("[MetadataClient] Initializing...", this.config);
195
- }
196
- // Always load staticMeta.json regardless of config.useStaticFallback
197
- await this.loadStaticMetaOverrides();
198
-
199
- if (this.config.onlyUseStaticFallback) {
200
- await this.loadStaticMetadata();
201
- this.buildLookupMaps();
202
-
203
- // Fetch HIP-3 metadata if configured
204
- if (this.config.hip3Dexs && this.config.hip3Dexs.length > 0) {
205
- await Promise.all(
206
- this.config.hip3Dexs.map((dex) => this.loadHip3Metadata(dex)),
207
- );
208
- }
209
- resolve();
210
- this.initialized = true;
211
- return;
212
- }
213
-
214
- try {
215
- // Fetch core metadata from API
216
- [this.spotMeta, this.perpsMeta, this.perpDexs] = await Promise.all([
217
- this.infoClient.spotMeta(),
218
- this.infoClient.meta(),
219
- this.infoClient.perpDexs() as Promise<PerpDex[] | null[]>,
220
- ]);
221
-
222
- if (this.config.debug) {
223
- console.info(
224
- "[MetadataClient] Core metadata",
225
- this.spotMeta,
226
- this.perpsMeta,
227
- this.perpDexs,
228
- );
229
- }
230
-
231
- // Build optimized lookup maps
232
- this.buildLookupMaps();
233
-
234
- // Fetch HIP-3 metadata if configured
235
- if (this.config.hip3Dexs && this.config.hip3Dexs.length > 0) {
236
- await Promise.all(
237
- this.config.hip3Dexs.map((dex) => this.loadHip3Metadata(dex)),
238
- );
239
- }
240
- this.initialized = true;
241
- if (this.config.debug) {
242
- console.info("[MetadataClient] Initialized");
243
- }
244
- resolve();
245
- } catch (error) {
246
- // Fall back to static data if API fetch fails and fallback is enabled
247
- if (this.config.useStaticFallback) {
248
- console.warn(
249
- "Failed to fetch metadata from API, using static fallback data",
250
- error,
251
- );
252
- await this.loadStaticMetadata();
253
- this.buildLookupMaps();
254
- this.initialized = true;
255
- resolve();
256
- } else {
257
- reject(error);
258
- }
259
- } finally {
260
- this.initialized = true;
261
- resolve();
262
- }
263
- });
264
- return this.initializing;
265
- }
266
-
267
- /**
268
- * Load staticMeta.json for display overrides
269
- * This is always loaded regardless of config.useStaticFallback
270
- */
271
- private async loadStaticMetaOverrides(): Promise<void> {
272
- const network = this.isTestnet ? "testnet" : "mainnet";
273
-
274
- try {
275
- const staticMetaModule = await import(
276
- `./data/${network}/staticMeta.json`
277
- );
278
- this.staticMeta = staticMetaModule.default as StaticMetadata;
279
- if (this.config.debug) {
280
- console.info(
281
- "[MetadataClient] Loaded static metadata overrides",
282
- this.staticMeta,
283
- );
284
- }
285
- } catch (error) {
286
- console.warn(`Failed to load staticMeta.json for ${network}:`, error);
287
- this.staticMeta = null;
288
- }
289
- }
290
-
291
- /**
292
- * Load static metadata from bundled JSON files
293
- */
294
- private async loadStaticMetadata(): Promise<void> {
295
- const network = this.isTestnet ? "testnet" : "mainnet";
296
-
297
- try {
298
- // Dynamic imports for static data
299
- const [
300
- spotMetaModule,
301
- perpsMetaModule,
302
- perpDexsModule,
303
- staticMetaModule,
304
- ] = await Promise.all([
305
- import(`./data/${network}/spotMeta.json`),
306
- import(`./data/${network}/meta.json`),
307
- import(`./data/${network}/perpDexs.json`),
308
- import(`./data/${network}/staticMeta.json`),
309
- ]);
310
-
311
- this.spotMeta = spotMetaModule.default as SpotMeta;
312
- this.perpsMeta = perpsMetaModule.default as PerpsMeta;
313
- this.perpDexs = perpDexsModule.default as (PerpDex | null)[];
314
- this.staticMeta = staticMetaModule.default as StaticMetadata;
315
-
316
- console.warn(`[MetadataClient] Using static ${network} metadata`);
317
- } catch (error) {
318
- console.error(`Failed to load static ${network} metadata:`, error);
319
- throw new Error(`Could not load metadata for ${network}`);
320
- }
321
- }
322
-
323
- /**
324
- * Build optimized lookup maps from raw metadata
325
- * Called after metadata is loaded (from API or static files)
326
- */
327
- private buildLookupMaps(): void {
328
- // Clear existing maps
329
- this.perpsSymbolToIndex.clear();
330
- this.spotTokenNameToIndex.clear();
331
- this.spotPairToMarket.clear();
332
- this.baseTokenToMarkets.clear();
333
- this.coinToMarket.clear();
334
- this.dexNameToIndex.clear();
335
- this.quoteAssets = [];
336
-
337
- if (this.config.debug) {
338
- console.info(
339
- "[MetadataClient] Building lookup maps",
340
- this.perpDexs,
341
- this.perpsMeta,
342
- this.spotMeta,
343
- );
344
- }
345
-
346
- // Build dex name to index map
347
- if (this.perpDexs) {
348
- this.perpDexs.forEach((dex, index) => {
349
- if (dex && dex.name) {
350
- this.dexNameToIndex.set(dex.name.toLowerCase(), index);
351
- }
352
- });
353
- }
354
-
355
- // Build perps symbol to index map
356
- if (this.perpsMeta) {
357
- this.perpsMeta.universe.forEach((market, index) => {
358
- const marketInfo: MarketInfo = {
359
- symbol: market.name,
360
- coin: market.name,
361
- assetId: index,
362
- szDecimals: market.szDecimals,
363
- type: "perps",
364
- maxLeverage: market.maxLeverage,
365
- growthMode: market.growthMode === "enabled",
366
- };
367
-
368
- // Apply static metadata overrides for perps
369
- const staticOverrides = this.staticMeta?.coins?.[market.name];
370
- if (staticOverrides) {
371
- if (staticOverrides.displayName) {
372
- marketInfo.displayName = staticOverrides.displayName;
373
- }
374
- if (staticOverrides.imageUrl) {
375
- marketInfo.imageUrl = staticOverrides.imageUrl;
376
- }
377
- }
378
-
379
- // Case-insensitive lookup
380
- this.perpsSymbolToIndex.set(market.name.toUpperCase(), index);
381
-
382
- // Add to unified symbol lookup
383
- this.coinToMarket.set(market.name, marketInfo);
384
- });
385
- }
386
-
387
- // Build spot token name to index map and collect quote assets
388
- if (this.spotMeta) {
389
- this.spotMeta.tokens.forEach((token) => {
390
- // Case-insensitive lookup
391
- this.spotTokenNameToIndex.set(token.name.toUpperCase(), token.index);
392
- });
393
-
394
- // Track unique quote assets
395
- const quoteIndices = new Set<number>();
396
-
397
- // Build spot pair to market map and base token to markets map
398
- this.spotMeta.universe.forEach((universe) => {
399
- const baseToken = this.spotMeta!.tokens[universe.tokens[0]];
400
- const quoteToken = this.spotMeta!.tokens[universe.tokens[1]];
401
-
402
- if (!baseToken || !quoteToken) return;
403
-
404
- const coin = universe.name;
405
-
406
- // Track quote asset
407
- quoteIndices.add(quoteToken.index);
408
-
409
- const marketInfo: MarketInfo = {
410
- coin,
411
- symbol: `${baseToken.name}/${quoteToken.name}`,
412
- assetId: 10000 + universe.index,
413
- szDecimals: baseToken.szDecimals,
414
- type: "spot",
415
- baseToken: baseToken,
416
- quoteToken: quoteToken,
417
- growthMode: false,
418
- };
419
-
420
- // Apply static metadata overrides for spot
421
- const staticOverrides = this.staticMeta?.coins?.[coin];
422
- if (staticOverrides) {
423
- if (staticOverrides.displayName) {
424
- marketInfo.displayName = staticOverrides.displayName;
425
- }
426
- if (staticOverrides.imageUrl) {
427
- marketInfo.imageUrl = staticOverrides.imageUrl;
428
- }
429
- }
430
-
431
- // Store by full pair (case-insensitive)
432
- const pairKey = `${baseToken.name}/${quoteToken.name}`.toUpperCase();
433
- this.spotPairToMarket.set(pairKey, marketInfo);
434
-
435
- // Add to unified symbol lookup
436
- this.coinToMarket.set(pairKey, marketInfo);
437
-
438
- this.coinToMarket.set(coin, marketInfo);
439
-
440
- // Group by base token (case-insensitive)
441
- const baseKey = baseToken.name.toUpperCase();
442
- const existing = this.baseTokenToMarkets.get(baseKey) || [];
443
- existing.push(marketInfo);
444
- this.baseTokenToMarkets.set(baseKey, existing);
445
- });
446
-
447
- // Pre-compute sorted quote assets list
448
- this.quoteAssets = Array.from(quoteIndices)
449
- .map((idx) => this.spotMeta!.tokens[idx].name)
450
- .sort();
451
- }
452
- }
453
-
454
- /**
455
- * Load metadata for a specific HIP-3 DEX
456
- * Also builds optimized lookups for this DEX's markets
457
- */
458
- async loadHip3Metadata(dexName: string): Promise<DexInfo> {
459
- if (this.hip3DexsMeta.has(dexName)) return this.hip3DexsMeta.get(dexName)!;
460
-
461
- try {
462
- const [meta, contexts] = await this.infoClient.metaAndAssetCtxs({
463
- dex: dexName,
464
- });
465
-
466
- if (this.config.debug) {
467
- console.info(
468
- "[MetadataClient] Loaded HIP-3 metadata",
469
- dexName,
470
- meta,
471
- contexts,
472
- );
473
- }
474
-
475
- // O(1) lookup using pre-computed map
476
- let dexIndex = this.dexNameToIndex.get(dexName.toLowerCase());
477
-
478
- // Fallback to array search if not in map (shouldn't happen after initialization)
479
- if (dexIndex === undefined) {
480
- dexIndex = this.perpDexs.findIndex(
481
- (d) => d && d.name.toLowerCase() === dexName.toLowerCase(),
482
- );
483
- }
484
-
485
- if (dexIndex === -1 || dexIndex === undefined) {
486
- throw new Error(`DEX ${dexName} not found`);
487
- }
488
-
489
- const dex = this.perpDexs[dexIndex!];
490
-
491
- const collateralTokenIndex =
492
- (meta as ExtendedPerpsMeta).collateralToken ?? 0;
493
-
494
- const spotMetaTokens = this.spotMeta?.tokens;
495
-
496
- const collateralTokenSymbol =
497
- spotMetaTokens?.[collateralTokenIndex]?.name ?? "USDC";
498
-
499
- const dexInfo: DexInfo = {
500
- meta,
501
- assetContext: contexts,
502
- collateralTokenSymbol,
503
- dexFullName: dex?.fullName ?? dexName,
504
- dexName: dex?.name ?? dexName,
505
- dexIndex: dexIndex,
506
- };
507
-
508
- // Apply static metadata overrides for DEX
509
- const staticDexOverrides = this.staticMeta?.dexs?.[dexName];
510
- if (staticDexOverrides) {
511
- if (staticDexOverrides.displayName) {
512
- dexInfo.displayName = staticDexOverrides.displayName;
513
- }
514
- if (staticDexOverrides.imageUrl) {
515
- dexInfo.imageUrl = staticDexOverrides.imageUrl;
516
- }
517
- if (staticDexOverrides.accountName) {
518
- dexInfo.accountName = staticDexOverrides.accountName;
519
- }
520
- }
521
-
522
- this.hip3DexsMeta.set(dexName, dexInfo);
523
-
524
- // Build HIP-3 market lookups for this DEX
525
- this.buildHip3MarketsForDex(dexName, dexInfo);
526
-
527
- return dexInfo;
528
- } catch (error) {
529
- console.error(`Failed to load HIP-3 metadata for ${dexName}:`, error);
530
- throw error;
531
- }
532
- }
533
-
534
- /**
535
- * Build optimized lookups for HIP-3 markets of a specific DEX
536
- */
537
- private buildHip3MarketsForDex(dexName: string, dexInfo: DexInfo): void {
538
- dexInfo.meta.universe.forEach((market, index) => {
539
- const symbol = market.name;
540
-
541
- const marketInfo: MarketInfo = {
542
- coin: symbol,
543
- symbol,
544
- assetId: 100000 + dexInfo.dexIndex * 10000 + index,
545
- szDecimals: market.szDecimals,
546
- type: "hip3",
547
- maxLeverage: market.maxLeverage,
548
- dexName,
549
- dexIndex: dexInfo.dexIndex,
550
- dexDisplayName: dexInfo.displayName,
551
- dexImageUrl: dexInfo.imageUrl,
552
- dexCollateralTokenSymbol: dexInfo.collateralTokenSymbol,
553
- growthMode: market.growthMode === "enabled",
554
- };
555
-
556
- // Apply static metadata overrides for HIP-3
557
- const staticOverrides = this.staticMeta?.coins?.[symbol];
558
- if (staticOverrides) {
559
- if (staticOverrides.displayName) {
560
- marketInfo.displayName = staticOverrides.displayName;
561
- }
562
- if (staticOverrides.imageUrl) {
563
- marketInfo.imageUrl = staticOverrides.imageUrl;
564
- }
565
- }
566
-
567
- if (this.config.debug) {
568
- console.info("[MetadataClient] caching market", symbol, marketInfo);
569
- }
570
-
571
- this.coinToMarket.set(symbol, marketInfo);
572
- this.hip3SymbolToMarket.set(symbol, marketInfo);
573
- });
574
- }
575
-
576
- /**
577
- * Ensure metadata is loaded (for lazy init)
578
- */
579
- private async ensureInitialized(): Promise<void> {
580
- if (!this.initialized) {
581
- await this.initialize();
582
- }
583
- }
584
-
585
- /**
586
- * Get market information by symbol
587
- * Optimized: O(1) direct map lookup for most cases
588
- * Lazily initialize hip-3 metadata if not already initialized
589
- *
590
- * @param symbol - Market symbol (e.g., "BTC", "PURR/USDC", "vntls:ABC")
591
- * @param quoteAsset - Quote asset for spot markets (default: "USDC")
592
- * @returns Market information or null if not found
593
- */
594
- async getMarketBySymbolAsync(
595
- symbol: string,
596
- quoteAsset: string = "USDC",
597
- ): Promise<MarketInfo | null> {
598
- await this.ensureInitialized();
599
-
600
- // Check if HIP-3 market (format: "dex:coin")
601
- if (symbol.includes(":")) {
602
- return this.getHip3Market(symbol);
603
- }
604
-
605
- // Try O(1) direct lookup first
606
- let lookupKey = symbol.toUpperCase();
607
-
608
- // If no "/" in symbol, it could be perps or need quote asset
609
- if (!symbol.includes("/") && !symbol.includes("@")) {
610
- // Try perps lookup first (O(1))
611
- const perpsMarket = this.coinToMarket.get(symbol);
612
- if (perpsMarket?.type === "perps") {
613
- return perpsMarket;
614
- }
615
-
616
- // Construct spot pair with quote asset
617
- lookupKey = `${symbol}/${quoteAsset}`.toUpperCase();
618
- }
619
-
620
- // O(1) lookup in unified map
621
- return this.coinToMarket.get(lookupKey) || null;
622
- }
623
-
624
- getMarketByCoin(coin: string): MarketInfo | null {
625
- return this.coinToMarket.get(coin) || null;
626
- }
627
-
628
- /**
629
- * Get perpetuals market information
630
- * Optimized: O(1) map lookup instead of O(n) array search
631
- */
632
- getPerpsMarket(symbol: string): MarketInfo | null {
633
- if (!this.perpsMeta) return null;
634
-
635
- if (isHip3Symbol(symbol)) {
636
- const [dexName, coinName] = symbol.split(":");
637
- if (!dexName || !coinName) return null;
638
-
639
- // Try O(1) lookup first (if DEX metadata already loaded)
640
- let cachedMarket = this.hip3SymbolToMarket.get(symbol);
641
- return cachedMarket || null;
642
- }
643
-
644
- // O(1) lookup using pre-computed map
645
- const index = this.perpsSymbolToIndex.get(symbol.toUpperCase());
646
- if (index === undefined) return null;
647
-
648
- const market = this.perpsMeta.universe[index];
649
-
650
- return {
651
- coin: symbol,
652
- symbol: market.name,
653
- assetId: index, // Perps asset ID is just the index
654
- szDecimals: market.szDecimals,
655
- type: "perps",
656
- maxLeverage: market.maxLeverage,
657
- growthMode: market.growthMode === "enabled",
658
- };
659
- }
660
-
661
- /**
662
- * Get spot market information
663
- * Optimized: O(1) map lookup instead of O(n) array searches
664
- *
665
- * @param baseSymbol - Base token symbol (e.g., "PURR", "UHYPE")
666
- * @param quoteSymbol - Quote token symbol (default: "USDC")
667
- */
668
- getSpotMarket(
669
- baseSymbol: string,
670
- quoteSymbol: string = "USDC",
671
- ): MarketInfo | null {
672
- if (!this.spotMeta) return null;
673
-
674
- // O(1) lookup using pre-computed map
675
- const pairKey = `${baseSymbol}/${quoteSymbol}`.toUpperCase();
676
- const market = this.spotPairToMarket.get(pairKey);
677
-
678
- return market || null;
679
- }
680
-
681
- /**
682
- * Get HIP-3 market information
683
- * Optimized: O(1) map lookup after DEX metadata is loaded
684
- *
685
- * @param symbol - HIP-3 market symbol (format: "dex:coin")
686
- */
687
- async getHip3Market(symbol: string): Promise<MarketInfo | null> {
688
- const [dexName, coinName] = symbol.split(":");
689
- if (!dexName || !coinName) return null;
690
-
691
- // Try O(1) lookup first (if DEX metadata already loaded)
692
- let cachedMarket = this.hip3SymbolToMarket.get(symbol);
693
- if (cachedMarket) return cachedMarket;
694
- console.warn("Missing market", symbol, this.hip3SymbolToMarket);
695
-
696
- // If not found, check if we need to load DEX metadata
697
- const dexMeta = this.hip3DexsMeta.get(dexName);
698
- if (!dexMeta && this.config.lazyInit) {
699
- // Load and build lookups for this DEX
700
- await this.loadHip3Metadata(dexName);
701
- // Try lookup again after loading
702
- cachedMarket = this.hip3SymbolToMarket.get(symbol);
703
- return cachedMarket || null;
704
- }
705
-
706
- // If DEX is loaded but symbol not found in map, return null
707
- return null;
708
- }
709
-
710
- async getHip3Dex(dexName: string): Promise<DexInfo | null> {
711
- await this.ensureInitialized();
712
- let dexInfo = this.hip3DexsMeta.get(dexName) ?? null;
713
- if (this.config.lazyInit && !dexInfo) {
714
- dexInfo = await this.loadHip3Metadata(dexName);
715
- }
716
-
717
- return dexInfo;
718
- }
719
-
720
- /**
721
- * Get all available markets for a base token
722
- * Optimized: O(1) map lookup instead of O(n) filter + map
723
- * Useful for showing all quote asset options
724
- */
725
- getAllMarketsForBase(baseSymbol: string): MarketInfo[] {
726
- if (!this.spotMeta) return [];
727
-
728
- // O(1) lookup using pre-computed map
729
- const baseKey = baseSymbol.toUpperCase();
730
- return this.baseTokenToMarkets.get(baseKey) || [];
731
- }
732
-
733
- /**
734
- * Get spot token information
735
- * Optimized: O(1) map lookup instead of O(n) array search
736
- */
737
- getSpotTokenInfo(tokenSymbol: string): TokenInfo | null {
738
- if (!this.spotMeta) return null;
739
-
740
- // O(1) lookup using pre-computed map
741
- const tokenIndex = this.spotTokenNameToIndex.get(tokenSymbol.toUpperCase());
742
- if (tokenIndex === undefined) return null;
743
-
744
- const token = this.spotMeta.tokens[tokenIndex];
745
-
746
- return {
747
- name: token.name,
748
- index: token.index,
749
- szDecimals: token.szDecimals,
750
- weiDecimals: token.weiDecimals,
751
- tokenId: token.tokenId,
752
- };
753
- }
754
-
755
- /**
756
- * Get all available quote assets
757
- * Optimized: O(1) pre-computed array instead of O(n) computation
758
- */
759
- getAvailableQuoteAssets(): string[] {
760
- return this.quoteAssets;
761
- }
762
-
763
- /**
764
- * Get raw metadata (for advanced use cases)
765
- */
766
- getRawMetadata() {
767
- return {
768
- spotMeta: this.spotMeta,
769
- perpsMeta: this.perpsMeta,
770
- perpDexs: this.perpDexs,
771
- hip3DexsMeta: Object.fromEntries(this.hip3DexsMeta),
772
- coinToMarket: Object.fromEntries(this.coinToMarket),
773
- hip3SymbolToMarket: Object.fromEntries(this.hip3SymbolToMarket),
774
- };
775
- }
776
-
777
- /**
778
- * Get network configuration
779
- */
780
- getNetworkInfo() {
781
- return {
782
- isTestnet: this.isTestnet,
783
- useStaticFallback: this.config.useStaticFallback,
784
- initialized: this.initialized,
785
- };
786
- }
787
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basedone/core",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Core utilities for Based One",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -30,9 +30,17 @@
30
30
  "ecommerce.ts",
31
31
  "lib"
32
32
  ],
33
+ "scripts": {
34
+ "build": "rm -rf dist && tsup index.ts react.ts ecommerce.ts --format cjs,esm --dts",
35
+ "dev": "tsup index.ts react.ts ecommerce.ts --format cjs,esm --dts --watch",
36
+ "test": "vitest",
37
+ "update-meta": "tsx scripts/update-static-meta.ts",
38
+ "prepublishOnly": "pnpm build"
39
+ },
33
40
  "keywords": [],
34
41
  "author": "",
35
42
  "license": "ISC",
43
+ "packageManager": "pnpm@10.10.0",
36
44
  "devDependencies": {
37
45
  "@types/node": "^20.0.0",
38
46
  "@types/react": "^18.0.0",
@@ -54,11 +62,5 @@
54
62
  "react": {
55
63
  "optional": true
56
64
  }
57
- },
58
- "scripts": {
59
- "build": "rm -rf dist && tsup index.ts react.ts ecommerce.ts --format cjs,esm --dts",
60
- "dev": "tsup index.ts react.ts ecommerce.ts --format cjs,esm --dts --watch",
61
- "test": "vitest",
62
- "update-meta": "tsx scripts/update-static-meta.ts"
63
65
  }
64
- }
66
+ }