@trustvc/trustvc 1.4.11 → 1.4.12
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/cjs/core/verify.js +3 -4
- package/dist/cjs/index.js +0 -5
- package/dist/cjs/open-attestation/utils.js +2 -0
- package/dist/cjs/utils/gasStation/index.js +0 -8
- package/dist/cjs/w3c/index.js +1 -1
- package/dist/esm/core/verify.js +3 -4
- package/dist/esm/index.js +0 -1
- package/dist/esm/open-attestation/utils.js +2 -1
- package/dist/esm/utils/gasStation/index.js +1 -1
- package/dist/esm/w3c/index.js +1 -1
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/verify.d.ts +5 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/open-attestation/index.d.ts +1 -1
- package/dist/types/open-attestation/utils.d.ts +2 -1
- package/dist/types/w3c/index.d.ts +1 -1
- package/package.json +7 -7
package/dist/cjs/core/verify.js
CHANGED
|
@@ -10,16 +10,15 @@ const verifyDocument = /* @__PURE__ */ __name((document, options) => {
|
|
|
10
10
|
if (typeof options === "string") {
|
|
11
11
|
options = { rpcProviderUrl: options };
|
|
12
12
|
}
|
|
13
|
+
const provider = options?.provider || new ethers.ethers.providers.JsonRpcProvider(options?.rpcProviderUrl);
|
|
13
14
|
if (tradetrust.utils.isWrappedV2Document(document) || tradetrust.utils.isWrappedV3Document(document)) {
|
|
14
15
|
const verify$1 = verify.verificationBuilder(verify.openAttestationVerifiers, {
|
|
15
|
-
provider
|
|
16
|
-
// Use user-provided provider URL
|
|
16
|
+
provider
|
|
17
17
|
});
|
|
18
18
|
return verify$1(document);
|
|
19
19
|
} else {
|
|
20
20
|
const verify$1 = verify.verificationBuilder(verify.w3cVerifiers, {
|
|
21
|
-
provider
|
|
22
|
-
// Use user-provided provider URL
|
|
21
|
+
provider,
|
|
23
22
|
documentLoader: options?.documentLoader
|
|
24
23
|
});
|
|
25
24
|
return verify$1(document);
|
package/dist/cjs/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var tokenRegistryV4 = require('./token-registry-v4');
|
|
4
4
|
var tokenRegistryV5 = require('./token-registry-v5');
|
|
5
|
-
var typedContractMethod = require('./token-registry-v5/typedContractMethod');
|
|
6
5
|
var core = require('./core');
|
|
7
6
|
var openAttestation = require('./open-attestation');
|
|
8
7
|
var verify = require('./verify');
|
|
@@ -80,10 +79,6 @@ Object.defineProperty(exports, "v5Utils", {
|
|
|
80
79
|
enumerable: true,
|
|
81
80
|
get: function () { return tokenRegistryV5.v5Utils; }
|
|
82
81
|
});
|
|
83
|
-
Object.defineProperty(exports, "TypedContractMethod", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
get: function () { return typedContractMethod.TypedContractMethod; }
|
|
86
|
-
});
|
|
87
82
|
Object.keys(core).forEach(function (k) {
|
|
88
83
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
89
84
|
enumerable: true,
|
|
@@ -4,6 +4,7 @@ var tradetrust = require('@tradetrust-tt/tradetrust');
|
|
|
4
4
|
|
|
5
5
|
const {
|
|
6
6
|
isTransferableAsset,
|
|
7
|
+
isDocumentRevokable,
|
|
7
8
|
getAssetId,
|
|
8
9
|
isWrappedV2Document,
|
|
9
10
|
isSignedWrappedV2Document,
|
|
@@ -47,6 +48,7 @@ exports.getAssetId = getAssetId;
|
|
|
47
48
|
exports.getDocumentData = getDocumentData;
|
|
48
49
|
exports.getIssuerAddress = getIssuerAddress;
|
|
49
50
|
exports.getTemplateURL = getTemplateURL;
|
|
51
|
+
exports.isDocumentRevokable = isDocumentRevokable;
|
|
50
52
|
exports.isObfuscated = isObfuscated;
|
|
51
53
|
exports.isRawV2Document = isRawV2Document;
|
|
52
54
|
exports.isRawV3Document = isRawV3Document;
|
|
@@ -4,14 +4,6 @@ var tradetrustUtils = require('@tradetrust-tt/tradetrust-utils');
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
Object.defineProperty(exports, "GasStationFeeData", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return tradetrustUtils.GasStationFeeData; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "GasStationFunction", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return tradetrustUtils.GasStationFunction; }
|
|
14
|
-
});
|
|
15
7
|
Object.defineProperty(exports, "calculateMaxFee", {
|
|
16
8
|
enumerable: true,
|
|
17
9
|
get: function () { return tradetrustUtils.calculateMaxFee; }
|
package/dist/cjs/w3c/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var vc__namespace = /*#__PURE__*/_interopNamespace(vc);
|
|
|
35
35
|
|
|
36
36
|
exports.context = context__namespace;
|
|
37
37
|
exports.credentialStatus = credentialStatus__namespace;
|
|
38
|
-
exports.
|
|
38
|
+
exports.issuer = issuer__namespace;
|
|
39
39
|
exports.vc = vc__namespace;
|
|
40
40
|
Object.keys(sign).forEach(function (k) {
|
|
41
41
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
package/dist/esm/core/verify.js
CHANGED
|
@@ -8,16 +8,15 @@ const verifyDocument = /* @__PURE__ */ __name((document, options) => {
|
|
|
8
8
|
if (typeof options === "string") {
|
|
9
9
|
options = { rpcProviderUrl: options };
|
|
10
10
|
}
|
|
11
|
+
const provider = options?.provider || new ethers.providers.JsonRpcProvider(options?.rpcProviderUrl);
|
|
11
12
|
if (utils.isWrappedV2Document(document) || utils.isWrappedV3Document(document)) {
|
|
12
13
|
const verify = verificationBuilder(openAttestationVerifiers, {
|
|
13
|
-
provider
|
|
14
|
-
// Use user-provided provider URL
|
|
14
|
+
provider
|
|
15
15
|
});
|
|
16
16
|
return verify(document);
|
|
17
17
|
} else {
|
|
18
18
|
const verify = verificationBuilder(w3cVerifiers, {
|
|
19
|
-
provider
|
|
20
|
-
// Use user-provided provider URL
|
|
19
|
+
provider,
|
|
21
20
|
documentLoader: options?.documentLoader
|
|
22
21
|
});
|
|
23
22
|
return verify(document);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { v4ComputeInterfaceId, v4ComputeTitleEscrowAddress, v4ContractAddress, v4Contracts, v4EncodeInitParams, v4GetEventFromReceipt, v4RoleHash, v4SupportInterfaceIds, v4Utils } from './token-registry-v4';
|
|
2
2
|
export { v5ComputeInterfaceId, v5ContractAddress, v5Contracts, v5EncodeInitParams, v5GetEventFromReceipt, v5RoleHash, v5SupportInterfaceIds, v5Utils } from './token-registry-v5';
|
|
3
|
-
export { TypedContractMethod } from './token-registry-v5/typedContractMethod';
|
|
4
3
|
export * from './core';
|
|
5
4
|
export * from './open-attestation';
|
|
6
5
|
export * from './verify';
|
|
@@ -3,6 +3,7 @@ export { SUPPORTED_SIGNING_ALGORITHM, SchemaId, getData as getDataV2, isSchemaVa
|
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
5
|
isTransferableAsset,
|
|
6
|
+
isDocumentRevokable,
|
|
6
7
|
getAssetId,
|
|
7
8
|
isWrappedV2Document,
|
|
8
9
|
isSignedWrappedV2Document,
|
|
@@ -17,4 +18,4 @@ const {
|
|
|
17
18
|
getTemplateURL
|
|
18
19
|
} = utils;
|
|
19
20
|
|
|
20
|
-
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document };
|
|
21
|
+
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL, isDocumentRevokable, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { calculateMaxFee, gasStation, scaleBigNumber } from '@tradetrust-tt/tradetrust-utils';
|
package/dist/esm/w3c/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { context };
|
|
|
3
3
|
import * as credentialStatus from './credential-status';
|
|
4
4
|
export { credentialStatus };
|
|
5
5
|
import * as issuer from './issuer';
|
|
6
|
-
export { issuer
|
|
6
|
+
export { issuer };
|
|
7
7
|
export * from './sign';
|
|
8
8
|
export * from './types';
|
|
9
9
|
import * as vc from './vc';
|
|
@@ -9,9 +9,9 @@ export { EndorsementChain, ParsedLog, TitleEscrowTransferEvent, TitleEscrowTrans
|
|
|
9
9
|
export { TitleEscrowInterface, fetchEndorsementChain, getDocumentOwner, getTitleEscrowAddress, isTitleEscrowVersion } from './endorsement-chain/useEndorsementChain.js';
|
|
10
10
|
export { DocumentBuilder, RenderMethod, W3CTransferableRecordsConfig, W3CVerifiableDocumentConfig, qrCode } from './documentBuilder.js';
|
|
11
11
|
import '@trustvc/w3c-vc';
|
|
12
|
+
import 'ethers';
|
|
12
13
|
import '@tradetrust-tt/tt-verify/dist/types/src/types/core';
|
|
13
14
|
import 'ethersV6';
|
|
14
15
|
import '@ethersproject/abstract-provider';
|
|
15
|
-
import 'ethers';
|
|
16
16
|
import 'ethers/lib/utils';
|
|
17
17
|
import '@trustvc/w3c-issuer';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { SignedVerifiableCredential, DocumentLoader } from '@trustvc/w3c-vc';
|
|
2
|
+
import { ethers } from 'ethers';
|
|
2
3
|
import { DocumentsToVerify, VerificationFragment } from '@tradetrust-tt/tt-verify/dist/types/src/types/core';
|
|
3
4
|
|
|
4
5
|
type VerificationBuilderOptions = {
|
|
5
6
|
rpcProviderUrl?: string;
|
|
6
7
|
documentLoader?: DocumentLoader;
|
|
8
|
+
provider?: ethers.providers.Provider;
|
|
7
9
|
};
|
|
8
10
|
interface VerifyDocumentParams {
|
|
9
11
|
/**
|
|
@@ -24,8 +26,9 @@ interface VerifyDocumentParams {
|
|
|
24
26
|
* (e.g., Ethereum, Polygon) for DID resolution and verification tasks.
|
|
25
27
|
* @param {DocumentsToVerify | SignedVerifiableCredential} document - The document to be verified, either an OpenAttestation document or a W3C Verifiable Credential.
|
|
26
28
|
* @param {VerificationBuilderOptions} options - The options object containing the provider URL and document loader.
|
|
27
|
-
* @param {string} options.rpcProviderUrl - The Ethereum-compatible JSON-RPC provider URL (e.g., Infura, Alchemy,
|
|
28
|
-
* @param {DocumentLoader} options.documentLoader - The document loader to be used for loading JSON-LD contexts.
|
|
29
|
+
* @param {string} options.rpcProviderUrl - The Ethereum-compatible JSON-RPC provider URL (e.g., Infura, Alchemy, etc.).
|
|
30
|
+
* @param {DocumentLoader} options.documentLoader - The document loader to be used for loading JSON-LD contexts, DIDs and credential status.
|
|
31
|
+
* @param {ethers.providers.Provider} options.provider - Ethers v5 provider. overrides rpcProviderUrl
|
|
29
32
|
* @returns {Promise<VerificationFragment[]>} - A promise that resolves to an array of verification fragments,
|
|
30
33
|
* detailing the results of various verification checks such as
|
|
31
34
|
* signature integrity, credential status, issuer identity, etc.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,14 +22,14 @@ export { TitleEscrowInterface, fetchEndorsementChain, getDocumentOwner, getTitle
|
|
|
22
22
|
export { DocumentBuilder, RenderMethod, W3CTransferableRecordsConfig, W3CVerifiableDocumentConfig, qrCode } from './core/documentBuilder.js';
|
|
23
23
|
export { signOA } from './open-attestation/sign.js';
|
|
24
24
|
export { KeyPair } from './open-attestation/types.js';
|
|
25
|
-
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document } from './open-attestation/utils.js';
|
|
25
|
+
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL, isDocumentRevokable, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document } from './open-attestation/utils.js';
|
|
26
26
|
export { verifyOASignature } from './open-attestation/verify.js';
|
|
27
27
|
export { wrapOADocument, wrapOADocumentV2, wrapOADocuments, wrapOADocumentsV2 } from './open-attestation/wrap.js';
|
|
28
28
|
export { openAttestationVerifiers, verifiers, w3cVerifiers } from './verify/verify.js';
|
|
29
29
|
export { i as fragments } from './index-CRVFHzes.js';
|
|
30
30
|
export { i as context } from './index-DwAYXQn2.js';
|
|
31
31
|
export { i as credentialStatus } from './index-CjwEVGoM.js';
|
|
32
|
-
export { i as
|
|
32
|
+
export { i as issuer } from './index-ClF4_Nqk.js';
|
|
33
33
|
export { signW3C } from './w3c/sign.js';
|
|
34
34
|
export { RawVerifiableCredential, SignedVerifiableCredential, SigningResult, VerificationResult } from '@trustvc/w3c-vc';
|
|
35
35
|
export { PrivateKeyPair } from '@trustvc/w3c-issuer';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { signOA } from './sign.js';
|
|
2
2
|
export { KeyPair } from './types.js';
|
|
3
|
-
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document } from './utils.js';
|
|
3
|
+
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL, isDocumentRevokable, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document } from './utils.js';
|
|
4
4
|
export { verifyOASignature } from './verify.js';
|
|
5
5
|
export { wrapOADocument, wrapOADocumentV2, wrapOADocuments, wrapOADocumentsV2 } from './wrap.js';
|
|
6
6
|
export { OpenAttestationDocument, SUPPORTED_SIGNING_ALGORITHM, SchemaId, SignedWrappedDocument, WrappedDocument, getData as getDataV2, isSchemaValidationError, obfuscateDocument, v2, v3, validateSchema, __unsafe__use__it__at__your__own__risks__wrapDocument as wrapOADocumentV3, __unsafe__use__it__at__your__own__risks__wrapDocuments as wrapOADocumentsV3 } from '@tradetrust-tt/tradetrust';
|
|
@@ -8,6 +8,7 @@ import * as _tradetrust_tt_tradetrust_dist_types___generated___schema_2_0 from '
|
|
|
8
8
|
import * as _tradetrust_tt_tradetrust_dist_types_shared_utils__types_diagnose from '@tradetrust-tt/tradetrust/dist/types/shared/utils/@types/diagnose';
|
|
9
9
|
|
|
10
10
|
declare const isTransferableAsset: (document: any) => boolean;
|
|
11
|
+
declare const isDocumentRevokable: (document: any) => boolean;
|
|
11
12
|
declare const getAssetId: (document: any) => string;
|
|
12
13
|
declare const isWrappedV2Document: (document: any, { mode }?: {
|
|
13
14
|
mode: _tradetrust_tt_tradetrust_dist_types_shared_utils__types_diagnose.Mode;
|
|
@@ -39,4 +40,4 @@ declare const diagnose: ({ version, kind, document, debug, mode, }: {
|
|
|
39
40
|
}) => utils.DiagnoseError[];
|
|
40
41
|
declare const getTemplateURL: (document: any) => string | undefined;
|
|
41
42
|
|
|
42
|
-
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document };
|
|
43
|
+
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, getTemplateURL, isDocumentRevokable, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { i as context } from '../index-DwAYXQn2.js';
|
|
2
2
|
export { i as credentialStatus } from '../index-CjwEVGoM.js';
|
|
3
|
-
export { i as
|
|
3
|
+
export { i as issuer } from '../index-ClF4_Nqk.js';
|
|
4
4
|
export { signW3C } from './sign.js';
|
|
5
5
|
export { RawVerifiableCredential, SignedVerifiableCredential, SigningResult, VerificationResult } from '@trustvc/w3c-vc';
|
|
6
6
|
export { PrivateKeyPair } from '@trustvc/w3c-issuer';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustvc/trustvc",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
4
4
|
"description": "TrustVC library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -111,17 +111,17 @@
|
|
|
111
111
|
},
|
|
112
112
|
"dependencies": {
|
|
113
113
|
"@tradetrust-tt/dnsprove": "^2.17.0",
|
|
114
|
-
"@tradetrust-tt/token-registry-v4": "npm:@tradetrust-tt/token-registry@^4.
|
|
115
|
-
"@tradetrust-tt/token-registry-v5": "npm:@tradetrust-tt/token-registry@^5.
|
|
114
|
+
"@tradetrust-tt/token-registry-v4": "npm:@tradetrust-tt/token-registry@^4.16.0",
|
|
115
|
+
"@tradetrust-tt/token-registry-v5": "npm:@tradetrust-tt/token-registry@^5.3.0",
|
|
116
116
|
"@tradetrust-tt/tradetrust": "^6.10.1",
|
|
117
117
|
"@tradetrust-tt/tradetrust-utils": "^2.3.1",
|
|
118
118
|
"@tradetrust-tt/tt-verify": "^9.4.0",
|
|
119
|
-
"@trustvc/w3c-context": "^1.2.
|
|
120
|
-
"@trustvc/w3c-credential-status": "^1.2.
|
|
119
|
+
"@trustvc/w3c-context": "^1.2.12",
|
|
120
|
+
"@trustvc/w3c-credential-status": "^1.2.12",
|
|
121
121
|
"@trustvc/w3c-issuer": "^1.2.3",
|
|
122
|
-
"@trustvc/w3c-vc": "^1.2.
|
|
122
|
+
"@trustvc/w3c-vc": "^1.2.16",
|
|
123
123
|
"ethers": "^5.8.0",
|
|
124
|
-
"ethersV6": "npm:ethers@^6.
|
|
124
|
+
"ethersV6": "npm:ethers@^6.14.3",
|
|
125
125
|
"js-sha3": "^0.9.3",
|
|
126
126
|
"ts-chacha20": "^1.2.0"
|
|
127
127
|
},
|