@ethersphere/bee-js 7.0.4 → 7.1.1
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 +48 -48
- package/dist/cjs/utils/eth.js +18 -1
- package/dist/cjs/utils/expose.js +2 -1
- package/dist/cjs/utils/pss.js +1 -1
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee.js +48 -49
- package/dist/mjs/utils/eth.js +15 -0
- package/dist/mjs/utils/expose.js +1 -1
- package/dist/mjs/utils/pss.js +1 -1
- package/dist/types/bee.d.ts +48 -48
- package/dist/types/types/debug.d.ts +3 -3
- package/dist/types/types/index.d.ts +14 -14
- package/dist/types/utils/eth.d.ts +1 -0
- package/dist/types/utils/expose.d.ts +1 -1
- package/dist/types/utils/pss.d.ts +1 -1
- package/package.json +2 -2
package/dist/cjs/bee.js
CHANGED
|
@@ -97,7 +97,7 @@ class Bee {
|
|
|
97
97
|
* @param options Additional options like tag, encryption, pinning, content-type and request options
|
|
98
98
|
*
|
|
99
99
|
* @returns reference is a content hash of the data
|
|
100
|
-
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
100
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
101
101
|
* @see [Bee API reference - `POST /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post)
|
|
102
102
|
*/
|
|
103
103
|
async uploadData(postageBatchId, data, options, requestOptions) {
|
|
@@ -114,7 +114,7 @@ class Bee {
|
|
|
114
114
|
* @param options Options that affects the request behavior
|
|
115
115
|
* @throws TypeError if some of the input parameters is not expected type
|
|
116
116
|
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
117
|
-
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
117
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
118
118
|
* @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)
|
|
119
119
|
*/
|
|
120
120
|
async downloadData(reference, options) {
|
|
@@ -129,7 +129,7 @@ class Bee {
|
|
|
129
129
|
* @param options Options that affects the request behavior
|
|
130
130
|
* @throws TypeError if some of the input parameters is not expected type
|
|
131
131
|
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
132
|
-
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
132
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
133
133
|
* @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)
|
|
134
134
|
*/
|
|
135
135
|
async downloadReadableData(reference, options) {
|
|
@@ -145,7 +145,7 @@ class Bee {
|
|
|
145
145
|
* @param options Additional options like tag, encryption, pinning, content-type and request options
|
|
146
146
|
*
|
|
147
147
|
* @returns reference is a content hash of the data
|
|
148
|
-
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
148
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
149
149
|
* @see [Bee API reference - `POST /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post)
|
|
150
150
|
*/
|
|
151
151
|
async uploadChunk(postageBatchId, data, options, requestOptions) {
|
|
@@ -170,8 +170,8 @@ class Bee {
|
|
|
170
170
|
* @param options Options that affects the request behavior
|
|
171
171
|
* @throws TypeError if some of the input parameters is not expected type
|
|
172
172
|
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
173
|
-
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
174
|
-
* @see [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{
|
|
173
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
174
|
+
* @see [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{address}/get)
|
|
175
175
|
*/
|
|
176
176
|
async downloadChunk(reference, options) {
|
|
177
177
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -189,9 +189,9 @@ class Bee {
|
|
|
189
189
|
* @param name Optional name of the uploaded file
|
|
190
190
|
* @param options Additional options like tag, encryption, pinning, content-type and request options
|
|
191
191
|
*
|
|
192
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
193
|
-
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
194
|
-
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/
|
|
192
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
193
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
194
|
+
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
|
|
195
195
|
* @returns reference is a content hash of the file
|
|
196
196
|
*/
|
|
197
197
|
async uploadFile(postageBatchId, data, name, options, requestOptions) {
|
|
@@ -228,8 +228,8 @@ class Bee {
|
|
|
228
228
|
* @throws TypeError if some of the input parameters is not expected type
|
|
229
229
|
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
230
230
|
* @see Data
|
|
231
|
-
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
232
|
-
* @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/
|
|
231
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
232
|
+
* @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)
|
|
233
233
|
*/
|
|
234
234
|
async downloadFile(reference, path = '', options) {
|
|
235
235
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -245,8 +245,8 @@ class Bee {
|
|
|
245
245
|
* @throws TypeError if some of the input parameters is not expected type
|
|
246
246
|
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
247
247
|
*
|
|
248
|
-
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/access-the-swarm/upload-and-download)
|
|
249
|
-
* @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/
|
|
248
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
249
|
+
* @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)
|
|
250
250
|
*/
|
|
251
251
|
async downloadReadableFile(reference, path = '', options) {
|
|
252
252
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -265,9 +265,9 @@ class Bee {
|
|
|
265
265
|
* @param fileList list of files to be uploaded
|
|
266
266
|
* @param options Additional options like tag, encryption, pinning and request options
|
|
267
267
|
*
|
|
268
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
269
|
-
* @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/access-the-swarm/upload-a-directory
|
|
270
|
-
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/
|
|
268
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
269
|
+
* @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)
|
|
270
|
+
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
|
|
271
271
|
*/
|
|
272
272
|
async uploadFiles(postageBatchId, fileList, options, requestOptions) {
|
|
273
273
|
(0, type_2.assertBatchId)(postageBatchId);
|
|
@@ -305,9 +305,9 @@ class Bee {
|
|
|
305
305
|
* @param dir the path of the files to be uploaded
|
|
306
306
|
* @param options Additional options like tag, encryption, pinning and request options
|
|
307
307
|
*
|
|
308
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
309
|
-
* @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/access-the-swarm/upload-a-directory
|
|
310
|
-
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/
|
|
308
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
309
|
+
* @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)
|
|
310
|
+
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
|
|
311
311
|
*/
|
|
312
312
|
async uploadFilesFromDirectory(postageBatchId, dir, options, requestOptions) {
|
|
313
313
|
(0, type_2.assertBatchId)(postageBatchId);
|
|
@@ -320,7 +320,7 @@ class Bee {
|
|
|
320
320
|
* Create a new Tag which is meant for tracking progres of syncing data across network.
|
|
321
321
|
*
|
|
322
322
|
* @param options Options that affects the request behavior
|
|
323
|
-
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
323
|
+
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
324
324
|
* @see [Bee API reference - `POST /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post)
|
|
325
325
|
*/
|
|
326
326
|
async createTag(options) {
|
|
@@ -336,7 +336,7 @@ class Bee {
|
|
|
336
336
|
* @throws TypeError if limit or offset are not numbers or undefined
|
|
337
337
|
* @throws BeeArgumentError if limit or offset have invalid options
|
|
338
338
|
*
|
|
339
|
-
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
339
|
+
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
340
340
|
* @see [Bee API reference - `GET /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get)
|
|
341
341
|
*/
|
|
342
342
|
async getAllTags(options) {
|
|
@@ -351,7 +351,7 @@ class Bee {
|
|
|
351
351
|
* @param options Options that affects the request behavior
|
|
352
352
|
* @throws TypeError if tagUid is in not correct format
|
|
353
353
|
*
|
|
354
|
-
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
354
|
+
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
355
355
|
* @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/get)
|
|
356
356
|
*
|
|
357
357
|
*/
|
|
@@ -368,7 +368,7 @@ class Bee {
|
|
|
368
368
|
* @throws TypeError if tagUid is in not correct format
|
|
369
369
|
* @throws BeeResponse error if something went wrong on the Bee node side while deleting the tag.
|
|
370
370
|
*
|
|
371
|
-
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
371
|
+
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
372
372
|
* @see [Bee API reference - `DELETE /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/delete)
|
|
373
373
|
*/
|
|
374
374
|
async deleteTag(tagUid, options) {
|
|
@@ -388,7 +388,7 @@ class Bee {
|
|
|
388
388
|
* @throws TypeError if tagUid is in not correct format
|
|
389
389
|
* @throws BeeResponse error if something went wrong on the Bee node side while deleting the tag.
|
|
390
390
|
*
|
|
391
|
-
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
391
|
+
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
392
392
|
* @see [Bee API reference - `PATCH /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/patch)
|
|
393
393
|
*/
|
|
394
394
|
async updateTag(tagUid, reference, options) {
|
|
@@ -404,7 +404,7 @@ class Bee {
|
|
|
404
404
|
* @param options Options that affects the request behavior
|
|
405
405
|
* @throws TypeError if reference is in not correct format
|
|
406
406
|
*
|
|
407
|
-
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/access-the-swarm/pinning)
|
|
407
|
+
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
|
|
408
408
|
*/
|
|
409
409
|
async pin(reference, options) {
|
|
410
410
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -418,7 +418,7 @@ class Bee {
|
|
|
418
418
|
* @param options Options that affects the request behavior
|
|
419
419
|
* @throws TypeError if reference is in not correct format
|
|
420
420
|
*
|
|
421
|
-
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/access-the-swarm/pinning)
|
|
421
|
+
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
|
|
422
422
|
*/
|
|
423
423
|
async unpin(reference, options) {
|
|
424
424
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -429,7 +429,7 @@ class Bee {
|
|
|
429
429
|
* Get list of all locally pinned references
|
|
430
430
|
*
|
|
431
431
|
* @param options Options that affects the request behavior
|
|
432
|
-
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/access-the-swarm/pinning)
|
|
432
|
+
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
|
|
433
433
|
*/
|
|
434
434
|
async getAllPins(options) {
|
|
435
435
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -443,7 +443,7 @@ class Bee {
|
|
|
443
443
|
* @throws TypeError if some of the input parameters is not expected type
|
|
444
444
|
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
445
445
|
*
|
|
446
|
-
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/access-the-swarm/pinning)
|
|
446
|
+
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
|
|
447
447
|
*/
|
|
448
448
|
async getPin(reference, options) {
|
|
449
449
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -535,7 +535,7 @@ class Bee {
|
|
|
535
535
|
* @param options Options that affects the request behavior
|
|
536
536
|
* @throws TypeError if `data`, `batchId`, `target` or `recipient` are in invalid format
|
|
537
537
|
*
|
|
538
|
-
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/
|
|
538
|
+
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)
|
|
539
539
|
* @see [Bee API reference - `POST /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1{topic}~1{targets}/post)
|
|
540
540
|
*/
|
|
541
541
|
async pssSend(postageBatchId, topic, target, data, recipient, options) {
|
|
@@ -565,7 +565,7 @@ class Bee {
|
|
|
565
565
|
*
|
|
566
566
|
* @returns Subscription to a given topic
|
|
567
567
|
*
|
|
568
|
-
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/
|
|
568
|
+
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)
|
|
569
569
|
* @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)
|
|
570
570
|
*/
|
|
571
571
|
pssSubscribe(topic, handler) {
|
|
@@ -627,7 +627,7 @@ class Bee {
|
|
|
627
627
|
*
|
|
628
628
|
* @returns Message in byte array
|
|
629
629
|
*
|
|
630
|
-
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/
|
|
630
|
+
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)
|
|
631
631
|
* @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)
|
|
632
632
|
*/
|
|
633
633
|
async pssReceive(topic, timeoutMsec = 0) {
|
|
@@ -672,7 +672,7 @@ class Bee {
|
|
|
672
672
|
* @param owner Owner's ethereum address in hex or bytes
|
|
673
673
|
* @param options Options that affects the request behavior
|
|
674
674
|
*
|
|
675
|
-
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/
|
|
675
|
+
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
|
|
676
676
|
* @see [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post)
|
|
677
677
|
*/
|
|
678
678
|
async createFeedManifest(postageBatchId, type, topic, owner, options) {
|
|
@@ -692,7 +692,7 @@ class Bee {
|
|
|
692
692
|
* @param owner Owner's ethereum address in hex or bytes
|
|
693
693
|
* @param options Options that affects the request behavior
|
|
694
694
|
*
|
|
695
|
-
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/
|
|
695
|
+
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
|
|
696
696
|
*/
|
|
697
697
|
makeFeedReader(type, topic, owner, options) {
|
|
698
698
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -709,7 +709,7 @@ class Bee {
|
|
|
709
709
|
* @param signer The signer's private key or a Signer instance that can sign data
|
|
710
710
|
* @param options Options that affects the request behavior
|
|
711
711
|
*
|
|
712
|
-
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/
|
|
712
|
+
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
|
|
713
713
|
*/
|
|
714
714
|
makeFeedWriter(type, topic, signer, options) {
|
|
715
715
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -734,7 +734,7 @@ class Bee {
|
|
|
734
734
|
*
|
|
735
735
|
* @throws BeeError if `options.signer` is not specified nor the default Signer on Bee's instance is specified.
|
|
736
736
|
*
|
|
737
|
-
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/
|
|
737
|
+
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
|
|
738
738
|
*/
|
|
739
739
|
async setJsonFeed(postageBatchId, topic, data, options, requestOptions) {
|
|
740
740
|
(0, type_2.assertRequestOptions)(options, 'JsonFeedOptions');
|
|
@@ -761,7 +761,7 @@ class Bee {
|
|
|
761
761
|
* @param options.address Ethereum address of owner of the feed that signed it. This option is exclusive with `signer` option.
|
|
762
762
|
* @param options.type Type of Feed
|
|
763
763
|
*
|
|
764
|
-
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/
|
|
764
|
+
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
|
|
765
765
|
*/
|
|
766
766
|
async getJsonFeed(topic, options) {
|
|
767
767
|
(0, type_2.assertRequestOptions)(options, 'JsonFeedOptions');
|
|
@@ -806,7 +806,7 @@ class Bee {
|
|
|
806
806
|
*
|
|
807
807
|
* @param ownerAddress The ethereum address of the owner
|
|
808
808
|
* @param options Options that affects the request behavior
|
|
809
|
-
* @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/
|
|
809
|
+
* @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)
|
|
810
810
|
*/
|
|
811
811
|
makeSOCReader(ownerAddress, options) {
|
|
812
812
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -821,7 +821,7 @@ class Bee {
|
|
|
821
821
|
*
|
|
822
822
|
* @param signer The signer's private key or a Signer instance that can sign data
|
|
823
823
|
* @param options Options that affects the request behavior
|
|
824
|
-
* @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/
|
|
824
|
+
* @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)
|
|
825
825
|
*/
|
|
826
826
|
makeSOCWriter(signer, options) {
|
|
827
827
|
(0, type_2.assertRequestOptions)(options);
|
|
@@ -872,7 +872,7 @@ class Bee {
|
|
|
872
872
|
* @param tagUid UID or tag object to be retrieved
|
|
873
873
|
* @throws TypeError if tagUid is in not correct format
|
|
874
874
|
*
|
|
875
|
-
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
|
|
875
|
+
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
876
876
|
* @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/debug-api/#tag/Tag)
|
|
877
877
|
*
|
|
878
878
|
*/
|
|
@@ -1170,7 +1170,7 @@ class Bee {
|
|
|
1170
1170
|
* Creates new postage batch from the funds that the node has available in its Ethereum account.
|
|
1171
1171
|
*
|
|
1172
1172
|
* For better understanding what each parameter means and what are the optimal values please see
|
|
1173
|
-
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
|
|
1173
|
+
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction#keep-your-data-alive).
|
|
1174
1174
|
*
|
|
1175
1175
|
* **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
|
|
1176
1176
|
*
|
|
@@ -1180,7 +1180,7 @@ class Bee {
|
|
|
1180
1180
|
* @throws BeeArgumentError when negative amount or depth is specified
|
|
1181
1181
|
* @throws TypeError if non-integer value is passed to amount or depth
|
|
1182
1182
|
*
|
|
1183
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
1183
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
1184
1184
|
* @see [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post)
|
|
1185
1185
|
*/
|
|
1186
1186
|
async createPostageBatch(amount, depth, options, requestOptions) {
|
|
@@ -1206,7 +1206,7 @@ class Bee {
|
|
|
1206
1206
|
* Topup a fresh amount of BZZ to given Postage Batch.
|
|
1207
1207
|
*
|
|
1208
1208
|
* For better understanding what each parameter means and what are the optimal values please see
|
|
1209
|
-
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
|
|
1209
|
+
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).
|
|
1210
1210
|
*
|
|
1211
1211
|
* **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
|
|
1212
1212
|
*
|
|
@@ -1214,7 +1214,7 @@ class Bee {
|
|
|
1214
1214
|
* @param amount Amount to be added to the batch
|
|
1215
1215
|
* @param options Request options
|
|
1216
1216
|
*
|
|
1217
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
1217
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
1218
1218
|
* @see [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1topup~1{id}~1{amount}/patch)
|
|
1219
1219
|
*/
|
|
1220
1220
|
async topUpBatch(postageBatchId, amount, options) {
|
|
@@ -1228,7 +1228,7 @@ class Bee {
|
|
|
1228
1228
|
* the Postage Batch to be used for more chunks.
|
|
1229
1229
|
*
|
|
1230
1230
|
* For better understanding what each parameter means and what are the optimal values please see
|
|
1231
|
-
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
|
|
1231
|
+
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).
|
|
1232
1232
|
*
|
|
1233
1233
|
* **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
|
|
1234
1234
|
*
|
|
@@ -1236,7 +1236,7 @@ class Bee {
|
|
|
1236
1236
|
* @param depth Amount to be added to the batch
|
|
1237
1237
|
* @param options Request options
|
|
1238
1238
|
*
|
|
1239
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
1239
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
1240
1240
|
* @see [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1topup~1{id}~1{amount}/patch)
|
|
1241
1241
|
*/
|
|
1242
1242
|
async diluteBatch(postageBatchId, depth, options) {
|
|
@@ -1250,7 +1250,7 @@ class Bee {
|
|
|
1250
1250
|
*
|
|
1251
1251
|
* @param postageBatchId Batch ID
|
|
1252
1252
|
*
|
|
1253
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
1253
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
1254
1254
|
* @see [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}/get)
|
|
1255
1255
|
*/
|
|
1256
1256
|
async getPostageBatch(postageBatchId, options) {
|
|
@@ -1263,7 +1263,7 @@ class Bee {
|
|
|
1263
1263
|
*
|
|
1264
1264
|
* @param postageBatchId Batch ID
|
|
1265
1265
|
*
|
|
1266
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
1266
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
1267
1267
|
* @see [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}~1buckets/get)
|
|
1268
1268
|
*/
|
|
1269
1269
|
async getPostageBatchBuckets(postageBatchId, options) {
|
|
@@ -1274,7 +1274,7 @@ class Bee {
|
|
|
1274
1274
|
/**
|
|
1275
1275
|
* Return all postage batches that has the node available.
|
|
1276
1276
|
*
|
|
1277
|
-
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
|
|
1277
|
+
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
1278
1278
|
* @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps/get)
|
|
1279
1279
|
*/
|
|
1280
1280
|
async getAllPostageBatch(options) {
|
package/dist/cjs/utils/eth.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.makeEthereumWalletSigner = exports.ethToSwarmAddress = exports.fromLittleEndian = exports.toLittleEndian = exports.isHexEthAddress = exports.makeHexEthAddress = exports.makeEthAddress = void 0;
|
|
6
|
+
exports.makeEthereumWalletSigner = exports.ethToSwarmAddress = exports.fromLittleEndian = exports.toLittleEndian = exports.isHexEthAddress = exports.makeHexEthAddress = exports.makeEthAddress = exports.capitalizeAddressERC55 = void 0;
|
|
7
7
|
// For ESM compatibility
|
|
8
8
|
const js_sha3_1 = __importDefault(require("js-sha3"));
|
|
9
9
|
const { keccak256, sha3_256 } = js_sha3_1.default;
|
|
@@ -11,6 +11,23 @@ const bytes_1 = require("./bytes");
|
|
|
11
11
|
const hex_1 = require("./hex");
|
|
12
12
|
const ETH_ADDR_BYTES_LENGTH = 20;
|
|
13
13
|
const ETH_ADDR_HEX_LENGTH = 40;
|
|
14
|
+
function capitalizeAddressERC55(address) {
|
|
15
|
+
if (address.startsWith('0x')) {
|
|
16
|
+
address = address.slice(2);
|
|
17
|
+
}
|
|
18
|
+
const addressHash = keccak256(address.toLowerCase());
|
|
19
|
+
let result = '0x';
|
|
20
|
+
for (let i = 0; i < address.length; i++) {
|
|
21
|
+
if (parseInt(addressHash[i], 16) > 7) {
|
|
22
|
+
result += address[i].toUpperCase();
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
result += address[i].toLowerCase();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
exports.capitalizeAddressERC55 = capitalizeAddressERC55;
|
|
14
31
|
function makeEthAddress(address) {
|
|
15
32
|
if (typeof address === 'string') {
|
|
16
33
|
const hexAddr = (0, hex_1.makeHexString)(address, ETH_ADDR_HEX_LENGTH);
|
package/dist/cjs/utils/expose.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRedundancyStats = exports.getRedundancyStat = exports.approximateOverheadForRedundancyLevel = exports.getStampUsage = exports.getStampTtlSeconds = exports.getStampMaximumCapacityBytes = exports.getStampEffectiveBytes = exports.getStampCostInPlur = exports.getStampCostInBzz = exports.getDepthForCapacity = exports.getAmountForTtl = exports.makeMaxTarget = exports.keccak256Hash = exports.toLittleEndian = exports.makeHexEthAddress = exports.makeEthereumWalletSigner = exports.makeEthAddress = exports.isHexEthAddress = exports.fromLittleEndian = exports.ethToSwarmAddress = exports.makeHexString = exports.isHexString = exports.intToHex = exports.hexToBytes = exports.bytesToHex = exports.assertPrefixedHexString = exports.assertHexString = exports.isFlexBytes = exports.isBytes = exports.flexBytesAtOffset = exports.bytesEqual = exports.bytesAtOffset = exports.assertFlexBytes = exports.assertBytes = exports.getFolderSize = exports.getCollectionSize = void 0;
|
|
3
|
+
exports.getRedundancyStats = exports.getRedundancyStat = exports.approximateOverheadForRedundancyLevel = exports.getStampUsage = exports.getStampTtlSeconds = exports.getStampMaximumCapacityBytes = exports.getStampEffectiveBytes = exports.getStampCostInPlur = exports.getStampCostInBzz = exports.getDepthForCapacity = exports.getAmountForTtl = exports.makeMaxTarget = exports.keccak256Hash = exports.toLittleEndian = exports.makeHexEthAddress = exports.makeEthereumWalletSigner = exports.makeEthAddress = exports.isHexEthAddress = exports.fromLittleEndian = exports.ethToSwarmAddress = exports.capitalizeAddressERC55 = exports.makeHexString = exports.isHexString = exports.intToHex = exports.hexToBytes = exports.bytesToHex = exports.assertPrefixedHexString = exports.assertHexString = exports.isFlexBytes = exports.isBytes = exports.flexBytesAtOffset = exports.bytesEqual = exports.bytesAtOffset = exports.assertFlexBytes = exports.assertBytes = exports.getFolderSize = exports.getCollectionSize = void 0;
|
|
4
4
|
var collection_1 = require("./collection");
|
|
5
5
|
Object.defineProperty(exports, "getCollectionSize", { enumerable: true, get: function () { return collection_1.getCollectionSize; } });
|
|
6
6
|
var collection_node_1 = require("./collection.node");
|
|
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "intToHex", { enumerable: true, get: function ()
|
|
|
22
22
|
Object.defineProperty(exports, "isHexString", { enumerable: true, get: function () { return hex_1.isHexString; } });
|
|
23
23
|
Object.defineProperty(exports, "makeHexString", { enumerable: true, get: function () { return hex_1.makeHexString; } });
|
|
24
24
|
var eth_1 = require("./eth");
|
|
25
|
+
Object.defineProperty(exports, "capitalizeAddressERC55", { enumerable: true, get: function () { return eth_1.capitalizeAddressERC55; } });
|
|
25
26
|
Object.defineProperty(exports, "ethToSwarmAddress", { enumerable: true, get: function () { return eth_1.ethToSwarmAddress; } });
|
|
26
27
|
Object.defineProperty(exports, "fromLittleEndian", { enumerable: true, get: function () { return eth_1.fromLittleEndian; } });
|
|
27
28
|
Object.defineProperty(exports, "isHexEthAddress", { enumerable: true, get: function () { return eth_1.isHexEthAddress; } });
|
package/dist/cjs/utils/pss.js
CHANGED
|
@@ -7,7 +7,7 @@ const types_1 = require("../types");
|
|
|
7
7
|
* target that Bee node will except.
|
|
8
8
|
*
|
|
9
9
|
* @param target is a non-prefixed hex string Bee address
|
|
10
|
-
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/
|
|
10
|
+
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)
|
|
11
11
|
*/
|
|
12
12
|
function makeMaxTarget(target) {
|
|
13
13
|
if (typeof target !== 'string') {
|