@ethersphere/bee-js 6.9.0 → 7.0.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 (144) hide show
  1. package/README.md +107 -65
  2. package/dist/cjs/bee.js +533 -6
  3. package/dist/cjs/chunk/cac.js +3 -3
  4. package/dist/cjs/chunk/soc.js +5 -5
  5. package/dist/cjs/chunk/span.js +2 -6
  6. package/dist/cjs/feed/identifier.js +2 -2
  7. package/dist/cjs/feed/index.js +7 -8
  8. package/dist/cjs/feed/retrievable.js +2 -2
  9. package/dist/cjs/index.js +1 -3
  10. package/dist/cjs/modules/bytes.js +3 -3
  11. package/dist/cjs/modules/bzz.js +9 -20
  12. package/dist/cjs/modules/chunk.js +2 -2
  13. package/dist/cjs/modules/debug/balance.js +4 -4
  14. package/dist/cjs/modules/debug/chequebook.js +8 -8
  15. package/dist/cjs/modules/debug/chunk.js +2 -19
  16. package/dist/cjs/modules/debug/settlements.js +2 -2
  17. package/dist/cjs/modules/debug/stake.js +3 -3
  18. package/dist/cjs/modules/debug/states.js +4 -19
  19. package/dist/cjs/modules/debug/status.js +15 -32
  20. package/dist/cjs/modules/debug/tag.js +1 -1
  21. package/dist/cjs/modules/debug/transactions.js +4 -4
  22. package/dist/cjs/modules/feed.js +6 -7
  23. package/dist/cjs/modules/pinning.js +4 -4
  24. package/dist/cjs/modules/pss.js +1 -1
  25. package/dist/cjs/modules/soc.js +1 -1
  26. package/dist/cjs/modules/status.js +1 -1
  27. package/dist/cjs/modules/stewardship.js +1 -1
  28. package/dist/cjs/package.json +4 -0
  29. package/dist/cjs/types/index.js +5 -1
  30. package/dist/cjs/utils/collection.js +7 -22
  31. package/dist/cjs/utils/collection.node.js +2 -1
  32. package/dist/cjs/utils/data.browser.js +1 -49
  33. package/dist/cjs/utils/error.js +2 -6
  34. package/dist/cjs/utils/eth.js +1 -1
  35. package/dist/cjs/utils/expose.js +1 -8
  36. package/dist/cjs/utils/file.js +2 -2
  37. package/dist/cjs/utils/http.js +6 -25
  38. package/dist/cjs/utils/tar-uploader.browser.js +26 -0
  39. package/dist/cjs/utils/tar-uploader.js +27 -0
  40. package/dist/cjs/utils/tar-writer.browser.js +17 -0
  41. package/dist/cjs/utils/tar-writer.js +21 -0
  42. package/dist/cjs/utils/tar.browser.js +65 -0
  43. package/dist/cjs/utils/tar.js +47 -21
  44. package/dist/cjs/utils/type.js +7 -3
  45. package/dist/cjs/utils/url.js +1 -6
  46. package/dist/index.browser.min.js +1 -1
  47. package/dist/index.browser.min.js.LICENSE.txt +0 -42
  48. package/dist/index.browser.min.js.map +1 -1
  49. package/dist/mjs/bee.js +533 -9
  50. package/dist/mjs/chunk/cac.js +4 -4
  51. package/dist/mjs/chunk/soc.js +6 -6
  52. package/dist/mjs/chunk/span.js +2 -6
  53. package/dist/mjs/feed/identifier.js +2 -2
  54. package/dist/mjs/feed/index.js +7 -11
  55. package/dist/mjs/feed/retrievable.js +2 -2
  56. package/dist/mjs/index.js +1 -2
  57. package/dist/mjs/modules/bytes.js +3 -3
  58. package/dist/mjs/modules/bzz.js +8 -20
  59. package/dist/mjs/modules/chunk.js +2 -2
  60. package/dist/mjs/modules/debug/balance.js +4 -4
  61. package/dist/mjs/modules/debug/chequebook.js +8 -8
  62. package/dist/mjs/modules/debug/chunk.js +1 -17
  63. package/dist/mjs/modules/debug/settlements.js +2 -2
  64. package/dist/mjs/modules/debug/stake.js +3 -3
  65. package/dist/mjs/modules/debug/states.js +4 -19
  66. package/dist/mjs/modules/debug/status.js +15 -34
  67. package/dist/mjs/modules/debug/tag.js +1 -1
  68. package/dist/mjs/modules/debug/transactions.js +4 -4
  69. package/dist/mjs/modules/feed.js +6 -7
  70. package/dist/mjs/modules/pinning.js +4 -4
  71. package/dist/mjs/modules/pss.js +1 -1
  72. package/dist/mjs/modules/soc.js +1 -1
  73. package/dist/mjs/modules/status.js +1 -1
  74. package/dist/mjs/modules/stewardship.js +1 -1
  75. package/dist/mjs/package.json +6 -2
  76. package/dist/mjs/types/index.js +4 -0
  77. package/dist/mjs/utils/collection.js +7 -22
  78. package/dist/mjs/utils/collection.node.js +2 -1
  79. package/dist/mjs/utils/data.browser.js +0 -57
  80. package/dist/mjs/utils/error.js +2 -6
  81. package/dist/mjs/utils/eth.js +1 -1
  82. package/dist/mjs/utils/expose.js +0 -1
  83. package/dist/mjs/utils/http.js +5 -2
  84. package/dist/mjs/utils/tar-uploader.browser.js +22 -0
  85. package/dist/mjs/utils/tar-uploader.js +23 -0
  86. package/dist/mjs/utils/tar-writer.browser.js +12 -0
  87. package/dist/mjs/utils/tar-writer.js +16 -0
  88. package/dist/mjs/utils/tar.browser.js +61 -0
  89. package/dist/mjs/utils/tar.js +45 -16
  90. package/dist/mjs/utils/type.js +4 -1
  91. package/dist/mjs/utils/url.js +1 -6
  92. package/dist/types/bee.d.ts +305 -4
  93. package/dist/types/chunk/soc.d.ts +2 -2
  94. package/dist/types/feed/identifier.d.ts +1 -1
  95. package/dist/types/feed/index.d.ts +1 -1
  96. package/dist/types/index.d.ts +1 -3
  97. package/dist/types/modules/bytes.d.ts +3 -3
  98. package/dist/types/modules/bzz.d.ts +14 -6
  99. package/dist/types/modules/chunk.d.ts +2 -2
  100. package/dist/types/modules/debug/balance.d.ts +4 -4
  101. package/dist/types/modules/debug/chequebook.d.ts +8 -8
  102. package/dist/types/modules/debug/chunk.d.ts +1 -10
  103. package/dist/types/modules/debug/settlements.d.ts +2 -2
  104. package/dist/types/modules/debug/stake.d.ts +3 -3
  105. package/dist/types/modules/debug/states.d.ts +3 -3
  106. package/dist/types/modules/debug/status.d.ts +10 -20
  107. package/dist/types/modules/debug/tag.d.ts +1 -1
  108. package/dist/types/modules/debug/transactions.d.ts +4 -4
  109. package/dist/types/modules/feed.d.ts +6 -9
  110. package/dist/types/modules/pinning.d.ts +4 -4
  111. package/dist/types/modules/pss.d.ts +1 -1
  112. package/dist/types/modules/soc.d.ts +1 -1
  113. package/dist/types/modules/status.d.ts +1 -1
  114. package/dist/types/modules/stewardship.d.ts +1 -1
  115. package/dist/types/types/debug.d.ts +0 -3
  116. package/dist/types/types/index.d.ts +9 -17
  117. package/dist/types/utils/collection.browser.d.ts +1 -1
  118. package/dist/types/utils/collection.d.ts +3 -3
  119. package/dist/types/utils/collection.node.d.ts +1 -1
  120. package/dist/types/utils/data.browser.d.ts +0 -7
  121. package/dist/types/utils/data.d.ts +1 -2
  122. package/dist/types/utils/error.d.ts +2 -7
  123. package/dist/types/utils/eth.d.ts +1 -1
  124. package/dist/types/utils/expose.d.ts +0 -1
  125. package/dist/types/utils/tar-uploader.browser.d.ts +4 -0
  126. package/dist/types/utils/tar-uploader.d.ts +4 -0
  127. package/dist/types/utils/tar-writer.browser.d.ts +3 -0
  128. package/dist/types/utils/tar-writer.d.ts +3 -0
  129. package/dist/types/utils/tar.browser.d.ts +9 -0
  130. package/dist/types/utils/tar.d.ts +10 -2
  131. package/dist/types/utils/type.d.ts +4 -1
  132. package/package.json +4 -19
  133. package/dist/cjs/bee-debug.js +0 -590
  134. package/dist/cjs/chunk/serialize.js +0 -19
  135. package/dist/cjs/utils/stream.js +0 -146
  136. package/dist/cjs/utils/uint64.js +0 -29
  137. package/dist/mjs/bee-debug.js +0 -560
  138. package/dist/mjs/chunk/serialize.js +0 -15
  139. package/dist/mjs/utils/stream.js +0 -129
  140. package/dist/mjs/utils/uint64.js +0 -22
  141. package/dist/types/bee-debug.d.ts +0 -323
  142. package/dist/types/chunk/serialize.d.ts +0 -6
  143. package/dist/types/utils/stream.d.ts +0 -40
  144. package/dist/types/utils/uint64.d.ts +0 -4
@@ -1,7 +1,9 @@
1
+ /// <reference types="node" />
2
+ import { Readable } from 'stream';
1
3
  import { Index, IndexBytes } from './feed';
2
4
  import { FeedType } from './feed/type';
3
- import type { AddressPrefix, AnyJson, BatchId, BeeOptions, BeeRequestOptions, CollectionUploadOptions, Data, FeedReader, FeedWriter, FileData, FileUploadOptions, JsonFeedOptions, Pin, PssMessageHandler, PssSubscription, PublicKey, Reference, SOCReader, SOCWriter, Signer, Tag, Topic, UploadOptions, UploadRedundancyOptions, UploadResultWithCid } from './types';
4
- import { AllTagsOptions, Collection, FeedManifestResult, Readable, ReferenceCidOrEns, ReferenceOrEns, UploadResult } from './types';
5
+ import type { Address, AddressPrefix, AllSettlements, AnyJson, BalanceResponse, BatchId, BeeOptions, BeeRequestOptions, BeeVersions, ChainState, ChequebookAddressResponse, ChequebookBalanceResponse, CollectionUploadOptions, Data, DebugStatus, ExtendedTag, FeedReader, FeedWriter, FileData, FileUploadOptions, Health, JsonFeedOptions, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NodeAddresses, NodeInfo, NumberString, Peer, PeerBalance, Pin, PingResponse, PostageBatch, PostageBatchBuckets, PssMessageHandler, PssSubscription, PublicKey, RedistributionState, Reference, RemovePeerResponse, ReserveState, SOCReader, SOCWriter, Settlements, Signer, Tag, Topic, Topology, TransactionHash, TransactionInfo, UploadOptions, UploadRedundancyOptions, UploadResultWithCid, WalletBalance } from './types';
6
+ import { AllTagsOptions, CashoutOptions, Collection, FeedManifestResult, PostageBatchOptions, ReferenceCidOrEns, ReferenceOrEns, TransactionOptions, UploadResult } from './types';
5
7
  import { EthAddress } from './utils/eth';
6
8
  /**
7
9
  * The main component that abstracts operations available on the main Bee API.
@@ -19,7 +21,7 @@ export declare class Bee {
19
21
  */
20
22
  readonly signer?: Signer;
21
23
  /**
22
- * Ky instance that defines connection to Bee node
24
+ * Options for making requests
23
25
  * @private
24
26
  */
25
27
  private readonly requestOptions;
@@ -155,7 +157,7 @@ export declare class Bee {
155
157
  * @param collection
156
158
  * @param options Collections and request options
157
159
  */
158
- uploadCollection(postageBatchId: string | BatchId, collection: Collection<Uint8Array | Readable>, options?: CollectionUploadOptions & UploadRedundancyOptions): Promise<UploadResultWithCid>;
160
+ uploadCollection(postageBatchId: string | BatchId, collection: Collection, options?: CollectionUploadOptions & UploadRedundancyOptions): Promise<UploadResultWithCid>;
159
161
  /**
160
162
  * Upload collection of files.
161
163
  *
@@ -489,6 +491,305 @@ export declare class Bee {
489
491
  * @returns true if successful, false on error
490
492
  */
491
493
  isConnected(options?: BeeRequestOptions): Promise<boolean>;
494
+ getNodeAddresses(options?: BeeRequestOptions): Promise<NodeAddresses>;
495
+ getBlocklist(options?: BeeRequestOptions): Promise<Peer[]>;
496
+ /**
497
+ * Retrieve tag extended information from Bee node
498
+ *
499
+ * @param tagUid UID or tag object to be retrieved
500
+ * @throws TypeError if tagUid is in not correct format
501
+ *
502
+ * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
503
+ * @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/debug-api/#tag/Tag)
504
+ *
505
+ */
506
+ retrieveExtendedTag(tagUid: number | Tag, options?: BeeRequestOptions): Promise<ExtendedTag>;
507
+ /**
508
+ * Get list of peers for this node
509
+ */
510
+ getPeers(options?: BeeRequestOptions): Promise<Peer[]>;
511
+ removePeer(peer: string | Address, options?: BeeRequestOptions): Promise<RemovePeerResponse>;
512
+ getTopology(options?: BeeRequestOptions): Promise<Topology>;
513
+ pingPeer(peer: string | Address, options?: BeeRequestOptions): Promise<PingResponse>;
514
+ /**
515
+ * Get the balances with all known peers including prepaid services
516
+ */
517
+ getAllBalances(options?: BeeRequestOptions): Promise<BalanceResponse>;
518
+ /**
519
+ * Get the balances with a specific peer including prepaid services
520
+ *
521
+ * @param address Swarm address of peer
522
+ */
523
+ getPeerBalance(address: Address | string, options?: BeeRequestOptions): Promise<PeerBalance>;
524
+ /**
525
+ * Get the past due consumption balances with all known peers
526
+ */
527
+ getPastDueConsumptionBalances(options?: BeeRequestOptions): Promise<BalanceResponse>;
528
+ /**
529
+ * Get the past due consumption balance with a specific peer
530
+ *
531
+ * @param address Swarm address of peer
532
+ */
533
+ getPastDueConsumptionPeerBalance(address: Address | string, options?: BeeRequestOptions): Promise<PeerBalance>;
534
+ /**
535
+ * Get the address of the chequebook contract used.
536
+ *
537
+ * **Warning:** The address is returned with 0x prefix unlike all other calls.
538
+ * https://github.com/ethersphere/bee/issues/1443
539
+ */
540
+ getChequebookAddress(options?: BeeRequestOptions): Promise<ChequebookAddressResponse>;
541
+ /**
542
+ * Get the balance of the chequebook
543
+ */
544
+ getChequebookBalance(options?: BeeRequestOptions): Promise<ChequebookBalanceResponse>;
545
+ /**
546
+ * Get last cheques for all peers
547
+ */
548
+ getLastCheques(options?: BeeRequestOptions): Promise<LastChequesResponse>;
549
+ /**
550
+ * Get last cheques for the peer
551
+ *
552
+ * @param address Swarm address of peer
553
+ */
554
+ getLastChequesForPeer(address: Address | string, options?: BeeRequestOptions): Promise<LastChequesForPeerResponse>;
555
+ /**
556
+ * Get last cashout action for the peer
557
+ *
558
+ * @param address Swarm address of peer
559
+ */
560
+ getLastCashoutAction(address: Address | string, options?: BeeRequestOptions): Promise<LastCashoutActionResponse>;
561
+ /**
562
+ * Cashout the last cheque for the peer
563
+ *
564
+ * @param address Swarm address of peer
565
+ * @param options
566
+ * @param options.gasPrice Gas price for the cashout transaction in WEI
567
+ * @param options.gasLimit Gas limit for the cashout transaction in WEI
568
+ */
569
+ cashoutLastCheque(address: string | Address, options?: CashoutOptions, requestOptions?: BeeRequestOptions): Promise<string>;
570
+ /**
571
+ * Deposit tokens from overlay address into chequebook
572
+ *
573
+ * @param amount Amount of tokens to deposit (must be positive integer)
574
+ * @param gasPrice Gas Price in WEI for the transaction call
575
+ * @return string Hash of the transaction
576
+ */
577
+ depositTokens(amount: number | NumberString, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<string>;
578
+ /**
579
+ * Withdraw tokens from the chequebook to the overlay address
580
+ *
581
+ * @param amount Amount of tokens to withdraw (must be positive integer)
582
+ * @param gasPrice Gas Price in WEI for the transaction call
583
+ * @return string Hash of the transaction
584
+ */
585
+ withdrawTokens(amount: number | NumberString, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<string>;
586
+ /**
587
+ * Get amount of sent and received from settlements with a peer
588
+ *
589
+ * @param address Swarm address of peer
590
+ */
591
+ getSettlements(address: Address | string, options?: BeeRequestOptions): Promise<Settlements>;
592
+ /**
593
+ * Get settlements with all known peers and total amount sent or received
594
+ */
595
+ getAllSettlements(options?: BeeRequestOptions): Promise<AllSettlements>;
596
+ /**
597
+ * Get status of node
598
+ */
599
+ getStatus(options?: BeeRequestOptions): Promise<DebugStatus>;
600
+ /**
601
+ * Get health of node
602
+ */
603
+ getHealth(options?: BeeRequestOptions): Promise<Health>;
604
+ /**
605
+ * Get readiness of node
606
+ */
607
+ getReadiness(options?: BeeRequestOptions): Promise<boolean>;
608
+ /**
609
+ * Get mode information of node
610
+ */
611
+ getNodeInfo(options?: BeeRequestOptions): Promise<NodeInfo>;
612
+ /**
613
+ * Connnects to a node and checks if it is a supported Bee version by the bee-js
614
+ *
615
+ * @returns true if the Bee node version is supported
616
+ * @deprecated Use `BeeDebug.isSupportedExactVersion()` instead
617
+ */
618
+ isSupportedVersion(options?: BeeRequestOptions): Promise<boolean> | never;
619
+ /**
620
+ * Connects to a node and checks if its version matches with the one that bee-js supports.
621
+ *
622
+ * Be aware that this is the most strict version check and most probably
623
+ * you will want to use more relaxed API-versions based checks like
624
+ * `BeeDebug.isSupportedApiVersion()`, `BeeDebug.isSupportedMainApiVersion()` or `BeeDebug.isSupportedDebugApiVersion()`
625
+ * based on your use-case.
626
+ *
627
+ * @param options
628
+ */
629
+ isSupportedExactVersion(options?: BeeRequestOptions): Promise<boolean> | never;
630
+ /**
631
+ * Connects to a node and checks if its main's API version matches with the one that bee-js supports.
632
+ *
633
+ * This is useful if you are not using `BeeDebug` class (for anything else then this check)
634
+ * and want to make sure about compatibility.
635
+ *
636
+ * @param options
637
+ */
638
+ isSupportedMainApiVersion(options?: BeeRequestOptions): Promise<boolean> | never;
639
+ /**
640
+ *
641
+ * Connects to a node and checks if its Main API version matches with the one that bee-js supports.
642
+ *
643
+ * This should be the main way how to check compatibility for your app and Bee node.
644
+ *
645
+ * @param options
646
+ */
647
+ isSupportedApiVersion(options?: BeeRequestOptions): Promise<boolean> | never;
648
+ /**
649
+ * Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)
650
+ * and versions that bee-js supports (properties prefixed with `supported*`).
651
+ *
652
+ * @param options
653
+ */
654
+ getVersions(options?: BeeRequestOptions): Promise<BeeVersions> | never;
655
+ /**
656
+ * Get reserve state
657
+ */
658
+ getReserveState(options?: BeeRequestOptions): Promise<ReserveState>;
659
+ /**
660
+ * Get chain state
661
+ */
662
+ getChainState(options?: BeeRequestOptions): Promise<ChainState>;
663
+ /**
664
+ * Get wallet balances for xDai and BZZ of the Bee node
665
+ *
666
+ * @param options
667
+ */
668
+ getWalletBalance(options?: BeeRequestOptions): Promise<WalletBalance>;
669
+ /**
670
+ * Creates new postage batch from the funds that the node has available in its Ethereum account.
671
+ *
672
+ * For better understanding what each parameter means and what are the optimal values please see
673
+ * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
674
+ *
675
+ * **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
676
+ *
677
+ * @param amount Amount that represents the value per chunk, has to be greater or equal zero.
678
+ * @param depth Logarithm of the number of chunks that can be stamped with the batch.
679
+ * @param options Options for creation of postage batch
680
+ * @throws BeeArgumentError when negative amount or depth is specified
681
+ * @throws TypeError if non-integer value is passed to amount or depth
682
+ *
683
+ * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
684
+ * @see [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post)
685
+ */
686
+ createPostageBatch(amount: NumberString, depth: number, options?: PostageBatchOptions, requestOptions?: BeeRequestOptions): Promise<BatchId>;
687
+ /**
688
+ * Topup a fresh amount of BZZ to given Postage Batch.
689
+ *
690
+ * For better understanding what each parameter means and what are the optimal values please see
691
+ * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
692
+ *
693
+ * **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
694
+ *
695
+ * @param postageBatchId Batch ID
696
+ * @param amount Amount to be added to the batch
697
+ * @param options Request options
698
+ *
699
+ * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
700
+ * @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)
701
+ */
702
+ topUpBatch(postageBatchId: BatchId | string, amount: NumberString, options?: BeeRequestOptions): Promise<void>;
703
+ /**
704
+ * Dilute given Postage Batch with new depth (that has to be bigger then the original depth), which allows
705
+ * the Postage Batch to be used for more chunks.
706
+ *
707
+ * For better understanding what each parameter means and what are the optimal values please see
708
+ * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
709
+ *
710
+ * **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
711
+ *
712
+ * @param postageBatchId Batch ID
713
+ * @param depth Amount to be added to the batch
714
+ * @param options Request options
715
+ *
716
+ * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
717
+ * @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)
718
+ */
719
+ diluteBatch(postageBatchId: BatchId | string, depth: number, options?: BeeRequestOptions): Promise<void>;
720
+ /**
721
+ * Return details for specific postage batch.
722
+ *
723
+ * @param postageBatchId Batch ID
724
+ *
725
+ * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
726
+ * @see [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}/get)
727
+ */
728
+ getPostageBatch(postageBatchId: BatchId | string, options?: BeeRequestOptions): Promise<PostageBatch>;
729
+ /**
730
+ * Return detailed information related to buckets for specific postage batch.
731
+ *
732
+ * @param postageBatchId Batch ID
733
+ *
734
+ * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
735
+ * @see [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}~1buckets/get)
736
+ */
737
+ getPostageBatchBuckets(postageBatchId: BatchId | string, options?: BeeRequestOptions): Promise<PostageBatchBuckets>;
738
+ /**
739
+ * Return all postage batches that has the node available.
740
+ *
741
+ * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
742
+ * @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps/get)
743
+ */
744
+ getAllPostageBatch(options?: BeeRequestOptions): Promise<PostageBatch[]>;
745
+ /**
746
+ * Return all globally available postage batches.
747
+ */
748
+ getAllGlobalPostageBatch(options?: BeeRequestOptions): Promise<PostageBatch[]>;
749
+ /**
750
+ * Return lists of all current pending transactions that the Bee made
751
+ */
752
+ getAllPendingTransactions(options?: BeeRequestOptions): Promise<TransactionInfo[]>;
753
+ /**
754
+ * Return transaction information for specific transaction
755
+ * @param transactionHash
756
+ */
757
+ getPendingTransaction(transactionHash: TransactionHash | string, options?: BeeRequestOptions): Promise<TransactionInfo>;
758
+ /**
759
+ * Rebroadcast already created transaction.
760
+ * This is mainly needed when your transaction fall off mempool from other reason is not incorporated into block.
761
+ *
762
+ * @param transactionHash
763
+ */
764
+ rebroadcastPendingTransaction(transactionHash: TransactionHash | string, options?: BeeRequestOptions): Promise<TransactionHash>;
765
+ /**
766
+ * Cancel currently pending transaction
767
+ * @param transactionHash
768
+ * @param gasPrice
769
+ */
770
+ cancelPendingTransaction(transactionHash: TransactionHash | string, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<TransactionHash>;
771
+ /**
772
+ * Gets the staked amount of BZZ (in PLUR unit) as number string.
773
+ *
774
+ * @param options
775
+ */
776
+ getStake(options?: BeeRequestOptions): Promise<NumberString>;
777
+ /**
778
+ * Deposits given amount of BZZ token (in PLUR unit).
779
+ *
780
+ * Be aware that staked BZZ tokens can **not** be withdrawn.
781
+ *
782
+ * @param amount Amount of BZZ token (in PLUR unit) to be staked. Minimum is 100_000_000_000_000_000 PLUR (10 BZZ).
783
+ * @param options
784
+ */
785
+ depositStake(amount: NumberString, options?: TransactionOptions, requestOptions?: BeeRequestOptions): Promise<void>;
786
+ /**
787
+ * Get current status of node in redistribution game
788
+ *
789
+ * @param options
790
+ */
791
+ getRedistributionState(options?: BeeRequestOptions): Promise<RedistributionState>;
792
+ private waitForUsablePostageStamp;
492
793
  /**
493
794
  * @param signer
494
795
  * @private
@@ -39,7 +39,7 @@ export declare function makeSingleOwnerChunk(chunk: Chunk, identifier: Identifie
39
39
  *
40
40
  * It uses the Chunk API and calculates the address before uploading.
41
41
  *
42
- * @param kyOptions Ky Options for making requests
42
+ * @param requestOptions Options for making requests
43
43
  * @param chunk A chunk object
44
44
  * @param postageBatchId Postage BatchId that will be assigned to uploaded data
45
45
  * @param options Upload options
@@ -48,7 +48,7 @@ export declare function uploadSingleOwnerChunk(requestOptions: BeeRequestOptions
48
48
  /**
49
49
  * Helper function to create and upload SOC.
50
50
  *
51
- * @param kyOptions Ky Options for making requests
51
+ * @param requestOptions Options for making requests
52
52
  * @param signer The singer interface for signing the chunk
53
53
  * @param postageBatchId
54
54
  * @param identifier The identifier of the chunk
@@ -1,4 +1,4 @@
1
- import { Topic } from '../types';
2
1
  import { Identifier } from '../chunk/soc';
2
+ import { Topic } from '../types';
3
3
  import { Index } from './index';
4
4
  export declare function makeFeedIdentifier(topic: Topic, index: Index): Identifier;
@@ -21,7 +21,7 @@ export interface FeedUpdate {
21
21
  reference: BytesReference;
22
22
  }
23
23
  export declare function findNextIndex(requestOptions: BeeRequestOptions, owner: HexEthAddress, topic: Topic, options?: FeedUpdateOptions): Promise<HexString<typeof FEED_INDEX_HEX_LENGTH>>;
24
- export declare function updateFeed(requestOptions: BeeRequestOptions, signer: Signer, topic: Topic, reference: BytesReference, postageBatchId: BatchId, options?: FeedUploadOptions, index?: Index): Promise<Reference>;
24
+ export declare function updateFeed(requestOptions: BeeRequestOptions, signer: Signer, topic: Topic, reference: BytesReference, postageBatchId: BatchId, options?: FeedUploadOptions): Promise<Reference>;
25
25
  export declare function getFeedUpdateChunkReference(owner: EthAddress, topic: Topic, index: Index): PlainBytesReference;
26
26
  export declare function downloadFeedUpdate(requestOptions: BeeRequestOptions, owner: EthAddress, topic: Topic, index: Index): Promise<FeedUpdate>;
27
27
  export declare function makeFeedReader(requestOptions: BeeRequestOptions, type: FeedType, topic: Topic, owner: HexEthAddress): FeedReader;
@@ -1,15 +1,13 @@
1
1
  import { Bee } from './bee';
2
- import { BeeDebug } from './bee-debug';
3
2
  export { SUPPORTED_BEE_VERSION, SUPPORTED_BEE_VERSION_EXACT } from './modules/debug/status';
4
3
  export * from './types';
5
4
  export * from './utils/error';
6
5
  export * as Utils from './utils/expose';
7
- export { Bee, BeeDebug };
6
+ export { Bee };
8
7
  declare global {
9
8
  interface Window {
10
9
  BeeJs: {
11
10
  Bee: typeof import('./bee').Bee;
12
- BeeDebug: typeof import('./bee-debug').BeeDebug;
13
11
  Utils: typeof import('./utils/expose');
14
12
  BeeError: typeof import('./utils/error').BeeError;
15
13
  BeeArgumentError: typeof import('./utils/error').BeeArgumentError;
@@ -3,7 +3,7 @@ import { UploadResult } from '../types';
3
3
  /**
4
4
  * Upload data to a Bee node
5
5
  *
6
- * @param kyOptions Ky Options for making requests
6
+ * @param requestOptions Options for making requests
7
7
  * @param data Data to be uploaded
8
8
  * @param postageBatchId Postage BatchId that will be assigned to uploaded data
9
9
  * @param options Additional options like tag, encryption, pinning
@@ -12,14 +12,14 @@ export declare function upload(requestOptions: BeeRequestOptions, data: string |
12
12
  /**
13
13
  * Download data as a byte array
14
14
  *
15
- * @param ky
15
+ * @param requestOptions Options for making requests
16
16
  * @param hash Bee content reference
17
17
  */
18
18
  export declare function download(requestOptions: BeeRequestOptions, hash: ReferenceOrEns, options?: DownloadRedundancyOptions): Promise<Data>;
19
19
  /**
20
20
  * Download data as a readable stream
21
21
  *
22
- * @param ky
22
+ * @param requestOptions Options for making requests
23
23
  * @param hash Bee content reference
24
24
  */
25
25
  export declare function downloadReadable(requestOptions: BeeRequestOptions, hash: ReferenceOrEns, options?: DownloadRedundancyOptions): Promise<ReadableStream<Uint8Array>>;
@@ -1,8 +1,10 @@
1
- import { BatchId, BeeRequestOptions, Collection, CollectionUploadOptions, Data, DownloadRedundancyOptions, FileData, FileUploadOptions, Readable, ReferenceOrEns, UploadRedundancyOptions, UploadResult } from '../types';
1
+ /// <reference types="node" />
2
+ import { Readable } from 'stream';
3
+ import { BatchId, BeeRequestOptions, Collection, CollectionUploadOptions, Data, DownloadRedundancyOptions, FileData, FileUploadOptions, ReferenceOrEns, UploadHeaders, UploadRedundancyOptions, UploadResult } from '../types';
2
4
  /**
3
5
  * Upload single file
4
6
  *
5
- * @param ky
7
+ * @param requestOptions Options for making requests
6
8
  * @param data Files data
7
9
  * @param postageBatchId Postage BatchId that will be assigned to uploaded data
8
10
  * @param name Name that will be attached to the uploaded file. Wraps the data into manifest with set index document.
@@ -12,7 +14,7 @@ export declare function uploadFile(requestOptions: BeeRequestOptions, data: stri
12
14
  /**
13
15
  * Download single file as a buffer
14
16
  *
15
- * @param kyOptions Ky Options for making requests
17
+ * @param requestOptions Options for making requests
16
18
  * @param hash Bee file or collection hash
17
19
  * @param path If hash is collection then this defines path to a single file in the collection
18
20
  */
@@ -20,16 +22,22 @@ export declare function downloadFile(requestOptions: BeeRequestOptions, hash: Re
20
22
  /**
21
23
  * Download single file as a readable stream
22
24
  *
23
- * @param kyOptions Ky Options for making requests
25
+ * @param requestOptions Options for making requests
24
26
  * @param hash Bee file or collection hash
25
27
  * @param path If hash is collection then this defines path to a single file in the collection
26
28
  */
27
29
  export declare function downloadFileReadable(requestOptions: BeeRequestOptions, hash: ReferenceOrEns, path?: string, options?: DownloadRedundancyOptions): Promise<FileData<ReadableStream<Uint8Array>>>;
30
+ /*******************************************************************************************************************/
31
+ export interface CollectionUploadHeaders extends UploadHeaders {
32
+ 'swarm-index-document'?: string;
33
+ 'swarm-error-document'?: string;
34
+ }
35
+ export declare function extractCollectionUploadHeaders(postageBatchId: BatchId, options?: CollectionUploadOptions & UploadRedundancyOptions): CollectionUploadHeaders & UploadRedundancyOptions;
28
36
  /**
29
37
  * Upload collection
30
- * @param kyOptions Ky Options for making requests
38
+ * @param requestOptions Options for making requests
31
39
  * @param collection Collection of Uint8Array buffers to upload
32
40
  * @param postageBatchId Postage BatchId that will be assigned to uploaded data
33
41
  * @param options
34
42
  */
35
- export declare function uploadCollection(requestOptions: BeeRequestOptions, collection: Collection<Uint8Array>, postageBatchId: BatchId, options?: CollectionUploadOptions & UploadRedundancyOptions): Promise<UploadResult>;
43
+ export declare function uploadCollection(requestOptions: BeeRequestOptions, collection: Collection, postageBatchId: BatchId, options?: CollectionUploadOptions & UploadRedundancyOptions): Promise<UploadResult>;
@@ -6,7 +6,7 @@ import type { BatchId, BeeRequestOptions, Data, Reference, ReferenceOrEns, Uploa
6
6
  * The span stores the length of the payload in uint64 little endian encoding.
7
7
  * Upload expects the chuck data to be set accordingly.
8
8
  *
9
- * @param ky Ky instance
9
+ * @param requestOptions Options for making requests
10
10
  * @param data Chunk data to be uploaded
11
11
  * @param postageBatchId Postage BatchId that will be assigned to uploaded data
12
12
  * @param options Additional options like tag, encryption, pinning
@@ -15,7 +15,7 @@ export declare function upload(requestOptions: BeeRequestOptions, data: Uint8Arr
15
15
  /**
16
16
  * Download chunk data as a byte array
17
17
  *
18
- * @param kyOptions Ky Options for making requests
18
+ * @param requestOptions Options for making requests
19
19
  * @param hash Bee content reference
20
20
  *
21
21
  */
@@ -2,26 +2,26 @@ import type { BalanceResponse, BeeRequestOptions, PeerBalance } from '../../type
2
2
  /**
3
3
  * Get the balances with all known peers including prepaid services
4
4
  *
5
- * @param kyOptions Ky Options for making requests
5
+ * @param requestOptions Options for making requests
6
6
  */
7
7
  export declare function getAllBalances(requestOptions: BeeRequestOptions): Promise<BalanceResponse>;
8
8
  /**
9
9
  * Get the balances with a specific peer including prepaid services
10
10
  *
11
- * @param kyOptions Ky Options for making requests
11
+ * @param requestOptions Options for making requests
12
12
  * @param address Swarm address of peer
13
13
  */
14
14
  export declare function getPeerBalance(requestOptions: BeeRequestOptions, address: string): Promise<PeerBalance>;
15
15
  /**
16
16
  * Get the past due consumption balances with all known peers
17
17
  *
18
- * @param kyOptions Ky Options for making requests
18
+ * @param requestOptions Options for making requests
19
19
  */
20
20
  export declare function getPastDueConsumptionBalances(requestOptions: BeeRequestOptions): Promise<BalanceResponse>;
21
21
  /**
22
22
  * Get the past due consumption balance with a specific peer
23
23
  *
24
- * @param kyOptions Ky Options for making requests
24
+ * @param requestOptions Options for making requests
25
25
  * @param address Swarm address of peer
26
26
  */
27
27
  export declare function getPastDueConsumptionPeerBalance(requestOptions: BeeRequestOptions, address: string): Promise<PeerBalance>;
@@ -2,26 +2,26 @@ import type { BeeRequestOptions, CashoutOptions, ChequebookAddressResponse, Cheq
2
2
  /**
3
3
  * Get the address of the chequebook contract used
4
4
  *
5
- * @param kyOptions Ky Options for making requests
5
+ * @param requestOptions Options for making requests
6
6
  */
7
7
  export declare function getChequebookAddress(requestOptions: BeeRequestOptions): Promise<ChequebookAddressResponse>;
8
8
  /**
9
9
  * Get the balance of the chequebook
10
10
  *
11
- * @param kyOptions Ky Options for making requests
11
+ * @param requestOptions Options for making requests
12
12
  */
13
13
  export declare function getChequebookBalance(requestOptions: BeeRequestOptions): Promise<ChequebookBalanceResponse>;
14
14
  /**
15
15
  * Get last cashout action for the peer
16
16
  *
17
- * @param kyOptions Ky Options for making requests
17
+ * @param requestOptions Options for making requests
18
18
  * @param peer Swarm address of peer
19
19
  */
20
20
  export declare function getLastCashoutAction(requestOptions: BeeRequestOptions, peer: string): Promise<LastCashoutActionResponse>;
21
21
  /**
22
22
  * Cashout the last cheque for the peer
23
23
  *
24
- * @param kyOptions Ky Options for making requests
24
+ * @param requestOptions Options for making requests
25
25
  * @param peer Swarm address of peer
26
26
  * @param options
27
27
  */
@@ -29,20 +29,20 @@ export declare function cashoutLastCheque(requestOptions: BeeRequestOptions, pee
29
29
  /**
30
30
  * Get last cheques for the peer
31
31
  *
32
- * @param kyOptions Ky Options for making requests
32
+ * @param requestOptions Options for making requests
33
33
  * @param peer Swarm address of peer
34
34
  */
35
35
  export declare function getLastChequesForPeer(requestOptions: BeeRequestOptions, peer: string): Promise<LastChequesForPeerResponse>;
36
36
  /**
37
37
  * Get last cheques for all peers
38
38
  *
39
- * @param kyOptions Ky Options for making requests
39
+ * @param requestOptions Options for making requests
40
40
  */
41
41
  export declare function getLastCheques(requestOptions: BeeRequestOptions): Promise<LastChequesResponse>;
42
42
  /**
43
43
  * Deposit tokens from overlay address into chequebook
44
44
  *
45
- * @param kyOptions Ky Options for making requests
45
+ * @param requestOptions Options for making requests
46
46
  * @param amount Amount of tokens to deposit
47
47
  * @param gasPrice Gas Price in WEI for the transaction call
48
48
  * @return string Hash of the transaction
@@ -51,7 +51,7 @@ export declare function depositTokens(requestOptions: BeeRequestOptions, amount:
51
51
  /**
52
52
  * Withdraw tokens from the chequebook to the overlay address
53
53
  *
54
- * @param kyOptions Ky Options for making requests
54
+ * @param requestOptions Options for making requests
55
55
  * @param amount Amount of tokens to withdraw
56
56
  * @param gasPrice Gas Price in WEI for the transaction call
57
57
  * @return string Hash of the transaction
@@ -2,18 +2,9 @@ import type { BeeGenericResponse, BeeRequestOptions } from '../../types';
2
2
  /**
3
3
  * Check if chunk at address exists locally
4
4
  *
5
- * @param kyOptions Ky Options for making requests
5
+ * @param requestOptions Options for making requests
6
6
  * @param address Swarm address of chunk
7
7
  *
8
8
  * @returns BeeGenericResponse if chunk is found or throws an exception
9
9
  */
10
10
  export declare function checkIfChunkExistsLocally(requestOptions: BeeRequestOptions, address: string): Promise<BeeGenericResponse>;
11
- /**
12
- * Delete a chunk from local storage
13
- *
14
- * @param kyOptions Ky Options for making requests
15
- * @param address Swarm address of chunk
16
- *
17
- * @returns BeeGenericResponse if chunk was deleted or throws an exception
18
- */
19
- export declare function deleteChunkFromLocalStorage(requestOptions: BeeRequestOptions, address: string): Promise<BeeGenericResponse>;
@@ -2,13 +2,13 @@ import type { AllSettlements, BeeRequestOptions, Settlements } from '../../types
2
2
  /**
3
3
  * Get amount of sent and received from settlements with a peer
4
4
  *
5
- * @param kyOptions Ky Options for making requests
5
+ * @param requestOptions Options for making requests
6
6
  * @param peer Swarm address of peer
7
7
  */
8
8
  export declare function getSettlements(requestOptions: BeeRequestOptions, peer: string): Promise<Settlements>;
9
9
  /**
10
10
  * Get settlements with all known peers and total amount sent or received
11
11
  *
12
- * @param kyOptions Ky Options for making requests
12
+ * @param requestOptions Options for making requests
13
13
  */
14
14
  export declare function getAllSettlements(requestOptions: BeeRequestOptions): Promise<AllSettlements>;
@@ -2,13 +2,13 @@ import { BeeRequestOptions, NumberString, RedistributionState, TransactionOption
2
2
  /**
3
3
  * Gets the staked amount
4
4
  *
5
- * @param kyOptions Ky Options for making requests
5
+ * @param requestOptions Options for making requests
6
6
  */
7
7
  export declare function getStake(requestOptions: BeeRequestOptions): Promise<NumberString>;
8
8
  /**
9
9
  * Stake given amount of tokens.
10
10
  *
11
- * @param ky
11
+ * @param requestOptions Options for making requests
12
12
  * @param amount
13
13
  * @param options
14
14
  */
@@ -16,6 +16,6 @@ export declare function stake(requestOptions: BeeRequestOptions, amount: NumberS
16
16
  /**
17
17
  * Get current status of node in redistribution game
18
18
  *
19
- * @param kyOptions Ky Options for making requests
19
+ * @param requestOptions Options for making requests
20
20
  */
21
21
  export declare function getRedistributionState(requestOptions: BeeRequestOptions): Promise<RedistributionState>;