@0xpolygonid/js-sdk 1.21.3 → 1.24.1
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 +4378 -545
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +4388 -545
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/credentials/credential-wallet.js +11 -78
- package/dist/node/cjs/credentials/index.js +1 -0
- package/dist/node/cjs/credentials/status/did-resolver-revocation.js +21 -0
- package/dist/node/cjs/iden3comm/constants.js +25 -1
- package/dist/node/cjs/iden3comm/handlers/auth.js +52 -8
- package/dist/node/cjs/iden3comm/handlers/common.js +13 -1
- package/dist/node/cjs/iden3comm/handlers/contract-request.js +5 -1
- package/dist/node/cjs/iden3comm/handlers/credential-proposal.js +14 -3
- package/dist/node/cjs/iden3comm/handlers/fetch.js +44 -2
- package/dist/node/cjs/iden3comm/handlers/message-handler.js +4 -0
- package/dist/node/cjs/iden3comm/handlers/payment.js +265 -28
- package/dist/node/cjs/iden3comm/handlers/revocation-status.js +4 -0
- package/dist/node/cjs/iden3comm/index.js +1 -0
- package/dist/node/cjs/iden3comm/packageManager.js +12 -0
- package/dist/node/cjs/iden3comm/packers/jws.js +21 -0
- package/dist/node/cjs/iden3comm/packers/plain.js +19 -0
- package/dist/node/cjs/iden3comm/packers/zkp.js +25 -0
- package/dist/node/cjs/iden3comm/types/index.js +1 -0
- package/dist/node/cjs/iden3comm/types/protocol/accept-profile.js +2 -0
- package/dist/node/cjs/iden3comm/utils/accept-profile.js +107 -0
- package/dist/node/cjs/iden3comm/utils/index.js +1 -0
- package/dist/node/cjs/storage/blockchain/abi/ERC20.json +1 -0
- package/dist/node/cjs/storage/blockchain/abi/ERC20Permit.json +1 -0
- package/dist/node/cjs/storage/blockchain/did-resolver-readonly-storage.js +72 -0
- package/dist/node/cjs/storage/blockchain/erc20-helper.js +59 -0
- package/dist/node/cjs/storage/blockchain/index.js +3 -0
- package/dist/node/cjs/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.js +245 -0
- package/dist/node/cjs/storage/blockchain/onchain-issuer.js +82 -0
- package/dist/node/cjs/storage/blockchain/onchain-zkp-verifier.js +38 -34
- package/dist/node/cjs/storage/interfaces/index.js +1 -0
- package/dist/node/cjs/storage/interfaces/onchain-issuer.js +2 -0
- package/dist/node/cjs/utils/did-helper.js +3 -3
- package/dist/node/cjs/verifiable/constants.js +29 -11
- package/dist/node/cjs/verifiable/credential.js +86 -0
- package/dist/node/esm/credentials/credential-wallet.js +12 -79
- package/dist/node/esm/credentials/index.js +1 -0
- package/dist/node/esm/credentials/status/did-resolver-revocation.js +17 -0
- package/dist/node/esm/iden3comm/constants.js +24 -0
- package/dist/node/esm/iden3comm/handlers/auth.js +55 -11
- package/dist/node/esm/iden3comm/handlers/common.js +11 -0
- package/dist/node/esm/iden3comm/handlers/contract-request.js +7 -3
- package/dist/node/esm/iden3comm/handlers/credential-proposal.js +15 -4
- package/dist/node/esm/iden3comm/handlers/fetch.js +44 -2
- package/dist/node/esm/iden3comm/handlers/message-handler.js +4 -0
- package/dist/node/esm/iden3comm/handlers/payment.js +264 -29
- package/dist/node/esm/iden3comm/handlers/revocation-status.js +4 -0
- package/dist/node/esm/iden3comm/index.js +1 -0
- package/dist/node/esm/iden3comm/packageManager.js +12 -0
- package/dist/node/esm/iden3comm/packers/jws.js +22 -1
- package/dist/node/esm/iden3comm/packers/plain.js +19 -0
- package/dist/node/esm/iden3comm/packers/zkp.js +26 -1
- package/dist/node/esm/iden3comm/types/index.js +1 -0
- package/dist/node/esm/iden3comm/types/protocol/accept-profile.js +1 -0
- package/dist/node/esm/iden3comm/utils/accept-profile.js +102 -0
- package/dist/node/esm/iden3comm/utils/index.js +1 -0
- package/dist/node/esm/storage/blockchain/abi/ERC20.json +1 -0
- package/dist/node/esm/storage/blockchain/abi/ERC20Permit.json +1 -0
- package/dist/node/esm/storage/blockchain/did-resolver-readonly-storage.js +68 -0
- package/dist/node/esm/storage/blockchain/erc20-helper.js +51 -0
- package/dist/node/esm/storage/blockchain/index.js +3 -0
- package/dist/node/esm/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.js +241 -0
- package/dist/node/esm/storage/blockchain/onchain-issuer.js +78 -0
- package/dist/node/esm/storage/blockchain/onchain-zkp-verifier.js +38 -34
- package/dist/node/esm/storage/interfaces/index.js +1 -0
- package/dist/node/esm/storage/interfaces/onchain-issuer.js +1 -0
- package/dist/node/esm/utils/did-helper.js +3 -3
- package/dist/node/esm/verifiable/constants.js +28 -10
- package/dist/node/esm/verifiable/credential.js +88 -2
- package/dist/types/credentials/credential-wallet.d.ts +0 -6
- package/dist/types/credentials/index.d.ts +1 -0
- package/dist/types/credentials/models.d.ts +8 -0
- package/dist/types/credentials/status/did-resolver-revocation.d.ts +7 -0
- package/dist/types/iden3comm/constants.d.ts +16 -0
- package/dist/types/iden3comm/handlers/auth.d.ts +19 -7
- package/dist/types/iden3comm/handlers/common.d.ts +7 -1
- package/dist/types/iden3comm/handlers/contract-request.d.ts +2 -2
- package/dist/types/iden3comm/handlers/credential-proposal.d.ts +9 -4
- package/dist/types/iden3comm/handlers/fetch.d.ts +30 -6
- package/dist/types/iden3comm/handlers/message-handler.d.ts +6 -0
- package/dist/types/iden3comm/handlers/payment.d.ts +71 -10
- package/dist/types/iden3comm/handlers/revocation-status.d.ts +2 -2
- package/dist/types/iden3comm/index.d.ts +1 -0
- package/dist/types/iden3comm/packageManager.d.ts +4 -0
- package/dist/types/iden3comm/packers/jws.d.ts +5 -0
- package/dist/types/iden3comm/packers/plain.d.ts +4 -0
- package/dist/types/iden3comm/packers/zkp.d.ts +6 -0
- package/dist/types/iden3comm/types/index.d.ts +1 -0
- package/dist/types/iden3comm/types/packageManager.d.ts +14 -0
- package/dist/types/iden3comm/types/packer.d.ts +25 -0
- package/dist/types/iden3comm/types/protocol/accept-profile.d.ts +7 -0
- package/dist/types/iden3comm/types/protocol/auth.d.ts +1 -0
- package/dist/types/iden3comm/types/protocol/credentials.d.ts +6 -6
- package/dist/types/iden3comm/types/protocol/messages.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/payment.d.ts +87 -13
- package/dist/types/iden3comm/types/protocol/proof.d.ts +3 -3
- package/dist/types/iden3comm/types/protocol/revocation.d.ts +2 -2
- package/dist/types/iden3comm/utils/accept-profile.d.ts +3 -0
- package/dist/types/iden3comm/utils/index.d.ts +1 -0
- package/dist/types/storage/blockchain/did-resolver-readonly-storage.d.ts +16 -0
- package/dist/types/storage/blockchain/erc20-helper.d.ts +19 -0
- package/dist/types/storage/blockchain/index.d.ts +3 -0
- package/dist/types/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.d.ts +66 -0
- package/dist/types/storage/blockchain/onchain-issuer.d.ts +40 -0
- package/dist/types/storage/blockchain/onchain-zkp-verifier.d.ts +11 -12
- package/dist/types/storage/entities/state.d.ts +2 -0
- package/dist/types/storage/interfaces/index.d.ts +1 -0
- package/dist/types/storage/interfaces/onchain-issuer.d.ts +12 -0
- package/dist/types/verifiable/constants.d.ts +28 -11
- package/dist/types/verifiable/credential.d.ts +15 -2
- package/package.json +3 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Signer, ethers } 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>;
|
|
13
|
+
/**
|
|
14
|
+
* @beta
|
|
15
|
+
* getERC20Decimals is a function to retrieve the number of decimals of an ERC20 token
|
|
16
|
+
* @param {string} tokenAddress - Token address
|
|
17
|
+
* @param {ethers.ContractRunner} runner - Contract runner
|
|
18
|
+
*/
|
|
19
|
+
export declare function getERC20Decimals(tokenAddress: string, runner: ethers.ContractRunner): Promise<number>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DID, Id } from '@iden3/js-iden3-core';
|
|
2
|
+
import { INonMerklizedIssuer } from '@iden3/onchain-non-merklized-issuer-base-abi';
|
|
3
|
+
import { W3CCredential } from '../../../../../../verifiable';
|
|
4
|
+
import { Options } from '@iden3/js-jsonld-merklization';
|
|
5
|
+
import { EthConnectionConfig } from '../../../../state';
|
|
6
|
+
/**
|
|
7
|
+
* `OnchainNonMerklizedIssuerAdapter` provides functionality to interact with a non-merklized on-chain credential issuer.
|
|
8
|
+
* This adapter enables interface detection, credential retrieval, and conversion to the W3C Verifiable Credential format.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @beta
|
|
12
|
+
* @class OnchainNonMerklizedIssuerAdapter
|
|
13
|
+
*/
|
|
14
|
+
export declare class OnchainNonMerklizedIssuerAdapter {
|
|
15
|
+
private readonly _contract;
|
|
16
|
+
private readonly _contractAddress;
|
|
17
|
+
private readonly _chainId;
|
|
18
|
+
private readonly _issuerDid;
|
|
19
|
+
private readonly _merklizationOptions?;
|
|
20
|
+
/**
|
|
21
|
+
* Initializes an instance of `OnchainNonMerklizedIssuerAdapter`.
|
|
22
|
+
*
|
|
23
|
+
* @param ethConnectionConfig The configuration for the Ethereum connection.
|
|
24
|
+
* @param issuerDid The decentralized identifier (DID) of the issuer.
|
|
25
|
+
* @param merklizationOptions Optional settings for merklization.
|
|
26
|
+
*/
|
|
27
|
+
constructor(ethConnectionConfig: EthConnectionConfig, issuerDid: DID, options?: {
|
|
28
|
+
merklizationOptions?: Options;
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Checks if the contract supports required interfaces.
|
|
32
|
+
* Throws an error if any required interface is unsupported.
|
|
33
|
+
*
|
|
34
|
+
* @throws Error - If required interfaces are not supported.
|
|
35
|
+
*/
|
|
36
|
+
isInterfaceSupported(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves a credential from the on-chain non-merklized contract.
|
|
39
|
+
* @param userId The user's core.Id.
|
|
40
|
+
* @param credentialId The unique identifier of the credential.
|
|
41
|
+
*/
|
|
42
|
+
getCredential(userId: Id, credentialId: bigint): Promise<{
|
|
43
|
+
credentialData: INonMerklizedIssuer.CredentialDataStructOutput;
|
|
44
|
+
coreClaimBigInts: bigint[];
|
|
45
|
+
credentialSubjectFields: INonMerklizedIssuer.SubjectFieldStructOutput[];
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves the credential IDs of a user.
|
|
49
|
+
* @param userId The user's core.Id.
|
|
50
|
+
* @returns An array of credential IDs.
|
|
51
|
+
*/
|
|
52
|
+
getUserCredentialsIds(userId: Id): Promise<bigint[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Converts on-chain credential to a verifiable credential.
|
|
55
|
+
*
|
|
56
|
+
* @param credentialData Data structure of the credential from the contract.
|
|
57
|
+
* @param coreClaimBigInts Claim data in bigint format.
|
|
58
|
+
* @param credentialSubjectFields Subject fields of the credential.
|
|
59
|
+
*/
|
|
60
|
+
convertOnChainInfoToW3CCredential(credentialData: INonMerklizedIssuer.CredentialDataStructOutput, coreClaimBigInts: bigint[], credentialSubjectFields: INonMerklizedIssuer.SubjectFieldStructOutput[]): Promise<W3CCredential>;
|
|
61
|
+
private credentialId;
|
|
62
|
+
private convertCredentialSubject;
|
|
63
|
+
private existenceProof;
|
|
64
|
+
private validateSourceValue;
|
|
65
|
+
private convertDisplayMethod;
|
|
66
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DID } from '@iden3/js-iden3-core';
|
|
2
|
+
import { Options } from '@iden3/js-jsonld-merklization';
|
|
3
|
+
import { W3CCredential } from '../../verifiable';
|
|
4
|
+
import { EthConnectionConfig } from './state';
|
|
5
|
+
import { IOnchainIssuer } from '../interfaces/onchain-issuer';
|
|
6
|
+
interface OnchainIssuerOptions {
|
|
7
|
+
merklizationOptions?: Options;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Represents an adapter for interacting with on-chain issuers.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
* @beta
|
|
14
|
+
* @class OnchainIssuer
|
|
15
|
+
*/
|
|
16
|
+
export declare class OnchainIssuer implements IOnchainIssuer {
|
|
17
|
+
private readonly _ethConnectionConfig;
|
|
18
|
+
private readonly _onchainIssuerOptions?;
|
|
19
|
+
/**
|
|
20
|
+
* Initializes an instance of `Adapter`.
|
|
21
|
+
* @param config The configuration for the Ethereum connection.
|
|
22
|
+
* @param merklizationOptions Optional settings for merklization.
|
|
23
|
+
*/
|
|
24
|
+
constructor(config: EthConnectionConfig[], options?: OnchainIssuerOptions);
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves a credential from the on-chain issuer.
|
|
27
|
+
* @param issuerDID The issuer's core.DID.
|
|
28
|
+
* @param userId The user's core.Id.
|
|
29
|
+
* @param credentialId The unique identifier of the credential.
|
|
30
|
+
*/
|
|
31
|
+
getCredential(issuerDID: DID, userDID: DID, credentialId: bigint): Promise<W3CCredential>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the credential identifiers for a user from the on-chain issuer.
|
|
34
|
+
* @param issuerDID The issuer's core.DID.
|
|
35
|
+
* @param userId The user's core.Id.
|
|
36
|
+
*/
|
|
37
|
+
getUserCredentialIds(issuerDID: DID, userDID: DID): Promise<bigint[]>;
|
|
38
|
+
private getContractConnection;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { Signer } from 'ethers';
|
|
|
2
2
|
import { EthConnectionConfig } from './state';
|
|
3
3
|
import { IOnChainZKPVerifier } from '../interfaces/onchain-zkp-verifier';
|
|
4
4
|
import { ContractInvokeTransactionData, JsonDocumentObjectValue, ZeroKnowledgeProofResponse } from '../../iden3comm';
|
|
5
|
+
import { GlobalStateUpdate } from '../entities/state';
|
|
5
6
|
/**
|
|
6
7
|
* Supported function signature for SubmitZKPResponse
|
|
7
8
|
*/
|
|
@@ -33,11 +34,7 @@ export declare class OnChainZKPVerifier implements IOnChainZKPVerifier {
|
|
|
33
34
|
/**
|
|
34
35
|
* supported circuits
|
|
35
36
|
*/
|
|
36
|
-
private readonly _supportedCircuits;
|
|
37
|
-
/**
|
|
38
|
-
* abi coder to encode/decode structures to solidity bytes
|
|
39
|
-
*/
|
|
40
|
-
private readonly _abiCoder;
|
|
37
|
+
private static readonly _supportedCircuits;
|
|
41
38
|
/**
|
|
42
39
|
*
|
|
43
40
|
* Creates an instance of OnChainZKPVerifier.
|
|
@@ -45,6 +42,7 @@ export declare class OnChainZKPVerifier implements IOnChainZKPVerifier {
|
|
|
45
42
|
* @param {EthConnectionConfig[]} - array of ETH configs
|
|
46
43
|
*/
|
|
47
44
|
constructor(_configs: EthConnectionConfig[], _opts?: OnChainZKPVerifierOptions | undefined);
|
|
45
|
+
static prepareTxArgsSubmitV1(txData: ContractInvokeTransactionData, zkProofResponse: ZeroKnowledgeProofResponse): Promise<JsonDocumentObjectValue[]>;
|
|
48
46
|
/**
|
|
49
47
|
* {@inheritDoc IOnChainZKPVerifier.prepareTxArgsSubmitV1}
|
|
50
48
|
*/
|
|
@@ -57,12 +55,13 @@ export declare class OnChainZKPVerifier implements IOnChainZKPVerifier {
|
|
|
57
55
|
* {@inheritDoc IOnChainZKPVerifier.submitZKPResponseV2}
|
|
58
56
|
*/
|
|
59
57
|
submitZKPResponseV2(ethSigner: Signer, txData: ContractInvokeTransactionData, zkProofResponses: ZeroKnowledgeProofResponse[]): Promise<Map<string, ZeroKnowledgeProofResponse[]>>;
|
|
58
|
+
static prepareTxArgsSubmitV2(resolverUrl: string, txData: ContractInvokeTransactionData, zkProofResponses: ZeroKnowledgeProofResponse[]): Promise<JsonDocumentObjectValue[]>;
|
|
60
59
|
prepareTxArgsSubmitV2(txData: ContractInvokeTransactionData, zkProofResponses: ZeroKnowledgeProofResponse[]): Promise<JsonDocumentObjectValue[]>;
|
|
61
|
-
private packZkpProof;
|
|
62
|
-
private packCrossChainProofs;
|
|
63
|
-
|
|
64
|
-
private packIdentityStateMsg;
|
|
65
|
-
private packMetadatas;
|
|
66
|
-
private getOnChainGistRootStatePubSignals;
|
|
67
|
-
private resolveDidDocumentEip712MessageAndSignature;
|
|
60
|
+
private static packZkpProof;
|
|
61
|
+
private static packCrossChainProofs;
|
|
62
|
+
static packGlobalStateMsg(msg: GlobalStateUpdate): string;
|
|
63
|
+
private static packIdentityStateMsg;
|
|
64
|
+
private static packMetadatas;
|
|
65
|
+
private static getOnChainGistRootStatePubSignals;
|
|
66
|
+
private static resolveDidDocumentEip712MessageAndSignature;
|
|
68
67
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ProofJSON } from '@iden3/js-merkletree';
|
|
1
2
|
/**
|
|
2
3
|
* state information of identity from chain.
|
|
3
4
|
*
|
|
@@ -42,6 +43,7 @@ export interface RootInfo {
|
|
|
42
43
|
replacedAtTimestamp: bigint;
|
|
43
44
|
createdAtBlock: bigint;
|
|
44
45
|
replacedAtBlock: bigint;
|
|
46
|
+
proof?: ProofJSON;
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* identity state message
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DID } from '@iden3/js-iden3-core';
|
|
2
|
+
import { W3CCredential } from '../../verifiable';
|
|
3
|
+
/**
|
|
4
|
+
* Interface that allows the processing of the on-chain issuer
|
|
5
|
+
*
|
|
6
|
+
* @beta
|
|
7
|
+
* @interface IOnchainIssuer
|
|
8
|
+
*/
|
|
9
|
+
export interface IOnchainIssuer {
|
|
10
|
+
getCredential(issuerDID: DID, userDID: DID, credentialId: bigint): Promise<W3CCredential>;
|
|
11
|
+
getUserCredentialIds(issuerDID: DID, userDID: DID): Promise<bigint[]>;
|
|
12
|
+
}
|
|
@@ -87,37 +87,54 @@ export declare enum RefreshServiceType {
|
|
|
87
87
|
Iden3RefreshService2023 = "Iden3RefreshService2023"
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* PaymentRequestDataType type for payment requests
|
|
91
91
|
* @beta
|
|
92
92
|
* @enum {string}
|
|
93
93
|
*/
|
|
94
|
-
export declare enum
|
|
95
|
-
|
|
94
|
+
export declare enum PaymentRequestDataType {
|
|
95
|
+
Iden3PaymentRequestCryptoV1 = "Iden3PaymentRequestCryptoV1",
|
|
96
|
+
Iden3PaymentRailsRequestV1 = "Iden3PaymentRailsRequestV1",
|
|
97
|
+
Iden3PaymentRailsERC20RequestV1 = "Iden3PaymentRailsERC20RequestV1"
|
|
96
98
|
}
|
|
97
99
|
/**
|
|
98
|
-
*
|
|
100
|
+
* PaymentType type for payment responses
|
|
99
101
|
* @beta
|
|
100
102
|
* @enum {string}
|
|
101
103
|
*/
|
|
102
|
-
export declare enum
|
|
103
|
-
|
|
104
|
+
export declare enum PaymentType {
|
|
105
|
+
Iden3PaymentCryptoV1 = "Iden3PaymentCryptoV1",
|
|
106
|
+
Iden3PaymentRailsV1 = "Iden3PaymentRailsV1",
|
|
107
|
+
Iden3PaymentRailsERC20V1 = "Iden3PaymentRailsERC20V1"
|
|
104
108
|
}
|
|
105
109
|
/**
|
|
106
|
-
*
|
|
110
|
+
* SupportedPaymentProofType type for payment proofs
|
|
107
111
|
* @beta
|
|
108
112
|
* @enum {string}
|
|
109
113
|
*/
|
|
110
|
-
export declare enum
|
|
111
|
-
|
|
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 {
|
|
120
|
+
* @enum {string}
|
|
117
121
|
*/
|
|
118
122
|
export declare enum SupportedCurrencies {
|
|
119
123
|
ETH = "ETH",
|
|
120
|
-
|
|
124
|
+
ETH_WEI = "ETHWEI",
|
|
125
|
+
ETH_GWEI = "ETHGWEI",
|
|
126
|
+
MATIC = "MATIC",
|
|
127
|
+
POL = "POL",
|
|
128
|
+
USDT = "USDT",
|
|
129
|
+
USDC = "USDC"
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Supported features for payment-request
|
|
133
|
+
* @beta
|
|
134
|
+
* @enum {string}
|
|
135
|
+
*/
|
|
136
|
+
export declare enum PaymentFeatures {
|
|
137
|
+
EIP_2612 = "EIP-2612"
|
|
121
138
|
}
|
|
122
139
|
/**
|
|
123
140
|
* DisplayMethodType type for display method
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BJJSignatureProof2021, Iden3SparseMerkleTreeProof, CredentialStatus, RefreshService, DisplayMethod } from './proof';
|
|
2
|
-
import { Claim } from '@iden3/js-iden3-core';
|
|
2
|
+
import { Claim, DID } from '@iden3/js-iden3-core';
|
|
3
3
|
import { Proof } from '@iden3/js-merkletree';
|
|
4
4
|
import { Merklizer, Options } from '@iden3/js-jsonld-merklization';
|
|
5
|
-
import { CredentialStatusResolverRegistry } from '../credentials';
|
|
5
|
+
import { CredentialRequest, CredentialStatusResolverRegistry } from '../credentials';
|
|
6
6
|
import { ProofType } from './constants';
|
|
7
7
|
import { CoreClaimCreationOptions } from './core-utils';
|
|
8
8
|
import { JsonDocumentObject } from '../iden3comm';
|
|
@@ -26,6 +26,19 @@ export declare class W3CCredential {
|
|
|
26
26
|
issuer: string;
|
|
27
27
|
credentialSchema: CredentialSchema;
|
|
28
28
|
proof?: object | unknown[];
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param issuer - DID of the issuer
|
|
32
|
+
* @param request - Credential request
|
|
33
|
+
* @returns - W3C Credential
|
|
34
|
+
*/
|
|
35
|
+
static fromCredentialRequest(issuer: DID, request: CredentialRequest): W3CCredential;
|
|
36
|
+
/**
|
|
37
|
+
* Builds credential status
|
|
38
|
+
* @param {CredentialRequest} request
|
|
39
|
+
* @returns `CredentialStatus`
|
|
40
|
+
*/
|
|
41
|
+
private static buildCredentialStatus;
|
|
29
42
|
toJSON(): this & {
|
|
30
43
|
proof: any;
|
|
31
44
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xpolygonid/js-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.1",
|
|
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.16",
|
|
83
83
|
"prettier": "^2.7.1",
|
|
84
84
|
"rimraf": "^5.0.5",
|
|
85
85
|
"rollup": "^4.14.3",
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
"snarkjs": "0.7.4"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
+
"@iden3/onchain-non-merklized-issuer-base-abi": "^0.0.3",
|
|
101
102
|
"@noble/curves": "^1.4.0",
|
|
102
103
|
"ajv": "8.12.0",
|
|
103
104
|
"ajv-formats": "2.1.1",
|