@dignetwork/dig-sdk 0.0.1-alpha.168 → 0.0.1-alpha.169
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreMonitorRegistry.d.ts","sourceRoot":"","sources":["../../src/blockchain/StoreMonitorRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAK5D;;GAEG;AACH,UAAU,eAAe;IACvB,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,KAAK,mBAAmB,GAAG,CACzB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,eAAe,KAC1B,IAAI,CAAC;AAEV;;;GAGG;AACH,qBAAa,oBAAoB;IAE/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAuB;IAG9C,OAAO,CAAC,cAAc,CAAmC;IAGzD,OAAO,CAAC,cAAc,CAA6B;IAGnD,OAAO,CAAC,uBAAuB,CAAwC;IAEvE;;OAEG;IACH,OAAO;IASP;;;OAGG;WACW,WAAW,IAAI,oBAAoB;IAOjD;;;;;OAKG;IACU,aAAa,CACxB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC;IAgChB;;;;;OAKG;IACU,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAkCtE;;;;;;OAMG;YACW,YAAY;IA4B1B;;;;;OAKG;YACW,YAAY;IAuG1B;;;;OAIG;YACW,sBAAsB;
|
|
1
|
+
{"version":3,"file":"StoreMonitorRegistry.d.ts","sourceRoot":"","sources":["../../src/blockchain/StoreMonitorRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAK5D;;GAEG;AACH,UAAU,eAAe;IACvB,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,KAAK,mBAAmB,GAAG,CACzB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,eAAe,KAC1B,IAAI,CAAC;AAEV;;;GAGG;AACH,qBAAa,oBAAoB;IAE/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAuB;IAG9C,OAAO,CAAC,cAAc,CAAmC;IAGzD,OAAO,CAAC,cAAc,CAA6B;IAGnD,OAAO,CAAC,uBAAuB,CAAwC;IAEvE;;OAEG;IACH,OAAO;IASP;;;OAGG;WACW,WAAW,IAAI,oBAAoB;IAOjD;;;;;OAKG;IACU,aAAa,CACxB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC;IAgChB;;;;;OAKG;IACU,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAkCtE;;;;;;OAMG;YACW,YAAY;IA4B1B;;;;;OAKG;YACW,YAAY;IAuG1B;;;;OAIG;YACW,sBAAsB;IA2CpC;;;;OAIG;YACW,KAAK;IAInB;;;OAGG;IACI,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAS7C;;;OAGG;IACI,eAAe,IAAI,IAAI;CAI/B"}
|
|
@@ -185,17 +185,14 @@ class StoreMonitorRegistry {
|
|
|
185
185
|
* @returns {Promise<StoreCacheEntry>} The latest store information.
|
|
186
186
|
*/
|
|
187
187
|
async fetchAndCacheStoreInfo(storeId) {
|
|
188
|
-
console.log(`Monitor: Fetching and caching latest store info for storeId: ${storeId}`);
|
|
189
188
|
const peer = await FullNodePeer_1.FullNodePeer.connect();
|
|
190
189
|
const dataStore = DataStore_1.DataStore.from(storeId);
|
|
191
190
|
const { createdAtHeight, createdAtHash } = await dataStore.getCreationHeight();
|
|
192
191
|
// Sync store from the peer using launcher ID
|
|
193
|
-
console.log(`Monitor: Syncing store from launcher ID for storeId: ${storeId}`);
|
|
194
192
|
const { latestStore, latestHeight } = await peer.syncStoreFromLauncherId(Buffer.from(storeId, "hex"), createdAtHeight, createdAtHash, false);
|
|
195
193
|
const latestHash = await peer.getHeaderHash(latestHeight);
|
|
196
194
|
// Serialize and cache the new store info
|
|
197
195
|
const serializedLatestStore = new DataStoreSerializer_1.DataStoreSerializer(latestStore, latestHeight, latestHash).serialize();
|
|
198
|
-
console.log(`Monitor: Caching new store info for storeId: ${storeId}`);
|
|
199
196
|
this.storeCoinCache.set(storeId, {
|
|
200
197
|
latestStore: serializedLatestStore,
|
|
201
198
|
latestHeight,
|
|
@@ -6,4 +6,20 @@ export declare const addDirectory: (datalayer: DataIntegrityTree, dirPath: strin
|
|
|
6
6
|
* @returns The total size of the folder in bytes.
|
|
7
7
|
*/
|
|
8
8
|
export declare const calculateFolderSize: (folderPath: string) => bigint;
|
|
9
|
+
/**
|
|
10
|
+
* Represents the result of listing files.
|
|
11
|
+
* - If `groupSize` is not provided, returns an array of relative file paths.
|
|
12
|
+
* - If `groupSize` is provided, returns an array of arrays, each containing up to `groupSize` file paths.
|
|
13
|
+
*/
|
|
14
|
+
type ListFilesResult = string[] | string[][];
|
|
15
|
+
/**
|
|
16
|
+
* Recursively lists all files in a directory, excluding specified folders and respecting `.gitignore` rules.
|
|
17
|
+
* Optionally groups the list into batches of a specified size.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} baseDir - The base directory path to start listing files from.
|
|
20
|
+
* @param {number} [groupSize] - Optional. The number of files per group. If provided, the result will be an array of arrays.
|
|
21
|
+
* @returns {ListFilesResult} - A flat list of relative file paths or grouped lists based on `groupSize`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function listFilesRecursively(baseDir: string, groupSize?: number): ListFilesResult;
|
|
24
|
+
export {};
|
|
9
25
|
//# sourceMappingURL=directoryUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directoryUtils.d.ts","sourceRoot":"","sources":["../../src/utils/directoryUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA+BzD,eAAO,MAAM,YAAY,cACZ,iBAAiB,WACnB,MAAM,YACN,MAAM,KACd,OAAO,CAAC,IAAI,CA4Cd,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,eAAgB,MAAM,KAAG,MAiBxD,CAAC"}
|
|
1
|
+
{"version":3,"file":"directoryUtils.d.ts","sourceRoot":"","sources":["../../src/utils/directoryUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA+BzD,eAAO,MAAM,YAAY,cACZ,iBAAiB,WACnB,MAAM,YACN,MAAM,KACd,OAAO,CAAC,IAAI,CA4Cd,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,eAAgB,MAAM,KAAG,MAiBxD,CAAC;AAEF;;;;GAIG;AACH,KAAK,eAAe,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB,eAAe,CAiEjB"}
|
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.calculateFolderSize = exports.addDirectory = void 0;
|
|
30
|
+
exports.listFilesRecursively = listFilesRecursively;
|
|
30
31
|
const path = __importStar(require("path"));
|
|
31
32
|
const fs = __importStar(require("fs"));
|
|
32
33
|
const ignore_1 = __importDefault(require("ignore"));
|