@ethersphere/bee-js 3.3.2 → 3.4.0-pre.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.
Files changed (48) hide show
  1. package/dist/cjs/utils/data.browser.js +6 -10
  2. package/dist/cjs/utils/data.js +4 -6
  3. package/dist/index.browser.min.js +1 -1
  4. package/dist/index.browser.min.js.map +1 -1
  5. package/dist/mjs/bee-debug.js +294 -189
  6. package/dist/mjs/bee.js +316 -237
  7. package/dist/mjs/chunk/signer.js +46 -12
  8. package/dist/mjs/chunk/soc.js +71 -31
  9. package/dist/mjs/chunk/span.js +1 -1
  10. package/dist/mjs/feed/index.js +86 -42
  11. package/dist/mjs/feed/json.js +46 -10
  12. package/dist/mjs/index.js +2 -1
  13. package/dist/mjs/modules/bytes.js +61 -24
  14. package/dist/mjs/modules/bzz.js +96 -58
  15. package/dist/mjs/modules/chunk.js +51 -16
  16. package/dist/mjs/modules/debug/balance.js +60 -20
  17. package/dist/mjs/modules/debug/chequebook.js +115 -67
  18. package/dist/mjs/modules/debug/chunk.js +47 -11
  19. package/dist/mjs/modules/debug/connectivity.js +76 -32
  20. package/dist/mjs/modules/debug/settlements.js +46 -10
  21. package/dist/mjs/modules/debug/stamps.js +91 -47
  22. package/dist/mjs/modules/debug/states.js +48 -12
  23. package/dist/mjs/modules/debug/status.js +97 -49
  24. package/dist/mjs/modules/debug/tag.js +39 -5
  25. package/dist/mjs/modules/debug/transactions.js +65 -25
  26. package/dist/mjs/modules/feed.js +50 -16
  27. package/dist/mjs/modules/pinning.js +67 -27
  28. package/dist/mjs/modules/pss.js +44 -10
  29. package/dist/mjs/modules/soc.js +47 -14
  30. package/dist/mjs/modules/status.js +37 -3
  31. package/dist/mjs/modules/stewardship.js +46 -10
  32. package/dist/mjs/modules/tag.js +73 -31
  33. package/dist/mjs/utils/collection.browser.js +41 -4
  34. package/dist/mjs/utils/collection.js +45 -11
  35. package/dist/mjs/utils/collection.node.js +137 -42
  36. package/dist/mjs/utils/data.browser.js +88 -53
  37. package/dist/mjs/utils/data.js +57 -22
  38. package/dist/mjs/utils/error.js +0 -9
  39. package/dist/mjs/utils/eth.js +68 -32
  40. package/dist/mjs/utils/file.js +42 -8
  41. package/dist/mjs/utils/headers.js +4 -4
  42. package/dist/mjs/utils/http.js +110 -64
  43. package/dist/mjs/utils/merge.js +2 -2
  44. package/dist/mjs/utils/stream.js +0 -4
  45. package/dist/mjs/utils/type.js +6 -6
  46. package/dist/types/utils/data.browser.d.ts +0 -1
  47. package/dist/types/utils/data.d.ts +2 -2
  48. package/package.json +14 -13
@@ -1,3 +1,35 @@
1
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) {
3
+ return value instanceof P ? value : new P(function (resolve) {
4
+ resolve(value);
5
+ });
6
+ }
7
+
8
+ return new (P || (P = Promise))(function (resolve, reject) {
9
+ function fulfilled(value) {
10
+ try {
11
+ step(generator.next(value));
12
+ } catch (e) {
13
+ reject(e);
14
+ }
15
+ }
16
+
17
+ function rejected(value) {
18
+ try {
19
+ step(generator["throw"](value));
20
+ } catch (e) {
21
+ reject(e);
22
+ }
23
+ }
24
+
25
+ function step(result) {
26
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
27
+ }
28
+
29
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
+ });
31
+ };
32
+
1
33
  import * as connectivity from "./modules/debug/connectivity.js";
2
34
  import * as balance from "./modules/debug/balance.js";
3
35
  import * as chequebook from "./modules/debug/chequebook.js";
@@ -13,18 +45,9 @@ import * as tag from "./modules/debug/tag.js";
13
45
  import * as stamps from "./modules/debug/stamps.js";
14
46
  import { makeDefaultKy, wrapRequestClosure, wrapResponseClosure } from "./utils/http.js";
15
47
  export class BeeDebug {
16
- /**
17
- * URL on which is the Debug API of Bee node exposed
18
- */
19
- url;
20
- /**
21
- * Ky instance that defines connection to Bee node
22
- * @private
23
- */
24
-
25
- ky;
26
-
27
48
  constructor(url, options) {
49
+ var _a;
50
+
28
51
  assertBeeUrl(url); // Remove last slash if present, as our endpoint strings starts with `/...`
29
52
  // which could lead to double slash in URL to which Bee responds with
30
53
  // unnecessary redirects.
@@ -32,38 +55,42 @@ export class BeeDebug {
32
55
  this.url = stripLastSlash(url);
33
56
  const kyOptions = {
34
57
  prefixUrl: this.url,
35
- timeout: options?.timeout ?? false,
36
- retry: options?.retry,
37
- fetch: options?.fetch,
58
+ timeout: (_a = options === null || options === void 0 ? void 0 : options.timeout) !== null && _a !== void 0 ? _a : false,
59
+ retry: options === null || options === void 0 ? void 0 : options.retry,
60
+ fetch: options === null || options === void 0 ? void 0 : options.fetch,
38
61
  hooks: {
39
62
  beforeRequest: [],
40
63
  afterResponse: []
41
64
  }
42
65
  };
43
66
 
44
- if (options?.defaultHeaders) {
67
+ if (options === null || options === void 0 ? void 0 : options.defaultHeaders) {
45
68
  kyOptions.headers = options.defaultHeaders;
46
69
  }
47
70
 
48
- if (options?.onRequest) {
71
+ if (options === null || options === void 0 ? void 0 : options.onRequest) {
49
72
  kyOptions.hooks.beforeRequest.push(wrapRequestClosure(options.onRequest));
50
73
  }
51
74
 
52
- if (options?.onResponse) {
75
+ if (options === null || options === void 0 ? void 0 : options.onResponse) {
53
76
  kyOptions.hooks.afterResponse.push(wrapResponseClosure(options.onResponse));
54
77
  }
55
78
 
56
79
  this.ky = makeDefaultKy(kyOptions);
57
80
  }
58
81
 
59
- async getNodeAddresses(options) {
60
- assertRequestOptions(options);
61
- return connectivity.getNodeAddresses(this.getKy(options));
82
+ getNodeAddresses(options) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ assertRequestOptions(options);
85
+ return connectivity.getNodeAddresses(this.getKy(options));
86
+ });
62
87
  }
63
88
 
64
- async getBlocklist(options) {
65
- assertRequestOptions(options);
66
- return connectivity.getBlocklist(this.getKy(options));
89
+ getBlocklist(options) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ assertRequestOptions(options);
92
+ return connectivity.getBlocklist(this.getKy(options));
93
+ });
67
94
  }
68
95
  /**
69
96
  * Retrieve tag extended information from Bee node
@@ -77,44 +104,54 @@ export class BeeDebug {
77
104
  */
78
105
 
79
106
 
80
- async retrieveExtendedTag(tagUid, options) {
81
- assertRequestOptions(options);
107
+ retrieveExtendedTag(tagUid, options) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ assertRequestOptions(options);
82
110
 
83
- if (isTag(tagUid)) {
84
- tagUid = tagUid.uid;
85
- } else if (typeof tagUid === 'number') {
86
- assertNonNegativeInteger(tagUid, 'UID');
87
- } else {
88
- throw new TypeError('tagUid has to be either Tag or a number (UID)!');
89
- }
111
+ if (isTag(tagUid)) {
112
+ tagUid = tagUid.uid;
113
+ } else if (typeof tagUid === 'number') {
114
+ assertNonNegativeInteger(tagUid, 'UID');
115
+ } else {
116
+ throw new TypeError('tagUid has to be either Tag or a number (UID)!');
117
+ }
90
118
 
91
- return tag.retrieveExtendedTag(this.getKy(options), tagUid);
119
+ return tag.retrieveExtendedTag(this.getKy(options), tagUid);
120
+ });
92
121
  }
93
122
  /**
94
123
  * Get list of peers for this node
95
124
  */
96
125
 
97
126
 
98
- async getPeers(options) {
99
- assertRequestOptions(options);
100
- return connectivity.getPeers(this.getKy(options));
127
+ getPeers(options) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ assertRequestOptions(options);
130
+ return connectivity.getPeers(this.getKy(options));
131
+ });
101
132
  }
102
133
 
103
- async removePeer(peer, options) {
104
- assertRequestOptions(options);
105
- assertAddress(peer);
106
- return connectivity.removePeer(this.getKy(options), peer);
134
+ removePeer(peer, options) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ assertRequestOptions(options);
137
+ assertAddress(peer);
138
+ return connectivity.removePeer(this.getKy(options), peer);
139
+ });
107
140
  }
108
141
 
109
- async getTopology(options) {
110
- assertRequestOptions(options);
111
- return connectivity.getTopology(this.getKy(options));
142
+ getTopology(options) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ assertRequestOptions(options);
145
+ return connectivity.getTopology(this.getKy(options));
146
+ });
112
147
  }
113
148
 
114
- async pingPeer(peer, options) {
115
- assertRequestOptions(options);
116
- assertAddress(peer);
117
- return connectivity.pingPeer(this.getKy(options), peer);
149
+ pingPeer(peer, options) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ assertRequestOptions(options);
152
+ assertAddress(peer);
153
+ return connectivity.pingPeer(this.getKy(options), peer);
154
+ });
118
155
  }
119
156
  /*
120
157
  * Balance endpoints
@@ -125,9 +162,11 @@ export class BeeDebug {
125
162
  */
126
163
 
127
164
 
128
- async getAllBalances(options) {
129
- assertRequestOptions(options);
130
- return balance.getAllBalances(this.getKy(options));
165
+ getAllBalances(options) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ assertRequestOptions(options);
168
+ return balance.getAllBalances(this.getKy(options));
169
+ });
131
170
  }
132
171
  /**
133
172
  * Get the balances with a specific peer including prepaid services
@@ -136,19 +175,23 @@ export class BeeDebug {
136
175
  */
137
176
 
138
177
 
139
- async getPeerBalance(address, options) {
140
- assertRequestOptions(options);
141
- assertAddress(address);
142
- return balance.getPeerBalance(this.getKy(options), address);
178
+ getPeerBalance(address, options) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ assertRequestOptions(options);
181
+ assertAddress(address);
182
+ return balance.getPeerBalance(this.getKy(options), address);
183
+ });
143
184
  }
144
185
  /**
145
186
  * Get the past due consumption balances with all known peers
146
187
  */
147
188
 
148
189
 
149
- async getPastDueConsumptionBalances(options) {
150
- assertRequestOptions(options);
151
- return balance.getPastDueConsumptionBalances(this.getKy(options));
190
+ getPastDueConsumptionBalances(options) {
191
+ return __awaiter(this, void 0, void 0, function* () {
192
+ assertRequestOptions(options);
193
+ return balance.getPastDueConsumptionBalances(this.getKy(options));
194
+ });
152
195
  }
153
196
  /**
154
197
  * Get the past due consumption balance with a specific peer
@@ -157,10 +200,12 @@ export class BeeDebug {
157
200
  */
158
201
 
159
202
 
160
- async getPastDueConsumptionPeerBalance(address, options) {
161
- assertRequestOptions(options);
162
- assertAddress(address);
163
- return balance.getPastDueConsumptionPeerBalance(this.getKy(options), address);
203
+ getPastDueConsumptionPeerBalance(address, options) {
204
+ return __awaiter(this, void 0, void 0, function* () {
205
+ assertRequestOptions(options);
206
+ assertAddress(address);
207
+ return balance.getPastDueConsumptionPeerBalance(this.getKy(options), address);
208
+ });
164
209
  }
165
210
  /*
166
211
  * Chequebook endpoints
@@ -174,27 +219,33 @@ export class BeeDebug {
174
219
  */
175
220
 
176
221
 
177
- async getChequebookAddress(options) {
178
- assertRequestOptions(options);
179
- return chequebook.getChequebookAddress(this.getKy(options));
222
+ getChequebookAddress(options) {
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ assertRequestOptions(options);
225
+ return chequebook.getChequebookAddress(this.getKy(options));
226
+ });
180
227
  }
181
228
  /**
182
229
  * Get the balance of the chequebook
183
230
  */
184
231
 
185
232
 
186
- async getChequebookBalance(options) {
187
- assertRequestOptions(options);
188
- return chequebook.getChequebookBalance(this.getKy(options));
233
+ getChequebookBalance(options) {
234
+ return __awaiter(this, void 0, void 0, function* () {
235
+ assertRequestOptions(options);
236
+ return chequebook.getChequebookBalance(this.getKy(options));
237
+ });
189
238
  }
190
239
  /**
191
240
  * Get last cheques for all peers
192
241
  */
193
242
 
194
243
 
195
- async getLastCheques(options) {
196
- assertRequestOptions(options);
197
- return chequebook.getLastCheques(this.getKy(options));
244
+ getLastCheques(options) {
245
+ return __awaiter(this, void 0, void 0, function* () {
246
+ assertRequestOptions(options);
247
+ return chequebook.getLastCheques(this.getKy(options));
248
+ });
198
249
  }
199
250
  /**
200
251
  * Get last cheques for the peer
@@ -203,10 +254,12 @@ export class BeeDebug {
203
254
  */
204
255
 
205
256
 
206
- async getLastChequesForPeer(address, options) {
207
- assertRequestOptions(options);
208
- assertAddress(address);
209
- return chequebook.getLastChequesForPeer(this.getKy(options), address);
257
+ getLastChequesForPeer(address, options) {
258
+ return __awaiter(this, void 0, void 0, function* () {
259
+ assertRequestOptions(options);
260
+ assertAddress(address);
261
+ return chequebook.getLastChequesForPeer(this.getKy(options), address);
262
+ });
210
263
  }
211
264
  /**
212
265
  * Get last cashout action for the peer
@@ -215,10 +268,12 @@ export class BeeDebug {
215
268
  */
216
269
 
217
270
 
218
- async getLastCashoutAction(address, options) {
219
- assertRequestOptions(options);
220
- assertAddress(address);
221
- return chequebook.getLastCashoutAction(this.getKy(options), address);
271
+ getLastCashoutAction(address, options) {
272
+ return __awaiter(this, void 0, void 0, function* () {
273
+ assertRequestOptions(options);
274
+ assertAddress(address);
275
+ return chequebook.getLastCashoutAction(this.getKy(options), address);
276
+ });
222
277
  }
223
278
  /**
224
279
  * Cashout the last cheque for the peer
@@ -230,10 +285,12 @@ export class BeeDebug {
230
285
  */
231
286
 
232
287
 
233
- async cashoutLastCheque(address, options) {
234
- assertCashoutOptions(options);
235
- assertAddress(address);
236
- return chequebook.cashoutLastCheque(this.getKy(options), address, options);
288
+ cashoutLastCheque(address, options) {
289
+ return __awaiter(this, void 0, void 0, function* () {
290
+ assertCashoutOptions(options);
291
+ assertAddress(address);
292
+ return chequebook.cashoutLastCheque(this.getKy(options), address, options);
293
+ });
237
294
  }
238
295
  /**
239
296
  * Deposit tokens from overlay address into chequebook
@@ -244,15 +301,17 @@ export class BeeDebug {
244
301
  */
245
302
 
246
303
 
247
- async depositTokens(amount, gasPrice, options) {
248
- assertRequestOptions(options);
249
- assertNonNegativeInteger(amount);
304
+ depositTokens(amount, gasPrice, options) {
305
+ return __awaiter(this, void 0, void 0, function* () {
306
+ assertRequestOptions(options);
307
+ assertNonNegativeInteger(amount);
250
308
 
251
- if (gasPrice) {
252
- assertNonNegativeInteger(gasPrice);
253
- }
309
+ if (gasPrice) {
310
+ assertNonNegativeInteger(gasPrice);
311
+ }
254
312
 
255
- return chequebook.depositTokens(this.getKy(options), amount, gasPrice);
313
+ return chequebook.depositTokens(this.getKy(options), amount, gasPrice);
314
+ });
256
315
  }
257
316
  /**
258
317
  * Withdraw tokens from the chequebook to the overlay address
@@ -263,15 +322,17 @@ export class BeeDebug {
263
322
  */
264
323
 
265
324
 
266
- async withdrawTokens(amount, gasPrice, options) {
267
- assertRequestOptions(options);
268
- assertNonNegativeInteger(amount);
325
+ withdrawTokens(amount, gasPrice, options) {
326
+ return __awaiter(this, void 0, void 0, function* () {
327
+ assertRequestOptions(options);
328
+ assertNonNegativeInteger(amount);
269
329
 
270
- if (gasPrice) {
271
- assertNonNegativeInteger(gasPrice);
272
- }
330
+ if (gasPrice) {
331
+ assertNonNegativeInteger(gasPrice);
332
+ }
273
333
 
274
- return chequebook.withdrawTokens(this.getKy(options), amount, gasPrice);
334
+ return chequebook.withdrawTokens(this.getKy(options), amount, gasPrice);
335
+ });
275
336
  }
276
337
  /*
277
338
  * Settlements endpoint
@@ -284,37 +345,45 @@ export class BeeDebug {
284
345
  */
285
346
 
286
347
 
287
- async getSettlements(address, options) {
288
- assertRequestOptions(options);
289
- assertAddress(address);
290
- return settlements.getSettlements(this.getKy(options), address);
348
+ getSettlements(address, options) {
349
+ return __awaiter(this, void 0, void 0, function* () {
350
+ assertRequestOptions(options);
351
+ assertAddress(address);
352
+ return settlements.getSettlements(this.getKy(options), address);
353
+ });
291
354
  }
292
355
  /**
293
356
  * Get settlements with all known peers and total amount sent or received
294
357
  */
295
358
 
296
359
 
297
- async getAllSettlements(options) {
298
- assertRequestOptions(options);
299
- return settlements.getAllSettlements(this.getKy(options));
360
+ getAllSettlements(options) {
361
+ return __awaiter(this, void 0, void 0, function* () {
362
+ assertRequestOptions(options);
363
+ return settlements.getAllSettlements(this.getKy(options));
364
+ });
300
365
  }
301
366
  /**
302
367
  * Get health of node
303
368
  */
304
369
 
305
370
 
306
- async getHealth(options) {
307
- assertRequestOptions(options);
308
- return status.getHealth(this.getKy(options));
371
+ getHealth(options) {
372
+ return __awaiter(this, void 0, void 0, function* () {
373
+ assertRequestOptions(options);
374
+ return status.getHealth(this.getKy(options));
375
+ });
309
376
  }
310
377
  /**
311
378
  * Get mode information of node
312
379
  */
313
380
 
314
381
 
315
- async getNodeInfo(options) {
316
- assertRequestOptions(options);
317
- return status.getNodeInfo(this.getKy(options));
382
+ getNodeInfo(options) {
383
+ return __awaiter(this, void 0, void 0, function* () {
384
+ assertRequestOptions(options);
385
+ return status.getNodeInfo(this.getKy(options));
386
+ });
318
387
  }
319
388
  /**
320
389
  * Connnects to a node and checks if it is a supported Bee version by the bee-js
@@ -324,9 +393,11 @@ export class BeeDebug {
324
393
  */
325
394
 
326
395
 
327
- async isSupportedVersion(options) {
328
- assertRequestOptions(options);
329
- return status.isSupportedVersion(this.getKy(options));
396
+ isSupportedVersion(options) {
397
+ return __awaiter(this, void 0, void 0, function* () {
398
+ assertRequestOptions(options);
399
+ return status.isSupportedVersion(this.getKy(options));
400
+ });
330
401
  }
331
402
  /**
332
403
  * Connects to a node and checks if its version matches with the one that bee-js supports.
@@ -340,9 +411,11 @@ export class BeeDebug {
340
411
  */
341
412
 
342
413
 
343
- async isSupportedExactVersion(options) {
344
- assertRequestOptions(options);
345
- return status.isSupportedExactVersion(this.getKy(options));
414
+ isSupportedExactVersion(options) {
415
+ return __awaiter(this, void 0, void 0, function* () {
416
+ assertRequestOptions(options);
417
+ return status.isSupportedExactVersion(this.getKy(options));
418
+ });
346
419
  }
347
420
  /**
348
421
  * Connects to a node and checks if its main's API version matches with the one that bee-js supports.
@@ -354,9 +427,11 @@ export class BeeDebug {
354
427
  */
355
428
 
356
429
 
357
- async isSupportedMainApiVersion(options) {
358
- assertRequestOptions(options);
359
- return status.isSupportedMainApiVersion(this.getKy(options));
430
+ isSupportedMainApiVersion(options) {
431
+ return __awaiter(this, void 0, void 0, function* () {
432
+ assertRequestOptions(options);
433
+ return status.isSupportedMainApiVersion(this.getKy(options));
434
+ });
360
435
  }
361
436
  /**
362
437
  * Connects to a node and checks if its Debug API version matches with the one that bee-js supports.
@@ -368,9 +443,11 @@ export class BeeDebug {
368
443
  */
369
444
 
370
445
 
371
- async isSupportedDebugApiVersion(options) {
372
- assertRequestOptions(options);
373
- return status.isSupportedDebugApiVersion(this.getKy(options));
446
+ isSupportedDebugApiVersion(options) {
447
+ return __awaiter(this, void 0, void 0, function* () {
448
+ assertRequestOptions(options);
449
+ return status.isSupportedDebugApiVersion(this.getKy(options));
450
+ });
374
451
  }
375
452
  /**
376
453
  *
@@ -382,9 +459,11 @@ export class BeeDebug {
382
459
  */
383
460
 
384
461
 
385
- async isSupportedApiVersion(options) {
386
- assertRequestOptions(options);
387
- return status.isSupportedDebugApiVersion(this.getKy(options));
462
+ isSupportedApiVersion(options) {
463
+ return __awaiter(this, void 0, void 0, function* () {
464
+ assertRequestOptions(options);
465
+ return status.isSupportedDebugApiVersion(this.getKy(options));
466
+ });
388
467
  }
389
468
  /**
390
469
  * Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)
@@ -394,27 +473,33 @@ export class BeeDebug {
394
473
  */
395
474
 
396
475
 
397
- async getVersions(options) {
398
- assertRequestOptions(options);
399
- return status.getVersions(this.getKy(options));
476
+ getVersions(options) {
477
+ return __awaiter(this, void 0, void 0, function* () {
478
+ assertRequestOptions(options);
479
+ return status.getVersions(this.getKy(options));
480
+ });
400
481
  }
401
482
  /**
402
483
  * Get reserve state
403
484
  */
404
485
 
405
486
 
406
- async getReserveState(options) {
407
- assertRequestOptions(options);
408
- return states.getReserveState(this.getKy(options));
487
+ getReserveState(options) {
488
+ return __awaiter(this, void 0, void 0, function* () {
489
+ assertRequestOptions(options);
490
+ return states.getReserveState(this.getKy(options));
491
+ });
409
492
  }
410
493
  /**
411
494
  * Get chain state
412
495
  */
413
496
 
414
497
 
415
- async getChainState(options) {
416
- assertRequestOptions(options);
417
- return states.getChainState(this.getKy(options));
498
+ getChainState(options) {
499
+ return __awaiter(this, void 0, void 0, function* () {
500
+ assertRequestOptions(options);
501
+ return states.getChainState(this.getKy(options));
502
+ });
418
503
  }
419
504
  /**
420
505
  * Creates new postage batch from the funds that the node has available in its Ethereum account.
@@ -435,28 +520,30 @@ export class BeeDebug {
435
520
  */
436
521
 
437
522
 
438
- async createPostageBatch(amount, depth, options) {
439
- assertRequestOptions(options);
440
- assertNonNegativeInteger(amount);
441
- assertNonNegativeInteger(depth);
523
+ createPostageBatch(amount, depth, options) {
524
+ return __awaiter(this, void 0, void 0, function* () {
525
+ assertRequestOptions(options);
526
+ assertNonNegativeInteger(amount);
527
+ assertNonNegativeInteger(depth);
442
528
 
443
- if (depth < STAMPS_DEPTH_MIN) {
444
- throw new BeeArgumentError(`Depth has to be at least ${STAMPS_DEPTH_MIN}`, depth);
445
- }
529
+ if (depth < STAMPS_DEPTH_MIN) {
530
+ throw new BeeArgumentError(`Depth has to be at least ${STAMPS_DEPTH_MIN}`, depth);
531
+ }
446
532
 
447
- if (depth > STAMPS_DEPTH_MAX) {
448
- throw new BeeArgumentError(`Depth has to be at most ${STAMPS_DEPTH_MAX}`, depth);
449
- }
533
+ if (depth > STAMPS_DEPTH_MAX) {
534
+ throw new BeeArgumentError(`Depth has to be at most ${STAMPS_DEPTH_MAX}`, depth);
535
+ }
450
536
 
451
- if (options?.gasPrice) {
452
- assertNonNegativeInteger(options.gasPrice);
453
- }
537
+ if (options === null || options === void 0 ? void 0 : options.gasPrice) {
538
+ assertNonNegativeInteger(options.gasPrice);
539
+ }
454
540
 
455
- if (options?.immutableFlag !== undefined) {
456
- assertBoolean(options.immutableFlag);
457
- }
541
+ if ((options === null || options === void 0 ? void 0 : options.immutableFlag) !== undefined) {
542
+ assertBoolean(options.immutableFlag);
543
+ }
458
544
 
459
- return stamps.createPostageBatch(this.getKy(options), amount, depth, options);
545
+ return stamps.createPostageBatch(this.getKy(options), amount, depth, options);
546
+ });
460
547
  }
461
548
  /**
462
549
  * Topup a fresh amount of BZZ to given Postage Batch.
@@ -475,11 +562,13 @@ export class BeeDebug {
475
562
  */
476
563
 
477
564
 
478
- async topUpBatch(postageBatchId, amount, options) {
479
- assertRequestOptions(options);
480
- assertNonNegativeInteger(amount, 'Amount');
481
- assertBatchId(postageBatchId);
482
- await stamps.topUpBatch(this.getKy(options), postageBatchId, amount);
565
+ topUpBatch(postageBatchId, amount, options) {
566
+ return __awaiter(this, void 0, void 0, function* () {
567
+ assertRequestOptions(options);
568
+ assertNonNegativeInteger(amount, 'Amount');
569
+ assertBatchId(postageBatchId);
570
+ yield stamps.topUpBatch(this.getKy(options), postageBatchId, amount);
571
+ });
483
572
  }
484
573
  /**
485
574
  * Dilute given Postage Batch with new depth (that has to be bigger then the original depth), which allows
@@ -499,11 +588,13 @@ export class BeeDebug {
499
588
  */
500
589
 
501
590
 
502
- async diluteBatch(postageBatchId, depth, options) {
503
- assertRequestOptions(options);
504
- assertNonNegativeInteger(depth, 'Depth');
505
- assertBatchId(postageBatchId);
506
- await stamps.diluteBatch(this.getKy(options), postageBatchId, depth);
591
+ diluteBatch(postageBatchId, depth, options) {
592
+ return __awaiter(this, void 0, void 0, function* () {
593
+ assertRequestOptions(options);
594
+ assertNonNegativeInteger(depth, 'Depth');
595
+ assertBatchId(postageBatchId);
596
+ yield stamps.diluteBatch(this.getKy(options), postageBatchId, depth);
597
+ });
507
598
  }
508
599
  /**
509
600
  * Return details for specific postage batch.
@@ -515,10 +606,12 @@ export class BeeDebug {
515
606
  */
516
607
 
517
608
 
518
- async getPostageBatch(postageBatchId, options) {
519
- assertRequestOptions(options);
520
- assertBatchId(postageBatchId);
521
- return stamps.getPostageBatch(this.getKy(options), postageBatchId);
609
+ getPostageBatch(postageBatchId, options) {
610
+ return __awaiter(this, void 0, void 0, function* () {
611
+ assertRequestOptions(options);
612
+ assertBatchId(postageBatchId);
613
+ return stamps.getPostageBatch(this.getKy(options), postageBatchId);
614
+ });
522
615
  }
523
616
  /**
524
617
  * Return detailed information related to buckets for specific postage batch.
@@ -530,10 +623,12 @@ export class BeeDebug {
530
623
  */
531
624
 
532
625
 
533
- async getPostageBatchBuckets(postageBatchId, options) {
534
- assertRequestOptions(options);
535
- assertBatchId(postageBatchId);
536
- return stamps.getPostageBatchBuckets(this.getKy(options), postageBatchId);
626
+ getPostageBatchBuckets(postageBatchId, options) {
627
+ return __awaiter(this, void 0, void 0, function* () {
628
+ assertRequestOptions(options);
629
+ assertBatchId(postageBatchId);
630
+ return stamps.getPostageBatchBuckets(this.getKy(options), postageBatchId);
631
+ });
537
632
  }
538
633
  /**
539
634
  * Return all postage batches that has the node available.
@@ -543,18 +638,22 @@ export class BeeDebug {
543
638
  */
544
639
 
545
640
 
546
- async getAllPostageBatch(options) {
547
- assertRequestOptions(options);
548
- return stamps.getAllPostageBatches(this.getKy(options));
641
+ getAllPostageBatch(options) {
642
+ return __awaiter(this, void 0, void 0, function* () {
643
+ assertRequestOptions(options);
644
+ return stamps.getAllPostageBatches(this.getKy(options));
645
+ });
549
646
  }
550
647
  /**
551
648
  * Return lists of all current pending transactions that the Bee made
552
649
  */
553
650
 
554
651
 
555
- async getAllPendingTransactions(options) {
556
- assertRequestOptions(options);
557
- return transactions.getAllTransactions(this.getKy(options));
652
+ getAllPendingTransactions(options) {
653
+ return __awaiter(this, void 0, void 0, function* () {
654
+ assertRequestOptions(options);
655
+ return transactions.getAllTransactions(this.getKy(options));
656
+ });
558
657
  }
559
658
  /**
560
659
  * Return transaction information for specific transaction
@@ -562,10 +661,12 @@ export class BeeDebug {
562
661
  */
563
662
 
564
663
 
565
- async getPendingTransaction(transactionHash, options) {
566
- assertRequestOptions(options);
567
- assertTransactionHash(transactionHash);
568
- return transactions.getTransaction(this.getKy(options), transactionHash);
664
+ getPendingTransaction(transactionHash, options) {
665
+ return __awaiter(this, void 0, void 0, function* () {
666
+ assertRequestOptions(options);
667
+ assertTransactionHash(transactionHash);
668
+ return transactions.getTransaction(this.getKy(options), transactionHash);
669
+ });
569
670
  }
570
671
  /**
571
672
  * Rebroadcast already created transaction.
@@ -575,10 +676,12 @@ export class BeeDebug {
575
676
  */
576
677
 
577
678
 
578
- async rebroadcastPendingTransaction(transactionHash, options) {
579
- assertRequestOptions(options);
580
- assertTransactionHash(transactionHash);
581
- return transactions.rebroadcastTransaction(this.getKy(options), transactionHash);
679
+ rebroadcastPendingTransaction(transactionHash, options) {
680
+ return __awaiter(this, void 0, void 0, function* () {
681
+ assertRequestOptions(options);
682
+ assertTransactionHash(transactionHash);
683
+ return transactions.rebroadcastTransaction(this.getKy(options), transactionHash);
684
+ });
582
685
  }
583
686
  /**
584
687
  * Cancel currently pending transaction
@@ -587,15 +690,17 @@ export class BeeDebug {
587
690
  */
588
691
 
589
692
 
590
- async cancelPendingTransaction(transactionHash, gasPrice, options) {
591
- assertRequestOptions(options);
592
- assertTransactionHash(transactionHash);
693
+ cancelPendingTransaction(transactionHash, gasPrice, options) {
694
+ return __awaiter(this, void 0, void 0, function* () {
695
+ assertRequestOptions(options);
696
+ assertTransactionHash(transactionHash);
593
697
 
594
- if (gasPrice) {
595
- assertNonNegativeInteger(gasPrice);
596
- }
698
+ if (gasPrice) {
699
+ assertNonNegativeInteger(gasPrice);
700
+ }
597
701
 
598
- return transactions.cancelTransaction(this.getKy(options), transactionHash, gasPrice);
702
+ return transactions.cancelTransaction(this.getKy(options), transactionHash, gasPrice);
703
+ });
599
704
  }
600
705
 
601
706
  getKy(options) {