@genobank/biofs 2.1.11 → 2.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/ADMIN_REGISTER_LAB.md +252 -0
- package/CHANGELOG_V2.2.0.md +284 -0
- package/LABNFT_BIOFS_INTEGRATION.md +396 -0
- package/dist/commands/admin/index.d.ts +13 -0
- package/dist/commands/admin/index.d.ts.map +1 -0
- package/dist/commands/admin/index.js +25 -0
- package/dist/commands/admin/index.js.map +1 -0
- package/dist/commands/admin/register-lab.d.ts +36 -0
- package/dist/commands/admin/register-lab.d.ts.map +1 -0
- package/dist/commands/admin/register-lab.js +249 -0
- package/dist/commands/admin/register-lab.js.map +1 -0
- package/dist/commands/admin/verify-lab.d.ts +22 -0
- package/dist/commands/admin/verify-lab.d.ts.map +1 -0
- package/dist/commands/admin/verify-lab.js +155 -0
- package/dist/commands/admin/verify-lab.js.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/sequentia/LabNFT.d.ts +174 -0
- package/dist/lib/sequentia/LabNFT.d.ts.map +1 -0
- package/dist/lib/sequentia/LabNFT.js +273 -0
- package/dist/lib/sequentia/LabNFT.js.map +1 -0
- package/dist/lib/sequentia/index.d.ts +3 -0
- package/dist/lib/sequentia/index.d.ts.map +1 -1
- package/dist/lib/sequentia/index.js +9 -2
- package/dist/lib/sequentia/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LabNFT Module - Sequentia Network
|
|
3
|
+
*
|
|
4
|
+
* Manages Lab NFTs for permittee registration on Sequentia blockchain.
|
|
5
|
+
* LabNFTs represent verified research labs, institutions, and researchers
|
|
6
|
+
* with GDPR-compliant consent management and access control.
|
|
7
|
+
*
|
|
8
|
+
* Contract: 0x24f42752F491540e305384A5C947911649C910CF
|
|
9
|
+
* Network: Sequentia L1 (Chain ID: 15132025)
|
|
10
|
+
*
|
|
11
|
+
* @author GenoBank.io - BioFS CLI
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Lab Types
|
|
15
|
+
*/
|
|
16
|
+
export declare enum LabType {
|
|
17
|
+
LAB = 0,
|
|
18
|
+
RESEARCHER = 1,
|
|
19
|
+
INSTITUTION = 2
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Access Levels
|
|
23
|
+
*/
|
|
24
|
+
export declare enum AccessLevel {
|
|
25
|
+
RESEARCH_ONLY = 0,
|
|
26
|
+
CLINICAL_NON_CRITICAL = 1,
|
|
27
|
+
CLINICAL_CRITICAL = 2,
|
|
28
|
+
COMMERCIAL = 3
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* GA4GH Compliance Levels
|
|
32
|
+
*/
|
|
33
|
+
export declare enum GA4GHLevel {
|
|
34
|
+
NONE = 0,
|
|
35
|
+
BASIC = 1,
|
|
36
|
+
LITE = 2,
|
|
37
|
+
FULL = 3
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Lab Information
|
|
41
|
+
*/
|
|
42
|
+
export interface LabInfo {
|
|
43
|
+
serial: number;
|
|
44
|
+
owner: string;
|
|
45
|
+
labType: LabType;
|
|
46
|
+
name: string;
|
|
47
|
+
specialization: string;
|
|
48
|
+
location: string;
|
|
49
|
+
website: string;
|
|
50
|
+
email: string;
|
|
51
|
+
biodataConsentHash: string;
|
|
52
|
+
commercialConsentHash: string;
|
|
53
|
+
accessLevel: AccessLevel;
|
|
54
|
+
ga4ghLevel: GA4GHLevel;
|
|
55
|
+
verified: boolean;
|
|
56
|
+
active: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Mint Lab Options
|
|
60
|
+
*/
|
|
61
|
+
export interface MintLabOptions {
|
|
62
|
+
owner: string;
|
|
63
|
+
labType: LabType;
|
|
64
|
+
name: string;
|
|
65
|
+
specialization: string;
|
|
66
|
+
location: string;
|
|
67
|
+
website: string;
|
|
68
|
+
email: string;
|
|
69
|
+
biodataConsentHash?: string;
|
|
70
|
+
commercialConsentHash?: string;
|
|
71
|
+
accessLevel?: AccessLevel;
|
|
72
|
+
ga4ghLevel?: GA4GHLevel;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* LabNFT Client
|
|
76
|
+
*
|
|
77
|
+
* Manages Lab NFTs on Sequentia Network
|
|
78
|
+
*/
|
|
79
|
+
export declare class LabNFT {
|
|
80
|
+
private provider;
|
|
81
|
+
private wallet;
|
|
82
|
+
private contract;
|
|
83
|
+
/**
|
|
84
|
+
* Initialize LabNFT client
|
|
85
|
+
*
|
|
86
|
+
* @param privateKey - Executor private key (without 0x prefix)
|
|
87
|
+
*/
|
|
88
|
+
constructor(privateKey: string);
|
|
89
|
+
/**
|
|
90
|
+
* Check if wallet has a LabNFT
|
|
91
|
+
*
|
|
92
|
+
* @param wallet - Wallet address to check
|
|
93
|
+
* @returns True if wallet is registered
|
|
94
|
+
*/
|
|
95
|
+
isLabRegistered(wallet: string): Promise<boolean>;
|
|
96
|
+
/**
|
|
97
|
+
* Get lab serial number by wallet
|
|
98
|
+
*
|
|
99
|
+
* @param wallet - Wallet address
|
|
100
|
+
* @returns Serial number (0 if not registered)
|
|
101
|
+
*/
|
|
102
|
+
getSerialByWallet(wallet: string): Promise<number>;
|
|
103
|
+
/**
|
|
104
|
+
* Get lab information by serial
|
|
105
|
+
*
|
|
106
|
+
* @param serial - LabNFT serial number
|
|
107
|
+
* @returns Lab information
|
|
108
|
+
*/
|
|
109
|
+
getLabBySerial(serial: number): Promise<LabInfo>;
|
|
110
|
+
/**
|
|
111
|
+
* Get lab information by wallet address
|
|
112
|
+
*
|
|
113
|
+
* @param wallet - Wallet address
|
|
114
|
+
* @returns Lab information or null if not registered
|
|
115
|
+
*/
|
|
116
|
+
getLabByWallet(wallet: string): Promise<LabInfo | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Get next available serial number
|
|
119
|
+
*
|
|
120
|
+
* @returns Next serial number
|
|
121
|
+
*/
|
|
122
|
+
getNextSerial(): Promise<number>;
|
|
123
|
+
/**
|
|
124
|
+
* Mint a new LabNFT
|
|
125
|
+
*
|
|
126
|
+
* @param options - Lab information
|
|
127
|
+
* @returns Transaction hash and serial number
|
|
128
|
+
*/
|
|
129
|
+
mintLab(options: MintLabOptions): Promise<{
|
|
130
|
+
txHash: string;
|
|
131
|
+
serial: number;
|
|
132
|
+
blockNumber: number;
|
|
133
|
+
}>;
|
|
134
|
+
/**
|
|
135
|
+
* Update lab information
|
|
136
|
+
*
|
|
137
|
+
* @param serial - LabNFT serial number
|
|
138
|
+
* @param updates - Fields to update
|
|
139
|
+
*/
|
|
140
|
+
updateLabInfo(serial: number, updates: {
|
|
141
|
+
name?: string;
|
|
142
|
+
specialization?: string;
|
|
143
|
+
location?: string;
|
|
144
|
+
website?: string;
|
|
145
|
+
email?: string;
|
|
146
|
+
}): Promise<string>;
|
|
147
|
+
/**
|
|
148
|
+
* Set lab verification status
|
|
149
|
+
*
|
|
150
|
+
* @param serial - LabNFT serial number
|
|
151
|
+
* @param verified - Verification status
|
|
152
|
+
*/
|
|
153
|
+
setVerified(serial: number, verified: boolean): Promise<string>;
|
|
154
|
+
/**
|
|
155
|
+
* Generate consent hash
|
|
156
|
+
*
|
|
157
|
+
* @param text - Consent text
|
|
158
|
+
* @returns Keccak256 hash (bytes32)
|
|
159
|
+
*/
|
|
160
|
+
static generateConsentHash(text: string): string;
|
|
161
|
+
/**
|
|
162
|
+
* Get contract address
|
|
163
|
+
*/
|
|
164
|
+
static getContractAddress(): string;
|
|
165
|
+
/**
|
|
166
|
+
* Get network configuration
|
|
167
|
+
*/
|
|
168
|
+
static getNetworkConfig(): {
|
|
169
|
+
rpcUrl: string;
|
|
170
|
+
chainId: number;
|
|
171
|
+
contract: string;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=LabNFT.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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,EAAE,MAAM,GAAG,MAAM;IAIhD;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,MAAM;IAInC;;OAEG;IACH,MAAM,CAAC,gBAAgB;;;;;CAOxB"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LabNFT Module - Sequentia Network
|
|
4
|
+
*
|
|
5
|
+
* Manages Lab NFTs for permittee registration on Sequentia blockchain.
|
|
6
|
+
* LabNFTs represent verified research labs, institutions, and researchers
|
|
7
|
+
* with GDPR-compliant consent management and access control.
|
|
8
|
+
*
|
|
9
|
+
* Contract: 0x24f42752F491540e305384A5C947911649C910CF
|
|
10
|
+
* Network: Sequentia L1 (Chain ID: 15132025)
|
|
11
|
+
*
|
|
12
|
+
* @author GenoBank.io - BioFS CLI
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LabNFT = exports.GA4GHLevel = exports.AccessLevel = exports.LabType = void 0;
|
|
16
|
+
const ethers_1 = require("ethers");
|
|
17
|
+
const index_1 = require("./index");
|
|
18
|
+
// LabNFT Contract Configuration
|
|
19
|
+
const LABNFT_CONTRACT = '0x24f42752F491540e305384A5C947911649C910CF';
|
|
20
|
+
const LABNFT_ABI = [
|
|
21
|
+
// View functions
|
|
22
|
+
'function getLabBySerial(uint256 _serial) external view returns (address owner, uint8 labType, string memory name, string memory specialization, string memory location, string memory website, string memory email, bytes32 biodataConsentHash, bytes32 commercialConsentHash, uint8 accessLevel, uint8 ga4ghLevel, bool verified, bool active)',
|
|
23
|
+
'function getSerialByWallet(address _wallet) external view returns (uint256)',
|
|
24
|
+
'function isLabRegistered(address _wallet) external view returns (bool)',
|
|
25
|
+
'function getNextSerial() external view returns (uint256)',
|
|
26
|
+
// Admin functions (requires executor key)
|
|
27
|
+
'function mintLab(address _owner, uint8 _labType, string memory _name, string memory _specialization, string memory _location, string memory _website, string memory _email, bytes32 _biodataConsentHash, bytes32 _commercialConsentHash, uint8 _accessLevel, uint8 _ga4ghLevel) external returns (uint256)',
|
|
28
|
+
'function updateLabInfo(uint256 _serial, string memory _name, string memory _specialization, string memory _location, string memory _website, string memory _email) external',
|
|
29
|
+
'function setVerified(uint256 _serial, bool _verified) external'
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Lab Types
|
|
33
|
+
*/
|
|
34
|
+
var LabType;
|
|
35
|
+
(function (LabType) {
|
|
36
|
+
LabType[LabType["LAB"] = 0] = "LAB";
|
|
37
|
+
LabType[LabType["RESEARCHER"] = 1] = "RESEARCHER";
|
|
38
|
+
LabType[LabType["INSTITUTION"] = 2] = "INSTITUTION";
|
|
39
|
+
})(LabType || (exports.LabType = LabType = {}));
|
|
40
|
+
/**
|
|
41
|
+
* Access Levels
|
|
42
|
+
*/
|
|
43
|
+
var AccessLevel;
|
|
44
|
+
(function (AccessLevel) {
|
|
45
|
+
AccessLevel[AccessLevel["RESEARCH_ONLY"] = 0] = "RESEARCH_ONLY";
|
|
46
|
+
AccessLevel[AccessLevel["CLINICAL_NON_CRITICAL"] = 1] = "CLINICAL_NON_CRITICAL";
|
|
47
|
+
AccessLevel[AccessLevel["CLINICAL_CRITICAL"] = 2] = "CLINICAL_CRITICAL";
|
|
48
|
+
AccessLevel[AccessLevel["COMMERCIAL"] = 3] = "COMMERCIAL";
|
|
49
|
+
})(AccessLevel || (exports.AccessLevel = AccessLevel = {}));
|
|
50
|
+
/**
|
|
51
|
+
* GA4GH Compliance Levels
|
|
52
|
+
*/
|
|
53
|
+
var GA4GHLevel;
|
|
54
|
+
(function (GA4GHLevel) {
|
|
55
|
+
GA4GHLevel[GA4GHLevel["NONE"] = 0] = "NONE";
|
|
56
|
+
GA4GHLevel[GA4GHLevel["BASIC"] = 1] = "BASIC";
|
|
57
|
+
GA4GHLevel[GA4GHLevel["LITE"] = 2] = "LITE";
|
|
58
|
+
GA4GHLevel[GA4GHLevel["FULL"] = 3] = "FULL";
|
|
59
|
+
})(GA4GHLevel || (exports.GA4GHLevel = GA4GHLevel = {}));
|
|
60
|
+
/**
|
|
61
|
+
* LabNFT Client
|
|
62
|
+
*
|
|
63
|
+
* Manages Lab NFTs on Sequentia Network
|
|
64
|
+
*/
|
|
65
|
+
class LabNFT {
|
|
66
|
+
/**
|
|
67
|
+
* Initialize LabNFT client
|
|
68
|
+
*
|
|
69
|
+
* @param privateKey - Executor private key (without 0x prefix)
|
|
70
|
+
*/
|
|
71
|
+
constructor(privateKey) {
|
|
72
|
+
this.provider = new ethers_1.ethers.JsonRpcProvider(index_1.SEQUENTIA_CONFIG.rpcUrl);
|
|
73
|
+
this.wallet = new ethers_1.ethers.Wallet(privateKey.startsWith('0x') ? privateKey : `0x${privateKey}`, this.provider);
|
|
74
|
+
this.contract = new ethers_1.ethers.Contract(LABNFT_CONTRACT, LABNFT_ABI, this.wallet);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Check if wallet has a LabNFT
|
|
78
|
+
*
|
|
79
|
+
* @param wallet - Wallet address to check
|
|
80
|
+
* @returns True if wallet is registered
|
|
81
|
+
*/
|
|
82
|
+
async isLabRegistered(wallet) {
|
|
83
|
+
try {
|
|
84
|
+
return await this.contract.isLabRegistered(wallet);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
throw new Error(`Failed to check lab registration: ${error.message}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get lab serial number by wallet
|
|
92
|
+
*
|
|
93
|
+
* @param wallet - Wallet address
|
|
94
|
+
* @returns Serial number (0 if not registered)
|
|
95
|
+
*/
|
|
96
|
+
async getSerialByWallet(wallet) {
|
|
97
|
+
try {
|
|
98
|
+
const serial = await this.contract.getSerialByWallet(wallet);
|
|
99
|
+
return Number(serial);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
throw new Error(`Failed to get lab serial: ${error.message}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get lab information by serial
|
|
107
|
+
*
|
|
108
|
+
* @param serial - LabNFT serial number
|
|
109
|
+
* @returns Lab information
|
|
110
|
+
*/
|
|
111
|
+
async getLabBySerial(serial) {
|
|
112
|
+
try {
|
|
113
|
+
const result = await this.contract.getLabBySerial(serial);
|
|
114
|
+
return {
|
|
115
|
+
serial,
|
|
116
|
+
owner: result[0],
|
|
117
|
+
labType: result[1],
|
|
118
|
+
name: result[2],
|
|
119
|
+
specialization: result[3],
|
|
120
|
+
location: result[4],
|
|
121
|
+
website: result[5],
|
|
122
|
+
email: result[6],
|
|
123
|
+
biodataConsentHash: result[7],
|
|
124
|
+
commercialConsentHash: result[8],
|
|
125
|
+
accessLevel: result[9],
|
|
126
|
+
ga4ghLevel: result[10],
|
|
127
|
+
verified: result[11],
|
|
128
|
+
active: result[12]
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
throw new Error(`Failed to get lab info: ${error.message}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Get lab information by wallet address
|
|
137
|
+
*
|
|
138
|
+
* @param wallet - Wallet address
|
|
139
|
+
* @returns Lab information or null if not registered
|
|
140
|
+
*/
|
|
141
|
+
async getLabByWallet(wallet) {
|
|
142
|
+
try {
|
|
143
|
+
const serial = await this.getSerialByWallet(wallet);
|
|
144
|
+
if (serial === 0)
|
|
145
|
+
return null;
|
|
146
|
+
return await this.getLabBySerial(serial);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
throw new Error(`Failed to get lab by wallet: ${error.message}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get next available serial number
|
|
154
|
+
*
|
|
155
|
+
* @returns Next serial number
|
|
156
|
+
*/
|
|
157
|
+
async getNextSerial() {
|
|
158
|
+
try {
|
|
159
|
+
const serial = await this.contract.getNextSerial();
|
|
160
|
+
return Number(serial);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
throw new Error(`Failed to get next serial: ${error.message}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Mint a new LabNFT
|
|
168
|
+
*
|
|
169
|
+
* @param options - Lab information
|
|
170
|
+
* @returns Transaction hash and serial number
|
|
171
|
+
*/
|
|
172
|
+
async mintLab(options) {
|
|
173
|
+
try {
|
|
174
|
+
// Generate consent hashes if not provided
|
|
175
|
+
const biodataHash = options.biodataConsentHash ||
|
|
176
|
+
ethers_1.ethers.keccak256(ethers_1.ethers.toUtf8Bytes(`Generated consent for ${options.name}`));
|
|
177
|
+
const commercialHash = options.commercialConsentHash ||
|
|
178
|
+
ethers_1.ethers.keccak256(ethers_1.ethers.toUtf8Bytes(`No commercial consent - ${options.name}`));
|
|
179
|
+
// Ensure both hashes are bytes32 format (0x + 64 hex chars)
|
|
180
|
+
if (biodataHash.length !== 66) {
|
|
181
|
+
throw new Error(`Invalid biodata consent hash length: ${biodataHash.length}`);
|
|
182
|
+
}
|
|
183
|
+
if (commercialHash.length !== 66) {
|
|
184
|
+
throw new Error(`Invalid commercial consent hash length: ${commercialHash.length}`);
|
|
185
|
+
}
|
|
186
|
+
// Build transaction
|
|
187
|
+
const tx = await this.contract.mintLab(options.owner, options.labType, options.name, options.specialization, options.location, options.website, options.email, biodataHash, commercialHash, options.accessLevel ?? AccessLevel.RESEARCH_ONLY, options.ga4ghLevel ?? GA4GHLevel.NONE);
|
|
188
|
+
// Wait for confirmation
|
|
189
|
+
const receipt = await tx.wait();
|
|
190
|
+
if (receipt.status !== 1) {
|
|
191
|
+
throw new Error('Transaction reverted');
|
|
192
|
+
}
|
|
193
|
+
// Get minted serial
|
|
194
|
+
const serial = await this.getSerialByWallet(options.owner);
|
|
195
|
+
return {
|
|
196
|
+
txHash: receipt.hash,
|
|
197
|
+
serial,
|
|
198
|
+
blockNumber: receipt.blockNumber
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
throw new Error(`Failed to mint LabNFT: ${error.message}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Update lab information
|
|
207
|
+
*
|
|
208
|
+
* @param serial - LabNFT serial number
|
|
209
|
+
* @param updates - Fields to update
|
|
210
|
+
*/
|
|
211
|
+
async updateLabInfo(serial, updates) {
|
|
212
|
+
try {
|
|
213
|
+
// Get current lab info
|
|
214
|
+
const current = await this.getLabBySerial(serial);
|
|
215
|
+
// Build transaction
|
|
216
|
+
const tx = await this.contract.updateLabInfo(serial, updates.name ?? current.name, updates.specialization ?? current.specialization, updates.location ?? current.location, updates.website ?? current.website, updates.email ?? current.email);
|
|
217
|
+
const receipt = await tx.wait();
|
|
218
|
+
if (receipt.status !== 1) {
|
|
219
|
+
throw new Error('Transaction reverted');
|
|
220
|
+
}
|
|
221
|
+
return receipt.hash;
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
throw new Error(`Failed to update lab info: ${error.message}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Set lab verification status
|
|
229
|
+
*
|
|
230
|
+
* @param serial - LabNFT serial number
|
|
231
|
+
* @param verified - Verification status
|
|
232
|
+
*/
|
|
233
|
+
async setVerified(serial, verified) {
|
|
234
|
+
try {
|
|
235
|
+
const tx = await this.contract.setVerified(serial, verified);
|
|
236
|
+
const receipt = await tx.wait();
|
|
237
|
+
if (receipt.status !== 1) {
|
|
238
|
+
throw new Error('Transaction reverted');
|
|
239
|
+
}
|
|
240
|
+
return receipt.hash;
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
throw new Error(`Failed to set verification: ${error.message}`);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Generate consent hash
|
|
248
|
+
*
|
|
249
|
+
* @param text - Consent text
|
|
250
|
+
* @returns Keccak256 hash (bytes32)
|
|
251
|
+
*/
|
|
252
|
+
static generateConsentHash(text) {
|
|
253
|
+
return ethers_1.ethers.keccak256(ethers_1.ethers.toUtf8Bytes(text));
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get contract address
|
|
257
|
+
*/
|
|
258
|
+
static getContractAddress() {
|
|
259
|
+
return LABNFT_CONTRACT;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Get network configuration
|
|
263
|
+
*/
|
|
264
|
+
static getNetworkConfig() {
|
|
265
|
+
return {
|
|
266
|
+
rpcUrl: index_1.SEQUENTIA_CONFIG.rpcUrl,
|
|
267
|
+
chainId: index_1.SEQUENTIA_CONFIG.chainId,
|
|
268
|
+
contract: LABNFT_CONTRACT
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
exports.LabNFT = LabNFT;
|
|
273
|
+
//# sourceMappingURL=LabNFT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabNFT.js","sourceRoot":"","sources":["../../../src/lib/sequentia/LabNFT.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,mCAAgC;AAChC,mCAA2C;AAE3C,gCAAgC;AAChC,MAAM,eAAe,GAAG,4CAA4C,CAAC;AACrE,MAAM,UAAU,GAAG;IACjB,iBAAiB;IACjB,iVAAiV;IACjV,6EAA6E;IAC7E,wEAAwE;IACxE,0DAA0D;IAE1D,0CAA0C;IAC1C,4SAA4S;IAC5S,6KAA6K;IAC7K,gEAAgE;CACjE,CAAC;AAEF;;GAEG;AACH,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,mCAAO,CAAA;IACP,iDAAc,CAAA;IACd,mDAAe,CAAA;AACjB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB;AAED;;GAEG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,+DAAiB,CAAA;IACjB,+EAAyB,CAAA;IACzB,uEAAqB,CAAA;I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AAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACrB,OAAO;YACL,MAAM,EAAE,wBAAgB,CAAC,MAAM;YAC/B,OAAO,EAAE,wBAAgB,CAAC,OAAO;YACjC,QAAQ,EAAE,eAAe;SAC1B,CAAC;IACJ,CAAC;CACF;AAhQD,wBAgQC"}
|
|
@@ -18,6 +18,7 @@ export { ConsentManager, ConsentStatus, ConsentType, type ConsentRecord, type Ac
|
|
|
18
18
|
export { BioPIL, BioPILLicenseType, type LicenseTerms, type LicenseToken, type AccessResult } from './BioPIL';
|
|
19
19
|
export { OpenCravatJobs, JobStatus, type Job, type PaymentRoute, type LabProfile } from './OpenCravatJobs';
|
|
20
20
|
export { PaymentRouter, type PaymentRecipient } from './PaymentRouter';
|
|
21
|
+
export { LabNFT, LabType, AccessLevel, GA4GHLevel, type LabInfo, type MintLabOptions } from './LabNFT';
|
|
21
22
|
export { BloomFilterFingerprint, calculateFingerprint, extractPhenotypeSubset, type SNP } from './BloomFilter';
|
|
22
23
|
export declare const SEQUENTIA_CONFIG: {
|
|
23
24
|
rpcUrl: string;
|
|
@@ -30,6 +31,7 @@ import { ConsentManager as ConsentManagerClass } from './ConsentManager';
|
|
|
30
31
|
import { BioPIL as BioPILClass } from './BioPIL';
|
|
31
32
|
import { OpenCravatJobs as OpenCravatJobsClass } from './OpenCravatJobs';
|
|
32
33
|
import { PaymentRouter as PaymentRouterClass } from './PaymentRouter';
|
|
34
|
+
import { LabNFT as LabNFTClass } from './LabNFT';
|
|
33
35
|
/**
|
|
34
36
|
* Initialize Sequentia Protocol client
|
|
35
37
|
*
|
|
@@ -42,5 +44,6 @@ export declare function initializeSequentia(privateKey: string): {
|
|
|
42
44
|
bioPIL: BioPILClass;
|
|
43
45
|
openCravatJobs: OpenCravatJobsClass;
|
|
44
46
|
paymentRouter: PaymentRouterClass;
|
|
47
|
+
labNFT: LabNFTClass;
|
|
45
48
|
};
|
|
46
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/sequentia/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7G,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/sequentia/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7G,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGvG,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAG/G,eAAO,MAAM,gBAAgB;;;;;CAK5B,CAAC;AAGF,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM;;;;;;;EASrD"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - x402 atomic USDC payments
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.SEQUENTIA_CONFIG = exports.extractPhenotypeSubset = exports.calculateFingerprint = exports.BloomFilterFingerprint = exports.PaymentRouter = exports.JobStatus = exports.OpenCravatJobs = exports.BioPILLicenseType = exports.BioPIL = exports.ConsentType = exports.ConsentStatus = exports.ConsentManager = exports.FileFormat = exports.BioCIDRegistry = void 0;
|
|
18
|
+
exports.SEQUENTIA_CONFIG = exports.extractPhenotypeSubset = exports.calculateFingerprint = exports.BloomFilterFingerprint = exports.GA4GHLevel = exports.AccessLevel = exports.LabType = exports.LabNFT = exports.PaymentRouter = exports.JobStatus = exports.OpenCravatJobs = exports.BioPILLicenseType = exports.BioPIL = exports.ConsentType = exports.ConsentStatus = exports.ConsentManager = exports.FileFormat = exports.BioCIDRegistry = void 0;
|
|
19
19
|
exports.initializeSequentia = initializeSequentia;
|
|
20
20
|
// Core Modules
|
|
21
21
|
var BioCIDRegistry_1 = require("./BioCIDRegistry");
|
|
@@ -33,6 +33,11 @@ Object.defineProperty(exports, "OpenCravatJobs", { enumerable: true, get: functi
|
|
|
33
33
|
Object.defineProperty(exports, "JobStatus", { enumerable: true, get: function () { return OpenCravatJobs_1.JobStatus; } });
|
|
34
34
|
var PaymentRouter_1 = require("./PaymentRouter");
|
|
35
35
|
Object.defineProperty(exports, "PaymentRouter", { enumerable: true, get: function () { return PaymentRouter_1.PaymentRouter; } });
|
|
36
|
+
var LabNFT_1 = require("./LabNFT");
|
|
37
|
+
Object.defineProperty(exports, "LabNFT", { enumerable: true, get: function () { return LabNFT_1.LabNFT; } });
|
|
38
|
+
Object.defineProperty(exports, "LabType", { enumerable: true, get: function () { return LabNFT_1.LabType; } });
|
|
39
|
+
Object.defineProperty(exports, "AccessLevel", { enumerable: true, get: function () { return LabNFT_1.AccessLevel; } });
|
|
40
|
+
Object.defineProperty(exports, "GA4GHLevel", { enumerable: true, get: function () { return LabNFT_1.GA4GHLevel; } });
|
|
36
41
|
// Fingerprinting
|
|
37
42
|
var BloomFilter_1 = require("./BloomFilter");
|
|
38
43
|
Object.defineProperty(exports, "BloomFilterFingerprint", { enumerable: true, get: function () { return BloomFilter_1.BloomFilterFingerprint; } });
|
|
@@ -51,6 +56,7 @@ const ConsentManager_2 = require("./ConsentManager");
|
|
|
51
56
|
const BioPIL_2 = require("./BioPIL");
|
|
52
57
|
const OpenCravatJobs_2 = require("./OpenCravatJobs");
|
|
53
58
|
const PaymentRouter_2 = require("./PaymentRouter");
|
|
59
|
+
const LabNFT_2 = require("./LabNFT");
|
|
54
60
|
/**
|
|
55
61
|
* Initialize Sequentia Protocol client
|
|
56
62
|
*
|
|
@@ -63,7 +69,8 @@ function initializeSequentia(privateKey) {
|
|
|
63
69
|
consentManager: new ConsentManager_2.ConsentManager(privateKey),
|
|
64
70
|
bioPIL: new BioPIL_2.BioPIL(privateKey),
|
|
65
71
|
openCravatJobs: new OpenCravatJobs_2.OpenCravatJobs(privateKey),
|
|
66
|
-
paymentRouter: new PaymentRouter_2.PaymentRouter(privateKey)
|
|
72
|
+
paymentRouter: new PaymentRouter_2.PaymentRouter(privateKey),
|
|
73
|
+
labNFT: new LabNFT_2.LabNFT(privateKey)
|
|
67
74
|
};
|
|
68
75
|
}
|
|
69
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/sequentia/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/sequentia/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAmCH,kDASC;AA1CD,eAAe;AACf,mDAA6G;AAApG,gHAAA,cAAc,OAAA;AAAE,4GAAA,UAAU,OAAA;AACnC,mDAAkH;AAAzG,gHAAA,cAAc,OAAA;AAAE,+GAAA,aAAa,OAAA;AAAE,6GAAA,WAAW,OAAA;AACnD,mCAA8G;AAArG,gGAAA,MAAM,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAClC,mDAA2G;AAAlG,gHAAA,cAAc,OAAA;AAAE,2GAAA,SAAS,OAAA;AAClC,iDAAuE;AAA9D,8GAAA,aAAa,OAAA;AACtB,mCAAuG;AAA9F,gGAAA,MAAM,OAAA;AAAE,iGAAA,OAAO,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,oGAAA,UAAU,OAAA;AAEjD,iBAAiB;AACjB,6CAA+G;AAAtG,qHAAA,sBAAsB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAAE,qHAAA,sBAAsB,OAAA;AAE7E,wBAAwB;AACX,QAAA,gBAAgB,GAAG;IAC5B,MAAM,EAAE,2BAA2B;IACnC,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,4CAA4C;IACvD,aAAa,EAAE,4CAA4C;CAC9D,CAAC;AAEF,oCAAoC;AACpC,qDAAyE;AACzE,qDAAyE;AACzE,qCAAiD;AACjD,qDAAyE;AACzE,mDAAsE;AACtE,qCAAiD;AAEjD;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,UAAkB;IAClD,OAAO;QACH,cAAc,EAAE,IAAI,+BAAmB,CAAC,UAAU,CAAC;QACnD,cAAc,EAAE,IAAI,+BAAmB,CAAC,UAAU,CAAC;QACnD,MAAM,EAAE,IAAI,eAAW,CAAC,UAAU,CAAC;QACnC,cAAc,EAAE,IAAI,+BAAmB,CAAC,UAAU,CAAC;QACnD,aAAa,EAAE,IAAI,6BAAkB,CAAC,UAAU,CAAC;QACjD,MAAM,EAAE,IAAI,eAAW,CAAC,UAAU,CAAC;KACtC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genobank/biofs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "BioFS - GenoBank.io BioNFT-Gated Filesystem CLI with Sequentia Protocol (BioCIDRegistry, ConsentManager, BioPIL) - 97% cost savings vs Story Protocol",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"form-data": "^4.0.0",
|
|
27
27
|
"fs-extra": "^11.2.0",
|
|
28
28
|
"inquirer": "^8.2.6",
|
|
29
|
+
"mongodb": "^6.20.0",
|
|
29
30
|
"open": "^8.4.2",
|
|
30
31
|
"ora": "^5.4.1",
|
|
31
32
|
"uuid": "^9.0.0"
|