Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
fix: remove wrappedV2 and wrappedV3 document methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MinHtet-O committed May 24, 2024
1 parent 4d75ee4 commit f12feef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Replace `<your_wallet_address>` and `<your_private_key>` with your actual wallet

```ts
import {
wrapDocumentV2,
wrapDocumentsV2,
signDocument,
isSignedWrappedV2Document,
SUPPORTED_SIGNING_ALGORITHM,
Expand All @@ -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,
Expand All @@ -37,7 +39,7 @@ async function start() {
private: '<your_private_key>',
}
)
// check is the document has already wrapped and signed
// check if the document has already wrapped and signed
console.log(isSignedWrappedV2Document(signedDocument))
}

Expand Down Expand Up @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions src/tradetrust/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,9 +28,7 @@ export {
getDataV2,
isSchemaValidationError,
wrapDocumentsV2,
wrapDocumentV2,
wrapDocumentsV3,
wrapDocumentV3,
v2,
v3,
SchemaId,
Expand Down

0 comments on commit f12feef

Please sign in to comment.