holosphere 2.0.0-alpha2 → 2.0.0-alpha4
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/dist/2019-D2OG2idw.js +6680 -0
- package/dist/2019-D2OG2idw.js.map +1 -0
- package/dist/2019-EION3wKo.cjs +8 -0
- package/dist/2019-EION3wKo.cjs.map +1 -0
- package/dist/_commonjsHelpers-C37NGDzP.cjs +2 -0
- package/dist/_commonjsHelpers-C37NGDzP.cjs.map +1 -0
- package/dist/_commonjsHelpers-CUmg6egw.js +7 -0
- package/dist/_commonjsHelpers-CUmg6egw.js.map +1 -0
- package/dist/browser-BSniCNqO.js +3058 -0
- package/dist/browser-BSniCNqO.js.map +1 -0
- package/dist/browser-Cq59Ij19.cjs +2 -0
- package/dist/browser-Cq59Ij19.cjs.map +1 -0
- package/dist/cjs/holosphere.cjs +1 -1
- package/dist/esm/holosphere.js +50 -53
- package/dist/index-BB_vVJgv.cjs +5 -0
- package/dist/index-BB_vVJgv.cjs.map +1 -0
- package/dist/index-CBitK71M.cjs +12 -0
- package/dist/index-CBitK71M.cjs.map +1 -0
- package/dist/index-CV0eOogK.js +37423 -0
- package/dist/index-CV0eOogK.js.map +1 -0
- package/dist/index-Cz-PLCUR.js +15104 -0
- package/dist/index-Cz-PLCUR.js.map +1 -0
- package/dist/indexeddb-storage-CRsZyB2f.cjs +2 -0
- package/dist/indexeddb-storage-CRsZyB2f.cjs.map +1 -0
- package/dist/{indexeddb-storage-CMW4qRQS.js → indexeddb-storage-DZaGlY_a.js} +49 -13
- package/dist/indexeddb-storage-DZaGlY_a.js.map +1 -0
- package/dist/{memory-storage-DQzcAZlf.js → memory-storage-BkUi6sZG.js} +6 -2
- package/dist/memory-storage-BkUi6sZG.js.map +1 -0
- package/dist/{memory-storage-DmePEP2q.cjs → memory-storage-C0DuUsdY.cjs} +2 -2
- package/dist/memory-storage-C0DuUsdY.cjs.map +1 -0
- package/dist/secp256k1-0kPdAVkK.cjs +12 -0
- package/dist/secp256k1-0kPdAVkK.cjs.map +1 -0
- package/dist/{secp256k1-vOXp40Fx.js → secp256k1-DN4FVXcv.js} +2 -393
- package/dist/secp256k1-DN4FVXcv.js.map +1 -0
- package/docs/CONTRACTS.md +797 -0
- package/examples/demo.html +47 -0
- package/package.json +10 -5
- package/src/contracts/abis/Appreciative.json +1280 -0
- package/src/contracts/abis/AppreciativeFactory.json +101 -0
- package/src/contracts/abis/Bundle.json +1435 -0
- package/src/contracts/abis/BundleFactory.json +106 -0
- package/src/contracts/abis/Holon.json +881 -0
- package/src/contracts/abis/Holons.json +330 -0
- package/src/contracts/abis/Managed.json +1262 -0
- package/src/contracts/abis/ManagedFactory.json +149 -0
- package/src/contracts/abis/Membrane.json +261 -0
- package/src/contracts/abis/Splitter.json +1624 -0
- package/src/contracts/abis/SplitterFactory.json +220 -0
- package/src/contracts/abis/TestToken.json +321 -0
- package/src/contracts/abis/Zoned.json +1461 -0
- package/src/contracts/abis/ZonedFactory.json +154 -0
- package/src/contracts/chain-manager.js +375 -0
- package/src/contracts/deployer.js +443 -0
- package/src/contracts/event-listener.js +507 -0
- package/src/contracts/holon-contracts.js +344 -0
- package/src/contracts/index.js +83 -0
- package/src/contracts/networks.js +224 -0
- package/src/contracts/operations.js +670 -0
- package/src/contracts/queries.js +589 -0
- package/src/core/holosphere.js +453 -1
- package/src/crypto/nostr-utils.js +263 -0
- package/src/federation/handshake.js +455 -0
- package/src/federation/hologram.js +1 -1
- package/src/hierarchical/upcast.js +6 -5
- package/src/index.js +463 -1939
- package/src/lib/ai-methods.js +308 -0
- package/src/lib/contract-methods.js +293 -0
- package/src/lib/errors.js +23 -0
- package/src/lib/federation-methods.js +238 -0
- package/src/lib/index.js +26 -0
- package/src/spatial/h3-operations.js +2 -2
- package/src/storage/backends/gundb-backend.js +377 -46
- package/src/storage/global-tables.js +28 -1
- package/src/storage/gun-auth.js +303 -0
- package/src/storage/gun-federation.js +776 -0
- package/src/storage/gun-references.js +198 -0
- package/src/storage/gun-schema.js +291 -0
- package/src/storage/gun-wrapper.js +347 -31
- package/src/storage/indexeddb-storage.js +49 -11
- package/src/storage/memory-storage.js +5 -0
- package/src/storage/nostr-async.js +45 -23
- package/src/storage/nostr-client.js +11 -5
- package/src/storage/persistent-storage.js +6 -1
- package/src/storage/unified-storage.js +119 -0
- package/src/subscriptions/manager.js +1 -1
- package/types/index.d.ts +133 -0
- package/dist/index-CDfIuXew.js +0 -15974
- package/dist/index-CDfIuXew.js.map +0 -1
- package/dist/index-ifOgtDvd.cjs +0 -3
- package/dist/index-ifOgtDvd.cjs.map +0 -1
- package/dist/indexeddb-storage-CMW4qRQS.js.map +0 -1
- package/dist/indexeddb-storage-DLZOgetM.cjs +0 -2
- package/dist/indexeddb-storage-DLZOgetM.cjs.map +0 -1
- package/dist/memory-storage-DQzcAZlf.js.map +0 -1
- package/dist/memory-storage-DmePEP2q.cjs.map +0 -1
- package/dist/secp256k1-CP0ZkpAx.cjs +0 -13
- package/dist/secp256k1-CP0ZkpAx.cjs.map +0 -1
- package/dist/secp256k1-vOXp40Fx.js.map +0 -1
|
@@ -96,13 +96,17 @@ export async function nostrGet(client, path, kind = 30000, options = {}) {
|
|
|
96
96
|
|
|
97
97
|
try {
|
|
98
98
|
const data = JSON.parse(event.content);
|
|
99
|
+
// Skip deleted items
|
|
100
|
+
if (data._deleted) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
99
103
|
// Optionally include author information
|
|
100
104
|
if (options.includeAuthor) {
|
|
101
105
|
data._author = event.pubkey;
|
|
102
106
|
}
|
|
103
107
|
return data;
|
|
104
108
|
} catch (error) {
|
|
105
|
-
|
|
109
|
+
// Silent - return null for unparseable events
|
|
106
110
|
return null;
|
|
107
111
|
}
|
|
108
112
|
}
|
|
@@ -143,8 +147,11 @@ export async function nostrGetAll(client, pathPrefix, kind = 30000, options = {}
|
|
|
143
147
|
try {
|
|
144
148
|
const data = JSON.parse(event.content);
|
|
145
149
|
|
|
146
|
-
//
|
|
147
|
-
if (data._deleted)
|
|
150
|
+
// Handle deleted items - remove from map if this is newer
|
|
151
|
+
if (data._deleted) {
|
|
152
|
+
byPath.delete(path);
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
148
155
|
|
|
149
156
|
// Optionally include author information
|
|
150
157
|
if (options.includeAuthor) {
|
|
@@ -192,8 +199,11 @@ export async function nostrGetAll(client, pathPrefix, kind = 30000, options = {}
|
|
|
192
199
|
try {
|
|
193
200
|
const data = JSON.parse(event.content);
|
|
194
201
|
|
|
195
|
-
//
|
|
196
|
-
if (data._deleted)
|
|
202
|
+
// Handle deleted items - remove from map if this is newer
|
|
203
|
+
if (data._deleted) {
|
|
204
|
+
byPath.delete(dTag);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
197
207
|
|
|
198
208
|
// Optionally include author information
|
|
199
209
|
if (options.includeAuthor) {
|
|
@@ -201,7 +211,7 @@ export async function nostrGetAll(client, pathPrefix, kind = 30000, options = {}
|
|
|
201
211
|
}
|
|
202
212
|
byPath.set(dTag, { data, created_at: event.created_at });
|
|
203
213
|
} catch (error) {
|
|
204
|
-
|
|
214
|
+
// Silent - skip unparseable events
|
|
205
215
|
}
|
|
206
216
|
}
|
|
207
217
|
}
|
|
@@ -252,13 +262,22 @@ export async function nostrGetAllHybrid(client, pathPrefix, kind = 30000, option
|
|
|
252
262
|
if (!existing || event.created_at > existing.created_at) {
|
|
253
263
|
try {
|
|
254
264
|
const data = JSON.parse(event.content);
|
|
265
|
+
// Skip null or non-object content
|
|
266
|
+
if (data === null || typeof data !== 'object') {
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
// Handle deleted items - remove from map if this is newer
|
|
270
|
+
if (data._deleted) {
|
|
271
|
+
byPath.delete(dTag);
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
255
274
|
// Optionally include author information
|
|
256
275
|
if (options.includeAuthor) {
|
|
257
276
|
data._author = event.pubkey;
|
|
258
277
|
}
|
|
259
278
|
byPath.set(dTag, { data, created_at: event.created_at });
|
|
260
279
|
} catch (error) {
|
|
261
|
-
|
|
280
|
+
// Silent - skip unparseable events
|
|
262
281
|
}
|
|
263
282
|
}
|
|
264
283
|
}
|
|
@@ -319,14 +338,10 @@ export async function nostrDelete(client, path, kind = 30000) {
|
|
|
319
338
|
|
|
320
339
|
// Publish deletion event (best effort, don't block on failure)
|
|
321
340
|
try {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
coordinate,
|
|
325
|
-
relays: publishResult?.relays?.length || 0,
|
|
326
|
-
successful: publishResult?.successful || []
|
|
327
|
-
});
|
|
341
|
+
await client.publish(deletionEvent);
|
|
342
|
+
// Silent success - deletion queued
|
|
328
343
|
} catch (error) {
|
|
329
|
-
|
|
344
|
+
// Silent - deletion will be retried
|
|
330
345
|
}
|
|
331
346
|
|
|
332
347
|
return result;
|
|
@@ -438,15 +453,10 @@ export async function nostrDeleteAll(client, pathPrefix, kind = 30000) {
|
|
|
438
453
|
content: '', // Optional deletion reason/note
|
|
439
454
|
};
|
|
440
455
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
itemsDeleted: matching.length,
|
|
444
|
-
coordinates: coordinates.length,
|
|
445
|
-
relays: publishResult?.relays?.length || 0,
|
|
446
|
-
successful: publishResult?.successful || []
|
|
447
|
-
});
|
|
456
|
+
await client.publish(deletionEvent);
|
|
457
|
+
// Silent success - bulk deletion queued
|
|
448
458
|
} catch (error) {
|
|
449
|
-
|
|
459
|
+
// Silent - bulk deletion will be retried
|
|
450
460
|
}
|
|
451
461
|
|
|
452
462
|
return {
|
|
@@ -492,6 +502,12 @@ export function nostrSubscribe(client, path, callback, options = {}) {
|
|
|
492
502
|
|
|
493
503
|
try {
|
|
494
504
|
const data = JSON.parse(event.content);
|
|
505
|
+
|
|
506
|
+
// Skip deleted items - don't send tombstones to subscribers
|
|
507
|
+
if (data._deleted) {
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
|
|
495
511
|
callback(data, event);
|
|
496
512
|
} catch (error) {
|
|
497
513
|
console.error('Failed to parse event in subscription:', error);
|
|
@@ -589,9 +605,15 @@ export async function nostrSubscribeMany(client, pathPrefix, callback, options =
|
|
|
589
605
|
|
|
590
606
|
// Client-side prefix filter
|
|
591
607
|
if (dTag && dTag.startsWith(pathPrefix)) {
|
|
592
|
-
acceptedCount++;
|
|
593
608
|
try {
|
|
594
609
|
const data = JSON.parse(event.content);
|
|
610
|
+
|
|
611
|
+
// Skip deleted items - don't send tombstones to subscribers
|
|
612
|
+
if (data._deleted) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
acceptedCount++;
|
|
595
617
|
// Notify all registered callbacks
|
|
596
618
|
for (const cb of callbacks) {
|
|
597
619
|
cb(data, dTag, event);
|
|
@@ -256,8 +256,8 @@ export class NostrClient {
|
|
|
256
256
|
};
|
|
257
257
|
} else {
|
|
258
258
|
// Fire and forget - publish in background, return immediately
|
|
259
|
-
this._attemptDelivery(signedEvent, this.relays).catch(
|
|
260
|
-
|
|
259
|
+
this._attemptDelivery(signedEvent, this.relays).catch(() => {
|
|
260
|
+
// Silent - event is cached locally and queued for retry
|
|
261
261
|
});
|
|
262
262
|
|
|
263
263
|
// Return immediately (data is in local cache and queued for delivery)
|
|
@@ -305,13 +305,19 @@ export class NostrClient {
|
|
|
305
305
|
await this.outboxQueue.markSent(event.id, successful);
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
// Log failures
|
|
309
|
-
if (failed.length > 0) {
|
|
308
|
+
// Log failures only at debug level (common during network issues)
|
|
309
|
+
if (failed.length > 0 && successful.length === 0) {
|
|
310
|
+
// Only warn if ALL relays failed (likely a real issue)
|
|
310
311
|
const reasons = results
|
|
311
312
|
.filter(r => r.status === 'rejected')
|
|
312
313
|
.map(f => f.reason?.message || f.reason || 'unknown')
|
|
313
314
|
.join(', ');
|
|
314
|
-
|
|
315
|
+
// Use debug level for timeout issues (very common)
|
|
316
|
+
if (reasons.includes('timed out')) {
|
|
317
|
+
// Silent - event is queued for retry anyway
|
|
318
|
+
} else {
|
|
319
|
+
console.warn(`[nostr] All relays failed for ${event.id.slice(0, 8)}: ${reasons}`);
|
|
320
|
+
}
|
|
315
321
|
}
|
|
316
322
|
|
|
317
323
|
return { successful, failed, results: formattedResults };
|
|
@@ -10,6 +10,7 @@ class PersistentStorage {
|
|
|
10
10
|
/**
|
|
11
11
|
* Initialize storage
|
|
12
12
|
* @param {string} namespace - Storage namespace (appName)
|
|
13
|
+
* @returns {Promise<void>}
|
|
13
14
|
*/
|
|
14
15
|
async init(namespace) {
|
|
15
16
|
throw new Error('init() must be implemented by subclass');
|
|
@@ -19,6 +20,7 @@ class PersistentStorage {
|
|
|
19
20
|
* Store event
|
|
20
21
|
* @param {string} key - Event ID or d-tag
|
|
21
22
|
* @param {Object} event - Nostr event
|
|
23
|
+
* @returns {Promise<void>}
|
|
22
24
|
*/
|
|
23
25
|
async put(key, event) {
|
|
24
26
|
throw new Error('put() must be implemented by subclass');
|
|
@@ -36,7 +38,7 @@ class PersistentStorage {
|
|
|
36
38
|
/**
|
|
37
39
|
* Get all events matching prefix
|
|
38
40
|
* @param {string} prefix - Key prefix
|
|
39
|
-
* @returns {Promise<
|
|
41
|
+
* @returns {Promise<any[]>} Array of events
|
|
40
42
|
*/
|
|
41
43
|
async getAll(prefix) {
|
|
42
44
|
throw new Error('getAll() must be implemented by subclass');
|
|
@@ -45,6 +47,7 @@ class PersistentStorage {
|
|
|
45
47
|
/**
|
|
46
48
|
* Delete event
|
|
47
49
|
* @param {string} key - Event ID or d-tag
|
|
50
|
+
* @returns {Promise<void>}
|
|
48
51
|
*/
|
|
49
52
|
async delete(key) {
|
|
50
53
|
throw new Error('delete() must be implemented by subclass');
|
|
@@ -52,6 +55,7 @@ class PersistentStorage {
|
|
|
52
55
|
|
|
53
56
|
/**
|
|
54
57
|
* Clear all data in namespace
|
|
58
|
+
* @returns {Promise<void>}
|
|
55
59
|
*/
|
|
56
60
|
async clear() {
|
|
57
61
|
throw new Error('clear() must be implemented by subclass');
|
|
@@ -59,6 +63,7 @@ class PersistentStorage {
|
|
|
59
63
|
|
|
60
64
|
/**
|
|
61
65
|
* Close storage
|
|
66
|
+
* @returns {Promise<void>}
|
|
62
67
|
*/
|
|
63
68
|
async close() {
|
|
64
69
|
throw new Error('close() must be implemented by subclass');
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Storage Adapter
|
|
3
|
+
* Routes storage operations to the correct backend (nostr or gundb)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as nostrWrapper from './nostr-wrapper.js';
|
|
7
|
+
import * as gunWrapper from './gun-wrapper.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Build path from components
|
|
11
|
+
* @param {string} appName - Application namespace
|
|
12
|
+
* @param {string} holonId - Holon identifier
|
|
13
|
+
* @param {string} lensName - Lens name
|
|
14
|
+
* @param {string} [key] - Optional data key
|
|
15
|
+
* @returns {string} Constructed path
|
|
16
|
+
*/
|
|
17
|
+
export function buildPath(appName, holonId, lensName, key = null) {
|
|
18
|
+
// Both backends use the same path format
|
|
19
|
+
return nostrWrapper.buildPath(appName, holonId, lensName, key);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Write data to storage
|
|
24
|
+
* @param {Object} client - Client instance (nostr client or gun-compatible client)
|
|
25
|
+
* @param {string} path - Storage path
|
|
26
|
+
* @param {Object} data - Data to write
|
|
27
|
+
* @returns {Promise<boolean>} Success indicator
|
|
28
|
+
*/
|
|
29
|
+
export async function write(client, path, data) {
|
|
30
|
+
// Check if this is a GunDB client
|
|
31
|
+
if (client.gun) {
|
|
32
|
+
return gunWrapper.write(client.gun, path, data);
|
|
33
|
+
}
|
|
34
|
+
// Default to Nostr
|
|
35
|
+
return nostrWrapper.write(client, path, data);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Read data from storage
|
|
40
|
+
* @param {Object} client - Client instance
|
|
41
|
+
* @param {string} path - Storage path
|
|
42
|
+
* @param {Object} [options] - Read options
|
|
43
|
+
* @returns {Promise<Object|null>} Data or null
|
|
44
|
+
*/
|
|
45
|
+
export async function read(client, path, options = {}) {
|
|
46
|
+
if (client.gun) {
|
|
47
|
+
return gunWrapper.read(client.gun, path);
|
|
48
|
+
}
|
|
49
|
+
return nostrWrapper.read(client, path, options);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Read all data under a path prefix
|
|
54
|
+
* @param {Object} client - Client instance
|
|
55
|
+
* @param {string} path - Path prefix
|
|
56
|
+
* @param {Object} [options] - Query options
|
|
57
|
+
* @returns {Promise<Object[]>} Array of data objects
|
|
58
|
+
*/
|
|
59
|
+
export async function readAll(client, path, options = {}) {
|
|
60
|
+
if (client.gun) {
|
|
61
|
+
return gunWrapper.readAll(client.gun, path);
|
|
62
|
+
}
|
|
63
|
+
return nostrWrapper.readAll(client, path, options);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Update data (merge fields)
|
|
68
|
+
* @param {Object} client - Client instance
|
|
69
|
+
* @param {string} path - Storage path
|
|
70
|
+
* @param {Object} updates - Fields to update
|
|
71
|
+
* @returns {Promise<boolean>} Success indicator
|
|
72
|
+
*/
|
|
73
|
+
export async function update(client, path, updates) {
|
|
74
|
+
if (client.gun) {
|
|
75
|
+
return gunWrapper.update(client.gun, path, updates);
|
|
76
|
+
}
|
|
77
|
+
return nostrWrapper.update(client, path, updates);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Delete data at path
|
|
82
|
+
* @param {Object} client - Client instance
|
|
83
|
+
* @param {string} path - Storage path
|
|
84
|
+
* @returns {Promise<boolean>} Success indicator
|
|
85
|
+
*/
|
|
86
|
+
export async function deleteData(client, path) {
|
|
87
|
+
if (client.gun) {
|
|
88
|
+
return gunWrapper.deleteData(client.gun, path);
|
|
89
|
+
}
|
|
90
|
+
return nostrWrapper.deleteData(client, path);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Delete all data under path prefix
|
|
95
|
+
* @param {Object} client - Client instance
|
|
96
|
+
* @param {string} path - Path prefix
|
|
97
|
+
* @returns {Promise<Object>} Deletion results
|
|
98
|
+
*/
|
|
99
|
+
export async function deleteAll(client, path) {
|
|
100
|
+
if (client.gun) {
|
|
101
|
+
return gunWrapper.deleteAll(client.gun, path);
|
|
102
|
+
}
|
|
103
|
+
return nostrWrapper.deleteAll(client, path);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Subscribe to data changes
|
|
108
|
+
* @param {Object} client - Client instance
|
|
109
|
+
* @param {string} path - Path or path prefix
|
|
110
|
+
* @param {Function} callback - Called on changes
|
|
111
|
+
* @param {Object} [options] - Subscription options
|
|
112
|
+
* @returns {Object} Subscription with unsubscribe method
|
|
113
|
+
*/
|
|
114
|
+
export function subscribe(client, path, callback, options = {}) {
|
|
115
|
+
if (client.gun) {
|
|
116
|
+
return gunWrapper.subscribe(client.gun, path, callback, options);
|
|
117
|
+
}
|
|
118
|
+
return nostrWrapper.subscribe(client, path, callback, options);
|
|
119
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Type declarations for holosphere
|
|
2
|
+
// This file tells TypeScript to skip type checking the bundled JS files
|
|
3
|
+
|
|
4
|
+
declare module 'holosphere' {
|
|
5
|
+
export class HoloSphere {
|
|
6
|
+
constructor(config?: any);
|
|
7
|
+
init(): Promise<void>;
|
|
8
|
+
|
|
9
|
+
// Core CRUD operations
|
|
10
|
+
get(holonId: string, lens: string, key?: string): Promise<any>;
|
|
11
|
+
getAll(holonId: string, lens: string): Promise<Record<string, any>>;
|
|
12
|
+
put(holonId: string, lens: string, value: any): Promise<void>;
|
|
13
|
+
put(holonId: string, lens: string, key: string, value: any): Promise<void>;
|
|
14
|
+
delete(holonId: string, lens: string, key?: string): Promise<void>;
|
|
15
|
+
read(holonId: string, lens: string, key?: string): Promise<any>;
|
|
16
|
+
|
|
17
|
+
// Subscription
|
|
18
|
+
subscribe(holonId: string, lens: string, callback: (data: any, key: string) => void): Promise<{ unsubscribe: () => void }>;
|
|
19
|
+
|
|
20
|
+
// Profile operations
|
|
21
|
+
getHolonProfile(holonId: string): Promise<any>;
|
|
22
|
+
setHolonProfile(holonId: string, profile: any): Promise<void>;
|
|
23
|
+
|
|
24
|
+
// Federation operations
|
|
25
|
+
federate(sourceHolonId: string, targetHolonId: string, sourceKey?: string | null, targetKey?: string | null, bidirectional?: boolean, permissions?: any): Promise<void>;
|
|
26
|
+
federateHolon(holonId: string, targetHolonId: string, options?: any): Promise<void>;
|
|
27
|
+
getFederation(holonId: string): Promise<any>;
|
|
28
|
+
propagate(holonId: string, lens: string, key: string, value: any): Promise<void>;
|
|
29
|
+
propagateData(holonId: string, lens: string, data: any): Promise<void>;
|
|
30
|
+
|
|
31
|
+
// Global operations
|
|
32
|
+
getGlobal(lens: string, key?: string): Promise<any>;
|
|
33
|
+
getAllGlobal(lens: string): Promise<Record<string, any>>;
|
|
34
|
+
writeGlobal(lens: string, key: string, value: any): Promise<void>;
|
|
35
|
+
|
|
36
|
+
// Internal properties (exposed for advanced use)
|
|
37
|
+
gun?: any;
|
|
38
|
+
client?: any;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class PersistentStorage {
|
|
42
|
+
init(namespace: string): Promise<void>;
|
|
43
|
+
put(key: string, event: any): Promise<void>;
|
|
44
|
+
get(key: string): Promise<any | null>;
|
|
45
|
+
getAll(prefix: string): Promise<any[]>;
|
|
46
|
+
delete(key: string): Promise<void>;
|
|
47
|
+
clear(): Promise<void>;
|
|
48
|
+
close(): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class IndexedDBStorage extends PersistentStorage {}
|
|
52
|
+
export class MemoryStorage extends PersistentStorage {}
|
|
53
|
+
export class FileSystemStorage extends PersistentStorage {}
|
|
54
|
+
|
|
55
|
+
export class ChainManager {
|
|
56
|
+
constructor(config?: any);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class ContractDeployer {
|
|
60
|
+
constructor(chainManager: ChainManager);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class ContractOperations {
|
|
64
|
+
constructor(chainManager: ChainManager);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export class ContractQueries {
|
|
68
|
+
constructor(chainManager: ChainManager);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class EventListener {
|
|
72
|
+
constructor(chainManager: ChainManager);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export class HolonContracts {
|
|
76
|
+
constructor(config?: any);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const ContractABIs: any;
|
|
80
|
+
export const NETWORKS: any;
|
|
81
|
+
|
|
82
|
+
export class AuthorizationError extends Error {}
|
|
83
|
+
export class ValidationError extends Error {}
|
|
84
|
+
|
|
85
|
+
export const crypto: any;
|
|
86
|
+
export const federation: any;
|
|
87
|
+
export const handshake: {
|
|
88
|
+
initiateFederationHandshake(holosphere: HoloSphere, privateKey: string, params: any): Promise<any>;
|
|
89
|
+
acceptFederationRequest(holosphere: HoloSphere, privateKey: string, params: any): Promise<any>;
|
|
90
|
+
rejectFederationRequest(holosphere: HoloSphere, privateKey: string, params: any): Promise<any>;
|
|
91
|
+
subscribeToFederationDMs(client: any, privateKey: string, publicKey: string, handlers: any): () => void;
|
|
92
|
+
};
|
|
93
|
+
export const hierarchical: any;
|
|
94
|
+
export const nostrUtils: any;
|
|
95
|
+
export const schema: any;
|
|
96
|
+
export const social: any;
|
|
97
|
+
export const spatial: any;
|
|
98
|
+
export const storage: any;
|
|
99
|
+
export const subscriptions: any;
|
|
100
|
+
export const networks: any;
|
|
101
|
+
|
|
102
|
+
export function createHologram(config?: any): any;
|
|
103
|
+
export function createAIServices(config?: any): any;
|
|
104
|
+
export function getNetwork(name: string): any;
|
|
105
|
+
export function getNetworksByType(type: string): any[];
|
|
106
|
+
export function listNetworks(): string[];
|
|
107
|
+
export function isNetworkSupported(name: string): boolean;
|
|
108
|
+
export function getAddressUrl(network: string, address: string): string;
|
|
109
|
+
export function getTxUrl(network: string, txHash: string): string;
|
|
110
|
+
export function matchScope(scope: string, pattern: string): boolean;
|
|
111
|
+
|
|
112
|
+
// AI-related exports
|
|
113
|
+
export class Classifier {}
|
|
114
|
+
export class Council {}
|
|
115
|
+
export class Embeddings {}
|
|
116
|
+
export class FederationAdvisor {}
|
|
117
|
+
export class H3AI {}
|
|
118
|
+
export class JSONOps {}
|
|
119
|
+
export class LLMService {}
|
|
120
|
+
export class NLQuery {}
|
|
121
|
+
export class RelationshipDiscovery {}
|
|
122
|
+
export class SchemaExtractor {}
|
|
123
|
+
export class SmartAggregation {}
|
|
124
|
+
export class SpatialAnalysis {}
|
|
125
|
+
export class TaskBreakdown {}
|
|
126
|
+
export class TTS {}
|
|
127
|
+
|
|
128
|
+
export const MODELS: any;
|
|
129
|
+
export const VOICES: any;
|
|
130
|
+
export const SANKEY_EVENTS: any;
|
|
131
|
+
|
|
132
|
+
export default HoloSphere;
|
|
133
|
+
}
|