@trustvc/trustvc 1.0.0-alpha.9 → 1.0.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/README.md +472 -21
- package/dist/contracts-BsBT1cT2.d.mts +22 -0
- package/dist/contracts-BsBT1cT2.d.ts +22 -0
- package/dist/contracts-Cbud3a4b.d.mts +22 -0
- package/dist/contracts-Cbud3a4b.d.ts +22 -0
- package/dist/core/decrypt.js +2 -2
- package/dist/core/documentBuilder.d.mts +6 -0
- package/dist/core/documentBuilder.d.ts +6 -0
- package/dist/core/documentBuilder.js +13 -0
- package/dist/core/encrypt.js +2 -2
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +6 -6
- package/dist/core/verify.d.mts +1 -1
- package/dist/core/verify.d.ts +1 -1
- package/dist/core/verify.js +13 -32
- package/dist/dnsprove/index.d.mts +1 -0
- package/dist/dnsprove/index.d.ts +1 -0
- package/dist/dnsprove/index.js +12 -0
- package/dist/esm/core/decrypt.js +1 -1
- package/dist/esm/core/documentBuilder.js +11 -0
- package/dist/esm/core/encrypt.js +1 -1
- package/dist/esm/core/index.js +2 -2
- package/dist/esm/core/verify.js +11 -30
- package/dist/esm/dnsprove/index.js +1 -0
- package/dist/esm/index.js +10 -1
- package/dist/esm/open-attestation/index.js +3 -2
- package/dist/esm/open-attestation/sign.js +10 -5
- package/dist/esm/open-attestation/types.js +1 -1
- package/dist/esm/open-attestation/utils.js +19 -0
- package/dist/esm/open-attestation/verify.js +2 -2
- package/dist/esm/open-attestation/wrap.js +28 -5
- package/dist/esm/token-registry-v4/contracts.js +1 -0
- package/dist/esm/token-registry-v4/index.js +1 -0
- package/dist/esm/token-registry-v4/supportInterfaceIds.js +5 -0
- package/dist/esm/token-registry-v5/contracts.js +1 -0
- package/dist/esm/token-registry-v5/index.js +1 -0
- package/dist/esm/token-registry-v5/supportInterfaceIds.js +5 -0
- package/dist/esm/utils/fragment/index.js +1 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/network/index.js +1 -0
- package/dist/esm/utils/supportedChains/index.js +1 -0
- package/dist/esm/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.js +2 -6
- package/dist/esm/{core → verify}/fragments/document-status/transferableRecords/utils.js +2 -2
- package/dist/esm/verify/fragments/index.js +5 -0
- package/dist/esm/verify/index.js +3 -0
- package/dist/esm/verify/verify.js +38 -0
- package/dist/esm/w3c/context/index.js +1 -0
- package/dist/esm/w3c/credential-status/index.js +1 -0
- package/dist/esm/w3c/index.js +9 -1
- package/dist/esm/w3c/issuer/index.js +1 -0
- package/dist/esm/w3c/vc/index.js +1 -0
- package/dist/index-1ws_BWZW.d.mts +22 -0
- package/dist/index-1ws_BWZW.d.ts +22 -0
- package/dist/index-CUw8WpjA.d.mts +22 -0
- package/dist/index-CjwEVGoM.d.mts +22 -0
- package/dist/index-CjwEVGoM.d.ts +22 -0
- package/dist/index-ClF4_Nqk.d.mts +22 -0
- package/dist/index-ClF4_Nqk.d.ts +22 -0
- package/dist/index-DK8Em_TZ.d.ts +22 -0
- package/dist/index-DwAYXQn2.d.mts +22 -0
- package/dist/index-DwAYXQn2.d.ts +22 -0
- package/dist/index.d.mts +40 -8
- package/dist/index.d.ts +40 -8
- package/dist/index.js +70 -14
- package/dist/open-attestation/index.d.mts +10 -3
- package/dist/open-attestation/index.d.ts +10 -3
- package/dist/open-attestation/index.js +15 -8
- package/dist/open-attestation/sign.d.mts +5 -3
- package/dist/open-attestation/sign.d.ts +5 -3
- package/dist/open-attestation/sign.js +10 -5
- package/dist/open-attestation/types.d.mts +2 -1
- package/dist/open-attestation/types.d.ts +2 -1
- package/dist/open-attestation/types.js +0 -16
- package/dist/open-attestation/utils.d.mts +41 -0
- package/dist/open-attestation/utils.d.ts +41 -0
- package/dist/open-attestation/utils.js +55 -0
- package/dist/open-attestation/verify.d.mts +2 -2
- package/dist/open-attestation/verify.d.ts +2 -2
- package/dist/open-attestation/verify.js +3 -3
- package/dist/open-attestation/wrap.d.mts +7 -3
- package/dist/open-attestation/wrap.d.ts +7 -3
- package/dist/open-attestation/wrap.js +39 -6
- package/dist/token-registry-v4/contracts.d.mts +1 -0
- package/dist/token-registry-v4/contracts.d.ts +1 -0
- package/dist/token-registry-v4/contracts.js +12 -0
- package/dist/token-registry-v4/index.d.mts +1 -0
- package/dist/token-registry-v4/index.d.ts +1 -0
- package/dist/token-registry-v4/index.js +12 -0
- package/dist/token-registry-v4/supportInterfaceIds.d.mts +12 -0
- package/dist/token-registry-v4/supportInterfaceIds.d.ts +12 -0
- package/dist/token-registry-v4/supportInterfaceIds.js +7 -0
- package/dist/token-registry-v5/contracts.d.mts +1 -0
- package/dist/token-registry-v5/contracts.d.ts +1 -0
- package/dist/token-registry-v5/contracts.js +12 -0
- package/dist/token-registry-v5/index.d.mts +1 -0
- package/dist/token-registry-v5/index.d.ts +1 -0
- package/dist/token-registry-v5/index.js +12 -0
- package/dist/token-registry-v5/supportInterfaceIds.d.mts +12 -0
- package/dist/token-registry-v5/supportInterfaceIds.d.ts +12 -0
- package/dist/token-registry-v5/supportInterfaceIds.js +7 -0
- package/dist/utils/fragment/index.d.mts +1 -0
- package/dist/utils/fragment/index.d.ts +1 -0
- package/dist/utils/fragment/index.js +14 -0
- package/dist/utils/index.d.mts +4 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +33 -0
- package/dist/utils/network/index.d.mts +1 -0
- package/dist/utils/network/index.d.ts +1 -0
- package/dist/utils/network/index.js +12 -0
- package/dist/utils/{stringUtils.d.ts → stringUtils/index.d.mts} +4 -0
- package/dist/utils/{stringUtils.d.mts → stringUtils/index.d.ts} +4 -0
- package/dist/utils/supportedChains/index.d.mts +1 -0
- package/dist/utils/supportedChains/index.d.ts +1 -0
- package/dist/utils/supportedChains/index.js +12 -0
- package/dist/{core → verify}/fragments/document-integrity/w3cSignatureIntegrity.d.mts +1 -1
- package/dist/{core → verify}/fragments/document-integrity/w3cSignatureIntegrity.d.ts +1 -1
- package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.d.mts +1 -1
- package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.d.ts +1 -1
- package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.js +14 -18
- package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.types.d.mts +1 -1
- package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.types.d.ts +1 -1
- package/dist/{core → verify}/fragments/document-status/transferableRecords/utils.d.mts +1 -1
- package/dist/{core → verify}/fragments/document-status/transferableRecords/utils.d.ts +1 -1
- package/dist/{core → verify}/fragments/document-status/transferableRecords/utils.js +9 -9
- package/dist/{core → verify}/fragments/document-status/w3cCredentialStatus.d.mts +1 -1
- package/dist/{core → verify}/fragments/document-status/w3cCredentialStatus.d.ts +1 -1
- package/dist/verify/fragments/index.d.mts +6 -0
- package/dist/verify/fragments/index.d.ts +6 -0
- package/dist/verify/fragments/index.js +54 -0
- package/dist/{core → verify}/fragments/issuer-identity/w3cIssuerIdentity.d.mts +1 -1
- package/dist/{core → verify}/fragments/issuer-identity/w3cIssuerIdentity.d.ts +1 -1
- package/dist/verify/index.d.mts +9 -0
- package/dist/verify/index.d.ts +9 -0
- package/dist/verify/index.js +34 -0
- package/dist/verify/verify.d.mts +29 -0
- package/dist/verify/verify.d.ts +29 -0
- package/dist/verify/verify.js +53 -0
- package/dist/w3c/context/index.d.mts +1 -0
- package/dist/w3c/context/index.d.ts +1 -0
- package/dist/w3c/context/index.js +12 -0
- package/dist/w3c/credential-status/index.d.mts +1 -0
- package/dist/w3c/credential-status/index.d.ts +1 -0
- package/dist/w3c/credential-status/index.js +12 -0
- package/dist/w3c/index.d.mts +7 -1
- package/dist/w3c/index.d.ts +7 -1
- package/dist/w3c/index.js +46 -15
- package/dist/w3c/issuer/index.d.mts +1 -0
- package/dist/w3c/issuer/index.d.ts +1 -0
- package/dist/w3c/issuer/index.js +12 -0
- package/dist/w3c/types.d.mts +6 -0
- package/dist/w3c/types.d.ts +6 -0
- package/dist/w3c/vc/index.d.mts +1 -0
- package/dist/w3c/vc/index.d.ts +1 -0
- package/dist/w3c/vc/index.js +12 -0
- package/package.json +100 -10
- /package/dist/{config.d.mts → constants.d.mts} +0 -0
- /package/dist/{config.d.ts → constants.d.ts} +0 -0
- /package/dist/{config.js → constants.js} +0 -0
- /package/dist/esm/{config.js → constants.js} +0 -0
- /package/dist/esm/utils/{stringUtils.js → stringUtils/index.js} +0 -0
- /package/dist/esm/{core → verify}/fragments/document-integrity/w3cSignatureIntegrity.js +0 -0
- /package/dist/esm/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.types.js +0 -0
- /package/dist/esm/{core → verify}/fragments/document-status/w3cCredentialStatus.js +0 -0
- /package/dist/esm/{core → verify}/fragments/issuer-identity/w3cIssuerIdentity.js +0 -0
- /package/dist/utils/{stringUtils.js → stringUtils/index.js} +0 -0
- /package/dist/{core → verify}/fragments/document-integrity/w3cSignatureIntegrity.js +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.types.js +0 -0
- /package/dist/{core → verify}/fragments/document-status/w3cCredentialStatus.js +0 -0
- /package/dist/{core → verify}/fragments/issuer-identity/w3cIssuerIdentity.js +0 -0
package/dist/core/encrypt.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var constants = require('../constants');
|
|
4
4
|
var stringUtils = require('../utils/stringUtils');
|
|
5
5
|
var tsChacha20 = require('ts-chacha20');
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
9
|
function encrypt(message, key, nonce) {
|
|
10
|
-
key = key.length > 0 ? key :
|
|
10
|
+
key = key.length > 0 ? key : constants.DEFAULT_KEY;
|
|
11
11
|
key = stringUtils.generate32ByteKey(key);
|
|
12
12
|
nonce = stringUtils.generate12ByteNonce(nonce ?? "");
|
|
13
13
|
const keyBuffer = stringUtils.stringToUint8Array(key);
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { verifyDocument } from './verify.mjs';
|
|
2
|
-
export { encrypt } from './encrypt.mjs';
|
|
3
1
|
export { decrypt } from './decrypt.mjs';
|
|
4
|
-
|
|
2
|
+
export { encrypt } from './encrypt.mjs';
|
|
3
|
+
export { verifyDocument } from './verify.mjs';
|
|
5
4
|
import '@trustvc/w3c-vc';
|
|
5
|
+
import '@tradetrust-tt/tt-verify/dist/types/src/types/core';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { verifyDocument } from './verify.js';
|
|
2
|
-
export { encrypt } from './encrypt.js';
|
|
3
1
|
export { decrypt } from './decrypt.js';
|
|
4
|
-
|
|
2
|
+
export { encrypt } from './encrypt.js';
|
|
3
|
+
export { verifyDocument } from './verify.js';
|
|
5
4
|
import '@trustvc/w3c-vc';
|
|
5
|
+
import '@tradetrust-tt/tt-verify/dist/types/src/types/core';
|
package/dist/core/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var verify = require('./verify');
|
|
4
|
-
var encrypt = require('./encrypt');
|
|
5
3
|
var decrypt = require('./decrypt');
|
|
4
|
+
var encrypt = require('./encrypt');
|
|
5
|
+
var verify = require('./verify');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
Object.keys(
|
|
9
|
+
Object.keys(decrypt).forEach(function (k) {
|
|
10
10
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return decrypt[k]; }
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
15
|
Object.keys(encrypt).forEach(function (k) {
|
|
@@ -18,9 +18,9 @@ Object.keys(encrypt).forEach(function (k) {
|
|
|
18
18
|
get: function () { return encrypt[k]; }
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
|
-
Object.keys(
|
|
21
|
+
Object.keys(verify).forEach(function (k) {
|
|
22
22
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return verify[k]; }
|
|
25
25
|
});
|
|
26
26
|
});
|
package/dist/core/verify.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocumentsToVerify, VerificationFragment } from '@govtechsg/oa-verify';
|
|
2
1
|
import { SignedVerifiableCredential } from '@trustvc/w3c-vc';
|
|
2
|
+
import { DocumentsToVerify, VerificationFragment } from '@tradetrust-tt/tt-verify/dist/types/src/types/core';
|
|
3
3
|
|
|
4
4
|
declare const verifyDocument: (document: DocumentsToVerify | SignedVerifiableCredential, rpcProviderUrl: string) => Promise<VerificationFragment[]>;
|
|
5
5
|
|
package/dist/core/verify.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocumentsToVerify, VerificationFragment } from '@govtechsg/oa-verify';
|
|
2
1
|
import { SignedVerifiableCredential } from '@trustvc/w3c-vc';
|
|
2
|
+
import { DocumentsToVerify, VerificationFragment } from '@tradetrust-tt/tt-verify/dist/types/src/types/core';
|
|
3
3
|
|
|
4
4
|
declare const verifyDocument: (document: DocumentsToVerify | SignedVerifiableCredential, rpcProviderUrl: string) => Promise<VerificationFragment[]>;
|
|
5
5
|
|
package/dist/core/verify.js
CHANGED
|
@@ -1,43 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var tradetrust = require('@tradetrust-tt/tradetrust');
|
|
4
4
|
var ethers = require('ethers');
|
|
5
|
-
var
|
|
6
|
-
var w3cCredentialStatus = require('./fragments/document-status/w3cCredentialStatus');
|
|
7
|
-
var w3cIssuerIdentity = require('./fragments/issuer-identity/w3cIssuerIdentity');
|
|
8
|
-
var openAttestation = require('@govtechsg/open-attestation');
|
|
9
|
-
var transferableRecordVerifier = require('./fragments/document-status/transferableRecords/transferableRecordVerifier');
|
|
5
|
+
var verify = require('../verify');
|
|
10
6
|
|
|
11
7
|
var __defProp = Object.defineProperty;
|
|
12
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
9
|
const verifyDocument = /* @__PURE__ */ __name(async (document, rpcProviderUrl) => {
|
|
14
|
-
if (
|
|
15
|
-
const verify =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
],
|
|
21
|
-
{
|
|
22
|
-
provider: new ethers.ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
23
|
-
// Use user-provided provider URL
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
return verify(document);
|
|
10
|
+
if (tradetrust.utils.isWrappedV2Document(document) || tradetrust.utils.isWrappedV3Document(document)) {
|
|
11
|
+
const verify$1 = verify.verificationBuilder(verify.openAttestationVerifiers, {
|
|
12
|
+
provider: new ethers.ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
13
|
+
// Use user-provided provider URL
|
|
14
|
+
});
|
|
15
|
+
return verify$1(document);
|
|
27
16
|
} else {
|
|
28
|
-
const verify =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
transferableRecordVerifier.credentialStatusTransferableRecordVerifier
|
|
34
|
-
],
|
|
35
|
-
{
|
|
36
|
-
provider: new ethers.ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
37
|
-
// Use user-provided provider URL
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
return verify(document);
|
|
17
|
+
const verify$1 = verify.verificationBuilder(verify.w3cVerifiers, {
|
|
18
|
+
provider: new ethers.ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
19
|
+
// Use user-provided provider URL
|
|
20
|
+
});
|
|
21
|
+
return verify$1(document);
|
|
41
22
|
}
|
|
42
23
|
}, "verifyDocument");
|
|
43
24
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/dnsprove';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/dnsprove';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dnsprove = require('@tradetrust-tt/dnsprove');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(dnsprove).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return dnsprove[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
package/dist/esm/core/decrypt.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
const _DocumentBuilder = class _DocumentBuilder {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.document = new _DocumentBuilder();
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
__name(_DocumentBuilder, "DocumentBuilder");
|
|
9
|
+
let DocumentBuilder = _DocumentBuilder;
|
|
10
|
+
|
|
11
|
+
export { DocumentBuilder };
|
package/dist/esm/core/encrypt.js
CHANGED
package/dist/esm/core/index.js
CHANGED
package/dist/esm/core/verify.js
CHANGED
|
@@ -1,40 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { utils } from '@tradetrust-tt/tradetrust';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
|
-
import {
|
|
4
|
-
import { w3cCredentialStatus } from './fragments/document-status/w3cCredentialStatus';
|
|
5
|
-
import { w3cIssuerIdentity } from './fragments/issuer-identity/w3cIssuerIdentity';
|
|
6
|
-
import { utils } from '@govtechsg/open-attestation';
|
|
7
|
-
import { credentialStatusTransferableRecordVerifier } from './fragments/document-status/transferableRecords/transferableRecordVerifier';
|
|
3
|
+
import { verificationBuilder, openAttestationVerifiers, w3cVerifiers } from '../verify';
|
|
8
4
|
|
|
9
5
|
var __defProp = Object.defineProperty;
|
|
10
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
11
7
|
const verifyDocument = /* @__PURE__ */ __name(async (document, rpcProviderUrl) => {
|
|
12
|
-
if (utils.isWrappedV2Document(document) || utils.isWrappedV3Document(document)
|
|
13
|
-
const verify = verificationBuilder(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
credentialStatusTransferableRecordVerifier
|
|
18
|
-
],
|
|
19
|
-
{
|
|
20
|
-
provider: new ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
21
|
-
// Use user-provided provider URL
|
|
22
|
-
}
|
|
23
|
-
);
|
|
8
|
+
if (utils.isWrappedV2Document(document) || utils.isWrappedV3Document(document)) {
|
|
9
|
+
const verify = verificationBuilder(openAttestationVerifiers, {
|
|
10
|
+
provider: new ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
11
|
+
// Use user-provided provider URL
|
|
12
|
+
});
|
|
24
13
|
return verify(document);
|
|
25
14
|
} else {
|
|
26
|
-
const verify = verificationBuilder(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
w3cIssuerIdentity,
|
|
31
|
-
credentialStatusTransferableRecordVerifier
|
|
32
|
-
],
|
|
33
|
-
{
|
|
34
|
-
provider: new ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
35
|
-
// Use user-provided provider URL
|
|
36
|
-
}
|
|
37
|
-
);
|
|
15
|
+
const verify = verificationBuilder(w3cVerifiers, {
|
|
16
|
+
provider: new ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
17
|
+
// Use user-provided provider URL
|
|
18
|
+
});
|
|
38
19
|
return verify(document);
|
|
39
20
|
}
|
|
40
21
|
}, "verifyDocument");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/dnsprove';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { supportInterfaceIds as v4SupportInterfaceIds } from './token-registry-v4/supportInterfaceIds';
|
|
2
|
+
export { supportInterfaceIds as v5SupportInterfaceIds } from './token-registry-v5/supportInterfaceIds';
|
|
3
|
+
import * as contracts from './token-registry-v4/contracts';
|
|
4
|
+
export { contracts as v4Contracts };
|
|
5
|
+
import * as contracts$1 from './token-registry-v5/contracts';
|
|
6
|
+
export { contracts$1 as v5Contracts };
|
|
2
7
|
export * from './core';
|
|
8
|
+
export * from './open-attestation';
|
|
9
|
+
export * from './verify';
|
|
3
10
|
export * from './w3c';
|
|
11
|
+
export * from './utils';
|
|
12
|
+
export * from './dnsprove';
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { signDocument, SUPPORTED_SIGNING_ALGORITHM } from '@tradetrust-tt/tradetrust';
|
|
2
2
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
async function signOA(document, keyPair) {
|
|
6
|
+
return signDocument(
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
document,
|
|
9
|
+
SUPPORTED_SIGNING_ALGORITHM.Secp256k1VerificationKey2018,
|
|
10
|
+
keyPair
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
__name(signOA, "signOA");
|
|
9
14
|
|
|
10
15
|
export { signOA };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { utils } from '@tradetrust-tt/tradetrust';
|
|
2
|
+
export { SUPPORTED_SIGNING_ALGORITHM, SchemaId, getData as getDataV2, isSchemaValidationError, obfuscateDocument, validateSchema } from '@tradetrust-tt/tradetrust';
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
isTransferableAsset,
|
|
6
|
+
getAssetId,
|
|
7
|
+
isWrappedV2Document,
|
|
8
|
+
isSignedWrappedV2Document,
|
|
9
|
+
isWrappedV3Document,
|
|
10
|
+
isSignedWrappedV3Document,
|
|
11
|
+
isRawV2Document,
|
|
12
|
+
isRawV3Document,
|
|
13
|
+
isObfuscated,
|
|
14
|
+
getDocumentData,
|
|
15
|
+
getIssuerAddress,
|
|
16
|
+
diagnose
|
|
17
|
+
} = utils;
|
|
18
|
+
|
|
19
|
+
export { diagnose, getAssetId, getDocumentData, getIssuerAddress, isObfuscated, isRawV2Document, isRawV3Document, isSignedWrappedV2Document, isSignedWrappedV3Document, isTransferableAsset, isWrappedV2Document, isWrappedV3Document };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { utils, verifySignature } from '@
|
|
1
|
+
import { utils, verifySignature } from '@tradetrust-tt/tradetrust';
|
|
2
2
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
5
|
const verifyOASignature = /* @__PURE__ */ __name(async (document) => {
|
|
6
|
-
if (utils.isWrappedV2Document(document) || utils.isWrappedV3Document(document)
|
|
6
|
+
if (utils.isWrappedV2Document(document) || utils.isWrappedV3Document(document)) {
|
|
7
7
|
return verifySignature(document);
|
|
8
8
|
} else {
|
|
9
9
|
return false;
|
|
@@ -1,10 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { wrapDocument, wrapDocuments, utils, __unsafe__use__it__at__your__own__risks__wrapDocument, __unsafe__use__it__at__your__own__risks__wrapDocuments } from '@tradetrust-tt/tradetrust';
|
|
2
|
+
export { __unsafe__use__it__at__your__own__risks__wrapDocument as wrapOADocumentV3, __unsafe__use__it__at__your__own__risks__wrapDocuments as wrapOADocumentsV3 } from '@tradetrust-tt/tradetrust';
|
|
2
3
|
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
const
|
|
6
|
-
const wrapOA = /* @__PURE__ */ __name(async (document) => {
|
|
6
|
+
const wrapOADocumentV2 = /* @__PURE__ */ __name(async (document) => {
|
|
7
7
|
return wrapDocument(document);
|
|
8
|
-
}, "
|
|
8
|
+
}, "wrapOADocumentV2");
|
|
9
|
+
const wrapOADocumentsV2 = /* @__PURE__ */ __name(async (documents) => {
|
|
10
|
+
return wrapDocuments(documents);
|
|
11
|
+
}, "wrapOADocumentsV2");
|
|
12
|
+
async function wrapOADocument(document) {
|
|
13
|
+
if (utils.isRawV2Document(document)) {
|
|
14
|
+
return wrapOADocumentV2(document);
|
|
15
|
+
} else if (utils.isRawV3Document(document)) {
|
|
16
|
+
return __unsafe__use__it__at__your__own__risks__wrapDocument(document);
|
|
17
|
+
} else {
|
|
18
|
+
throw new Error("Unsupported document version");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
__name(wrapOADocument, "wrapOADocument");
|
|
22
|
+
async function wrapOADocuments(documents) {
|
|
23
|
+
if (documents.every((s) => utils.isRawV2Document(s))) {
|
|
24
|
+
return wrapOADocumentsV2(documents);
|
|
25
|
+
} else if (documents.every((s) => utils.isRawV3Document(s))) {
|
|
26
|
+
return __unsafe__use__it__at__your__own__risks__wrapDocuments(documents);
|
|
27
|
+
} else {
|
|
28
|
+
throw new Error("Unsupported documents version");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
__name(wrapOADocuments, "wrapOADocuments");
|
|
9
32
|
|
|
10
|
-
export {
|
|
33
|
+
export { wrapOADocument, wrapOADocumentV2, wrapOADocuments, wrapOADocumentsV2 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v4/contracts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v4';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v5/contracts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v5';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { errorMessageHandling, interpretFragments } from '@tradetrust-tt/tradetrust-utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/network';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/supportedChains';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { OpenAttestationEthereumTokenRegistryStatusCode, CodedError, ValidTokenRegistryStatus } from '@
|
|
2
|
-
import { v4 } from '@govtechsg/open-attestation';
|
|
1
|
+
import { OpenAttestationEthereumTokenRegistryStatusCode, CodedError, ValidTokenRegistryStatus } from '@tradetrust-tt/tt-verify';
|
|
3
2
|
import * as w3cVC from '@trustvc/w3c-vc';
|
|
4
3
|
import { isTokenMintedOnRegistry } from './utils';
|
|
5
4
|
|
|
@@ -11,10 +10,7 @@ const name = TRANSFERABLE_RECORDS_TYPE;
|
|
|
11
10
|
const verify = /* @__PURE__ */ __name(async (document, options) => {
|
|
12
11
|
let signedDocument;
|
|
13
12
|
let tokenId;
|
|
14
|
-
if (
|
|
15
|
-
signedDocument = document;
|
|
16
|
-
tokenId = "0x" + signedDocument?.proof?.targetHash;
|
|
17
|
-
} else if (w3cVC.isSignedDocument(document)) {
|
|
13
|
+
if (w3cVC.isSignedDocument(document)) {
|
|
18
14
|
signedDocument = document;
|
|
19
15
|
tokenId = "0x" + signedDocument?.credentialStatus?.tokenId;
|
|
20
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TradeTrustToken__factory } from '@tradetrust-tt/token-registry-v5/dist/contracts';
|
|
2
|
+
import { CodedError, OpenAttestationEthereumTokenRegistryStatusCode } from '@tradetrust-tt/tt-verify';
|
|
3
3
|
import { errors, constants } from 'ethers';
|
|
4
4
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { openAttestationDidIdentityProof, openAttestationDidSignedDocumentStatus, openAttestationDnsDidIdentityProof, openAttestationDnsTxtIdentityProof, openAttestationEthereumDocumentStoreStatus, openAttestationEthereumTokenRegistryStatus, openAttestationHash } from '@tradetrust-tt/tt-verify';
|
|
2
|
+
export { w3cSignatureIntegrity } from './document-integrity/w3cSignatureIntegrity';
|
|
3
|
+
export { credentialStatusTransferableRecordVerifier } from './document-status/transferableRecords/transferableRecordVerifier';
|
|
4
|
+
export { w3cCredentialStatus } from './document-status/w3cCredentialStatus';
|
|
5
|
+
export { w3cIssuerIdentity } from './issuer-identity/w3cIssuerIdentity';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { openAttestationVerifiers as openAttestationVerifiers$1, openAttestationDidIdentityProof, openAttestationHash, openAttestationDidSignedDocumentStatus, openAttestationEthereumDocumentStoreStatus, openAttestationEthereumTokenRegistryStatus, openAttestationDnsDidIdentityProof, openAttestationDnsTxtIdentityProof } from '@tradetrust-tt/tt-verify';
|
|
2
|
+
export { isValid, verificationBuilder, verify } from '@tradetrust-tt/tt-verify';
|
|
3
|
+
import { w3cSignatureIntegrity } from './fragments/document-integrity/w3cSignatureIntegrity';
|
|
4
|
+
import { credentialStatusTransferableRecordVerifier } from './fragments/document-status/transferableRecords/transferableRecordVerifier';
|
|
5
|
+
import { w3cCredentialStatus } from './fragments/document-status/w3cCredentialStatus';
|
|
6
|
+
import { w3cIssuerIdentity } from './fragments/issuer-identity/w3cIssuerIdentity';
|
|
7
|
+
|
|
8
|
+
const verifiers = {
|
|
9
|
+
documentIntegrity: {
|
|
10
|
+
openAttestationHash,
|
|
11
|
+
w3cSignatureIntegrity
|
|
12
|
+
},
|
|
13
|
+
documentStatus: {
|
|
14
|
+
openAttestationDidSignedDocumentStatus,
|
|
15
|
+
openAttestationEthereumDocumentStoreStatus,
|
|
16
|
+
openAttestationEthereumTokenRegistryStatus,
|
|
17
|
+
w3cCredentialStatus,
|
|
18
|
+
credentialStatusTransferableRecordVerifier
|
|
19
|
+
},
|
|
20
|
+
issuerIdentity: {
|
|
21
|
+
openAttestationDidIdentityProof,
|
|
22
|
+
openAttestationDnsDidIdentityProof,
|
|
23
|
+
openAttestationDnsTxtIdentityProof,
|
|
24
|
+
w3cIssuerIdentity
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const openAttestationVerifiers = [
|
|
28
|
+
...openAttestationVerifiers$1,
|
|
29
|
+
openAttestationDidIdentityProof
|
|
30
|
+
];
|
|
31
|
+
const w3cVerifiers = [
|
|
32
|
+
w3cSignatureIntegrity,
|
|
33
|
+
w3cCredentialStatus,
|
|
34
|
+
credentialStatusTransferableRecordVerifier,
|
|
35
|
+
w3cIssuerIdentity
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export { openAttestationVerifiers, verifiers, w3cVerifiers };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@trustvc/w3c-context';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@trustvc/w3c-credential-status';
|
package/dist/esm/w3c/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import * as context from './context';
|
|
2
|
+
export { context };
|
|
3
|
+
import * as credentialStatus from './credential-status';
|
|
4
|
+
export { credentialStatus };
|
|
5
|
+
import * as issuer from './issuer';
|
|
6
|
+
export { issuer as isser };
|
|
1
7
|
export * from './sign';
|
|
2
|
-
export * from './verify';
|
|
3
8
|
export * from './types';
|
|
9
|
+
import * as vc from './vc';
|
|
10
|
+
export { vc };
|
|
11
|
+
export * from './verify';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@trustvc/w3c-issuer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@trustvc/w3c-vc';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as w3cVc from '@trustvc/w3c-vc';
|
|
2
|
+
|
|
3
|
+
function _mergeNamespaces(n, m) {
|
|
4
|
+
m.forEach(function (e) {
|
|
5
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
6
|
+
if (k !== 'default' && !(k in n)) {
|
|
7
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
8
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return e[k]; }
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return Object.freeze(n);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var index = /*#__PURE__*/_mergeNamespaces({
|
|
19
|
+
__proto__: null
|
|
20
|
+
}, [w3cVc]);
|
|
21
|
+
|
|
22
|
+
export { index as i };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as w3cVc from '@trustvc/w3c-vc';
|
|
2
|
+
|
|
3
|
+
function _mergeNamespaces(n, m) {
|
|
4
|
+
m.forEach(function (e) {
|
|
5
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
6
|
+
if (k !== 'default' && !(k in n)) {
|
|
7
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
8
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return e[k]; }
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return Object.freeze(n);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var index = /*#__PURE__*/_mergeNamespaces({
|
|
19
|
+
__proto__: null
|
|
20
|
+
}, [w3cVc]);
|
|
21
|
+
|
|
22
|
+
export { index as i };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { openAttestationDidIdentityProof, openAttestationDidSignedDocumentStatus, openAttestationDnsDidIdentityProof, openAttestationDnsTxtIdentityProof, openAttestationEthereumDocumentStoreStatus, openAttestationEthereumTokenRegistryStatus, openAttestationHash } from '@tradetrust-tt/tt-verify';
|
|
2
|
+
import { w3cSignatureIntegrity } from './verify/fragments/document-integrity/w3cSignatureIntegrity.mjs';
|
|
3
|
+
import { credentialStatusTransferableRecordVerifier } from './verify/fragments/document-status/transferableRecords/transferableRecordVerifier.mjs';
|
|
4
|
+
import { w3cCredentialStatus } from './verify/fragments/document-status/w3cCredentialStatus.mjs';
|
|
5
|
+
import { w3cIssuerIdentity } from './verify/fragments/issuer-identity/w3cIssuerIdentity.mjs';
|
|
6
|
+
|
|
7
|
+
declare const index_credentialStatusTransferableRecordVerifier: typeof credentialStatusTransferableRecordVerifier;
|
|
8
|
+
declare const index_openAttestationDidIdentityProof: typeof openAttestationDidIdentityProof;
|
|
9
|
+
declare const index_openAttestationDidSignedDocumentStatus: typeof openAttestationDidSignedDocumentStatus;
|
|
10
|
+
declare const index_openAttestationDnsDidIdentityProof: typeof openAttestationDnsDidIdentityProof;
|
|
11
|
+
declare const index_openAttestationDnsTxtIdentityProof: typeof openAttestationDnsTxtIdentityProof;
|
|
12
|
+
declare const index_openAttestationEthereumDocumentStoreStatus: typeof openAttestationEthereumDocumentStoreStatus;
|
|
13
|
+
declare const index_openAttestationEthereumTokenRegistryStatus: typeof openAttestationEthereumTokenRegistryStatus;
|
|
14
|
+
declare const index_openAttestationHash: typeof openAttestationHash;
|
|
15
|
+
declare const index_w3cCredentialStatus: typeof w3cCredentialStatus;
|
|
16
|
+
declare const index_w3cIssuerIdentity: typeof w3cIssuerIdentity;
|
|
17
|
+
declare const index_w3cSignatureIntegrity: typeof w3cSignatureIntegrity;
|
|
18
|
+
declare namespace index {
|
|
19
|
+
export { index_credentialStatusTransferableRecordVerifier as credentialStatusTransferableRecordVerifier, index_openAttestationDidIdentityProof as openAttestationDidIdentityProof, index_openAttestationDidSignedDocumentStatus as openAttestationDidSignedDocumentStatus, index_openAttestationDnsDidIdentityProof as openAttestationDnsDidIdentityProof, index_openAttestationDnsTxtIdentityProof as openAttestationDnsTxtIdentityProof, index_openAttestationEthereumDocumentStoreStatus as openAttestationEthereumDocumentStoreStatus, index_openAttestationEthereumTokenRegistryStatus as openAttestationEthereumTokenRegistryStatus, index_openAttestationHash as openAttestationHash, index_w3cCredentialStatus as w3cCredentialStatus, index_w3cIssuerIdentity as w3cIssuerIdentity, index_w3cSignatureIntegrity as w3cSignatureIntegrity };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { index as i };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as w3cCredentialStatus from '@trustvc/w3c-credential-status';
|
|
2
|
+
|
|
3
|
+
function _mergeNamespaces(n, m) {
|
|
4
|
+
m.forEach(function (e) {
|
|
5
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
6
|
+
if (k !== 'default' && !(k in n)) {
|
|
7
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
8
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return e[k]; }
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return Object.freeze(n);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var index = /*#__PURE__*/_mergeNamespaces({
|
|
19
|
+
__proto__: null
|
|
20
|
+
}, [w3cCredentialStatus]);
|
|
21
|
+
|
|
22
|
+
export { index as i };
|