@0xpolygonid/js-sdk 1.17.2 → 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
 
@@ -54482,43 +54474,43 @@ const IDEN3_PROTOCOL = 'https://iden3-communication.io/';
54482
54474
  */
54483
54475
  const PROTOCOL_MESSAGE_TYPE = Object.freeze({
54484
54476
  // AuthorizationV2RequestMessageType defines auth request type of the communication protocol
54485
- AUTHORIZATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'authorization/1.0/request',
54477
+ AUTHORIZATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}authorization/1.0/request`,
54486
54478
  // AuthorizationResponseMessageType defines auth response type of the communication protocol
54487
- AUTHORIZATION_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'authorization/1.0/response',
54479
+ AUTHORIZATION_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}authorization/1.0/response`,
54488
54480
  // CredentialIssuanceRequestMessageType accepts request for credential creation
54489
- CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/issuance-request',
54481
+ CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/issuance-request`,
54490
54482
  // CredentialFetchRequestMessageType is type for request of credential generation
54491
- CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/fetch-request',
54483
+ CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/fetch-request`,
54492
54484
  // CredentialOfferMessageType is type of message with credential offering
54493
- CREDENTIAL_OFFER_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/offer',
54485
+ CREDENTIAL_OFFER_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/offer`,
54494
54486
  // CredentialIssuanceResponseMessageType is type for message with a credential issuance
54495
- CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/issuance-response',
54487
+ CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/issuance-response`,
54496
54488
  // CredentialRefreshMessageType is type for message with a credential issuance
54497
- CREDENTIAL_REFRESH_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/refresh',
54489
+ CREDENTIAL_REFRESH_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/refresh`,
54498
54490
  // DeviceRegistrationRequestMessageType defines device registration request type of the communication protocol
54499
- DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'devices/1.0/registration',
54491
+ DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}devices/1.0/registration`,
54500
54492
  // MessageFetMessageFetchRequestMessageType defines message fetch request type of the communication protocol.
54501
- MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'messages/1.0/fetch',
54493
+ MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}messages/1.0/fetch`,
54502
54494
  // ProofGenerationRequestMessageType is type for request of proof generation
54503
- PROOF_GENERATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/request',
54495
+ PROOF_GENERATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/request`,
54504
54496
  // ProofGenerationResponseMessageType is type for response of proof generation
54505
- PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/response',
54497
+ PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/response`,
54506
54498
  // RevocationStatusRequestMessageType is type for request of revocation status
54507
- REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'revocation/1.0/request-status',
54499
+ REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}revocation/1.0/request-status`,
54508
54500
  // RevocationStatusResponseMessageType is type for response with a revocation status
54509
- REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'revocation/1.0/status',
54501
+ REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}revocation/1.0/status`,
54510
54502
  // ContractInvokeRequestMessageType is type for request of contract invoke request
54511
- CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/contract-invoke-request',
54503
+ CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/contract-invoke-request`,
54512
54504
  // CredentialOnchainOfferMessageType is type of message with credential onchain offering
54513
- CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/onchain-offer',
54505
+ CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/onchain-offer`,
54514
54506
  // ProposalRequestMessageType is type for proposal-request message
54515
- PROPOSAL_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/proposal-request',
54507
+ PROPOSAL_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/proposal-request`,
54516
54508
  // ProposalMessageType is type for proposal message
54517
- PROPOSAL_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/proposal',
54509
+ PROPOSAL_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/proposal`,
54518
54510
  // PaymentRequestMessageType is type for payment-request message
54519
- PAYMENT_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/payment-request',
54511
+ PAYMENT_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment-request`,
54520
54512
  // PaymentMessageType is type for payment message
54521
- PAYMENT_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/payment'
54513
+ PAYMENT_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment`
54522
54514
  });
54523
54515
  /**
54524
54516
  * Media types for iden3 comm communication protocol