neozipkit 0.1.1 → 0.3.0
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/LICENSE +22 -0
- package/README.md +371 -200
- package/contracts/ABI.txt +889 -0
- package/contracts/Bytecode.txt +1 -0
- package/contracts/COMPILATION_NOTES.md +59 -0
- package/contracts/QUICK_DEPLOY.md +286 -0
- package/contracts/README.md +256 -0
- package/contracts/VERIFICATION.md +308 -0
- package/contracts/deploy-interactive.js +448 -0
- package/contracts/deployment-arbitrum-sepolia.json +12 -0
- package/contracts/deployment-arbitrum.json +12 -0
- package/contracts/deployment-eth-sepolia.json +12 -0
- package/contracts/hardhat.config.js +114 -0
- package/contracts/package.json +20 -0
- package/contracts/scripts/compile-and-extract.js +119 -0
- package/contracts/scripts/verify-contract.js +223 -0
- package/contracts/src/{NZIP-NFT-Private.sol → NZIP-NFT-v2.0.sol} +66 -151
- package/contracts/src/NZIP-NFT.sol +9 -15
- package/dist/{browser → blockchain/browser}/TokenVerifierBrowser.d.ts +11 -20
- package/dist/blockchain/browser/TokenVerifierBrowser.d.ts.map +1 -0
- package/dist/{browser → blockchain/browser}/TokenVerifierBrowser.js +106 -92
- package/dist/blockchain/browser/TokenVerifierBrowser.js.map +1 -0
- package/dist/blockchain/browser/WalletManagerBrowser.d.ts +98 -0
- package/dist/blockchain/browser/WalletManagerBrowser.d.ts.map +1 -0
- package/dist/blockchain/browser/WalletManagerBrowser.js +434 -0
- package/dist/blockchain/browser/WalletManagerBrowser.js.map +1 -0
- package/dist/blockchain/browser/ZipkitMinterBrowser.d.ts +58 -0
- package/dist/blockchain/browser/ZipkitMinterBrowser.d.ts.map +1 -0
- package/dist/blockchain/browser/ZipkitMinterBrowser.js +317 -0
- package/dist/blockchain/browser/ZipkitMinterBrowser.js.map +1 -0
- package/dist/blockchain/browser/index.d.ts +11 -0
- package/dist/blockchain/browser/index.d.ts.map +1 -0
- package/dist/blockchain/browser/index.js +16 -0
- package/dist/blockchain/browser/index.js.map +1 -0
- package/dist/{server/blockchain/WalletAnalyzer.d.ts → blockchain/core/WalletManager.d.ts} +69 -26
- package/dist/blockchain/core/WalletManager.d.ts.map +1 -0
- package/dist/{server/blockchain/WalletAnalyzer.js → blockchain/core/WalletManager.js} +172 -160
- package/dist/blockchain/core/WalletManager.js.map +1 -0
- package/dist/blockchain/core/ZipkitMinter.d.ts +141 -0
- package/dist/blockchain/core/ZipkitMinter.d.ts.map +1 -0
- package/dist/blockchain/core/ZipkitMinter.js +548 -0
- package/dist/blockchain/core/ZipkitMinter.js.map +1 -0
- package/dist/blockchain/core/ZipkitOTS.d.ts +126 -0
- package/dist/blockchain/core/ZipkitOTS.d.ts.map +1 -0
- package/dist/blockchain/core/ZipkitOTS.js +506 -0
- package/dist/blockchain/core/ZipkitOTS.js.map +1 -0
- package/dist/blockchain/core/ZipkitVerifier.d.ts +177 -0
- package/dist/blockchain/core/ZipkitVerifier.d.ts.map +1 -0
- package/dist/blockchain/core/ZipkitVerifier.js +632 -0
- package/dist/blockchain/core/ZipkitVerifier.js.map +1 -0
- package/dist/blockchain/core/contracts.d.ts +83 -0
- package/dist/blockchain/core/contracts.d.ts.map +1 -0
- package/dist/blockchain/core/contracts.js +341 -0
- package/dist/blockchain/core/contracts.js.map +1 -0
- package/dist/blockchain/core/index.d.ts +12 -0
- package/dist/blockchain/core/index.d.ts.map +1 -0
- package/dist/blockchain/core/index.js +59 -0
- package/dist/blockchain/core/index.js.map +1 -0
- package/dist/blockchain/index.d.ts +11 -0
- package/dist/blockchain/index.d.ts.map +1 -0
- package/dist/blockchain/index.js +34 -0
- package/dist/blockchain/index.js.map +1 -0
- package/dist/blockchain/node/WalletManagerNode.d.ts +47 -0
- package/dist/blockchain/node/WalletManagerNode.d.ts.map +1 -0
- package/dist/blockchain/node/WalletManagerNode.js +203 -0
- package/dist/blockchain/node/WalletManagerNode.js.map +1 -0
- package/dist/blockchain/node/index.d.ts +12 -0
- package/dist/blockchain/node/index.d.ts.map +1 -0
- package/dist/blockchain/node/index.js +24 -0
- package/dist/blockchain/node/index.js.map +1 -0
- package/dist/browser/ZipkitBrowser.d.ts +27 -0
- package/dist/browser/ZipkitBrowser.d.ts.map +1 -0
- package/dist/browser/{ZipKitBrowser.js → ZipkitBrowser.js} +96 -43
- package/dist/browser/ZipkitBrowser.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +42 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser-esm/index.d.ts +12 -0
- package/dist/browser-esm/index.js +59559 -0
- package/dist/browser-esm/index.js.map +7 -0
- package/dist/browser-umd/index.d.ts +12 -0
- package/dist/browser-umd/index.js +59576 -0
- package/dist/browser-umd/index.js.map +7 -0
- package/dist/browser-umd/index.min.js +63 -0
- package/dist/browser.d.ts +8 -17
- package/dist/browser.js +13 -29
- package/dist/core/ZipCompress.d.ts +99 -0
- package/dist/core/ZipCompress.d.ts.map +1 -0
- package/dist/core/ZipCompress.js +309 -0
- package/dist/core/ZipCompress.js.map +1 -0
- package/dist/core/ZipDecompress.d.ts +58 -0
- package/dist/core/ZipDecompress.d.ts.map +1 -0
- package/dist/core/ZipDecompress.js +172 -0
- package/dist/core/ZipDecompress.js.map +1 -0
- package/dist/{shared → core}/ZipEntry.d.ts +8 -1
- package/dist/core/ZipEntry.d.ts.map +1 -0
- package/dist/{shared → core}/ZipEntry.js +224 -81
- package/dist/core/ZipEntry.js.map +1 -0
- package/dist/core/Zipkit.d.ts +315 -0
- package/dist/core/Zipkit.d.ts.map +1 -0
- package/dist/core/Zipkit.js +647 -0
- package/dist/core/Zipkit.js.map +1 -0
- package/dist/core/components/HashCalculator.d.ts +138 -0
- package/dist/core/components/HashCalculator.d.ts.map +1 -0
- package/dist/core/components/HashCalculator.js +360 -0
- package/dist/core/components/HashCalculator.js.map +1 -0
- package/dist/core/components/Logger.d.ts +73 -0
- package/dist/core/components/Logger.d.ts.map +1 -0
- package/dist/core/components/Logger.js +156 -0
- package/dist/core/components/Logger.js.map +1 -0
- package/dist/core/components/ProgressTracker.d.ts +43 -0
- package/dist/core/components/ProgressTracker.d.ts.map +1 -0
- package/dist/core/components/ProgressTracker.js +112 -0
- package/dist/core/components/ProgressTracker.js.map +1 -0
- package/dist/{shared → core}/components/Support.d.ts +1 -0
- package/dist/core/components/Support.d.ts.map +1 -0
- package/dist/{shared → core}/components/Support.js +1 -0
- package/dist/core/components/Support.js.map +1 -0
- package/dist/{shared → core}/components/Util.d.ts +7 -2
- package/dist/core/components/Util.d.ts.map +1 -0
- package/dist/{shared → core}/components/Util.js +14 -34
- package/dist/core/components/Util.js.map +1 -0
- package/dist/{shared → core}/constants/Errors.d.ts +1 -2
- package/dist/core/constants/Errors.d.ts.map +1 -0
- package/dist/{shared → core}/constants/Errors.js +1 -3
- package/dist/core/constants/Errors.js.map +1 -0
- package/dist/{shared → core}/constants/Headers.d.ts +3 -0
- package/dist/core/constants/Headers.d.ts.map +1 -0
- package/dist/{shared → core}/constants/Headers.js +20 -17
- package/dist/core/constants/Headers.js.map +1 -0
- package/dist/core/encryption/Manager.d.ts +58 -0
- package/dist/core/encryption/Manager.d.ts.map +1 -0
- package/dist/core/encryption/Manager.js +121 -0
- package/dist/core/encryption/Manager.js.map +1 -0
- package/dist/core/encryption/ZipCrypto.d.ts +172 -0
- package/dist/core/encryption/ZipCrypto.d.ts.map +1 -0
- package/dist/core/encryption/ZipCrypto.js +554 -0
- package/dist/core/encryption/ZipCrypto.js.map +1 -0
- package/dist/core/encryption/index.d.ts +9 -0
- package/dist/core/encryption/index.d.ts.map +1 -0
- package/dist/core/encryption/index.js +17 -0
- package/dist/core/encryption/index.js.map +1 -0
- package/dist/core/encryption/types.d.ts +29 -0
- package/dist/core/encryption/types.d.ts.map +1 -0
- package/dist/core/encryption/types.js +12 -0
- package/dist/core/encryption/types.js.map +1 -0
- package/dist/core/index.d.ts +24 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +57 -0
- package/dist/core/index.js.map +1 -0
- package/dist/{shared → core}/version.d.ts +1 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +31 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.d.ts +8 -25
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -47
- package/dist/index.js.map +1 -0
- package/dist/node/ZipCompressNode.d.ts +123 -0
- package/dist/node/ZipCompressNode.d.ts.map +1 -0
- package/dist/node/ZipCompressNode.js +576 -0
- package/dist/node/ZipCompressNode.js.map +1 -0
- package/dist/node/ZipDecompressNode.d.ts +120 -0
- package/dist/node/ZipDecompressNode.d.ts.map +1 -0
- package/dist/node/ZipDecompressNode.js +461 -0
- package/dist/node/ZipDecompressNode.js.map +1 -0
- package/dist/node/ZipkitNode.d.ts +406 -0
- package/dist/node/ZipkitNode.d.ts.map +1 -0
- package/dist/node/ZipkitNode.js +1305 -0
- package/dist/node/ZipkitNode.js.map +1 -0
- package/dist/node/index.d.ts +26 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +65 -0
- package/dist/node/index.js.map +1 -0
- package/dist/types/index.d.ts +59 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +36 -1
- package/dist/types/index.js.map +1 -0
- package/examples/README.md +269 -0
- package/examples/blockchain-tokenize.ts +354 -0
- package/examples/create-zip.ts +172 -0
- package/examples/extract-zip.ts +158 -0
- package/examples/list-zip.ts +161 -0
- package/examples/test-files/data.json +116 -0
- package/examples/test-files/document.md +80 -0
- package/examples/test-files/document.txt +2 -0
- package/examples/test-files/file1.txt +48 -0
- package/examples/test-files/file2.txt +80 -0
- package/examples/tsconfig.json +44 -0
- package/examples/unzip-token.ts +6 -3
- package/examples/verify-tokenized-zip.ts +305 -0
- package/package.json +117 -23
- package/src/blockchain/README.md +222 -0
- package/src/{browser → blockchain/browser}/TokenVerifierBrowser.ts +125 -79
- package/src/blockchain/browser/WalletManagerBrowser.ts +486 -0
- package/src/blockchain/browser/ZipkitMinterBrowser.ts +400 -0
- package/src/blockchain/browser/index.ts +13 -0
- package/src/blockchain/core/WalletManager.ts +436 -0
- package/src/blockchain/core/ZipkitMinter.ts +716 -0
- package/src/blockchain/core/ZipkitOTS.ts +588 -0
- package/src/blockchain/core/ZipkitVerifier.ts +853 -0
- package/src/blockchain/core/contracts.ts +370 -0
- package/src/blockchain/core/index.ts +71 -0
- package/src/blockchain/index.ts +27 -0
- package/src/blockchain/node/WalletManagerNode.ts +171 -0
- package/src/blockchain/node/index.ts +40 -0
- package/src/browser/{ZipKitBrowser.ts → ZipkitBrowser.ts} +104 -41
- package/src/browser/index.esm.ts +37 -0
- package/src/browser/index.ts +25 -0
- package/src/core/ZipCompress.ts +398 -0
- package/src/core/ZipDecompress.ts +212 -0
- package/src/{shared → core}/ZipEntry.ts +239 -89
- package/src/core/Zipkit.ts +794 -0
- package/src/core/components/HashCalculator.ts +384 -0
- package/src/core/components/Logger.ts +180 -0
- package/src/core/components/ProgressTracker.ts +134 -0
- package/src/{shared → core}/components/Util.ts +12 -34
- package/src/{shared → core}/constants/Errors.ts +0 -4
- package/src/{shared → core}/constants/Headers.ts +19 -17
- package/src/core/encryption/Manager.ts +137 -0
- package/src/core/encryption/ZipCrypto.ts +650 -0
- package/src/core/encryption/index.ts +15 -0
- package/src/core/encryption/types.ts +33 -0
- package/src/core/index.ts +34 -0
- package/src/core/version.ts +33 -0
- package/src/index.ts +54 -32
- package/src/node/ZipCompressNode.ts +632 -0
- package/src/node/ZipDecompressNode.ts +508 -0
- package/src/node/ZipkitNode.ts +1559 -0
- package/src/node/index.ts +69 -0
- package/src/types/index.ts +131 -1
- package/src/types/opentimestamps.d.ts +1 -23
- package/contracts/Lock.sol +0 -34
- package/contracts/bytecode.txt +0 -1
- package/contracts/compile-contract.js +0 -168
- package/contracts/deploy/deploy-both-contracts.js +0 -286
- package/contracts/deploy/deploy-enhanced-contract.js +0 -197
- package/contracts/deploy/deploy-private-contract.js +0 -190
- package/contracts/deploy/deploy-public-clean.js +0 -1063
- package/contracts/deploy/deploy-public-contract.js +0 -1107
- package/contracts/deployment.config.example.js +0 -25
- package/contracts/remix-compile.js +0 -222
- package/contracts/setup-deployment.js +0 -51
- package/contracts/src/ZipFileNFT-DEPRECATED-6field.sol +0 -260
- package/contracts/src/ZipFileNFT-DEPRECATED-Enhanced.sol +0 -289
- package/dist/browser/CertificateGeneratorBrowser.d.ts +0 -75
- package/dist/browser/CertificateGeneratorBrowser.js +0 -433
- package/dist/browser/ZipKitBrowser.d.ts +0 -18
- package/dist/browser/ZipKitStampBrowser.d.ts +0 -2
- package/dist/browser/ZipKitStampBrowser.js +0 -12
- package/dist/browser-index.d.ts +0 -21
- package/dist/browser-index.js +0 -58
- package/dist/server/blockchain/CertificateToken.d.ts +0 -48
- package/dist/server/blockchain/CertificateToken.js +0 -386
- package/dist/server/blockchain/NFTMinter.d.ts +0 -41
- package/dist/server/blockchain/NFTMinter.js +0 -323
- package/dist/server/blockchain/TokenQuerier.d.ts +0 -31
- package/dist/server/blockchain/TokenQuerier.js +0 -259
- package/dist/server/blockchain/TokenVerifier.d.ts +0 -20
- package/dist/server/blockchain/TokenVerifier.js +0 -395
- package/dist/server/blockchain/WalletFormatter.d.ts +0 -39
- package/dist/server/blockchain/WalletFormatter.js +0 -196
- package/dist/server/blockchain/WalletManager.d.ts +0 -46
- package/dist/server/blockchain/WalletManager.js +0 -294
- package/dist/server/blockchain/ZipMetadata.d.ts +0 -27
- package/dist/server/blockchain/ZipMetadata.js +0 -131
- package/dist/server/blockchain/ZipTokenProcessor.d.ts +0 -44
- package/dist/server/blockchain/ZipTokenProcessor.js +0 -204
- package/dist/server/blockchain/constants.d.ts +0 -102
- package/dist/server/blockchain/constants.js +0 -968
- package/dist/server/blockchain/index.d.ts +0 -9
- package/dist/server/blockchain/index.js +0 -44
- package/dist/server/blockchain/test-certificate.d.ts +0 -8
- package/dist/server/blockchain/test-certificate.js +0 -100
- package/dist/server/blockchain/types.d.ts +0 -69
- package/dist/server/blockchain/types.js +0 -51
- package/dist/server/platform/server/ZipKitServer.d.ts +0 -105
- package/dist/server/platform/server/ZipKitServer.js +0 -437
- package/dist/server/platform/servercomponents/ZipKitOTS.d.ts +0 -91
- package/dist/server/platform/servercomponents/ZipKitOTS.js +0 -271
- package/dist/shared/ZipKit.d.ts +0 -249
- package/dist/shared/ZipKit.js +0 -789
- package/dist/shared/components/CertificateOTS.d.ts +0 -15
- package/dist/shared/components/CertificateOTS.js +0 -116
- package/dist/shared/components/FileSys.d.ts +0 -2
- package/dist/shared/components/FileSys.js +0 -113
- package/dist/shared/components/HashAccumulator.d.ts +0 -55
- package/dist/shared/components/HashAccumulator.js +0 -100
- package/dist/shared/components/ZipCrypto.d.ts +0 -3
- package/dist/shared/components/ZipCrypto.js +0 -78
- package/dist/shared/components/merkleTree.d.ts +0 -66
- package/dist/shared/components/merkleTree.js +0 -136
- package/dist/shared/types/index.d.ts +0 -21
- package/dist/shared/types/index.js +0 -3
- package/dist/shared/types.d.ts +0 -33
- package/dist/shared/types.js +0 -8
- package/dist/shared/version.js +0 -7
- package/src/browser/CertificateGeneratorBrowser.ts +0 -498
- package/src/browser/ZipKitStampBrowser.ts +0 -9
- package/src/browser-index.ts +0 -36
- package/src/server/blockchain/CertificateToken.ts +0 -444
- package/src/server/blockchain/NFTMinter.ts +0 -357
- package/src/server/blockchain/TokenQuerier.ts +0 -287
- package/src/server/blockchain/TokenVerifier.ts +0 -453
- package/src/server/blockchain/WalletAnalyzer.ts +0 -397
- package/src/server/blockchain/WalletFormatter.ts +0 -206
- package/src/server/blockchain/WalletManager.ts +0 -294
- package/src/server/blockchain/ZipMetadata.ts +0 -117
- package/src/server/blockchain/ZipTokenProcessor.ts +0 -234
- package/src/server/blockchain/constants.ts +0 -969
- package/src/server/blockchain/index.ts +0 -42
- package/src/server/blockchain/test-certificate.ts +0 -137
- package/src/server/blockchain/types.ts +0 -134
- package/src/server/platform/server/ZipKitServer.ts +0 -459
- package/src/server/platform/servercomponents/ZipKitOTS.ts +0 -313
- package/src/server/platform/servercomponents/opentimestamps.d.ts +0 -23
- package/src/shared/ZipKit.ts +0 -899
- package/src/shared/components/CertificateOTS.ts +0 -132
- package/src/shared/components/FileSys.ts +0 -87
- package/src/shared/components/HashAccumulator.ts +0 -113
- package/src/shared/components/ZipCrypto.ts +0 -91
- package/src/shared/components/merkleTree.ts +0 -162
- package/src/shared/types/index.ts +0 -25
- package/src/shared/types/modules.d.ts +0 -22
- package/src/shared/types/opentimestamps.d.ts +0 -23
- package/src/shared/types.d.ts +0 -8
- package/src/shared/types.ts +0 -43
- package/src/shared/version.ts +0 -4
- /package/src/{shared → core}/components/Support.ts +0 -0
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// ======================================
|
|
3
|
-
// CertificateGeneratorBrowser.ts
|
|
4
|
-
// Browser-compatible certificate generator for tokenized ZIP files
|
|
5
|
-
// Copyright (c) 2025 NeoWare, Inc. All rights reserved.
|
|
6
|
-
// ======================================
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.CertificateGeneratorBrowser = void 0;
|
|
9
|
-
exports.createCertificateGenerator = createCertificateGenerator;
|
|
10
|
-
exports.generateTokenCertificate = generateTokenCertificate;
|
|
11
|
-
const Headers_1 = require("../shared/constants/Headers");
|
|
12
|
-
/**
|
|
13
|
-
* Browser-compatible certificate generator class
|
|
14
|
-
*/
|
|
15
|
-
class CertificateGeneratorBrowser {
|
|
16
|
-
/**
|
|
17
|
-
* Generates a certificate HTML document for tokenized ZIP files
|
|
18
|
-
*/
|
|
19
|
-
createTokenCertificate(tokenInfo, zipFile, blockchainVerification, walletInfo, zipFiles, options) {
|
|
20
|
-
// Generate token information HTML
|
|
21
|
-
const tokenHTML = this.generateTokenSection(tokenInfo);
|
|
22
|
-
// Generate blockchain verification HTML
|
|
23
|
-
const verificationHTML = this.generateVerificationSection(blockchainVerification);
|
|
24
|
-
// Generate wallet information HTML
|
|
25
|
-
const walletHTML = walletInfo ? this.generateWalletSection(walletInfo) : '';
|
|
26
|
-
// Generate files table HTML
|
|
27
|
-
const filesTableHTML = zipFiles ? this.generateFilesTable(zipFiles) : '';
|
|
28
|
-
// Get the complete HTML template
|
|
29
|
-
const htmlTemplate = this.getCertificateTemplate();
|
|
30
|
-
// Create the complete attestation HTML combining all sections
|
|
31
|
-
const attestHTML = tokenHTML + verificationHTML + walletHTML;
|
|
32
|
-
// Replace placeholders in the template
|
|
33
|
-
const html = htmlTemplate
|
|
34
|
-
.replace(/{{ATTEST_STR}}/g, `NFT Token Certificate for ${zipFile}`)
|
|
35
|
-
.replace(/{{UPDATE_WARNING}}/g, blockchainVerification.verificationStatus === 'FAILED' ?
|
|
36
|
-
'<div class="warning">⚠️ Warning: Blockchain verification failed. This archive may have been tampered with.</div>' : '')
|
|
37
|
-
.replace(/{{ZIP_FILE}}/g, zipFile)
|
|
38
|
-
.replace(/{{HASH_DIGEST}}/g, blockchainVerification.calculatedMerkleRoot)
|
|
39
|
-
.replace(/{{ATTESTATION_HTML}}/g, attestHTML)
|
|
40
|
-
.replace(/{{FILES_TABLE_HTML}}/g, filesTableHTML)
|
|
41
|
-
.replace(/{{GENERATION_TIME}}/g, new Date().toUTCString());
|
|
42
|
-
return html;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Saves a certificate as a downloadable file (browser-compatible)
|
|
46
|
-
*/
|
|
47
|
-
saveCertificate(fileName, certificateHTML) {
|
|
48
|
-
const baseName = fileName.replace(/\.zip$/i, '');
|
|
49
|
-
const certFileName = `${baseName}.token-certificate.html`;
|
|
50
|
-
// Create a blob with the HTML content
|
|
51
|
-
const blob = new Blob([certificateHTML], { type: 'text/html' });
|
|
52
|
-
// Create a download link
|
|
53
|
-
const url = URL.createObjectURL(blob);
|
|
54
|
-
const link = document.createElement('a');
|
|
55
|
-
link.href = url;
|
|
56
|
-
link.download = certFileName;
|
|
57
|
-
// Trigger download
|
|
58
|
-
document.body.appendChild(link);
|
|
59
|
-
link.click();
|
|
60
|
-
document.body.removeChild(link);
|
|
61
|
-
// Clean up the URL object
|
|
62
|
-
URL.revokeObjectURL(url);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Generate token information section
|
|
66
|
-
*/
|
|
67
|
-
generateTokenSection(tokenInfo) {
|
|
68
|
-
return `
|
|
69
|
-
<div class="token-section">
|
|
70
|
-
<h3>🎫 NFT Token Information</h3>
|
|
71
|
-
<div class="key-value-pair">
|
|
72
|
-
<div class="key">Token ID:</div>
|
|
73
|
-
<div class="value"><code>${tokenInfo.tokenId}</code></div>
|
|
74
|
-
</div>
|
|
75
|
-
<div class="key-value-pair">
|
|
76
|
-
<div class="key">Network:</div>
|
|
77
|
-
<div class="value">${tokenInfo.network}</div>
|
|
78
|
-
</div>
|
|
79
|
-
<div class="key-value-pair">
|
|
80
|
-
<div class="key">Contract Address:</div>
|
|
81
|
-
<div class="value"><code>${tokenInfo.contractAddress}</code></div>
|
|
82
|
-
</div>
|
|
83
|
-
<div class="key-value-pair">
|
|
84
|
-
<div class="key">Transaction Hash:</div>
|
|
85
|
-
<div class="value"><code>${tokenInfo.transactionHash}</code></div>
|
|
86
|
-
</div>
|
|
87
|
-
${tokenInfo.wallet ? `
|
|
88
|
-
<div class="key-value-pair">
|
|
89
|
-
<div class="key">Wallet:</div>
|
|
90
|
-
<div class="value"><code>${tokenInfo.wallet}</code></div>
|
|
91
|
-
</div>
|
|
92
|
-
` : ''}
|
|
93
|
-
${tokenInfo.timestamp ? `
|
|
94
|
-
<div class="key-value-pair">
|
|
95
|
-
<div class="key">Minted At:</div>
|
|
96
|
-
<div class="value">${new Date(tokenInfo.timestamp * 1000).toUTCString()}</div>
|
|
97
|
-
</div>
|
|
98
|
-
` : ''}
|
|
99
|
-
${tokenInfo.note ? `
|
|
100
|
-
<div class="key-value-pair">
|
|
101
|
-
<div class="key">Note:</div>
|
|
102
|
-
<div class="value">${tokenInfo.note}</div>
|
|
103
|
-
</div>
|
|
104
|
-
` : ''}
|
|
105
|
-
</div>
|
|
106
|
-
`;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Generate blockchain verification section
|
|
110
|
-
*/
|
|
111
|
-
generateVerificationSection(verification) {
|
|
112
|
-
const statusIcon = verification.verificationStatus === 'PASSED' ? '✅' :
|
|
113
|
-
verification.verificationStatus === 'FAILED' ? '❌' : '⚠️';
|
|
114
|
-
return `
|
|
115
|
-
<div class="verification-section ${verification.verificationStatus.toLowerCase()}">
|
|
116
|
-
<h3>🔐 Blockchain Verification</h3>
|
|
117
|
-
<div class="verification-status ${verification.verificationStatus.toLowerCase()}">
|
|
118
|
-
${statusIcon} <strong>Status: ${verification.verificationStatus}</strong>
|
|
119
|
-
</div>
|
|
120
|
-
<div class="key-value-pair">
|
|
121
|
-
<div class="key">Blockchain Merkle Root:</div>
|
|
122
|
-
<div class="value"><code>${verification.blockchainMerkleRoot}</code></div>
|
|
123
|
-
</div>
|
|
124
|
-
<div class="key-value-pair">
|
|
125
|
-
<div class="key">Calculated Merkle Root:</div>
|
|
126
|
-
<div class="value"><code>${verification.calculatedMerkleRoot}</code></div>
|
|
127
|
-
</div>
|
|
128
|
-
<div class="key-value-pair">
|
|
129
|
-
<div class="key">Integrity Check:</div>
|
|
130
|
-
<div class="value">${verification.merkleRootMatches ?
|
|
131
|
-
'✅ Archive contents match blockchain record' :
|
|
132
|
-
'❌ Archive contents do not match blockchain record'}</div>
|
|
133
|
-
</div>
|
|
134
|
-
${verification.verificationTime ? `
|
|
135
|
-
<div class="key-value-pair">
|
|
136
|
-
<div class="key">Verified At:</div>
|
|
137
|
-
<div class="value">${new Date(verification.verificationTime * 1000).toUTCString()}</div>
|
|
138
|
-
</div>
|
|
139
|
-
` : ''}
|
|
140
|
-
${verification.blockNumber ? `
|
|
141
|
-
<div class="key-value-pair">
|
|
142
|
-
<div class="key">Block Number:</div>
|
|
143
|
-
<div class="value">${verification.blockNumber}</div>
|
|
144
|
-
</div>
|
|
145
|
-
` : ''}
|
|
146
|
-
</div>
|
|
147
|
-
`;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Generate wallet information section
|
|
151
|
-
*/
|
|
152
|
-
generateWalletSection(walletInfo) {
|
|
153
|
-
return `
|
|
154
|
-
<div class="wallet-section">
|
|
155
|
-
<h3>👛 Wallet Information</h3>
|
|
156
|
-
<div class="key-value-pair">
|
|
157
|
-
<div class="key">Address:</div>
|
|
158
|
-
<div class="value"><code>${walletInfo.address}</code></div>
|
|
159
|
-
</div>
|
|
160
|
-
<div class="key-value-pair">
|
|
161
|
-
<div class="key">Network:</div>
|
|
162
|
-
<div class="value">${walletInfo.network}</div>
|
|
163
|
-
</div>
|
|
164
|
-
${walletInfo.balance ? `
|
|
165
|
-
<div class="key-value-pair">
|
|
166
|
-
<div class="key">Balance:</div>
|
|
167
|
-
<div class="value">${walletInfo.balance}</div>
|
|
168
|
-
</div>
|
|
169
|
-
` : ''}
|
|
170
|
-
${walletInfo.ensName ? `
|
|
171
|
-
<div class="key-value-pair">
|
|
172
|
-
<div class="key">ENS Name:</div>
|
|
173
|
-
<div class="value">${walletInfo.ensName}</div>
|
|
174
|
-
</div>
|
|
175
|
-
` : ''}
|
|
176
|
-
</div>
|
|
177
|
-
`;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Generate files table
|
|
181
|
-
*/
|
|
182
|
-
generateFilesTable(zipFiles) {
|
|
183
|
-
if (zipFiles.length === 0) {
|
|
184
|
-
return '<tr><td colspan="4">No files found</td></tr>';
|
|
185
|
-
}
|
|
186
|
-
return zipFiles.map(file => `
|
|
187
|
-
<tr>
|
|
188
|
-
<td class="table-data1">${file.filename}</td>
|
|
189
|
-
<td>${file.size.toLocaleString()}</td>
|
|
190
|
-
<td>${file.date}</td>
|
|
191
|
-
<td><code>${file.hash}</code></td>
|
|
192
|
-
</tr>
|
|
193
|
-
`).join('');
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Get the HTML template for certificates
|
|
197
|
-
*/
|
|
198
|
-
getCertificateTemplate() {
|
|
199
|
-
return `<!DOCTYPE html>
|
|
200
|
-
<html lang="en">
|
|
201
|
-
<head>
|
|
202
|
-
<meta charset="UTF-8">
|
|
203
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
204
|
-
<title>NFT Token Certificate - {{ZIP_FILE}}</title>
|
|
205
|
-
<style>
|
|
206
|
-
body {
|
|
207
|
-
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
208
|
-
line-height: 1.6;
|
|
209
|
-
margin: 0;
|
|
210
|
-
padding: 20px;
|
|
211
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
212
|
-
min-height: 100vh;
|
|
213
|
-
}
|
|
214
|
-
.certificate {
|
|
215
|
-
max-width: 900px;
|
|
216
|
-
margin: 0 auto;
|
|
217
|
-
background: white;
|
|
218
|
-
border-radius: 15px;
|
|
219
|
-
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
|
|
220
|
-
overflow: hidden;
|
|
221
|
-
}
|
|
222
|
-
.header {
|
|
223
|
-
background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
|
|
224
|
-
color: white;
|
|
225
|
-
padding: 30px;
|
|
226
|
-
text-align: center;
|
|
227
|
-
}
|
|
228
|
-
.header h1 {
|
|
229
|
-
margin: 0;
|
|
230
|
-
font-size: 2.5em;
|
|
231
|
-
font-weight: 300;
|
|
232
|
-
}
|
|
233
|
-
.header h2 {
|
|
234
|
-
margin: 10px 0 0 0;
|
|
235
|
-
font-size: 1.2em;
|
|
236
|
-
opacity: 0.9;
|
|
237
|
-
}
|
|
238
|
-
.content {
|
|
239
|
-
padding: 40px;
|
|
240
|
-
}
|
|
241
|
-
.token-section, .verification-section, .wallet-section {
|
|
242
|
-
margin-bottom: 30px;
|
|
243
|
-
padding: 20px;
|
|
244
|
-
border-radius: 10px;
|
|
245
|
-
border-left: 4px solid #3498db;
|
|
246
|
-
background: #f8f9fa;
|
|
247
|
-
}
|
|
248
|
-
.verification-section.passed {
|
|
249
|
-
border-left-color: #27ae60;
|
|
250
|
-
}
|
|
251
|
-
.verification-section.failed {
|
|
252
|
-
border-left-color: #e74c3c;
|
|
253
|
-
}
|
|
254
|
-
.verification-section.unavailable {
|
|
255
|
-
border-left-color: #f39c12;
|
|
256
|
-
}
|
|
257
|
-
.verification-status {
|
|
258
|
-
font-size: 1.2em;
|
|
259
|
-
margin-bottom: 15px;
|
|
260
|
-
padding: 10px;
|
|
261
|
-
border-radius: 5px;
|
|
262
|
-
}
|
|
263
|
-
.verification-status.passed {
|
|
264
|
-
background: #d4edda;
|
|
265
|
-
color: #155724;
|
|
266
|
-
}
|
|
267
|
-
.verification-status.failed {
|
|
268
|
-
background: #f8d7da;
|
|
269
|
-
color: #721c24;
|
|
270
|
-
}
|
|
271
|
-
.verification-status.unavailable {
|
|
272
|
-
background: #fff3cd;
|
|
273
|
-
color: #856404;
|
|
274
|
-
}
|
|
275
|
-
.key-value-pair {
|
|
276
|
-
display: flex;
|
|
277
|
-
margin-bottom: 10px;
|
|
278
|
-
align-items: flex-start;
|
|
279
|
-
}
|
|
280
|
-
.key {
|
|
281
|
-
font-weight: bold;
|
|
282
|
-
min-width: 200px;
|
|
283
|
-
color: #2c3e50;
|
|
284
|
-
}
|
|
285
|
-
.value {
|
|
286
|
-
flex: 1;
|
|
287
|
-
word-break: break-all;
|
|
288
|
-
}
|
|
289
|
-
.value code {
|
|
290
|
-
background: #e9ecef;
|
|
291
|
-
padding: 2px 6px;
|
|
292
|
-
border-radius: 3px;
|
|
293
|
-
font-family: 'Monaco', 'Menlo', monospace;
|
|
294
|
-
font-size: 0.9em;
|
|
295
|
-
}
|
|
296
|
-
.files-section {
|
|
297
|
-
margin-top: 30px;
|
|
298
|
-
}
|
|
299
|
-
.files-table {
|
|
300
|
-
width: 100%;
|
|
301
|
-
border-collapse: collapse;
|
|
302
|
-
margin-top: 15px;
|
|
303
|
-
}
|
|
304
|
-
.files-table th,
|
|
305
|
-
.files-table td {
|
|
306
|
-
padding: 12px;
|
|
307
|
-
text-align: left;
|
|
308
|
-
border-bottom: 1px solid #dee2e6;
|
|
309
|
-
}
|
|
310
|
-
.files-table th {
|
|
311
|
-
background: #f8f9fa;
|
|
312
|
-
font-weight: bold;
|
|
313
|
-
color: #2c3e50;
|
|
314
|
-
}
|
|
315
|
-
.table-data1 {
|
|
316
|
-
font-weight: bold;
|
|
317
|
-
}
|
|
318
|
-
.warning {
|
|
319
|
-
background: #fff3cd;
|
|
320
|
-
color: #856404;
|
|
321
|
-
padding: 15px;
|
|
322
|
-
border-radius: 5px;
|
|
323
|
-
margin-bottom: 20px;
|
|
324
|
-
border-left: 4px solid #ffc107;
|
|
325
|
-
}
|
|
326
|
-
.footer {
|
|
327
|
-
text-align: center;
|
|
328
|
-
padding: 20px;
|
|
329
|
-
background: #f8f9fa;
|
|
330
|
-
color: #6c757d;
|
|
331
|
-
font-size: 0.9em;
|
|
332
|
-
}
|
|
333
|
-
h3 {
|
|
334
|
-
margin-top: 0;
|
|
335
|
-
color: #2c3e50;
|
|
336
|
-
font-size: 1.3em;
|
|
337
|
-
}
|
|
338
|
-
</style>
|
|
339
|
-
</head>
|
|
340
|
-
<body>
|
|
341
|
-
<div class="certificate">
|
|
342
|
-
<div class="header">
|
|
343
|
-
<h1>🎫 NFT Token Certificate</h1>
|
|
344
|
-
<h2>Blockchain-Verified Digital Archive</h2>
|
|
345
|
-
</div>
|
|
346
|
-
|
|
347
|
-
<div class="content">
|
|
348
|
-
{{UPDATE_WARNING}}
|
|
349
|
-
|
|
350
|
-
<div class="key-value-pair" style="margin-bottom: 30px; font-size: 1.1em;">
|
|
351
|
-
<div class="key">Archive File:</div>
|
|
352
|
-
<div class="value"><strong>{{ZIP_FILE}}</strong></div>
|
|
353
|
-
</div>
|
|
354
|
-
|
|
355
|
-
{{ATTESTATION_HTML}}
|
|
356
|
-
|
|
357
|
-
<div class="files-section">
|
|
358
|
-
<h3>📁 Archive Contents</h3>
|
|
359
|
-
<table class="files-table">
|
|
360
|
-
<thead>
|
|
361
|
-
<tr>
|
|
362
|
-
<th>File Name</th>
|
|
363
|
-
<th>Size (bytes)</th>
|
|
364
|
-
<th>Date Modified</th>
|
|
365
|
-
<th>SHA256 Hash</th>
|
|
366
|
-
</tr>
|
|
367
|
-
</thead>
|
|
368
|
-
<tbody>
|
|
369
|
-
{{FILES_TABLE_HTML}}
|
|
370
|
-
</tbody>
|
|
371
|
-
</table>
|
|
372
|
-
</div>
|
|
373
|
-
</div>
|
|
374
|
-
|
|
375
|
-
<div class="footer">
|
|
376
|
-
<p>This certificate verifies the integrity and authenticity of the tokenized archive through blockchain technology.</p>
|
|
377
|
-
<p>Generated on: {{GENERATION_TIME}}</p>
|
|
378
|
-
</div>
|
|
379
|
-
</div>
|
|
380
|
-
</body>
|
|
381
|
-
</html>`;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Prepares file information from ZIP entries for certificate generation
|
|
385
|
-
*/
|
|
386
|
-
prepareZipFileInfo(zipEntries) {
|
|
387
|
-
const zipFiles = [];
|
|
388
|
-
for (const entry of zipEntries) {
|
|
389
|
-
// Skip the token file itself and directories
|
|
390
|
-
if (entry.filename !== Headers_1.TOKENIZED_METADATA &&
|
|
391
|
-
!entry.isDirectory &&
|
|
392
|
-
entry.sha256) {
|
|
393
|
-
zipFiles.push({
|
|
394
|
-
filename: entry.filename,
|
|
395
|
-
size: entry.uncompressedSize,
|
|
396
|
-
date: this.formatEntryDate(entry),
|
|
397
|
-
hash: entry.sha256
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
return zipFiles;
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Formats the date from a ZIP entry
|
|
405
|
-
*/
|
|
406
|
-
formatEntryDate(entry) {
|
|
407
|
-
try {
|
|
408
|
-
// Try to use the entry's date formatting if available
|
|
409
|
-
if (typeof entry.toFormattedUTCDateString === 'function') {
|
|
410
|
-
return entry.toFormattedUTCDateString();
|
|
411
|
-
}
|
|
412
|
-
// Fallback to current date
|
|
413
|
-
return new Date().toUTCString();
|
|
414
|
-
}
|
|
415
|
-
catch (error) {
|
|
416
|
-
return new Date().toUTCString();
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
exports.CertificateGeneratorBrowser = CertificateGeneratorBrowser;
|
|
421
|
-
/**
|
|
422
|
-
* Creates a new CertificateGeneratorBrowser instance
|
|
423
|
-
*/
|
|
424
|
-
function createCertificateGenerator() {
|
|
425
|
-
return new CertificateGeneratorBrowser();
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Convenience function to generate a certificate
|
|
429
|
-
*/
|
|
430
|
-
function generateTokenCertificate(tokenInfo, zipFile, blockchainVerification, walletInfo, zipFiles) {
|
|
431
|
-
const generator = new CertificateGeneratorBrowser();
|
|
432
|
-
return generator.createTokenCertificate(tokenInfo, zipFile, blockchainVerification, walletInfo, zipFiles);
|
|
433
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import ZipKit, { CompressOptions, CreateZipOptions } from '../shared/ZipKit';
|
|
2
|
-
import ZipEntry from '../shared/ZipEntry';
|
|
3
|
-
import Errors from '../shared/constants/Errors';
|
|
4
|
-
import * as Headers from '../shared/constants/Headers';
|
|
5
|
-
import { sha256 } from '../shared/components/ZipCrypto';
|
|
6
|
-
import { getTypeOf } from '../shared/components/Util';
|
|
7
|
-
import type { FileData } from '../shared/types';
|
|
8
|
-
export * from '../shared/ZipKit';
|
|
9
|
-
export { ZipEntry, Errors, Headers, sha256, getTypeOf };
|
|
10
|
-
export default class ZipKitBrowser extends ZipKit {
|
|
11
|
-
constructor();
|
|
12
|
-
loadZipBlob(data: Blob): Promise<ZipEntry[] | null>;
|
|
13
|
-
createZipFileEntry(file: FileData): ZipEntry;
|
|
14
|
-
hashFile(file: FileData): Promise<string>;
|
|
15
|
-
compressDataBlob(entry: ZipEntry, data: Blob, options?: CompressOptions): Promise<Buffer>;
|
|
16
|
-
extractBlob(entry: ZipEntry, skipHashCheck?: boolean): Promise<Blob | null>;
|
|
17
|
-
createZipBlob(cmpOptions?: CompressOptions, options?: CreateZipOptions): Promise<Blob | null>;
|
|
18
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// A browser-safe version of ZipKitStamp
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.verifyTimestamp = exports.createTimestamp = void 0;
|
|
5
|
-
const createTimestamp = async (hash, options = {}) => {
|
|
6
|
-
throw new Error('Blockchain timestamp creation is not supported in browsers');
|
|
7
|
-
};
|
|
8
|
-
exports.createTimestamp = createTimestamp;
|
|
9
|
-
const verifyTimestamp = async (timestamp, options = {}) => {
|
|
10
|
-
throw new Error('Blockchain timestamp verification is not supported in browsers');
|
|
11
|
-
};
|
|
12
|
-
exports.verifyTimestamp = verifyTimestamp;
|
package/dist/browser-index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import ZipKit from './shared/ZipKit';
|
|
2
|
-
export { ZipEntry, Errors, CMP_METHOD, TIMESTAMP_METADATA, TIMESTAMP_SUBMITTED } from './shared/ZipKit';
|
|
3
|
-
export type { CompressOptions } from './shared/ZipKit';
|
|
4
|
-
export * from './shared/ZipKit';
|
|
5
|
-
export * from './shared/ZipEntry';
|
|
6
|
-
export default ZipKit;
|
|
7
|
-
export { default as ZipKitBrowser } from './browser/ZipKitBrowser';
|
|
8
|
-
export { CertificateGeneratorBrowser } from './browser/CertificateGeneratorBrowser';
|
|
9
|
-
export { TokenVerificationResult, checkForTokenization as checkForTokenizationBrowser, NZipTokenInfo } from './browser/TokenVerifierBrowser';
|
|
10
|
-
export type { TokenVerificationOptions } from './browser/TokenVerifierBrowser';
|
|
11
|
-
export { default as HashAccumulator } from './shared/components/HashAccumulator';
|
|
12
|
-
export * from './shared/components/Util';
|
|
13
|
-
export * from './shared/components/Support';
|
|
14
|
-
export * from './shared/types';
|
|
15
|
-
export * from './shared/constants/Headers';
|
|
16
|
-
export * from './shared/constants/Errors';
|
|
17
|
-
export * from './shared/version';
|
|
18
|
-
export declare const PlatformUtils: {
|
|
19
|
-
isBrowser: boolean;
|
|
20
|
-
isNode: string | false;
|
|
21
|
-
};
|
package/dist/browser-index.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// =============================================================================
|
|
3
|
-
// NeoZipKit - Browser-Only Package Exports
|
|
4
|
-
// =============================================================================
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.PlatformUtils = exports.HashAccumulator = exports.checkForTokenizationBrowser = exports.CertificateGeneratorBrowser = exports.ZipKitBrowser = exports.TIMESTAMP_SUBMITTED = exports.TIMESTAMP_METADATA = exports.CMP_METHOD = exports.Errors = exports.ZipEntry = void 0;
|
|
24
|
-
// Core shared exports
|
|
25
|
-
const ZipKit_1 = __importDefault(require("./shared/ZipKit"));
|
|
26
|
-
var ZipKit_2 = require("./shared/ZipKit");
|
|
27
|
-
Object.defineProperty(exports, "ZipEntry", { enumerable: true, get: function () { return ZipKit_2.ZipEntry; } });
|
|
28
|
-
Object.defineProperty(exports, "Errors", { enumerable: true, get: function () { return ZipKit_2.Errors; } });
|
|
29
|
-
Object.defineProperty(exports, "CMP_METHOD", { enumerable: true, get: function () { return ZipKit_2.CMP_METHOD; } });
|
|
30
|
-
Object.defineProperty(exports, "TIMESTAMP_METADATA", { enumerable: true, get: function () { return ZipKit_2.TIMESTAMP_METADATA; } });
|
|
31
|
-
Object.defineProperty(exports, "TIMESTAMP_SUBMITTED", { enumerable: true, get: function () { return ZipKit_2.TIMESTAMP_SUBMITTED; } });
|
|
32
|
-
__exportStar(require("./shared/ZipKit"), exports);
|
|
33
|
-
__exportStar(require("./shared/ZipEntry"), exports);
|
|
34
|
-
exports.default = ZipKit_1.default;
|
|
35
|
-
// Browser-only exports
|
|
36
|
-
var ZipKitBrowser_1 = require("./browser/ZipKitBrowser");
|
|
37
|
-
Object.defineProperty(exports, "ZipKitBrowser", { enumerable: true, get: function () { return __importDefault(ZipKitBrowser_1).default; } });
|
|
38
|
-
var CertificateGeneratorBrowser_1 = require("./browser/CertificateGeneratorBrowser");
|
|
39
|
-
Object.defineProperty(exports, "CertificateGeneratorBrowser", { enumerable: true, get: function () { return CertificateGeneratorBrowser_1.CertificateGeneratorBrowser; } });
|
|
40
|
-
var TokenVerifierBrowser_1 = require("./browser/TokenVerifierBrowser");
|
|
41
|
-
Object.defineProperty(exports, "checkForTokenizationBrowser", { enumerable: true, get: function () { return TokenVerifierBrowser_1.checkForTokenization; } });
|
|
42
|
-
// Shared component exports
|
|
43
|
-
var HashAccumulator_1 = require("./shared/components/HashAccumulator");
|
|
44
|
-
Object.defineProperty(exports, "HashAccumulator", { enumerable: true, get: function () { return __importDefault(HashAccumulator_1).default; } });
|
|
45
|
-
__exportStar(require("./shared/components/Util"), exports);
|
|
46
|
-
__exportStar(require("./shared/components/Support"), exports);
|
|
47
|
-
// Type and constant exports
|
|
48
|
-
__exportStar(require("./shared/types"), exports);
|
|
49
|
-
__exportStar(require("./shared/constants/Headers"), exports);
|
|
50
|
-
__exportStar(require("./shared/constants/Errors"), exports);
|
|
51
|
-
__exportStar(require("./shared/version"), exports);
|
|
52
|
-
// Platform-specific conditional exports
|
|
53
|
-
exports.PlatformUtils = {
|
|
54
|
-
// Browser detection
|
|
55
|
-
isBrowser: typeof window !== 'undefined' && typeof document !== 'undefined',
|
|
56
|
-
// Node.js detection
|
|
57
|
-
isNode: typeof process !== 'undefined' && process.versions && process.versions.node,
|
|
58
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export interface TokenInfo {
|
|
2
|
-
tokenId: string;
|
|
3
|
-
contractAddress: string;
|
|
4
|
-
network: string;
|
|
5
|
-
transactionHash: string;
|
|
6
|
-
wallet?: string;
|
|
7
|
-
timestamp?: number;
|
|
8
|
-
note?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface BlockchainVerification {
|
|
11
|
-
merkleRootMatches: boolean;
|
|
12
|
-
blockchainMerkleRoot: string;
|
|
13
|
-
calculatedMerkleRoot: string;
|
|
14
|
-
verificationStatus: 'PASSED' | 'FAILED' | 'UNAVAILABLE';
|
|
15
|
-
verificationTime?: number;
|
|
16
|
-
blockNumber?: number;
|
|
17
|
-
}
|
|
18
|
-
export interface WalletInfo {
|
|
19
|
-
address: string;
|
|
20
|
-
balance?: string;
|
|
21
|
-
network: string;
|
|
22
|
-
ensName?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface ZipFileInfo {
|
|
25
|
-
filename: string;
|
|
26
|
-
size: number;
|
|
27
|
-
date: string;
|
|
28
|
-
hash: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Generates a certificate HTML document for tokenized ZIP files
|
|
32
|
-
*
|
|
33
|
-
* @param tokenInfo - NFT token information
|
|
34
|
-
* @param zipFile - Name of the zip file
|
|
35
|
-
* @param blockchainVerification - Blockchain verification results
|
|
36
|
-
* @param walletInfo - Wallet information (optional)
|
|
37
|
-
* @param zipFiles - Array of file information (optional)
|
|
38
|
-
* @param options - Certificate generation options
|
|
39
|
-
* @returns Generated HTML certificate as string
|
|
40
|
-
*/
|
|
41
|
-
export declare function createTokenCertificate(tokenInfo: TokenInfo, zipFile: string, blockchainVerification: BlockchainVerification, walletInfo?: WalletInfo, zipFiles?: ZipFileInfo[], options?: {
|
|
42
|
-
narrow?: boolean;
|
|
43
|
-
includeQR?: boolean;
|
|
44
|
-
}): string;
|
|
45
|
-
/**
|
|
46
|
-
* Saves a certificate to disk
|
|
47
|
-
*/
|
|
48
|
-
export declare function saveCertificate(fileName: string, certificateHTML: string, outputDir?: string): string;
|