@ethersphere/bee-js 5.1.2 → 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 +1 -1
- package/dist/cjs/bee-debug.js +17 -8
- package/dist/cjs/modules/debug/stake.js +16 -1
- package/dist/cjs/modules/debug/status.js +1 -1
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee-debug.js +17 -8
- package/dist/mjs/modules/debug/stake.js +14 -0
- package/dist/mjs/modules/debug/status.js +1 -1
- package/dist/types/bee-debug.d.ts +7 -1
- package/dist/types/modules/debug/stake.d.ts +7 -1
- package/dist/types/modules/debug/status.d.ts +1 -1
- package/dist/types/types/debug.d.ts +11 -1
- package/package.json +2 -2
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.
|
|
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
|
|
package/dist/cjs/bee-debug.js
CHANGED
|
@@ -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
|
|
34
|
-
const
|
|
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
|
|
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
|
+
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('-'));
|