@ethersphere/bee-js 12.2.0 → 12.2.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/cjs/bee.js CHANGED
@@ -1629,10 +1629,16 @@ class Bee {
1629
1629
  ? currentAmount * multiplier
1630
1630
  : (currentAmount + additionalAmount) * multiplier;
1631
1631
  const amountDelta = targetAmount - currentAmount;
1632
- const transactionId = await this.topUpBatch(batch.batchID, amountDelta, requestOptions);
1632
+ let transactionId;
1633
+ if (amountDelta > 0n) {
1634
+ transactionId = await this.topUpBatch(batch.batchID, amountDelta, requestOptions);
1635
+ }
1633
1636
  if (depthDelta > 0) {
1634
1637
  return this.diluteBatch(batch.batchID, depth, requestOptions);
1635
1638
  }
1639
+ if (!transactionId) {
1640
+ throw new Error('Nothing to extend, both size and duration are already sufficient');
1641
+ }
1636
1642
  return transactionId;
1637
1643
  }
1638
1644
  /**
package/dist/cjs/index.js CHANGED
@@ -36,11 +36,9 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Stamper = exports.BeeDev = exports.Bee = exports.Size = exports.Utils = exports.Duration = exports.Bytes = exports.SUPPORTED_BEE_VERSION_EXACT = exports.SUPPORTED_BEE_VERSION = exports.MantarayNode = exports.MerkleTree = void 0;
39
+ exports.Stamper = exports.Bee = exports.Size = exports.Utils = exports.Duration = exports.Bytes = exports.SUPPORTED_BEE_VERSION_EXACT = exports.SUPPORTED_BEE_VERSION = exports.MantarayNode = exports.MerkleTree = void 0;
40
40
  const bee_1 = require("./bee");
41
41
  Object.defineProperty(exports, "Bee", { enumerable: true, get: function () { return bee_1.Bee; } });
42
- const bee_dev_1 = require("./bee-dev");
43
- Object.defineProperty(exports, "BeeDev", { enumerable: true, get: function () { return bee_dev_1.BeeDev; } });
44
42
  const stamper_1 = require("./stamper/stamper");
45
43
  Object.defineProperty(exports, "Stamper", { enumerable: true, get: function () { return stamper_1.Stamper; } });
46
44
  var cafe_utility_1 = require("cafe-utility");