From f12feefa1bb2716cacaa29298b27ea0db671dab9 Mon Sep 17 00:00:00 2001 From: Min Htet Oo Date: Fri, 24 May 2024 10:55:30 +0800 Subject: [PATCH] fix: remove wrappedV2 and wrappedV3 document methods --- README.md | 16 +++++++++------- src/tradetrust/index.ts | 4 ---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index aa7ffd1..ec94981 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Replace `` and `` with your actual wallet ```ts import { - wrapDocumentV2, + wrapDocumentsV2, signDocument, isSignedWrappedV2Document, SUPPORTED_SIGNING_ALGORITHM, @@ -28,7 +28,9 @@ const document = { } as any async function start() { - const wrappedDocument = wrapDocumentV2(document) + const wrappedDocuments = wrapDocumentsV2([document]) + const wrappedDocument = wrappedDocuments[0] + const signedDocument = await signDocument( wrappedDocument, SUPPORTED_SIGNING_ALGORITHM.Secp256k1VerificationKey2018, @@ -37,7 +39,7 @@ async function start() { private: '', } ) - // check is the document has already wrapped and signed + // check if the document has already wrapped and signed console.log(isSignedWrappedV2Document(signedDocument)) } @@ -93,14 +95,14 @@ tradetrust-core provides the following methods for document verification and val It generates receives provider options and returns the ethereum JSON RPC provider to be used for [verify](#verify) method. -#### `wrapDocumentV2` - -It takes in a Tradetrust v2 document and returns the wrapped document. - #### `wrapDocumentsV2` It takes in array of Tradetrust v2 documents and returns the wrapped documents. +#### `wrapDocumentsV3` + +It takes in array of Tradetrust v3 documents and returns the wrapped documents. + #### `obfuscateDocument` It removes a key-value pair from the document's data section, without causing the file hash to change. This can be used to generate a new document containing a subset of the original data, yet allow the recipient to proof the provenance of the document. diff --git a/src/tradetrust/index.ts b/src/tradetrust/index.ts index b670928..e7f95d1 100644 --- a/src/tradetrust/index.ts +++ b/src/tradetrust/index.ts @@ -14,9 +14,7 @@ import { getData as getDataV2, isSchemaValidationError, wrapDocuments as wrapDocumentsV2, - wrapDocument as wrapDocumentV2, __unsafe__use__it__at__your__own__risks__wrapDocuments as wrapDocumentsV3, - __unsafe__use__it__at__your__own__risks__wrapDocument as wrapDocumentV3, } from '@tradetrust-tt/tradetrust' // Re-export everything @@ -30,9 +28,7 @@ export { getDataV2, isSchemaValidationError, wrapDocumentsV2, - wrapDocumentV2, wrapDocumentsV3, - wrapDocumentV3, v2, v3, SchemaId,