From 05a8bb6f7ba0d1c14459193f872255d6afce638d Mon Sep 17 00:00:00 2001 From: manishdex25 Date: Fri, 10 Jul 2026 19:33:29 +0530 Subject: [PATCH] feat: add Bill of Exchange context and sample - Added Bill of Exchange context JSON schema to the project. - Introduced a sample JSON file for the Bill of Exchange credential. - Updated README to include the new Bill of Exchange context URL. --- packages/w3c-context/README.md | 1 + .../samples/bill-of-exchange.sample.json | 59 +++++++++++ .../src/context/bill-of-exchange.json | 100 ++++++++++++++++++ packages/w3c-context/src/lib/index.ts | 3 + 4 files changed, 163 insertions(+) create mode 100644 packages/w3c-context/samples/bill-of-exchange.sample.json create mode 100644 packages/w3c-context/src/context/bill-of-exchange.json diff --git a/packages/w3c-context/README.md b/packages/w3c-context/README.md index e7e390a..ccb407b 100644 --- a/packages/w3c-context/README.md +++ b/packages/w3c-context/README.md @@ -73,6 +73,7 @@ The package includes the following pre-cached contexts: - `https://trustvc.io/context/attachments-context.json` - Attachments - `https://trustvc.io/context/qrcode-context.json` - QR Code - `https://trustvc.io/context/opencerts-context.json` - OpenCerts Certificate +- `https://trustvc.io/context/bill-of-exchange.json` - Bill of Exchange - `https://trustvc.io/context/bill-of-lading.json` - Bill of Lading - `https://trustvc.io/context/bill-of-lading-carrier.json` - Bill of Lading Carrier - `https://trustvc.io/context/coo.json` - Certificate of Origin diff --git a/packages/w3c-context/samples/bill-of-exchange.sample.json b/packages/w3c-context/samples/bill-of-exchange.sample.json new file mode 100644 index 0000000..c456d53 --- /dev/null +++ b/packages/w3c-context/samples/bill-of-exchange.sample.json @@ -0,0 +1,59 @@ +{ + "@context": [ + "https://www.w3.org/ns/credentials/v2", + "https://w3id.org/security/data-integrity/v2", + "https://trustvc.io/context/render-method-context-v2.json", + "https://trustvc.io/context/bill-of-exchange.json", + "https://trustvc.io/context/transferable-records-context.json", + "https://trustvc.io/context/qrcode-context.json" + ], + "renderMethod": [ + { + "type": "EMBEDDED_RENDERER", + "templateName": "BILL_OF_EXCHANGE", + "id": "https://generic-templates.tradetrust.io" + } + ], + "credentialSubject": { + "boeNumber": "BOE-2026-00147", + "placeOfIssue": "Singapore", + "dateOfIssue": "2026-07-01", + "tenor": "90 days after sight", + "drawerCompanyName": "Meridian Commodities Pte Ltd", + "drawerCompanyNo": "UEN-202312345A", + "drawerJurisdiction": "Singapore", + "drawerAddress": "8 Marina Boulevard, #24-01, Singapore 018981", + "drawerEmail": "trade.finance@meridiancommodities.com", + "drawerWalletAddress": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", + "draweeCompanyName": "Fairview Industries Inc.", + "draweeCompanyNo": "EIN-84-1923456", + "draweeJurisdiction": "Delaware, United States", + "draweeAddress": "1201 Market Street, Suite 900, Wilmington, DE 19801, USA", + "draweeEmail": "accounts.payable@fairviewindustries.com", + "draweeWalletAddress": "0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199", + "payeeCompanyName": "Meridian Commodities Pte Ltd", + "payeeWalletAddress": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", + "dueDate": "2026-09-29", + "currency": "USD", + "amount": "128,500.00", + "amountInWords": "One hundred twenty-eight thousand five hundred United States Dollars only", + "clause": "Pay against this Bill of Exchange, on the tenor stated above, to the order of the Payee the sum stated, value received, without set-off, deduction or counterclaim, for goods shipped under Invoice No. INV-2026-0456 and Bill of Lading No. BL-SIN-2026-0781.", + "signerName": "Wei Ling Tan", + "signerPosition": "Director of Trade Finance", + "signerEmail": "wl.tan@meridiancommodities.com", + "signerTimeStamp": "2026-07-01" + }, + "type": [ + "VerifiableCredential" + ], + "credentialStatus": { + "type": "TransferableRecords", + "tokenNetwork": { + "chain": "Sepolia", + "chainId": 11155111 + }, + "tokenRegistry": "0x9A2B1e4C8f3D5a6B7c8D9E0F1A2B3C4D5E6F7A8B" + }, + "issuer": "did:web:trustvc.github.io:did:1", + "validFrom": "2026-07-01T09:00:00Z" +} diff --git a/packages/w3c-context/src/context/bill-of-exchange.json b/packages/w3c-context/src/context/bill-of-exchange.json new file mode 100644 index 0000000..7458308 --- /dev/null +++ b/packages/w3c-context/src/context/bill-of-exchange.json @@ -0,0 +1,100 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "BillOfExchange": { + "@id": "https://example.com/terms#BillOfExchange", + "@type": "@id", + "@context": { + "@protected": true, + "logo": { + "@id": "https://example.com/terms#logo" + }, + "backgroundImage": { + "@id": "https://example.com/terms#backgroundImage" + }, + "boeNumber": { + "@id": "https://example.com/terms#boeNumber" + }, + "placeOfIssue": { + "@id": "https://example.com/terms#placeOfIssue" + }, + "dateOfIssue": { + "@id": "https://example.com/terms#dateOfIssue" + }, + "tenor": { + "@id": "https://example.com/terms#tenor" + }, + "drawerCompanyName": { + "@id": "https://example.com/terms#drawerCompanyName" + }, + "drawerCompanyNo": { + "@id": "https://example.com/terms#drawerCompanyNo" + }, + "drawerJurisdiction": { + "@id": "https://example.com/terms#drawerJurisdiction" + }, + "drawerAddress": { + "@id": "https://example.com/terms#drawerAddress" + }, + "drawerEmail": { + "@id": "https://example.com/terms#drawerEmail" + }, + "drawerWalletAddress": { + "@id": "https://example.com/terms#drawerWalletAddress" + }, + "draweeCompanyName": { + "@id": "https://example.com/terms#draweeCompanyName" + }, + "draweeCompanyNo": { + "@id": "https://example.com/terms#draweeCompanyNo" + }, + "draweeJurisdiction": { + "@id": "https://example.com/terms#draweeJurisdiction" + }, + "draweeAddress": { + "@id": "https://example.com/terms#draweeAddress" + }, + "draweeEmail": { + "@id": "https://example.com/terms#draweeEmail" + }, + "draweeWalletAddress": { + "@id": "https://example.com/terms#draweeWalletAddress" + }, + "payeeCompanyName": { + "@id": "https://example.com/terms#payeeCompanyName" + }, + "payeeWalletAddress": { + "@id": "https://example.com/terms#payeeWalletAddress" + }, + "dueDate": { + "@id": "https://example.com/terms#dueDate" + }, + "currency": { + "@id": "https://example.com/terms#currency" + }, + "amount": { + "@id": "https://example.com/terms#amount" + }, + "amountInWords": { + "@id": "https://example.com/terms#amountInWords" + }, + "clause": { + "@id": "https://example.com/terms#clause" + }, + "signerName": { + "@id": "https://example.com/terms#signerName" + }, + "signerPosition": { + "@id": "https://example.com/terms#signerPosition" + }, + "signerEmail": { + "@id": "https://example.com/terms#signerEmail" + }, + "signerTimeStamp": { + "@id": "https://example.com/terms#signerTimeStamp" + } + } + } + } +} diff --git a/packages/w3c-context/src/lib/index.ts b/packages/w3c-context/src/lib/index.ts index aabc8a9..ddf504a 100644 --- a/packages/w3c-context/src/lib/index.ts +++ b/packages/w3c-context/src/lib/index.ts @@ -4,6 +4,7 @@ import { DocumentLoader, DocumentLoaderObject } from './types'; import jsonldSignatures from 'jsonld-signatures'; import attachmentsContext from '../context/attachments-context.json'; import bbsV1 from '../context/bbs-v1.json'; +import boeContext from '../context/bill-of-exchange.json'; import bolContext from '../context/bill-of-lading.json'; import bolcContext from '../context/bill-of-lading-carrier.json'; import cooContext from '../context/coo.json'; @@ -41,6 +42,7 @@ export const ATTACHMENTS_CONTEXT_URL = 'https://trustvc.io/context/attachments-c export const QRCODE_CONTEXT_URL = 'https://trustvc.io/context/qrcode-context.json'; export const OPENCERTS_CONTEXT_URL = 'https://trustvc.io/context/opencerts-context.json'; +export const BOE_CONTEXT_URL = 'https://trustvc.io/context/bill-of-exchange.json'; export const BOL_CONTEXT_URL = 'https://trustvc.io/context/bill-of-lading.json'; export const BOLC_CONTEXT_URL = 'https://trustvc.io/context/bill-of-lading-carrier.json'; export const COO_CONTEXT_URL = 'https://trustvc.io/context/coo.json'; @@ -81,6 +83,7 @@ export const qrCodeContexts: { [key: string]: Document } = { }; export const templateContexts: { [key: string]: Document } = { + [BOE_CONTEXT_URL]: boeContext, [BOL_CONTEXT_URL]: bolContext, [BOLC_CONTEXT_URL]: bolcContext, [COO_CONTEXT_URL]: cooContext,