@ethersphere/bee-js 8.3.1 → 9.0.2

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 (224) hide show
  1. package/README.md +192 -50
  2. package/dist/cjs/bee-dev.js +78 -0
  3. package/dist/cjs/bee.js +341 -417
  4. package/dist/cjs/chunk/bmt.js +15 -32
  5. package/dist/cjs/chunk/cac.js +26 -36
  6. package/dist/cjs/chunk/soc.js +56 -51
  7. package/dist/cjs/feed/identifier.js +3 -28
  8. package/dist/cjs/feed/index.js +95 -44
  9. package/dist/cjs/feed/retrievable.js +11 -22
  10. package/dist/cjs/index.js +17 -1
  11. package/dist/cjs/manifest/manifest.js +369 -0
  12. package/dist/cjs/modules/bytes.js +24 -12
  13. package/dist/cjs/modules/bzz.js +24 -34
  14. package/dist/cjs/modules/chunk.js +13 -7
  15. package/dist/cjs/modules/debug/balance.js +29 -4
  16. package/dist/cjs/modules/debug/chequebook.js +60 -16
  17. package/dist/cjs/modules/debug/connectivity.js +82 -4
  18. package/dist/cjs/modules/debug/settlements.js +22 -2
  19. package/dist/cjs/modules/debug/stake.js +29 -11
  20. package/dist/cjs/modules/debug/stamps.js +88 -7
  21. package/dist/cjs/modules/debug/states.js +25 -3
  22. package/dist/cjs/modules/debug/status.js +45 -47
  23. package/dist/cjs/modules/debug/transactions.js +27 -5
  24. package/dist/cjs/modules/envelope.js +8 -6
  25. package/dist/cjs/modules/feed.js +25 -10
  26. package/dist/cjs/modules/grantee.js +18 -12
  27. package/dist/cjs/modules/gsoc.js +24 -0
  28. package/dist/cjs/modules/pinning.js +13 -2
  29. package/dist/cjs/modules/pss.js +9 -3
  30. package/dist/cjs/modules/soc.js +9 -4
  31. package/dist/cjs/modules/stewardship.js +7 -3
  32. package/dist/cjs/modules/tag.js +35 -3
  33. package/dist/cjs/package.json +1 -0
  34. package/dist/cjs/stamper/stamper.js +43 -0
  35. package/dist/cjs/types/debug.js +16 -1
  36. package/dist/cjs/types/index.js +2 -24
  37. package/dist/cjs/utils/bytes.js +67 -115
  38. package/dist/cjs/utils/chunk-size.js +17 -0
  39. package/dist/cjs/utils/chunk-stream.browser.js +85 -0
  40. package/dist/cjs/utils/chunk-stream.js +84 -0
  41. package/dist/cjs/utils/cid.js +5 -6
  42. package/dist/cjs/utils/collection.browser.js +2 -2
  43. package/dist/cjs/utils/collection.js +3 -2
  44. package/dist/cjs/utils/collection.node.js +0 -2
  45. package/dist/cjs/utils/constants.js +7 -3
  46. package/dist/cjs/utils/data.browser.js +6 -3
  47. package/dist/cjs/utils/data.js +8 -4
  48. package/dist/cjs/utils/duration.js +51 -0
  49. package/dist/cjs/utils/expose.js +11 -40
  50. package/dist/cjs/utils/headers.js +79 -52
  51. package/dist/cjs/utils/http.js +34 -10
  52. package/dist/cjs/utils/mime.js +78 -0
  53. package/dist/cjs/utils/pss.js +3 -4
  54. package/dist/cjs/utils/redundancy.js +18 -14
  55. package/dist/cjs/utils/resource-locator.js +17 -0
  56. package/dist/cjs/utils/size.js +35 -0
  57. package/dist/cjs/utils/stamps.js +67 -51
  58. package/dist/cjs/utils/tar-uploader.browser.js +2 -2
  59. package/dist/cjs/utils/tar-uploader.js +2 -2
  60. package/dist/cjs/utils/tokens.js +144 -0
  61. package/dist/cjs/utils/type.js +142 -350
  62. package/dist/cjs/utils/typed-bytes.js +179 -0
  63. package/dist/cjs/utils/upload-progress.js +2 -0
  64. package/dist/cjs/utils/url.js +0 -4
  65. package/dist/cjs/utils/workaround.js +27 -0
  66. package/dist/index.browser.min.js +1 -2
  67. package/dist/index.browser.min.js.map +1 -1
  68. package/dist/mjs/bee-dev.js +98 -0
  69. package/dist/mjs/bee.js +367 -411
  70. package/dist/mjs/chunk/bmt.js +13 -29
  71. package/dist/mjs/chunk/cac.js +26 -34
  72. package/dist/mjs/chunk/soc.js +57 -53
  73. package/dist/mjs/feed/identifier.js +3 -26
  74. package/dist/mjs/feed/index.js +98 -51
  75. package/dist/mjs/feed/retrievable.js +12 -23
  76. package/dist/mjs/index.js +10 -1
  77. package/dist/mjs/manifest/manifest.js +371 -0
  78. package/dist/mjs/modules/bytes.js +27 -15
  79. package/dist/mjs/modules/bzz.js +25 -32
  80. package/dist/mjs/modules/chunk.js +16 -8
  81. package/dist/mjs/modules/debug/balance.js +61 -4
  82. package/dist/mjs/modules/debug/chequebook.js +116 -16
  83. package/dist/mjs/modules/debug/connectivity.js +144 -3
  84. package/dist/mjs/modules/debug/settlements.js +46 -2
  85. package/dist/mjs/modules/debug/stake.js +69 -11
  86. package/dist/mjs/modules/debug/stamps.js +184 -7
  87. package/dist/mjs/modules/debug/states.js +55 -3
  88. package/dist/mjs/modules/debug/status.js +97 -45
  89. package/dist/mjs/modules/debug/transactions.js +61 -5
  90. package/dist/mjs/modules/envelope.js +11 -9
  91. package/dist/mjs/modules/feed.js +26 -10
  92. package/dist/mjs/modules/grantee.js +35 -13
  93. package/dist/mjs/modules/gsoc.js +16 -0
  94. package/dist/mjs/modules/pinning.js +23 -2
  95. package/dist/mjs/modules/pss.js +10 -4
  96. package/dist/mjs/modules/soc.js +10 -5
  97. package/dist/mjs/modules/stewardship.js +14 -4
  98. package/dist/mjs/modules/tag.js +93 -3
  99. package/dist/mjs/package.json +2 -1
  100. package/dist/mjs/stamper/stamper.js +39 -0
  101. package/dist/mjs/types/debug.js +15 -1
  102. package/dist/mjs/types/index.js +2 -24
  103. package/dist/mjs/utils/bytes.js +63 -104
  104. package/dist/mjs/utils/chunk-size.js +13 -0
  105. package/dist/mjs/utils/chunk-stream.browser.js +85 -0
  106. package/dist/mjs/utils/chunk-stream.js +87 -0
  107. package/dist/mjs/utils/cid.js +5 -6
  108. package/dist/mjs/utils/collection.browser.js +2 -2
  109. package/dist/mjs/utils/collection.js +2 -2
  110. package/dist/mjs/utils/collection.node.js +0 -2
  111. package/dist/mjs/utils/constants.js +6 -2
  112. package/dist/mjs/utils/data.browser.js +9 -3
  113. package/dist/mjs/utils/data.js +12 -4
  114. package/dist/mjs/utils/duration.js +47 -0
  115. package/dist/mjs/utils/expose.js +2 -7
  116. package/dist/mjs/utils/headers.js +73 -48
  117. package/dist/mjs/utils/http.js +33 -11
  118. package/dist/mjs/utils/mime.js +75 -0
  119. package/dist/mjs/utils/pss.js +3 -4
  120. package/dist/mjs/utils/redundancy.js +18 -8
  121. package/dist/mjs/utils/resource-locator.js +13 -0
  122. package/dist/mjs/utils/size.js +31 -0
  123. package/dist/mjs/utils/stamps.js +47 -44
  124. package/dist/mjs/utils/tar-uploader.browser.js +2 -2
  125. package/dist/mjs/utils/tar-uploader.js +2 -2
  126. package/dist/mjs/utils/tokens.js +139 -0
  127. package/dist/mjs/utils/type.js +216 -310
  128. package/dist/mjs/utils/typed-bytes.js +160 -0
  129. package/dist/mjs/utils/upload-progress.js +1 -0
  130. package/dist/mjs/utils/url.js +0 -4
  131. package/dist/mjs/utils/workaround.js +22 -0
  132. package/dist/types/bee-dev.d.ts +5 -0
  133. package/dist/types/bee.d.ts +88 -165
  134. package/dist/types/chunk/bmt.d.ts +2 -2
  135. package/dist/types/chunk/cac.d.ts +7 -24
  136. package/dist/types/chunk/soc.d.ts +15 -15
  137. package/dist/types/feed/identifier.d.ts +2 -4
  138. package/dist/types/feed/index.d.ts +14 -18
  139. package/dist/types/feed/retrievable.d.ts +3 -4
  140. package/dist/types/index.d.ts +28 -1
  141. package/dist/types/manifest/manifest.d.ts +106 -0
  142. package/dist/types/modules/bytes.d.ts +8 -5
  143. package/dist/types/modules/bzz.d.ts +8 -10
  144. package/dist/types/modules/chunk.d.ts +4 -3
  145. package/dist/types/modules/debug/balance.d.ts +3 -2
  146. package/dist/types/modules/debug/chequebook.d.ts +7 -6
  147. package/dist/types/modules/debug/connectivity.d.ts +5 -3
  148. package/dist/types/modules/debug/settlements.d.ts +2 -1
  149. package/dist/types/modules/debug/stake.d.ts +4 -2
  150. package/dist/types/modules/debug/stamps.d.ts +5 -4
  151. package/dist/types/modules/debug/status.d.ts +6 -25
  152. package/dist/types/modules/debug/transactions.d.ts +5 -4
  153. package/dist/types/modules/envelope.d.ts +3 -2
  154. package/dist/types/modules/feed.d.ts +20 -16
  155. package/dist/types/modules/grantee.d.ts +7 -6
  156. package/dist/types/modules/gsoc.d.ts +7 -0
  157. package/dist/types/modules/pinning.d.ts +2 -4
  158. package/dist/types/modules/pss.d.ts +4 -3
  159. package/dist/types/modules/soc.d.ts +3 -2
  160. package/dist/types/modules/stewardship.d.ts +4 -4
  161. package/dist/types/modules/tag.d.ts +2 -1
  162. package/dist/types/stamper/stamper.d.ts +15 -0
  163. package/dist/types/types/debug.d.ts +63 -115
  164. package/dist/types/types/index.d.ts +103 -204
  165. package/dist/types/utils/bytes.d.ts +16 -90
  166. package/dist/types/utils/chunk-size.d.ts +1 -0
  167. package/dist/types/utils/chunk-stream.browser.d.ts +6 -0
  168. package/dist/types/utils/chunk-stream.d.ts +6 -0
  169. package/dist/types/utils/cid.d.ts +3 -2
  170. package/dist/types/utils/collection.browser.d.ts +2 -2
  171. package/dist/types/utils/collection.d.ts +2 -1
  172. package/dist/types/utils/collection.node.d.ts +0 -1
  173. package/dist/types/utils/constants.d.ts +4 -1
  174. package/dist/types/utils/duration.d.ts +17 -0
  175. package/dist/types/utils/error.d.ts +2 -2
  176. package/dist/types/utils/expose.d.ts +2 -7
  177. package/dist/types/utils/headers.d.ts +3 -4
  178. package/dist/types/utils/mime.d.ts +1 -0
  179. package/dist/types/utils/pss.d.ts +2 -2
  180. package/dist/types/utils/resource-locator.d.ts +6 -0
  181. package/dist/types/utils/size.d.ts +16 -0
  182. package/dist/types/utils/stamps.d.ts +27 -33
  183. package/dist/types/utils/tar-uploader.browser.d.ts +3 -4
  184. package/dist/types/utils/tar-uploader.d.ts +3 -4
  185. package/dist/types/utils/tokens.d.ts +77 -0
  186. package/dist/types/utils/type.d.ts +20 -52
  187. package/dist/types/utils/typed-bytes.d.ts +68 -0
  188. package/dist/types/utils/upload-progress.d.ts +4 -0
  189. package/dist/types/utils/workaround.d.ts +2 -0
  190. package/package.json +11 -17
  191. package/dist/cjs/chunk/signer.js +0 -126
  192. package/dist/cjs/chunk/span.js +0 -25
  193. package/dist/cjs/feed/json.js +0 -28
  194. package/dist/cjs/feed/topic.js +0 -25
  195. package/dist/cjs/feed/type.js +0 -15
  196. package/dist/cjs/modules/debug/chunk.js +0 -21
  197. package/dist/cjs/modules/debug/tag.js +0 -19
  198. package/dist/cjs/utils/eth.js +0 -216
  199. package/dist/cjs/utils/hash.js +0 -21
  200. package/dist/cjs/utils/hex.js +0 -150
  201. package/dist/cjs/utils/reference.js +0 -36
  202. package/dist/index.browser.min.js.LICENSE.txt +0 -8
  203. package/dist/mjs/chunk/signer.js +0 -114
  204. package/dist/mjs/chunk/span.js +0 -21
  205. package/dist/mjs/feed/json.js +0 -26
  206. package/dist/mjs/feed/topic.js +0 -19
  207. package/dist/mjs/feed/type.js +0 -10
  208. package/dist/mjs/modules/debug/chunk.js +0 -17
  209. package/dist/mjs/modules/debug/tag.js +0 -15
  210. package/dist/mjs/utils/eth.js +0 -192
  211. package/dist/mjs/utils/hash.js +0 -16
  212. package/dist/mjs/utils/hex.js +0 -135
  213. package/dist/mjs/utils/reference.js +0 -29
  214. package/dist/types/chunk/signer.d.ts +0 -31
  215. package/dist/types/chunk/span.d.ts +0 -10
  216. package/dist/types/feed/json.d.ts +0 -4
  217. package/dist/types/feed/topic.d.ts +0 -3
  218. package/dist/types/feed/type.d.ts +0 -6
  219. package/dist/types/modules/debug/chunk.d.ts +0 -10
  220. package/dist/types/modules/debug/tag.d.ts +0 -8
  221. package/dist/types/utils/eth.d.ts +0 -67
  222. package/dist/types/utils/hash.d.ts +0 -9
  223. package/dist/types/utils/hex.d.ts +0 -86
  224. package/dist/types/utils/reference.d.ts +0 -2
@@ -1,10 +1,15 @@
1
1
  /// <reference types="node" />
2
2
  import { Readable } from 'stream';
3
- import { Index, IndexBytes } from './feed';
4
- import { FeedType } from './feed/type';
5
- import type { Address, AddressPrefix, AllSettlements, AnyJson, BalanceResponse, BatchId, BeeOptions, BeeRequestOptions, BeeVersions, ChainState, ChequebookAddressResponse, ChequebookBalanceResponse, CollectionUploadOptions, Data, DebugStatus, Envelope, ExtendedTag, FeedReader, FeedWriter, FileData, FileUploadOptions, GetGranteesResult, GranteesResult, Health, JsonFeedOptions, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NodeAddresses, NodeInfo, NumberString, Peer, PeerBalance, Pin, PingResponse, PostageBatch, PostageBatchBuckets, PssMessageHandler, PssSubscription, PublicKey, RedistributionState, Reference, ReferenceInformation, 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';
7
- import { EthAddress } from './utils/eth';
3
+ import { Chunk } from './chunk/cac';
4
+ import { FeedPayloadResult } from './modules/feed';
5
+ import type { AllSettlements, BalanceResponse, BeeOptions, BeeRequestOptions, BeeVersions, ChainState, ChequebookAddressResponse, ChequebookBalanceResponse, CollectionUploadOptions, DebugStatus, DownloadOptions, EnvelopeWithBatchId, FeedReader, FeedWriter, FileData, FileUploadOptions, GetGranteesResult, GlobalPostageBatch, GranteesResult, GsocMessageHandler, GsocSubscription, Health, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NodeAddresses, NodeInfo, NumberString, Peer, PeerBalance, Pin, PingResponse, PostageBatch, PostageBatchBuckets, PssMessageHandler, PssSubscription, Readiness, RedistributionState, RedundantUploadOptions, ReferenceInformation, RemovePeerResponse, ReserveState, SOCReader, SOCWriter, Settlements, Tag, Topology, TransactionInfo, UploadOptions, WalletBalance } from './types';
6
+ import { AllTagsOptions, Collection, PostageBatchOptions, TransactionOptions, UploadResult } from './types';
7
+ import { Bytes } from './utils/bytes';
8
+ import { Duration } from './utils/duration';
9
+ import { Size } from './utils/size';
10
+ import { BZZ } from './utils/tokens';
11
+ import { BatchId, EthAddress, FeedIndex, Identifier, PeerAddress, PrivateKey, PublicKey, Reference, Topic, TransactionId } from './utils/typed-bytes';
12
+ import { UploadProgress } from './utils/upload-progress';
8
13
  /**
9
14
  * The main component that abstracts operations available on the main Bee API.
10
15
  *
@@ -19,7 +24,7 @@ export declare class Bee {
19
24
  /**
20
25
  * Default Signer object used for signing operations, mainly Feeds.
21
26
  */
22
- readonly signer?: Signer;
27
+ readonly signer?: PrivateKey;
23
28
  /**
24
29
  * Options for making requests
25
30
  * @private
@@ -41,35 +46,35 @@ export declare class Bee {
41
46
  * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
42
47
  * @see [Bee API reference - `POST /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post)
43
48
  */
44
- uploadData(postageBatchId: string | BatchId, data: string | Uint8Array, options?: UploadOptions & UploadRedundancyOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
49
+ uploadData(postageBatchId: BatchId | Uint8Array | string, data: string | Uint8Array, options?: RedundantUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
45
50
  /**
46
51
  * Requests content length for a `/bytes` reference
47
52
  *
48
53
  * @see [Bee API reference - `HEAD /bytes/`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/head)
49
54
  */
50
- probeData(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<ReferenceInformation>;
55
+ probeData(reference: Reference | Uint8Array | string, options?: BeeRequestOptions): Promise<ReferenceInformation>;
51
56
  /**
52
57
  * Download data as a byte array
53
58
  *
54
- * @param reference Bee data reference in hex string (either 64 or 128 chars long) or ENS domain.
59
+ * @param resource Swarm reference, Swarm CID, or ENS domain
55
60
  * @param options Options that affects the request behavior
56
61
  * @throws TypeError if some of the input parameters is not expected type
57
62
  * @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
58
63
  * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
59
64
  * @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)
60
65
  */
61
- downloadData(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<Data>;
66
+ downloadData(resource: Reference | string | Uint8Array, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<Bytes>;
62
67
  /**
63
68
  * Download data as a Readable stream
64
69
  *
65
- * @param reference Bee data reference in hex string (either 64 or 128 chars long) or ENS domain.
70
+ * @param resource Swarm reference, Swarm CID, or ENS domain
66
71
  * @param options Options that affects the request behavior
67
72
  * @throws TypeError if some of the input parameters is not expected type
68
73
  * @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
69
74
  * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
70
75
  * @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)
71
76
  */
72
- downloadReadableData(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<ReadableStream<Uint8Array>>;
77
+ downloadReadableData(resource: Reference | Uint8Array | string, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<ReadableStream<Uint8Array>>;
73
78
  /**
74
79
  * Upload chunk to a Bee node
75
80
  *
@@ -81,7 +86,7 @@ export declare class Bee {
81
86
  * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
82
87
  * @see [Bee API reference - `POST /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post)
83
88
  */
84
- uploadChunk(stamp: BatchId | Uint8Array | string, data: Uint8Array, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
89
+ uploadChunk(stamp: EnvelopeWithBatchId | BatchId | Uint8Array | string, data: Uint8Array | Chunk, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
85
90
  /**
86
91
  * Download chunk as a byte array
87
92
  *
@@ -92,7 +97,7 @@ export declare class Bee {
92
97
  * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
93
98
  * @see [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{address}/get)
94
99
  */
95
- downloadChunk(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<Data>;
100
+ downloadChunk(reference: Reference | Uint8Array | string, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<Uint8Array>;
96
101
  /**
97
102
  * Create a grantees list from the given array of public keys.
98
103
  *
@@ -103,7 +108,7 @@ export declare class Bee {
103
108
  * @param requestOptions - Optional request options.
104
109
  * @returns A promise that resolves to a `GranteesResult` object.
105
110
  */
106
- createGrantees(postageBatchId: string | BatchId, grantees: string[], requestOptions?: BeeRequestOptions): Promise<GranteesResult>;
111
+ createGrantees(postageBatchId: BatchId | Uint8Array | string, grantees: PublicKey[] | Uint8Array[] | string[], requestOptions?: BeeRequestOptions): Promise<GranteesResult>;
107
112
  /**
108
113
  * Retrieves the grantees for a given reference.
109
114
  *
@@ -111,7 +116,7 @@ export declare class Bee {
111
116
  * @param requestOptions - Optional request options.
112
117
  * @returns A promise that resolves to a `GetGranteesResult` object.
113
118
  */
114
- getGrantees(reference: ReferenceOrEns | string, requestOptions?: BeeRequestOptions): Promise<GetGranteesResult>;
119
+ getGrantees(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<GetGranteesResult>;
115
120
  /**
116
121
  * Updates the grantees of a specific reference and history.
117
122
  *
@@ -122,16 +127,13 @@ export declare class Bee {
122
127
  * @param requestOptions - Optional request options.
123
128
  * @returns A Promise that resolves to to a `GranteesResult` object.
124
129
  */
125
- patchGrantees(postageBatchId: string | BatchId, reference: Reference | string, history: Reference | string, grantees: {
126
- add?: string[];
127
- revoke?: string[];
130
+ patchGrantees(postageBatchId: BatchId | Uint8Array | string, reference: Reference | Uint8Array | string, history: Reference | Uint8Array | string, grantees: {
131
+ add?: PublicKey[] | Uint8Array[] | string[];
132
+ revoke?: PublicKey[] | Uint8Array[] | string[];
128
133
  }, requestOptions?: BeeRequestOptions): Promise<GranteesResult>;
129
134
  /**
130
135
  * Upload single file to a Bee node.
131
136
  *
132
- * **To make sure that you won't lose critical data it is highly recommended to also
133
- * locally pin the data with `options.pin = true`**
134
- *
135
137
  * @param postageBatchId Postage BatchId to be used to upload the data with
136
138
  * @param data Data or file to be uploaded
137
139
  * @param name Optional name of the uploaded file
@@ -142,11 +144,11 @@ export declare class Bee {
142
144
  * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
143
145
  * @returns reference is a content hash of the file
144
146
  */
145
- uploadFile(postageBatchId: string | BatchId, data: string | Uint8Array | Readable | File, name?: string, options?: FileUploadOptions & UploadRedundancyOptions, requestOptions?: BeeRequestOptions): Promise<UploadResultWithCid>;
147
+ uploadFile(postageBatchId: BatchId | Uint8Array | string, data: string | Uint8Array | Readable | File, name?: string, options?: FileUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
146
148
  /**
147
149
  * Download single file.
148
150
  *
149
- * @param reference Bee file reference in hex string (either 64 or 128 chars long), ENS domain or Swarm CID.
151
+ * @param resource Swarm reference, Swarm CID, or ENS domain
150
152
  * @param path If reference points to manifest, then this parameter defines path to the file
151
153
  * @param options Options that affects the request behavior
152
154
  * @throws TypeError if some of the input parameters is not expected type
@@ -155,7 +157,7 @@ export declare class Bee {
155
157
  * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
156
158
  * @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)
157
159
  */
158
- downloadFile(reference: ReferenceCidOrEns | string, path?: string, options?: BeeRequestOptions): Promise<FileData<Data>>;
160
+ downloadFile(resource: Reference | Uint8Array | string, path?: string, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<FileData<Bytes>>;
159
161
  /**
160
162
  * Download single file as a readable stream
161
163
  *
@@ -168,7 +170,7 @@ export declare class Bee {
168
170
  * @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
169
171
  * @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)
170
172
  */
171
- downloadReadableFile(reference: ReferenceCidOrEns | string, path?: string, options?: BeeRequestOptions): Promise<FileData<ReadableStream<Uint8Array>>>;
173
+ downloadReadableFile(reference: Reference | Uint8Array | string, path?: string, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<FileData<ReadableStream<Uint8Array>>>;
172
174
  /**
173
175
  * Upload collection of files to a Bee node
174
176
  *
@@ -185,7 +187,10 @@ export declare class Bee {
185
187
  * @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)
186
188
  * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
187
189
  */
188
- uploadFiles(postageBatchId: string | BatchId, fileList: FileList | File[], options?: CollectionUploadOptions & UploadRedundancyOptions, requestOptions?: BeeRequestOptions): Promise<UploadResultWithCid>;
190
+ uploadFiles(postageBatchId: BatchId | Uint8Array | string, fileList: FileList | File[], options?: CollectionUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
191
+ hashDirectory(dir: string): Promise<Reference>;
192
+ streamDirectory(postageBatchId: BatchId | Uint8Array | string, dir: string, onUploadProgress?: (progress: UploadProgress) => void, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
193
+ streamFiles(postageBatchId: BatchId | Uint8Array | string, files: File[] | FileList, onUploadProgress?: (progress: UploadProgress) => void, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
189
194
  /**
190
195
  * Upload Collection that you can assembly yourself.
191
196
  *
@@ -196,7 +201,7 @@ export declare class Bee {
196
201
  * @param collection
197
202
  * @param options Collections and request options
198
203
  */
199
- uploadCollection(postageBatchId: string | BatchId, collection: Collection, options?: CollectionUploadOptions & UploadRedundancyOptions, requestOptions?: BeeRequestOptions): Promise<UploadResultWithCid>;
204
+ uploadCollection(postageBatchId: BatchId | Uint8Array | string, collection: Collection, options?: CollectionUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
200
205
  /**
201
206
  * Upload collection of files.
202
207
  *
@@ -213,7 +218,7 @@ export declare class Bee {
213
218
  * @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)
214
219
  * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
215
220
  */
216
- uploadFilesFromDirectory(postageBatchId: string | BatchId, dir: string, options?: CollectionUploadOptions & UploadRedundancyOptions, requestOptions?: BeeRequestOptions): Promise<UploadResultWithCid>;
221
+ uploadFilesFromDirectory(postageBatchId: BatchId | Uint8Array | string, dir: string, options?: CollectionUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
217
222
  /**
218
223
  * Create a new Tag which is meant for tracking progres of syncing data across network.
219
224
  *
@@ -284,7 +289,7 @@ export declare class Bee {
284
289
  *
285
290
  * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
286
291
  */
287
- pin(reference: Reference | string, options?: BeeRequestOptions): Promise<void>;
292
+ pin(reference: Reference | Uint8Array | string, options?: BeeRequestOptions): Promise<void>;
288
293
  /**
289
294
  * Unpin local data with given reference
290
295
  *
@@ -294,7 +299,7 @@ export declare class Bee {
294
299
  *
295
300
  * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
296
301
  */
297
- unpin(reference: Reference | string, options?: BeeRequestOptions): Promise<void>;
302
+ unpin(reference: Reference | Uint8Array | string, options?: BeeRequestOptions): Promise<void>;
298
303
  /**
299
304
  * Get list of all locally pinned references
300
305
  *
@@ -312,7 +317,7 @@ export declare class Bee {
312
317
  *
313
318
  * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
314
319
  */
315
- getPin(reference: Reference | string, options?: BeeRequestOptions): Promise<Pin>;
320
+ getPin(reference: Reference | Uint8Array | string, options?: BeeRequestOptions): Promise<Pin>;
316
321
  /**
317
322
  * Instructs the Bee node to reupload a locally pinned data into the network.
318
323
  *
@@ -324,7 +329,7 @@ export declare class Bee {
324
329
  *
325
330
  * @see [Bee API reference - `PUT /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/put)
326
331
  */
327
- reuploadPinnedData(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<void>;
332
+ reuploadPinnedData(postageBatchId: BatchId | Uint8Array | string, reference: Reference | Uint8Array | string, options?: BeeRequestOptions): Promise<void>;
328
333
  /**
329
334
  * Checks if content specified by reference is retrievable from the network.
330
335
  *
@@ -335,7 +340,7 @@ export declare class Bee {
335
340
  *
336
341
  * @see [Bee API reference - `GET /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/get)
337
342
  */
338
- isReferenceRetrievable(reference: ReferenceOrEns | string, options?: BeeRequestOptions): Promise<boolean>;
343
+ isReferenceRetrievable(reference: Reference | Uint8Array | string, options?: BeeRequestOptions): Promise<boolean>;
339
344
  /**
340
345
  * Functions that validates if feed is retrievable in the network.
341
346
  *
@@ -351,7 +356,7 @@ export declare class Bee {
351
356
  * @param index
352
357
  * @param options
353
358
  */
354
- isFeedRetrievable(type: FeedType, owner: EthAddress | Uint8Array | string, topic: Topic | Uint8Array | string, index?: Index | number | IndexBytes | string, options?: BeeRequestOptions): Promise<boolean>;
359
+ isFeedRetrievable(owner: EthAddress | Uint8Array | string, topic: Topic | Uint8Array | string, index?: FeedIndex, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<boolean>;
355
360
  /**
356
361
  * Send data to recipient or target with Postal Service for Swarm.
357
362
  *
@@ -374,7 +379,7 @@ export declare class Bee {
374
379
  * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)
375
380
  * @see [Bee API reference - `POST /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1{topic}~1{targets}/post)
376
381
  */
377
- pssSend(postageBatchId: string | BatchId, topic: string, target: AddressPrefix, data: string | Uint8Array, recipient?: string | PublicKey, options?: BeeRequestOptions): Promise<void>;
382
+ pssSend(postageBatchId: BatchId | Uint8Array | string, topic: Topic, target: string, data: string | Uint8Array, recipient?: string | PublicKey, options?: BeeRequestOptions): Promise<void>;
378
383
  /**
379
384
  * Subscribe to messages for given topic with Postal Service for Swarm
380
385
  *
@@ -389,7 +394,7 @@ export declare class Bee {
389
394
  * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)
390
395
  * @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)
391
396
  */
392
- pssSubscribe(topic: string, handler: PssMessageHandler): PssSubscription;
397
+ pssSubscribe(topic: Topic, handler: PssMessageHandler): PssSubscription;
393
398
  /**
394
399
  * Receive message with Postal Service for Swarm
395
400
  *
@@ -414,14 +419,16 @@ export declare class Bee {
414
419
  * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)
415
420
  * @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)
416
421
  */
417
- pssReceive(topic: string, timeoutMsec?: number): Promise<Data>;
422
+ pssReceive(topic: Topic, timeoutMsec?: number): Promise<Bytes>;
423
+ gsocMine(targetOverlay: PeerAddress | Uint8Array | string, identifier: Identifier | Uint8Array | string, proximity?: number): PrivateKey;
424
+ gsocSend(postageBatchId: BatchId | Uint8Array | string, signer: PrivateKey | Uint8Array | string, identifier: Identifier | Uint8Array | string, data: string | Uint8Array, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
425
+ gsocSubscribe(address: EthAddress | Uint8Array | string, identifier: Identifier | Uint8Array | string, handler: GsocMessageHandler): GsocSubscription;
418
426
  /**
419
427
  * Create feed manifest chunk and return the reference to it.
420
428
  *
421
429
  * Feed manifest chunk allows for a feed to be able to be resolved through `/bzz` endpoint.
422
430
  *
423
431
  * @param postageBatchId Postage BatchId to be used to create the Feed Manifest
424
- * @param type The type of the feed, can be 'epoch' or 'sequence'
425
432
  * @param topic Topic in hex or bytes
426
433
  * @param owner Owner's ethereum address in hex or bytes
427
434
  * @param options Options that affects the request behavior
@@ -429,77 +436,28 @@ export declare class Bee {
429
436
  * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
430
437
  * @see [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post)
431
438
  */
432
- createFeedManifest(stamp: BatchId | Uint8Array | string, type: FeedType, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: BeeRequestOptions): Promise<FeedManifestResult>;
439
+ createFeedManifest(postageBatchId: BatchId | Uint8Array | string, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<Reference>;
433
440
  /**
434
441
  * Make a new feed reader for downloading feed updates.
435
442
  *
436
- * @param type The type of the feed, can be 'epoch' or 'sequence'
437
443
  * @param topic Topic in hex or bytes
438
444
  * @param owner Owner's ethereum address in hex or bytes
439
445
  * @param options Options that affects the request behavior
440
446
  *
441
447
  * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
442
448
  */
443
- makeFeedReader(type: FeedType, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: BeeRequestOptions): FeedReader;
449
+ makeFeedReader(topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: BeeRequestOptions): FeedReader;
444
450
  /**
445
451
  * Make a new feed writer for updating feeds
446
452
  *
447
- * @param type The type of the feed, can be 'epoch' or 'sequence'
448
453
  * @param topic Topic in hex or bytes
449
454
  * @param signer The signer's private key or a Signer instance that can sign data
450
455
  * @param options Options that affects the request behavior
451
456
  *
452
457
  * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
453
458
  */
454
- makeFeedWriter(type: FeedType, topic: Topic | Uint8Array | string, signer?: Signer | Uint8Array | string, options?: BeeRequestOptions): FeedWriter;
455
- /**
456
- * High-level function that allows you to easily set JSON data to feed.
457
- * JSON-like data types are supported.
458
- *
459
- * The default Signer of Bee instance is used if `options.signer` is not specified.
460
- * If none of those two is set error is thrown.
461
- *
462
- * @param postageBatchId Postage BatchId to be used to upload the data with
463
- * @param topic Human readable string, that is internally hashed so there are no constrains there.
464
- * @param data JSON compatible data
465
- * @param options
466
- * @param options.signer Custom instance of Signer or string with private key.
467
- * @param options.type Type of Feed
468
- *
469
- * @throws BeeError if `options.signer` is not specified nor the default Signer on Bee's instance is specified.
470
- *
471
- * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
472
- */
473
- setJsonFeed<T extends AnyJson>(postageBatchId: string | BatchId, topic: string, data: T, options?: JsonFeedOptions & UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
474
- /**
475
- * High-level function that allows you to easily get data from feed.
476
- * Returned data are parsed using JSON.parse().
477
- *
478
- * This method also supports specification of `signer` object passed to constructor. The order of evaluation is:
479
- * - `options.address`
480
- * - `options.signer`
481
- * - `this.signer`
482
- *
483
- * At least one of these has to be specified!
484
- *
485
- * @param topic Human readable string, that is internally hashed so there are no constrains there.
486
- * @param options
487
- * @param options.signer Custom instance of Signer or string with private key. This option is exclusive with `address` option.
488
- * @param options.address Ethereum address of owner of the feed that signed it. This option is exclusive with `signer` option.
489
- * @param options.type Type of Feed
490
- *
491
- * @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
492
- */
493
- getJsonFeed<T extends AnyJson>(topic: string, options?: JsonFeedOptions, requestOptions?: BeeRequestOptions): Promise<T>;
494
- /**
495
- * Make a new feed topic from a string
496
- *
497
- * Because the topic has to be 32 bytes long this function
498
- * hashes the input string to create a topic string of arbitrary length.
499
- *
500
- * @param topic The input string
501
- */
502
- makeFeedTopic(topic: string): Topic;
459
+ makeFeedWriter(topic: Topic | Uint8Array | string, signer?: PrivateKey | Uint8Array | string, options?: BeeRequestOptions): FeedWriter;
460
+ fetchLatestFeedUpdate(topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<FeedPayloadResult>;
503
461
  /**
504
462
  * Returns an object for reading single owner chunks
505
463
  *
@@ -515,8 +473,8 @@ export declare class Bee {
515
473
  * @param options Options that affects the request behavior
516
474
  * @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)
517
475
  */
518
- makeSOCWriter(signer?: Signer | Uint8Array | string, options?: BeeRequestOptions): SOCWriter;
519
- createEnvelope(postageBatchId: BatchId, reference: Reference, options?: BeeRequestOptions): Promise<Envelope>;
476
+ makeSOCWriter(signer?: PrivateKey | Uint8Array | string, options?: BeeRequestOptions): SOCWriter;
477
+ createEnvelope(postageBatchId: BatchId | Uint8Array | string, reference: Reference | Uint8Array | string, options?: BeeRequestOptions): Promise<EnvelopeWithBatchId>;
520
478
  /**
521
479
  * Ping the Bee node to see if there is a live Bee node on the given URL.
522
480
  *
@@ -533,24 +491,13 @@ export declare class Bee {
533
491
  isConnected(options?: BeeRequestOptions): Promise<boolean>;
534
492
  getNodeAddresses(options?: BeeRequestOptions): Promise<NodeAddresses>;
535
493
  getBlocklist(options?: BeeRequestOptions): Promise<Peer[]>;
536
- /**
537
- * Retrieve tag extended information from Bee node
538
- *
539
- * @param tagUid UID or tag object to be retrieved
540
- * @throws TypeError if tagUid is in not correct format
541
- *
542
- * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
543
- * @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/debug-api/#tag/Tag)
544
- *
545
- */
546
- retrieveExtendedTag(tagUid: number | Tag, options?: BeeRequestOptions): Promise<ExtendedTag>;
547
494
  /**
548
495
  * Get list of peers for this node
549
496
  */
550
497
  getPeers(options?: BeeRequestOptions): Promise<Peer[]>;
551
- removePeer(peer: string | Address, options?: BeeRequestOptions): Promise<RemovePeerResponse>;
498
+ removePeer(peer: PeerAddress | string, options?: BeeRequestOptions): Promise<RemovePeerResponse>;
552
499
  getTopology(options?: BeeRequestOptions): Promise<Topology>;
553
- pingPeer(peer: string | Address, options?: BeeRequestOptions): Promise<PingResponse>;
500
+ pingPeer(peer: PeerAddress | string, options?: BeeRequestOptions): Promise<PingResponse>;
554
501
  /**
555
502
  * Get the balances with all known peers including prepaid services
556
503
  */
@@ -560,7 +507,7 @@ export declare class Bee {
560
507
  *
561
508
  * @param address Swarm address of peer
562
509
  */
563
- getPeerBalance(address: Address | string, options?: BeeRequestOptions): Promise<PeerBalance>;
510
+ getPeerBalance(address: PeerAddress | string, options?: BeeRequestOptions): Promise<PeerBalance>;
564
511
  /**
565
512
  * Get the past due consumption balances with all known peers
566
513
  */
@@ -570,7 +517,7 @@ export declare class Bee {
570
517
  *
571
518
  * @param address Swarm address of peer
572
519
  */
573
- getPastDueConsumptionPeerBalance(address: Address | string, options?: BeeRequestOptions): Promise<PeerBalance>;
520
+ getPastDueConsumptionPeerBalance(address: PeerAddress | string, options?: BeeRequestOptions): Promise<PeerBalance>;
574
521
  /**
575
522
  * Get the address of the chequebook contract used.
576
523
  *
@@ -591,13 +538,13 @@ export declare class Bee {
591
538
  *
592
539
  * @param address Swarm address of peer
593
540
  */
594
- getLastChequesForPeer(address: Address | string, options?: BeeRequestOptions): Promise<LastChequesForPeerResponse>;
541
+ getLastChequesForPeer(address: PeerAddress | string, options?: BeeRequestOptions): Promise<LastChequesForPeerResponse>;
595
542
  /**
596
543
  * Get last cashout action for the peer
597
544
  *
598
545
  * @param address Swarm address of peer
599
546
  */
600
- getLastCashoutAction(address: Address | string, options?: BeeRequestOptions): Promise<LastCashoutActionResponse>;
547
+ getLastCashoutAction(address: PeerAddress | string, options?: BeeRequestOptions): Promise<LastCashoutActionResponse>;
601
548
  /**
602
549
  * Cashout the last cheque for the peer
603
550
  *
@@ -606,7 +553,7 @@ export declare class Bee {
606
553
  * @param options.gasPrice Gas price for the cashout transaction in WEI
607
554
  * @param options.gasLimit Gas limit for the cashout transaction in WEI
608
555
  */
609
- cashoutLastCheque(address: string | Address, options?: CashoutOptions, requestOptions?: BeeRequestOptions): Promise<string>;
556
+ cashoutLastCheque(address: PeerAddress | string, options?: TransactionOptions, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
610
557
  /**
611
558
  * Deposit tokens from overlay address into chequebook
612
559
  *
@@ -614,7 +561,7 @@ export declare class Bee {
614
561
  * @param gasPrice Gas Price in WEI for the transaction call
615
562
  * @return string Hash of the transaction
616
563
  */
617
- depositTokens(amount: number | NumberString, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<string>;
564
+ depositTokens(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint, options?: BeeRequestOptions): Promise<TransactionId>;
618
565
  /**
619
566
  * Withdraw tokens from the chequebook to the overlay address
620
567
  *
@@ -622,13 +569,13 @@ export declare class Bee {
622
569
  * @param gasPrice Gas Price in WEI for the transaction call
623
570
  * @return string Hash of the transaction
624
571
  */
625
- withdrawTokens(amount: number | NumberString, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<string>;
572
+ withdrawTokens(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint, options?: BeeRequestOptions): Promise<TransactionId>;
626
573
  /**
627
574
  * Get amount of sent and received from settlements with a peer
628
575
  *
629
576
  * @param address Swarm address of peer
630
577
  */
631
- getSettlements(address: Address | string, options?: BeeRequestOptions): Promise<Settlements>;
578
+ getSettlements(address: PeerAddress | string, options?: BeeRequestOptions): Promise<Settlements>;
632
579
  /**
633
580
  * Get settlements with all known peers and total amount sent or received
634
581
  */
@@ -644,38 +591,17 @@ export declare class Bee {
644
591
  /**
645
592
  * Get readiness of node
646
593
  */
647
- getReadiness(options?: BeeRequestOptions): Promise<boolean>;
594
+ getReadiness(options?: BeeRequestOptions): Promise<Readiness>;
648
595
  /**
649
596
  * Get mode information of node
650
597
  */
651
598
  getNodeInfo(options?: BeeRequestOptions): Promise<NodeInfo>;
652
- /**
653
- * Connnects to a node and checks if it is a supported Bee version by the bee-js
654
- *
655
- * @returns true if the Bee node version is supported
656
- * @deprecated Use `BeeDebug.isSupportedExactVersion()` instead
657
- */
658
- isSupportedVersion(options?: BeeRequestOptions): Promise<boolean> | never;
659
599
  /**
660
600
  * Connects to a node and checks if its version matches with the one that bee-js supports.
661
601
  *
662
- * Be aware that this is the most strict version check and most probably
663
- * you will want to use more relaxed API-versions based checks like
664
- * `BeeDebug.isSupportedApiVersion()`, `BeeDebug.isSupportedMainApiVersion()` or `BeeDebug.isSupportedDebugApiVersion()`
665
- * based on your use-case.
666
- *
667
602
  * @param options
668
603
  */
669
604
  isSupportedExactVersion(options?: BeeRequestOptions): Promise<boolean> | never;
670
- /**
671
- * Connects to a node and checks if its main's API version matches with the one that bee-js supports.
672
- *
673
- * This is useful if you are not using `BeeDebug` class (for anything else then this check)
674
- * and want to make sure about compatibility.
675
- *
676
- * @param options
677
- */
678
- isSupportedMainApiVersion(options?: BeeRequestOptions): Promise<boolean> | never;
679
605
  /**
680
606
  *
681
607
  * Connects to a node and checks if its Main API version matches with the one that bee-js supports.
@@ -721,25 +647,30 @@ export declare class Bee {
721
647
  * @throws TypeError if non-integer value is passed to amount or depth
722
648
  *
723
649
  * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
724
- * @see [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post)
650
+ * @see [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post)
725
651
  */
726
- createPostageBatch(amount: NumberString, depth: number, options?: PostageBatchOptions, requestOptions?: BeeRequestOptions): Promise<BatchId>;
652
+ createPostageBatch(amount: NumberString | string | bigint, depth: number, options?: PostageBatchOptions, requestOptions?: BeeRequestOptions): Promise<BatchId>;
653
+ buyStorage(size: Size, duration: Duration, options?: PostageBatchOptions, requestOptions?: BeeRequestOptions): Promise<BatchId>;
654
+ getStorageCost(size: Size, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
655
+ extendStorageSize(postageBatchId: BatchId | Uint8Array | string, size: Size, options?: BeeRequestOptions): Promise<BatchId>;
656
+ extendStorageDuration(postageBatchId: BatchId | Uint8Array | string, duration: Duration, options?: BeeRequestOptions): Promise<BatchId>;
657
+ getExtensionCost(postageBatchId: BatchId | Uint8Array | string, size: Size, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
658
+ getSizeExtensionCost(postageBatchId: BatchId | Uint8Array | string, size: Size, options?: BeeRequestOptions): Promise<BZZ>;
659
+ getDurationExtensionCost(postageBatchId: BatchId | Uint8Array | string, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
727
660
  /**
728
661
  * Topup a fresh amount of BZZ to given Postage Batch.
729
662
  *
730
663
  * For better understanding what each parameter means and what are the optimal values please see
731
664
  * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).
732
665
  *
733
- * **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
734
- *
735
666
  * @param postageBatchId Batch ID
736
667
  * @param amount Amount to be added to the batch
737
668
  * @param options Request options
738
669
  *
739
670
  * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
740
- * @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)
671
+ * @see [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1topup~1{batch_id}~1{amount}/patch)
741
672
  */
742
- topUpBatch(postageBatchId: BatchId | string, amount: NumberString, options?: BeeRequestOptions): Promise<void>;
673
+ topUpBatch(postageBatchId: BatchId | Uint8Array | string, amount: NumberString | string | bigint, options?: BeeRequestOptions): Promise<BatchId>;
743
674
  /**
744
675
  * Dilute given Postage Batch with new depth (that has to be bigger then the original depth), which allows
745
676
  * the Postage Batch to be used for more chunks.
@@ -747,45 +678,43 @@ export declare class Bee {
747
678
  * For better understanding what each parameter means and what are the optimal values please see
748
679
  * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).
749
680
  *
750
- * **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
751
- *
752
681
  * @param postageBatchId Batch ID
753
682
  * @param depth Amount to be added to the batch
754
683
  * @param options Request options
755
684
  *
756
685
  * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
757
- * @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)
686
+ * @see [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1dilute~1%7Bbatch_id%7D~1%7Bdepth%7D/patch)
758
687
  */
759
- diluteBatch(postageBatchId: BatchId | string, depth: number, options?: BeeRequestOptions): Promise<void>;
688
+ diluteBatch(postageBatchId: BatchId | Uint8Array | string, depth: number, options?: BeeRequestOptions): Promise<BatchId>;
760
689
  /**
761
690
  * Return details for specific postage batch.
762
691
  *
763
692
  * @param postageBatchId Batch ID
764
693
  *
765
694
  * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
766
- * @see [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}/get)
695
+ * @see [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get)
767
696
  */
768
- getPostageBatch(postageBatchId: BatchId | string, options?: BeeRequestOptions): Promise<PostageBatch>;
697
+ getPostageBatch(postageBatchId: BatchId | Uint8Array | string, options?: BeeRequestOptions): Promise<PostageBatch>;
769
698
  /**
770
699
  * Return detailed information related to buckets for specific postage batch.
771
700
  *
772
701
  * @param postageBatchId Batch ID
773
702
  *
774
703
  * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
775
- * @see [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}~1buckets/get)
704
+ * @see [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D~1buckets/get)
776
705
  */
777
- getPostageBatchBuckets(postageBatchId: BatchId | string, options?: BeeRequestOptions): Promise<PostageBatchBuckets>;
706
+ getPostageBatchBuckets(postageBatchId: BatchId | Uint8Array | string, options?: BeeRequestOptions): Promise<PostageBatchBuckets>;
778
707
  /**
779
708
  * Return all postage batches that has the node available.
780
709
  *
781
710
  * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
782
- * @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps/get)
711
+ * @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get)
783
712
  */
784
713
  getAllPostageBatch(options?: BeeRequestOptions): Promise<PostageBatch[]>;
785
714
  /**
786
715
  * Return all globally available postage batches.
787
716
  */
788
- getAllGlobalPostageBatch(options?: BeeRequestOptions): Promise<PostageBatch[]>;
717
+ getAllGlobalPostageBatch(options?: BeeRequestOptions): Promise<GlobalPostageBatch[]>;
789
718
  /**
790
719
  * Return lists of all current pending transactions that the Bee made
791
720
  */
@@ -794,26 +723,26 @@ export declare class Bee {
794
723
  * Return transaction information for specific transaction
795
724
  * @param transactionHash
796
725
  */
797
- getPendingTransaction(transactionHash: TransactionHash | string, options?: BeeRequestOptions): Promise<TransactionInfo>;
726
+ getPendingTransaction(transactionHash: TransactionId | Uint8Array | string, options?: BeeRequestOptions): Promise<TransactionInfo>;
798
727
  /**
799
728
  * Rebroadcast already created transaction.
800
729
  * This is mainly needed when your transaction fall off mempool from other reason is not incorporated into block.
801
730
  *
802
731
  * @param transactionHash
803
732
  */
804
- rebroadcastPendingTransaction(transactionHash: TransactionHash | string, options?: BeeRequestOptions): Promise<TransactionHash>;
733
+ rebroadcastPendingTransaction(transactionHash: TransactionId | Uint8Array | string, options?: BeeRequestOptions): Promise<TransactionId>;
805
734
  /**
806
735
  * Cancel currently pending transaction
807
736
  * @param transactionHash
808
737
  * @param gasPrice
809
738
  */
810
- cancelPendingTransaction(transactionHash: TransactionHash | string, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<TransactionHash>;
739
+ cancelPendingTransaction(transactionHash: TransactionId | Uint8Array | string, gasPrice?: NumberString | string | bigint, options?: BeeRequestOptions): Promise<TransactionId>;
811
740
  /**
812
741
  * Gets the staked amount of BZZ (in PLUR unit) as number string.
813
742
  *
814
743
  * @param options
815
744
  */
816
- getStake(options?: BeeRequestOptions): Promise<NumberString>;
745
+ getStake(options?: BeeRequestOptions): Promise<BZZ>;
817
746
  /**
818
747
  * Deposits given amount of BZZ token (in PLUR unit).
819
748
  *
@@ -822,7 +751,7 @@ export declare class Bee {
822
751
  * @param amount Amount of BZZ token (in PLUR unit) to be staked. Minimum is 100_000_000_000_000_000 PLUR (10 BZZ).
823
752
  * @param options
824
753
  */
825
- depositStake(amount: NumberString, options?: TransactionOptions, requestOptions?: BeeRequestOptions): Promise<void>;
754
+ depositStake(amount: BZZ | NumberString | string | bigint, options?: TransactionOptions, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
826
755
  /**
827
756
  * Get current status of node in redistribution game
828
757
  *
@@ -830,11 +759,5 @@ export declare class Bee {
830
759
  */
831
760
  getRedistributionState(options?: BeeRequestOptions): Promise<RedistributionState>;
832
761
  private waitForUsablePostageStamp;
833
- /**
834
- * @param signer
835
- * @private
836
- * @throws BeeError if either no Signer was passed or no default Signer was specified for the instance
837
- */
838
- private resolveSigner;
839
- private getRequestOptionsForCall;
762
+ protected getRequestOptionsForCall(options?: BeeRequestOptions): BeeRequestOptions;
840
763
  }