@trustvc/trustvc 1.0.0-alpha.10 → 1.0.0-alpha.11
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/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 +11 -26
- 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 +9 -24
- package/dist/esm/dnsprove/index.js +1 -0
- package/dist/esm/index.js +10 -1
- package/dist/esm/open-attestation/types.js +1 -1
- package/dist/esm/open-attestation/utils.js +19 -1
- package/dist/esm/open-attestation/wrap.js +15 -15
- 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/utils.js +1 -1
- 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 +39 -7
- package/dist/index.d.ts +39 -7
- package/dist/index.js +70 -14
- package/dist/open-attestation/index.d.mts +9 -2
- package/dist/open-attestation/index.d.ts +9 -2
- package/dist/open-attestation/sign.d.mts +1 -0
- package/dist/open-attestation/sign.d.ts +1 -0
- 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 -3
- package/dist/open-attestation/utils.d.ts +41 -3
- package/dist/open-attestation/utils.js +48 -3
- package/dist/open-attestation/wrap.d.mts +6 -6
- package/dist/open-attestation/wrap.d.ts +6 -6
- package/dist/open-attestation/wrap.js +18 -18
- 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-status/transferableRecords/utils.js +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/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 +90 -3
- /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.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.d.mts +0 -0
- /package/dist/{core → verify}/fragments/document-integrity/w3cSignatureIntegrity.d.ts +0 -0
- /package/dist/{core → verify}/fragments/document-integrity/w3cSignatureIntegrity.js +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.d.mts +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.d.ts +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.js +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.types.d.mts +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.types.d.ts +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/transferableRecordVerifier.types.js +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/utils.d.mts +0 -0
- /package/dist/{core → verify}/fragments/document-status/transferableRecords/utils.d.ts +0 -0
- /package/dist/{core → verify}/fragments/document-status/w3cCredentialStatus.d.mts +0 -0
- /package/dist/{core → verify}/fragments/document-status/w3cCredentialStatus.d.ts +0 -0
- /package/dist/{core → verify}/fragments/document-status/w3cCredentialStatus.js +0 -0
- /package/dist/{core → verify}/fragments/issuer-identity/w3cIssuerIdentity.d.mts +0 -0
- /package/dist/{core → verify}/fragments/issuer-identity/w3cIssuerIdentity.d.ts +0 -0
- /package/dist/{core → verify}/fragments/issuer-identity/w3cIssuerIdentity.js +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as contracts$1 from '@tradetrust-tt/token-registry-v4/contracts';
|
|
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 contracts = /*#__PURE__*/_mergeNamespaces({
|
|
19
|
+
__proto__: null
|
|
20
|
+
}, [contracts$1]);
|
|
21
|
+
|
|
22
|
+
export { contracts as c };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as contracts$1 from '@tradetrust-tt/token-registry-v4/contracts';
|
|
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 contracts = /*#__PURE__*/_mergeNamespaces({
|
|
19
|
+
__proto__: null
|
|
20
|
+
}, [contracts$1]);
|
|
21
|
+
|
|
22
|
+
export { contracts as c };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as contracts$1 from '@tradetrust-tt/token-registry-v5/contracts';
|
|
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 contracts = /*#__PURE__*/_mergeNamespaces({
|
|
19
|
+
__proto__: null
|
|
20
|
+
}, [contracts$1]);
|
|
21
|
+
|
|
22
|
+
export { contracts as c };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as contracts$1 from '@tradetrust-tt/token-registry-v5/contracts';
|
|
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 contracts = /*#__PURE__*/_mergeNamespaces({
|
|
19
|
+
__proto__: null
|
|
20
|
+
}, [contracts$1]);
|
|
21
|
+
|
|
22
|
+
export { contracts as c };
|
package/dist/core/decrypt.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 decrypt(encryptedMessage, 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);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
+
const _DocumentBuilder = class _DocumentBuilder {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.document = new _DocumentBuilder();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
__name(_DocumentBuilder, "DocumentBuilder");
|
|
11
|
+
let DocumentBuilder = _DocumentBuilder;
|
|
12
|
+
|
|
13
|
+
exports.DocumentBuilder = DocumentBuilder;
|
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 '@tradetrust-tt/tt-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 '@tradetrust-tt/tt-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,39 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var tradetrust = require('@tradetrust-tt/tradetrust');
|
|
4
|
-
var ttVerify = require('@tradetrust-tt/tt-verify');
|
|
5
4
|
var ethers = require('ethers');
|
|
6
|
-
var
|
|
7
|
-
var transferableRecordVerifier = require('./fragments/document-status/transferableRecords/transferableRecordVerifier');
|
|
8
|
-
var w3cCredentialStatus = require('./fragments/document-status/w3cCredentialStatus');
|
|
9
|
-
var w3cIssuerIdentity = require('./fragments/issuer-identity/w3cIssuerIdentity');
|
|
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
10
|
if (tradetrust.utils.isWrappedV2Document(document) || tradetrust.utils.isWrappedV3Document(document)) {
|
|
15
|
-
const verify =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
return verify(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);
|
|
23
16
|
} else {
|
|
24
|
-
const verify =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
transferableRecordVerifier.credentialStatusTransferableRecordVerifier
|
|
30
|
-
],
|
|
31
|
-
{
|
|
32
|
-
provider: new ethers.ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
33
|
-
// Use user-provided provider URL
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
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);
|
|
37
22
|
}
|
|
38
23
|
}, "verifyDocument");
|
|
39
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,36 +1,21 @@
|
|
|
1
1
|
import { utils } from '@tradetrust-tt/tradetrust';
|
|
2
|
-
import { verificationBuilder, openAttestationVerifiers, openAttestationDidIdentityProof } from '@tradetrust-tt/tt-verify';
|
|
3
2
|
import { ethers } from 'ethers';
|
|
4
|
-
import {
|
|
5
|
-
import { credentialStatusTransferableRecordVerifier } from './fragments/document-status/transferableRecords/transferableRecordVerifier';
|
|
6
|
-
import { w3cCredentialStatus } from './fragments/document-status/w3cCredentialStatus';
|
|
7
|
-
import { w3cIssuerIdentity } from './fragments/issuer-identity/w3cIssuerIdentity';
|
|
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
8
|
if (utils.isWrappedV2Document(document) || utils.isWrappedV3Document(document)) {
|
|
13
|
-
const verify = verificationBuilder(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Use user-provided provider URL
|
|
18
|
-
}
|
|
19
|
-
);
|
|
9
|
+
const verify = verificationBuilder(openAttestationVerifiers, {
|
|
10
|
+
provider: new ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
11
|
+
// Use user-provided provider URL
|
|
12
|
+
});
|
|
20
13
|
return verify(document);
|
|
21
14
|
} else {
|
|
22
|
-
const verify = verificationBuilder(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
w3cIssuerIdentity,
|
|
27
|
-
credentialStatusTransferableRecordVerifier
|
|
28
|
-
],
|
|
29
|
-
{
|
|
30
|
-
provider: new ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
31
|
-
// Use user-provided provider URL
|
|
32
|
-
}
|
|
33
|
-
);
|
|
15
|
+
const verify = verificationBuilder(w3cVerifiers, {
|
|
16
|
+
provider: new ethers.providers.JsonRpcProvider(rpcProviderUrl)
|
|
17
|
+
// Use user-provided provider URL
|
|
18
|
+
});
|
|
34
19
|
return verify(document);
|
|
35
20
|
}
|
|
36
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 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
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,33 +1,33 @@
|
|
|
1
|
-
import { wrapDocument
|
|
2
|
-
export {
|
|
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';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
const
|
|
7
|
-
return wrapDocument
|
|
8
|
-
}, "
|
|
9
|
-
const
|
|
10
|
-
return wrapDocuments
|
|
11
|
-
}, "
|
|
12
|
-
async function
|
|
6
|
+
const wrapOADocumentV2 = /* @__PURE__ */ __name(async (document) => {
|
|
7
|
+
return wrapDocument(document);
|
|
8
|
+
}, "wrapOADocumentV2");
|
|
9
|
+
const wrapOADocumentsV2 = /* @__PURE__ */ __name(async (documents) => {
|
|
10
|
+
return wrapDocuments(documents);
|
|
11
|
+
}, "wrapOADocumentsV2");
|
|
12
|
+
async function wrapOADocument(document) {
|
|
13
13
|
if (utils.isRawV2Document(document)) {
|
|
14
|
-
return
|
|
14
|
+
return wrapOADocumentV2(document);
|
|
15
15
|
} else if (utils.isRawV3Document(document)) {
|
|
16
16
|
return __unsafe__use__it__at__your__own__risks__wrapDocument(document);
|
|
17
17
|
} else {
|
|
18
18
|
throw new Error("Unsupported document version");
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
__name(
|
|
22
|
-
async function
|
|
21
|
+
__name(wrapOADocument, "wrapOADocument");
|
|
22
|
+
async function wrapOADocuments(documents) {
|
|
23
23
|
if (documents.every((s) => utils.isRawV2Document(s))) {
|
|
24
|
-
return
|
|
24
|
+
return wrapOADocumentsV2(documents);
|
|
25
25
|
} else if (documents.every((s) => utils.isRawV3Document(s))) {
|
|
26
26
|
return __unsafe__use__it__at__your__own__risks__wrapDocuments(documents);
|
|
27
27
|
} else {
|
|
28
28
|
throw new Error("Unsupported documents version");
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
__name(
|
|
31
|
+
__name(wrapOADocuments, "wrapOADocuments");
|
|
32
32
|
|
|
33
|
-
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,5 @@
|
|
|
1
|
+
import { TradeTrustToken__factory } from '@tradetrust-tt/token-registry-v5/dist/contracts';
|
|
1
2
|
import { CodedError, OpenAttestationEthereumTokenRegistryStatusCode } from '@tradetrust-tt/tt-verify';
|
|
2
|
-
import { TradeTrustToken__factory } from '@tradetrust-tt/token-registry/dist/contracts';
|
|
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 };
|