@0xpolygonid/js-sdk 1.17.3 → 1.17.4

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.
@@ -52304,12 +52304,6 @@ class EthStateStorage {
52304
52304
  }
52305
52305
  getStateContractAndProviderForId(id) {
52306
52306
  const idTyped = Id$1.fromBigInt(id);
52307
- if (!Array.isArray(this.ethConfig)) {
52308
- return {
52309
- stateContract: this.stateContract,
52310
- provider: this.provider
52311
- };
52312
- }
52313
52307
  const chainId = getChainId(DID.blockchainFromId(idTyped), DID.networkIdFromId(idTyped));
52314
52308
  const config = this.networkByChainId(chainId);
52315
52309
  const provider = new JsonRpcProvider(config.url);
@@ -52317,14 +52311,12 @@ class EthStateStorage {
52317
52311
  return { stateContract, provider };
52318
52312
  }
52319
52313
  networkByChainId(chainId) {
52320
- if (Array.isArray(this.ethConfig)) {
52321
- const network = this.ethConfig.find((c) => c.chainId === chainId);
52322
- if (!network) {
52323
- throw new Error(`chainId "${chainId}" not supported`);
52324
- }
52325
- return network;
52314
+ const config = Array.isArray(this.ethConfig) ? this.ethConfig : [this.ethConfig];
52315
+ const network = config.find((c) => c.chainId === chainId);
52316
+ if (!network) {
52317
+ throw new Error(`chainId "${chainId}" not supported`);
52326
52318
  }
52327
- return this.ethConfig;
52319
+ return network;
52328
52320
  }
52329
52321
  }
52330
52322