@net-protocol/storage 0.1.11 → 0.1.12
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/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1004,8 +1004,8 @@ function validateDataSize(chunks) {
|
|
|
1004
1004
|
function computeTopLevelHash(chunkHashes) {
|
|
1005
1005
|
return keccak256HashString(chunkHashes.join(""));
|
|
1006
1006
|
}
|
|
1007
|
-
function processDataForStorage(data, operatorAddress, storageKey) {
|
|
1008
|
-
const chunks = chunkData(data);
|
|
1007
|
+
function processDataForStorage(data, operatorAddress, storageKey, chunkSize) {
|
|
1008
|
+
const chunks = chunkData(data, chunkSize);
|
|
1009
1009
|
const validation = validateDataSize(chunks);
|
|
1010
1010
|
if (!validation.valid) {
|
|
1011
1011
|
return {
|
|
@@ -1476,7 +1476,8 @@ var StorageClient = class {
|
|
|
1476
1476
|
const result = processDataForStorage(
|
|
1477
1477
|
params.data,
|
|
1478
1478
|
params.operatorAddress,
|
|
1479
|
-
params.storageKey
|
|
1479
|
+
params.storageKey,
|
|
1480
|
+
params.chunkSize
|
|
1480
1481
|
);
|
|
1481
1482
|
if (!result.valid) {
|
|
1482
1483
|
throw new Error(result.error || "Failed to process data for storage");
|
|
@@ -1765,6 +1766,6 @@ function estimateChunkCount(fileSize, isBinary = true) {
|
|
|
1765
1766
|
return Math.max(1, Math.ceil(fileSize / chunkSize));
|
|
1766
1767
|
}
|
|
1767
1768
|
|
|
1768
|
-
export { CHUNKED_STORAGE_CONTRACT, CHUNKED_STORAGE_READER_CONTRACT, CONCURRENT_XML_FETCHES, MAX_XML_DEPTH, SAFE_STORAGE_READER_CONTRACT, STORAGE_CONTRACT, STORAGE_ROUTER_CONTRACT, StorageClient, assembleChunks, base64ToDataUri, chunkData, chunkDataForStorage, computeTopLevelHash, containsXmlReferences, detectFileTypeFromBase64, detectStorageType, encodeStorageKeyForUrl, estimateChunkCount, fileToDataUri, formatStorageKeyForDisplay, generateStorageEmbedTag, generateXmlMetadata, generateXmlMetadataWithSource, getChunkCount, getReferenceKey, getStorageKeyBytes, isBinaryFile, parseNetReferences, processDataForStorage, processFileStreaming, processFileStreamingComplete, readFileSlice, resolveOperator, resolveXmlRecursive, shouldSuggestXmlStorage, validateDataSize };
|
|
1769
|
+
export { CHUNKED_STORAGE_CONTRACT, CHUNKED_STORAGE_READER_CONTRACT, CONCURRENT_XML_FETCHES, MAX_XML_DEPTH, OPTIMAL_CHUNK_SIZE, SAFE_STORAGE_READER_CONTRACT, STORAGE_CONTRACT, STORAGE_ROUTER_CONTRACT, StorageClient, assembleChunks, base64ToDataUri, chunkData, chunkDataForStorage, computeTopLevelHash, containsXmlReferences, detectFileTypeFromBase64, detectStorageType, encodeStorageKeyForUrl, estimateChunkCount, fileToDataUri, formatStorageKeyForDisplay, generateStorageEmbedTag, generateXmlMetadata, generateXmlMetadataWithSource, getChunkCount, getReferenceKey, getStorageKeyBytes, isBinaryFile, parseNetReferences, processDataForStorage, processFileStreaming, processFileStreamingComplete, readFileSlice, resolveOperator, resolveXmlRecursive, shouldSuggestXmlStorage, validateDataSize };
|
|
1769
1770
|
//# sourceMappingURL=index.mjs.map
|
|
1770
1771
|
//# sourceMappingURL=index.mjs.map
|