@ethersphere/bee-js 9.2.1 → 9.3.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/cjs/bee.js +7 -0
- package/dist/cjs/modules/rchash.js +15 -0
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee.js +7 -0
- package/dist/mjs/modules/rchash.js +15 -0
- package/dist/types/bee.d.ts +4 -0
- package/dist/types/modules/rchash.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/bee.js
CHANGED
|
@@ -47,6 +47,7 @@ const grantee = __importStar(require("./modules/grantee"));
|
|
|
47
47
|
const gsoc = __importStar(require("./modules/gsoc"));
|
|
48
48
|
const pinning = __importStar(require("./modules/pinning"));
|
|
49
49
|
const pss = __importStar(require("./modules/pss"));
|
|
50
|
+
const rchash_1 = require("./modules/rchash");
|
|
50
51
|
const status = __importStar(require("./modules/status"));
|
|
51
52
|
const stewardship = __importStar(require("./modules/stewardship"));
|
|
52
53
|
const tag = __importStar(require("./modules/tag"));
|
|
@@ -865,6 +866,12 @@ class Bee {
|
|
|
865
866
|
reference = new typed_bytes_1.Reference(reference);
|
|
866
867
|
return (0, envelope_1.postEnvelope)(this.getRequestOptionsForCall(options), postageBatchId, reference);
|
|
867
868
|
}
|
|
869
|
+
/**
|
|
870
|
+
* Get reserve commitment hash duration seconds
|
|
871
|
+
*/
|
|
872
|
+
async rchash(depth, anchor1, anchor2, options) {
|
|
873
|
+
return (0, rchash_1.rchash)(this.getRequestOptionsForCall(options), depth, anchor1, anchor2);
|
|
874
|
+
}
|
|
868
875
|
/**
|
|
869
876
|
* Ping the Bee node to see if there is a live Bee node on the given URL.
|
|
870
877
|
*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rchash = void 0;
|
|
4
|
+
const cafe_utility_1 = require("cafe-utility");
|
|
5
|
+
const http_1 = require("../utils/http");
|
|
6
|
+
const RCHASH_ENDPOINT = 'rchash';
|
|
7
|
+
async function rchash(requestOptions, depth, anchor1, anchor2) {
|
|
8
|
+
const response = await (0, http_1.http)(requestOptions, {
|
|
9
|
+
responseType: 'json',
|
|
10
|
+
url: `${RCHASH_ENDPOINT}/${depth}/${anchor1}/${anchor2}`,
|
|
11
|
+
});
|
|
12
|
+
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
13
|
+
return cafe_utility_1.Types.asNumber(body.durationSeconds, { name: 'durationSeconds' });
|
|
14
|
+
}
|
|
15
|
+
exports.rchash = rchash;
|