@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
|
@@ -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
|
-
|
|
52321
|
-
|
|
52322
|
-
|
|
52323
|
-
|
|
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
|
|
52319
|
+
return network;
|
|
52328
52320
|
}
|
|
52329
52321
|
}
|
|
52330
52322
|
|