@0xpolygonid/js-sdk 1.30.0 → 1.31.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 +200 -47
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +202 -46
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/credentials/credential-wallet.js +1 -1
- package/dist/node/cjs/iden3comm/handlers/common.js +51 -24
- package/dist/node/cjs/identity/identity-wallet.js +12 -12
- package/dist/node/cjs/proof/proof-service.js +5 -4
- package/dist/node/cjs/proof/verifiers/query.js +25 -1
- package/dist/node/cjs/schema-processor/json/validator.js +11 -0
- package/dist/node/cjs/verifiable/constants.js +20 -1
- package/dist/node/cjs/verifiable/presentation.js +3 -3
- package/dist/node/esm/credentials/credential-wallet.js +1 -1
- package/dist/node/esm/iden3comm/handlers/common.js +51 -24
- package/dist/node/esm/identity/identity-wallet.js +12 -12
- package/dist/node/esm/proof/proof-service.js +6 -5
- package/dist/node/esm/proof/verifiers/query.js +21 -0
- package/dist/node/esm/schema-processor/json/validator.js +11 -0
- package/dist/node/esm/verifiable/constants.js +20 -1
- package/dist/node/esm/verifiable/presentation.js +3 -3
- package/dist/types/iden3comm/types/protocol/auth.d.ts +2 -2
- package/dist/types/proof/verifiers/query.d.ts +3 -0
- package/dist/types/verifiable/constants.d.ts +16 -0
- package/package.json +1 -1
|
@@ -5,7 +5,26 @@ export const VerifiableConstants = Object.freeze({
|
|
|
5
5
|
CONTEXT_TYPE_IS_EMPTY: 'ctxType is empty',
|
|
6
6
|
// ErrStateNotFound issuer state is genesis state.
|
|
7
7
|
IDENTITY_DOES_NOT_EXIST: 'Identity does not exist',
|
|
8
|
-
NO_AUTH_CRED_FOUND: 'no auth credentials found'
|
|
8
|
+
NO_AUTH_CRED_FOUND: 'no auth credentials found',
|
|
9
|
+
// identity wallet
|
|
10
|
+
ID_WALLET_NO_CREDENTIAL_SATISFIED_QUERY: 'no credential satisfied query',
|
|
11
|
+
ID_WALLET_SIGNER_IS_REQUIRED: 'Ethereum signer is required to create Ethereum identities in order to transit state',
|
|
12
|
+
ID_WALLET_PROVER_IS_REQUIRED: 'prover is required to generate proofs for non ethereum identities',
|
|
13
|
+
ID_WALLET_CORE_CLAIM_REQUIRED_IN_SIG_PROOF: 'credential must have coreClaim representation in the signature proof',
|
|
14
|
+
ID_WALLET_CORE_CLAIM_REQUIRED_IN_ANY_PROOF: 'credential must have coreClaim representation in proofs',
|
|
15
|
+
ID_WALLET_CORE_CLAIM_MISMATCH: 'core claim representations is set in both proofs but they are not equal',
|
|
16
|
+
ID_WALLET_CORE_CLAIM_IS_NOT_SET: 'core claim is not set in credential proofs',
|
|
17
|
+
ID_WALLET_PROFILE_OR_IDENTITY_NOT_FOUND: 'profile or identity not found',
|
|
18
|
+
ID_WALLET_PROFILE_ALREADY_EXISTS: 'profile with given nonce or verifier already exists',
|
|
19
|
+
ID_WALLET_ISSUER_AUTH_BJJ_CRED_MUST_HAVE_ANY_PROOF: 'issuer auth credential must have proof',
|
|
20
|
+
ID_WALLET_ISSUER_AUTH_BJJ_CRED_MUST_HAVE_MTP_PROOF: 'mtp is required for auth bjj key to issue new credentials',
|
|
21
|
+
// proof service
|
|
22
|
+
PROOF_SERVICE_NO_CREDENTIAL_FOR_IDENTITY_OR_PROFILE: 'no credentials belong to did or its profiles',
|
|
23
|
+
PROOF_SERVICE_NO_CREDENTIAL_FOR_QUERY: 'credential not found for query',
|
|
24
|
+
PROOF_SERVICE_PROFILE_GENESIS_DID_MISMATCH: 'subject and auth profiles are not derived from the same did',
|
|
25
|
+
PROOF_SERVICE_NO_QUERIES_IN_ZKP_REQUEST: 'no queries in zkp request',
|
|
26
|
+
// credential wallet
|
|
27
|
+
CREDENTIAL_WALLET_ALL_CREDENTIALS_ARE_REVOKED: 'all claims are revoked'
|
|
9
28
|
},
|
|
10
29
|
CREDENTIAL_TYPE: {
|
|
11
30
|
// VerifiableCredential is a W3C verifiable credential type
|
|
@@ -41,12 +41,12 @@ export const createVerifiablePresentation = (context, tp, credential, queries) =
|
|
|
41
41
|
}
|
|
42
42
|
const skeleton = {
|
|
43
43
|
'@context': baseContext,
|
|
44
|
-
|
|
44
|
+
type: VerifiableConstants.CREDENTIAL_TYPE.W3C_VERIFIABLE_PRESENTATION,
|
|
45
45
|
verifiableCredential: {
|
|
46
46
|
'@context': ldContext,
|
|
47
|
-
|
|
47
|
+
type: vcTypes,
|
|
48
48
|
credentialSubject: {
|
|
49
|
-
|
|
49
|
+
type: tp
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
};
|
|
@@ -70,10 +70,10 @@ export type ZeroKnowledgeProofAuthResponse = Omit<ZeroKnowledgeProofResponse, 'i
|
|
|
70
70
|
/** VerifiablePresentation represents structure of Verifiable Presentation */
|
|
71
71
|
export type VerifiablePresentation = {
|
|
72
72
|
'@context': string | (string | object)[];
|
|
73
|
-
|
|
73
|
+
type: string;
|
|
74
74
|
verifiableCredential: {
|
|
75
75
|
'@context': string | string[];
|
|
76
|
-
|
|
76
|
+
type: string | string[];
|
|
77
77
|
credentialSubject: JsonDocumentObject;
|
|
78
78
|
};
|
|
79
79
|
};
|
|
@@ -37,3 +37,6 @@ export declare function validateDisclosureV2Circuit(cq: QueryMetadata, outputs:
|
|
|
37
37
|
export declare function validateDisclosureNativeSDSupport(cq: QueryMetadata, outputs: ClaimOutputs, verifiablePresentation?: VerifiablePresentation, ldLoader?: DocumentLoader): Promise<void>;
|
|
38
38
|
export declare function validateEmptyCredentialSubjectNoopNativeSupport(outputs: ClaimOutputs): Promise<void>;
|
|
39
39
|
export declare const fieldValueFromVerifiablePresentation: (fieldName: string, verifiablePresentation?: VerifiablePresentation, ldLoader?: DocumentLoader) => Promise<bigint>;
|
|
40
|
+
export declare function calculateGroupId(requestIds: bigint[]): bigint;
|
|
41
|
+
export declare function calculateRequestId(requestParams: string, creatorAddress: string): bigint;
|
|
42
|
+
export declare function calculateMultiRequestId(requestIds: bigint[], groupIds: bigint[], creatorAddress: string): bigint;
|
|
@@ -5,6 +5,22 @@ export declare const VerifiableConstants: Readonly<{
|
|
|
5
5
|
CONTEXT_TYPE_IS_EMPTY: string;
|
|
6
6
|
IDENTITY_DOES_NOT_EXIST: string;
|
|
7
7
|
NO_AUTH_CRED_FOUND: string;
|
|
8
|
+
ID_WALLET_NO_CREDENTIAL_SATISFIED_QUERY: string;
|
|
9
|
+
ID_WALLET_SIGNER_IS_REQUIRED: string;
|
|
10
|
+
ID_WALLET_PROVER_IS_REQUIRED: string;
|
|
11
|
+
ID_WALLET_CORE_CLAIM_REQUIRED_IN_SIG_PROOF: string;
|
|
12
|
+
ID_WALLET_CORE_CLAIM_REQUIRED_IN_ANY_PROOF: string;
|
|
13
|
+
ID_WALLET_CORE_CLAIM_MISMATCH: string;
|
|
14
|
+
ID_WALLET_CORE_CLAIM_IS_NOT_SET: string;
|
|
15
|
+
ID_WALLET_PROFILE_OR_IDENTITY_NOT_FOUND: string;
|
|
16
|
+
ID_WALLET_PROFILE_ALREADY_EXISTS: string;
|
|
17
|
+
ID_WALLET_ISSUER_AUTH_BJJ_CRED_MUST_HAVE_ANY_PROOF: string;
|
|
18
|
+
ID_WALLET_ISSUER_AUTH_BJJ_CRED_MUST_HAVE_MTP_PROOF: string;
|
|
19
|
+
PROOF_SERVICE_NO_CREDENTIAL_FOR_IDENTITY_OR_PROFILE: string;
|
|
20
|
+
PROOF_SERVICE_NO_CREDENTIAL_FOR_QUERY: string;
|
|
21
|
+
PROOF_SERVICE_PROFILE_GENESIS_DID_MISMATCH: string;
|
|
22
|
+
PROOF_SERVICE_NO_QUERIES_IN_ZKP_REQUEST: string;
|
|
23
|
+
CREDENTIAL_WALLET_ALL_CREDENTIALS_ARE_REVOKED: string;
|
|
8
24
|
};
|
|
9
25
|
CREDENTIAL_TYPE: {
|
|
10
26
|
W3C_VERIFIABLE_CREDENTIAL: string;
|