@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.
@@ -52443,12 +52443,6 @@ var PolygonIdSdk = (function (exports) {
52443
52443
  }
52444
52444
  getStateContractAndProviderForId(id) {
52445
52445
  const idTyped = H$2.fromBigInt(id);
52446
- if (!Array.isArray(this.ethConfig)) {
52447
- return {
52448
- stateContract: this.stateContract,
52449
- provider: this.provider
52450
- };
52451
- }
52452
52446
  const chainId = et$2(Z$2.blockchainFromId(idTyped), Z$2.networkIdFromId(idTyped));
52453
52447
  const config = this.networkByChainId(chainId);
52454
52448
  const provider = new JsonRpcProvider(config.url);
@@ -52456,14 +52450,12 @@ var PolygonIdSdk = (function (exports) {
52456
52450
  return { stateContract, provider };
52457
52451
  }
52458
52452
  networkByChainId(chainId) {
52459
- if (Array.isArray(this.ethConfig)) {
52460
- const network = this.ethConfig.find((c) => c.chainId === chainId);
52461
- if (!network) {
52462
- throw new Error(`chainId "${chainId}" not supported`);
52463
- }
52464
- return network;
52453
+ const config = Array.isArray(this.ethConfig) ? this.ethConfig : [this.ethConfig];
52454
+ const network = config.find((c) => c.chainId === chainId);
52455
+ if (!network) {
52456
+ throw new Error(`chainId "${chainId}" not supported`);
52465
52457
  }
52466
- return this.ethConfig;
52458
+ return network;
52467
52459
  }
52468
52460
  }
52469
52461