@upcoming/bee-js 0.14.0 → 0.15.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/dist/cjs/bee.js +1 -1
- package/dist/cjs/utils/expose.js +2 -1
- package/dist/cjs/utils/stamps.js +17 -9
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee.js +1 -1
- package/dist/mjs/utils/expose.js +1 -1
- package/dist/mjs/utils/stamps.js +8 -1
- package/dist/types/utils/expose.d.ts +1 -1
- package/dist/types/utils/stamps.d.ts +1 -0
- package/package.json +1 -1
package/dist/mjs/bee.js
CHANGED
|
@@ -686,7 +686,7 @@ export class Bee {
|
|
|
686
686
|
}
|
|
687
687
|
});
|
|
688
688
|
}
|
|
689
|
-
gsocMine(targetOverlay, identifier, proximity =
|
|
689
|
+
gsocMine(targetOverlay, identifier, proximity = 12) {
|
|
690
690
|
targetOverlay = new PeerAddress(targetOverlay);
|
|
691
691
|
identifier = new Identifier(identifier);
|
|
692
692
|
const start = 0xb33n;
|
package/dist/mjs/utils/expose.js
CHANGED
|
@@ -2,4 +2,4 @@ export { getCollectionSize, makeCollectionFromFileList } from "./collection.js";
|
|
|
2
2
|
export { getFolderSize } from "./collection.node.js";
|
|
3
3
|
export { makeMaxTarget } from "./pss.js";
|
|
4
4
|
export { approximateOverheadForRedundancyLevel, getRedundancyStat, getRedundancyStats } from "./redundancy.js";
|
|
5
|
-
export { getAmountForDuration, getDepthForSize, getStampCost, getStampDuration, getStampEffectiveBytes, getStampTheoreticalBytes, getStampUsage } from "./stamps.js";
|
|
5
|
+
export { getAmountForDuration, getDepthForSize, getStampCost, getStampDuration, getStampEffectiveBytes, getStampEffectiveBytesBreakpoints, getStampTheoreticalBytes, getStampUsage } from "./stamps.js";
|
package/dist/mjs/utils/stamps.js
CHANGED
|
@@ -41,7 +41,7 @@ const utilisationRateMap = {
|
|
|
41
41
|
33: 0.9842,
|
|
42
42
|
34: 0.9889
|
|
43
43
|
};
|
|
44
|
-
const effectiveSizeBreakpoints = [[22, 4.93], [23, 17.03], [24, 44.21], [25, 102.78], [26, 225.
|
|
44
|
+
const effectiveSizeBreakpoints = [[22, 4.93], [23, 17.03], [24, 44.21], [25, 102.78], [26, 225.87], [27, 480.44], [28, 1001.44], [29, 2060.27], [30, 4201.9], [31, 8519.02], [32, 17199.89], [33, 34628.46]];
|
|
45
45
|
/**
|
|
46
46
|
* Utility function that calculates the effective size of a postage batch based on its depth.
|
|
47
47
|
*
|
|
@@ -57,6 +57,13 @@ export function getStampEffectiveBytes(depth) {
|
|
|
57
57
|
const utilRate = utilisationRateMap[depth] ?? 0.99;
|
|
58
58
|
return Math.ceil(getStampTheoreticalBytes(depth) * utilRate);
|
|
59
59
|
}
|
|
60
|
+
export function getStampEffectiveBytesBreakpoints() {
|
|
61
|
+
const map = new Map();
|
|
62
|
+
for (let i = 22; i < 35; i++) {
|
|
63
|
+
map.set(i, getStampEffectiveBytes(i));
|
|
64
|
+
}
|
|
65
|
+
return map;
|
|
66
|
+
}
|
|
60
67
|
/**
|
|
61
68
|
* Utility function that calculates the cost of a postage batch based on its depth and amount.
|
|
62
69
|
*/
|
|
@@ -2,4 +2,4 @@ export { getCollectionSize, makeCollectionFromFileList } from './collection';
|
|
|
2
2
|
export { getFolderSize } from './collection.node';
|
|
3
3
|
export { makeMaxTarget } from './pss';
|
|
4
4
|
export { approximateOverheadForRedundancyLevel, getRedundancyStat, getRedundancyStats } from './redundancy';
|
|
5
|
-
export { getAmountForDuration, getDepthForSize, getStampCost, getStampDuration, getStampEffectiveBytes, getStampTheoreticalBytes, getStampUsage, } from './stamps';
|
|
5
|
+
export { getAmountForDuration, getDepthForSize, getStampCost, getStampDuration, getStampEffectiveBytes, getStampEffectiveBytesBreakpoints, getStampTheoreticalBytes, getStampUsage, } from './stamps';
|
|
@@ -27,6 +27,7 @@ export declare function getStampTheoreticalBytes(depth: number): number;
|
|
|
27
27
|
* @returns {number} The effective size of the postage batch in bytes.
|
|
28
28
|
*/
|
|
29
29
|
export declare function getStampEffectiveBytes(depth: number): number;
|
|
30
|
+
export declare function getStampEffectiveBytesBreakpoints(): Map<number, number>;
|
|
30
31
|
/**
|
|
31
32
|
* Utility function that calculates the cost of a postage batch based on its depth and amount.
|
|
32
33
|
*/
|