@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.
@@ -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
 
@@ -54621,43 +54613,43 @@ var PolygonIdSdk = (function (exports) {
54621
54613
  */
54622
54614
  const PROTOCOL_MESSAGE_TYPE = Object.freeze({
54623
54615
  // AuthorizationV2RequestMessageType defines auth request type of the communication protocol
54624
- AUTHORIZATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'authorization/1.0/request',
54616
+ AUTHORIZATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}authorization/1.0/request`,
54625
54617
  // AuthorizationResponseMessageType defines auth response type of the communication protocol
54626
- AUTHORIZATION_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'authorization/1.0/response',
54618
+ AUTHORIZATION_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}authorization/1.0/response`,
54627
54619
  // CredentialIssuanceRequestMessageType accepts request for credential creation
54628
- CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/issuance-request',
54620
+ CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/issuance-request`,
54629
54621
  // CredentialFetchRequestMessageType is type for request of credential generation
54630
- CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/fetch-request',
54622
+ CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/fetch-request`,
54631
54623
  // CredentialOfferMessageType is type of message with credential offering
54632
- CREDENTIAL_OFFER_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/offer',
54624
+ CREDENTIAL_OFFER_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/offer`,
54633
54625
  // CredentialIssuanceResponseMessageType is type for message with a credential issuance
54634
- CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/issuance-response',
54626
+ CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/issuance-response`,
54635
54627
  // CredentialRefreshMessageType is type for message with a credential issuance
54636
- CREDENTIAL_REFRESH_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/refresh',
54628
+ CREDENTIAL_REFRESH_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/refresh`,
54637
54629
  // DeviceRegistrationRequestMessageType defines device registration request type of the communication protocol
54638
- DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'devices/1.0/registration',
54630
+ DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}devices/1.0/registration`,
54639
54631
  // MessageFetMessageFetchRequestMessageType defines message fetch request type of the communication protocol.
54640
- MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'messages/1.0/fetch',
54632
+ MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}messages/1.0/fetch`,
54641
54633
  // ProofGenerationRequestMessageType is type for request of proof generation
54642
- PROOF_GENERATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/request',
54634
+ PROOF_GENERATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/request`,
54643
54635
  // ProofGenerationResponseMessageType is type for response of proof generation
54644
- PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/response',
54636
+ PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/response`,
54645
54637
  // RevocationStatusRequestMessageType is type for request of revocation status
54646
- REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'revocation/1.0/request-status',
54638
+ REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}revocation/1.0/request-status`,
54647
54639
  // RevocationStatusResponseMessageType is type for response with a revocation status
54648
- REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'revocation/1.0/status',
54640
+ REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}revocation/1.0/status`,
54649
54641
  // ContractInvokeRequestMessageType is type for request of contract invoke request
54650
- CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/contract-invoke-request',
54642
+ CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/contract-invoke-request`,
54651
54643
  // CredentialOnchainOfferMessageType is type of message with credential onchain offering
54652
- CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/onchain-offer',
54644
+ CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/onchain-offer`,
54653
54645
  // ProposalRequestMessageType is type for proposal-request message
54654
- PROPOSAL_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/proposal-request',
54646
+ PROPOSAL_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/proposal-request`,
54655
54647
  // ProposalMessageType is type for proposal message
54656
- PROPOSAL_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/proposal',
54648
+ PROPOSAL_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/proposal`,
54657
54649
  // PaymentRequestMessageType is type for payment-request message
54658
- PAYMENT_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/payment-request',
54650
+ PAYMENT_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment-request`,
54659
54651
  // PaymentMessageType is type for payment message
54660
- PAYMENT_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/payment'
54652
+ PAYMENT_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment`
54661
54653
  });
54662
54654
  /**
54663
54655
  * Media types for iden3 comm communication protocol