ComplianceReporter
SIP Protocol API Reference v0.7.2
SIP Protocol API Reference / ComplianceReporter
Class: ComplianceReporter
Section titled “Class: ComplianceReporter”Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:6982
ComplianceReporter - Generates audit reports from encrypted transactions
Example
Section titled “Example”const reporter = new ComplianceReporter()
const report = await reporter.generateAuditReport({ viewingKey: myViewingKey, transactions: encryptedTransactions, startDate: new Date('2025-01-01'), endDate: new Date('2025-12-31'), format: 'json',})
console.log(`Report contains ${report.summary.transactionCount} transactions`)console.log(`Total volume: ${report.summary.totalVolume}`)Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ComplianceReporter():
ComplianceReporter
Returns
Section titled “Returns”ComplianceReporter
Methods
Section titled “Methods”generateAuditReport()
Section titled “generateAuditReport()”generateAuditReport(
params):Promise<AuditReport>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:6994
Generate an audit report from encrypted transactions
Decrypts transactions using the provided viewing key, filters by date range, and generates a comprehensive report with summary statistics.
Parameters
Section titled “Parameters”params
Section titled “params”Report generation parameters
Returns
Section titled “Returns”Promise<AuditReport>
Audit report with decrypted transactions and statistics
Throws
Section titled “Throws”If parameters are invalid
Throws
Section titled “Throws”If decryption fails
exportToPdf()
Section titled “exportToPdf()”exportToPdf(
report,options?):Uint8Array
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:7039
Export audit report to PDF format
Generates a professionally formatted PDF document from an audit report. Works in both Node.js and browser environments.
Parameters
Section titled “Parameters”report
Section titled “report”The audit report to export
options?
Section titled “options?”PDF export options
Returns
Section titled “Returns”Uint8Array
PDF document as Uint8Array
Example
Section titled “Example”const reporter = new ComplianceReporter()const report = await reporter.generateAuditReport({...})
const pdfBytes = reporter.exportToPdf(report, { title: 'Q1 2025 Audit Report', organization: 'ACME Corp',})
// Save to file (Node.js)fs.writeFileSync('report.pdf', pdfBytes)exportForRegulator()
Section titled “exportForRegulator()”exportForRegulator(
params):Promise<RegulatoryExport>
Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:7083
Export transactions to regulatory compliance formats
Decrypts and exports transactions in formats required by regulators:
- FATF: Financial Action Task Force Travel Rule format
- FINCEN: FinCEN Suspicious Activity Report (SAR) format
- CSV: Generic comma-separated values format
Parameters
Section titled “Parameters”params
Section titled “params”Export parameters
Returns
Section titled “Returns”Promise<RegulatoryExport>
Regulatory export in the specified format
Throws
Section titled “Throws”If parameters are invalid
Throws
Section titled “Throws”If decryption fails
Example
Section titled “Example”const reporter = new ComplianceReporter()
// FATF Travel Rule exportconst fatfExport = await reporter.exportForRegulator({ viewingKey: myViewingKey, transactions: encryptedTxs, jurisdiction: 'EU', format: 'FATF', currency: 'EUR',})
// FINCEN SAR export (US only)const fincenExport = await reporter.exportForRegulator({ viewingKey: myViewingKey, transactions: suspiciousTxs, jurisdiction: 'US', format: 'FINCEN',})
// CSV exportconst csvExport = await reporter.exportForRegulator({ viewingKey: myViewingKey, transactions: encryptedTxs, jurisdiction: 'SG', format: 'CSV',})