neozipkit 0.1.1
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/README.md +400 -0
- package/contracts/Lock.sol +34 -0
- package/contracts/bytecode.txt +1 -0
- package/contracts/compile-contract.js +168 -0
- package/contracts/deploy/deploy-both-contracts.js +286 -0
- package/contracts/deploy/deploy-enhanced-contract.js +197 -0
- package/contracts/deploy/deploy-private-contract.js +190 -0
- package/contracts/deploy/deploy-public-clean.js +1063 -0
- package/contracts/deploy/deploy-public-contract.js +1107 -0
- package/contracts/deployment.config.example.js +25 -0
- package/contracts/remix-compile.js +222 -0
- package/contracts/setup-deployment.js +51 -0
- package/contracts/src/NZIP-NFT-Private.sol +350 -0
- package/contracts/src/NZIP-NFT.sol +265 -0
- package/contracts/src/ZipFileNFT-DEPRECATED-6field.sol +260 -0
- package/contracts/src/ZipFileNFT-DEPRECATED-Enhanced.sol +289 -0
- package/dist/browser/CertificateGeneratorBrowser.d.ts +75 -0
- package/dist/browser/CertificateGeneratorBrowser.js +433 -0
- package/dist/browser/TokenVerifierBrowser.d.ts +76 -0
- package/dist/browser/TokenVerifierBrowser.js +299 -0
- package/dist/browser/ZipKitBrowser.d.ts +18 -0
- package/dist/browser/ZipKitBrowser.js +250 -0
- package/dist/browser/ZipKitStampBrowser.d.ts +2 -0
- package/dist/browser/ZipKitStampBrowser.js +12 -0
- package/dist/browser-index.d.ts +21 -0
- package/dist/browser-index.js +58 -0
- package/dist/browser.d.ts +21 -0
- package/dist/browser.js +58 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +76 -0
- package/dist/server/blockchain/CertificateToken.d.ts +48 -0
- package/dist/server/blockchain/CertificateToken.js +386 -0
- package/dist/server/blockchain/NFTMinter.d.ts +41 -0
- package/dist/server/blockchain/NFTMinter.js +323 -0
- package/dist/server/blockchain/TokenQuerier.d.ts +31 -0
- package/dist/server/blockchain/TokenQuerier.js +259 -0
- package/dist/server/blockchain/TokenVerifier.d.ts +20 -0
- package/dist/server/blockchain/TokenVerifier.js +395 -0
- package/dist/server/blockchain/WalletAnalyzer.d.ts +81 -0
- package/dist/server/blockchain/WalletAnalyzer.js +356 -0
- package/dist/server/blockchain/WalletFormatter.d.ts +39 -0
- package/dist/server/blockchain/WalletFormatter.js +196 -0
- package/dist/server/blockchain/WalletManager.d.ts +46 -0
- package/dist/server/blockchain/WalletManager.js +294 -0
- package/dist/server/blockchain/ZipMetadata.d.ts +27 -0
- package/dist/server/blockchain/ZipMetadata.js +131 -0
- package/dist/server/blockchain/ZipTokenProcessor.d.ts +44 -0
- package/dist/server/blockchain/ZipTokenProcessor.js +204 -0
- package/dist/server/blockchain/constants.d.ts +102 -0
- package/dist/server/blockchain/constants.js +968 -0
- package/dist/server/blockchain/index.d.ts +9 -0
- package/dist/server/blockchain/index.js +44 -0
- package/dist/server/blockchain/test-certificate.d.ts +8 -0
- package/dist/server/blockchain/test-certificate.js +100 -0
- package/dist/server/blockchain/types.d.ts +69 -0
- package/dist/server/blockchain/types.js +51 -0
- package/dist/server/platform/server/ZipKitServer.d.ts +105 -0
- package/dist/server/platform/server/ZipKitServer.js +437 -0
- package/dist/server/platform/servercomponents/ZipKitOTS.d.ts +91 -0
- package/dist/server/platform/servercomponents/ZipKitOTS.js +271 -0
- package/dist/shared/ZipEntry.d.ts +131 -0
- package/dist/shared/ZipEntry.js +686 -0
- package/dist/shared/ZipKit.d.ts +249 -0
- package/dist/shared/ZipKit.js +789 -0
- package/dist/shared/components/CertificateOTS.d.ts +15 -0
- package/dist/shared/components/CertificateOTS.js +116 -0
- package/dist/shared/components/FileSys.d.ts +2 -0
- package/dist/shared/components/FileSys.js +113 -0
- package/dist/shared/components/HashAccumulator.d.ts +55 -0
- package/dist/shared/components/HashAccumulator.js +100 -0
- package/dist/shared/components/Support.d.ts +63 -0
- package/dist/shared/components/Support.js +70 -0
- package/dist/shared/components/Util.d.ts +21 -0
- package/dist/shared/components/Util.js +115 -0
- package/dist/shared/components/ZipCrypto.d.ts +3 -0
- package/dist/shared/components/ZipCrypto.js +78 -0
- package/dist/shared/components/merkleTree.d.ts +66 -0
- package/dist/shared/components/merkleTree.js +136 -0
- package/dist/shared/constants/Errors.d.ts +53 -0
- package/dist/shared/constants/Errors.js +69 -0
- package/dist/shared/constants/Headers.d.ts +167 -0
- package/dist/shared/constants/Headers.js +191 -0
- package/dist/shared/types/index.d.ts +21 -0
- package/dist/shared/types/index.js +3 -0
- package/dist/shared/types.d.ts +33 -0
- package/dist/shared/types.js +8 -0
- package/dist/shared/version.d.ts +4 -0
- package/dist/shared/version.js +7 -0
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.js +3 -0
- package/examples/unzip-token.ts +488 -0
- package/examples/zip-token.ts +604 -0
- package/package.json +117 -0
- package/src/browser/CertificateGeneratorBrowser.ts +498 -0
- package/src/browser/TokenVerifierBrowser.ts +344 -0
- package/src/browser/ZipKitBrowser.ts +242 -0
- package/src/browser/ZipKitStampBrowser.ts +9 -0
- package/src/browser-index.ts +36 -0
- package/src/index.ts +48 -0
- package/src/server/blockchain/CertificateToken.ts +444 -0
- package/src/server/blockchain/NFTMinter.ts +357 -0
- package/src/server/blockchain/TokenQuerier.ts +287 -0
- package/src/server/blockchain/TokenVerifier.ts +453 -0
- package/src/server/blockchain/WalletAnalyzer.ts +397 -0
- package/src/server/blockchain/WalletFormatter.ts +206 -0
- package/src/server/blockchain/WalletManager.ts +294 -0
- package/src/server/blockchain/ZipMetadata.ts +117 -0
- package/src/server/blockchain/ZipTokenProcessor.ts +234 -0
- package/src/server/blockchain/constants.ts +969 -0
- package/src/server/blockchain/index.ts +42 -0
- package/src/server/blockchain/test-certificate.ts +137 -0
- package/src/server/blockchain/types.ts +134 -0
- package/src/server/platform/server/ZipKitServer.ts +459 -0
- package/src/server/platform/servercomponents/ZipKitOTS.ts +313 -0
- package/src/server/platform/servercomponents/opentimestamps.d.ts +23 -0
- package/src/shared/ZipEntry.ts +767 -0
- package/src/shared/ZipKit.ts +899 -0
- package/src/shared/components/CertificateOTS.ts +132 -0
- package/src/shared/components/FileSys.ts +87 -0
- package/src/shared/components/HashAccumulator.ts +113 -0
- package/src/shared/components/Support.ts +77 -0
- package/src/shared/components/Util.ts +113 -0
- package/src/shared/components/ZipCrypto.ts +91 -0
- package/src/shared/components/merkleTree.ts +162 -0
- package/src/shared/constants/Errors.ts +82 -0
- package/src/shared/constants/Headers.ts +203 -0
- package/src/shared/types/index.ts +25 -0
- package/src/shared/types/modules.d.ts +22 -0
- package/src/shared/types/opentimestamps.d.ts +23 -0
- package/src/shared/types.d.ts +8 -0
- package/src/shared/types.ts +43 -0
- package/src/shared/version.ts +4 -0
- package/src/types/index.ts +25 -0
- package/src/types/modules.d.ts +22 -0
- package/src/types/opentimestamps.d.ts +23 -0
|
@@ -0,0 +1,21 @@
|
|
|
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.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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 ZipKitServer } from './server/platform/server/ZipKitServer';
|
|
12
|
+
export { verifyTimestamp, createTimestamp } from './server/platform/servercomponents/ZipKitOTS';
|
|
13
|
+
export * from './server/blockchain';
|
|
14
|
+
export { checkForTokenization as checkForTokenizationServer } from './server/blockchain/TokenVerifier';
|
|
15
|
+
export { NFTMinter } from './server/blockchain/NFTMinter';
|
|
16
|
+
export { WalletAnalyzer } from './server/blockchain/WalletAnalyzer';
|
|
17
|
+
export { WalletManager } from './server/blockchain/WalletManager';
|
|
18
|
+
export { ZipTokenProcessor } from './server/blockchain/ZipTokenProcessor';
|
|
19
|
+
export { default as HashAccumulator } from './shared/components/HashAccumulator';
|
|
20
|
+
export * from './shared/components/Util';
|
|
21
|
+
export * from './shared/components/Support';
|
|
22
|
+
export * from './shared/types';
|
|
23
|
+
export * from './shared/constants/Headers';
|
|
24
|
+
export * from './shared/constants/Errors';
|
|
25
|
+
export * from './shared/version';
|
|
26
|
+
export declare const PlatformUtils: {
|
|
27
|
+
isBrowser: boolean;
|
|
28
|
+
isNode: string | false;
|
|
29
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// NeoZipKit - Unified 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.ZipTokenProcessor = exports.WalletManager = exports.WalletAnalyzer = exports.NFTMinter = exports.checkForTokenizationServer = exports.createTimestamp = exports.verifyTimestamp = exports.ZipKitServer = 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
|
+
// Server-only exports (now included in main build)
|
|
43
|
+
var ZipKitServer_1 = require("./server/platform/server/ZipKitServer");
|
|
44
|
+
Object.defineProperty(exports, "ZipKitServer", { enumerable: true, get: function () { return __importDefault(ZipKitServer_1).default; } });
|
|
45
|
+
var ZipKitOTS_1 = require("./server/platform/servercomponents/ZipKitOTS");
|
|
46
|
+
Object.defineProperty(exports, "verifyTimestamp", { enumerable: true, get: function () { return ZipKitOTS_1.verifyTimestamp; } });
|
|
47
|
+
Object.defineProperty(exports, "createTimestamp", { enumerable: true, get: function () { return ZipKitOTS_1.createTimestamp; } });
|
|
48
|
+
// Blockchain exports
|
|
49
|
+
__exportStar(require("./server/blockchain"), exports);
|
|
50
|
+
var TokenVerifier_1 = require("./server/blockchain/TokenVerifier");
|
|
51
|
+
Object.defineProperty(exports, "checkForTokenizationServer", { enumerable: true, get: function () { return TokenVerifier_1.checkForTokenization; } });
|
|
52
|
+
var NFTMinter_1 = require("./server/blockchain/NFTMinter");
|
|
53
|
+
Object.defineProperty(exports, "NFTMinter", { enumerable: true, get: function () { return NFTMinter_1.NFTMinter; } });
|
|
54
|
+
var WalletAnalyzer_1 = require("./server/blockchain/WalletAnalyzer");
|
|
55
|
+
Object.defineProperty(exports, "WalletAnalyzer", { enumerable: true, get: function () { return WalletAnalyzer_1.WalletAnalyzer; } });
|
|
56
|
+
var WalletManager_1 = require("./server/blockchain/WalletManager");
|
|
57
|
+
Object.defineProperty(exports, "WalletManager", { enumerable: true, get: function () { return WalletManager_1.WalletManager; } });
|
|
58
|
+
var ZipTokenProcessor_1 = require("./server/blockchain/ZipTokenProcessor");
|
|
59
|
+
Object.defineProperty(exports, "ZipTokenProcessor", { enumerable: true, get: function () { return ZipTokenProcessor_1.ZipTokenProcessor; } });
|
|
60
|
+
// Shared component exports
|
|
61
|
+
var HashAccumulator_1 = require("./shared/components/HashAccumulator");
|
|
62
|
+
Object.defineProperty(exports, "HashAccumulator", { enumerable: true, get: function () { return __importDefault(HashAccumulator_1).default; } });
|
|
63
|
+
__exportStar(require("./shared/components/Util"), exports);
|
|
64
|
+
__exportStar(require("./shared/components/Support"), exports);
|
|
65
|
+
// Type and constant exports
|
|
66
|
+
__exportStar(require("./shared/types"), exports);
|
|
67
|
+
__exportStar(require("./shared/constants/Headers"), exports);
|
|
68
|
+
__exportStar(require("./shared/constants/Errors"), exports);
|
|
69
|
+
__exportStar(require("./shared/version"), exports);
|
|
70
|
+
// Platform-specific conditional exports
|
|
71
|
+
exports.PlatformUtils = {
|
|
72
|
+
// Browser detection
|
|
73
|
+
isBrowser: typeof window !== 'undefined' && typeof document !== 'undefined',
|
|
74
|
+
// Node.js detection
|
|
75
|
+
isNode: typeof process !== 'undefined' && process.versions && process.versions.node,
|
|
76
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
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;
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ======================================
|
|
3
|
+
// CertificateToken.ts
|
|
4
|
+
// Copyright (c) 2025 NeoWare, Inc. All rights reserved.
|
|
5
|
+
//
|
|
6
|
+
// Standalone certificate generator for tokenized ZIP files
|
|
7
|
+
// This will be integrated into neozipkit once fully functional
|
|
8
|
+
// ======================================
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.createTokenCertificate = createTokenCertificate;
|
|
14
|
+
exports.saveCertificate = saveCertificate;
|
|
15
|
+
const fs_1 = __importDefault(require("fs"));
|
|
16
|
+
const path_1 = __importDefault(require("path"));
|
|
17
|
+
/**
|
|
18
|
+
* Generates a certificate HTML document for tokenized ZIP files
|
|
19
|
+
*
|
|
20
|
+
* @param tokenInfo - NFT token information
|
|
21
|
+
* @param zipFile - Name of the zip file
|
|
22
|
+
* @param blockchainVerification - Blockchain verification results
|
|
23
|
+
* @param walletInfo - Wallet information (optional)
|
|
24
|
+
* @param zipFiles - Array of file information (optional)
|
|
25
|
+
* @param options - Certificate generation options
|
|
26
|
+
* @returns Generated HTML certificate as string
|
|
27
|
+
*/
|
|
28
|
+
function createTokenCertificate(tokenInfo, zipFile, blockchainVerification, walletInfo, zipFiles, options) {
|
|
29
|
+
// Generate token information HTML
|
|
30
|
+
const tokenHTML = generateTokenSection(tokenInfo);
|
|
31
|
+
// Generate blockchain verification HTML
|
|
32
|
+
const verificationHTML = generateVerificationSection(blockchainVerification);
|
|
33
|
+
// Generate wallet information HTML
|
|
34
|
+
const walletHTML = walletInfo ? generateWalletSection(walletInfo) : '';
|
|
35
|
+
// Generate files table HTML
|
|
36
|
+
const filesTableHTML = zipFiles ? generateFilesTable(zipFiles) : '';
|
|
37
|
+
// Get the complete HTML template
|
|
38
|
+
const htmlTemplate = getCertificateTemplate();
|
|
39
|
+
// Create the complete attestation HTML combining all sections
|
|
40
|
+
const attestHTML = tokenHTML + verificationHTML + walletHTML;
|
|
41
|
+
// Replace placeholders in the template
|
|
42
|
+
const html = htmlTemplate
|
|
43
|
+
.replace(/{{ATTEST_STR}}/g, `NFT Token Certificate for ${zipFile}`)
|
|
44
|
+
.replace(/{{UPDATE_WARNING}}/g, blockchainVerification.verificationStatus === 'FAILED' ?
|
|
45
|
+
'<div class="warning">⚠️ Warning: Blockchain verification failed. This archive may have been tampered with.</div>' : '')
|
|
46
|
+
.replace(/{{ZIP_FILE}}/g, zipFile)
|
|
47
|
+
.replace(/{{HASH_DIGEST}}/g, blockchainVerification.calculatedMerkleRoot)
|
|
48
|
+
.replace(/{{ATTESTATION_HTML}}/g, attestHTML)
|
|
49
|
+
.replace(/{{FILES_TABLE_HTML}}/g, filesTableHTML)
|
|
50
|
+
.replace(/{{GENERATION_TIME}}/g, new Date().toUTCString());
|
|
51
|
+
return html;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Saves a certificate to disk
|
|
55
|
+
*/
|
|
56
|
+
function saveCertificate(fileName, certificateHTML, outputDir) {
|
|
57
|
+
try {
|
|
58
|
+
const dir = outputDir || path_1.default.dirname(fileName);
|
|
59
|
+
const baseName = path_1.default.basename(fileName, '.zip');
|
|
60
|
+
const certFileName = path_1.default.join(dir, `${baseName}.token-certificate.html`);
|
|
61
|
+
// Ensure directory exists
|
|
62
|
+
if (!fs_1.default.existsSync(dir)) {
|
|
63
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
64
|
+
}
|
|
65
|
+
// Write the certificate HTML to a file
|
|
66
|
+
fs_1.default.writeFileSync(certFileName, certificateHTML, { encoding: 'utf8' });
|
|
67
|
+
return certFileName;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw new Error(`Failed to save certificate: ${error}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Generate token information section
|
|
75
|
+
*/
|
|
76
|
+
function generateTokenSection(tokenInfo) {
|
|
77
|
+
return `
|
|
78
|
+
<div class="token-section">
|
|
79
|
+
<h3>🎫 NFT Token Information</h3>
|
|
80
|
+
<div class="key-value-pair">
|
|
81
|
+
<div class="key">Token ID:</div>
|
|
82
|
+
<div class="value">${tokenInfo.tokenId}</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="key-value-pair">
|
|
85
|
+
<div class="key">Contract Address:</div>
|
|
86
|
+
<div class="value"><code>${tokenInfo.contractAddress}</code></div>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="key-value-pair">
|
|
89
|
+
<div class="key">Network:</div>
|
|
90
|
+
<div class="value">${tokenInfo.network}</div>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="key-value-pair">
|
|
93
|
+
<div class="key">Minting Transaction:</div>
|
|
94
|
+
<div class="value"><code>${tokenInfo.transactionHash}</code></div>
|
|
95
|
+
</div>
|
|
96
|
+
${tokenInfo.timestamp ? `
|
|
97
|
+
<div class="key-value-pair">
|
|
98
|
+
<div class="key">Token Created:</div>
|
|
99
|
+
<div class="value">${new Date(tokenInfo.timestamp * 1000).toUTCString()}</div>
|
|
100
|
+
</div>
|
|
101
|
+
` : ''}
|
|
102
|
+
${tokenInfo.note ? `
|
|
103
|
+
<div class="key-value-pair">
|
|
104
|
+
<div class="key">Note:</div>
|
|
105
|
+
<div class="value">${tokenInfo.note}</div>
|
|
106
|
+
</div>
|
|
107
|
+
` : ''}
|
|
108
|
+
</div>
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Generate blockchain verification section
|
|
113
|
+
*/
|
|
114
|
+
function generateVerificationSection(verification) {
|
|
115
|
+
const statusIcon = verification.verificationStatus === 'PASSED' ? '✅' :
|
|
116
|
+
verification.verificationStatus === 'FAILED' ? '❌' : '⚠️';
|
|
117
|
+
return `
|
|
118
|
+
<div class="verification-section ${verification.verificationStatus.toLowerCase()}">
|
|
119
|
+
<h3>🔐 Blockchain Verification</h3>
|
|
120
|
+
<div class="verification-status ${verification.verificationStatus.toLowerCase()}">
|
|
121
|
+
${statusIcon} <strong>Status: ${verification.verificationStatus}</strong>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="key-value-pair">
|
|
124
|
+
<div class="key">Blockchain Merkle Root:</div>
|
|
125
|
+
<div class="value"><code>${verification.blockchainMerkleRoot}</code></div>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="key-value-pair">
|
|
128
|
+
<div class="key">Calculated Merkle Root:</div>
|
|
129
|
+
<div class="value"><code>${verification.calculatedMerkleRoot}</code></div>
|
|
130
|
+
</div>
|
|
131
|
+
<div class="key-value-pair">
|
|
132
|
+
<div class="key">Integrity Check:</div>
|
|
133
|
+
<div class="value">${verification.merkleRootMatches ?
|
|
134
|
+
'✅ Archive contents match blockchain record' :
|
|
135
|
+
'❌ Archive contents do not match blockchain record'}</div>
|
|
136
|
+
</div>
|
|
137
|
+
${verification.verificationTime ? `
|
|
138
|
+
<div class="key-value-pair">
|
|
139
|
+
<div class="key">Verified At:</div>
|
|
140
|
+
<div class="value">${new Date(verification.verificationTime * 1000).toUTCString()}</div>
|
|
141
|
+
</div>
|
|
142
|
+
` : ''}
|
|
143
|
+
${verification.blockNumber ? `
|
|
144
|
+
<div class="key-value-pair">
|
|
145
|
+
<div class="key">Block Number:</div>
|
|
146
|
+
<div class="value">${verification.blockNumber}</div>
|
|
147
|
+
</div>
|
|
148
|
+
` : ''}
|
|
149
|
+
</div>
|
|
150
|
+
`;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Generate wallet information section
|
|
154
|
+
*/
|
|
155
|
+
function generateWalletSection(walletInfo) {
|
|
156
|
+
return `
|
|
157
|
+
<div class="wallet-section">
|
|
158
|
+
<h3>👛 Wallet Information</h3>
|
|
159
|
+
<div class="key-value-pair">
|
|
160
|
+
<div class="key">Wallet Address:</div>
|
|
161
|
+
<div class="value"><code>${walletInfo.address}</code></div>
|
|
162
|
+
</div>
|
|
163
|
+
${walletInfo.ensName ? `
|
|
164
|
+
<div class="key-value-pair">
|
|
165
|
+
<div class="key">ENS Name:</div>
|
|
166
|
+
<div class="value">${walletInfo.ensName}</div>
|
|
167
|
+
</div>
|
|
168
|
+
` : ''}
|
|
169
|
+
<div class="key-value-pair">
|
|
170
|
+
<div class="key">Network:</div>
|
|
171
|
+
<div class="value">${walletInfo.network}</div>
|
|
172
|
+
</div>
|
|
173
|
+
${walletInfo.balance ? `
|
|
174
|
+
<div class="key-value-pair">
|
|
175
|
+
<div class="key">Balance:</div>
|
|
176
|
+
<div class="value">${walletInfo.balance}</div>
|
|
177
|
+
</div>
|
|
178
|
+
` : ''}
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Generate files table HTML
|
|
184
|
+
*/
|
|
185
|
+
function generateFilesTable(files) {
|
|
186
|
+
let filesTableHTML = '';
|
|
187
|
+
files.forEach((file) => {
|
|
188
|
+
filesTableHTML += `
|
|
189
|
+
<tr>
|
|
190
|
+
<td class="table-data1">${file.filename}</td>
|
|
191
|
+
<td class="table-data">${file.size.toString()}</td>
|
|
192
|
+
<td class="table-data">${file.date}</td>
|
|
193
|
+
<td class="table-data"><code>${file.hash}</code></td>
|
|
194
|
+
</tr>
|
|
195
|
+
`;
|
|
196
|
+
});
|
|
197
|
+
return filesTableHTML;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get the HTML template for certificates
|
|
201
|
+
*/
|
|
202
|
+
function getCertificateTemplate() {
|
|
203
|
+
return `<!DOCTYPE html>
|
|
204
|
+
<html lang="en">
|
|
205
|
+
<head>
|
|
206
|
+
<meta charset="UTF-8">
|
|
207
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
208
|
+
<title>NFT Token Certificate - {{ZIP_FILE}}</title>
|
|
209
|
+
<style>
|
|
210
|
+
body {
|
|
211
|
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
212
|
+
line-height: 1.6;
|
|
213
|
+
margin: 0;
|
|
214
|
+
padding: 20px;
|
|
215
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
216
|
+
min-height: 100vh;
|
|
217
|
+
}
|
|
218
|
+
.certificate {
|
|
219
|
+
max-width: 900px;
|
|
220
|
+
margin: 0 auto;
|
|
221
|
+
background: white;
|
|
222
|
+
border-radius: 15px;
|
|
223
|
+
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
}
|
|
226
|
+
.header {
|
|
227
|
+
background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
|
|
228
|
+
color: white;
|
|
229
|
+
padding: 30px;
|
|
230
|
+
text-align: center;
|
|
231
|
+
}
|
|
232
|
+
.header h1 {
|
|
233
|
+
margin: 0;
|
|
234
|
+
font-size: 2.5em;
|
|
235
|
+
font-weight: 300;
|
|
236
|
+
}
|
|
237
|
+
.header h2 {
|
|
238
|
+
margin: 10px 0 0 0;
|
|
239
|
+
font-size: 1.2em;
|
|
240
|
+
opacity: 0.9;
|
|
241
|
+
}
|
|
242
|
+
.content {
|
|
243
|
+
padding: 40px;
|
|
244
|
+
}
|
|
245
|
+
.token-section, .verification-section, .wallet-section {
|
|
246
|
+
margin-bottom: 30px;
|
|
247
|
+
padding: 20px;
|
|
248
|
+
border-radius: 10px;
|
|
249
|
+
border-left: 4px solid #3498db;
|
|
250
|
+
background: #f8f9fa;
|
|
251
|
+
}
|
|
252
|
+
.verification-section.passed {
|
|
253
|
+
border-left-color: #27ae60;
|
|
254
|
+
}
|
|
255
|
+
.verification-section.failed {
|
|
256
|
+
border-left-color: #e74c3c;
|
|
257
|
+
}
|
|
258
|
+
.verification-section.unavailable {
|
|
259
|
+
border-left-color: #f39c12;
|
|
260
|
+
}
|
|
261
|
+
.verification-status {
|
|
262
|
+
font-size: 1.2em;
|
|
263
|
+
margin-bottom: 15px;
|
|
264
|
+
padding: 10px;
|
|
265
|
+
border-radius: 5px;
|
|
266
|
+
}
|
|
267
|
+
.verification-status.passed {
|
|
268
|
+
background: #d4edda;
|
|
269
|
+
color: #155724;
|
|
270
|
+
}
|
|
271
|
+
.verification-status.failed {
|
|
272
|
+
background: #f8d7da;
|
|
273
|
+
color: #721c24;
|
|
274
|
+
}
|
|
275
|
+
.verification-status.unavailable {
|
|
276
|
+
background: #fff3cd;
|
|
277
|
+
color: #856404;
|
|
278
|
+
}
|
|
279
|
+
.key-value-pair {
|
|
280
|
+
display: flex;
|
|
281
|
+
margin-bottom: 10px;
|
|
282
|
+
align-items: flex-start;
|
|
283
|
+
}
|
|
284
|
+
.key {
|
|
285
|
+
font-weight: bold;
|
|
286
|
+
min-width: 200px;
|
|
287
|
+
color: #2c3e50;
|
|
288
|
+
}
|
|
289
|
+
.value {
|
|
290
|
+
flex: 1;
|
|
291
|
+
word-break: break-all;
|
|
292
|
+
}
|
|
293
|
+
.value code {
|
|
294
|
+
background: #e9ecef;
|
|
295
|
+
padding: 2px 6px;
|
|
296
|
+
border-radius: 3px;
|
|
297
|
+
font-family: 'Monaco', 'Menlo', monospace;
|
|
298
|
+
font-size: 0.9em;
|
|
299
|
+
}
|
|
300
|
+
.files-section {
|
|
301
|
+
margin-top: 30px;
|
|
302
|
+
}
|
|
303
|
+
.files-table {
|
|
304
|
+
width: 100%;
|
|
305
|
+
border-collapse: collapse;
|
|
306
|
+
margin-top: 15px;
|
|
307
|
+
}
|
|
308
|
+
.files-table th,
|
|
309
|
+
.files-table td {
|
|
310
|
+
padding: 12px;
|
|
311
|
+
text-align: left;
|
|
312
|
+
border-bottom: 1px solid #dee2e6;
|
|
313
|
+
}
|
|
314
|
+
.files-table th {
|
|
315
|
+
background: #f8f9fa;
|
|
316
|
+
font-weight: bold;
|
|
317
|
+
color: #2c3e50;
|
|
318
|
+
}
|
|
319
|
+
.table-data1 {
|
|
320
|
+
font-weight: bold;
|
|
321
|
+
}
|
|
322
|
+
.warning {
|
|
323
|
+
background: #fff3cd;
|
|
324
|
+
color: #856404;
|
|
325
|
+
padding: 15px;
|
|
326
|
+
border-radius: 5px;
|
|
327
|
+
margin-bottom: 20px;
|
|
328
|
+
border-left: 4px solid #ffc107;
|
|
329
|
+
}
|
|
330
|
+
.footer {
|
|
331
|
+
text-align: center;
|
|
332
|
+
padding: 20px;
|
|
333
|
+
background: #f8f9fa;
|
|
334
|
+
color: #6c757d;
|
|
335
|
+
font-size: 0.9em;
|
|
336
|
+
}
|
|
337
|
+
h3 {
|
|
338
|
+
margin-top: 0;
|
|
339
|
+
color: #2c3e50;
|
|
340
|
+
font-size: 1.3em;
|
|
341
|
+
}
|
|
342
|
+
</style>
|
|
343
|
+
</head>
|
|
344
|
+
<body>
|
|
345
|
+
<div class="certificate">
|
|
346
|
+
<div class="header">
|
|
347
|
+
<h1>🎫 NFT Token Certificate</h1>
|
|
348
|
+
<h2>Blockchain-Verified Digital Archive</h2>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<div class="content">
|
|
352
|
+
{{UPDATE_WARNING}}
|
|
353
|
+
|
|
354
|
+
<div class="key-value-pair" style="margin-bottom: 30px; font-size: 1.1em;">
|
|
355
|
+
<div class="key">Archive File:</div>
|
|
356
|
+
<div class="value"><strong>{{ZIP_FILE}}</strong></div>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
{{ATTESTATION_HTML}}
|
|
360
|
+
|
|
361
|
+
<div class="files-section">
|
|
362
|
+
<h3>📁 Archive Contents</h3>
|
|
363
|
+
<table class="files-table">
|
|
364
|
+
<thead>
|
|
365
|
+
<tr>
|
|
366
|
+
<th>File Name</th>
|
|
367
|
+
<th>Size (bytes)</th>
|
|
368
|
+
<th>Date Modified</th>
|
|
369
|
+
<th>SHA256 Hash</th>
|
|
370
|
+
</tr>
|
|
371
|
+
</thead>
|
|
372
|
+
<tbody>
|
|
373
|
+
{{FILES_TABLE_HTML}}
|
|
374
|
+
</tbody>
|
|
375
|
+
</table>
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<div class="footer">
|
|
380
|
+
<p>This certificate verifies the integrity and authenticity of the tokenized archive through blockchain technology.</p>
|
|
381
|
+
<p>Generated on: {{GENERATION_TIME}}</p>
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
</body>
|
|
385
|
+
</html>`;
|
|
386
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
import { MintingResult, ZipTokenData, NFTMetadata } from './types';
|
|
3
|
+
export interface ExistingTokenInfo {
|
|
4
|
+
tokenId: string;
|
|
5
|
+
fileName: string;
|
|
6
|
+
merkleRootHash: string;
|
|
7
|
+
creationTimestamp: number;
|
|
8
|
+
tokenizationTime: number;
|
|
9
|
+
creator: string;
|
|
10
|
+
isOwnedByWallet: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class NFTMinter {
|
|
13
|
+
private wallet;
|
|
14
|
+
private provider;
|
|
15
|
+
constructor(wallet: ethers.Wallet | null, provider: ethers.JsonRpcProvider | null);
|
|
16
|
+
/**
|
|
17
|
+
* Creates NFT metadata for the ZIP archive
|
|
18
|
+
*/
|
|
19
|
+
createNFTMetadata(zipTokenData: ZipTokenData): NFTMetadata;
|
|
20
|
+
/**
|
|
21
|
+
* Loads contract deployment information
|
|
22
|
+
*/
|
|
23
|
+
private loadContractInfo;
|
|
24
|
+
/**
|
|
25
|
+
* Check for existing tokens with the same merkle root
|
|
26
|
+
* This is efficient because it uses the contract's getTokensByMerkleRoot function
|
|
27
|
+
*/
|
|
28
|
+
findExistingTokensByMerkleRoot(merkleRoot: string): Promise<ExistingTokenInfo[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Prompts user to choose between reusing an existing timestamp or creating a new token
|
|
31
|
+
*/
|
|
32
|
+
promptUserChoice(existingTokens: ExistingTokenInfo[], fileName: string): Promise<{
|
|
33
|
+
useExisting: boolean;
|
|
34
|
+
selectedTimestamp?: number;
|
|
35
|
+
selectedTokenId?: string;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Mints an NFT token for the ZIP archive using the timestamped contract
|
|
39
|
+
*/
|
|
40
|
+
mintZipFileNFT(zipTokenData: ZipTokenData): Promise<MintingResult>;
|
|
41
|
+
}
|