@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,22 +0,0 @@
1
- import { makeBytes } from "./bytes.js"; // TODO handle bigger values than 32 bit
2
- // For now it's good enough because we only use these functions
3
- // sequential feed indexes.
4
- export function writeUint64LittleEndian(value, bytes = makeBytes(8)) {
5
- const dataView = new DataView(bytes.buffer);
6
- const valueLower32 = value & 0xffffffff;
7
- const littleEndian = true;
8
- dataView.setUint32(0, valueLower32, littleEndian);
9
- dataView.setUint32(4, 0, littleEndian);
10
- return bytes;
11
- }
12
- export function writeUint64BigEndian(value, bytes = makeBytes(8)) {
13
- const dataView = new DataView(bytes.buffer);
14
- const valueLower32 = value & 0xffffffff;
15
- dataView.setUint32(0, 0);
16
- dataView.setUint32(4, valueLower32);
17
- return bytes;
18
- }
19
- export function readUint64BigEndian(bytes) {
20
- const dataView = new DataView(bytes.buffer);
21
- return dataView.getUint32(4);
22
- }
@@ -1,323 +0,0 @@
1
- import type { Address, AllSettlements, BalanceResponse, BeeRequestOptions, BeeVersions, ChainState, ChequebookAddressResponse, ChequebookBalanceResponse, DebugStatus, ExtendedTag, Health, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NodeAddresses, NodeInfo, NumberString, Peer, PeerBalance, PingResponse, PostageBatch, PostageBatchBuckets, RedistributionState, RemovePeerResponse, ReserveState, Settlements, Topology, TransactionHash, TransactionInfo, WalletBalance } from './types';
2
- import { BatchId, BeeOptions, CashoutOptions, PostageBatchOptions, Tag, TransactionOptions } from './types';
3
- export declare class BeeDebug {
4
- /**
5
- * URL on which is the Debug API of Bee node exposed
6
- */
7
- readonly url: string;
8
- /**
9
- * Ky instance that defines connection to Bee node
10
- * @private
11
- */
12
- private readonly requestOptions;
13
- constructor(url: string, options?: BeeOptions);
14
- getNodeAddresses(options?: BeeRequestOptions): Promise<NodeAddresses>;
15
- getBlocklist(options?: BeeRequestOptions): Promise<Peer[]>;
16
- /**
17
- * Retrieve tag extended information from Bee node
18
- *
19
- * @param tagUid UID or tag object to be retrieved
20
- * @throws TypeError if tagUid is in not correct format
21
- *
22
- * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/access-the-swarm/syncing)
23
- * @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/debug-api/#tag/Tag)
24
- *
25
- */
26
- retrieveExtendedTag(tagUid: number | Tag, options?: BeeRequestOptions): Promise<ExtendedTag>;
27
- /**
28
- * Get list of peers for this node
29
- */
30
- getPeers(options?: BeeRequestOptions): Promise<Peer[]>;
31
- removePeer(peer: string | Address, options?: BeeRequestOptions): Promise<RemovePeerResponse>;
32
- getTopology(options?: BeeRequestOptions): Promise<Topology>;
33
- pingPeer(peer: string | Address, options?: BeeRequestOptions): Promise<PingResponse>;
34
- /**
35
- * Get the balances with all known peers including prepaid services
36
- */
37
- getAllBalances(options?: BeeRequestOptions): Promise<BalanceResponse>;
38
- /**
39
- * Get the balances with a specific peer including prepaid services
40
- *
41
- * @param address Swarm address of peer
42
- */
43
- getPeerBalance(address: Address | string, options?: BeeRequestOptions): Promise<PeerBalance>;
44
- /**
45
- * Get the past due consumption balances with all known peers
46
- */
47
- getPastDueConsumptionBalances(options?: BeeRequestOptions): Promise<BalanceResponse>;
48
- /**
49
- * Get the past due consumption balance with a specific peer
50
- *
51
- * @param address Swarm address of peer
52
- */
53
- getPastDueConsumptionPeerBalance(address: Address | string, options?: BeeRequestOptions): Promise<PeerBalance>;
54
- /**
55
- * Get the address of the chequebook contract used.
56
- *
57
- * **Warning:** The address is returned with 0x prefix unlike all other calls.
58
- * https://github.com/ethersphere/bee/issues/1443
59
- */
60
- getChequebookAddress(options?: BeeRequestOptions): Promise<ChequebookAddressResponse>;
61
- /**
62
- * Get the balance of the chequebook
63
- */
64
- getChequebookBalance(options?: BeeRequestOptions): Promise<ChequebookBalanceResponse>;
65
- /**
66
- * Get last cheques for all peers
67
- */
68
- getLastCheques(options?: BeeRequestOptions): Promise<LastChequesResponse>;
69
- /**
70
- * Get last cheques for the peer
71
- *
72
- * @param address Swarm address of peer
73
- */
74
- getLastChequesForPeer(address: Address | string, options?: BeeRequestOptions): Promise<LastChequesForPeerResponse>;
75
- /**
76
- * Get last cashout action for the peer
77
- *
78
- * @param address Swarm address of peer
79
- */
80
- getLastCashoutAction(address: Address | string, options?: BeeRequestOptions): Promise<LastCashoutActionResponse>;
81
- /**
82
- * Cashout the last cheque for the peer
83
- *
84
- * @param address Swarm address of peer
85
- * @param options
86
- * @param options.gasPrice Gas price for the cashout transaction in WEI
87
- * @param options.gasLimit Gas limit for the cashout transaction in WEI
88
- */
89
- cashoutLastCheque(address: string | Address, options?: CashoutOptions, requestOptions?: BeeRequestOptions): Promise<string>;
90
- /**
91
- * Deposit tokens from overlay address into chequebook
92
- *
93
- * @param amount Amount of tokens to deposit (must be positive integer)
94
- * @param gasPrice Gas Price in WEI for the transaction call
95
- * @return string Hash of the transaction
96
- */
97
- depositTokens(amount: number | NumberString, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<string>;
98
- /**
99
- * Withdraw tokens from the chequebook to the overlay address
100
- *
101
- * @param amount Amount of tokens to withdraw (must be positive integer)
102
- * @param gasPrice Gas Price in WEI for the transaction call
103
- * @return string Hash of the transaction
104
- */
105
- withdrawTokens(amount: number | NumberString, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<string>;
106
- /**
107
- * Get amount of sent and received from settlements with a peer
108
- *
109
- * @param address Swarm address of peer
110
- */
111
- getSettlements(address: Address | string, options?: BeeRequestOptions): Promise<Settlements>;
112
- /**
113
- * Get settlements with all known peers and total amount sent or received
114
- */
115
- getAllSettlements(options?: BeeRequestOptions): Promise<AllSettlements>;
116
- /**
117
- * Get status of node
118
- */
119
- getStatus(options?: BeeRequestOptions): Promise<DebugStatus>;
120
- /**
121
- * Get health of node
122
- */
123
- getHealth(options?: BeeRequestOptions): Promise<Health>;
124
- /**
125
- * Get readiness of node
126
- */
127
- getReadiness(options?: BeeRequestOptions): Promise<boolean>;
128
- /**
129
- * Get mode information of node
130
- */
131
- getNodeInfo(options?: BeeRequestOptions): Promise<NodeInfo>;
132
- /**
133
- * Connnects to a node and checks if it is a supported Bee version by the bee-js
134
- *
135
- * @returns true if the Bee node version is supported
136
- * @deprecated Use `BeeDebug.isSupportedExactVersion()` instead
137
- */
138
- isSupportedVersion(options?: BeeRequestOptions): Promise<boolean> | never;
139
- /**
140
- * Connects to a node and checks if its version matches with the one that bee-js supports.
141
- *
142
- * Be aware that this is the most strict version check and most probably
143
- * you will want to use more relaxed API-versions based checks like
144
- * `BeeDebug.isSupportedApiVersion()`, `BeeDebug.isSupportedMainApiVersion()` or `BeeDebug.isSupportedDebugApiVersion()`
145
- * based on your use-case.
146
- *
147
- * @param options
148
- */
149
- isSupportedExactVersion(options?: BeeRequestOptions): Promise<boolean> | never;
150
- /**
151
- * Connects to a node and checks if its main's API version matches with the one that bee-js supports.
152
- *
153
- * This is useful if you are not using `BeeDebug` class (for anything else then this check)
154
- * and want to make sure about compatibility.
155
- *
156
- * @param options
157
- */
158
- isSupportedMainApiVersion(options?: BeeRequestOptions): Promise<boolean> | never;
159
- /**
160
- * Connects to a node and checks if its Debug API version matches with the one that bee-js supports.
161
- *
162
- * This is useful if you are not using `Bee` class in your application and want to make sure
163
- * about compatibility.
164
- *
165
- * @param options
166
- */
167
- isSupportedDebugApiVersion(options?: BeeRequestOptions): Promise<boolean> | never;
168
- /**
169
- *
170
- * Connects to a node and checks if its Main and Debug API versions matches with the one that bee-js supports.
171
- *
172
- * This should be the main way how to check compatibility for your app and Bee node.
173
- *
174
- * @param options
175
- */
176
- isSupportedApiVersion(options?: BeeRequestOptions): Promise<boolean> | never;
177
- /**
178
- * Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)
179
- * and versions that bee-js supports (properties prefixed with `supported*`).
180
- *
181
- * @param options
182
- */
183
- getVersions(options?: BeeRequestOptions): Promise<BeeVersions> | never;
184
- /**
185
- * Get reserve state
186
- */
187
- getReserveState(options?: BeeRequestOptions): Promise<ReserveState>;
188
- /**
189
- * Get chain state
190
- */
191
- getChainState(options?: BeeRequestOptions): Promise<ChainState>;
192
- /**
193
- * Get wallet balances for xDai and BZZ of the Bee node
194
- *
195
- * @param options
196
- */
197
- getWalletBalance(options?: BeeRequestOptions): Promise<WalletBalance>;
198
- /**
199
- * Creates new postage batch from the funds that the node has available in its Ethereum account.
200
- *
201
- * For better understanding what each parameter means and what are the optimal values please see
202
- * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
203
- *
204
- * **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
205
- *
206
- * @param amount Amount that represents the value per chunk, has to be greater or equal zero.
207
- * @param depth Logarithm of the number of chunks that can be stamped with the batch.
208
- * @param options Options for creation of postage batch
209
- * @throws BeeArgumentError when negative amount or depth is specified
210
- * @throws TypeError if non-integer value is passed to amount or depth
211
- *
212
- * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
213
- * @see [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post)
214
- */
215
- createPostageBatch(amount: NumberString, depth: number, options?: PostageBatchOptions, requestOptions?: BeeRequestOptions): Promise<BatchId>;
216
- /**
217
- * Topup a fresh amount of BZZ to given Postage Batch.
218
- *
219
- * For better understanding what each parameter means and what are the optimal values please see
220
- * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
221
- *
222
- * **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
223
- *
224
- * @param postageBatchId Batch ID
225
- * @param amount Amount to be added to the batch
226
- * @param options Request options
227
- *
228
- * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
229
- * @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)
230
- */
231
- topUpBatch(postageBatchId: BatchId | string, amount: NumberString, options?: BeeRequestOptions): Promise<void>;
232
- /**
233
- * Dilute given Postage Batch with new depth (that has to be bigger then the original depth), which allows
234
- * the Postage Batch to be used for more chunks.
235
- *
236
- * For better understanding what each parameter means and what are the optimal values please see
237
- * [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive).
238
- *
239
- * **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY**
240
- *
241
- * @param postageBatchId Batch ID
242
- * @param depth Amount to be added to the batch
243
- * @param options Request options
244
- *
245
- * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
246
- * @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)
247
- */
248
- diluteBatch(postageBatchId: BatchId | string, depth: number, options?: BeeRequestOptions): Promise<void>;
249
- /**
250
- * Return details for specific postage batch.
251
- *
252
- * @param postageBatchId Batch ID
253
- *
254
- * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
255
- * @see [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}/get)
256
- */
257
- getPostageBatch(postageBatchId: BatchId | string, options?: BeeRequestOptions): Promise<PostageBatch>;
258
- /**
259
- * Return detailed information related to buckets for specific postage batch.
260
- *
261
- * @param postageBatchId Batch ID
262
- *
263
- * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
264
- * @see [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}~1buckets/get)
265
- */
266
- getPostageBatchBuckets(postageBatchId: BatchId | string, options?: BeeRequestOptions): Promise<PostageBatchBuckets>;
267
- /**
268
- * Return all postage batches that has the node available.
269
- *
270
- * @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive)
271
- * @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps/get)
272
- */
273
- getAllPostageBatch(options?: BeeRequestOptions): Promise<PostageBatch[]>;
274
- /**
275
- * Return all globally available postage batches.
276
- */
277
- getAllGlobalPostageBatch(options?: BeeRequestOptions): Promise<PostageBatch[]>;
278
- /**
279
- * Return lists of all current pending transactions that the Bee made
280
- */
281
- getAllPendingTransactions(options?: BeeRequestOptions): Promise<TransactionInfo[]>;
282
- /**
283
- * Return transaction information for specific transaction
284
- * @param transactionHash
285
- */
286
- getPendingTransaction(transactionHash: TransactionHash | string, options?: BeeRequestOptions): Promise<TransactionInfo>;
287
- /**
288
- * Rebroadcast already created transaction.
289
- * This is mainly needed when your transaction fall off mempool from other reason is not incorporated into block.
290
- *
291
- * @param transactionHash
292
- */
293
- rebroadcastPendingTransaction(transactionHash: TransactionHash | string, options?: BeeRequestOptions): Promise<TransactionHash>;
294
- /**
295
- * Cancel currently pending transaction
296
- * @param transactionHash
297
- * @param gasPrice
298
- */
299
- cancelPendingTransaction(transactionHash: TransactionHash | string, gasPrice?: NumberString, options?: BeeRequestOptions): Promise<TransactionHash>;
300
- /**
301
- * Gets the staked amount of BZZ (in PLUR unit) as number string.
302
- *
303
- * @param options
304
- */
305
- getStake(options?: BeeRequestOptions): Promise<NumberString>;
306
- /**
307
- * Deposits given amount of BZZ token (in PLUR unit).
308
- *
309
- * Be aware that staked BZZ tokens can **not** be withdrawn.
310
- *
311
- * @param amount Amount of BZZ token (in PLUR unit) to be staked. Minimum is 100_000_000_000_000_000 PLUR (10 BZZ).
312
- * @param options
313
- */
314
- depositStake(amount: NumberString, options?: TransactionOptions, requestOptions?: BeeRequestOptions): Promise<void>;
315
- /**
316
- * Get current status of node in redistribution game
317
- *
318
- * @param options
319
- */
320
- getRedistributionState(options?: BeeRequestOptions): Promise<RedistributionState>;
321
- private waitForUsablePostageStamp;
322
- private getRequestOptionsForCall;
323
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Helper function for serialize byte arrays
3
- *
4
- * @param arrays Any number of byte array arguments
5
- */
6
- export declare function serializeBytes(...arrays: Uint8Array[]): Uint8Array;
@@ -1,40 +0,0 @@
1
- /// <reference types="node" />
2
- import { Readable as NodeReadableNative, ReadableOptions as NodeReadableOptions } from 'stream';
3
- import { ReadableStream } from 'web-streams-polyfill';
4
- import { Readable } from '../types';
5
- /**
6
- * Validates if passed object is either browser's ReadableStream
7
- * or Node's Readable.
8
- *
9
- * @param entry
10
- */
11
- export declare function isReadable(entry: unknown): entry is Readable;
12
- export declare function isReadableStream(entry: unknown): entry is ReadableStream;
13
- export declare function isNodeReadable(entry: unknown): entry is NodeReadableNative;
14
- /**
15
- * Function that converts Node's Readable into WHATWG ReadableStream
16
- *
17
- * Taken over from https://github.com/gwicke/node-web-streams/blob/master/lib/conversions.js
18
- * Because it uses forked web-streams-polyfill that are outdated.
19
- *
20
- * @author https://github.com/gwicke
21
- * @licence Apache License 2.0 https://github.com/gwicke/node-web-streams/blob/master/LICENSE
22
- * @param nodeStream
23
- */
24
- export declare function readableNodeToWeb(nodeStream: NodeReadableNative): ReadableStream<Uint8Array>;
25
- /**
26
- * Function that converts WHATWG ReadableStream into Node's Readable
27
- *
28
- * Taken over from https://github.com/gwicke/node-web-streams/blob/master/lib/conversions.js
29
- * Because it uses forked web-streams-polyfill that is outdated.
30
- *
31
- * **Warning!**
32
- * If you want to use this function in browser you have to polyfill `stream` package with your bundler.
33
- *
34
- * @author https://github.com/gwicke
35
- * @licence Apache License 2.0 https://github.com/gwicke/node-web-streams/blob/master/LICENSE
36
- * @param webStream
37
- * @param options
38
- */
39
- export declare function readableWebToNode(webStream: ReadableStream<unknown>, options?: NodeReadableOptions): NodeReadableNative;
40
- export declare function normalizeToReadableStream(stream: Readable): ReadableStream;
@@ -1,4 +0,0 @@
1
- import { Bytes } from './bytes';
2
- export declare function writeUint64LittleEndian(value: number, bytes?: Bytes<8>): Bytes<8>;
3
- export declare function writeUint64BigEndian(value: number, bytes?: Bytes<8>): Bytes<8>;
4
- export declare function readUint64BigEndian(bytes: Bytes<8>): number;