@0xpolygonid/js-sdk 1.17.2 → 1.17.3

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.
@@ -7,43 +7,43 @@ const IDEN3_PROTOCOL = 'https://iden3-communication.io/';
7
7
  */
8
8
  exports.PROTOCOL_MESSAGE_TYPE = Object.freeze({
9
9
  // AuthorizationV2RequestMessageType defines auth request type of the communication protocol
10
- AUTHORIZATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'authorization/1.0/request',
10
+ AUTHORIZATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}authorization/1.0/request`,
11
11
  // AuthorizationResponseMessageType defines auth response type of the communication protocol
12
- AUTHORIZATION_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'authorization/1.0/response',
12
+ AUTHORIZATION_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}authorization/1.0/response`,
13
13
  // CredentialIssuanceRequestMessageType accepts request for credential creation
14
- CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/issuance-request',
14
+ CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/issuance-request`,
15
15
  // CredentialFetchRequestMessageType is type for request of credential generation
16
- CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/fetch-request',
16
+ CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/fetch-request`,
17
17
  // CredentialOfferMessageType is type of message with credential offering
18
- CREDENTIAL_OFFER_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/offer',
18
+ CREDENTIAL_OFFER_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/offer`,
19
19
  // CredentialIssuanceResponseMessageType is type for message with a credential issuance
20
- CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/issuance-response',
20
+ CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/issuance-response`,
21
21
  // CredentialRefreshMessageType is type for message with a credential issuance
22
- CREDENTIAL_REFRESH_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/refresh',
22
+ CREDENTIAL_REFRESH_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/refresh`,
23
23
  // DeviceRegistrationRequestMessageType defines device registration request type of the communication protocol
24
- DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'devices/1.0/registration',
24
+ DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}devices/1.0/registration`,
25
25
  // MessageFetMessageFetchRequestMessageType defines message fetch request type of the communication protocol.
26
- MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'messages/1.0/fetch',
26
+ MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}messages/1.0/fetch`,
27
27
  // ProofGenerationRequestMessageType is type for request of proof generation
28
- PROOF_GENERATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/request',
28
+ PROOF_GENERATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/request`,
29
29
  // ProofGenerationResponseMessageType is type for response of proof generation
30
- PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/response',
30
+ PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/response`,
31
31
  // RevocationStatusRequestMessageType is type for request of revocation status
32
- REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'revocation/1.0/request-status',
32
+ REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}revocation/1.0/request-status`,
33
33
  // RevocationStatusResponseMessageType is type for response with a revocation status
34
- REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'revocation/1.0/status',
34
+ REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}revocation/1.0/status`,
35
35
  // ContractInvokeRequestMessageType is type for request of contract invoke request
36
- CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/contract-invoke-request',
36
+ CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/contract-invoke-request`,
37
37
  // CredentialOnchainOfferMessageType is type of message with credential onchain offering
38
- CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/onchain-offer',
38
+ CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/onchain-offer`,
39
39
  // ProposalRequestMessageType is type for proposal-request message
40
- PROPOSAL_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/proposal-request',
40
+ PROPOSAL_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/proposal-request`,
41
41
  // ProposalMessageType is type for proposal message
42
- PROPOSAL_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/proposal',
42
+ PROPOSAL_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/proposal`,
43
43
  // PaymentRequestMessageType is type for payment-request message
44
- PAYMENT_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/payment-request',
44
+ PAYMENT_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment-request`,
45
45
  // PaymentMessageType is type for payment message
46
- PAYMENT_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/payment'
46
+ PAYMENT_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment`
47
47
  });
48
48
  /**
49
49
  * Media types for iden3 comm communication protocol
@@ -4,43 +4,43 @@ const IDEN3_PROTOCOL = 'https://iden3-communication.io/';
4
4
  */
5
5
  export const PROTOCOL_MESSAGE_TYPE = Object.freeze({
6
6
  // AuthorizationV2RequestMessageType defines auth request type of the communication protocol
7
- AUTHORIZATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'authorization/1.0/request',
7
+ AUTHORIZATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}authorization/1.0/request`,
8
8
  // AuthorizationResponseMessageType defines auth response type of the communication protocol
9
- AUTHORIZATION_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'authorization/1.0/response',
9
+ AUTHORIZATION_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}authorization/1.0/response`,
10
10
  // CredentialIssuanceRequestMessageType accepts request for credential creation
11
- CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/issuance-request',
11
+ CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/issuance-request`,
12
12
  // CredentialFetchRequestMessageType is type for request of credential generation
13
- CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/fetch-request',
13
+ CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/fetch-request`,
14
14
  // CredentialOfferMessageType is type of message with credential offering
15
- CREDENTIAL_OFFER_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/offer',
15
+ CREDENTIAL_OFFER_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/offer`,
16
16
  // CredentialIssuanceResponseMessageType is type for message with a credential issuance
17
- CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/issuance-response',
17
+ CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/issuance-response`,
18
18
  // CredentialRefreshMessageType is type for message with a credential issuance
19
- CREDENTIAL_REFRESH_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/refresh',
19
+ CREDENTIAL_REFRESH_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/refresh`,
20
20
  // DeviceRegistrationRequestMessageType defines device registration request type of the communication protocol
21
- DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'devices/1.0/registration',
21
+ DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}devices/1.0/registration`,
22
22
  // MessageFetMessageFetchRequestMessageType defines message fetch request type of the communication protocol.
23
- MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'messages/1.0/fetch',
23
+ MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}messages/1.0/fetch`,
24
24
  // ProofGenerationRequestMessageType is type for request of proof generation
25
- PROOF_GENERATION_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/request',
25
+ PROOF_GENERATION_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/request`,
26
26
  // ProofGenerationResponseMessageType is type for response of proof generation
27
- PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/response',
27
+ PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/response`,
28
28
  // RevocationStatusRequestMessageType is type for request of revocation status
29
- REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'revocation/1.0/request-status',
29
+ REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}revocation/1.0/request-status`,
30
30
  // RevocationStatusResponseMessageType is type for response with a revocation status
31
- REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: IDEN3_PROTOCOL + 'revocation/1.0/status',
31
+ REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: `${IDEN3_PROTOCOL}revocation/1.0/status`,
32
32
  // ContractInvokeRequestMessageType is type for request of contract invoke request
33
- CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'proofs/1.0/contract-invoke-request',
33
+ CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}proofs/1.0/contract-invoke-request`,
34
34
  // CredentialOnchainOfferMessageType is type of message with credential onchain offering
35
- CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/1.0/onchain-offer',
35
+ CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/1.0/onchain-offer`,
36
36
  // ProposalRequestMessageType is type for proposal-request message
37
- PROPOSAL_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/proposal-request',
37
+ PROPOSAL_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/proposal-request`,
38
38
  // ProposalMessageType is type for proposal message
39
- PROPOSAL_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/proposal',
39
+ PROPOSAL_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/proposal`,
40
40
  // PaymentRequestMessageType is type for payment-request message
41
- PAYMENT_REQUEST_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/payment-request',
41
+ PAYMENT_REQUEST_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment-request`,
42
42
  // PaymentMessageType is type for payment message
43
- PAYMENT_MESSAGE_TYPE: IDEN3_PROTOCOL + 'credentials/0.1/payment'
43
+ PAYMENT_MESSAGE_TYPE: `${IDEN3_PROTOCOL}credentials/0.1/payment`
44
44
  });
45
45
  /**
46
46
  * Media types for iden3 comm communication protocol
@@ -2,25 +2,25 @@
2
2
  * Constants for Iden3 protocol
3
3
  */
4
4
  export declare const PROTOCOL_MESSAGE_TYPE: Readonly<{
5
- AUTHORIZATION_REQUEST_MESSAGE_TYPE: string;
6
- AUTHORIZATION_RESPONSE_MESSAGE_TYPE: string;
7
- CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: string;
8
- CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: string;
9
- CREDENTIAL_OFFER_MESSAGE_TYPE: string;
10
- CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: string;
11
- CREDENTIAL_REFRESH_MESSAGE_TYPE: string;
12
- DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: string;
13
- MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: string;
14
- PROOF_GENERATION_REQUEST_MESSAGE_TYPE: string;
15
- PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: string;
16
- REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: string;
17
- REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: string;
18
- CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: string;
19
- CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: string;
20
- PROPOSAL_REQUEST_MESSAGE_TYPE: string;
21
- PROPOSAL_MESSAGE_TYPE: string;
22
- PAYMENT_REQUEST_MESSAGE_TYPE: string;
23
- PAYMENT_MESSAGE_TYPE: string;
5
+ AUTHORIZATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/request";
6
+ AUTHORIZATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/response";
7
+ CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-request";
8
+ CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/fetch-request";
9
+ CREDENTIAL_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/offer";
10
+ CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-response";
11
+ CREDENTIAL_REFRESH_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/refresh";
12
+ DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/devices/1.0/registration";
13
+ MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/messages/1.0/fetch";
14
+ PROOF_GENERATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/request";
15
+ PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/response";
16
+ REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/request-status";
17
+ REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/status";
18
+ CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-request";
19
+ CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/onchain-offer";
20
+ PROPOSAL_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal-request";
21
+ PROPOSAL_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal";
22
+ PAYMENT_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment-request";
23
+ PAYMENT_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment";
24
24
  }>;
25
25
  /**
26
26
  * Media types for iden3 comm communication protocol
@@ -2,13 +2,13 @@ import { DID } from '@iden3/js-iden3-core';
2
2
  import { DataPrepareHandlerFunc, VerificationHandlerFunc } from '../packers';
3
3
  import { ProvingMethodAlg } from '@iden3/js-jwz';
4
4
  import { CircuitId } from '../../circuits';
5
- import { MediaType } from '../constants';
5
+ import { MediaType, PROTOCOL_MESSAGE_TYPE } from '../constants';
6
6
  import { DIDDocument, VerificationMethod } from 'did-resolver';
7
7
  import { StateVerificationOpts } from './models';
8
8
  /**
9
9
  * Protocol message type
10
10
  */
11
- export type ProtocolMessage = string;
11
+ export type ProtocolMessage = (typeof PROTOCOL_MESSAGE_TYPE)[keyof typeof PROTOCOL_MESSAGE_TYPE];
12
12
  /**
13
13
  * JSONValue
14
14
  */
@@ -1,10 +1,12 @@
1
1
  import { ZKProof } from '@iden3/js-jwz';
2
2
  import { BasicMessage, JSONObject } from '../packer';
3
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
3
4
  /** AuthorizationResponseMessage is struct the represents iden3message authorization response */
4
5
  export type AuthorizationResponseMessage = BasicMessage & {
5
6
  body: AuthorizationMessageResponseBody;
6
7
  from: string;
7
8
  to: string;
9
+ type: typeof PROTOCOL_MESSAGE_TYPE.AUTHORIZATION_RESPONSE_MESSAGE_TYPE;
8
10
  };
9
11
  /** AuthorizationMessageResponseBody is struct the represents authorization response data */
10
12
  export type AuthorizationMessageResponseBody = {
@@ -16,6 +18,7 @@ export type AuthorizationMessageResponseBody = {
16
18
  export type AuthorizationRequestMessage = BasicMessage & {
17
19
  body: AuthorizationRequestMessageBody;
18
20
  from: string;
21
+ type: typeof PROTOCOL_MESSAGE_TYPE.AUTHORIZATION_REQUEST_MESSAGE_TYPE;
19
22
  };
20
23
  /** AuthorizationRequestMessageBody is body for authorization request */
21
24
  export type AuthorizationRequestMessageBody = {
@@ -1,8 +1,10 @@
1
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
1
2
  import { BasicMessage } from '../packer';
2
3
  import { ZeroKnowledgeProofRequest } from './auth';
3
4
  /** ContractInvokeRequest represents structure of contract invoke request object */
4
5
  export type ContractInvokeRequest = BasicMessage & {
5
6
  body: ContractInvokeRequestBody;
7
+ type: typeof PROTOCOL_MESSAGE_TYPE.CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE;
6
8
  };
7
9
  /** ContractInvokeRequestBody represents structure of contract invoke request body object */
8
10
  export type ContractInvokeRequestBody = {
@@ -1,4 +1,5 @@
1
1
  import { W3CCredential } from '../../../verifiable';
2
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
2
3
  import { BasicMessage, JSONObject } from '../packer';
3
4
  import { ContractInvokeTransactionData } from './contract-request';
4
5
  /** CredentialIssuanceRequestMessageBody represents data for credential issuance request */
@@ -10,19 +11,22 @@ export type CredentialIssuanceRequestMessageBody = {
10
11
  /** CredentialIssuanceRequestMessage represent Iden3message for credential request */
11
12
  export type CredentialIssuanceRequestMessage = Required<BasicMessage> & {
12
13
  body: CredentialIssuanceRequestMessageBody;
14
+ type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE;
13
15
  };
14
16
  /** CredentialsOfferMessage represent Iden3message for credential offer */
15
17
  export type CredentialsOfferMessage = Required<BasicMessage> & {
16
18
  body: CredentialsOfferMessageBody;
19
+ type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_OFFER_MESSAGE_TYPE;
17
20
  };
18
21
  /** CredentialsOfferMessageBody is struct the represents offer message */
19
22
  export type CredentialsOfferMessageBody = {
20
23
  url: string;
21
24
  credentials: CredentialOffer[];
22
25
  };
23
- /** CredentialsOnchainOfferMessage represent Iden3message for credential onhcain offer message */
26
+ /** CredentialsOnchainOfferMessage represent Iden3message for credential onchain offer message */
24
27
  export type CredentialsOnchainOfferMessage = Required<BasicMessage> & {
25
28
  body: CredentialsOnchainOfferMessageBody;
29
+ type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE;
26
30
  };
27
31
  /** CredentialsOnchainOfferMessageBody is struct the represents onchain offer message body */
28
32
  export type CredentialsOnchainOfferMessageBody = {
@@ -44,6 +48,7 @@ export type CredentialOffer = {
44
48
  /** CredentialIssuanceMessage represent Iden3message for credential issuance */
45
49
  export type CredentialIssuanceMessage = Required<BasicMessage> & {
46
50
  body: IssuanceMessageBody;
51
+ type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE;
47
52
  };
48
53
  /** IssuanceMessageBody is struct the represents message when credential is issued */
49
54
  export type IssuanceMessageBody = {
@@ -52,6 +57,7 @@ export type IssuanceMessageBody = {
52
57
  /** CredentialFetchRequestMessage represent Iden3message for credential fetch request */
53
58
  export type CredentialFetchRequestMessage = BasicMessage & {
54
59
  body?: CredentialFetchRequestMessageBody;
60
+ type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE;
55
61
  };
56
62
  /** CredentialFetchRequestMessageBody is msg body for fetch request */
57
63
  export type CredentialFetchRequestMessageBody = {
@@ -66,6 +72,7 @@ export type Schema = {
66
72
  /** CredentialRefreshMessage represent Iden3message for credential refresh request */
67
73
  export type CredentialRefreshMessage = Required<BasicMessage> & {
68
74
  body?: CredentialRefreshMessageBody;
75
+ type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_REFRESH_MESSAGE_TYPE;
69
76
  };
70
77
  /** CredentialRefreshMessageBody is msg body for refresh request */
71
78
  export type CredentialRefreshMessageBody = {
@@ -1,7 +1,9 @@
1
1
  import { BasicMessage } from '../';
2
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
2
3
  /** MessageFetchRequestMessage represent Iden3message for message fetch request. */
3
4
  export type MessageFetchRequestMessage = Required<BasicMessage> & {
4
5
  body?: MessageFetchRequestMessageBody;
6
+ type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE;
5
7
  };
6
8
  /** MessageFetchRequestMessageBody is struct the represents body for message fetch request. */
7
9
  export type MessageFetchRequestMessageBody = {
@@ -1,8 +1,10 @@
1
1
  import { BasicMessage } from '../';
2
2
  import { PaymentRequestDataType, PaymentRequestType, PaymentType } from '../../../verifiable';
3
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
3
4
  /** @beta PaymentRequestMessage is struct the represents payment-request message */
4
5
  export type PaymentRequestMessage = BasicMessage & {
5
6
  body: PaymentRequestMessageBody;
7
+ type: typeof PROTOCOL_MESSAGE_TYPE.PAYMENT_REQUEST_MESSAGE_TYPE;
6
8
  };
7
9
  /** @beta PaymentRequestMessageBody is struct the represents body for payment-request */
8
10
  export type PaymentRequestMessageBody = {
@@ -33,6 +35,7 @@ export type PaymentRequestDataInfo = {
33
35
  /** @beta PaymentMessage is struct the represents payment message */
34
36
  export type PaymentMessage = BasicMessage & {
35
37
  body: PaymentMessageBody;
38
+ type: typeof PROTOCOL_MESSAGE_TYPE.PAYMENT_MESSAGE_TYPE;
36
39
  };
37
40
  /** @beta PaymentMessageBody is struct the represents body for payment message */
38
41
  export type PaymentMessageBody = {
@@ -1,8 +1,10 @@
1
1
  import { BasicMessage } from '../';
2
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
2
3
  import { ZeroKnowledgeProofRequest, ZeroKnowledgeProofResponse } from './auth';
3
4
  /** ProofGenerationRequestMessage is struct the represents body for proof generation request */
4
5
  export type ProofGenerationRequestMessage = Required<BasicMessage> & {
5
6
  body?: ProofGenerationRequestMessageBody;
7
+ type: typeof PROTOCOL_MESSAGE_TYPE.PROOF_GENERATION_REQUEST_MESSAGE_TYPE;
6
8
  };
7
9
  /** ProofGenerationRequestMessageBody is struct the represents body for proof generation request */
8
10
  export type ProofGenerationRequestMessageBody = {
@@ -11,6 +13,7 @@ export type ProofGenerationRequestMessageBody = {
11
13
  /** ProofGenerationResponseMessage is struct the represents body for proof generation request */
12
14
  export type ProofGenerationResponseMessage = Required<BasicMessage> & {
13
15
  body?: ResponseMessageBody;
16
+ type: typeof PROTOCOL_MESSAGE_TYPE.PROOF_GENERATION_RESPONSE_MESSAGE_TYPE;
14
17
  };
15
18
  /** ResponseMessageBody is struct the represents request for revocation status */
16
19
  export type ResponseMessageBody = {
@@ -1,7 +1,9 @@
1
1
  import { BasicMessage, JSONObject } from '../';
2
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
2
3
  /** @beta ProposalRequestMessage is struct the represents proposal-request message */
3
4
  export type ProposalRequestMessage = BasicMessage & {
4
5
  body?: ProposalRequestMessageBody;
6
+ type: typeof PROTOCOL_MESSAGE_TYPE.PROPOSAL_REQUEST_MESSAGE_TYPE;
5
7
  };
6
8
  /** @beta ProposalRequestMessageBody is struct the represents body for proposal-request */
7
9
  export type ProposalRequestMessageBody = {
@@ -15,6 +17,7 @@ export type ProposalRequestMessageBody = {
15
17
  /** @beta ProposalMessage is struct the represents proposal message */
16
18
  export type ProposalMessage = BasicMessage & {
17
19
  body?: ProposalMessageBody;
20
+ type: typeof PROTOCOL_MESSAGE_TYPE.PROPOSAL_MESSAGE_TYPE;
18
21
  };
19
22
  /** @beta ProposalMessageBody is struct the represents body for proposal message */
20
23
  export type ProposalMessageBody = {
@@ -1,8 +1,10 @@
1
1
  import { BasicMessage } from '../';
2
2
  import { RevocationStatus } from '../../../verifiable';
3
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
3
4
  /** RevocationStatusRequestMessage is struct the represents body for proof generation request */
4
5
  export type RevocationStatusRequestMessage = BasicMessage & {
5
6
  body?: RevocationStatusRequestMessageBody;
7
+ type: typeof PROTOCOL_MESSAGE_TYPE.REVOCATION_STATUS_REQUEST_MESSAGE_TYPE;
6
8
  };
7
9
  /** RevocationStatusRequestMessageBody is struct the represents request for revocation status */
8
10
  export type RevocationStatusRequestMessageBody = {
@@ -11,6 +13,7 @@ export type RevocationStatusRequestMessageBody = {
11
13
  /** RevocationStatusResponseMessage is struct the represents body for proof generation request */
12
14
  export type RevocationStatusResponseMessage = Required<BasicMessage> & {
13
15
  body?: RevocationStatusResponseMessageBody;
16
+ type: typeof PROTOCOL_MESSAGE_TYPE.REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE;
14
17
  };
15
18
  /** RevocationStatusResponseMessageBody is struct the represents request for revocation status */
16
19
  export type RevocationStatusResponseMessageBody = RevocationStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xpolygonid/js-sdk",
3
- "version": "1.17.2",
3
+ "version": "1.17.3",
4
4
  "description": "SDK to work with Polygon ID",
5
5
  "main": "dist/node/cjs/index.js",
6
6
  "module": "dist/node/esm/index.js",