@unicitylabs/sphere-sdk 0.8.0-dev.4 → 0.8.0-dev.5

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/index.cjs CHANGED
@@ -28507,13 +28507,14 @@ var Sphere = class _Sphere {
28507
28507
  */
28508
28508
  static resolveGroupChatConfig(config, network) {
28509
28509
  if (!config) return void 0;
28510
+ if (!network) {
28511
+ throw new SphereError("network is required to resolve group chat relays.", "INVALID_CONFIG");
28512
+ }
28510
28513
  if (config === true) {
28511
- const netConfig = network ? NETWORKS[network] : NETWORKS.mainnet;
28512
- return { relays: [...netConfig.groupRelays] };
28514
+ return { relays: [...NETWORKS[network].groupRelays] };
28513
28515
  }
28514
28516
  if (!config.relays || config.relays.length === 0) {
28515
- const netConfig = network ? NETWORKS[network] : NETWORKS.mainnet;
28516
- return { ...config, relays: [...netConfig.groupRelays] };
28517
+ return { ...config, relays: [...NETWORKS[network].groupRelays] };
28517
28518
  }
28518
28519
  return config;
28519
28520
  }
@@ -28561,13 +28562,12 @@ var Sphere = class _Sphere {
28561
28562
  */
28562
28563
  static configureTokenRegistry(storage, network) {
28563
28564
  if (!network) {
28564
- logger.warn(
28565
- "Sphere",
28566
- "configureTokenRegistry: no network provided \u2014 defaulting to testnet. Pass options.network to avoid loading the wrong-network registry."
28565
+ throw new SphereError(
28566
+ "network is required to configure the TokenRegistry. Every Sphere entry point must forward options.network.",
28567
+ "INVALID_CONFIG"
28567
28568
  );
28568
28569
  }
28569
- const netConfig = network ? NETWORKS[network] : NETWORKS.testnet;
28570
- TokenRegistry.configure({ remoteUrl: netConfig.tokenRegistryUrl, storage });
28570
+ TokenRegistry.configure({ remoteUrl: NETWORKS[network].tokenRegistryUrl, storage });
28571
28571
  }
28572
28572
  /**
28573
28573
  * Create new wallet with mnemonic