@ethersphere/bee-js 9.1.1 → 9.1.2

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/mjs/bee.js CHANGED
@@ -1136,7 +1136,7 @@ export class Bee {
1136
1136
  throw new BeeArgumentError(`Depth has to be between ${STAMPS_DEPTH_MIN}..${STAMPS_DEPTH_MAX}`, depth);
1137
1137
  }
1138
1138
  const chainState = await this.getChainState();
1139
- const minimumAmount = BigInt(chainState.currentPrice) * 17280n;
1139
+ const minimumAmount = BigInt(chainState.currentPrice) * 17280n + 1n;
1140
1140
  if (BigInt(amountString) < minimumAmount) {
1141
1141
  throw new BeeArgumentError(`Amount has to be at least ${minimumAmount} (1 day at current price ${chainState.currentPrice})`, amountString);
1142
1142
  }
@@ -1168,7 +1168,7 @@ export class Bee {
1168
1168
  if (delta <= 0) {
1169
1169
  throw new BeeArgumentError('New depth has to be greater than the original depth', depth);
1170
1170
  }
1171
- await this.topUpBatch(batch.batchID, BigInt(batch.amount) * 2n ** BigInt(delta - 1), options);
1171
+ await this.topUpBatch(batch.batchID, BigInt(batch.amount) * 2n ** BigInt(delta - 1) + 1n, options);
1172
1172
  return this.diluteBatch(batch.batchID, depth, options);
1173
1173
  }
1174
1174
  async extendStorageDuration(postageBatchId, duration, options) {
@@ -89,7 +89,7 @@ export function getStampDuration(amount, pricePerBlock, blockTime) {
89
89
  * @param blockTime The block time in seconds.
90
90
  */
91
91
  export function getAmountForDuration(duration, pricePerBlock, blockTime) {
92
- return BigInt(duration.toSeconds()) / BigInt(blockTime) * BigInt(pricePerBlock);
92
+ return BigInt(duration.toSeconds()) / BigInt(blockTime) * BigInt(pricePerBlock) + 1n;
93
93
  }
94
94
  /**
95
95
  * Utility function that calculates the depth required for a postage batch to achieve the specified effective size
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethersphere/bee-js",
3
- "version": "9.1.1",
3
+ "version": "9.1.2",
4
4
  "description": "Javascript client for Bee",
5
5
  "keywords": [
6
6
  "bee",