@ethersphere/bee-js 5.1.2-pre.0 → 5.2.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/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  **Warning: This project is in beta state. There might (and most probably will) be changes in the future to its API and working. Also, no guarantees can be made about its stability, efficiency, and security at this stage.**
15
15
 
16
- This project is intended to be used with **Bee version <!-- SUPPORTED_BEE_START -->1.11.1<!-- SUPPORTED_BEE_END -->**. Using it with older or newer Bee versions is not recommended and may not work. Stay up to date by joining the [official Discord](https://discord.gg/GU22h2utj6) and by keeping an eye on the [releases tab](https://github.com/ethersphere/bee-js/releases).
16
+ This project is intended to be used with **Bee version <!-- SUPPORTED_BEE_START -->1.12.0<!-- SUPPORTED_BEE_END -->**. Using it with older or newer Bee versions is not recommended and may not work. Stay up to date by joining the [official Discord](https://discord.gg/GU22h2utj6) and by keeping an eye on the [releases tab](https://github.com/ethersphere/bee-js/releases).
17
17
 
18
18
  ## Table of Contents
19
19
 
@@ -148,8 +148,6 @@ or for Browsers
148
148
 
149
149
  ## Maintainers
150
150
 
151
- - [auhau](https://github.com/auhau)
152
- - [vojtechsimetka](https://github.com/vojtechsimetka)
153
151
 
154
152
  ## License
155
153
 
@@ -24,23 +24,23 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.BeeDebug = void 0;
27
- const connectivity = __importStar(require("./modules/debug/connectivity"));
28
27
  const balance = __importStar(require("./modules/debug/balance"));
29
28
  const chequebook = __importStar(require("./modules/debug/chequebook"));
29
+ const connectivity = __importStar(require("./modules/debug/connectivity"));
30
30
  const settlements = __importStar(require("./modules/debug/settlements"));
31
+ const stake = __importStar(require("./modules/debug/stake"));
32
+ const states = __importStar(require("./modules/debug/states"));
31
33
  const status = __importStar(require("./modules/debug/status"));
32
34
  const transactions = __importStar(require("./modules/debug/transactions"));
33
- const states = __importStar(require("./modules/debug/states"));
34
- const stake = __importStar(require("./modules/debug/stake"));
35
+ const stamps = __importStar(require("./modules/debug/stamps"));
36
+ const tag = __importStar(require("./modules/debug/tag"));
37
+ const types_1 = require("./types");
35
38
  const error_1 = require("./utils/error");
36
- const url_1 = require("./utils/url");
37
39
  const type_1 = require("./utils/type");
38
- const types_1 = require("./types");
39
- const tag = __importStar(require("./modules/debug/tag"));
40
- const stamps = __importStar(require("./modules/debug/stamps"));
40
+ const url_1 = require("./utils/url");
41
41
  const http_1 = require("./utils/http");
42
- const sleep_1 = require("./utils/sleep");
43
42
  const merge_1 = require("./utils/merge");
43
+ const sleep_1 = require("./utils/sleep");
44
44
  class BeeDebug {
45
45
  constructor(url, options) {
46
46
  (0, url_1.assertBeeUrl)(url);
@@ -556,6 +556,15 @@ class BeeDebug {
556
556
  (0, type_1.assertTransactionOptions)(options);
557
557
  await stake.stake(this.getKyOptionsForCall(options), amount, options);
558
558
  }
559
+ /**
560
+ * Get current status of node in redistribution game
561
+ *
562
+ * @param options
563
+ */
564
+ async getRedistributionState(options) {
565
+ (0, type_1.assertRequestOptions)(options);
566
+ return stake.getRedistributionState(this.getKyOptionsForCall(options));
567
+ }
559
568
  async waitForUsablePostageStamp(id, timeout = 120000) {
560
569
  const TIME_STEP = 1500;
561
570
  for (let time = 0; time < timeout; time += TIME_STEP) {
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stake = exports.getStake = void 0;
3
+ exports.getRedistributionState = exports.stake = exports.getStake = void 0;
4
4
  const http_1 = require("../../utils/http");
5
5
  const STAKE_ENDPOINT = 'stake';
6
+ const REDISTRIBUTION_ENDPOINT = 'redistributionstate';
6
7
  /**
7
8
  * Gets the staked amount
8
9
  *
@@ -40,3 +41,17 @@ async function stake(kyOptions, amount, options) {
40
41
  });
41
42
  }
42
43
  exports.stake = stake;
44
+ /**
45
+ * Get current status of node in redistribution game
46
+ *
47
+ * @param kyOptions Ky Options for making requests
48
+ */
49
+ async function getRedistributionState(kyOptions) {
50
+ const response = await (0, http_1.http)(kyOptions, {
51
+ method: 'get',
52
+ responseType: 'json',
53
+ path: REDISTRIBUTION_ENDPOINT,
54
+ });
55
+ return response.parsedData;
56
+ }
57
+ exports.getRedistributionState = getRedistributionState;
@@ -8,7 +8,7 @@ const http_1 = require("../../utils/http");
8
8
  const major_js_1 = __importDefault(require("semver/functions/major.js"));
9
9
  // Following lines bellow are automatically updated with GitHub Action when Bee version is updated
10
10
  // so if you are changing anything about them change the `update_bee` action accordingly!
11
- exports.SUPPORTED_BEE_VERSION_EXACT = '1.11.1-1992b846';
11
+ exports.SUPPORTED_BEE_VERSION_EXACT = '1.12.0-88c1d236';
12
12
  exports.SUPPORTED_API_VERSION = '4.0.0';
13
13
  exports.SUPPORTED_DEBUG_API_VERSION = '4.0.0';
14
14
  exports.SUPPORTED_BEE_VERSION = exports.SUPPORTED_BEE_VERSION_EXACT.substring(0, exports.SUPPORTED_BEE_VERSION_EXACT.indexOf('-'));