@ethersphere/bee-js 5.1.1 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/223.index.browser.min.js +3 -0
- package/dist/223.index.browser.min.js.LICENSE.txt +1 -0
- package/dist/223.index.browser.min.js.map +1 -0
- package/dist/cjs/bee-debug.js +208 -312
- package/dist/cjs/bee.js +258 -353
- package/dist/cjs/chunk/signer.js +11 -22
- package/dist/cjs/chunk/soc.js +33 -50
- package/dist/cjs/chunk/span.js +1 -1
- package/dist/cjs/feed/index.js +50 -65
- package/dist/cjs/feed/json.js +8 -21
- package/dist/cjs/feed/retrievable.js +14 -27
- package/dist/cjs/modules/bytes.js +25 -37
- package/dist/cjs/modules/bzz.js +63 -68
- package/dist/cjs/modules/chunk.js +17 -27
- package/dist/cjs/modules/debug/balance.js +24 -41
- package/dist/cjs/modules/debug/chequebook.js +71 -96
- package/dist/cjs/modules/debug/chunk.js +13 -26
- package/dist/cjs/modules/debug/connectivity.js +32 -53
- package/dist/cjs/modules/debug/settlements.js +12 -25
- package/dist/cjs/modules/debug/stake.js +20 -33
- package/dist/cjs/modules/debug/stamps.js +45 -66
- package/dist/cjs/modules/debug/states.js +27 -40
- package/dist/cjs/modules/debug/status.js +53 -80
- package/dist/cjs/modules/debug/tag.js +6 -17
- package/dist/cjs/modules/debug/transactions.js +23 -40
- package/dist/cjs/modules/feed.js +17 -27
- package/dist/cjs/modules/pinning.js +24 -41
- package/dist/cjs/modules/pss.js +9 -20
- package/dist/cjs/modules/soc.js +12 -20
- package/dist/cjs/modules/status.js +4 -15
- package/dist/cjs/modules/stewardship.js +10 -23
- package/dist/cjs/modules/tag.js +28 -47
- package/dist/cjs/utils/collection.browser.js +4 -17
- package/dist/cjs/utils/collection.js +11 -22
- package/dist/cjs/utils/collection.node.js +42 -86
- package/dist/cjs/utils/data.browser.js +46 -59
- package/dist/cjs/utils/data.js +22 -35
- package/dist/cjs/utils/eth.js +31 -43
- package/dist/cjs/utils/file.js +9 -20
- package/dist/cjs/utils/headers.js +4 -4
- package/dist/cjs/utils/http.js +78 -93
- package/dist/cjs/utils/merge.js +1 -1
- package/dist/cjs/utils/sleep.js +2 -13
- package/dist/cjs/utils/type.js +14 -12
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.LICENSE.txt +1 -3
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee-debug.js +209 -450
- package/dist/mjs/bee.js +256 -491
- package/dist/mjs/chunk/bmt.js +4 -10
- package/dist/mjs/chunk/cac.js +0 -3
- package/dist/mjs/chunk/signer.js +12 -63
- package/dist/mjs/chunk/soc.js +33 -85
- package/dist/mjs/chunk/span.js +3 -6
- package/dist/mjs/feed/identifier.js +0 -6
- package/dist/mjs/feed/index.js +53 -97
- package/dist/mjs/feed/json.js +10 -49
- package/dist/mjs/feed/retrievable.js +13 -64
- package/dist/mjs/feed/topic.js +0 -2
- package/dist/mjs/index.js +1 -2
- package/dist/mjs/modules/bytes.js +25 -65
- package/dist/mjs/modules/bzz.js +64 -108
- package/dist/mjs/modules/chunk.js +17 -54
- package/dist/mjs/modules/debug/balance.js +24 -68
- package/dist/mjs/modules/debug/chequebook.js +75 -138
- package/dist/mjs/modules/debug/chunk.js +13 -51
- package/dist/mjs/modules/debug/connectivity.js +32 -76
- package/dist/mjs/modules/debug/settlements.js +12 -50
- package/dist/mjs/modules/debug/stake.js +20 -61
- package/dist/mjs/modules/debug/stamps.js +47 -94
- package/dist/mjs/modules/debug/states.js +25 -66
- package/dist/mjs/modules/debug/status.js +66 -125
- package/dist/mjs/modules/debug/tag.js +6 -41
- package/dist/mjs/modules/debug/transactions.js +25 -69
- package/dist/mjs/modules/feed.js +17 -57
- package/dist/mjs/modules/pinning.js +24 -68
- package/dist/mjs/modules/pss.js +11 -47
- package/dist/mjs/modules/soc.js +14 -48
- package/dist/mjs/modules/status.js +4 -39
- package/dist/mjs/modules/stewardship.js +10 -47
- package/dist/mjs/modules/tag.js +31 -78
- package/dist/mjs/types/debug.js +0 -1
- package/dist/mjs/types/index.js +0 -4
- package/dist/mjs/utils/bytes.js +6 -14
- package/dist/mjs/utils/collection.browser.js +4 -42
- package/dist/mjs/utils/collection.js +11 -57
- package/dist/mjs/utils/collection.node.js +42 -150
- package/dist/mjs/utils/data.browser.js +49 -94
- package/dist/mjs/utils/data.js +19 -62
- package/dist/mjs/utils/error.js +0 -5
- package/dist/mjs/utils/eth.js +37 -95
- package/dist/mjs/utils/file.js +11 -50
- package/dist/mjs/utils/hash.js +0 -1
- package/dist/mjs/utils/headers.js +6 -14
- package/dist/mjs/utils/hex.js +6 -25
- package/dist/mjs/utils/http.js +80 -138
- package/dist/mjs/utils/merge.js +3 -7
- package/dist/mjs/utils/pss.js +0 -2
- package/dist/mjs/utils/reference.js +2 -5
- package/dist/mjs/utils/sleep.js +2 -37
- package/dist/mjs/utils/stream.js +0 -23
- package/dist/mjs/utils/tar.js +2 -5
- package/dist/mjs/utils/type.js +18 -82
- package/dist/mjs/utils/uint64.js +0 -1
- package/dist/mjs/utils/url.js +2 -10
- package/dist/types/bee-debug.d.ts +2 -2
- package/dist/types/bee.d.ts +2 -26
- package/dist/types/chunk/cac.d.ts +1 -1
- package/dist/types/chunk/soc.d.ts +8 -7
- package/dist/types/feed/index.d.ts +9 -8
- package/dist/types/feed/type.d.ts +1 -1
- package/dist/types/modules/bytes.d.ts +6 -5
- package/dist/types/modules/bzz.d.ts +9 -8
- package/dist/types/modules/chunk.d.ts +5 -4
- package/dist/types/modules/debug/balance.d.ts +10 -9
- package/dist/types/modules/debug/chequebook.d.ts +18 -17
- package/dist/types/modules/debug/chunk.d.ts +6 -5
- package/dist/types/modules/debug/connectivity.d.ts +8 -7
- package/dist/types/modules/debug/settlements.d.ts +6 -5
- package/dist/types/modules/debug/stake.d.ts +5 -4
- package/dist/types/modules/debug/stamps.d.ts +8 -7
- package/dist/types/modules/debug/states.d.ts +8 -7
- package/dist/types/modules/debug/status.d.ts +15 -15
- package/dist/types/modules/debug/tag.d.ts +4 -3
- package/dist/types/modules/debug/transactions.d.ts +6 -5
- package/dist/types/modules/feed.d.ts +4 -3
- package/dist/types/modules/pinning.d.ts +8 -7
- package/dist/types/modules/pss.d.ts +4 -3
- package/dist/types/modules/soc.d.ts +3 -2
- package/dist/types/modules/status.d.ts +3 -3
- package/dist/types/modules/stewardship.d.ts +4 -3
- package/dist/types/modules/tag.d.ts +7 -6
- package/dist/types/types/debug.d.ts +1 -1
- package/dist/types/types/index.d.ts +30 -34
- package/dist/types/utils/eth.d.ts +3 -3
- package/dist/types/utils/hex.d.ts +2 -2
- package/dist/types/utils/http.d.ts +6 -6
- package/package.json +34 -39
- package/dist/cjs/types/ky-options.js +0 -8
- package/dist/cjs/types/ky-universal/common.js +0 -8
- package/dist/cjs/types/ky-universal/hooks.js +0 -8
- package/dist/cjs/types/ky-universal/retry.js +0 -8
- package/dist/mjs/types/ky-options.js +0 -7
- package/dist/mjs/types/ky-universal/common.js +0 -7
- package/dist/mjs/types/ky-universal/hooks.js +0 -7
- package/dist/mjs/types/ky-universal/retry.js +0 -7
- package/dist/types/types/ky-options.d.ts +0 -221
- package/dist/types/types/ky-universal/common.d.ts +0 -13
- package/dist/types/types/ky-universal/hooks.d.ts +0 -92
- package/dist/types/types/ky-universal/retry.d.ts +0 -38
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import type { BatchId, Data,
|
|
1
|
+
import type { BatchId, Data, ReferenceOrEns, UploadOptions } from '../types';
|
|
2
2
|
import { UploadResult } from '../types';
|
|
3
|
+
import type { Options as KyOptions } from 'ky';
|
|
3
4
|
/**
|
|
4
5
|
* Upload data to a Bee node
|
|
5
6
|
*
|
|
6
|
-
* @param
|
|
7
|
+
* @param kyOptions Ky Options for making requests
|
|
7
8
|
* @param data Data to be uploaded
|
|
8
9
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
9
10
|
* @param options Additional options like tag, encryption, pinning
|
|
10
11
|
*/
|
|
11
|
-
export declare function upload(
|
|
12
|
+
export declare function upload(kyOptions: KyOptions, data: string | Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<UploadResult>;
|
|
12
13
|
/**
|
|
13
14
|
* Download data as a byte array
|
|
14
15
|
*
|
|
15
16
|
* @param ky
|
|
16
17
|
* @param hash Bee content reference
|
|
17
18
|
*/
|
|
18
|
-
export declare function download(
|
|
19
|
+
export declare function download(kyOptions: KyOptions, hash: ReferenceOrEns): Promise<Data>;
|
|
19
20
|
/**
|
|
20
21
|
* Download data as a readable stream
|
|
21
22
|
*
|
|
22
23
|
* @param ky
|
|
23
24
|
* @param hash Bee content reference
|
|
24
25
|
*/
|
|
25
|
-
export declare function downloadReadable(
|
|
26
|
+
export declare function downloadReadable(kyOptions: KyOptions, hash: ReferenceOrEns): Promise<ReadableStream<Uint8Array>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BatchId, Collection, CollectionUploadOptions, Data, FileData, FileUploadOptions,
|
|
1
|
+
import { BatchId, Collection, CollectionUploadOptions, Data, FileData, FileUploadOptions, Readable, ReferenceOrEns, UploadResult } from '../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Upload single file
|
|
4
5
|
*
|
|
@@ -8,28 +9,28 @@ import { BatchId, Collection, CollectionUploadOptions, Data, FileData, FileUploa
|
|
|
8
9
|
* @param name Name that will be attached to the uploaded file. Wraps the data into manifest with set index document.
|
|
9
10
|
* @param options
|
|
10
11
|
*/
|
|
11
|
-
export declare function uploadFile(
|
|
12
|
+
export declare function uploadFile(kyOptions: KyOptions, data: string | Uint8Array | Readable | ArrayBuffer, postageBatchId: BatchId, name?: string, options?: FileUploadOptions): Promise<UploadResult>;
|
|
12
13
|
/**
|
|
13
14
|
* Download single file as a buffer
|
|
14
15
|
*
|
|
15
|
-
* @param
|
|
16
|
+
* @param kyOptions Ky Options for making requests
|
|
16
17
|
* @param hash Bee file or collection hash
|
|
17
18
|
* @param path If hash is collection then this defines path to a single file in the collection
|
|
18
19
|
*/
|
|
19
|
-
export declare function downloadFile(
|
|
20
|
+
export declare function downloadFile(kyOptions: KyOptions, hash: ReferenceOrEns, path?: string): Promise<FileData<Data>>;
|
|
20
21
|
/**
|
|
21
22
|
* Download single file as a readable stream
|
|
22
23
|
*
|
|
23
|
-
* @param
|
|
24
|
+
* @param kyOptions Ky Options for making requests
|
|
24
25
|
* @param hash Bee file or collection hash
|
|
25
26
|
* @param path If hash is collection then this defines path to a single file in the collection
|
|
26
27
|
*/
|
|
27
|
-
export declare function downloadFileReadable(
|
|
28
|
+
export declare function downloadFileReadable(kyOptions: KyOptions, hash: ReferenceOrEns, path?: string): Promise<FileData<ReadableStream<Uint8Array>>>;
|
|
28
29
|
/**
|
|
29
30
|
* Upload collection
|
|
30
|
-
* @param
|
|
31
|
+
* @param kyOptions Ky Options for making requests
|
|
31
32
|
* @param collection Collection of Uint8Array buffers to upload
|
|
32
33
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
33
34
|
* @param options
|
|
34
35
|
*/
|
|
35
|
-
export declare function uploadCollection(
|
|
36
|
+
export declare function uploadCollection(kyOptions: KyOptions, collection: Collection<Uint8Array>, postageBatchId: BatchId, options?: CollectionUploadOptions): Promise<UploadResult>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BatchId, Data,
|
|
1
|
+
import type { BatchId, Data, Reference, ReferenceOrEns, UploadOptions } from '../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Upload chunk to a Bee node
|
|
4
5
|
*
|
|
@@ -11,12 +12,12 @@ import type { BatchId, Data, Ky, Reference, ReferenceOrEns, UploadOptions } from
|
|
|
11
12
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
12
13
|
* @param options Additional options like tag, encryption, pinning
|
|
13
14
|
*/
|
|
14
|
-
export declare function upload(
|
|
15
|
+
export declare function upload(kyOptions: KyOptions, data: Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
|
|
15
16
|
/**
|
|
16
17
|
* Download chunk data as a byte array
|
|
17
18
|
*
|
|
18
|
-
* @param
|
|
19
|
+
* @param kyOptions Ky Options for making requests
|
|
19
20
|
* @param hash Bee content reference
|
|
20
21
|
*
|
|
21
22
|
*/
|
|
22
|
-
export declare function download(
|
|
23
|
+
export declare function download(kyOptions: KyOptions, hash: ReferenceOrEns): Promise<Data>;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import type { PeerBalance, BalanceResponse
|
|
1
|
+
import type { PeerBalance, BalanceResponse } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Get the balances with all known peers including prepaid services
|
|
4
5
|
*
|
|
5
|
-
* @param
|
|
6
|
+
* @param kyOptions Ky Options for making requests
|
|
6
7
|
*/
|
|
7
|
-
export declare function getAllBalances(
|
|
8
|
+
export declare function getAllBalances(kyOptions: KyOptions): Promise<BalanceResponse>;
|
|
8
9
|
/**
|
|
9
10
|
* Get the balances with a specific peer including prepaid services
|
|
10
11
|
*
|
|
11
|
-
* @param
|
|
12
|
+
* @param kyOptions Ky Options for making requests
|
|
12
13
|
* @param address Swarm address of peer
|
|
13
14
|
*/
|
|
14
|
-
export declare function getPeerBalance(
|
|
15
|
+
export declare function getPeerBalance(kyOptions: KyOptions, address: string): Promise<PeerBalance>;
|
|
15
16
|
/**
|
|
16
17
|
* Get the past due consumption balances with all known peers
|
|
17
18
|
*
|
|
18
|
-
* @param
|
|
19
|
+
* @param kyOptions Ky Options for making requests
|
|
19
20
|
*/
|
|
20
|
-
export declare function getPastDueConsumptionBalances(
|
|
21
|
+
export declare function getPastDueConsumptionBalances(kyOptions: KyOptions): Promise<BalanceResponse>;
|
|
21
22
|
/**
|
|
22
23
|
* Get the past due consumption balance with a specific peer
|
|
23
24
|
*
|
|
24
|
-
* @param
|
|
25
|
+
* @param kyOptions Ky Options for making requests
|
|
25
26
|
* @param address Swarm address of peer
|
|
26
27
|
*/
|
|
27
|
-
export declare function getPastDueConsumptionPeerBalance(
|
|
28
|
+
export declare function getPastDueConsumptionPeerBalance(kyOptions: KyOptions, address: string): Promise<PeerBalance>;
|
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import type { ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString,
|
|
1
|
+
import type { ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString, CashoutOptions, TransactionHash } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Get the address of the chequebook contract used
|
|
4
5
|
*
|
|
5
|
-
* @param
|
|
6
|
+
* @param kyOptions Ky Options for making requests
|
|
6
7
|
*/
|
|
7
|
-
export declare function getChequebookAddress(
|
|
8
|
+
export declare function getChequebookAddress(kyOptions: KyOptions): Promise<ChequebookAddressResponse>;
|
|
8
9
|
/**
|
|
9
10
|
* Get the balance of the chequebook
|
|
10
11
|
*
|
|
11
|
-
* @param
|
|
12
|
+
* @param kyOptions Ky Options for making requests
|
|
12
13
|
*/
|
|
13
|
-
export declare function getChequebookBalance(
|
|
14
|
+
export declare function getChequebookBalance(kyOptions: KyOptions): Promise<ChequebookBalanceResponse>;
|
|
14
15
|
/**
|
|
15
16
|
* Get last cashout action for the peer
|
|
16
17
|
*
|
|
17
|
-
* @param
|
|
18
|
+
* @param kyOptions Ky Options for making requests
|
|
18
19
|
* @param peer Swarm address of peer
|
|
19
20
|
*/
|
|
20
|
-
export declare function getLastCashoutAction(
|
|
21
|
+
export declare function getLastCashoutAction(kyOptions: KyOptions, peer: string): Promise<LastCashoutActionResponse>;
|
|
21
22
|
/**
|
|
22
23
|
* Cashout the last cheque for the peer
|
|
23
24
|
*
|
|
24
|
-
* @param
|
|
25
|
+
* @param kyOptions Ky Options for making requests
|
|
25
26
|
* @param peer Swarm address of peer
|
|
26
27
|
* @param options
|
|
27
28
|
*/
|
|
28
|
-
export declare function cashoutLastCheque(
|
|
29
|
+
export declare function cashoutLastCheque(kyOptions: KyOptions, peer: string, options?: CashoutOptions): Promise<TransactionHash>;
|
|
29
30
|
/**
|
|
30
31
|
* Get last cheques for the peer
|
|
31
32
|
*
|
|
32
|
-
* @param
|
|
33
|
+
* @param kyOptions Ky Options for making requests
|
|
33
34
|
* @param peer Swarm address of peer
|
|
34
35
|
*/
|
|
35
|
-
export declare function getLastChequesForPeer(
|
|
36
|
+
export declare function getLastChequesForPeer(kyOptions: KyOptions, peer: string): Promise<LastChequesForPeerResponse>;
|
|
36
37
|
/**
|
|
37
38
|
* Get last cheques for all peers
|
|
38
39
|
*
|
|
39
|
-
* @param
|
|
40
|
+
* @param kyOptions Ky Options for making requests
|
|
40
41
|
*/
|
|
41
|
-
export declare function getLastCheques(
|
|
42
|
+
export declare function getLastCheques(kyOptions: KyOptions): Promise<LastChequesResponse>;
|
|
42
43
|
/**
|
|
43
44
|
* Deposit tokens from overlay address into chequebook
|
|
44
45
|
*
|
|
45
|
-
* @param
|
|
46
|
+
* @param kyOptions Ky Options for making requests
|
|
46
47
|
* @param amount Amount of tokens to deposit
|
|
47
48
|
* @param gasPrice Gas Price in WEI for the transaction call
|
|
48
49
|
* @return string Hash of the transaction
|
|
49
50
|
*/
|
|
50
|
-
export declare function depositTokens(
|
|
51
|
+
export declare function depositTokens(kyOptions: KyOptions, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
|
|
51
52
|
/**
|
|
52
53
|
* Withdraw tokens from the chequebook to the overlay address
|
|
53
54
|
*
|
|
54
|
-
* @param
|
|
55
|
+
* @param kyOptions Ky Options for making requests
|
|
55
56
|
* @param amount Amount of tokens to withdraw
|
|
56
57
|
* @param gasPrice Gas Price in WEI for the transaction call
|
|
57
58
|
* @return string Hash of the transaction
|
|
58
59
|
*/
|
|
59
|
-
export declare function withdrawTokens(
|
|
60
|
+
export declare function withdrawTokens(kyOptions: KyOptions, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import type { BeeGenericResponse
|
|
1
|
+
import type { BeeGenericResponse } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Check if chunk at address exists locally
|
|
4
5
|
*
|
|
5
|
-
* @param
|
|
6
|
+
* @param kyOptions Ky Options for making requests
|
|
6
7
|
* @param address Swarm address of chunk
|
|
7
8
|
*
|
|
8
9
|
* @returns BeeGenericResponse if chunk is found or throws an exception
|
|
9
10
|
*/
|
|
10
|
-
export declare function checkIfChunkExistsLocally(
|
|
11
|
+
export declare function checkIfChunkExistsLocally(kyOptions: KyOptions, address: string): Promise<BeeGenericResponse>;
|
|
11
12
|
/**
|
|
12
13
|
* Delete a chunk from local storage
|
|
13
14
|
*
|
|
14
|
-
* @param
|
|
15
|
+
* @param kyOptions Ky Options for making requests
|
|
15
16
|
* @param address Swarm address of chunk
|
|
16
17
|
*
|
|
17
18
|
* @returns BeeGenericResponse if chunk was deleted or throws an exception
|
|
18
19
|
*/
|
|
19
|
-
export declare function deleteChunkFromLocalStorage(
|
|
20
|
+
export declare function deleteChunkFromLocalStorage(kyOptions: KyOptions, address: string): Promise<BeeGenericResponse>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
1
|
+
import type { NodeAddresses, Peer, PingResponse, RemovePeerResponse, Topology } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
3
|
+
export declare function getNodeAddresses(kyOptions: KyOptions): Promise<NodeAddresses>;
|
|
4
|
+
export declare function getPeers(kyOptions: KyOptions): Promise<Peer[]>;
|
|
5
|
+
export declare function getBlocklist(kyOptions: KyOptions): Promise<Peer[]>;
|
|
6
|
+
export declare function removePeer(kyOptions: KyOptions, peer: string): Promise<RemovePeerResponse>;
|
|
7
|
+
export declare function getTopology(kyOptions: KyOptions): Promise<Topology>;
|
|
8
|
+
export declare function pingPeer(kyOptions: KyOptions, peer: string): Promise<PingResponse>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type { Settlements, AllSettlements
|
|
1
|
+
import type { Settlements, AllSettlements } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Get amount of sent and received from settlements with a peer
|
|
4
5
|
*
|
|
5
|
-
* @param
|
|
6
|
+
* @param kyOptions Ky Options for making requests
|
|
6
7
|
* @param peer Swarm address of peer
|
|
7
8
|
*/
|
|
8
|
-
export declare function getSettlements(
|
|
9
|
+
export declare function getSettlements(kyOptions: KyOptions, peer: string): Promise<Settlements>;
|
|
9
10
|
/**
|
|
10
11
|
* Get settlements with all known peers and total amount sent or received
|
|
11
12
|
*
|
|
12
|
-
* @param
|
|
13
|
+
* @param kyOptions Ky Options for making requests
|
|
13
14
|
*/
|
|
14
|
-
export declare function getAllSettlements(
|
|
15
|
+
export declare function getAllSettlements(kyOptions: KyOptions): Promise<AllSettlements>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberString, TransactionOptions } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Gets the staked amount
|
|
4
5
|
*
|
|
5
|
-
* @param
|
|
6
|
+
* @param kyOptions Ky Options for making requests
|
|
6
7
|
*/
|
|
7
|
-
export declare function getStake(
|
|
8
|
+
export declare function getStake(kyOptions: KyOptions): Promise<NumberString>;
|
|
8
9
|
/**
|
|
9
10
|
* Stake given amount of tokens.
|
|
10
11
|
*
|
|
@@ -12,4 +13,4 @@ export declare function getStake(ky: Ky): Promise<NumberString>;
|
|
|
12
13
|
* @param amount
|
|
13
14
|
* @param options
|
|
14
15
|
*/
|
|
15
|
-
export declare function stake(
|
|
16
|
+
export declare function stake(kyOptions: KyOptions, amount: NumberString, options?: TransactionOptions): Promise<void>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { BatchId, PostageBatch,
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
1
|
+
import type { BatchId, PostageBatch, NumberString, PostageBatchBuckets, PostageBatchOptions } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
3
|
+
export declare function getAllPostageBatches(kyOptions: KyOptions): Promise<PostageBatch[]>;
|
|
4
|
+
export declare function getPostageBatch(kyOptions: KyOptions, postageBatchId: BatchId): Promise<PostageBatch>;
|
|
5
|
+
export declare function getPostageBatchBuckets(kyOptions: KyOptions, postageBatchId: BatchId): Promise<PostageBatchBuckets>;
|
|
6
|
+
export declare function createPostageBatch(kyOptions: KyOptions, amount: NumberString, depth: number, options?: PostageBatchOptions): Promise<BatchId>;
|
|
7
|
+
export declare function topUpBatch(kyOptions: KyOptions, id: string, amount: NumberString): Promise<BatchId>;
|
|
8
|
+
export declare function diluteBatch(kyOptions: KyOptions, id: string, depth: number): Promise<BatchId>;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { ChainState,
|
|
1
|
+
import { ChainState, ReserveState, WalletBalance } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Get state of reserve
|
|
4
5
|
*
|
|
5
|
-
* @param
|
|
6
|
+
* @param kyOptions Ky Options for making requests
|
|
6
7
|
*/
|
|
7
|
-
export declare function getReserveState(
|
|
8
|
+
export declare function getReserveState(kyOptions: KyOptions): Promise<ReserveState>;
|
|
8
9
|
/**
|
|
9
10
|
* Get state of reserve
|
|
10
11
|
*
|
|
11
|
-
* @param
|
|
12
|
+
* @param kyOptions Ky Options for making requests
|
|
12
13
|
*/
|
|
13
|
-
export declare function getChainState(
|
|
14
|
+
export declare function getChainState(kyOptions: KyOptions): Promise<ChainState>;
|
|
14
15
|
/**
|
|
15
16
|
* Get wallet balances for xDai and BZZ of the node
|
|
16
17
|
*
|
|
17
|
-
* @param
|
|
18
|
+
* @param kyOptions Ky Options for making requests
|
|
18
19
|
*/
|
|
19
|
-
export declare function getWalletBalance(
|
|
20
|
+
export declare function getWalletBalance(kyOptions: KyOptions): Promise<WalletBalance>;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import type { Health, NodeInfo } from '../../types/debug';
|
|
2
|
-
import { Ky } from '../../types';
|
|
3
2
|
import { BeeVersions } from '../../types/debug';
|
|
4
|
-
|
|
3
|
+
import type { Options as KyOptions } from 'ky';
|
|
4
|
+
export declare const SUPPORTED_BEE_VERSION_EXACT = "1.11.1-1992b846";
|
|
5
5
|
export declare const SUPPORTED_API_VERSION = "4.0.0";
|
|
6
6
|
export declare const SUPPORTED_DEBUG_API_VERSION = "4.0.0";
|
|
7
7
|
export declare const SUPPORTED_BEE_VERSION: string;
|
|
8
8
|
/**
|
|
9
9
|
* Get health of node
|
|
10
10
|
*
|
|
11
|
-
* @param
|
|
11
|
+
* @param kyOptions Ky Options for making requests
|
|
12
12
|
*/
|
|
13
|
-
export declare function getHealth(
|
|
13
|
+
export declare function getHealth(kyOptions: KyOptions): Promise<Health>;
|
|
14
14
|
/**
|
|
15
15
|
* Get readiness of node
|
|
16
16
|
*
|
|
17
|
-
* @param
|
|
17
|
+
* @param kyOptions Ky Options for making requests
|
|
18
18
|
*/
|
|
19
|
-
export declare function getReadiness(
|
|
19
|
+
export declare function getReadiness(kyOptions: KyOptions): Promise<boolean>;
|
|
20
20
|
/**
|
|
21
21
|
* Get information about Bee node
|
|
22
22
|
*
|
|
23
|
-
* @param
|
|
23
|
+
* @param kyOptions Ky Options for making requests
|
|
24
24
|
*/
|
|
25
|
-
export declare function getNodeInfo(
|
|
25
|
+
export declare function getNodeInfo(kyOptions: KyOptions): Promise<NodeInfo>;
|
|
26
26
|
/**
|
|
27
27
|
* Connects to a node and checks if it is a supported Bee version by the bee-js
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
29
|
+
* @param kyOptions Ky Options for making requests
|
|
30
30
|
*
|
|
31
31
|
* @returns true if the Bee node version is supported
|
|
32
32
|
* @deprecated Use `isSupportedExactVersion` instead
|
|
33
33
|
*/
|
|
34
|
-
export declare function isSupportedVersion(
|
|
34
|
+
export declare function isSupportedVersion(kyOptions: KyOptions): Promise<boolean>;
|
|
35
35
|
/**
|
|
36
36
|
* Connects to a node and checks if its version matches with the one that bee-js supports.
|
|
37
37
|
*
|
|
@@ -42,7 +42,7 @@ export declare function isSupportedVersion(ky: Ky): Promise<boolean>;
|
|
|
42
42
|
*
|
|
43
43
|
* @param ky
|
|
44
44
|
*/
|
|
45
|
-
export declare function isSupportedExactVersion(
|
|
45
|
+
export declare function isSupportedExactVersion(kyOptions: KyOptions): Promise<boolean>;
|
|
46
46
|
/**
|
|
47
47
|
* Connects to a node and checks if its main's API version matches with the one that bee-js supports.
|
|
48
48
|
*
|
|
@@ -51,7 +51,7 @@ export declare function isSupportedExactVersion(ky: Ky): Promise<boolean>;
|
|
|
51
51
|
*
|
|
52
52
|
* @param ky
|
|
53
53
|
*/
|
|
54
|
-
export declare function isSupportedMainApiVersion(
|
|
54
|
+
export declare function isSupportedMainApiVersion(kyOptions: KyOptions): Promise<boolean>;
|
|
55
55
|
/**
|
|
56
56
|
* Connects to a node and checks if its Debug API version matches with the one that bee-js supports.
|
|
57
57
|
*
|
|
@@ -60,7 +60,7 @@ export declare function isSupportedMainApiVersion(ky: Ky): Promise<boolean>;
|
|
|
60
60
|
*
|
|
61
61
|
* @param ky
|
|
62
62
|
*/
|
|
63
|
-
export declare function isSupportedDebugApiVersion(
|
|
63
|
+
export declare function isSupportedDebugApiVersion(kyOptions: KyOptions): Promise<boolean>;
|
|
64
64
|
/**
|
|
65
65
|
* Connects to a node and checks if its Main and Debug API versions matches with the one that bee-js supports.
|
|
66
66
|
*
|
|
@@ -68,11 +68,11 @@ export declare function isSupportedDebugApiVersion(ky: Ky): Promise<boolean>;
|
|
|
68
68
|
*
|
|
69
69
|
* @param ky
|
|
70
70
|
*/
|
|
71
|
-
export declare function isSupportedApiVersion(
|
|
71
|
+
export declare function isSupportedApiVersion(kyOptions: KyOptions): Promise<boolean>;
|
|
72
72
|
/**
|
|
73
73
|
* Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)
|
|
74
74
|
* and versions that bee-js supports (properties prefixed with `supported*`).
|
|
75
75
|
*
|
|
76
76
|
* @param ky
|
|
77
77
|
*/
|
|
78
|
-
export declare function getVersions(
|
|
78
|
+
export declare function getVersions(kyOptions: KyOptions): Promise<BeeVersions>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ExtendedTag
|
|
1
|
+
import { ExtendedTag } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Retrieve tag with extended information from Bee node
|
|
4
5
|
*
|
|
5
|
-
* @param
|
|
6
|
+
* @param kyOptions Ky Options for making requests
|
|
6
7
|
* @param uid UID of tag to be retrieved
|
|
7
8
|
*/
|
|
8
|
-
export declare function retrieveExtendedTag(
|
|
9
|
+
export declare function retrieveExtendedTag(kyOptions: KyOptions, uid: number): Promise<ExtendedTag>;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberString, TransactionHash, TransactionInfo } from '../../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Get list of all pending transactions
|
|
4
5
|
*
|
|
5
6
|
* @param ky Debug Ky instance
|
|
6
7
|
*/
|
|
7
|
-
export declare function getAllTransactions(
|
|
8
|
+
export declare function getAllTransactions(kyOptions: KyOptions): Promise<TransactionInfo[]>;
|
|
8
9
|
/**
|
|
9
10
|
* Get information for specific pending transactions
|
|
10
11
|
*
|
|
11
12
|
* @param ky Debug Ky instance
|
|
12
13
|
* @param transactionHash Hash of the transaction
|
|
13
14
|
*/
|
|
14
|
-
export declare function getTransaction(
|
|
15
|
+
export declare function getTransaction(kyOptions: KyOptions, transactionHash: TransactionHash): Promise<TransactionInfo>;
|
|
15
16
|
/**
|
|
16
17
|
* Rebroadcast existing transaction
|
|
17
18
|
*
|
|
18
19
|
* @param ky Debug Ky instance
|
|
19
20
|
* @param transactionHash Hash of the transaction
|
|
20
21
|
*/
|
|
21
|
-
export declare function rebroadcastTransaction(
|
|
22
|
+
export declare function rebroadcastTransaction(kyOptions: KyOptions, transactionHash: TransactionHash): Promise<TransactionHash>;
|
|
22
23
|
/**
|
|
23
24
|
* Cancel existing transaction
|
|
24
25
|
*
|
|
@@ -26,4 +27,4 @@ export declare function rebroadcastTransaction(ky: Ky, transactionHash: Transact
|
|
|
26
27
|
* @param transactionHash Hash of the transaction
|
|
27
28
|
* @param gasPrice Optional gas price
|
|
28
29
|
*/
|
|
29
|
-
export declare function cancelTransaction(
|
|
30
|
+
export declare function cancelTransaction(kyOptions: KyOptions, transactionHash: TransactionHash, gasPrice?: NumberString): Promise<TransactionHash>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { BatchId,
|
|
1
|
+
import { BatchId, Reference, ReferenceResponse, Topic } from '../types';
|
|
2
2
|
import { FeedType } from '../feed/type';
|
|
3
3
|
import { HexEthAddress } from '../utils/eth';
|
|
4
|
+
import type { Options as KyOptions } from 'ky';
|
|
4
5
|
export interface CreateFeedOptions {
|
|
5
6
|
type?: FeedType;
|
|
6
7
|
}
|
|
@@ -40,7 +41,7 @@ export interface FetchFeedUpdateResponse extends ReferenceResponse, FeedUpdateHe
|
|
|
40
41
|
* @param postageBatchId Postage BatchId to be used to create the Feed Manifest
|
|
41
42
|
* @param options Additional options, like type (default: 'sequence')
|
|
42
43
|
*/
|
|
43
|
-
export declare function createFeedManifest(
|
|
44
|
+
export declare function createFeedManifest(kyOptions: KyOptions, owner: HexEthAddress, topic: Topic, postageBatchId: BatchId, options?: CreateFeedOptions): Promise<Reference>;
|
|
44
45
|
/**
|
|
45
46
|
* Find and retrieve feed update
|
|
46
47
|
*
|
|
@@ -54,5 +55,5 @@ export declare function createFeedManifest(ky: Ky, owner: HexEthAddress, topic:
|
|
|
54
55
|
* @param topic Topic in hex
|
|
55
56
|
* @param options Additional options, like index, at, type
|
|
56
57
|
*/
|
|
57
|
-
export declare function fetchLatestFeedUpdate(
|
|
58
|
+
export declare function fetchLatestFeedUpdate(kyOptions: KyOptions, owner: HexEthAddress, topic: Topic, options?: FeedUpdateOptions): Promise<FetchFeedUpdateResponse>;
|
|
58
59
|
export {};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Pin, Reference } from '../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
export interface GetAllPinResponse {
|
|
3
4
|
references: Reference[];
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
6
7
|
* Pin data with given reference
|
|
7
8
|
*
|
|
8
|
-
* @param
|
|
9
|
+
* @param kyOptions Ky Options for making requests
|
|
9
10
|
* @param reference Bee data reference
|
|
10
11
|
*/
|
|
11
|
-
export declare function pin(
|
|
12
|
+
export declare function pin(kyOptions: KyOptions, reference: Reference): Promise<void>;
|
|
12
13
|
/**
|
|
13
14
|
* Unpin data with given reference
|
|
14
15
|
*
|
|
15
|
-
* @param
|
|
16
|
+
* @param kyOptions Ky Options for making requests
|
|
16
17
|
* @param reference Bee data reference
|
|
17
18
|
*/
|
|
18
|
-
export declare function unpin(
|
|
19
|
+
export declare function unpin(kyOptions: KyOptions, reference: Reference): Promise<void>;
|
|
19
20
|
/**
|
|
20
21
|
* Get pin status for specific address.
|
|
21
22
|
*
|
|
@@ -23,10 +24,10 @@ export declare function unpin(ky: Ky, reference: Reference): Promise<void>;
|
|
|
23
24
|
* @param reference
|
|
24
25
|
* @throws Error if given address is not pinned
|
|
25
26
|
*/
|
|
26
|
-
export declare function getPin(
|
|
27
|
+
export declare function getPin(kyOptions: KyOptions, reference: Reference): Promise<Pin>;
|
|
27
28
|
/**
|
|
28
29
|
* Get list of all pins
|
|
29
30
|
*
|
|
30
31
|
* @param ky Ky instance
|
|
31
32
|
*/
|
|
32
|
-
export declare function getAllPins(
|
|
33
|
+
export declare function getAllPins(kyOptions: KyOptions): Promise<Reference[]>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="ws" />
|
|
2
2
|
import WebSocket from 'isomorphic-ws';
|
|
3
|
-
import type { BatchId,
|
|
3
|
+
import type { BatchId, PublicKey } from '../types';
|
|
4
|
+
import type { Options as KyOptions } from 'ky';
|
|
4
5
|
/**
|
|
5
6
|
* Send to recipient or target with Postal Service for Swarm
|
|
6
7
|
*
|
|
7
|
-
* @param
|
|
8
|
+
* @param kyOptions Ky Options for making requests
|
|
8
9
|
* @param topic Topic name
|
|
9
10
|
* @param target Target message address prefix
|
|
10
11
|
* @param data
|
|
@@ -12,7 +13,7 @@ import type { BatchId, Ky, PublicKey } from '../types';
|
|
|
12
13
|
* @param recipient Recipient public key
|
|
13
14
|
*
|
|
14
15
|
*/
|
|
15
|
-
export declare function send(
|
|
16
|
+
export declare function send(kyOptions: KyOptions, topic: string, target: string, data: string | Uint8Array, postageBatchId: BatchId, recipient?: PublicKey): Promise<void>;
|
|
16
17
|
/**
|
|
17
18
|
* Subscribe for messages on the given topic
|
|
18
19
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BatchId,
|
|
1
|
+
import { BatchId, Reference, UploadOptions } from '../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Upload single owner chunk (SOC) to a Bee node
|
|
4
5
|
*
|
|
@@ -10,4 +11,4 @@ import { BatchId, Ky, Reference, UploadOptions } from '../types';
|
|
|
10
11
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
11
12
|
* @param options Additional options like tag, encryption, pinning
|
|
12
13
|
*/
|
|
13
|
-
export declare function upload(
|
|
14
|
+
export declare function upload(kyOptions: KyOptions, owner: string, identifier: string, signature: string, data: Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
2
|
/**
|
|
3
3
|
* Ping the base bee URL. If connection was not successful throw error
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param kyOptions Ky instance for given Bee class instance
|
|
6
6
|
*/
|
|
7
|
-
export declare function checkConnection(
|
|
7
|
+
export declare function checkConnection(kyOptions: KyOptions): Promise<void> | never;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReferenceOrEns } from '../types';
|
|
2
|
+
import type { Options as KyOptions } from 'ky';
|
|
2
3
|
/**
|
|
3
4
|
* Reupload locally pinned data
|
|
4
5
|
* @param ky Ky instance
|
|
@@ -6,5 +7,5 @@ import type { Ky, ReferenceOrEns } from '../types';
|
|
|
6
7
|
* @param options
|
|
7
8
|
* @throws BeeResponseError if not locally pinned or invalid data
|
|
8
9
|
*/
|
|
9
|
-
export declare function reupload(
|
|
10
|
-
export declare function isRetrievable(
|
|
10
|
+
export declare function reupload(kyOptions: KyOptions, reference: ReferenceOrEns): Promise<void>;
|
|
11
|
+
export declare function isRetrievable(kyOptions: KyOptions, reference: ReferenceOrEns): Promise<boolean>;
|