@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.
@@ -28148,13 +28148,14 @@ var Sphere = class _Sphere {
28148
28148
  */
28149
28149
  static resolveGroupChatConfig(config, network) {
28150
28150
  if (!config) return void 0;
28151
+ if (!network) {
28152
+ throw new SphereError("network is required to resolve group chat relays.", "INVALID_CONFIG");
28153
+ }
28151
28154
  if (config === true) {
28152
- const netConfig = network ? NETWORKS[network] : NETWORKS.mainnet;
28153
- return { relays: [...netConfig.groupRelays] };
28155
+ return { relays: [...NETWORKS[network].groupRelays] };
28154
28156
  }
28155
28157
  if (!config.relays || config.relays.length === 0) {
28156
- const netConfig = network ? NETWORKS[network] : NETWORKS.mainnet;
28157
- return { ...config, relays: [...netConfig.groupRelays] };
28158
+ return { ...config, relays: [...NETWORKS[network].groupRelays] };
28158
28159
  }
28159
28160
  return config;
28160
28161
  }
@@ -28202,13 +28203,12 @@ var Sphere = class _Sphere {
28202
28203
  */
28203
28204
  static configureTokenRegistry(storage, network) {
28204
28205
  if (!network) {
28205
- logger.warn(
28206
- "Sphere",
28207
- "configureTokenRegistry: no network provided \u2014 defaulting to testnet. Pass options.network to avoid loading the wrong-network registry."
28206
+ throw new SphereError(
28207
+ "network is required to configure the TokenRegistry. Every Sphere entry point must forward options.network.",
28208
+ "INVALID_CONFIG"
28208
28209
  );
28209
28210
  }
28210
- const netConfig = network ? NETWORKS[network] : NETWORKS.testnet;
28211
- TokenRegistry.configure({ remoteUrl: netConfig.tokenRegistryUrl, storage });
28211
+ TokenRegistry.configure({ remoteUrl: NETWORKS[network].tokenRegistryUrl, storage });
28212
28212
  }
28213
28213
  /**
28214
28214
  * Create new wallet with mnemonic