@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.
- package/dist/browser/esm/index.js +24 -32
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +24 -32
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/iden3comm/constants.js +19 -19
- package/dist/node/cjs/storage/blockchain/state.js +5 -13
- package/dist/node/esm/iden3comm/constants.js +19 -19
- package/dist/node/esm/storage/blockchain/state.js +5 -13
- package/dist/types/iden3comm/constants.d.ts +19 -19
- package/dist/types/iden3comm/types/packer.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/auth.d.ts +3 -0
- package/dist/types/iden3comm/types/protocol/contract-request.d.ts +2 -0
- package/dist/types/iden3comm/types/protocol/credentials.d.ts +10 -3
- package/dist/types/iden3comm/types/protocol/messages.d.ts +3 -1
- package/dist/types/iden3comm/types/protocol/payment.d.ts +3 -0
- package/dist/types/iden3comm/types/protocol/proof.d.ts +5 -2
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +6 -3
- package/dist/types/iden3comm/types/protocol/revocation.d.ts +5 -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
|
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
54652
|
+
PAYMENT_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment`
|
|
54661
54653
|
});
|
|
54662
54654
|
/**
|
|
54663
54655
|
* Media types for iden3 comm communication protocol
|