@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.
- package/dist/browser/esm/index.js +5 -13
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +5 -13
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/storage/blockchain/state.js +5 -13
- package/dist/node/esm/storage/blockchain/state.js +5 -13
- package/dist/types/iden3comm/types/protocol/credentials.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/messages.d.ts +1 -1
- package/dist/types/iden3comm/types/protocol/proof.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +3 -3
- package/dist/types/iden3comm/types/protocol/revocation.d.ts +2 -2
- package/package.json +3 -2
|
@@ -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
|
-
|
|
52460
|
-
|
|
52461
|
-
|
|
52462
|
-
|
|
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
|
|
52458
|
+
return network;
|
|
52467
52459
|
}
|
|
52468
52460
|
}
|
|
52469
52461
|
|