@ethersphere/bee-js 9.8.0 → 10.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.
- package/dist/cjs/bee.js +819 -364
- package/dist/cjs/manifest/manifest.js +6 -3
- package/dist/cjs/modules/debug/chequebook.js +1 -1
- package/dist/cjs/types/index.js +285 -4
- package/dist/cjs/utils/bytes.js +19 -1
- package/dist/cjs/utils/duration.js +6 -2
- package/dist/cjs/utils/stamps.js +36 -13
- package/dist/cjs/utils/type.js +2 -0
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee.js +818 -364
- package/dist/mjs/manifest/manifest.js +6 -3
- package/dist/mjs/modules/debug/chequebook.js +2 -2
- package/dist/mjs/types/index.js +1275 -4
- package/dist/mjs/utils/bytes.js +17 -0
- package/dist/mjs/utils/duration.js +7 -3
- package/dist/mjs/utils/stamps.js +35 -14
- package/dist/mjs/utils/type.js +6 -0
- package/dist/types/bee.d.ts +701 -249
- package/dist/types/types/debug.d.ts +1 -1
- package/dist/types/types/index.d.ts +108 -6
- package/dist/types/utils/bytes.d.ts +1 -0
- package/dist/types/utils/duration.d.ts +2 -0
- package/dist/types/utils/stamps.d.ts +4 -4
- package/package.json +1 -1
package/dist/types/bee.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Readable } from 'stream';
|
|
3
3
|
import { Chunk } from './chunk/cac';
|
|
4
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';
|
|
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, RedundancyLevel, RedundantUploadOptions, ReferenceInformation, RemovePeerResponse, ReserveState, SOCReader, SOCWriter, Settlements, Tag, Topology, TransactionInfo, UploadOptions, WalletBalance } from './types';
|
|
6
6
|
import { AllTagsOptions, Collection, PostageBatchOptions, TransactionOptions, UploadResult } from './types';
|
|
7
7
|
import { Bytes } from './utils/bytes';
|
|
8
8
|
import { Duration } from './utils/duration';
|
|
@@ -11,80 +11,121 @@ import { BZZ, DAI } from './utils/tokens';
|
|
|
11
11
|
import { BatchId, EthAddress, FeedIndex, Identifier, PeerAddress, PrivateKey, PublicKey, Reference, Topic, TransactionId } from './utils/typed-bytes';
|
|
12
12
|
import { UploadProgress } from './utils/upload-progress';
|
|
13
13
|
/**
|
|
14
|
-
* The main component that abstracts operations available on the
|
|
14
|
+
* The main component that abstracts operations available on the Bee API.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Instantiate with `new Bee(url, options)` where `url` is the Bee node URL and `options` are optional parameters.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const bee = new Bee('http://localhost:1633')
|
|
18
20
|
*/
|
|
19
21
|
export declare class Bee {
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* Bee node API URL.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* `http://localhost:1633`
|
|
22
27
|
*/
|
|
23
28
|
readonly url: string;
|
|
24
29
|
/**
|
|
25
|
-
* Default
|
|
30
|
+
* Default signer (a private key) used for signing.
|
|
31
|
+
*
|
|
32
|
+
* Mainly used in single-owner chunk (SOC) related operations, and consequently in feeds.
|
|
33
|
+
*
|
|
34
|
+
* If not provided, methods such as `makeFeedWriter` and `makeSOCWriter`
|
|
35
|
+
* must be provided with a private key in their respective function calls.
|
|
26
36
|
*/
|
|
27
37
|
readonly signer?: PrivateKey;
|
|
28
38
|
/**
|
|
29
|
-
* Network on which the Bee node is running
|
|
39
|
+
* Network on which the Bee node is running.
|
|
40
|
+
*
|
|
41
|
+
* This is currently used to determine block time for postage batch time-to-live (TTL) calculations.
|
|
42
|
+
* The block time for `gnosis` is `5` seconds, and for `sepolia` it is `15` seconds.
|
|
43
|
+
*
|
|
44
|
+
* @default 'gnosis'
|
|
30
45
|
*/
|
|
31
46
|
readonly network: 'gnosis' | 'sepolia';
|
|
32
47
|
/**
|
|
33
|
-
* Options for making requests
|
|
34
|
-
* @private
|
|
48
|
+
* Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
35
49
|
*/
|
|
36
50
|
private readonly requestOptions;
|
|
37
51
|
/**
|
|
38
52
|
* @param url URL on which is the main API of Bee node exposed
|
|
39
53
|
* @param options
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* const bee = new Bee('http://localhost:1633')
|
|
40
57
|
*/
|
|
41
58
|
constructor(url: string, options?: BeeOptions);
|
|
42
59
|
/**
|
|
43
|
-
*
|
|
60
|
+
* Uploads raw data to the network (as opposed to uploading chunks or files).
|
|
44
61
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* @param
|
|
62
|
+
* Data uploaded with this method should be retrieved with the {@link downloadData} method.
|
|
63
|
+
*
|
|
64
|
+
* @param postageBatchId Usable Postage Batch ID with sufficient capacity to upload the data.
|
|
65
|
+
* @param data A `string` (text data) or `Uint8Array` (raw data) to be uploaded.
|
|
66
|
+
* @param options Additional options like tag, encryption, pinning, content-type and request options.
|
|
67
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
48
68
|
*
|
|
49
69
|
* @returns reference is a content hash of the data
|
|
50
|
-
*
|
|
70
|
+
*
|
|
51
71
|
* @see [Bee API reference - `POST /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post)
|
|
72
|
+
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
52
73
|
*/
|
|
53
74
|
uploadData(postageBatchId: BatchId | Uint8Array | string, data: string | Uint8Array, options?: RedundantUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
54
75
|
/**
|
|
55
|
-
*
|
|
76
|
+
* Fetches content length for a `/bytes` reference.
|
|
77
|
+
*
|
|
78
|
+
* @param reference
|
|
79
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
56
80
|
*
|
|
57
|
-
* @see [Bee API reference - `HEAD /bytes
|
|
81
|
+
* @see [Bee API reference - `HEAD /bytes/{reference}`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/head)
|
|
58
82
|
*/
|
|
59
|
-
probeData(reference: Reference | Uint8Array | string,
|
|
83
|
+
probeData(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<ReferenceInformation>;
|
|
60
84
|
/**
|
|
61
|
-
*
|
|
85
|
+
* Downloads raw data through the `GET /bytes/{reference}` endpoint.
|
|
86
|
+
*
|
|
87
|
+
* This method may be used to download data that was uploaded with the {@link uploadData} method.
|
|
88
|
+
*
|
|
89
|
+
* For downloading files or using the `GET /bzz/{reference}/` endpoint, use the {@link downloadFile} method instead.
|
|
90
|
+
* For downloading chunks or using the `GET /chunks/{reference} endpoint, use the `downloadChunk` method instead.
|
|
62
91
|
*
|
|
63
|
-
* @param resource Swarm reference, Swarm CID, or ENS domain
|
|
92
|
+
* @param resource Swarm reference, Swarm CID, or ENS domain.
|
|
64
93
|
* @param options Options that affects the request behavior
|
|
94
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
95
|
+
*
|
|
65
96
|
* @throws TypeError if some of the input parameters is not expected type
|
|
66
97
|
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
98
|
+
*
|
|
67
99
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
68
100
|
* @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)
|
|
69
101
|
*/
|
|
70
102
|
downloadData(resource: Reference | string | Uint8Array, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<Bytes>;
|
|
71
103
|
/**
|
|
72
|
-
* Download data
|
|
104
|
+
* Download raw data through the `GET /bytes/{reference}` endpoint.
|
|
105
|
+
*
|
|
106
|
+
* This method may be used to download data that was uploaded with the {@link uploadData} method.
|
|
107
|
+
*
|
|
108
|
+
* Only tested in Node.js environment.
|
|
109
|
+
*
|
|
110
|
+
* @param resource Swarm reference, Swarm CID, or ENS domain.
|
|
111
|
+
* @param options Options that affects the request behavior.
|
|
112
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
113
|
+
*
|
|
114
|
+
* @returns ReadableStream of Uint8Array
|
|
73
115
|
*
|
|
74
|
-
* @param resource Swarm reference, Swarm CID, or ENS domain
|
|
75
|
-
* @param options Options that affects the request behavior
|
|
76
|
-
* @throws TypeError if some of the input parameters is not expected type
|
|
77
|
-
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
78
116
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
79
117
|
* @see [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get)
|
|
80
118
|
*/
|
|
81
119
|
downloadReadableData(resource: Reference | Uint8Array | string, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<ReadableStream<Uint8Array>>;
|
|
82
120
|
/**
|
|
83
|
-
*
|
|
121
|
+
* Uploads a chunk to the network.
|
|
122
|
+
*
|
|
123
|
+
* Chunks uploaded with this method should be retrieved with the {@link downloadChunk} method.
|
|
84
124
|
*
|
|
85
|
-
* @param
|
|
125
|
+
* @param stamp Postage Batch ID or an Envelope created with the {@link createEnvelope} method.
|
|
86
126
|
* @param data Raw chunk to be uploaded
|
|
87
127
|
* @param options Additional options like tag, encryption, pinning, content-type and request options
|
|
128
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
88
129
|
*
|
|
89
130
|
* @returns reference is a content hash of the data
|
|
90
131
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
@@ -92,12 +133,17 @@ export declare class Bee {
|
|
|
92
133
|
*/
|
|
93
134
|
uploadChunk(stamp: EnvelopeWithBatchId | BatchId | Uint8Array | string, data: Uint8Array | Chunk, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
94
135
|
/**
|
|
95
|
-
*
|
|
136
|
+
* Downloads a chunk as a `Uint8Array`.
|
|
137
|
+
*
|
|
138
|
+
* May be used to download chunks uploaded with the {@link uploadChunk} method.
|
|
139
|
+
*
|
|
140
|
+
* Use {@link downloadData} method to download raw data uploaded with the {@link uploadData} method.
|
|
141
|
+
* Use {@link downloadFile} method to download files uploaded with the {@link uploadFile} method.
|
|
96
142
|
*
|
|
97
143
|
* @param reference Bee chunk reference in hex string (either 64 or 128 chars long) or ENS domain.
|
|
98
144
|
* @param options Options that affects the request behavior
|
|
99
|
-
* @
|
|
100
|
-
*
|
|
145
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
146
|
+
*
|
|
101
147
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
102
148
|
* @see [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{address}/get)
|
|
103
149
|
*/
|
|
@@ -105,7 +151,7 @@ export declare class Bee {
|
|
|
105
151
|
/**
|
|
106
152
|
* Create a grantees list from the given array of public keys.
|
|
107
153
|
*
|
|
108
|
-
* The grantees list can be obtained with the
|
|
154
|
+
* The grantees list can be obtained with the {@link getGrantees} method.
|
|
109
155
|
*
|
|
110
156
|
* @param postageBatchId - The ID of the postage batch.
|
|
111
157
|
* @param grantees - An array of public keys representing the grantees.
|
|
@@ -128,7 +174,7 @@ export declare class Bee {
|
|
|
128
174
|
* @param history - The history.
|
|
129
175
|
* @param postageBatchId - The ID of the postage batch.
|
|
130
176
|
* @param grantees - The grantees.
|
|
131
|
-
* @param requestOptions
|
|
177
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
132
178
|
* @returns A Promise that resolves to to a `GranteesResult` object.
|
|
133
179
|
*/
|
|
134
180
|
patchGrantees(postageBatchId: BatchId | Uint8Array | string, reference: Reference | Uint8Array | string, history: Reference | Uint8Array | string, grantees: {
|
|
@@ -136,12 +182,18 @@ export declare class Bee {
|
|
|
136
182
|
revoke?: PublicKey[] | Uint8Array[] | string[];
|
|
137
183
|
}, requestOptions?: BeeRequestOptions): Promise<GranteesResult>;
|
|
138
184
|
/**
|
|
139
|
-
*
|
|
185
|
+
* Uploads a single file to a Bee node.
|
|
186
|
+
*
|
|
187
|
+
* To download the file, use the {@link downloadFile} method.
|
|
188
|
+
*
|
|
189
|
+
* Use {@link uploadData} method to upload raw data that can be downloaded with the {@link downloadData} method.
|
|
190
|
+
* Use {@link uploadChunk} method to upload chunks that can be downloaded with the {@link downloadChunk} method.
|
|
140
191
|
*
|
|
141
192
|
* @param postageBatchId Postage BatchId to be used to upload the data with
|
|
142
193
|
* @param data Data or file to be uploaded
|
|
143
194
|
* @param name Optional name of the uploaded file
|
|
144
195
|
* @param options Additional options like tag, encryption, pinning, content-type and request options
|
|
196
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
145
197
|
*
|
|
146
198
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
147
199
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
@@ -150,14 +202,13 @@ export declare class Bee {
|
|
|
150
202
|
*/
|
|
151
203
|
uploadFile(postageBatchId: BatchId | Uint8Array | string, data: string | Uint8Array | Readable | File, name?: string, options?: FileUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
152
204
|
/**
|
|
153
|
-
*
|
|
205
|
+
* Downloads a single file.
|
|
154
206
|
*
|
|
155
|
-
* @param resource Swarm reference, Swarm CID, or ENS domain
|
|
207
|
+
* @param resource Swarm reference, Swarm CID, or ENS domain.
|
|
156
208
|
* @param path If reference points to manifest, then this parameter defines path to the file
|
|
157
209
|
* @param options Options that affects the request behavior
|
|
158
|
-
* @
|
|
159
|
-
*
|
|
160
|
-
* @see Data
|
|
210
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
211
|
+
*
|
|
161
212
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
162
213
|
* @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)
|
|
163
214
|
*/
|
|
@@ -168,8 +219,7 @@ export declare class Bee {
|
|
|
168
219
|
* @param reference Bee file reference in hex string (either 64 or 128 chars long), ENS domain or Swarm CID.
|
|
169
220
|
* @param path If reference points to manifest / collections, then this parameter defines path to the file
|
|
170
221
|
* @param options Options that affects the request behavior
|
|
171
|
-
* @
|
|
172
|
-
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
222
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
173
223
|
*
|
|
174
224
|
* @see [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download)
|
|
175
225
|
* @see [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get)
|
|
@@ -186,14 +236,59 @@ export declare class Bee {
|
|
|
186
236
|
* @param postageBatchId Postage BatchId to be used to upload the data with
|
|
187
237
|
* @param fileList list of files to be uploaded
|
|
188
238
|
* @param options Additional options like tag, encryption, pinning and request options
|
|
239
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
189
240
|
*
|
|
190
241
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
191
242
|
* @see [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory)
|
|
192
243
|
* @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
|
|
193
244
|
*/
|
|
194
245
|
uploadFiles(postageBatchId: BatchId | Uint8Array | string, fileList: FileList | File[], options?: CollectionUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
246
|
+
/**
|
|
247
|
+
* Hashes a directory locally and returns the root hash (Swarm reference).
|
|
248
|
+
*
|
|
249
|
+
* The actual Swarm reference may be different as there is no canonical hashing of directories.
|
|
250
|
+
* For example, metadata may have different casing, or the order of metadata may differ.
|
|
251
|
+
* Such small differences will result in different Swarm references.
|
|
252
|
+
*
|
|
253
|
+
* Different implementations of the Mantaray structure may also result in different Swarm references.
|
|
254
|
+
*
|
|
255
|
+
* @param dir
|
|
256
|
+
* @returns
|
|
257
|
+
*/
|
|
195
258
|
hashDirectory(dir: string): Promise<Reference>;
|
|
259
|
+
/**
|
|
260
|
+
* Uploads a directory to the network. The difference between this method and {@link uploadFilesFromDirectory} is that
|
|
261
|
+
* this method streams the directory contents directly to the Bee node, which supports arbitrary directory sizes,
|
|
262
|
+
* but may be slower due to uploading chunks one by one.
|
|
263
|
+
*
|
|
264
|
+
* Options such as encryption, erasure coding and ACT are not yet available for this method.
|
|
265
|
+
*
|
|
266
|
+
* Only intended for the Node.js environment.
|
|
267
|
+
*
|
|
268
|
+
* @param postageBatchId
|
|
269
|
+
* @param dir
|
|
270
|
+
* @param onUploadProgress
|
|
271
|
+
* @param options
|
|
272
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
273
|
+
* @returns
|
|
274
|
+
*/
|
|
196
275
|
streamDirectory(postageBatchId: BatchId | Uint8Array | string, dir: string, onUploadProgress?: (progress: UploadProgress) => void, options?: CollectionUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
276
|
+
/**
|
|
277
|
+
* Uploads a collection of files to the network. The difference between this method and {@link uploadFiles} is that
|
|
278
|
+
* this method streams the files to the Bee node, which supports arbitrary sizes,
|
|
279
|
+
* but may be slower due to uploading chunks one by one.
|
|
280
|
+
*
|
|
281
|
+
* Options such as encryption, erasure coding and ACT are not yet available for this method.
|
|
282
|
+
*
|
|
283
|
+
* Only intended for the browser environment.
|
|
284
|
+
*
|
|
285
|
+
* @param postageBatchId
|
|
286
|
+
* @param files
|
|
287
|
+
* @param onUploadProgress
|
|
288
|
+
* @param options
|
|
289
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
290
|
+
* @returns
|
|
291
|
+
*/
|
|
197
292
|
streamFiles(postageBatchId: BatchId | Uint8Array | string, files: File[] | FileList, onUploadProgress?: (progress: UploadProgress) => void, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
198
293
|
/**
|
|
199
294
|
* Upload Collection that you can assembly yourself.
|
|
@@ -224,50 +319,47 @@ export declare class Bee {
|
|
|
224
319
|
*/
|
|
225
320
|
uploadFilesFromDirectory(postageBatchId: BatchId | Uint8Array | string, dir: string, options?: CollectionUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
226
321
|
/**
|
|
227
|
-
*
|
|
322
|
+
* Creates a new Tag which is meant for tracking upload and synchronization progress.
|
|
323
|
+
*
|
|
324
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
228
325
|
*
|
|
229
|
-
* @param options Options that affects the request behavior
|
|
230
326
|
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
231
327
|
* @see [Bee API reference - `POST /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post)
|
|
232
328
|
*/
|
|
233
|
-
createTag(
|
|
329
|
+
createTag(requestOptions?: BeeRequestOptions): Promise<Tag>;
|
|
234
330
|
/**
|
|
235
|
-
* Fetches all tags.
|
|
331
|
+
* Fetches all tags in a paginated manner.
|
|
236
332
|
*
|
|
237
333
|
* The listing is limited by options.limit. So you have to iterate using options.offset to get all tags.
|
|
238
334
|
*
|
|
239
|
-
* @param options
|
|
240
|
-
* @
|
|
241
|
-
* @throws BeeArgumentError if limit or offset have invalid options
|
|
335
|
+
* @param options Specify `limit` and `offset` to paginate through the tags.
|
|
336
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
242
337
|
*
|
|
243
338
|
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
244
339
|
* @see [Bee API reference - `GET /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get)
|
|
245
340
|
*/
|
|
246
341
|
getAllTags(options?: AllTagsOptions, requestOptions?: BeeRequestOptions): Promise<Tag[]>;
|
|
247
342
|
/**
|
|
248
|
-
*
|
|
343
|
+
* Retrieves tag information from Bee node.
|
|
249
344
|
*
|
|
250
345
|
* @param tagUid UID or tag object to be retrieved
|
|
251
|
-
* @param
|
|
252
|
-
* @throws TypeError if tagUid is in not correct format
|
|
346
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
253
347
|
*
|
|
254
348
|
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
255
349
|
* @see [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/get)
|
|
256
350
|
*
|
|
257
351
|
*/
|
|
258
|
-
retrieveTag(tagUid: number | Tag,
|
|
352
|
+
retrieveTag(tagUid: number | Tag, requestOptions?: BeeRequestOptions): Promise<Tag>;
|
|
259
353
|
/**
|
|
260
|
-
*
|
|
354
|
+
* Deletes Tag.
|
|
261
355
|
*
|
|
262
356
|
* @param tagUid UID or tag object to be retrieved
|
|
263
|
-
* @param
|
|
264
|
-
* @throws TypeError if tagUid is in not correct format
|
|
265
|
-
* @throws BeeResponse error if something went wrong on the Bee node side while deleting the tag.
|
|
357
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
266
358
|
*
|
|
267
359
|
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
268
360
|
* @see [Bee API reference - `DELETE /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/delete)
|
|
269
361
|
*/
|
|
270
|
-
deleteTag(tagUid: number | Tag,
|
|
362
|
+
deleteTag(tagUid: number | Tag, requestOptions?: BeeRequestOptions): Promise<void>;
|
|
271
363
|
/**
|
|
272
364
|
* Update tag's total chunks count.
|
|
273
365
|
*
|
|
@@ -276,77 +368,68 @@ export declare class Bee {
|
|
|
276
368
|
*
|
|
277
369
|
* @param tagUid UID or tag object to be retrieved
|
|
278
370
|
* @param reference The root reference that contains all the chunks to be counted
|
|
279
|
-
* @param
|
|
280
|
-
* @throws TypeError if tagUid is in not correct format
|
|
281
|
-
* @throws BeeResponse error if something went wrong on the Bee node side while deleting the tag.
|
|
371
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
282
372
|
*
|
|
283
373
|
* @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
|
|
284
374
|
* @see [Bee API reference - `PATCH /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/patch)
|
|
285
375
|
*/
|
|
286
|
-
updateTag(tagUid: number | Tag, reference: Reference | string,
|
|
376
|
+
updateTag(tagUid: number | Tag, reference: Reference | string, requestOptions?: BeeRequestOptions): Promise<void>;
|
|
287
377
|
/**
|
|
288
|
-
*
|
|
378
|
+
* Pins local data with given reference.
|
|
289
379
|
*
|
|
290
380
|
* @param reference Data reference
|
|
291
|
-
* @param
|
|
292
|
-
* @throws TypeError if reference is in not correct format
|
|
381
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
293
382
|
*
|
|
294
383
|
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
|
|
295
384
|
*/
|
|
296
|
-
pin(reference: Reference | Uint8Array | string,
|
|
385
|
+
pin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<void>;
|
|
297
386
|
/**
|
|
298
|
-
*
|
|
387
|
+
* Unpins local data with given reference.
|
|
299
388
|
*
|
|
300
389
|
* @param reference Data reference
|
|
301
|
-
* @param
|
|
302
|
-
* @throws TypeError if reference is in not correct format
|
|
390
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
303
391
|
*
|
|
304
392
|
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
|
|
305
393
|
*/
|
|
306
|
-
unpin(reference: Reference | Uint8Array | string,
|
|
394
|
+
unpin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<void>;
|
|
307
395
|
/**
|
|
308
|
-
*
|
|
396
|
+
* Gets list of all locally pinned references.
|
|
397
|
+
*
|
|
398
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
309
399
|
*
|
|
310
|
-
* @param options Options that affects the request behavior
|
|
311
400
|
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
|
|
312
401
|
*/
|
|
313
|
-
getAllPins(
|
|
402
|
+
getAllPins(requestOptions?: BeeRequestOptions): Promise<Reference[]>;
|
|
314
403
|
/**
|
|
315
404
|
* Get pinning status of chunk with given reference
|
|
316
405
|
*
|
|
317
406
|
* @param reference Bee data reference in hex string (either 64 or 128 chars long) or ENS domain.
|
|
318
|
-
* @param
|
|
319
|
-
* @throws TypeError if some of the input parameters is not expected type
|
|
320
|
-
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
407
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
321
408
|
*
|
|
322
409
|
* @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
|
|
323
410
|
*/
|
|
324
|
-
getPin(reference: Reference | Uint8Array | string,
|
|
411
|
+
getPin(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<Pin>;
|
|
325
412
|
/**
|
|
326
413
|
* Instructs the Bee node to reupload a locally pinned data into the network.
|
|
327
414
|
*
|
|
415
|
+
* @param postageBatchId Postage Batch ID that will be used to re-upload the data.
|
|
328
416
|
* @param reference Bee data reference to be re-uploaded in hex string (either 64 or 128 chars long) or ENS domain.
|
|
329
|
-
* @param
|
|
330
|
-
* @throws BeeArgumentError if the reference is not locally pinned
|
|
331
|
-
* @throws TypeError if some of the input parameters is not expected type
|
|
332
|
-
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
417
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
333
418
|
*
|
|
334
419
|
* @see [Bee API reference - `PUT /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/put)
|
|
335
420
|
*/
|
|
336
|
-
reuploadPinnedData(postageBatchId: BatchId | Uint8Array | string, reference: Reference | Uint8Array | string,
|
|
421
|
+
reuploadPinnedData(postageBatchId: BatchId | Uint8Array | string, reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<void>;
|
|
337
422
|
/**
|
|
338
423
|
* Checks if content specified by reference is retrievable from the network.
|
|
339
424
|
*
|
|
340
425
|
* @param reference Bee data reference to be checked in hex string (either 64 or 128 chars long) or ENS domain.
|
|
341
|
-
* @param
|
|
342
|
-
* @throws TypeError if some of the input parameters is not expected type
|
|
343
|
-
* @throws BeeArgumentError if there is passed ENS domain with invalid unicode characters
|
|
426
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
344
427
|
*
|
|
345
428
|
* @see [Bee API reference - `GET /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/get)
|
|
346
429
|
*/
|
|
347
|
-
isReferenceRetrievable(reference: Reference | Uint8Array | string,
|
|
430
|
+
isReferenceRetrievable(reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<boolean>;
|
|
348
431
|
/**
|
|
349
|
-
* Functions that
|
|
432
|
+
* Functions that validate if feed is retrievable in the network.
|
|
350
433
|
*
|
|
351
434
|
* If no index is passed then it check for "latest" update, which is a weaker guarantee as nobody can be really
|
|
352
435
|
* sure what is the "latest" update.
|
|
@@ -359,6 +442,7 @@ export declare class Bee {
|
|
|
359
442
|
* @param topic
|
|
360
443
|
* @param index
|
|
361
444
|
* @param options
|
|
445
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
362
446
|
*/
|
|
363
447
|
isFeedRetrievable(owner: EthAddress | Uint8Array | string, topic: Topic | Uint8Array | string, index?: FeedIndex, options?: DownloadOptions, requestOptions?: BeeRequestOptions): Promise<boolean>;
|
|
364
448
|
/**
|
|
@@ -369,26 +453,23 @@ export declare class Bee {
|
|
|
369
453
|
* most likely for setting up an encrypted communication
|
|
370
454
|
* channel by sending an one-off message.
|
|
371
455
|
*
|
|
372
|
-
* **Warning!
|
|
373
|
-
* This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them.
|
|
456
|
+
* **Warning! Only full nodes can accept PSS messages.**
|
|
374
457
|
*
|
|
375
458
|
* @param postageBatchId Postage BatchId that will be assigned to sent message
|
|
376
459
|
* @param topic Topic name
|
|
377
460
|
* @param target Target message address prefix. Has a limit on length. Recommend to use `Utils.Pss.makeMaxTarget()` to get the most specific target that Bee node will accept.
|
|
378
461
|
* @param data Message to be sent
|
|
379
462
|
* @param recipient Recipient public key
|
|
380
|
-
* @param
|
|
381
|
-
* @throws TypeError if `data`, `batchId`, `target` or `recipient` are in invalid format
|
|
463
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
382
464
|
*
|
|
383
465
|
* @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss)
|
|
384
466
|
* @see [Bee API reference - `POST /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1{topic}~1{targets}/post)
|
|
385
467
|
*/
|
|
386
|
-
pssSend(postageBatchId: BatchId | Uint8Array | string, topic: Topic, target: string, data: string | Uint8Array, recipient?: string | PublicKey,
|
|
468
|
+
pssSend(postageBatchId: BatchId | Uint8Array | string, topic: Topic, target: string, data: string | Uint8Array, recipient?: string | PublicKey, requestOptions?: BeeRequestOptions): Promise<void>;
|
|
387
469
|
/**
|
|
388
|
-
*
|
|
470
|
+
* Subscribes to messages for given topic with the Postal Service for Swarm.
|
|
389
471
|
*
|
|
390
|
-
* **Warning!
|
|
391
|
-
* This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them.
|
|
472
|
+
* **Warning! Only full nodes can accept PSS messages.**
|
|
392
473
|
*
|
|
393
474
|
* @param topic Topic name
|
|
394
475
|
* @param handler Message handler interface
|
|
@@ -400,20 +481,14 @@ export declare class Bee {
|
|
|
400
481
|
*/
|
|
401
482
|
pssSubscribe(topic: Topic, handler: PssMessageHandler): PssSubscription;
|
|
402
483
|
/**
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
* Because sending a PSS message is slow and CPU intensive,
|
|
406
|
-
* it is not supposed to be used for general messaging but
|
|
407
|
-
* most likely for setting up an encrypted communication
|
|
408
|
-
* channel by sending an one-off message.
|
|
484
|
+
* Receives message using the Postal Service for Swarm.
|
|
409
485
|
*
|
|
410
486
|
* This is a helper function to wait for exactly one message to
|
|
411
487
|
* arrive and then cancel the subscription. Additionally a
|
|
412
488
|
* timeout can be provided for the message to arrive or else
|
|
413
489
|
* an error will be thrown.
|
|
414
490
|
*
|
|
415
|
-
* **Warning!
|
|
416
|
-
* This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them.
|
|
491
|
+
* **Warning! Only full nodes can accept PSS messages.**
|
|
417
492
|
*
|
|
418
493
|
* @param topic Topic name
|
|
419
494
|
* @param timeoutMsec Timeout in milliseconds
|
|
@@ -424,412 +499,789 @@ export declare class Bee {
|
|
|
424
499
|
* @see [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get)
|
|
425
500
|
*/
|
|
426
501
|
pssReceive(topic: Topic, timeoutMsec?: number): Promise<Bytes>;
|
|
502
|
+
/**
|
|
503
|
+
* Mines the signer (a private key) to be used to send GSOC messages to the specific target overlay address.
|
|
504
|
+
*
|
|
505
|
+
* Use {@link gsocSend} to send GSOC messages with the mined signer.
|
|
506
|
+
*
|
|
507
|
+
* Use {@link gsocSubscribe} to subscribe to GSOC messages for the specified owner (of the signer) and identifier.
|
|
508
|
+
*
|
|
509
|
+
* See {@link gsocSend} or {@link gsocSubscribe} for concrete examples of usage.
|
|
510
|
+
*
|
|
511
|
+
* **Warning! Only full nodes can accept GSOC messages.**
|
|
512
|
+
*
|
|
513
|
+
* @param targetOverlay
|
|
514
|
+
* @param identifier
|
|
515
|
+
* @param proximity
|
|
516
|
+
* @returns
|
|
517
|
+
*/
|
|
427
518
|
gsocMine(targetOverlay: PeerAddress | Uint8Array | string, identifier: Identifier | Uint8Array | string, proximity?: number): PrivateKey;
|
|
519
|
+
/**
|
|
520
|
+
* Sends a GSOC message with the specified signer and identifier.
|
|
521
|
+
*
|
|
522
|
+
* Use {@link gsocMine} to mine a signer for the target overlay address.
|
|
523
|
+
*
|
|
524
|
+
* Use {@link gsocSubscribe} to subscribe to GSOC messages for the specified owner (of the signer) and identifier.
|
|
525
|
+
*
|
|
526
|
+
* **Warning! Only full nodes can accept GSOC messages.**
|
|
527
|
+
*
|
|
528
|
+
* @param postageBatchId
|
|
529
|
+
* @param signer
|
|
530
|
+
* @param identifier
|
|
531
|
+
* @param data
|
|
532
|
+
* @param options
|
|
533
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
534
|
+
* @returns
|
|
535
|
+
*
|
|
536
|
+
* @example
|
|
537
|
+
* const identifier = NULL_IDENTIFIER
|
|
538
|
+
* const overlay = '0x1234567890123456789012345678901234567890'
|
|
539
|
+
* const signer = bee.gsocMine(overlay, identifier)
|
|
540
|
+
* await bee.gsocSend(postageBatchId, signer, identifier, 'GSOC!')
|
|
541
|
+
*/
|
|
428
542
|
gsocSend(postageBatchId: BatchId | Uint8Array | string, signer: PrivateKey | Uint8Array | string, identifier: Identifier | Uint8Array | string, data: string | Uint8Array, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
|
|
543
|
+
/**
|
|
544
|
+
* Subscribes to GSOC messages for the specified owner (of the signer) and identifier.
|
|
545
|
+
*
|
|
546
|
+
* Use {@link gsocMine} to mine a signer for the target overlay address.
|
|
547
|
+
*
|
|
548
|
+
* Use {@link gsocSend} to send GSOC messages with the mined signer.
|
|
549
|
+
*
|
|
550
|
+
* **Warning! Only full nodes can accept GSOC messages.**
|
|
551
|
+
*
|
|
552
|
+
* @param address
|
|
553
|
+
* @param identifier
|
|
554
|
+
* @param handler
|
|
555
|
+
* @returns
|
|
556
|
+
*
|
|
557
|
+
* @example
|
|
558
|
+
* const identifier = NULL_IDENTIFIER
|
|
559
|
+
* const { overlay } = await bee.getNodeAddresses()
|
|
560
|
+
* const signer = bee.gsocMine(overlay, identifier)
|
|
561
|
+
*
|
|
562
|
+
* const subscription = bee.gsocSubscribe(signer.publicKey().address(), identifier, {
|
|
563
|
+
* onMessage(message) {
|
|
564
|
+
* // handle
|
|
565
|
+
* },
|
|
566
|
+
* onError(error) {
|
|
567
|
+
* // handle
|
|
568
|
+
* },
|
|
569
|
+
* onClose() {
|
|
570
|
+
* // handle
|
|
571
|
+
* }
|
|
572
|
+
* })
|
|
573
|
+
*/
|
|
429
574
|
gsocSubscribe(address: EthAddress | Uint8Array | string, identifier: Identifier | Uint8Array | string, handler: GsocMessageHandler): GsocSubscription;
|
|
430
575
|
/**
|
|
431
|
-
*
|
|
576
|
+
* Creates a feed manifest chunk and returns the reference to it.
|
|
432
577
|
*
|
|
433
|
-
* Feed manifest
|
|
578
|
+
* Feed manifest chunks allow for a feed to be able to be resolved through `/bzz` endpoint.
|
|
434
579
|
*
|
|
435
580
|
* @param postageBatchId Postage BatchId to be used to create the Feed Manifest
|
|
436
581
|
* @param topic Topic in hex or bytes
|
|
437
582
|
* @param owner Owner's ethereum address in hex or bytes
|
|
438
583
|
* @param options Options that affects the request behavior
|
|
584
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
439
585
|
*
|
|
440
586
|
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
|
|
441
587
|
* @see [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post)
|
|
442
588
|
*/
|
|
443
589
|
createFeedManifest(postageBatchId: BatchId | Uint8Array | string, topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, options?: UploadOptions, requestOptions?: BeeRequestOptions): Promise<Reference>;
|
|
444
590
|
/**
|
|
445
|
-
*
|
|
591
|
+
* Makes a new feed reader for downloading feed updates.
|
|
446
592
|
*
|
|
447
593
|
* @param topic Topic in hex or bytes
|
|
448
594
|
* @param owner Owner's ethereum address in hex or bytes
|
|
449
|
-
* @param
|
|
595
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
450
596
|
*
|
|
451
597
|
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
|
|
452
598
|
*/
|
|
453
|
-
makeFeedReader(topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string,
|
|
599
|
+
makeFeedReader(topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, requestOptions?: BeeRequestOptions): FeedReader;
|
|
454
600
|
/**
|
|
455
|
-
*
|
|
601
|
+
* Makes a new feed writer for updating feeds
|
|
456
602
|
*
|
|
457
603
|
* @param topic Topic in hex or bytes
|
|
458
604
|
* @param signer The signer's private key or a Signer instance that can sign data
|
|
459
|
-
* @param
|
|
605
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
460
606
|
*
|
|
461
607
|
* @see [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds)
|
|
462
608
|
*/
|
|
463
|
-
makeFeedWriter(topic: Topic | Uint8Array | string, signer?: PrivateKey | Uint8Array | string,
|
|
609
|
+
makeFeedWriter(topic: Topic | Uint8Array | string, signer?: PrivateKey | Uint8Array | string, requestOptions?: BeeRequestOptions): FeedWriter;
|
|
464
610
|
fetchLatestFeedUpdate(topic: Topic | Uint8Array | string, owner: EthAddress | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<FeedPayloadResult>;
|
|
465
611
|
/**
|
|
466
612
|
* Returns an object for reading single owner chunks
|
|
467
613
|
*
|
|
468
614
|
* @param ownerAddress The ethereum address of the owner
|
|
469
|
-
* @param
|
|
615
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
470
616
|
* @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)
|
|
471
617
|
*/
|
|
472
|
-
makeSOCReader(ownerAddress: EthAddress | Uint8Array | string,
|
|
618
|
+
makeSOCReader(ownerAddress: EthAddress | Uint8Array | string, requestOptions?: BeeRequestOptions): SOCReader;
|
|
473
619
|
/**
|
|
474
620
|
* Returns an object for reading and writing single owner chunks
|
|
475
621
|
*
|
|
476
622
|
* @param signer The signer's private key or a Signer instance that can sign data
|
|
477
|
-
* @param
|
|
623
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
478
624
|
* @see [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks)
|
|
479
625
|
*/
|
|
480
|
-
makeSOCWriter(signer?: PrivateKey | Uint8Array | string,
|
|
481
|
-
createEnvelope(postageBatchId: BatchId | Uint8Array | string, reference: Reference | Uint8Array | string, options?: BeeRequestOptions): Promise<EnvelopeWithBatchId>;
|
|
626
|
+
makeSOCWriter(signer?: PrivateKey | Uint8Array | string, requestOptions?: BeeRequestOptions): SOCWriter;
|
|
482
627
|
/**
|
|
483
|
-
*
|
|
628
|
+
* Creates the postage batch signature for a specific chunk address.
|
|
629
|
+
*
|
|
630
|
+
* This is for advanced usage, where a pre-signed chunk can be uploaded
|
|
631
|
+
* through a different Bee node.
|
|
632
|
+
*
|
|
633
|
+
* @param postageBatchId
|
|
634
|
+
* @param reference
|
|
635
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
636
|
+
*
|
|
637
|
+
* @example
|
|
638
|
+
* const envelope = await bee.createEnvelope(batchId, chunk.address)
|
|
639
|
+
* await bee.uploadChunk(envelope, chunk)
|
|
640
|
+
*
|
|
641
|
+
* @returns
|
|
484
642
|
*/
|
|
485
|
-
|
|
643
|
+
createEnvelope(postageBatchId: BatchId | Uint8Array | string, reference: Reference | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<EnvelopeWithBatchId>;
|
|
486
644
|
/**
|
|
487
|
-
*
|
|
645
|
+
* Gets reserve commitment hash duration seconds.
|
|
488
646
|
*
|
|
489
|
-
*
|
|
647
|
+
* To be able to participe in the storage incentives and not get frozen, this should
|
|
648
|
+
* ideally run under 5 minutes.
|
|
649
|
+
*
|
|
650
|
+
* This is a CPU intensice operation, as roughly 2^22 chunks are hashed in the process.
|
|
651
|
+
*
|
|
652
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
653
|
+
*
|
|
654
|
+
* @example
|
|
655
|
+
* const addresses = await bee.getNodeAddresses()
|
|
656
|
+
* const topology = await bee.getTopology()
|
|
657
|
+
* const result = await bee.rchash(topology.depth, addresses.overlay.toHex(), addresses.overlay.toHex())
|
|
658
|
+
* // result is a number of seconds
|
|
659
|
+
*/
|
|
660
|
+
rchash(depth: number, anchor1: string, anchor2: string, requestOptions?: BeeRequestOptions): Promise<number>;
|
|
661
|
+
/**
|
|
662
|
+
* Pings the Bee node to see if there is a live Bee node on the given URL.
|
|
663
|
+
*
|
|
664
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
490
665
|
* @throws If connection was not successful throw error
|
|
491
666
|
*/
|
|
492
|
-
checkConnection(
|
|
667
|
+
checkConnection(requestOptions?: BeeRequestOptions): Promise<void> | never;
|
|
493
668
|
/**
|
|
494
|
-
*
|
|
669
|
+
* Pings the Bee node to see if there is a live Bee node on the given URL.
|
|
495
670
|
*
|
|
496
|
-
* @param
|
|
671
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
497
672
|
* @returns true if successful, false on error
|
|
498
673
|
*/
|
|
499
|
-
isConnected(
|
|
674
|
+
isConnected(requestOptions?: BeeRequestOptions): Promise<boolean>;
|
|
500
675
|
/**
|
|
501
676
|
* Checks the `/gateway` endpoint to see if the remote API is a gateway.
|
|
502
677
|
*
|
|
503
678
|
* Do note that this is not a standard way to check for gateway nodes,
|
|
504
679
|
* but some of the gateway tooling expose this endpoint.
|
|
505
680
|
*
|
|
506
|
-
* @param
|
|
681
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
507
682
|
*/
|
|
508
|
-
isGateway(
|
|
509
|
-
getNodeAddresses(options?: BeeRequestOptions): Promise<NodeAddresses>;
|
|
510
|
-
getBlocklist(options?: BeeRequestOptions): Promise<Peer[]>;
|
|
683
|
+
isGateway(requestOptions?: BeeRequestOptions): Promise<boolean>;
|
|
511
684
|
/**
|
|
512
|
-
*
|
|
685
|
+
* Fetches the overlay, underlay, Ethereum, and other addresses of the Bee node.
|
|
686
|
+
*
|
|
687
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
688
|
+
* @returns
|
|
689
|
+
*/
|
|
690
|
+
getNodeAddresses(requestOptions?: BeeRequestOptions): Promise<NodeAddresses>;
|
|
691
|
+
/**
|
|
692
|
+
* Fetches the list of blocked peers for this node.
|
|
693
|
+
*
|
|
694
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
695
|
+
* @returns
|
|
696
|
+
*/
|
|
697
|
+
getBlocklist(requestOptions?: BeeRequestOptions): Promise<Peer[]>;
|
|
698
|
+
/**
|
|
699
|
+
* Gets list of peers for this node.
|
|
700
|
+
*
|
|
701
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
702
|
+
*/
|
|
703
|
+
getPeers(requestOptions?: BeeRequestOptions): Promise<Peer[]>;
|
|
704
|
+
/**
|
|
705
|
+
* Disconnects from a specific peer.
|
|
706
|
+
*
|
|
707
|
+
* @param peer Overlay address of the peer to be removed.
|
|
708
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
709
|
+
* @returns
|
|
710
|
+
*/
|
|
711
|
+
removePeer(peer: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<RemovePeerResponse>;
|
|
712
|
+
/**
|
|
713
|
+
* Fetches topology and connectivity information of the Bee node.
|
|
714
|
+
*
|
|
715
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
716
|
+
* @returns
|
|
513
717
|
*/
|
|
514
|
-
|
|
515
|
-
removePeer(peer: PeerAddress | string, options?: BeeRequestOptions): Promise<RemovePeerResponse>;
|
|
516
|
-
getTopology(options?: BeeRequestOptions): Promise<Topology>;
|
|
517
|
-
pingPeer(peer: PeerAddress | string, options?: BeeRequestOptions): Promise<PingResponse>;
|
|
718
|
+
getTopology(requestOptions?: BeeRequestOptions): Promise<Topology>;
|
|
518
719
|
/**
|
|
519
|
-
*
|
|
720
|
+
* Pings a specific peer to check its availability.
|
|
721
|
+
*
|
|
722
|
+
* @param peer Overlay address of the peer to be pinged.
|
|
723
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
724
|
+
* @returns
|
|
520
725
|
*/
|
|
521
|
-
|
|
726
|
+
pingPeer(peer: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<PingResponse>;
|
|
522
727
|
/**
|
|
523
|
-
*
|
|
728
|
+
* Gets the SWAP balances with all known peers including prepaid services.
|
|
729
|
+
*
|
|
730
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
731
|
+
*
|
|
732
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
733
|
+
*/
|
|
734
|
+
getAllBalances(requestOptions?: BeeRequestOptions): Promise<BalanceResponse>;
|
|
735
|
+
/**
|
|
736
|
+
* Gets the SWAP balances for a specific peer including prepaid services.
|
|
524
737
|
*
|
|
525
738
|
* @param address Swarm address of peer
|
|
739
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
526
740
|
*/
|
|
527
|
-
getPeerBalance(address: PeerAddress | string,
|
|
741
|
+
getPeerBalance(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<PeerBalance>;
|
|
528
742
|
/**
|
|
529
|
-
*
|
|
743
|
+
* Gets the past due consumption balances for all known peers.
|
|
744
|
+
*
|
|
745
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
746
|
+
*
|
|
747
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
530
748
|
*/
|
|
531
|
-
getPastDueConsumptionBalances(
|
|
749
|
+
getPastDueConsumptionBalances(requestOptions?: BeeRequestOptions): Promise<BalanceResponse>;
|
|
532
750
|
/**
|
|
533
|
-
*
|
|
751
|
+
* Gets the past due consumption balance for a specific peer.
|
|
752
|
+
*
|
|
753
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
534
754
|
*
|
|
535
755
|
* @param address Swarm address of peer
|
|
756
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
536
757
|
*/
|
|
537
|
-
getPastDueConsumptionPeerBalance(address: PeerAddress | string,
|
|
758
|
+
getPastDueConsumptionPeerBalance(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<PeerBalance>;
|
|
538
759
|
/**
|
|
539
|
-
*
|
|
760
|
+
* Gets the address of the deloyed chequebook.
|
|
540
761
|
*
|
|
541
|
-
*
|
|
542
|
-
* https://github.com/ethersphere/bee/issues/1443
|
|
762
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
543
763
|
*/
|
|
544
|
-
getChequebookAddress(
|
|
764
|
+
getChequebookAddress(requestOptions?: BeeRequestOptions): Promise<ChequebookAddressResponse>;
|
|
545
765
|
/**
|
|
546
|
-
*
|
|
766
|
+
* Gets the balance of the chequebook.
|
|
767
|
+
*
|
|
768
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
547
769
|
*/
|
|
548
|
-
getChequebookBalance(
|
|
770
|
+
getChequebookBalance(requestOptions?: BeeRequestOptions): Promise<ChequebookBalanceResponse>;
|
|
549
771
|
/**
|
|
550
|
-
*
|
|
772
|
+
* Gets the last cheques for all peers.
|
|
773
|
+
*
|
|
774
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
775
|
+
*
|
|
776
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
551
777
|
*/
|
|
552
|
-
getLastCheques(
|
|
778
|
+
getLastCheques(requestOptions?: BeeRequestOptions): Promise<LastChequesResponse>;
|
|
553
779
|
/**
|
|
554
|
-
*
|
|
780
|
+
* Gets the last cheques for a specific peer.
|
|
555
781
|
*
|
|
556
|
-
*
|
|
782
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
783
|
+
*
|
|
784
|
+
* @param address Overlay address of peer.
|
|
785
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
557
786
|
*/
|
|
558
|
-
getLastChequesForPeer(address: PeerAddress | string,
|
|
787
|
+
getLastChequesForPeer(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<LastChequesForPeerResponse>;
|
|
559
788
|
/**
|
|
560
|
-
*
|
|
789
|
+
* Gets the last cashout action for a specific peer.
|
|
561
790
|
*
|
|
562
|
-
*
|
|
791
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
792
|
+
*
|
|
793
|
+
* @param address Overlay address of peer.
|
|
794
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
563
795
|
*/
|
|
564
|
-
getLastCashoutAction(address: PeerAddress | string,
|
|
796
|
+
getLastCashoutAction(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<LastCashoutActionResponse>;
|
|
565
797
|
/**
|
|
566
|
-
*
|
|
798
|
+
* Cashes out the last cheque for a specific peer.
|
|
799
|
+
*
|
|
800
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
567
801
|
*
|
|
568
802
|
* @param address Swarm address of peer
|
|
569
803
|
* @param options
|
|
570
804
|
* @param options.gasPrice Gas price for the cashout transaction in WEI
|
|
571
805
|
* @param options.gasLimit Gas limit for the cashout transaction in WEI
|
|
806
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
572
807
|
*/
|
|
573
808
|
cashoutLastCheque(address: PeerAddress | string, options?: TransactionOptions, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
574
809
|
/**
|
|
575
|
-
*
|
|
810
|
+
* Deposits tokens from the node wallet into the chequebook.
|
|
576
811
|
*
|
|
577
812
|
* @param amount Amount of tokens to deposit (must be positive integer)
|
|
578
813
|
* @param gasPrice Gas Price in WEI for the transaction call
|
|
814
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
815
|
+
*
|
|
579
816
|
* @return string Hash of the transaction
|
|
580
817
|
* @deprecated Use `depositBZZToChequebook` instead.
|
|
581
818
|
*/
|
|
582
|
-
depositTokens(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint,
|
|
819
|
+
depositTokens(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
583
820
|
/**
|
|
584
|
-
*
|
|
821
|
+
* Deposits tokens from the node wallet into the chequebook.
|
|
585
822
|
*
|
|
586
823
|
* @param amount Amount of tokens to deposit (must be positive integer)
|
|
587
824
|
* @param gasPrice Gas Price in WEI for the transaction call
|
|
825
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
826
|
+
*
|
|
588
827
|
* @return string Hash of the transaction
|
|
589
828
|
*/
|
|
590
|
-
depositBZZToChequebook(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint,
|
|
829
|
+
depositBZZToChequebook(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
591
830
|
/**
|
|
592
|
-
*
|
|
831
|
+
* Withdraws tokens from the chequebook to the node wallet.
|
|
593
832
|
*
|
|
594
833
|
* @param amount Amount of tokens to withdraw (must be positive integer)
|
|
595
834
|
* @param gasPrice Gas Price in WEI for the transaction call
|
|
835
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
836
|
+
*
|
|
596
837
|
* @return string Hash of the transaction
|
|
597
838
|
* @deprecated Use `withdrawBZZFromChequebook` instead.
|
|
598
839
|
*/
|
|
599
|
-
withdrawTokens(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint,
|
|
840
|
+
withdrawTokens(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
600
841
|
/**
|
|
601
|
-
*
|
|
842
|
+
* Withdraws tokens from the chequebook to the node wallet.
|
|
602
843
|
*
|
|
603
|
-
* @param amount
|
|
604
|
-
* @param gasPrice Gas Price in WEI for the transaction call
|
|
605
|
-
* @return
|
|
844
|
+
* @param amount Amount of BZZ tokens to withdraw. If not providing a `BZZ` instance, the amount is denoted in PLUR.
|
|
845
|
+
* @param gasPrice Gas Price in WEI for the transaction call.
|
|
846
|
+
* @return Transaction ID
|
|
847
|
+
*/
|
|
848
|
+
withdrawBZZFromChequebook(amount: BZZ | NumberString | string | bigint, gasPrice?: NumberString | string | bigint, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
849
|
+
/**
|
|
850
|
+
* Withdraws BZZ from the node wallet (not chequebook) to a whitelisted external wallet address.
|
|
851
|
+
*
|
|
852
|
+
* @param amount Amount of BZZ tokens to withdraw. If not providing a `BZZ` instance, the amount is denoted in PLUR.
|
|
853
|
+
* @param address
|
|
854
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
855
|
+
* @return Transaction ID
|
|
856
|
+
*/
|
|
857
|
+
withdrawBZZToExternalWallet(amount: BZZ | NumberString | string | bigint, address: EthAddress | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
858
|
+
/**
|
|
859
|
+
* Withdraws DAI from the node wallet (not chequebook) to a whitelisted external wallet address.
|
|
860
|
+
*
|
|
861
|
+
* @param amount Amount of DAI tokens to withdraw. If not providing a `DAI` instance, the amount is denoted in wei.
|
|
862
|
+
* @param address
|
|
863
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
864
|
+
* @return Transaction ID
|
|
606
865
|
*/
|
|
607
|
-
|
|
608
|
-
withdrawBZZToExternalWallet(amount: BZZ | NumberString | string | bigint, address: EthAddress | Uint8Array | string, options?: BeeRequestOptions): Promise<TransactionId>;
|
|
609
|
-
withdrawDAIToExternalWallet(amount: DAI | NumberString | string | bigint, address: EthAddress | Uint8Array | string, options?: BeeRequestOptions): Promise<TransactionId>;
|
|
866
|
+
withdrawDAIToExternalWallet(amount: DAI | NumberString | string | bigint, address: EthAddress | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
610
867
|
/**
|
|
611
|
-
*
|
|
868
|
+
* Gets the amount of sent and received micropayments from settlements with a peer.
|
|
869
|
+
*
|
|
870
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
612
871
|
*
|
|
613
872
|
* @param address Swarm address of peer
|
|
873
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
614
874
|
*/
|
|
615
|
-
getSettlements(address: PeerAddress | string,
|
|
875
|
+
getSettlements(address: PeerAddress | string, requestOptions?: BeeRequestOptions): Promise<Settlements>;
|
|
616
876
|
/**
|
|
617
|
-
*
|
|
877
|
+
* Gets settlements with all known peers and total amount sent or received.
|
|
878
|
+
*
|
|
879
|
+
* This is related to the bandwidth incentives and the chequebook.
|
|
880
|
+
*
|
|
881
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
618
882
|
*/
|
|
619
|
-
getAllSettlements(
|
|
883
|
+
getAllSettlements(requestOptions?: BeeRequestOptions): Promise<AllSettlements>;
|
|
620
884
|
/**
|
|
621
|
-
*
|
|
885
|
+
* Gets the general status of the node.
|
|
886
|
+
*
|
|
887
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
622
888
|
*/
|
|
623
|
-
getStatus(
|
|
889
|
+
getStatus(requestOptions?: BeeRequestOptions): Promise<DebugStatus>;
|
|
624
890
|
/**
|
|
625
|
-
*
|
|
891
|
+
* Gets the health of the node.
|
|
892
|
+
*
|
|
893
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
626
894
|
*/
|
|
627
|
-
getHealth(
|
|
895
|
+
getHealth(requestOptions?: BeeRequestOptions): Promise<Health>;
|
|
628
896
|
/**
|
|
629
|
-
*
|
|
897
|
+
* Gets the readiness status of the node.
|
|
898
|
+
*
|
|
899
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
630
900
|
*/
|
|
631
|
-
getReadiness(
|
|
901
|
+
getReadiness(requestOptions?: BeeRequestOptions): Promise<Readiness>;
|
|
632
902
|
/**
|
|
633
|
-
* Get mode information of node
|
|
903
|
+
* Get mode information of node.
|
|
904
|
+
*
|
|
905
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
634
906
|
*/
|
|
635
|
-
getNodeInfo(
|
|
907
|
+
getNodeInfo(requestOptions?: BeeRequestOptions): Promise<NodeInfo>;
|
|
636
908
|
/**
|
|
637
909
|
* Connects to a node and checks if its version matches with the one that bee-js supports.
|
|
638
910
|
*
|
|
639
|
-
* @param
|
|
911
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
640
912
|
*/
|
|
641
|
-
isSupportedExactVersion(
|
|
913
|
+
isSupportedExactVersion(requestOptions?: BeeRequestOptions): Promise<boolean> | never;
|
|
642
914
|
/**
|
|
643
915
|
*
|
|
644
916
|
* Connects to a node and checks if its Main API version matches with the one that bee-js supports.
|
|
645
917
|
*
|
|
646
918
|
* This should be the main way how to check compatibility for your app and Bee node.
|
|
647
919
|
*
|
|
648
|
-
* @param
|
|
920
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
649
921
|
*/
|
|
650
|
-
isSupportedApiVersion(
|
|
922
|
+
isSupportedApiVersion(requestOptions?: BeeRequestOptions): Promise<boolean> | never;
|
|
651
923
|
/**
|
|
652
924
|
* Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)
|
|
653
925
|
* and versions that bee-js supports (properties prefixed with `supported*`).
|
|
654
926
|
*
|
|
655
|
-
* @param
|
|
927
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
656
928
|
*/
|
|
657
|
-
getVersions(
|
|
929
|
+
getVersions(requestOptions?: BeeRequestOptions): Promise<BeeVersions> | never;
|
|
658
930
|
/**
|
|
659
|
-
* Get reserve state
|
|
931
|
+
* Get reserve state.
|
|
932
|
+
*
|
|
933
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
660
934
|
*/
|
|
661
|
-
getReserveState(
|
|
935
|
+
getReserveState(requestOptions?: BeeRequestOptions): Promise<ReserveState>;
|
|
662
936
|
/**
|
|
663
|
-
*
|
|
937
|
+
* Gets chain state.
|
|
938
|
+
*
|
|
939
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
664
940
|
*/
|
|
665
|
-
getChainState(
|
|
941
|
+
getChainState(requestOptions?: BeeRequestOptions): Promise<ChainState>;
|
|
666
942
|
/**
|
|
667
|
-
*
|
|
943
|
+
* Gets DAI and BZZ balances of the Bee node wallet.
|
|
668
944
|
*
|
|
669
|
-
* @param
|
|
945
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
670
946
|
*/
|
|
671
|
-
getWalletBalance(
|
|
947
|
+
getWalletBalance(requestOptions?: BeeRequestOptions): Promise<WalletBalance>;
|
|
672
948
|
/**
|
|
673
|
-
* Creates new postage batch
|
|
949
|
+
* Creates a new postage batch, spending BZZ tokens from the node wallet.
|
|
674
950
|
*
|
|
675
|
-
*
|
|
676
|
-
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction#keep-your-data-alive).
|
|
951
|
+
* Use {@link buyStorage} for a more convenient way to create postage batch.
|
|
677
952
|
*
|
|
678
|
-
*
|
|
953
|
+
* For better understanding what each parameter means and what the optimal values are, see
|
|
954
|
+
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction#keep-your-data-alive).
|
|
679
955
|
*
|
|
680
|
-
* @param amount
|
|
681
|
-
* @param depth
|
|
956
|
+
* @param amount TTL parameter - 1 day at the minimum of 24,000 storage price requires an amount of 414,720,000.
|
|
957
|
+
* @param depth Capacity parameter - 17..255 - depth 17 provides 512MB of theoretical capacity, 18 provides 1GB, 19 provides 2GB, etc.
|
|
682
958
|
* @param options Options for creation of postage batch
|
|
683
|
-
* @
|
|
684
|
-
* @throws TypeError if non-integer value is passed to amount or depth
|
|
959
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
685
960
|
*
|
|
686
961
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
687
962
|
* @see [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post)
|
|
688
963
|
*/
|
|
689
964
|
createPostageBatch(amount: NumberString | string | bigint, depth: number, options?: PostageBatchOptions, requestOptions?: BeeRequestOptions): Promise<BatchId>;
|
|
690
|
-
buyStorage(size: Size, duration: Duration, options?: PostageBatchOptions, requestOptions?: BeeRequestOptions): Promise<BatchId>;
|
|
691
|
-
getStorageCost(size: Size, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
|
|
692
|
-
extendStorageSize(postageBatchId: BatchId | Uint8Array | string, size: Size, options?: BeeRequestOptions): Promise<BatchId>;
|
|
693
|
-
extendStorageDuration(postageBatchId: BatchId | Uint8Array | string, duration: Duration, options?: BeeRequestOptions): Promise<BatchId>;
|
|
694
|
-
getExtensionCost(postageBatchId: BatchId | Uint8Array | string, size: Size, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
|
|
695
|
-
getSizeExtensionCost(postageBatchId: BatchId | Uint8Array | string, size: Size, options?: BeeRequestOptions): Promise<BZZ>;
|
|
696
|
-
getDurationExtensionCost(postageBatchId: BatchId | Uint8Array | string, duration: Duration, options?: BeeRequestOptions): Promise<BZZ>;
|
|
697
965
|
/**
|
|
698
|
-
*
|
|
966
|
+
* A more convenient method to create a postage batch, which is analogous
|
|
967
|
+
* to buying storage for a certain size and duration on the Swarm network.
|
|
968
|
+
*
|
|
969
|
+
* Use {@link getStorageCost} to calculate the cost of creating a postage batch.
|
|
970
|
+
*
|
|
971
|
+
* For the low level API, use {@link createPostageBatch}.
|
|
972
|
+
*
|
|
973
|
+
* @example const batchId = await bee.buyStorage(Size.fromGigabytes(8), Duration.fromDays(31))
|
|
974
|
+
|
|
975
|
+
* @param size
|
|
976
|
+
* @param duration
|
|
977
|
+
* @param options
|
|
978
|
+
* @param requestOptions
|
|
979
|
+
* @param encryption
|
|
980
|
+
* @param erasureCodeLevel
|
|
981
|
+
* @returns
|
|
982
|
+
*/
|
|
983
|
+
buyStorage(size: Size, duration: Duration, options?: PostageBatchOptions, requestOptions?: BeeRequestOptions, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): Promise<BatchId>;
|
|
984
|
+
/**
|
|
985
|
+
* Calculates the estimated BZZ cost for creating a postage batch for the given size and duration.
|
|
986
|
+
*
|
|
987
|
+
* Use {@link buyStorage} to create a postage batch with the calculated cost.
|
|
988
|
+
*
|
|
989
|
+
* @example const bzz = await bee.getStorageCost(Size.fromGigabytes(1), Duration.fromDays(30))
|
|
990
|
+
*
|
|
991
|
+
* @param size Size of the data to be stored.
|
|
992
|
+
* @param duration Duration for which the data should be stored.
|
|
993
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
994
|
+
* @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.
|
|
995
|
+
* @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.
|
|
996
|
+
* @returns
|
|
997
|
+
*/
|
|
998
|
+
getStorageCost(size: Size, duration: Duration, requestOptions?: BeeRequestOptions, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): Promise<BZZ>;
|
|
999
|
+
/**
|
|
1000
|
+
* Extends the storage of a postage batch by either increasing its size, duration or both.
|
|
1001
|
+
*
|
|
1002
|
+
* The size is ABSOLUTE, while the duration is RELATIVE to the current duration of the postage batch.
|
|
1003
|
+
*
|
|
1004
|
+
* Use {@link getExtensionCost} to calculate the cost of extending the storage.
|
|
1005
|
+
*
|
|
1006
|
+
* @example
|
|
1007
|
+
* // Increases the size to 8GB (unless it is already at 8GB or higher)
|
|
1008
|
+
* // and extends the duration by 30 days (regardless of the current duration).
|
|
1009
|
+
* await bee.extendStorage(batchId, Size.fromGigabytes(8), Duration.fromDays(30))
|
|
1010
|
+
*
|
|
1011
|
+
* @example
|
|
1012
|
+
* // To increase the duration to a desired date, pass a second parameter to `Duration.fromEndDate`.
|
|
1013
|
+
* // With the second parameter, the duration is set to the difference between the current end date and the desired end date.
|
|
1014
|
+
* const oneMonth = new Date(Date.now() + Dates.days(31))
|
|
1015
|
+
* const batch = await bee.getPostageBatch(batchId)
|
|
1016
|
+
* await bee.extendStorage(batchId, Size.fromGigabytes(8), Duration.fromEndDate(oneMonth, batch.duration.toEndDate()))
|
|
1017
|
+
*
|
|
1018
|
+
* @param postageBatchId Batch ID of the postage batch to extend.
|
|
1019
|
+
* @param size Absolute size to extend the postage batch to.
|
|
1020
|
+
* @param duration Relative duration to extend the postage batch by.
|
|
1021
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
1022
|
+
* @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.
|
|
1023
|
+
* @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.
|
|
1024
|
+
* @returns
|
|
1025
|
+
*/
|
|
1026
|
+
extendStorage(postageBatchId: BatchId | Uint8Array | string, size: Size, duration: Duration, requestOptions?: BeeRequestOptions, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): Promise<BatchId>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Extends the storage size of a postage batch by increasing its depth.
|
|
1029
|
+
*
|
|
1030
|
+
* Use {@link getSizeExtensionCost} to calculate the cost of extending the size.
|
|
1031
|
+
* Use {@link extendStorage} to extend both size and duration.
|
|
1032
|
+
*
|
|
1033
|
+
* @param postageBatchId
|
|
1034
|
+
* @param size Absolute size to extend the postage batch to.
|
|
1035
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
1036
|
+
* @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.
|
|
1037
|
+
* @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.
|
|
1038
|
+
* @returns
|
|
1039
|
+
*/
|
|
1040
|
+
extendStorageSize(postageBatchId: BatchId | Uint8Array | string, size: Size, requestOptions?: BeeRequestOptions, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): Promise<BatchId>;
|
|
1041
|
+
/**
|
|
1042
|
+
* Extends the duration of a postage batch.
|
|
1043
|
+
*
|
|
1044
|
+
* Use {@link getDurationExtensionCost} to calculate the cost of extending the duration.
|
|
1045
|
+
* Use {@link extendStorage} to extend both size and duration.
|
|
1046
|
+
*
|
|
1047
|
+
* @param postageBatchId
|
|
1048
|
+
* @param duration Relative duration to extend the postage batch by.
|
|
1049
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
1050
|
+
* @returns
|
|
1051
|
+
*/
|
|
1052
|
+
extendStorageDuration(postageBatchId: BatchId | Uint8Array | string, duration: Duration, requestOptions?: BeeRequestOptions): Promise<BatchId>;
|
|
1053
|
+
/**
|
|
1054
|
+
* Calculates the cost of extending both the duration and the capacity of a postage batch.
|
|
1055
|
+
*
|
|
1056
|
+
* The size is ABSOLUTE, while the duration is RELATIVE to the current duration of the postage batch.
|
|
1057
|
+
*
|
|
1058
|
+
* Use {@link extendStorage} to extend the the duration and capacity of a postage batch.
|
|
1059
|
+
*
|
|
1060
|
+
* @param postageBatchId
|
|
1061
|
+
* @param size Absolute size to extend the postage batch to.
|
|
1062
|
+
* @param duration Relative duration to extend the postage batch by.
|
|
1063
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
1064
|
+
* @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.
|
|
1065
|
+
* @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.
|
|
1066
|
+
* @returns
|
|
1067
|
+
*/
|
|
1068
|
+
getExtensionCost(postageBatchId: BatchId | Uint8Array | string, size: Size, duration: Duration, requestOptions?: BeeRequestOptions, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): Promise<BZZ>;
|
|
1069
|
+
/**
|
|
1070
|
+
* Calculates the cost of extending the size of a postage batch.
|
|
1071
|
+
*
|
|
1072
|
+
* The size is ABSOLUTE, so if the postage batch already equals or is greater than the given size,
|
|
1073
|
+
* the cost will be zero.
|
|
1074
|
+
*
|
|
1075
|
+
* Use {@link extendStorageSize} to extend the size of a postage batch.
|
|
1076
|
+
*
|
|
1077
|
+
* Use {@link getExtensionCost} to get the cost of extending both size and duration.
|
|
1078
|
+
* Use {@link getDurationExtensionCost} to get the cost of extending only the duration.
|
|
1079
|
+
*
|
|
1080
|
+
* @param postageBatchId
|
|
1081
|
+
* @param size
|
|
1082
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
1083
|
+
* @param encryption Assume the future uploaded data is encrypted, which skews the capacity of the postage batch.
|
|
1084
|
+
* @param erasureCodeLevel Assume the future uploaded data is erasure coded, which skews the capacity of the postage batch.
|
|
1085
|
+
* @returns
|
|
1086
|
+
*/
|
|
1087
|
+
getSizeExtensionCost(postageBatchId: BatchId | Uint8Array | string, size: Size, requestOptions?: BeeRequestOptions, encryption?: boolean, erasureCodeLevel?: RedundancyLevel): Promise<BZZ>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Calculates the cost of extending the duration of a postage batch.
|
|
1090
|
+
*
|
|
1091
|
+
* The duration is RELATIVE to the current duration of the postage batch,
|
|
1092
|
+
* e.g. specifying `Duration.fromDays(30)` will extend the current duration by 30 days,
|
|
1093
|
+
* regardless of the current duration.
|
|
1094
|
+
*
|
|
1095
|
+
* Use {@link extendStorageDuration} to extend the duration of a postage batch.
|
|
1096
|
+
*
|
|
1097
|
+
* Use {@link getExtensionCost} to get the cost of extending both size and duration.
|
|
1098
|
+
* Use {@link getSizeExtensionCost} to get the cost of extending only the size.
|
|
1099
|
+
*
|
|
1100
|
+
* @param postageBatchId
|
|
1101
|
+
* @param duration
|
|
1102
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
1103
|
+
* @returns
|
|
1104
|
+
*/
|
|
1105
|
+
getDurationExtensionCost(postageBatchId: BatchId | Uint8Array | string, duration: Duration, requestOptions?: BeeRequestOptions): Promise<BZZ>;
|
|
1106
|
+
/**
|
|
1107
|
+
* Increases the duration of a postage batch by increasing its amount.
|
|
1108
|
+
*
|
|
1109
|
+
* For a more convenient way to extend the postage batch, refer to the methods below.
|
|
1110
|
+
*
|
|
1111
|
+
* Use {@link getDurationExtensionCost}, {@link getSizeExtensionCost} or {@link getExtensionCost}
|
|
1112
|
+
* to calculate the costs of extending the postage batch properties.
|
|
1113
|
+
*
|
|
1114
|
+
* Use {@link extendStorageDuration}, {@link extendStorageSize} or {@link extendStorage}
|
|
1115
|
+
* to extend the postage batch properties.
|
|
699
1116
|
*
|
|
700
1117
|
* For better understanding what each parameter means and what are the optimal values please see
|
|
701
1118
|
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).
|
|
702
1119
|
*
|
|
703
1120
|
* @param postageBatchId Batch ID
|
|
704
1121
|
* @param amount Amount to be added to the batch
|
|
705
|
-
* @param
|
|
1122
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
706
1123
|
*
|
|
707
1124
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
708
1125
|
* @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)
|
|
709
1126
|
*/
|
|
710
|
-
topUpBatch(postageBatchId: BatchId | Uint8Array | string, amount: NumberString | string | bigint,
|
|
1127
|
+
topUpBatch(postageBatchId: BatchId | Uint8Array | string, amount: NumberString | string | bigint, requestOptions?: BeeRequestOptions): Promise<BatchId>;
|
|
711
1128
|
/**
|
|
712
|
-
*
|
|
713
|
-
*
|
|
1129
|
+
* Dilutes a postage batch to extend its capacity by increasing its depth.
|
|
1130
|
+
*
|
|
1131
|
+
* This is a free operation, as for every depth increase, the capacity is doubled,
|
|
1132
|
+
* but the amount (duration) is halved.
|
|
1133
|
+
*
|
|
1134
|
+
* To increase the capacity of the postage batch while retaining the same amount (duration),
|
|
1135
|
+
* you need to top up the postage batch first using {@link topUpBatch}.
|
|
1136
|
+
*
|
|
1137
|
+
* For a more convenient way to extend the postage batch, refer to the methods below.
|
|
1138
|
+
*
|
|
1139
|
+
* Use {@link getDurationExtensionCost}, {@link getSizeExtensionCost} or {@link getExtensionCost}
|
|
1140
|
+
* to calculate the costs of extending the postage batch properties.
|
|
1141
|
+
*
|
|
1142
|
+
* Use {@link extendStorageDuration}, {@link extendStorageSize} or {@link extendStorage}
|
|
1143
|
+
* to extend the postage batch properties.
|
|
714
1144
|
*
|
|
715
1145
|
* For better understanding what each parameter means and what are the optimal values please see
|
|
716
1146
|
* [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive).
|
|
717
1147
|
*
|
|
718
1148
|
* @param postageBatchId Batch ID
|
|
719
1149
|
* @param depth Amount to be added to the batch
|
|
720
|
-
* @param
|
|
1150
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
721
1151
|
*
|
|
722
1152
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
723
1153
|
* @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)
|
|
724
1154
|
*/
|
|
725
|
-
diluteBatch(postageBatchId: BatchId | Uint8Array | string, depth: number,
|
|
1155
|
+
diluteBatch(postageBatchId: BatchId | Uint8Array | string, depth: number, requestOptions?: BeeRequestOptions): Promise<BatchId>;
|
|
726
1156
|
/**
|
|
727
|
-
*
|
|
1157
|
+
* Returns details for specific postage batch.
|
|
728
1158
|
*
|
|
729
1159
|
* @param postageBatchId Batch ID
|
|
1160
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
730
1161
|
*
|
|
731
1162
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
732
1163
|
* @see [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get)
|
|
733
1164
|
*/
|
|
734
|
-
getPostageBatch(postageBatchId: BatchId | Uint8Array | string,
|
|
1165
|
+
getPostageBatch(postageBatchId: BatchId | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<PostageBatch>;
|
|
735
1166
|
/**
|
|
736
1167
|
* Return detailed information related to buckets for specific postage batch.
|
|
737
1168
|
*
|
|
738
1169
|
* @param postageBatchId Batch ID
|
|
1170
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
739
1171
|
*
|
|
740
1172
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
741
1173
|
* @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)
|
|
742
1174
|
*/
|
|
743
|
-
getPostageBatchBuckets(postageBatchId: BatchId | Uint8Array | string,
|
|
1175
|
+
getPostageBatchBuckets(postageBatchId: BatchId | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<PostageBatchBuckets>;
|
|
744
1176
|
/**
|
|
745
|
-
*
|
|
1177
|
+
* Returns all postage batches that belongs to the node.
|
|
1178
|
+
*
|
|
1179
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
746
1180
|
*
|
|
747
1181
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
748
1182
|
* @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get)
|
|
749
1183
|
* @deprecated Use `getPostageBatches` instead
|
|
750
1184
|
*/
|
|
751
|
-
getAllPostageBatch(
|
|
1185
|
+
getAllPostageBatch(requestOptions?: BeeRequestOptions): Promise<PostageBatch[]>;
|
|
752
1186
|
/**
|
|
753
|
-
*
|
|
1187
|
+
* Returns all postage batches that are globally available on the Swarm network.
|
|
1188
|
+
*
|
|
1189
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
1190
|
+
*
|
|
754
1191
|
* @deprecated Use `getGlobalPostageBatches` instead
|
|
755
1192
|
*/
|
|
756
|
-
getAllGlobalPostageBatch(
|
|
1193
|
+
getAllGlobalPostageBatch(requestOptions?: BeeRequestOptions): Promise<GlobalPostageBatch[]>;
|
|
757
1194
|
/**
|
|
758
|
-
*
|
|
1195
|
+
* Returns all postage batches that belong to the node.
|
|
1196
|
+
*
|
|
1197
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
759
1198
|
*
|
|
760
1199
|
* @see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive)
|
|
761
1200
|
* @see [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get)
|
|
762
1201
|
*/
|
|
763
|
-
getPostageBatches(
|
|
1202
|
+
getPostageBatches(requestOptions?: BeeRequestOptions): Promise<PostageBatch[]>;
|
|
764
1203
|
/**
|
|
765
|
-
*
|
|
1204
|
+
* Returns all globally available postage batches.
|
|
1205
|
+
*
|
|
1206
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
766
1207
|
*/
|
|
767
|
-
getGlobalPostageBatches(
|
|
1208
|
+
getGlobalPostageBatches(requestOptions?: BeeRequestOptions): Promise<GlobalPostageBatch[]>;
|
|
768
1209
|
/**
|
|
769
|
-
*
|
|
1210
|
+
* Fetches the list of all current pending transactions for the Bee node.
|
|
1211
|
+
*
|
|
1212
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
770
1213
|
*/
|
|
771
|
-
getAllPendingTransactions(
|
|
1214
|
+
getAllPendingTransactions(requestOptions?: BeeRequestOptions): Promise<TransactionInfo[]>;
|
|
772
1215
|
/**
|
|
773
|
-
*
|
|
1216
|
+
* Fetches the transaction information for a specific transaction.
|
|
1217
|
+
*
|
|
774
1218
|
* @param transactionHash
|
|
1219
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
775
1220
|
*/
|
|
776
|
-
getPendingTransaction(transactionHash: TransactionId | Uint8Array | string,
|
|
1221
|
+
getPendingTransaction(transactionHash: TransactionId | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<TransactionInfo>;
|
|
777
1222
|
/**
|
|
778
|
-
*
|
|
779
|
-
*
|
|
1223
|
+
* Rebroadcasts already created transaction.
|
|
1224
|
+
*
|
|
1225
|
+
* This is mainly needed when the transaction falls off mempool or is not incorporated into any block.
|
|
780
1226
|
*
|
|
781
1227
|
* @param transactionHash
|
|
1228
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
782
1229
|
*/
|
|
783
|
-
rebroadcastPendingTransaction(transactionHash: TransactionId | Uint8Array | string,
|
|
1230
|
+
rebroadcastPendingTransaction(transactionHash: TransactionId | Uint8Array | string, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
784
1231
|
/**
|
|
785
|
-
* Cancels a currently pending transaction
|
|
1232
|
+
* Cancels a currently pending transaction.
|
|
1233
|
+
*
|
|
786
1234
|
* @param transactionHash
|
|
787
1235
|
* @param gasPrice
|
|
1236
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
788
1237
|
*/
|
|
789
|
-
cancelPendingTransaction(transactionHash: TransactionId | Uint8Array | string, gasPrice?: NumberString | string | bigint,
|
|
1238
|
+
cancelPendingTransaction(transactionHash: TransactionId | Uint8Array | string, gasPrice?: NumberString | string | bigint, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
790
1239
|
/**
|
|
791
|
-
* Gets the amount of staked BZZ
|
|
1240
|
+
* Gets the amount of staked BZZ.
|
|
792
1241
|
*
|
|
793
|
-
* @param
|
|
1242
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
794
1243
|
*/
|
|
795
|
-
getStake(
|
|
1244
|
+
getStake(requestOptions?: BeeRequestOptions): Promise<BZZ>;
|
|
796
1245
|
/**
|
|
797
1246
|
* Gets the amount of withdrawable staked BZZ.
|
|
798
1247
|
*
|
|
799
|
-
* @param
|
|
1248
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
800
1249
|
*/
|
|
801
|
-
getWithdrawableStake(
|
|
1250
|
+
getWithdrawableStake(requestOptions?: BeeRequestOptions): Promise<BZZ>;
|
|
802
1251
|
/**
|
|
803
|
-
* Withdraws
|
|
1252
|
+
* Withdraws all surplus staked BZZ to the node wallet.
|
|
804
1253
|
*
|
|
805
|
-
* Use the
|
|
1254
|
+
* Use the {@link getWithdrawableStake} method to check how much surplus stake is available.
|
|
806
1255
|
*
|
|
807
|
-
* @param
|
|
1256
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
808
1257
|
*/
|
|
809
|
-
withdrawSurplusStake(
|
|
1258
|
+
withdrawSurplusStake(requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
810
1259
|
/**
|
|
811
1260
|
* Withdraws all staked BZZ to the node wallet.
|
|
812
1261
|
*
|
|
813
1262
|
* **Only available when the staking contract is paused and is in the process of being migrated to a new contract!**
|
|
814
1263
|
*
|
|
815
|
-
* @param
|
|
1264
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
816
1265
|
*/
|
|
817
|
-
migrateStake(
|
|
1266
|
+
migrateStake(requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
818
1267
|
/**
|
|
819
1268
|
* Stakes the given amount of BZZ. Initial deposit must be at least 10 BZZ.
|
|
820
1269
|
*
|
|
821
1270
|
* Be aware that staked BZZ tokens can **not** be withdrawn.
|
|
822
1271
|
*
|
|
823
1272
|
* @param amount Amount of BZZ tokens to be staked. If not providing a `BZZ` instance, the amount is denoted in PLUR.
|
|
824
|
-
* @param options
|
|
1273
|
+
* @param options
|
|
1274
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
825
1275
|
*/
|
|
826
1276
|
depositStake(amount: BZZ | NumberString | string | bigint, options?: TransactionOptions, requestOptions?: BeeRequestOptions): Promise<TransactionId>;
|
|
827
1277
|
/**
|
|
828
|
-
* Gets current status of node in redistribution game
|
|
1278
|
+
* Gets current status of node in redistribution game.
|
|
1279
|
+
*
|
|
1280
|
+
* @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
|
|
829
1281
|
*
|
|
830
|
-
* @
|
|
1282
|
+
* @see [Bee API reference - `GET /redistributionstate`](https://docs.ethswarm.org/api/#tag/RedistributionState/paths/~1redistributionstate/get)
|
|
831
1283
|
*/
|
|
832
|
-
getRedistributionState(
|
|
1284
|
+
getRedistributionState(requestOptions?: BeeRequestOptions): Promise<RedistributionState>;
|
|
833
1285
|
private waitForUsablePostageStamp;
|
|
834
|
-
protected getRequestOptionsForCall(
|
|
1286
|
+
protected getRequestOptionsForCall(requestOptions?: BeeRequestOptions): BeeRequestOptions;
|
|
835
1287
|
}
|