@ethersphere/bee-js 1.2.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/CHANGELOG.md +135 -2
  2. package/README.md +3 -1
  3. package/dist/index.browser.min.js +1 -1
  4. package/dist/index.browser.min.js.LICENSE.txt +51 -0
  5. package/dist/index.browser.min.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.LICENSE.txt +42 -0
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/src/bee-debug.d.ts +75 -38
  10. package/dist/src/bee.d.ts +88 -82
  11. package/dist/src/chunk/soc.d.ts +6 -6
  12. package/dist/src/feed/index.d.ts +7 -7
  13. package/dist/src/feed/json.d.ts +2 -2
  14. package/dist/src/modules/bytes.d.ts +8 -11
  15. package/dist/src/modules/bzz.d.ts +9 -14
  16. package/dist/src/modules/chunk.d.ts +7 -11
  17. package/dist/src/modules/debug/balance.d.ts +9 -9
  18. package/dist/src/modules/debug/chequebook.d.ts +17 -18
  19. package/dist/src/modules/debug/chunk.d.ts +5 -5
  20. package/dist/src/modules/debug/connectivity.d.ts +7 -7
  21. package/dist/src/modules/debug/settlements.d.ts +5 -5
  22. package/dist/src/modules/debug/stamps.d.ts +7 -5
  23. package/dist/src/modules/debug/states.d.ts +5 -5
  24. package/dist/src/modules/debug/status.d.ts +5 -4
  25. package/dist/src/modules/debug/tag.d.ts +3 -3
  26. package/dist/src/modules/debug/transactions.d.ts +9 -9
  27. package/dist/src/modules/feed.d.ts +5 -5
  28. package/dist/src/modules/pinning.d.ts +9 -9
  29. package/dist/src/modules/pss.d.ts +4 -3
  30. package/dist/src/modules/soc.d.ts +3 -3
  31. package/dist/src/modules/status.d.ts +3 -2
  32. package/dist/src/modules/stewardship.d.ts +4 -4
  33. package/dist/src/modules/tag.d.ts +6 -6
  34. package/dist/src/types/debug.d.ts +4 -2
  35. package/dist/src/types/index.d.ts +71 -19
  36. package/dist/src/utils/bytes.d.ts +1 -1
  37. package/dist/src/utils/data.browser.d.ts +3 -1
  38. package/dist/src/utils/data.d.ts +7 -4
  39. package/dist/src/utils/expose.d.ts +6 -9
  40. package/dist/src/utils/headers.d.ts +3 -3
  41. package/dist/src/utils/http.d.ts +25 -0
  42. package/dist/src/utils/merge.d.ts +8 -0
  43. package/dist/src/utils/pss.d.ts +9 -0
  44. package/dist/src/utils/stream.d.ts +37 -0
  45. package/dist/src/utils/type.d.ts +19 -9
  46. package/package.json +15 -8
  47. package/.babelrc.js +0 -33
  48. package/.depcheckrc.json +0 -27
  49. package/.editorconfig +0 -6
  50. package/.eslintignore +0 -1
  51. package/.eslintrc.js +0 -108
  52. package/.gitattributes +0 -1
  53. package/.github/config.yaml +0 -23
  54. package/.github/workflows/check.yaml +0 -57
  55. package/.github/workflows/publish_npmjs.yaml +0 -20
  56. package/.github/workflows/release_github.yaml +0 -20
  57. package/.github/workflows/tests.yaml +0 -128
  58. package/.huskyrc +0 -5
  59. package/.prettierrc +0 -13
  60. package/.vscode/launch.json +0 -49
  61. package/.vscode/settings.json +0 -39
  62. package/CODEOWNERS +0 -1
  63. package/CODE_OF_CONDUCT.md +0 -76
  64. package/commitlint.config.js +0 -3
  65. package/dist/src/modules/stamps.d.ts +0 -4
  66. package/dist/src/utils/hooks.d.ts +0 -31
  67. package/dist/src/utils/safe-axios.d.ts +0 -8
  68. package/jest-puppeteer.config.js +0 -5
  69. package/jest.config.ts +0 -170
  70. package/src/bee-debug.ts +0 -440
  71. package/src/bee.ts +0 -941
  72. package/src/chunk/bmt.ts +0 -55
  73. package/src/chunk/cac.ts +0 -79
  74. package/src/chunk/serialize.ts +0 -16
  75. package/src/chunk/signer.ts +0 -141
  76. package/src/chunk/soc.ts +0 -190
  77. package/src/chunk/span.ts +0 -33
  78. package/src/feed/index.ts +0 -221
  79. package/src/feed/json.ts +0 -32
  80. package/src/feed/topic.ts +0 -23
  81. package/src/feed/type.ts +0 -12
  82. package/src/index.ts +0 -24
  83. package/src/modules/bytes.ts +0 -75
  84. package/src/modules/bzz.ts +0 -184
  85. package/src/modules/chunk.ts +0 -75
  86. package/src/modules/debug/balance.ts +0 -63
  87. package/src/modules/debug/chequebook.ts +0 -174
  88. package/src/modules/debug/chunk.ts +0 -39
  89. package/src/modules/debug/connectivity.ts +0 -61
  90. package/src/modules/debug/settlements.ts +0 -33
  91. package/src/modules/debug/stamps.ts +0 -69
  92. package/src/modules/debug/states.ts +0 -35
  93. package/src/modules/debug/status.ts +0 -34
  94. package/src/modules/debug/tag.ts +0 -19
  95. package/src/modules/debug/transactions.ts +0 -79
  96. package/src/modules/feed.ts +0 -92
  97. package/src/modules/pinning.ts +0 -74
  98. package/src/modules/pss.ts +0 -48
  99. package/src/modules/soc.ts +0 -41
  100. package/src/modules/stamps.ts +0 -59
  101. package/src/modules/status.ts +0 -13
  102. package/src/modules/stewardship.ts +0 -21
  103. package/src/modules/tag.ts +0 -83
  104. package/src/types/axios/index.d.ts +0 -18
  105. package/src/types/debug.ts +0 -204
  106. package/src/types/index.ts +0 -497
  107. package/src/types/tar-js.d.ts +0 -1
  108. package/src/types/webpack-bundle-analyzer/index.d.ts +0 -13
  109. package/src/utils/bytes.ts +0 -144
  110. package/src/utils/collection.ts +0 -151
  111. package/src/utils/data.browser.ts +0 -24
  112. package/src/utils/data.ts +0 -35
  113. package/src/utils/error.ts +0 -23
  114. package/src/utils/eth.ts +0 -229
  115. package/src/utils/expose.ts +0 -10
  116. package/src/utils/file.ts +0 -40
  117. package/src/utils/hash.ts +0 -16
  118. package/src/utils/headers.ts +0 -63
  119. package/src/utils/hex.ts +0 -186
  120. package/src/utils/hooks.ts +0 -89
  121. package/src/utils/safe-axios.ts +0 -98
  122. package/src/utils/tar.ts +0 -30
  123. package/src/utils/type.ts +0 -302
  124. package/src/utils/uint64.ts +0 -31
  125. package/src/utils/url.ts +0 -52
  126. package/test/bee.sh +0 -187
  127. package/test/data/1.txt +0 -1
  128. package/test/data/2.txt +0 -0
  129. package/test/data/empty +0 -0
  130. package/test/data/sub/3.txt +0 -1
  131. package/test/data/sub//303/251 +0 -0
  132. package/test/data/sub//360/237/230/216 +0 -0
  133. package/test/integration/bee-class.browser.spec.ts +0 -215
  134. package/test/integration/bee-class.spec.ts +0 -595
  135. package/test/integration/bee-debug-class.spec.ts +0 -85
  136. package/test/integration/chunk/bmt.spec.ts +0 -33
  137. package/test/integration/chunk/cac.spec.ts +0 -27
  138. package/test/integration/chunk/soc.spec.ts +0 -38
  139. package/test/integration/feed/index.spec.ts +0 -84
  140. package/test/integration/modules/bytes.spec.ts +0 -23
  141. package/test/integration/modules/bzz.spec.ts +0 -270
  142. package/test/integration/modules/chunk.spec.ts +0 -29
  143. package/test/integration/modules/debug/balance.spec.ts +0 -70
  144. package/test/integration/modules/debug/chequebook.spec.ts +0 -64
  145. package/test/integration/modules/debug/connectivity.spec.ts +0 -69
  146. package/test/integration/modules/debug/settlements.spec.ts +0 -34
  147. package/test/integration/modules/debug/states.spec.ts +0 -34
  148. package/test/integration/modules/debug/status.spec.ts +0 -65
  149. package/test/integration/modules/debug/tag.spec.ts +0 -27
  150. package/test/integration/modules/feed.spec.ts +0 -61
  151. package/test/integration/modules/pinning.spec.ts +0 -155
  152. package/test/integration/modules/pss.spec.ts +0 -92
  153. package/test/integration/modules/status.spec.ts +0 -10
  154. package/test/integration/modules/stewardship.spec.ts +0 -32
  155. package/test/integration/modules/tag.spec.ts +0 -51
  156. package/test/test-type-sequencer.js +0 -36
  157. package/test/testpage/testpage.html +0 -20
  158. package/test/unit/assertions.ts +0 -376
  159. package/test/unit/bee-class.spec.ts +0 -685
  160. package/test/unit/bee-debug-class.spec.ts +0 -365
  161. package/test/unit/chunk/bmt.spec.ts +0 -16
  162. package/test/unit/chunk/cac.spec.ts +0 -29
  163. package/test/unit/chunk/serialize.spec.ts +0 -24
  164. package/test/unit/chunk/signer.spec.ts +0 -140
  165. package/test/unit/chunk/soc.spec.ts +0 -25
  166. package/test/unit/chunk/span.spec.ts +0 -38
  167. package/test/unit/feed/json.spec.ts +0 -73
  168. package/test/unit/nock.ts +0 -134
  169. package/test/unit/utils/bytes.spec.ts +0 -32
  170. package/test/unit/utils/collection.spec.ts +0 -22
  171. package/test/unit/utils/eth.spec.ts +0 -224
  172. package/test/unit/utils/hex.spec.ts +0 -115
  173. package/test/unit/utils/hooks.spec.ts +0 -179
  174. package/test/unit/utils/safe-axios.spec.ts +0 -20
  175. package/test/unit/utils/type.spec.ts +0 -32
  176. package/test/unit/utils/uint64.spec.ts +0 -102
  177. package/test/utils.ts +0 -292
  178. package/tsconfig.json +0 -18
  179. package/tsconfig.test.json +0 -11
  180. package/typedoc.json +0 -7
  181. package/webpack.config.ts +0 -141
@@ -1,27 +1,27 @@
1
- import { PeerBalance, BalanceResponse } from '../../types';
1
+ import type { PeerBalance, BalanceResponse, Ky } from '../../types';
2
2
  /**
3
3
  * Get the balances with all known peers including prepaid services
4
4
  *
5
- * @param url Bee debug url
5
+ * @param ky Ky debug instance
6
6
  */
7
- export declare function getAllBalances(url: string): Promise<BalanceResponse>;
7
+ export declare function getAllBalances(ky: Ky): Promise<BalanceResponse>;
8
8
  /**
9
9
  * Get the balances with a specific peer including prepaid services
10
10
  *
11
- * @param url Bee debug url
11
+ * @param ky Ky debug instance
12
12
  * @param address Swarm address of peer
13
13
  */
14
- export declare function getPeerBalance(url: string, address: string): Promise<PeerBalance>;
14
+ export declare function getPeerBalance(ky: Ky, address: string): Promise<PeerBalance>;
15
15
  /**
16
16
  * Get the past due consumption balances with all known peers
17
17
  *
18
- * @param url Bee debug url
18
+ * @param ky Ky debug instance
19
19
  */
20
- export declare function getPastDueConsumptionBalances(url: string): Promise<BalanceResponse>;
20
+ export declare function getPastDueConsumptionBalances(ky: Ky): Promise<BalanceResponse>;
21
21
  /**
22
22
  * Get the past due consumption balance with a specific peer
23
23
  *
24
- * @param url Bee debug url
24
+ * @param ky Ky debug instance
25
25
  * @param address Swarm address of peer
26
26
  */
27
- export declare function getPastDueConsumptionPeerBalance(url: string, address: string): Promise<PeerBalance>;
27
+ export declare function getPastDueConsumptionPeerBalance(ky: Ky, address: string): Promise<PeerBalance>;
@@ -1,60 +1,59 @@
1
- import type { ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString, TransactionHash } from '../../types';
2
- import { CashoutOptions } from '../../types';
1
+ import type { ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString, Ky, CashoutOptions, TransactionHash } from '../../types';
3
2
  /**
4
3
  * Get the address of the chequebook contract used
5
4
  *
6
- * @param url Bee debug url
5
+ * @param ky Ky debug instance
7
6
  */
8
- export declare function getChequebookAddress(url: string): Promise<ChequebookAddressResponse>;
7
+ export declare function getChequebookAddress(ky: Ky): Promise<ChequebookAddressResponse>;
9
8
  /**
10
9
  * Get the balance of the chequebook
11
10
  *
12
- * @param url Bee debug url
11
+ * @param ky Ky debug instance
13
12
  */
14
- export declare function getChequebookBalance(url: string): Promise<ChequebookBalanceResponse>;
13
+ export declare function getChequebookBalance(ky: Ky): Promise<ChequebookBalanceResponse>;
15
14
  /**
16
15
  * Get last cashout action for the peer
17
16
  *
18
- * @param url Bee debug url
17
+ * @param ky Ky debug instance
19
18
  * @param peer Swarm address of peer
20
19
  */
21
- export declare function getLastCashoutAction(url: string, peer: string): Promise<LastCashoutActionResponse>;
20
+ export declare function getLastCashoutAction(ky: Ky, peer: string): Promise<LastCashoutActionResponse>;
22
21
  /**
23
22
  * Cashout the last cheque for the peer
24
23
  *
25
- * @param url Bee debug url
24
+ * @param ky Ky debug instance
26
25
  * @param peer Swarm address of peer
27
26
  * @param options
28
27
  */
29
- export declare function cashoutLastCheque(url: string, peer: string, options?: CashoutOptions): Promise<TransactionHash>;
28
+ export declare function cashoutLastCheque(ky: Ky, peer: string, options?: CashoutOptions): Promise<TransactionHash>;
30
29
  /**
31
30
  * Get last cheques for the peer
32
31
  *
33
- * @param url Bee debug url
32
+ * @param ky Ky debug instance
34
33
  * @param peer Swarm address of peer
35
34
  */
36
- export declare function getLastChequesForPeer(url: string, peer: string): Promise<LastChequesForPeerResponse>;
35
+ export declare function getLastChequesForPeer(ky: Ky, peer: string): Promise<LastChequesForPeerResponse>;
37
36
  /**
38
37
  * Get last cheques for all peers
39
38
  *
40
- * @param url Bee debug url
39
+ * @param ky Ky debug instance
41
40
  */
42
- export declare function getLastCheques(url: string): Promise<LastChequesResponse>;
41
+ export declare function getLastCheques(ky: Ky): Promise<LastChequesResponse>;
43
42
  /**
44
43
  * Deposit tokens from overlay address into chequebook
45
44
  *
46
- * @param url Bee debug url
45
+ * @param ky Ky debug instance
47
46
  * @param amount Amount of tokens to deposit
48
47
  * @param gasPrice Gas Price in WEI for the transaction call
49
48
  * @return string Hash of the transaction
50
49
  */
51
- export declare function depositTokens(url: string, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
50
+ export declare function depositTokens(ky: Ky, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
52
51
  /**
53
52
  * Withdraw tokens from the chequebook to the overlay address
54
53
  *
55
- * @param url Bee debug url
54
+ * @param ky Ky debug instance
56
55
  * @param amount Amount of tokens to withdraw
57
56
  * @param gasPrice Gas Price in WEI for the transaction call
58
57
  * @return string Hash of the transaction
59
58
  */
60
- export declare function withdrawTokens(url: string, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
59
+ export declare function withdrawTokens(ky: Ky, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
@@ -1,19 +1,19 @@
1
- import { BeeGenericResponse } from '../../types';
1
+ import type { BeeGenericResponse, Ky } from '../../types';
2
2
  /**
3
3
  * Check if chunk at address exists locally
4
4
  *
5
- * @param url Bee debug url
5
+ * @param ky Ky debug instance
6
6
  * @param address Swarm address of chunk
7
7
  *
8
8
  * @returns BeeGenericResponse if chunk is found or throws an exception
9
9
  */
10
- export declare function checkIfChunkExistsLocally(url: string, address: string): Promise<BeeGenericResponse>;
10
+ export declare function checkIfChunkExistsLocally(ky: Ky, address: string): Promise<BeeGenericResponse>;
11
11
  /**
12
12
  * Delete a chunk from local storage
13
13
  *
14
- * @param url Bee debug url
14
+ * @param ky Ky debug instance
15
15
  * @param address Swarm address of chunk
16
16
  *
17
17
  * @returns BeeGenericResponse if chunk was deleted or throws an exception
18
18
  */
19
- export declare function deleteChunkFromLocalStorage(url: string, address: string): Promise<BeeGenericResponse>;
19
+ export declare function deleteChunkFromLocalStorage(ky: Ky, address: string): Promise<BeeGenericResponse>;
@@ -1,7 +1,7 @@
1
- import type { NodeAddresses, Peer, PingResponse, RemovePeerResponse, Topology } from '../../types';
2
- export declare function getNodeAddresses(url: string): Promise<NodeAddresses>;
3
- export declare function getPeers(url: string): Promise<Peer[]>;
4
- export declare function getBlocklist(url: string): Promise<Peer[]>;
5
- export declare function removePeer(url: string, peer: string): Promise<RemovePeerResponse>;
6
- export declare function getTopology(url: string): Promise<Topology>;
7
- export declare function pingPeer(url: string, peer: string): Promise<PingResponse>;
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,14 +1,14 @@
1
- import { Settlements, AllSettlements } from '../../types';
1
+ import type { Settlements, AllSettlements, Ky } from '../../types';
2
2
  /**
3
3
  * Get amount of sent and received from settlements with a peer
4
4
  *
5
- * @param url Bee debug url
5
+ * @param ky Ky debug instance
6
6
  * @param peer Swarm address of peer
7
7
  */
8
- export declare function getSettlements(url: string, peer: string): Promise<Settlements>;
8
+ export declare function getSettlements(ky: Ky, peer: string): Promise<Settlements>;
9
9
  /**
10
10
  * Get settlements with all known peers and total amount sent or received
11
11
  *
12
- * @param url Bee debug url
12
+ * @param ky Ky debug instance
13
13
  */
14
- export declare function getAllSettlements(url: string): Promise<AllSettlements>;
14
+ export declare function getAllSettlements(ky: Ky): Promise<AllSettlements>;
@@ -1,5 +1,7 @@
1
- import { BatchId, DebugPostageBatch, NumberString, PostageBatchBuckets, PostageBatchOptions } from '../../types';
2
- export declare function getAllPostageBatches(url: string): Promise<DebugPostageBatch[]>;
3
- export declare function getPostageBatch(url: string, postageBatchId: BatchId): Promise<DebugPostageBatch>;
4
- export declare function getPostageBatchBuckets(url: string, postageBatchId: BatchId): Promise<PostageBatchBuckets>;
5
- export declare function createPostageBatch(url: string, amount: NumberString, depth: number, options?: PostageBatchOptions): Promise<BatchId>;
1
+ import type { BatchId, DebugPostageBatch, Ky, NumberString, PostageBatchBuckets, PostageBatchOptions } from '../../types';
2
+ export declare function getAllPostageBatches(ky: Ky): Promise<DebugPostageBatch[]>;
3
+ export declare function getPostageBatch(ky: Ky, postageBatchId: BatchId): Promise<DebugPostageBatch>;
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,13 +1,13 @@
1
- import { ChainState, ReserveState } from '../../types';
1
+ import { ChainState, Ky, ReserveState } from '../../types';
2
2
  /**
3
3
  * Get state of reserve
4
4
  *
5
- * @param url Bee debug URL
5
+ * @param ky Ky debug instance
6
6
  */
7
- export declare function getReserveState(url: string): Promise<ReserveState>;
7
+ export declare function getReserveState(ky: Ky): Promise<ReserveState>;
8
8
  /**
9
9
  * Get state of reserve
10
10
  *
11
- * @param url Bee debug URL
11
+ * @param ky Ky debug instance
12
12
  */
13
- export declare function getChainState(url: string): Promise<ChainState>;
13
+ export declare function getChainState(ky: Ky): Promise<ChainState>;
@@ -1,17 +1,18 @@
1
1
  import type { Health } from '../../types/debug';
2
+ import { Ky } from '../../types';
2
3
  export declare const SUPPORTED_BEE_VERSION_EXACT: string;
3
4
  export declare const SUPPORTED_BEE_VERSION: string;
4
5
  /**
5
6
  * Get health of node
6
7
  *
7
- * @param url Bee debug URL
8
+ * @param ky Ky debug instance
8
9
  */
9
- export declare function getHealth(url: string): Promise<Health> | never;
10
+ export declare function getHealth(ky: Ky): Promise<Health> | never;
10
11
  /**
11
12
  * Connnects to a node and checks if it is a supported Bee version by the bee-js
12
13
  *
13
- * @param url Bee debug URL
14
+ * @param ky Ky debug instance
14
15
  *
15
16
  * @returns true if the Bee node version is supported
16
17
  */
17
- export declare function isSupportedVersion(url: string): Promise<boolean> | never;
18
+ export declare function isSupportedVersion(ky: Ky): Promise<boolean> | never;
@@ -1,8 +1,8 @@
1
- import { ExtendedTag } from '../../types';
1
+ import { ExtendedTag, Ky } from '../../types';
2
2
  /**
3
3
  * Retrieve tag with extended information from Bee node
4
4
  *
5
- * @param url Bee tag URL
5
+ * @param ky Ky debug instance
6
6
  * @param uid UID of tag to be retrieved
7
7
  */
8
- export declare function retrieveExtendedTag(url: string, uid: number): Promise<ExtendedTag>;
8
+ export declare function retrieveExtendedTag(ky: Ky, uid: number): Promise<ExtendedTag>;
@@ -1,29 +1,29 @@
1
- import { NumberString, TransactionHash, TransactionInfo } from '../../types';
1
+ import { Ky, NumberString, TransactionHash, TransactionInfo } from '../../types';
2
2
  /**
3
3
  * Get list of all pending transactions
4
4
  *
5
- * @param url Bee debug url
5
+ * @param ky Debug Ky instance
6
6
  */
7
- export declare function getAllTransactions(url: string): Promise<TransactionInfo[]>;
7
+ export declare function getAllTransactions(ky: Ky): Promise<TransactionInfo[]>;
8
8
  /**
9
9
  * Get information for specific pending transactions
10
10
  *
11
- * @param url Bee debug url
11
+ * @param ky Debug Ky instance
12
12
  * @param transactionHash Hash of the transaction
13
13
  */
14
- export declare function getTransaction(url: string, transactionHash: TransactionHash): Promise<TransactionInfo>;
14
+ export declare function getTransaction(ky: Ky, transactionHash: TransactionHash): Promise<TransactionInfo>;
15
15
  /**
16
16
  * Rebroadcast existing transaction
17
17
  *
18
- * @param url Bee debug url
18
+ * @param ky Debug Ky instance
19
19
  * @param transactionHash Hash of the transaction
20
20
  */
21
- export declare function rebroadcastTransaction(url: string, transactionHash: TransactionHash): Promise<TransactionHash>;
21
+ export declare function rebroadcastTransaction(ky: Ky, transactionHash: TransactionHash): Promise<TransactionHash>;
22
22
  /**
23
23
  * Cancel existing transaction
24
24
  *
25
- * @param url Bee debug url
25
+ * @param ky Debug Ky instance
26
26
  * @param transactionHash Hash of the transaction
27
27
  * @param gasPrice Optional gas price
28
28
  */
29
- export declare function cancelTransaction(url: string, transactionHash: TransactionHash, gasPrice?: NumberString): Promise<TransactionHash>;
29
+ export declare function cancelTransaction(ky: Ky, transactionHash: TransactionHash, gasPrice?: NumberString): Promise<TransactionHash>;
@@ -1,4 +1,4 @@
1
- import { BatchId, Reference, ReferenceResponse, Topic } from '../types';
1
+ import { BatchId, Ky, Reference, ReferenceResponse, Topic } from '../types';
2
2
  import { FeedType } from '../feed/type';
3
3
  import { HexEthAddress } from '../utils/eth';
4
4
  export interface CreateFeedOptions {
@@ -23,13 +23,13 @@ export interface FetchFeedUpdateResponse extends ReferenceResponse, FeedUpdateHe
23
23
  /**
24
24
  * Create an initial feed root manifest
25
25
  *
26
- * @param url Bee URL
26
+ * @param ky Ky instance
27
27
  * @param owner Owner's ethereum address in hex
28
28
  * @param topic Topic in hex
29
29
  * @param postageBatchId Postage BatchId to be used to create the Feed Manifest
30
30
  * @param options Additional options, like type (default: 'sequence')
31
31
  */
32
- export declare function createFeedManifest(url: string, owner: HexEthAddress, topic: Topic, postageBatchId: BatchId, options?: CreateFeedOptions): Promise<Reference>;
32
+ export declare function createFeedManifest(ky: Ky, owner: HexEthAddress, topic: Topic, postageBatchId: BatchId, options?: CreateFeedOptions): Promise<Reference>;
33
33
  /**
34
34
  * Find and retrieve feed update
35
35
  *
@@ -38,10 +38,10 @@ export declare function createFeedManifest(url: string, owner: HexEthAddress, to
38
38
  * the reference it contains along with its index and the
39
39
  * index of the subsequent update.
40
40
  *
41
- * @param url Bee URL
41
+ * @param ky Ky instance
42
42
  * @param owner Owner's ethereum address in hex
43
43
  * @param topic Topic in hex
44
44
  * @param options Additional options, like index, at, type
45
45
  */
46
- export declare function fetchFeedUpdate(url: string, owner: HexEthAddress, topic: Topic, options?: FeedUpdateOptions): Promise<FetchFeedUpdateResponse>;
46
+ export declare function fetchFeedUpdate(ky: Ky, owner: HexEthAddress, topic: Topic, options?: FeedUpdateOptions): Promise<FetchFeedUpdateResponse>;
47
47
  export {};
@@ -1,32 +1,32 @@
1
- import type { Pin, Reference } from '../types';
1
+ import type { Ky, Pin, Reference } from '../types';
2
2
  export interface GetAllPinResponse {
3
3
  references: Reference[] | null;
4
4
  }
5
5
  /**
6
6
  * Pin data with given reference
7
7
  *
8
- * @param url Bee URL
8
+ * @param ky Ky instance for given Bee class instance
9
9
  * @param reference Bee data reference
10
10
  */
11
- export declare function pin(url: string, reference: Reference): Promise<void>;
11
+ export declare function pin(ky: Ky, reference: Reference): Promise<void>;
12
12
  /**
13
13
  * Unpin data with given reference
14
14
  *
15
- * @param url Bee URL
15
+ * @param ky Ky instance for given Bee class instance
16
16
  * @param reference Bee data reference
17
17
  */
18
- export declare function unpin(url: string, reference: Reference): Promise<void>;
18
+ export declare function unpin(ky: Ky, reference: Reference): Promise<void>;
19
19
  /**
20
20
  * Get pin status for specific address.
21
21
  *
22
- * @param url Bee URL
22
+ * @param ky Ky instance
23
23
  * @param reference
24
24
  * @throws Error if given address is not pinned
25
25
  */
26
- export declare function getPin(url: string, reference: Reference): Promise<Pin>;
26
+ export declare function getPin(ky: Ky, reference: Reference): Promise<Pin>;
27
27
  /**
28
28
  * Get list of all pins
29
29
  *
30
- * @param url Bee URL
30
+ * @param ky Ky instance
31
31
  */
32
- export declare function getAllPins(url: string): Promise<Reference[]>;
32
+ export declare function getAllPins(ky: Ky): Promise<Reference[]>;
@@ -1,10 +1,10 @@
1
1
  /// <reference types="ws" />
2
2
  import WebSocket from 'isomorphic-ws';
3
- import type { BatchId, PublicKey } from '../types';
3
+ import type { BatchId, Ky, PublicKey } from '../types';
4
4
  /**
5
5
  * Send to recipient or target with Postal Service for Swarm
6
6
  *
7
- * @param url Bee url
7
+ * @param ky Ky instance for given Bee class instance
8
8
  * @param topic Topic name
9
9
  * @param target Target message address prefix
10
10
  * @param data
@@ -12,10 +12,11 @@ import type { BatchId, PublicKey } from '../types';
12
12
  * @param recipient Recipient public key
13
13
  *
14
14
  */
15
- export declare function send(url: string, topic: string, target: string, data: string | Uint8Array, postageBatchId: BatchId, recipient?: PublicKey): Promise<void>;
15
+ export declare function send(ky: Ky, topic: string, target: string, data: string | Uint8Array, postageBatchId: BatchId, recipient?: PublicKey): Promise<void>;
16
16
  /**
17
17
  * Subscribe for messages on the given topic
18
18
  *
19
+ * @param url Bee node URL
19
20
  * @param topic Topic name
20
21
  */
21
22
  export declare function subscribe(url: string, topic: string): WebSocket;
@@ -1,8 +1,8 @@
1
- import { BatchId, Reference, UploadOptions } from '../types';
1
+ import { BatchId, Ky, Reference, UploadOptions } from '../types';
2
2
  /**
3
3
  * Upload single owner chunk (SOC) to a Bee node
4
4
  *
5
- * @param url Bee URL
5
+ * @param ky Ky instance
6
6
  * @param owner Owner's ethereum address in hex
7
7
  * @param identifier Arbitrary identifier in hex
8
8
  * @param signature Signature in hex
@@ -10,4 +10,4 @@ import { BatchId, Reference, UploadOptions } from '../types';
10
10
  * @param postageBatchId Postage BatchId that will be assigned to uploaded data
11
11
  * @param options Additional options like tag, encryption, pinning
12
12
  */
13
- export declare function upload(url: string, owner: string, identifier: string, signature: string, data: Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
13
+ export declare function upload(ky: Ky, owner: string, identifier: string, signature: string, data: Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
@@ -1,6 +1,7 @@
1
+ import { Ky } from '../types';
1
2
  /**
2
3
  * Ping the base bee URL. If connection was not successful throw error
3
4
  *
4
- * @param url Bee URL
5
+ * @param ky Ky instance for given Bee class instance
5
6
  */
6
- export declare function checkConnection(url: string): Promise<void> | never;
7
+ export declare function checkConnection(ky: Ky): Promise<void> | never;
@@ -1,10 +1,10 @@
1
- import { Reference } from '../types';
2
- import { AxiosRequestConfig } from 'axios';
1
+ import type { Ky, Reference } from '../types';
3
2
  /**
4
3
  * Reupload locally pinned data
5
- * @param url
4
+ * @param ky Ky instance
6
5
  * @param reference
7
6
  * @param options
8
7
  * @throws BeeResponseError if not locally pinned or invalid data
9
8
  */
10
- export declare function reupload(url: string, reference: Reference, options?: AxiosRequestConfig): Promise<void>;
9
+ export declare function reupload(ky: Ky, reference: Reference): Promise<void>;
10
+ export declare function isRetrievable(ky: Ky, reference: Reference): Promise<boolean>;
@@ -1,17 +1,17 @@
1
- import { Reference, Tag } from '../types';
1
+ import { Ky, Reference, Tag } from '../types';
2
2
  /**
3
3
  * Create new tag on the Bee node
4
4
  *
5
5
  * @param url Bee tag URL
6
6
  */
7
- export declare function createTag(url: string): Promise<Tag>;
7
+ export declare function createTag(ky: Ky): Promise<Tag>;
8
8
  /**
9
9
  * Retrieve tag information from Bee node
10
10
  *
11
11
  * @param url Bee tag URL
12
12
  * @param uid UID of tag to be retrieved
13
13
  */
14
- export declare function retrieveTag(url: string, uid: number): Promise<Tag>;
14
+ export declare function retrieveTag(ky: Ky, uid: number): Promise<Tag>;
15
15
  /**
16
16
  * Get limited listing of all tags.
17
17
  *
@@ -19,17 +19,17 @@ export declare function retrieveTag(url: string, uid: number): Promise<Tag>;
19
19
  * @param offset
20
20
  * @param limit
21
21
  */
22
- export declare function getAllTags(url: string, offset?: number, limit?: number): Promise<Tag[]>;
22
+ export declare function getAllTags(ky: Ky, offset?: number, limit?: number): Promise<Tag[]>;
23
23
  /**
24
24
  * Removes tag from the Bee node.
25
25
  * @param url
26
26
  * @param uid
27
27
  */
28
- export declare function deleteTag(url: string, uid: number): Promise<void>;
28
+ export declare function deleteTag(ky: Ky, uid: number): Promise<void>;
29
29
  /**
30
30
  * Updates tag
31
31
  * @param url
32
32
  * @param uid
33
33
  * @param reference
34
34
  */
35
- export declare function updateTag(url: string, uid: number, reference: Reference): Promise<void>;
35
+ export declare function updateTag(ky: Ky, uid: number, reference: Reference): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { PublicKey, NumberString, Reference, TransactionHash } from './index';
1
+ import { PublicKey, NumberString, Reference, TransactionHash, RequestOptions } from './index';
2
2
  import { HexEthAddress } from '../utils/eth';
3
3
  /**
4
4
  * Object that contains information about progress of upload of data to network.
@@ -70,7 +70,7 @@ export interface ChequebookBalanceResponse {
70
70
  totalBalance: NumberString;
71
71
  availableBalance: NumberString;
72
72
  }
73
- export interface CashoutOptions {
73
+ export interface CashoutOptions extends RequestOptions {
74
74
  /**
75
75
  * Gas price for the cashout transaction in WEI
76
76
  */
@@ -118,6 +118,8 @@ export interface BalanceResponse {
118
118
  export interface Health {
119
119
  status: 'ok';
120
120
  version: string;
121
+ apiVersion: string;
122
+ debugApiVersion: string;
121
123
  }
122
124
  export interface RemovePeerResponse {
123
125
  message: string;