@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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tradetrust = require('@tradetrust-tt/tradetrust');
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
isTransferableAsset,
|
|
7
|
+
getAssetId,
|
|
8
|
+
isWrappedV2Document,
|
|
9
|
+
isSignedWrappedV2Document,
|
|
10
|
+
isWrappedV3Document,
|
|
11
|
+
isSignedWrappedV3Document,
|
|
12
|
+
isRawV2Document,
|
|
13
|
+
isRawV3Document,
|
|
14
|
+
isObfuscated,
|
|
15
|
+
getDocumentData,
|
|
16
|
+
getIssuerAddress,
|
|
17
|
+
diagnose
|
|
18
|
+
} = tradetrust.utils;
|
|
19
|
+
|
|
20
|
+
Object.defineProperty(exports, "SUPPORTED_SIGNING_ALGORITHM", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return tradetrust.SUPPORTED_SIGNING_ALGORITHM; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "SchemaId", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return tradetrust.SchemaId; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "getDataV2", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return tradetrust.getData; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "isSchemaValidationError", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return tradetrust.isSchemaValidationError; }
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "obfuscateDocument", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return tradetrust.obfuscateDocument; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "validateSchema", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return tradetrust.validateSchema; }
|
|
43
|
+
});
|
|
44
|
+
exports.diagnose = diagnose;
|
|
45
|
+
exports.getAssetId = getAssetId;
|
|
46
|
+
exports.getDocumentData = getDocumentData;
|
|
47
|
+
exports.getIssuerAddress = getIssuerAddress;
|
|
48
|
+
exports.isObfuscated = isObfuscated;
|
|
49
|
+
exports.isRawV2Document = isRawV2Document;
|
|
50
|
+
exports.isRawV3Document = isRawV3Document;
|
|
51
|
+
exports.isSignedWrappedV2Document = isSignedWrappedV2Document;
|
|
52
|
+
exports.isSignedWrappedV3Document = isSignedWrappedV3Document;
|
|
53
|
+
exports.isTransferableAsset = isTransferableAsset;
|
|
54
|
+
exports.isWrappedV2Document = isWrappedV2Document;
|
|
55
|
+
exports.isWrappedV3Document = isWrappedV3Document;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v2, v3
|
|
1
|
+
import { v2, v3 } from '@tradetrust-tt/tradetrust';
|
|
2
2
|
|
|
3
|
-
declare const verifyOASignature: (document: v2.WrappedDocument | v3.WrappedDocument
|
|
3
|
+
declare const verifyOASignature: (document: v2.WrappedDocument | v3.WrappedDocument) => Promise<boolean>;
|
|
4
4
|
|
|
5
5
|
export { verifyOASignature };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v2, v3
|
|
1
|
+
import { v2, v3 } from '@tradetrust-tt/tradetrust';
|
|
2
2
|
|
|
3
|
-
declare const verifyOASignature: (document: v2.WrappedDocument | v3.WrappedDocument
|
|
3
|
+
declare const verifyOASignature: (document: v2.WrappedDocument | v3.WrappedDocument) => Promise<boolean>;
|
|
4
4
|
|
|
5
5
|
export { verifyOASignature };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var tradetrust = require('@tradetrust-tt/tradetrust');
|
|
4
4
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
7
|
const verifyOASignature = /* @__PURE__ */ __name(async (document) => {
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
8
|
+
if (tradetrust.utils.isWrappedV2Document(document) || tradetrust.utils.isWrappedV3Document(document)) {
|
|
9
|
+
return tradetrust.verifySignature(document);
|
|
10
10
|
} else {
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v2, OpenAttestationDocument, WrappedDocument } 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
|
-
declare const
|
|
4
|
+
declare const wrapOADocumentV2: <T extends v2.OpenAttestationDocument>(document: T) => Promise<v2.WrappedDocument<T>>;
|
|
5
|
+
declare const wrapOADocumentsV2: <T extends v2.OpenAttestationDocument>(documents: T[]) => Promise<v2.WrappedDocument<T>[]>;
|
|
6
|
+
declare function wrapOADocument<T extends OpenAttestationDocument>(document: T): Promise<WrappedDocument<T>>;
|
|
7
|
+
declare function wrapOADocuments<T extends OpenAttestationDocument>(documents: T[]): Promise<WrappedDocument<T>[]>;
|
|
4
8
|
|
|
5
|
-
export {
|
|
9
|
+
export { wrapOADocument, wrapOADocumentV2, wrapOADocuments, wrapOADocumentsV2 };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v2, OpenAttestationDocument, WrappedDocument } 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
|
-
declare const
|
|
4
|
+
declare const wrapOADocumentV2: <T extends v2.OpenAttestationDocument>(document: T) => Promise<v2.WrappedDocument<T>>;
|
|
5
|
+
declare const wrapOADocumentsV2: <T extends v2.OpenAttestationDocument>(documents: T[]) => Promise<v2.WrappedDocument<T>[]>;
|
|
6
|
+
declare function wrapOADocument<T extends OpenAttestationDocument>(document: T): Promise<WrappedDocument<T>>;
|
|
7
|
+
declare function wrapOADocuments<T extends OpenAttestationDocument>(documents: T[]): Promise<WrappedDocument<T>[]>;
|
|
4
8
|
|
|
5
|
-
export {
|
|
9
|
+
export { wrapOADocument, wrapOADocumentV2, wrapOADocuments, wrapOADocumentsV2 };
|
|
@@ -1,12 +1,45 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var tradetrust = require('@tradetrust-tt/tradetrust');
|
|
4
4
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const wrapOADocumentV2 = /* @__PURE__ */ __name(async (document) => {
|
|
8
|
+
return tradetrust.wrapDocument(document);
|
|
9
|
+
}, "wrapOADocumentV2");
|
|
10
|
+
const wrapOADocumentsV2 = /* @__PURE__ */ __name(async (documents) => {
|
|
11
|
+
return tradetrust.wrapDocuments(documents);
|
|
12
|
+
}, "wrapOADocumentsV2");
|
|
13
|
+
async function wrapOADocument(document) {
|
|
14
|
+
if (tradetrust.utils.isRawV2Document(document)) {
|
|
15
|
+
return wrapOADocumentV2(document);
|
|
16
|
+
} else if (tradetrust.utils.isRawV3Document(document)) {
|
|
17
|
+
return tradetrust.__unsafe__use__it__at__your__own__risks__wrapDocument(document);
|
|
18
|
+
} else {
|
|
19
|
+
throw new Error("Unsupported document version");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
__name(wrapOADocument, "wrapOADocument");
|
|
23
|
+
async function wrapOADocuments(documents) {
|
|
24
|
+
if (documents.every((s) => tradetrust.utils.isRawV2Document(s))) {
|
|
25
|
+
return wrapOADocumentsV2(documents);
|
|
26
|
+
} else if (documents.every((s) => tradetrust.utils.isRawV3Document(s))) {
|
|
27
|
+
return tradetrust.__unsafe__use__it__at__your__own__risks__wrapDocuments(documents);
|
|
28
|
+
} else {
|
|
29
|
+
throw new Error("Unsupported documents version");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
__name(wrapOADocuments, "wrapOADocuments");
|
|
11
33
|
|
|
12
|
-
exports
|
|
34
|
+
Object.defineProperty(exports, "wrapOADocumentV3", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return tradetrust.__unsafe__use__it__at__your__own__risks__wrapDocument; }
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "wrapOADocumentsV3", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () { return tradetrust.__unsafe__use__it__at__your__own__risks__wrapDocuments; }
|
|
41
|
+
});
|
|
42
|
+
exports.wrapOADocument = wrapOADocument;
|
|
43
|
+
exports.wrapOADocumentV2 = wrapOADocumentV2;
|
|
44
|
+
exports.wrapOADocuments = wrapOADocuments;
|
|
45
|
+
exports.wrapOADocumentsV2 = wrapOADocumentsV2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v4/contracts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v4/contracts';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var contracts = require('@tradetrust-tt/token-registry-v4/contracts');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(contracts).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return contracts[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v4';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v4';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tokenRegistryV4 = require('@tradetrust-tt/token-registry-v4');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(tokenRegistryV4).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return tokenRegistryV4[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const supportInterfaceIds: {
|
|
2
|
+
TradeTrustTokenMintable: string;
|
|
3
|
+
TradeTrustTokenBurnable: string;
|
|
4
|
+
TradeTrustTokenRestorable: string;
|
|
5
|
+
TitleEscrow: string;
|
|
6
|
+
TitleEscrowSignable: string;
|
|
7
|
+
TitleEscrowFactory: string;
|
|
8
|
+
AccessControl: string;
|
|
9
|
+
SBT: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { supportInterfaceIds };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const supportInterfaceIds: {
|
|
2
|
+
TradeTrustTokenMintable: string;
|
|
3
|
+
TradeTrustTokenBurnable: string;
|
|
4
|
+
TradeTrustTokenRestorable: string;
|
|
5
|
+
TitleEscrow: string;
|
|
6
|
+
TitleEscrowSignable: string;
|
|
7
|
+
TitleEscrowFactory: string;
|
|
8
|
+
AccessControl: string;
|
|
9
|
+
SBT: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { supportInterfaceIds };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v5/contracts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v5/contracts';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var contracts = require('@tradetrust-tt/token-registry-v5/contracts');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(contracts).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return contracts[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v5';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/token-registry-v5';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tokenRegistryV5 = require('@tradetrust-tt/token-registry-v5');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(tokenRegistryV5).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return tokenRegistryV5[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const supportInterfaceIds: {
|
|
2
|
+
TradeTrustTokenMintable: string;
|
|
3
|
+
TradeTrustTokenBurnable: string;
|
|
4
|
+
TradeTrustTokenRestorable: string;
|
|
5
|
+
TitleEscrow: string;
|
|
6
|
+
TitleEscrowSignable: string;
|
|
7
|
+
TitleEscrowFactory: string;
|
|
8
|
+
AccessControl: string;
|
|
9
|
+
SBT: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { supportInterfaceIds };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const supportInterfaceIds: {
|
|
2
|
+
TradeTrustTokenMintable: string;
|
|
3
|
+
TradeTrustTokenBurnable: string;
|
|
4
|
+
TradeTrustTokenRestorable: string;
|
|
5
|
+
TitleEscrow: string;
|
|
6
|
+
TitleEscrowSignable: string;
|
|
7
|
+
TitleEscrowFactory: string;
|
|
8
|
+
AccessControl: string;
|
|
9
|
+
SBT: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { supportInterfaceIds };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { errorMessageHandling, interpretFragments } from '@tradetrust-tt/tradetrust-utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { errorMessageHandling, interpretFragments } from '@tradetrust-tt/tradetrust-utils';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tradetrustUtils = require('@tradetrust-tt/tradetrust-utils');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "errorMessageHandling", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return tradetrustUtils.errorMessageHandling; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "interpretFragments", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return tradetrustUtils.interpretFragments; }
|
|
14
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { errorMessageHandling, interpretFragments } from '@tradetrust-tt/tradetrust-utils';
|
|
2
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/network';
|
|
3
|
+
export { generate12ByteNonce, generate32ByteKey, stringToUint8Array } from './stringUtils/index.mjs';
|
|
4
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/supportedChains';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { errorMessageHandling, interpretFragments } from '@tradetrust-tt/tradetrust-utils';
|
|
2
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/network';
|
|
3
|
+
export { generate12ByteNonce, generate32ByteKey, stringToUint8Array } from './stringUtils/index.js';
|
|
4
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/supportedChains';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var fragment = require('./fragment');
|
|
4
|
+
var network = require('./network');
|
|
5
|
+
var stringUtils = require('./stringUtils');
|
|
6
|
+
var supportedChains = require('./supportedChains');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.keys(fragment).forEach(function (k) {
|
|
11
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return fragment[k]; }
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
Object.keys(network).forEach(function (k) {
|
|
17
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return network[k]; }
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
Object.keys(stringUtils).forEach(function (k) {
|
|
23
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return stringUtils[k]; }
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
Object.keys(supportedChains).forEach(function (k) {
|
|
29
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return supportedChains[k]; }
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/network';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/network';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var network = require('@tradetrust-tt/tradetrust-utils/constants/network');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(network).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return network[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import '@tradetrust-tt/tradetrust-utils';
|
|
2
|
+
import '@tradetrust-tt/tradetrust-utils/constants/network';
|
|
3
|
+
import '@tradetrust-tt/tradetrust-utils/constants/supportedChains';
|
|
4
|
+
|
|
1
5
|
declare function stringToUint8Array(str: string): Uint8Array;
|
|
2
6
|
declare function generate32ByteKey(input: string): string;
|
|
3
7
|
declare function generate12ByteNonce(input: string): string;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import '@tradetrust-tt/tradetrust-utils';
|
|
2
|
+
import '@tradetrust-tt/tradetrust-utils/constants/network';
|
|
3
|
+
import '@tradetrust-tt/tradetrust-utils/constants/supportedChains';
|
|
4
|
+
|
|
1
5
|
declare function stringToUint8Array(str: string): Uint8Array;
|
|
2
6
|
declare function generate32ByteKey(input: string): string;
|
|
3
7
|
declare function generate12ByteNonce(input: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/supportedChains';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tradetrust-tt/tradetrust-utils/constants/supportedChains';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var supportedChains = require('@tradetrust-tt/tradetrust-utils/constants/supportedChains');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(supportedChains).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return supportedChains[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VerifierType } from './transferableRecordVerifier.types.mjs';
|
|
2
|
-
import '@
|
|
2
|
+
import '@tradetrust-tt/tt-verify';
|
|
3
3
|
|
|
4
4
|
declare const TRANSFERABLE_RECORDS_TYPE = "TransferableRecords";
|
|
5
5
|
declare const credentialStatusTransferableRecordVerifier: VerifierType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VerifierType } from './transferableRecordVerifier.types.js';
|
|
2
|
-
import '@
|
|
2
|
+
import '@tradetrust-tt/tt-verify';
|
|
3
3
|
|
|
4
4
|
declare const TRANSFERABLE_RECORDS_TYPE = "TransferableRecords";
|
|
5
5
|
declare const credentialStatusTransferableRecordVerifier: VerifierType;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var openAttestation = require('@govtechsg/open-attestation');
|
|
3
|
+
var ttVerify = require('@tradetrust-tt/tt-verify');
|
|
5
4
|
var w3cVC = require('@trustvc/w3c-vc');
|
|
6
5
|
var utils = require('./utils');
|
|
7
6
|
|
|
@@ -33,26 +32,23 @@ const name = TRANSFERABLE_RECORDS_TYPE;
|
|
|
33
32
|
const verify = /* @__PURE__ */ __name(async (document, options) => {
|
|
34
33
|
let signedDocument;
|
|
35
34
|
let tokenId;
|
|
36
|
-
if (
|
|
37
|
-
signedDocument = document;
|
|
38
|
-
tokenId = "0x" + signedDocument?.proof?.targetHash;
|
|
39
|
-
} else if (w3cVC__namespace.isSignedDocument(document)) {
|
|
35
|
+
if (w3cVC__namespace.isSignedDocument(document)) {
|
|
40
36
|
signedDocument = document;
|
|
41
37
|
tokenId = "0x" + signedDocument?.credentialStatus?.tokenId;
|
|
42
38
|
}
|
|
43
39
|
const credentialStatus = signedDocument?.credentialStatus;
|
|
44
40
|
if (!credentialStatus?.tokenRegistry) {
|
|
45
|
-
throw new
|
|
41
|
+
throw new ttVerify.CodedError(
|
|
46
42
|
"Document's credentialStatus does not have tokenRegistry",
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
ttVerify.OpenAttestationEthereumTokenRegistryStatusCode.UNRECOGNIZED_DOCUMENT,
|
|
44
|
+
ttVerify.OpenAttestationEthereumTokenRegistryStatusCode[ttVerify.OpenAttestationEthereumTokenRegistryStatusCode.UNRECOGNIZED_DOCUMENT]
|
|
49
45
|
);
|
|
50
46
|
}
|
|
51
47
|
if (!credentialStatus?.tokenNetwork || !credentialStatus?.tokenNetwork?.chainId) {
|
|
52
|
-
throw new
|
|
48
|
+
throw new ttVerify.CodedError(
|
|
53
49
|
"Document's credentialStatus does not have tokenNetwork.chainId",
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
ttVerify.OpenAttestationEthereumTokenRegistryStatusCode.UNRECOGNIZED_DOCUMENT,
|
|
51
|
+
ttVerify.OpenAttestationEthereumTokenRegistryStatusCode[ttVerify.OpenAttestationEthereumTokenRegistryStatusCode.UNRECOGNIZED_DOCUMENT]
|
|
56
52
|
);
|
|
57
53
|
}
|
|
58
54
|
const { provider } = options;
|
|
@@ -69,7 +65,7 @@ const verify = /* @__PURE__ */ __name(async (document, options) => {
|
|
|
69
65
|
tokenRegistry: credentialStatus.tokenRegistry
|
|
70
66
|
}
|
|
71
67
|
};
|
|
72
|
-
if (
|
|
68
|
+
if (ttVerify.ValidTokenRegistryStatus.guard(mintStatus)) {
|
|
73
69
|
result.status = "VALID";
|
|
74
70
|
} else {
|
|
75
71
|
result.reason = mintStatus.reason;
|
|
@@ -82,8 +78,8 @@ const skip = /* @__PURE__ */ __name(async () => {
|
|
|
82
78
|
type,
|
|
83
79
|
name,
|
|
84
80
|
reason: {
|
|
85
|
-
code:
|
|
86
|
-
codeString:
|
|
81
|
+
code: ttVerify.OpenAttestationEthereumTokenRegistryStatusCode.SKIPPED,
|
|
82
|
+
codeString: ttVerify.OpenAttestationEthereumTokenRegistryStatusCode[ttVerify.OpenAttestationEthereumTokenRegistryStatusCode.SKIPPED],
|
|
87
83
|
message: `Document does not have TransferableRecords status`
|
|
88
84
|
}
|
|
89
85
|
};
|
|
@@ -101,7 +97,7 @@ const credentialStatusTransferableRecordVerifier = {
|
|
|
101
97
|
try {
|
|
102
98
|
return await verify(...args);
|
|
103
99
|
} catch (e) {
|
|
104
|
-
if (e instanceof
|
|
100
|
+
if (e instanceof ttVerify.CodedError) {
|
|
105
101
|
const err = {
|
|
106
102
|
name,
|
|
107
103
|
type,
|
|
@@ -119,8 +115,8 @@ const credentialStatusTransferableRecordVerifier = {
|
|
|
119
115
|
type,
|
|
120
116
|
status: "ERROR",
|
|
121
117
|
reason: {
|
|
122
|
-
code:
|
|
123
|
-
codeString:
|
|
118
|
+
code: ttVerify.OpenAttestationEthereumTokenRegistryStatusCode.UNEXPECTED_ERROR,
|
|
119
|
+
codeString: ttVerify.OpenAttestationEthereumTokenRegistryStatusCode[ttVerify.OpenAttestationEthereumTokenRegistryStatusCode.UNEXPECTED_ERROR],
|
|
124
120
|
message: e instanceof Error ? e.message : "An unexpected error occurred"
|
|
125
121
|
}
|
|
126
122
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAttestationEthereumTokenRegistryStatusCode, VerificationFragment, ErrorVerificationFragment, Verifier } from '@
|
|
1
|
+
import { OpenAttestationEthereumTokenRegistryStatusCode, VerificationFragment, ErrorVerificationFragment, Verifier } from '@tradetrust-tt/tt-verify';
|
|
2
2
|
|
|
3
3
|
type TransferableRecordsErrorReason = {
|
|
4
4
|
code: OpenAttestationEthereumTokenRegistryStatusCode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAttestationEthereumTokenRegistryStatusCode, VerificationFragment, ErrorVerificationFragment, Verifier } from '@
|
|
1
|
+
import { OpenAttestationEthereumTokenRegistryStatusCode, VerificationFragment, ErrorVerificationFragment, Verifier } from '@tradetrust-tt/tt-verify';
|
|
2
2
|
|
|
3
3
|
type TransferableRecordsErrorReason = {
|
|
4
4
|
code: OpenAttestationEthereumTokenRegistryStatusCode;
|