@0xpolygonid/js-sdk 1.21.1 → 1.23.0

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.
Files changed (82) hide show
  1. package/dist/browser/esm/index.js +1394 -278
  2. package/dist/browser/esm/index.js.map +1 -1
  3. package/dist/browser/umd/index.js +1399 -278
  4. package/dist/browser/umd/index.js.map +1 -1
  5. package/dist/node/cjs/iden3comm/constants.js +25 -1
  6. package/dist/node/cjs/iden3comm/handlers/auth.js +52 -8
  7. package/dist/node/cjs/iden3comm/handlers/common.js +13 -1
  8. package/dist/node/cjs/iden3comm/handlers/contract-request.js +5 -1
  9. package/dist/node/cjs/iden3comm/handlers/credential-proposal.js +14 -3
  10. package/dist/node/cjs/iden3comm/handlers/fetch.js +12 -2
  11. package/dist/node/cjs/iden3comm/handlers/message-handler.js +4 -0
  12. package/dist/node/cjs/iden3comm/handlers/payment.js +240 -28
  13. package/dist/node/cjs/iden3comm/handlers/revocation-status.js +4 -0
  14. package/dist/node/cjs/iden3comm/index.js +1 -0
  15. package/dist/node/cjs/iden3comm/packageManager.js +12 -0
  16. package/dist/node/cjs/iden3comm/packers/jws.js +21 -0
  17. package/dist/node/cjs/iden3comm/packers/plain.js +19 -0
  18. package/dist/node/cjs/iden3comm/packers/zkp.js +25 -0
  19. package/dist/node/cjs/iden3comm/types/index.js +1 -0
  20. package/dist/node/cjs/iden3comm/types/protocol/accept-profile.js +2 -0
  21. package/dist/node/cjs/iden3comm/utils/accept-profile.js +107 -0
  22. package/dist/node/cjs/iden3comm/utils/index.js +1 -0
  23. package/dist/node/cjs/proof/provers/inputs-generator.js +2 -1
  24. package/dist/node/cjs/storage/blockchain/abi/ERC20Permit.json +1 -0
  25. package/dist/node/cjs/storage/blockchain/erc20-permit-sig.js +46 -0
  26. package/dist/node/cjs/storage/blockchain/index.js +1 -0
  27. package/dist/node/cjs/storage/filters/jsonQuery.js +5 -3
  28. package/dist/node/cjs/verifiable/constants.js +28 -11
  29. package/dist/node/esm/iden3comm/constants.js +24 -0
  30. package/dist/node/esm/iden3comm/handlers/auth.js +55 -11
  31. package/dist/node/esm/iden3comm/handlers/common.js +11 -0
  32. package/dist/node/esm/iden3comm/handlers/contract-request.js +7 -3
  33. package/dist/node/esm/iden3comm/handlers/credential-proposal.js +15 -4
  34. package/dist/node/esm/iden3comm/handlers/fetch.js +12 -2
  35. package/dist/node/esm/iden3comm/handlers/message-handler.js +4 -0
  36. package/dist/node/esm/iden3comm/handlers/payment.js +240 -29
  37. package/dist/node/esm/iden3comm/handlers/revocation-status.js +4 -0
  38. package/dist/node/esm/iden3comm/index.js +1 -0
  39. package/dist/node/esm/iden3comm/packageManager.js +12 -0
  40. package/dist/node/esm/iden3comm/packers/jws.js +22 -1
  41. package/dist/node/esm/iden3comm/packers/plain.js +19 -0
  42. package/dist/node/esm/iden3comm/packers/zkp.js +26 -1
  43. package/dist/node/esm/iden3comm/types/index.js +1 -0
  44. package/dist/node/esm/iden3comm/types/protocol/accept-profile.js +1 -0
  45. package/dist/node/esm/iden3comm/utils/accept-profile.js +102 -0
  46. package/dist/node/esm/iden3comm/utils/index.js +1 -0
  47. package/dist/node/esm/proof/provers/inputs-generator.js +2 -1
  48. package/dist/node/esm/storage/blockchain/abi/ERC20Permit.json +1 -0
  49. package/dist/node/esm/storage/blockchain/erc20-permit-sig.js +39 -0
  50. package/dist/node/esm/storage/blockchain/index.js +1 -0
  51. package/dist/node/esm/storage/filters/jsonQuery.js +5 -3
  52. package/dist/node/esm/verifiable/constants.js +27 -10
  53. package/dist/types/iden3comm/constants.d.ts +16 -0
  54. package/dist/types/iden3comm/handlers/auth.d.ts +19 -7
  55. package/dist/types/iden3comm/handlers/common.d.ts +7 -1
  56. package/dist/types/iden3comm/handlers/contract-request.d.ts +2 -2
  57. package/dist/types/iden3comm/handlers/credential-proposal.d.ts +9 -4
  58. package/dist/types/iden3comm/handlers/fetch.d.ts +22 -6
  59. package/dist/types/iden3comm/handlers/message-handler.d.ts +6 -0
  60. package/dist/types/iden3comm/handlers/payment.d.ts +70 -10
  61. package/dist/types/iden3comm/handlers/revocation-status.d.ts +2 -2
  62. package/dist/types/iden3comm/index.d.ts +1 -0
  63. package/dist/types/iden3comm/packageManager.d.ts +4 -0
  64. package/dist/types/iden3comm/packers/jws.d.ts +5 -0
  65. package/dist/types/iden3comm/packers/plain.d.ts +4 -0
  66. package/dist/types/iden3comm/packers/zkp.d.ts +6 -0
  67. package/dist/types/iden3comm/types/index.d.ts +1 -0
  68. package/dist/types/iden3comm/types/packageManager.d.ts +14 -0
  69. package/dist/types/iden3comm/types/packer.d.ts +25 -0
  70. package/dist/types/iden3comm/types/protocol/accept-profile.d.ts +7 -0
  71. package/dist/types/iden3comm/types/protocol/auth.d.ts +1 -0
  72. package/dist/types/iden3comm/types/protocol/credentials.d.ts +6 -6
  73. package/dist/types/iden3comm/types/protocol/messages.d.ts +2 -2
  74. package/dist/types/iden3comm/types/protocol/payment.d.ts +87 -13
  75. package/dist/types/iden3comm/types/protocol/proof.d.ts +3 -3
  76. package/dist/types/iden3comm/types/protocol/revocation.d.ts +2 -2
  77. package/dist/types/iden3comm/utils/accept-profile.d.ts +3 -0
  78. package/dist/types/iden3comm/utils/index.d.ts +1 -0
  79. package/dist/types/storage/blockchain/erc20-permit-sig.d.ts +12 -0
  80. package/dist/types/storage/blockchain/index.d.ts +1 -0
  81. package/dist/types/verifiable/constants.d.ts +27 -11
  82. package/package.json +2 -2
@@ -29,6 +29,9 @@ export type JsonDocumentObject = {
29
29
  * JSON document object allowed values
30
30
  */
31
31
  export type JsonDocumentObjectValue = string | number | boolean | JsonDocumentObject | JsonDocumentObjectValue[];
32
+ /**
33
+ * Basic message with all possible fields optional
34
+ */
32
35
  export type BasicMessage = {
33
36
  id: string;
34
37
  typ?: MediaType;
@@ -37,6 +40,15 @@ export type BasicMessage = {
37
40
  body?: unknown;
38
41
  from?: string;
39
42
  to?: string;
43
+ created_time?: number;
44
+ expires_time?: number;
45
+ };
46
+ /**
47
+ * Basic message with all possible fields required
48
+ */
49
+ export type RequiredBasicMessage = Omit<Required<BasicMessage>, 'created_time' | 'expires_time'> & {
50
+ created_time?: number;
51
+ expires_time?: number;
40
52
  };
41
53
  /**
42
54
  * parameters for any packer
@@ -111,6 +123,19 @@ export interface IPacker {
111
123
  * @returns The media type as a MediaType.
112
124
  */
113
125
  mediaType(): MediaType;
126
+ /**
127
+ * gets packer envelope (supported profiles) with options
128
+ *
129
+ * @returns {string}
130
+ */
131
+ getSupportedProfiles(): string[];
132
+ /**
133
+ * returns true if profile is supported by packer
134
+ *
135
+ * @param {string} profile
136
+ * @returns {boolean}
137
+ */
138
+ isProfileSupported(profile: string): boolean;
114
139
  }
115
140
  /**
116
141
  * Params for verification of auth circuit public signals
@@ -0,0 +1,7 @@
1
+ import { AcceptAuthCircuits, AcceptJwsAlgorithms, AcceptJwzAlgorithms, MediaType, ProtocolVersion } from '../../constants';
2
+ export type AcceptProfile = {
3
+ protocolVersion: ProtocolVersion;
4
+ env: MediaType;
5
+ circuits?: AcceptAuthCircuits[];
6
+ alg?: AcceptJwsAlgorithms[] | AcceptJwzAlgorithms[];
7
+ };
@@ -31,6 +31,7 @@ export type AuthorizationRequestMessageBody = {
31
31
  message?: string;
32
32
  did_doc?: DIDDocument;
33
33
  scope: Array<ZeroKnowledgeProofRequest>;
34
+ accept?: string[];
34
35
  };
35
36
  /** ZeroKnowledgeProofRequest represents structure of zkp request object */
36
37
  export type ZeroKnowledgeProofRequest = {
@@ -1,6 +1,6 @@
1
1
  import { W3CCredential } from '../../../verifiable';
2
2
  import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
3
- import { BasicMessage, JsonDocumentObject } from '../packer';
3
+ import { BasicMessage, JsonDocumentObject, RequiredBasicMessage } from '../packer';
4
4
  import { ContractInvokeTransactionData } from './contract-request';
5
5
  /** CredentialIssuanceRequestMessageBody represents data for credential issuance request */
6
6
  export type CredentialIssuanceRequestMessageBody = {
@@ -9,12 +9,12 @@ export type CredentialIssuanceRequestMessageBody = {
9
9
  expiration: number;
10
10
  };
11
11
  /** CredentialIssuanceRequestMessage represent Iden3message for credential request */
12
- export type CredentialIssuanceRequestMessage = Required<BasicMessage> & {
12
+ export type CredentialIssuanceRequestMessage = RequiredBasicMessage & {
13
13
  body: CredentialIssuanceRequestMessageBody;
14
14
  type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE;
15
15
  };
16
16
  /** CredentialsOfferMessage represent Iden3message for credential offer */
17
- export type CredentialsOfferMessage = Required<BasicMessage> & {
17
+ export type CredentialsOfferMessage = RequiredBasicMessage & {
18
18
  body: CredentialsOfferMessageBody;
19
19
  type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_OFFER_MESSAGE_TYPE;
20
20
  };
@@ -24,7 +24,7 @@ export type CredentialsOfferMessageBody = {
24
24
  credentials: CredentialOffer[];
25
25
  };
26
26
  /** CredentialsOnchainOfferMessage represent Iden3message for credential onchain offer message */
27
- export type CredentialsOnchainOfferMessage = Required<BasicMessage> & {
27
+ export type CredentialsOnchainOfferMessage = RequiredBasicMessage & {
28
28
  body: CredentialsOnchainOfferMessageBody;
29
29
  type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE;
30
30
  };
@@ -46,7 +46,7 @@ export type CredentialOffer = {
46
46
  status?: CredentialOfferStatus;
47
47
  };
48
48
  /** CredentialIssuanceMessage represent Iden3message for credential issuance */
49
- export type CredentialIssuanceMessage = Required<BasicMessage> & {
49
+ export type CredentialIssuanceMessage = RequiredBasicMessage & {
50
50
  body: IssuanceMessageBody;
51
51
  type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE;
52
52
  };
@@ -70,7 +70,7 @@ export type Schema = {
70
70
  type: string;
71
71
  };
72
72
  /** CredentialRefreshMessage represent Iden3message for credential refresh request */
73
- export type CredentialRefreshMessage = Required<BasicMessage> & {
73
+ export type CredentialRefreshMessage = RequiredBasicMessage & {
74
74
  body: CredentialRefreshMessageBody;
75
75
  type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_REFRESH_MESSAGE_TYPE;
76
76
  };
@@ -1,7 +1,7 @@
1
- import { BasicMessage } from '../';
1
+ import { RequiredBasicMessage } from '../';
2
2
  import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
3
3
  /** MessageFetchRequestMessage represent Iden3message for message fetch request. */
4
- export type MessageFetchRequestMessage = Required<BasicMessage> & {
4
+ export type MessageFetchRequestMessage = RequiredBasicMessage & {
5
5
  body: MessageFetchRequestMessageBody;
6
6
  type: typeof PROTOCOL_MESSAGE_TYPE.CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE;
7
7
  };
@@ -1,5 +1,5 @@
1
1
  import { BasicMessage } from '../';
2
- import { PaymentRequestDataType, PaymentRequestType, PaymentType, SupportedCurrencies } from '../../../verifiable';
2
+ import { PaymentFeatures, PaymentRequestDataType, SupportedCurrencies, SupportedPaymentProofType } from '../../../verifiable';
3
3
  import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
4
4
  /** @beta PaymentRequestMessage is struct the represents payment-request message */
5
5
  export type PaymentRequestMessage = BasicMessage & {
@@ -17,20 +17,52 @@ export type PaymentRequestInfo = {
17
17
  type: string;
18
18
  context: string;
19
19
  }[];
20
- type: PaymentRequestType;
21
- data: PaymentRequestDataInfo;
22
- expiration?: string;
20
+ data: Iden3PaymentRequestCryptoV1 | (Iden3PaymentRequestCryptoV1 | Iden3PaymentRailsRequestV1 | Iden3PaymentRailsERC20RequestV1)[];
23
21
  description?: string;
24
22
  };
25
- /** @beta PaymentRequestDataInfo is struct the represents payment data info for payment-request */
26
- export type PaymentRequestDataInfo = {
27
- type: PaymentRequestDataType;
23
+ /** @beta Iden3PaymentRequestCryptoV1 is struct the represents payment data info for payment-request */
24
+ export type Iden3PaymentRequestCryptoV1 = {
25
+ type: PaymentRequestDataType.Iden3PaymentRequestCryptoV1;
26
+ '@context'?: string | (string | object)[];
28
27
  amount: string;
29
28
  id: string;
30
29
  chainId: string;
31
30
  address: string;
32
- currency: SupportedCurrencies;
33
- signature?: string;
31
+ currency: SupportedCurrencies | string;
32
+ expiration?: string;
33
+ };
34
+ export type Iden3PaymentRailsRequestV1 = {
35
+ type: PaymentRequestDataType.Iden3PaymentRailsRequestV1;
36
+ '@context': string | (string | object)[];
37
+ recipient: string;
38
+ amount: string;
39
+ currency: SupportedCurrencies | string;
40
+ expirationDate: string;
41
+ nonce: string;
42
+ metadata: string;
43
+ proof: EthereumEip712Signature2021 | EthereumEip712Signature2021[];
44
+ };
45
+ export type Iden3PaymentRailsERC20RequestV1 = Omit<Required<Iden3PaymentRailsRequestV1>, 'type'> & {
46
+ tokenAddress: string;
47
+ features?: PaymentFeatures[];
48
+ type: PaymentRequestDataType.Iden3PaymentRailsERC20RequestV1;
49
+ };
50
+ export type EthereumEip712Signature2021 = {
51
+ type: SupportedPaymentProofType.EthereumEip712Signature2021;
52
+ proofPurpose: string;
53
+ proofValue: string;
54
+ verificationMethod: string;
55
+ created: string;
56
+ eip712: {
57
+ types: string;
58
+ primaryType: string;
59
+ domain: {
60
+ name: string;
61
+ version: string;
62
+ chainId: string;
63
+ verifyingContract: string;
64
+ };
65
+ };
34
66
  };
35
67
  /** @beta PaymentMessage is struct the represents payment message */
36
68
  export type PaymentMessage = BasicMessage & {
@@ -39,13 +71,55 @@ export type PaymentMessage = BasicMessage & {
39
71
  };
40
72
  /** @beta PaymentMessageBody is struct the represents body for payment message */
41
73
  export type PaymentMessageBody = {
42
- payments: PaymentInfo[];
74
+ payments: PaymentTypeUnion[];
43
75
  };
44
- /** @beta PaymentInfo is struct the represents payment info for payment */
45
- export type PaymentInfo = {
76
+ /** @beta Iden3PaymentCryptoV1 is struct the represents payment info for payment */
77
+ export type Iden3PaymentCryptoV1 = {
46
78
  id: string;
47
- type: PaymentType;
79
+ type: 'Iden3PaymentCryptoV1';
80
+ '@context'?: string | (string | object)[];
81
+ paymentData: {
82
+ txId: string;
83
+ };
84
+ };
85
+ /** @beta Iden3PaymentRailsV1 is struct the represents payment info for Iden3PaymentRailsRequestV1 */
86
+ export type Iden3PaymentRailsV1 = {
87
+ nonce: string;
88
+ type: 'Iden3PaymentRailsV1';
89
+ '@context': string | (string | object)[];
48
90
  paymentData: {
49
91
  txId: string;
92
+ chainId: string;
50
93
  };
51
94
  };
95
+ /** @beta Iden3PaymentRailsERC20V1 is struct the represents payment info for Iden3PaymentRailsERC20RequestV1 */
96
+ export type Iden3PaymentRailsERC20V1 = {
97
+ nonce: string;
98
+ type: 'Iden3PaymentRailsERC20V1';
99
+ '@context': string | (string | object)[];
100
+ paymentData: {
101
+ txId: string;
102
+ chainId: string;
103
+ tokenAddress: string;
104
+ };
105
+ };
106
+ /** @beta MultiChainPaymentConfig is struct that represents payments contracts information for different chains */
107
+ export type MultiChainPaymentConfig = {
108
+ chainId: string;
109
+ paymentContract: string;
110
+ recipient: string;
111
+ erc20TokenAddressArr: {
112
+ symbol: string;
113
+ address: string;
114
+ }[];
115
+ };
116
+ /**
117
+ * @beta
118
+ * PaymentRequestTypeUnion is a type of supported payment request types
119
+ */
120
+ export type PaymentRequestTypeUnion = Iden3PaymentRequestCryptoV1 | Iden3PaymentRailsRequestV1 | Iden3PaymentRailsERC20RequestV1;
121
+ /**
122
+ * @beta
123
+ * PaymentTypeUnion is a type of supported payment types
124
+ */
125
+ export type PaymentTypeUnion = Iden3PaymentCryptoV1 | Iden3PaymentRailsV1 | Iden3PaymentRailsERC20V1;
@@ -1,8 +1,8 @@
1
- import { BasicMessage } from '../';
1
+ import { RequiredBasicMessage } from '../';
2
2
  import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
3
3
  import { ZeroKnowledgeProofRequest, ZeroKnowledgeProofResponse } from './auth';
4
4
  /** ProofGenerationRequestMessage is struct the represents body for proof generation request */
5
- export type ProofGenerationRequestMessage = Required<BasicMessage> & {
5
+ export type ProofGenerationRequestMessage = RequiredBasicMessage & {
6
6
  body: ProofGenerationRequestMessageBody;
7
7
  type: typeof PROTOCOL_MESSAGE_TYPE.PROOF_GENERATION_REQUEST_MESSAGE_TYPE;
8
8
  };
@@ -11,7 +11,7 @@ export type ProofGenerationRequestMessageBody = {
11
11
  scope: Array<ZeroKnowledgeProofRequest>;
12
12
  };
13
13
  /** ProofGenerationResponseMessage is struct the represents body for proof generation request */
14
- export type ProofGenerationResponseMessage = Required<BasicMessage> & {
14
+ export type ProofGenerationResponseMessage = RequiredBasicMessage & {
15
15
  body: ResponseMessageBody;
16
16
  type: typeof PROTOCOL_MESSAGE_TYPE.PROOF_GENERATION_RESPONSE_MESSAGE_TYPE;
17
17
  };
@@ -1,4 +1,4 @@
1
- import { BasicMessage } from '../';
1
+ import { BasicMessage, RequiredBasicMessage } from '../';
2
2
  import { RevocationStatus } from '../../../verifiable';
3
3
  import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
4
4
  /** RevocationStatusRequestMessage is struct the represents body for proof generation request */
@@ -11,7 +11,7 @@ export type RevocationStatusRequestMessageBody = {
11
11
  revocation_nonce: number;
12
12
  };
13
13
  /** RevocationStatusResponseMessage is struct the represents body for proof generation request */
14
- export type RevocationStatusResponseMessage = Required<BasicMessage> & {
14
+ export type RevocationStatusResponseMessage = RequiredBasicMessage & {
15
15
  body: RevocationStatusResponseMessageBody;
16
16
  type: typeof PROTOCOL_MESSAGE_TYPE.REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE;
17
17
  };
@@ -0,0 +1,3 @@
1
+ import { AcceptProfile } from '../types';
2
+ export declare const buildAccept: (profiles: AcceptProfile[]) => string[];
3
+ export declare const parseAcceptProfile: (profile: string) => AcceptProfile;
@@ -1,3 +1,4 @@
1
1
  export * from './envelope';
2
2
  export * from './message';
3
3
  export * from './did';
4
+ export * from './accept-profile';
@@ -0,0 +1,12 @@
1
+ import { Signer } from 'ethers';
2
+ /**
3
+ * @beta
4
+ * getPermitSignature is a function to create EIP712 Permit signature
5
+ * @param {Signer} signer - User who owns the tokens
6
+ * @param {string} tokenAddress - EIP-2612 contract address
7
+ * @param {string} spender - The contract address that will spend tokens
8
+ * @param {bigint} value - Amount of tokens to approve
9
+ * @param {number} deadline - Timestamp when the permit expires
10
+ * @returns {Promise<PaymentRequestMessage>}
11
+ */
12
+ export declare function getPermitSignature(signer: Signer, tokenAddress: string, spender: string, value: bigint, deadline: number): Promise<string>;
@@ -1,3 +1,4 @@
1
1
  export * from './state';
2
2
  export * from './onchain-zkp-verifier';
3
3
  export * from './onchain-revocation';
4
+ export * from './erc20-permit-sig';
@@ -87,37 +87,53 @@ export declare enum RefreshServiceType {
87
87
  Iden3RefreshService2023 = "Iden3RefreshService2023"
88
88
  }
89
89
  /**
90
- * PaymentRequestType type for payment requests
90
+ * PaymentRequestDataType type for payment requests
91
91
  * @beta
92
92
  * @enum {string}
93
93
  */
94
- export declare enum PaymentRequestType {
95
- PaymentRequest = "PaymentRequest"
94
+ export declare enum PaymentRequestDataType {
95
+ Iden3PaymentRequestCryptoV1 = "Iden3PaymentRequestCryptoV1",
96
+ Iden3PaymentRailsRequestV1 = "Iden3PaymentRailsRequestV1",
97
+ Iden3PaymentRailsERC20RequestV1 = "Iden3PaymentRailsERC20RequestV1"
96
98
  }
97
99
  /**
98
- * PaymentRequestDataType type for payment requests
100
+ * PaymentType type for payment responses
99
101
  * @beta
100
102
  * @enum {string}
101
103
  */
102
- export declare enum PaymentRequestDataType {
103
- Iden3PaymentRequestCryptoV1 = "Iden3PaymentRequestCryptoV1"
104
+ export declare enum PaymentType {
105
+ Iden3PaymentCryptoV1 = "Iden3PaymentCryptoV1",
106
+ Iden3PaymentRailsV1 = "Iden3PaymentRailsV1",
107
+ Iden3PaymentRailsERC20V1 = "Iden3PaymentRailsERC20V1"
104
108
  }
105
109
  /**
106
- * PaymentType type for payment responses
110
+ * SupportedPaymentProofType type for payment proofs
107
111
  * @beta
108
112
  * @enum {string}
109
113
  */
110
- export declare enum PaymentType {
111
- Iden3PaymentCryptoV1 = "Iden3PaymentCryptoV1"
114
+ export declare enum SupportedPaymentProofType {
115
+ EthereumEip712Signature2021 = "EthereumEip712Signature2021"
112
116
  }
113
117
  /**
114
118
  * Media types for Payment supported currencies
115
119
  * @beta
116
- * @enum {number}
120
+ * @enum {string}
117
121
  */
118
122
  export declare enum SupportedCurrencies {
119
123
  ETH = "ETH",
120
- MATIC = "MATIC"
124
+ ETH_WEI = "ETHWEI",
125
+ ETH_GWEI = "ETHGWEI",
126
+ MATIC = "MATIC",
127
+ USDT = "USDT",
128
+ USDC = "USDC"
129
+ }
130
+ /**
131
+ * Supported features for payment-request
132
+ * @beta
133
+ * @enum {string}
134
+ */
135
+ export declare enum PaymentFeatures {
136
+ EIP_2612 = "EIP-2612"
121
137
  }
122
138
  /**
123
139
  * DisplayMethodType type for display method
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xpolygonid/js-sdk",
3
- "version": "1.21.1",
3
+ "version": "1.23.0",
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",
@@ -51,7 +51,6 @@
51
51
  "homepage": "https://github.com/0xPolygonID/js-sdk#readme",
52
52
  "devDependencies": {
53
53
  "@cspell/eslint-plugin": "^8.14.2",
54
- "@gr2m/fetch-mock": "9.11.0-pull-request-644.1",
55
54
  "@iden3/eslint-config": "https://github.com/iden3/eslint-config",
56
55
  "@microsoft/api-documenter": "^7.8.20",
57
56
  "@microsoft/api-extractor": "^7.9.0",
@@ -80,6 +79,7 @@
80
79
  "eslint-config-prettier": "^8.8.0",
81
80
  "eslint-plugin-prettier": "^4.2.1",
82
81
  "mocha": "10.2.0",
82
+ "nock": "^14.0.0-beta.15",
83
83
  "prettier": "^2.7.1",
84
84
  "rimraf": "^5.0.5",
85
85
  "rollup": "^4.14.3",