@ethersphere/bee-js 12.2.0 → 12.2.1

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
@@ -1602,10 +1602,16 @@ export class Bee {
1602
1602
  const currentAmount = getAmountForDuration(batch.duration, chainState.currentPrice, blockTime);
1603
1603
  const targetAmount = duration.isZero() ? currentAmount * multiplier : (currentAmount + additionalAmount) * multiplier;
1604
1604
  const amountDelta = targetAmount - currentAmount;
1605
- const transactionId = await this.topUpBatch(batch.batchID, amountDelta, requestOptions);
1605
+ let transactionId;
1606
+ if (amountDelta > 0n) {
1607
+ transactionId = await this.topUpBatch(batch.batchID, amountDelta, requestOptions);
1608
+ }
1606
1609
  if (depthDelta > 0) {
1607
1610
  return this.diluteBatch(batch.batchID, depth, requestOptions);
1608
1611
  }
1612
+ if (!transactionId) {
1613
+ throw new Error('Nothing to extend, both size and duration are already sufficient');
1614
+ }
1609
1615
  return transactionId;
1610
1616
  }
1611
1617
  /**
@@ -1074,7 +1074,7 @@ export declare class Bee {
1074
1074
  * @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.
1075
1075
  * @returns
1076
1076
  */
1077
- extendStorage(postageBatchId: BatchId | Uint8Array | string, size: Size, duration: Duration, requestOptions?: BeeRequestOptions, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): Promise<BatchId>;
1077
+ extendStorage(postageBatchId: BatchId | Uint8Array | string, size: Size, duration: Duration, requestOptions?: BeeRequestOptions, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): Promise<TransactionId | BatchId>;
1078
1078
  /**
1079
1079
  * Extends the storage size of a postage batch by increasing its depth.
1080
1080
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethersphere/bee-js",
3
- "version": "12.2.0",
3
+ "version": "12.2.1",
4
4
  "description": "Javascript client for Bee",
5
5
  "keywords": [
6
6
  "bee",
@@ -64,7 +64,7 @@
64
64
  "depcheck": "depcheck ."
65
65
  },
66
66
  "dependencies": {
67
- "axios": "^1.15.1",
67
+ "axios": "^1.15.2",
68
68
  "cafe-utility": "^33.9.0",
69
69
  "debug": "^4.4.1",
70
70
  "isomorphic-ws": "^4.0.1",