@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.
Files changed (151) hide show
  1. package/README.md +14 -6
  2. package/dist/223.index.browser.min.js +3 -0
  3. package/dist/223.index.browser.min.js.LICENSE.txt +1 -0
  4. package/dist/223.index.browser.min.js.map +1 -0
  5. package/dist/cjs/bee-debug.js +208 -312
  6. package/dist/cjs/bee.js +258 -353
  7. package/dist/cjs/chunk/signer.js +11 -22
  8. package/dist/cjs/chunk/soc.js +33 -50
  9. package/dist/cjs/chunk/span.js +1 -1
  10. package/dist/cjs/feed/index.js +50 -65
  11. package/dist/cjs/feed/json.js +8 -21
  12. package/dist/cjs/feed/retrievable.js +14 -27
  13. package/dist/cjs/modules/bytes.js +25 -37
  14. package/dist/cjs/modules/bzz.js +63 -68
  15. package/dist/cjs/modules/chunk.js +17 -27
  16. package/dist/cjs/modules/debug/balance.js +24 -41
  17. package/dist/cjs/modules/debug/chequebook.js +71 -96
  18. package/dist/cjs/modules/debug/chunk.js +13 -26
  19. package/dist/cjs/modules/debug/connectivity.js +32 -53
  20. package/dist/cjs/modules/debug/settlements.js +12 -25
  21. package/dist/cjs/modules/debug/stake.js +20 -33
  22. package/dist/cjs/modules/debug/stamps.js +45 -66
  23. package/dist/cjs/modules/debug/states.js +27 -40
  24. package/dist/cjs/modules/debug/status.js +53 -80
  25. package/dist/cjs/modules/debug/tag.js +6 -17
  26. package/dist/cjs/modules/debug/transactions.js +23 -40
  27. package/dist/cjs/modules/feed.js +17 -27
  28. package/dist/cjs/modules/pinning.js +24 -41
  29. package/dist/cjs/modules/pss.js +9 -20
  30. package/dist/cjs/modules/soc.js +12 -20
  31. package/dist/cjs/modules/status.js +4 -15
  32. package/dist/cjs/modules/stewardship.js +10 -23
  33. package/dist/cjs/modules/tag.js +28 -47
  34. package/dist/cjs/utils/collection.browser.js +4 -17
  35. package/dist/cjs/utils/collection.js +11 -22
  36. package/dist/cjs/utils/collection.node.js +42 -86
  37. package/dist/cjs/utils/data.browser.js +46 -59
  38. package/dist/cjs/utils/data.js +22 -35
  39. package/dist/cjs/utils/eth.js +31 -43
  40. package/dist/cjs/utils/file.js +9 -20
  41. package/dist/cjs/utils/headers.js +4 -4
  42. package/dist/cjs/utils/http.js +78 -93
  43. package/dist/cjs/utils/merge.js +1 -1
  44. package/dist/cjs/utils/sleep.js +2 -13
  45. package/dist/cjs/utils/type.js +14 -12
  46. package/dist/index.browser.min.js +1 -1
  47. package/dist/index.browser.min.js.LICENSE.txt +1 -3
  48. package/dist/index.browser.min.js.map +1 -1
  49. package/dist/mjs/bee-debug.js +209 -450
  50. package/dist/mjs/bee.js +256 -491
  51. package/dist/mjs/chunk/bmt.js +4 -10
  52. package/dist/mjs/chunk/cac.js +0 -3
  53. package/dist/mjs/chunk/signer.js +12 -63
  54. package/dist/mjs/chunk/soc.js +33 -85
  55. package/dist/mjs/chunk/span.js +3 -6
  56. package/dist/mjs/feed/identifier.js +0 -6
  57. package/dist/mjs/feed/index.js +53 -97
  58. package/dist/mjs/feed/json.js +10 -49
  59. package/dist/mjs/feed/retrievable.js +13 -64
  60. package/dist/mjs/feed/topic.js +0 -2
  61. package/dist/mjs/index.js +1 -2
  62. package/dist/mjs/modules/bytes.js +25 -65
  63. package/dist/mjs/modules/bzz.js +64 -108
  64. package/dist/mjs/modules/chunk.js +17 -54
  65. package/dist/mjs/modules/debug/balance.js +24 -68
  66. package/dist/mjs/modules/debug/chequebook.js +75 -138
  67. package/dist/mjs/modules/debug/chunk.js +13 -51
  68. package/dist/mjs/modules/debug/connectivity.js +32 -76
  69. package/dist/mjs/modules/debug/settlements.js +12 -50
  70. package/dist/mjs/modules/debug/stake.js +20 -61
  71. package/dist/mjs/modules/debug/stamps.js +47 -94
  72. package/dist/mjs/modules/debug/states.js +25 -66
  73. package/dist/mjs/modules/debug/status.js +66 -125
  74. package/dist/mjs/modules/debug/tag.js +6 -41
  75. package/dist/mjs/modules/debug/transactions.js +25 -69
  76. package/dist/mjs/modules/feed.js +17 -57
  77. package/dist/mjs/modules/pinning.js +24 -68
  78. package/dist/mjs/modules/pss.js +11 -47
  79. package/dist/mjs/modules/soc.js +14 -48
  80. package/dist/mjs/modules/status.js +4 -39
  81. package/dist/mjs/modules/stewardship.js +10 -47
  82. package/dist/mjs/modules/tag.js +31 -78
  83. package/dist/mjs/types/debug.js +0 -1
  84. package/dist/mjs/types/index.js +0 -4
  85. package/dist/mjs/utils/bytes.js +6 -14
  86. package/dist/mjs/utils/collection.browser.js +4 -42
  87. package/dist/mjs/utils/collection.js +11 -57
  88. package/dist/mjs/utils/collection.node.js +42 -150
  89. package/dist/mjs/utils/data.browser.js +49 -94
  90. package/dist/mjs/utils/data.js +19 -62
  91. package/dist/mjs/utils/error.js +0 -5
  92. package/dist/mjs/utils/eth.js +37 -95
  93. package/dist/mjs/utils/file.js +11 -50
  94. package/dist/mjs/utils/hash.js +0 -1
  95. package/dist/mjs/utils/headers.js +6 -14
  96. package/dist/mjs/utils/hex.js +6 -25
  97. package/dist/mjs/utils/http.js +80 -138
  98. package/dist/mjs/utils/merge.js +3 -7
  99. package/dist/mjs/utils/pss.js +0 -2
  100. package/dist/mjs/utils/reference.js +2 -5
  101. package/dist/mjs/utils/sleep.js +2 -37
  102. package/dist/mjs/utils/stream.js +0 -23
  103. package/dist/mjs/utils/tar.js +2 -5
  104. package/dist/mjs/utils/type.js +18 -82
  105. package/dist/mjs/utils/uint64.js +0 -1
  106. package/dist/mjs/utils/url.js +2 -10
  107. package/dist/types/bee-debug.d.ts +2 -2
  108. package/dist/types/bee.d.ts +2 -26
  109. package/dist/types/chunk/cac.d.ts +1 -1
  110. package/dist/types/chunk/soc.d.ts +8 -7
  111. package/dist/types/feed/index.d.ts +9 -8
  112. package/dist/types/feed/type.d.ts +1 -1
  113. package/dist/types/modules/bytes.d.ts +6 -5
  114. package/dist/types/modules/bzz.d.ts +9 -8
  115. package/dist/types/modules/chunk.d.ts +5 -4
  116. package/dist/types/modules/debug/balance.d.ts +10 -9
  117. package/dist/types/modules/debug/chequebook.d.ts +18 -17
  118. package/dist/types/modules/debug/chunk.d.ts +6 -5
  119. package/dist/types/modules/debug/connectivity.d.ts +8 -7
  120. package/dist/types/modules/debug/settlements.d.ts +6 -5
  121. package/dist/types/modules/debug/stake.d.ts +5 -4
  122. package/dist/types/modules/debug/stamps.d.ts +8 -7
  123. package/dist/types/modules/debug/states.d.ts +8 -7
  124. package/dist/types/modules/debug/status.d.ts +15 -15
  125. package/dist/types/modules/debug/tag.d.ts +4 -3
  126. package/dist/types/modules/debug/transactions.d.ts +6 -5
  127. package/dist/types/modules/feed.d.ts +4 -3
  128. package/dist/types/modules/pinning.d.ts +8 -7
  129. package/dist/types/modules/pss.d.ts +4 -3
  130. package/dist/types/modules/soc.d.ts +3 -2
  131. package/dist/types/modules/status.d.ts +3 -3
  132. package/dist/types/modules/stewardship.d.ts +4 -3
  133. package/dist/types/modules/tag.d.ts +7 -6
  134. package/dist/types/types/debug.d.ts +1 -1
  135. package/dist/types/types/index.d.ts +30 -34
  136. package/dist/types/utils/eth.d.ts +3 -3
  137. package/dist/types/utils/hex.d.ts +2 -2
  138. package/dist/types/utils/http.d.ts +6 -6
  139. package/package.json +34 -39
  140. package/dist/cjs/types/ky-options.js +0 -8
  141. package/dist/cjs/types/ky-universal/common.js +0 -8
  142. package/dist/cjs/types/ky-universal/hooks.js +0 -8
  143. package/dist/cjs/types/ky-universal/retry.js +0 -8
  144. package/dist/mjs/types/ky-options.js +0 -7
  145. package/dist/mjs/types/ky-universal/common.js +0 -7
  146. package/dist/mjs/types/ky-universal/hooks.js +0 -7
  147. package/dist/mjs/types/ky-universal/retry.js +0 -7
  148. package/dist/types/types/ky-options.d.ts +0 -221
  149. package/dist/types/types/ky-universal/common.d.ts +0 -13
  150. package/dist/types/types/ky-universal/hooks.d.ts +0 -92
  151. package/dist/types/types/ky-universal/retry.d.ts +0 -38
@@ -1,25 +1,26 @@
1
- import type { BatchId, Data, Ky, ReferenceOrEns, UploadOptions } from '../types';
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 ky Ky instance
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(ky: Ky, data: string | Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<UploadResult>;
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(ky: Ky, hash: ReferenceOrEns): Promise<Data>;
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(ky: Ky, hash: ReferenceOrEns): Promise<ReadableStream<Uint8Array>>;
26
+ export declare function downloadReadable(kyOptions: KyOptions, hash: ReferenceOrEns): Promise<ReadableStream<Uint8Array>>;
@@ -1,4 +1,5 @@
1
- import { BatchId, Collection, CollectionUploadOptions, Data, FileData, FileUploadOptions, Ky, Readable, ReferenceOrEns, UploadResult } from '../types';
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(ky: Ky, data: string | Uint8Array | Readable | ArrayBuffer, postageBatchId: BatchId, name?: string, options?: FileUploadOptions): Promise<UploadResult>;
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 ky Ky instance for given Bee class instance
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(ky: Ky, hash: ReferenceOrEns, path?: string): Promise<FileData<Data>>;
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 ky Ky instance for given Bee class instance
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(ky: Ky, hash: ReferenceOrEns, path?: string): Promise<FileData<ReadableStream<Uint8Array>>>;
28
+ export declare function downloadFileReadable(kyOptions: KyOptions, hash: ReferenceOrEns, path?: string): Promise<FileData<ReadableStream<Uint8Array>>>;
28
29
  /**
29
30
  * Upload collection
30
- * @param ky Ky instance for given Bee class instance
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(ky: Ky, collection: Collection<Uint8Array>, postageBatchId: BatchId, options?: CollectionUploadOptions): Promise<UploadResult>;
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, Ky, Reference, ReferenceOrEns, UploadOptions } from '../types';
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(ky: Ky, data: Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
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 ky Ky instance for given Bee class instance
19
+ * @param kyOptions Ky Options for making requests
19
20
  * @param hash Bee content reference
20
21
  *
21
22
  */
22
- export declare function download(ky: Ky, hash: ReferenceOrEns): Promise<Data>;
23
+ export declare function download(kyOptions: KyOptions, hash: ReferenceOrEns): Promise<Data>;
@@ -1,27 +1,28 @@
1
- import type { PeerBalance, BalanceResponse, Ky } from '../../types';
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 ky Ky debug instance
6
+ * @param kyOptions Ky Options for making requests
6
7
  */
7
- export declare function getAllBalances(ky: Ky): Promise<BalanceResponse>;
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 ky Ky debug instance
12
+ * @param kyOptions Ky Options for making requests
12
13
  * @param address Swarm address of peer
13
14
  */
14
- export declare function getPeerBalance(ky: Ky, address: string): Promise<PeerBalance>;
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 ky Ky debug instance
19
+ * @param kyOptions Ky Options for making requests
19
20
  */
20
- export declare function getPastDueConsumptionBalances(ky: Ky): Promise<BalanceResponse>;
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 ky Ky debug instance
25
+ * @param kyOptions Ky Options for making requests
25
26
  * @param address Swarm address of peer
26
27
  */
27
- export declare function getPastDueConsumptionPeerBalance(ky: Ky, address: string): Promise<PeerBalance>;
28
+ export declare function getPastDueConsumptionPeerBalance(kyOptions: KyOptions, address: string): Promise<PeerBalance>;
@@ -1,59 +1,60 @@
1
- import type { ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString, Ky, CashoutOptions, TransactionHash } from '../../types';
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 ky Ky debug instance
6
+ * @param kyOptions Ky Options for making requests
6
7
  */
7
- export declare function getChequebookAddress(ky: Ky): Promise<ChequebookAddressResponse>;
8
+ export declare function getChequebookAddress(kyOptions: KyOptions): Promise<ChequebookAddressResponse>;
8
9
  /**
9
10
  * Get the balance of the chequebook
10
11
  *
11
- * @param ky Ky debug instance
12
+ * @param kyOptions Ky Options for making requests
12
13
  */
13
- export declare function getChequebookBalance(ky: Ky): Promise<ChequebookBalanceResponse>;
14
+ export declare function getChequebookBalance(kyOptions: KyOptions): Promise<ChequebookBalanceResponse>;
14
15
  /**
15
16
  * Get last cashout action for the peer
16
17
  *
17
- * @param ky Ky debug instance
18
+ * @param kyOptions Ky Options for making requests
18
19
  * @param peer Swarm address of peer
19
20
  */
20
- export declare function getLastCashoutAction(ky: Ky, peer: string): Promise<LastCashoutActionResponse>;
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 ky Ky debug instance
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(ky: Ky, peer: string, options?: CashoutOptions): Promise<TransactionHash>;
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 ky Ky debug instance
33
+ * @param kyOptions Ky Options for making requests
33
34
  * @param peer Swarm address of peer
34
35
  */
35
- export declare function getLastChequesForPeer(ky: Ky, peer: string): Promise<LastChequesForPeerResponse>;
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 ky Ky debug instance
40
+ * @param kyOptions Ky Options for making requests
40
41
  */
41
- export declare function getLastCheques(ky: Ky): Promise<LastChequesResponse>;
42
+ export declare function getLastCheques(kyOptions: KyOptions): Promise<LastChequesResponse>;
42
43
  /**
43
44
  * Deposit tokens from overlay address into chequebook
44
45
  *
45
- * @param ky Ky debug instance
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(ky: Ky, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
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 ky Ky debug instance
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(ky: Ky, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
60
+ export declare function withdrawTokens(kyOptions: KyOptions, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
@@ -1,19 +1,20 @@
1
- import type { BeeGenericResponse, Ky } from '../../types';
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 ky Ky debug instance
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(ky: Ky, address: string): Promise<BeeGenericResponse>;
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 ky Ky debug instance
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(ky: Ky, address: string): Promise<BeeGenericResponse>;
20
+ export declare function deleteChunkFromLocalStorage(kyOptions: KyOptions, address: string): Promise<BeeGenericResponse>;
@@ -1,7 +1,8 @@
1
- import type { Ky, NodeAddresses, Peer, PingResponse, RemovePeerResponse, Topology } from '../../types';
2
- export declare function getNodeAddresses(ky: Ky): Promise<NodeAddresses>;
3
- export declare function getPeers(ky: Ky): Promise<Peer[]>;
4
- export declare function getBlocklist(ky: Ky): Promise<Peer[]>;
5
- export declare function removePeer(ky: Ky, peer: string): Promise<RemovePeerResponse>;
6
- export declare function getTopology(ky: Ky): Promise<Topology>;
7
- export declare function pingPeer(ky: Ky, peer: string): Promise<PingResponse>;
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, Ky } from '../../types';
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 ky Ky debug instance
6
+ * @param kyOptions Ky Options for making requests
6
7
  * @param peer Swarm address of peer
7
8
  */
8
- export declare function getSettlements(ky: Ky, peer: string): Promise<Settlements>;
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 ky Ky debug instance
13
+ * @param kyOptions Ky Options for making requests
13
14
  */
14
- export declare function getAllSettlements(ky: Ky): Promise<AllSettlements>;
15
+ export declare function getAllSettlements(kyOptions: KyOptions): Promise<AllSettlements>;
@@ -1,10 +1,11 @@
1
- import { Ky, NumberString, TransactionOptions } from '../../types';
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 ky Ky instance for given Bee class instance
6
+ * @param kyOptions Ky Options for making requests
6
7
  */
7
- export declare function getStake(ky: Ky): Promise<NumberString>;
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(ky: Ky, amount: NumberString, options?: TransactionOptions): Promise<void>;
16
+ export declare function stake(kyOptions: KyOptions, amount: NumberString, options?: TransactionOptions): Promise<void>;
@@ -1,7 +1,8 @@
1
- import type { BatchId, PostageBatch, Ky, NumberString, PostageBatchBuckets, PostageBatchOptions } from '../../types';
2
- export declare function getAllPostageBatches(ky: Ky): Promise<PostageBatch[]>;
3
- export declare function getPostageBatch(ky: Ky, postageBatchId: BatchId): Promise<PostageBatch>;
4
- export declare function getPostageBatchBuckets(ky: Ky, postageBatchId: BatchId): Promise<PostageBatchBuckets>;
5
- export declare function createPostageBatch(ky: Ky, amount: NumberString, depth: number, options?: PostageBatchOptions): Promise<BatchId>;
6
- export declare function topUpBatch(ky: Ky, id: string, amount: NumberString): Promise<BatchId>;
7
- export declare function diluteBatch(ky: Ky, id: string, depth: number): Promise<BatchId>;
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, Ky, ReserveState, WalletBalance } from '../../types';
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 ky Ky debug instance
6
+ * @param kyOptions Ky Options for making requests
6
7
  */
7
- export declare function getReserveState(ky: Ky): Promise<ReserveState>;
8
+ export declare function getReserveState(kyOptions: KyOptions): Promise<ReserveState>;
8
9
  /**
9
10
  * Get state of reserve
10
11
  *
11
- * @param ky Ky debug instance
12
+ * @param kyOptions Ky Options for making requests
12
13
  */
13
- export declare function getChainState(ky: Ky): Promise<ChainState>;
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 ky Ky debug instance
18
+ * @param kyOptions Ky Options for making requests
18
19
  */
19
- export declare function getWalletBalance(ky: Ky): Promise<WalletBalance>;
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
- export declare const SUPPORTED_BEE_VERSION_EXACT = "1.10.0-904cbb08";
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 ky Ky debug instance
11
+ * @param kyOptions Ky Options for making requests
12
12
  */
13
- export declare function getHealth(ky: Ky): Promise<Health>;
13
+ export declare function getHealth(kyOptions: KyOptions): Promise<Health>;
14
14
  /**
15
15
  * Get readiness of node
16
16
  *
17
- * @param ky Ky debug instance
17
+ * @param kyOptions Ky Options for making requests
18
18
  */
19
- export declare function getReadiness(ky: Ky): Promise<boolean>;
19
+ export declare function getReadiness(kyOptions: KyOptions): Promise<boolean>;
20
20
  /**
21
21
  * Get information about Bee node
22
22
  *
23
- * @param ky Ky debug instance
23
+ * @param kyOptions Ky Options for making requests
24
24
  */
25
- export declare function getNodeInfo(ky: Ky): Promise<NodeInfo>;
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 ky Ky debug instance
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(ky: Ky): Promise<boolean>;
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(ky: Ky): Promise<boolean>;
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(ky: Ky): Promise<boolean>;
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(ky: Ky): Promise<boolean>;
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(ky: Ky): Promise<boolean>;
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(ky: Ky): Promise<BeeVersions>;
78
+ export declare function getVersions(kyOptions: KyOptions): Promise<BeeVersions>;
@@ -1,8 +1,9 @@
1
- import { ExtendedTag, Ky } from '../../types';
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 ky Ky debug instance
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(ky: Ky, uid: number): Promise<ExtendedTag>;
9
+ export declare function retrieveExtendedTag(kyOptions: KyOptions, uid: number): Promise<ExtendedTag>;
@@ -1,24 +1,25 @@
1
- import { Ky, NumberString, TransactionHash, TransactionInfo } from '../../types';
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(ky: Ky): Promise<TransactionInfo[]>;
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(ky: Ky, transactionHash: TransactionHash): Promise<TransactionInfo>;
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(ky: Ky, transactionHash: TransactionHash): Promise<TransactionHash>;
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(ky: Ky, transactionHash: TransactionHash, gasPrice?: NumberString): Promise<TransactionHash>;
30
+ export declare function cancelTransaction(kyOptions: KyOptions, transactionHash: TransactionHash, gasPrice?: NumberString): Promise<TransactionHash>;
@@ -1,6 +1,7 @@
1
- import { BatchId, Ky, Reference, ReferenceResponse, Topic } from '../types';
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(ky: Ky, owner: HexEthAddress, topic: Topic, postageBatchId: BatchId, options?: CreateFeedOptions): Promise<Reference>;
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(ky: Ky, owner: HexEthAddress, topic: Topic, options?: FeedUpdateOptions): Promise<FetchFeedUpdateResponse>;
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 { Ky, Pin, Reference } from '../types';
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 ky Ky instance for given Bee class instance
9
+ * @param kyOptions Ky Options for making requests
9
10
  * @param reference Bee data reference
10
11
  */
11
- export declare function pin(ky: Ky, reference: Reference): Promise<void>;
12
+ export declare function pin(kyOptions: KyOptions, reference: Reference): Promise<void>;
12
13
  /**
13
14
  * Unpin data with given reference
14
15
  *
15
- * @param ky Ky instance for given Bee class instance
16
+ * @param kyOptions Ky Options for making requests
16
17
  * @param reference Bee data reference
17
18
  */
18
- export declare function unpin(ky: Ky, reference: Reference): Promise<void>;
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(ky: Ky, reference: Reference): Promise<Pin>;
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(ky: Ky): Promise<Reference[]>;
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, Ky, PublicKey } from '../types';
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 ky Ky instance for given Bee class instance
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(ky: Ky, topic: string, target: string, data: string | Uint8Array, postageBatchId: BatchId, recipient?: PublicKey): Promise<void>;
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, Ky, Reference, UploadOptions } from '../types';
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(ky: Ky, owner: string, identifier: string, signature: string, data: Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
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 { Ky } from '../types';
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 ky Ky instance for given Bee class instance
5
+ * @param kyOptions Ky instance for given Bee class instance
6
6
  */
7
- export declare function checkConnection(ky: Ky): Promise<void> | never;
7
+ export declare function checkConnection(kyOptions: KyOptions): Promise<void> | never;
@@ -1,4 +1,5 @@
1
- import type { Ky, ReferenceOrEns } from '../types';
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(ky: Ky, reference: ReferenceOrEns): Promise<void>;
10
- export declare function isRetrievable(ky: Ky, reference: ReferenceOrEns): Promise<boolean>;
10
+ export declare function reupload(kyOptions: KyOptions, reference: ReferenceOrEns): Promise<void>;
11
+ export declare function isRetrievable(kyOptions: KyOptions, reference: ReferenceOrEns): Promise<boolean>;