@upcoming/bee-js 0.13.0 → 0.14.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/mjs/bee.js CHANGED
@@ -1176,6 +1176,15 @@ export class Bee {
1176
1176
  const amount = getAmountForDuration(duration, chainState.currentPrice);
1177
1177
  return this.topUpBatch(batch.batchID, amount, options);
1178
1178
  }
1179
+ async getExtensionCost(postageBatchId, gigabytes, duration, options) {
1180
+ const batch = await this.getPostageBatch(postageBatchId, options);
1181
+ const chainState = await this.getChainState(options);
1182
+ const amount = getAmountForDuration(duration, chainState.currentPrice);
1183
+ const depth = getDepthForSize(gigabytes);
1184
+ const currentValue = getStampCost(batch.depth, batch.amount);
1185
+ const newValue = getStampCost(depth, amount);
1186
+ return newValue.minus(currentValue);
1187
+ }
1179
1188
  async getSizeExtensionCost(postageBatchId, gigabytes, options) {
1180
1189
  const batch = await this.getPostageBatch(postageBatchId, options);
1181
1190
  const depth = getDepthForSize(gigabytes);
@@ -653,6 +653,7 @@ export declare class Bee {
653
653
  getStorageCost(gigabytes: number, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
654
654
  extendStorageSize(postageBatchId: BatchId | Uint8Array | string, gigabytes: number, options?: BeeRequestOptions): Promise<BatchId>;
655
655
  extendStorageDuration(postageBatchId: BatchId | Uint8Array | string, duration: Duration, options?: BeeRequestOptions): Promise<BatchId>;
656
+ getExtensionCost(postageBatchId: BatchId | Uint8Array | string, gigabytes: number, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
656
657
  getSizeExtensionCost(postageBatchId: BatchId | Uint8Array | string, gigabytes: number, options?: BeeRequestOptions): Promise<BZZ>;
657
658
  getDurationExtensionCost(postageBatchId: BatchId | Uint8Array | string, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
658
659
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upcoming/bee-js",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Javascript client for Bee",
5
5
  "keywords": [
6
6
  "bee",