@ethersphere/bee-js 12.3.2-upcoming.116 → 13.0.0-upcoming.g540faf6

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 (276) hide show
  1. package/README.md +104 -103
  2. package/dist/cjs/api/balance.js +24 -0
  3. package/dist/cjs/api/batches.js +26 -0
  4. package/dist/cjs/{modules → api}/bytes.js +4 -29
  5. package/dist/cjs/{modules → api}/bzz.js +6 -34
  6. package/dist/cjs/{modules/debug → api}/chequebook.js +48 -87
  7. package/dist/cjs/api/chunk.js +43 -0
  8. package/dist/cjs/api/connectivity.js +86 -0
  9. package/dist/cjs/api/consumed.js +24 -0
  10. package/dist/cjs/{modules → api}/envelope.js +3 -2
  11. package/dist/cjs/api/feed.js +55 -0
  12. package/dist/cjs/api/grantee.js +62 -0
  13. package/dist/cjs/{modules/pinning.js → api/pin.js} +13 -34
  14. package/dist/cjs/api/pss.js +19 -0
  15. package/dist/cjs/api/redistributionstate.js +17 -0
  16. package/dist/cjs/{modules/debug/settlements.js → api/settlement.js} +3 -11
  17. package/dist/cjs/api/soc.js +34 -0
  18. package/dist/cjs/{modules/debug → api}/stake.js +15 -43
  19. package/dist/cjs/{modules/debug/stamps.js → api/stamp.js} +41 -57
  20. package/dist/cjs/api/status.js +67 -0
  21. package/dist/cjs/{modules → api}/stewardship.js +1 -6
  22. package/dist/cjs/api/tag.js +51 -0
  23. package/dist/cjs/{modules/debug/transactions.js → api/transaction.js} +10 -31
  24. package/dist/cjs/{modules/debug/states.js → api/wallet.js} +4 -36
  25. package/dist/cjs/bee.js +115 -1978
  26. package/dist/cjs/chunk/soc.js +23 -65
  27. package/dist/cjs/feed/identifier.js +3 -4
  28. package/dist/cjs/feed/index.js +20 -22
  29. package/dist/cjs/feed/retrievable.js +3 -3
  30. package/dist/cjs/index.js +18 -8
  31. package/dist/cjs/manifest/manifest.js +99 -335
  32. package/dist/cjs/modules/balance.js +86 -0
  33. package/dist/cjs/modules/cheque.js +92 -0
  34. package/dist/cjs/modules/chequebook.js +90 -0
  35. package/dist/cjs/modules/chunk.js +87 -53
  36. package/dist/cjs/modules/collection.js +145 -0
  37. package/dist/cjs/modules/connectivity.js +141 -0
  38. package/dist/cjs/modules/context.js +2 -0
  39. package/dist/cjs/modules/data.js +119 -0
  40. package/dist/cjs/modules/feed.js +94 -70
  41. package/dist/cjs/modules/file.js +113 -0
  42. package/dist/cjs/modules/grantee.js +86 -55
  43. package/dist/cjs/modules/messaging.js +248 -0
  44. package/dist/cjs/modules/pin.js +100 -0
  45. package/dist/cjs/modules/settlement.js +67 -0
  46. package/dist/cjs/modules/soc.js +39 -36
  47. package/dist/cjs/modules/stake.js +110 -0
  48. package/dist/cjs/modules/stamp.js +199 -0
  49. package/dist/cjs/modules/status.js +128 -20
  50. package/dist/cjs/modules/storage.js +191 -0
  51. package/dist/cjs/modules/tag.js +97 -71
  52. package/dist/cjs/modules/transaction.js +92 -0
  53. package/dist/cjs/modules/wallet.js +82 -0
  54. package/dist/cjs/types/schema/chequebook.js +5 -5
  55. package/dist/cjs/types/schema/connectivity.js +5 -5
  56. package/dist/cjs/types/schema/envelope.js +5 -5
  57. package/dist/cjs/types/schema/grantee.js +4 -4
  58. package/dist/cjs/types/schema/stake.js +2 -2
  59. package/dist/cjs/types/schema/stamps.js +4 -4
  60. package/dist/cjs/types/schema/states.js +2 -2
  61. package/dist/cjs/types/schema/transactions.js +3 -3
  62. package/dist/cjs/types/schema/upload.js +2 -2
  63. package/dist/cjs/utils/chunk-stream.browser.js +24 -16
  64. package/dist/cjs/utils/chunk-stream.js +17 -9
  65. package/dist/cjs/utils/constants.js +3 -3
  66. package/dist/cjs/utils/expose.js +4 -4
  67. package/dist/cjs/utils/headers.js +4 -4
  68. package/dist/cjs/utils/http.js +3 -1
  69. package/dist/cjs/utils/pss.js +2 -2
  70. package/dist/cjs/utils/resource-locator.js +2 -2
  71. package/dist/cjs/utils/schema.js +4 -4
  72. package/dist/cjs/utils/stamps.js +15 -130
  73. package/dist/cjs/utils/type.js +2 -2
  74. package/dist/codemod/index.js +141 -0
  75. package/dist/codemod/transforms/v13.js +524 -0
  76. package/dist/index.browser.min.js +2 -1
  77. package/dist/index.browser.min.js.LICENSE.txt +3 -0
  78. package/dist/index.browser.min.js.map +1 -1
  79. package/dist/mjs/api/balance.js +20 -0
  80. package/dist/mjs/api/batches.js +22 -0
  81. package/dist/mjs/{modules → api}/bytes.js +2 -27
  82. package/dist/mjs/{modules → api}/bzz.js +2 -30
  83. package/dist/mjs/{modules/debug → api}/chequebook.js +50 -89
  84. package/dist/mjs/api/chunk.js +37 -0
  85. package/dist/mjs/api/connectivity.js +76 -0
  86. package/dist/mjs/api/consumed.js +20 -0
  87. package/dist/mjs/{modules → api}/envelope.js +3 -2
  88. package/dist/mjs/api/feed.js +52 -0
  89. package/dist/mjs/api/grantee.js +59 -0
  90. package/dist/mjs/{modules/pinning.js → api/pin.js} +14 -35
  91. package/dist/mjs/api/pss.js +18 -0
  92. package/dist/mjs/api/redistributionstate.js +14 -0
  93. package/dist/mjs/{modules/debug/settlements.js → api/settlement.js} +3 -11
  94. package/dist/mjs/api/soc.js +31 -0
  95. package/dist/mjs/{modules/debug → api}/stake.js +14 -41
  96. package/dist/mjs/{modules/debug/stamps.js → api/stamp.js} +37 -51
  97. package/dist/mjs/api/status.js +59 -0
  98. package/dist/mjs/{modules → api}/stewardship.js +1 -6
  99. package/dist/mjs/api/tag.js +49 -0
  100. package/dist/mjs/api/transaction.js +41 -0
  101. package/dist/mjs/api/wallet.js +38 -0
  102. package/dist/mjs/bee.js +115 -1965
  103. package/dist/mjs/chunk/soc.js +13 -51
  104. package/dist/mjs/feed/identifier.js +2 -3
  105. package/dist/mjs/feed/index.js +9 -11
  106. package/dist/mjs/feed/retrievable.js +2 -2
  107. package/dist/mjs/index.js +2 -5
  108. package/dist/mjs/manifest/manifest.js +97 -341
  109. package/dist/mjs/modules/balance.js +49 -0
  110. package/dist/mjs/modules/cheque.js +55 -0
  111. package/dist/mjs/modules/chequebook.js +65 -0
  112. package/dist/mjs/modules/chunk.js +52 -49
  113. package/dist/mjs/modules/collection.js +108 -0
  114. package/dist/mjs/modules/connectivity.js +102 -0
  115. package/dist/mjs/modules/context.js +1 -0
  116. package/dist/mjs/modules/data.js +82 -0
  117. package/dist/mjs/modules/feed.js +89 -67
  118. package/dist/mjs/modules/file.js +78 -0
  119. package/dist/mjs/modules/grantee.js +52 -55
  120. package/dist/mjs/modules/messaging.js +213 -0
  121. package/dist/mjs/modules/pin.js +63 -0
  122. package/dist/mjs/modules/settlement.js +30 -0
  123. package/dist/mjs/modules/soc.js +36 -34
  124. package/dist/mjs/modules/stake.js +76 -0
  125. package/dist/mjs/modules/stamp.js +170 -0
  126. package/dist/mjs/modules/status.js +98 -18
  127. package/dist/mjs/modules/storage.js +185 -0
  128. package/dist/mjs/modules/tag.js +61 -68
  129. package/dist/mjs/modules/transaction.js +58 -0
  130. package/dist/mjs/modules/wallet.js +45 -0
  131. package/dist/mjs/types/schema/chequebook.js +1 -1
  132. package/dist/mjs/types/schema/connectivity.js +1 -1
  133. package/dist/mjs/types/schema/envelope.js +5 -5
  134. package/dist/mjs/types/schema/grantee.js +1 -1
  135. package/dist/mjs/types/schema/stake.js +1 -1
  136. package/dist/mjs/types/schema/stamps.js +1 -1
  137. package/dist/mjs/types/schema/states.js +1 -1
  138. package/dist/mjs/types/schema/transactions.js +1 -1
  139. package/dist/mjs/types/schema/upload.js +1 -1
  140. package/dist/mjs/utils/chunk-stream.browser.js +28 -18
  141. package/dist/mjs/utils/chunk-stream.js +21 -11
  142. package/dist/mjs/utils/constants.js +1 -1
  143. package/dist/mjs/utils/expose.js +1 -1
  144. package/dist/mjs/utils/headers.js +1 -1
  145. package/dist/mjs/utils/http.js +6 -1
  146. package/dist/mjs/utils/pss.js +1 -1
  147. package/dist/mjs/utils/resource-locator.js +1 -1
  148. package/dist/mjs/utils/schema.js +1 -1
  149. package/dist/mjs/utils/stamps.js +5 -99
  150. package/dist/mjs/utils/type.js +2 -2
  151. package/dist/types/api/balance.d.ts +7 -0
  152. package/dist/types/api/batches.d.ts +7 -0
  153. package/dist/types/api/bytes.d.ts +12 -0
  154. package/dist/types/api/bzz.d.ts +12 -0
  155. package/dist/types/api/chequebook.d.ts +21 -0
  156. package/dist/types/api/chunk.d.ts +7 -0
  157. package/dist/types/api/connectivity.d.ts +22 -0
  158. package/dist/types/api/consumed.d.ts +7 -0
  159. package/dist/types/{modules → api}/envelope.d.ts +1 -1
  160. package/dist/types/api/feed.d.ts +40 -0
  161. package/dist/types/api/grantee.d.ts +11 -0
  162. package/dist/types/api/pin.d.ts +10 -0
  163. package/dist/types/api/pss.d.ts +6 -0
  164. package/dist/types/api/redistributionstate.d.ts +5 -0
  165. package/dist/types/api/settlement.d.ts +7 -0
  166. package/dist/types/api/soc.d.ts +6 -0
  167. package/dist/types/api/stake.d.ts +11 -0
  168. package/dist/types/api/stamp.d.ts +12 -0
  169. package/dist/types/api/status.d.ts +11 -0
  170. package/dist/types/api/stewardship.d.ts +7 -0
  171. package/dist/types/api/tag.d.ts +12 -0
  172. package/dist/types/api/transaction.d.ts +9 -0
  173. package/dist/types/api/wallet.d.ts +9 -0
  174. package/dist/types/bee.d.ts +71 -1199
  175. package/dist/types/chunk/soc.d.ts +3 -48
  176. package/dist/types/feed/identifier.d.ts +1 -1
  177. package/dist/types/feed/index.d.ts +2 -4
  178. package/dist/types/feed/retrievable.d.ts +1 -1
  179. package/dist/types/index.d.ts +17 -20
  180. package/dist/types/manifest/manifest.d.ts +25 -34
  181. package/dist/types/modules/balance.d.ts +38 -0
  182. package/dist/types/modules/cheque.d.ts +40 -0
  183. package/dist/types/modules/chequebook.d.ts +41 -0
  184. package/dist/types/modules/chunk.d.ts +30 -20
  185. package/dist/types/modules/collection.d.ts +77 -0
  186. package/dist/types/modules/connectivity.d.ts +74 -0
  187. package/dist/types/modules/context.d.ts +24 -0
  188. package/dist/types/modules/data.d.ts +56 -0
  189. package/dist/types/modules/feed.d.ts +47 -49
  190. package/dist/types/modules/file.d.ts +43 -0
  191. package/dist/types/modules/grantee.d.ts +40 -8
  192. package/dist/types/modules/messaging.d.ts +79 -0
  193. package/dist/types/modules/pin.d.ts +47 -0
  194. package/dist/types/modules/settlement.d.ts +25 -0
  195. package/dist/types/modules/soc.d.ts +23 -11
  196. package/dist/types/modules/stake.d.ts +55 -0
  197. package/dist/types/modules/stamp.d.ts +96 -0
  198. package/dist/types/modules/status.d.ts +66 -5
  199. package/dist/types/modules/storage.d.ts +107 -0
  200. package/dist/types/modules/tag.d.ts +44 -33
  201. package/dist/types/modules/transaction.d.ts +42 -0
  202. package/dist/types/modules/wallet.d.ts +35 -0
  203. package/dist/types/types/debug.d.ts +1 -1
  204. package/dist/types/types/index.d.ts +3 -12
  205. package/dist/types/types/schema/chequebook.d.ts +1 -1
  206. package/dist/types/types/schema/connectivity.d.ts +1 -1
  207. package/dist/types/types/schema/grantee.d.ts +1 -1
  208. package/dist/types/types/schema/stake.d.ts +1 -1
  209. package/dist/types/types/schema/stamps.d.ts +1 -1
  210. package/dist/types/types/schema/states.d.ts +1 -1
  211. package/dist/types/types/schema/transactions.d.ts +1 -1
  212. package/dist/types/types/schema/upload.d.ts +1 -1
  213. package/dist/types/utils/chunk-stream.browser.d.ts +1 -1
  214. package/dist/types/utils/chunk-stream.d.ts +2 -2
  215. package/dist/types/utils/constants.d.ts +1 -1
  216. package/dist/types/utils/expose.d.ts +1 -1
  217. package/dist/types/utils/headers.d.ts +1 -1
  218. package/dist/types/utils/pss.d.ts +1 -1
  219. package/dist/types/utils/resource-locator.d.ts +1 -1
  220. package/dist/types/utils/schema.d.ts +1 -1
  221. package/dist/types/utils/stamps.d.ts +2 -27
  222. package/dist/types/utils/tar-uploader.browser.d.ts +1 -1
  223. package/dist/types/utils/tar-uploader.d.ts +1 -1
  224. package/dist/types/utils/type.d.ts +1 -1
  225. package/package.json +9 -3
  226. package/dist/cjs/chunk/bmt.js +0 -37
  227. package/dist/cjs/chunk/cac.js +0 -43
  228. package/dist/cjs/modules/debug/balance.js +0 -60
  229. package/dist/cjs/modules/debug/connectivity.js +0 -54
  230. package/dist/cjs/modules/debug/status.js +0 -104
  231. package/dist/cjs/modules/gsoc.js +0 -23
  232. package/dist/cjs/modules/pss.js +0 -48
  233. package/dist/cjs/stamper/stamper.js +0 -44
  234. package/dist/cjs/utils/bytes.js +0 -116
  235. package/dist/cjs/utils/cid.js +0 -37
  236. package/dist/cjs/utils/redundancy.js +0 -133
  237. package/dist/cjs/utils/typed-bytes.js +0 -186
  238. package/dist/mjs/chunk/bmt.js +0 -34
  239. package/dist/mjs/chunk/cac.js +0 -34
  240. package/dist/mjs/modules/debug/balance.js +0 -54
  241. package/dist/mjs/modules/debug/connectivity.js +0 -46
  242. package/dist/mjs/modules/debug/states.js +0 -68
  243. package/dist/mjs/modules/debug/status.js +0 -99
  244. package/dist/mjs/modules/debug/transactions.js +0 -62
  245. package/dist/mjs/modules/gsoc.js +0 -16
  246. package/dist/mjs/modules/pss.js +0 -43
  247. package/dist/mjs/stamper/stamper.js +0 -40
  248. package/dist/mjs/utils/bytes.js +0 -102
  249. package/dist/mjs/utils/cid.js +0 -32
  250. package/dist/mjs/utils/redundancy.js +0 -98
  251. package/dist/mjs/utils/typed-bytes.js +0 -167
  252. package/dist/types/chunk/bmt.d.ts +0 -16
  253. package/dist/types/chunk/cac.d.ts +0 -40
  254. package/dist/types/modules/bytes.d.ts +0 -35
  255. package/dist/types/modules/bzz.d.ts +0 -40
  256. package/dist/types/modules/debug/balance.d.ts +0 -28
  257. package/dist/types/modules/debug/chequebook.d.ts +0 -60
  258. package/dist/types/modules/debug/connectivity.d.ts +0 -9
  259. package/dist/types/modules/debug/settlements.d.ts +0 -15
  260. package/dist/types/modules/debug/stake.d.ts +0 -30
  261. package/dist/types/modules/debug/stamps.d.ts +0 -11
  262. package/dist/types/modules/debug/states.d.ts +0 -23
  263. package/dist/types/modules/debug/status.d.ts +0 -46
  264. package/dist/types/modules/debug/transactions.d.ts +0 -30
  265. package/dist/types/modules/gsoc.d.ts +0 -6
  266. package/dist/types/modules/pinning.d.ts +0 -30
  267. package/dist/types/modules/pss.d.ts +0 -22
  268. package/dist/types/modules/stewardship.d.ts +0 -10
  269. package/dist/types/stamper/stamper.d.ts +0 -15
  270. package/dist/types/utils/bytes.d.ts +0 -19
  271. package/dist/types/utils/cid.d.ts +0 -10
  272. package/dist/types/utils/redundancy.d.ts +0 -21
  273. package/dist/types/utils/typed-bytes.d.ts +0 -69
  274. /package/dist/cjs/{modules → api}/rchash.js +0 -0
  275. /package/dist/mjs/{modules → api}/rchash.js +0 -0
  276. /package/dist/types/{modules → api}/rchash.d.ts +0 -0
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  > Write your code in CJS, MJS or TypeScript.
15
15
 
16
- > Intended to be used with Bee version 2.5.0.
16
+ > Intended to be used with Bee version 2.8.1.
17
17
 
18
18
  ## Quick start
19
19
 
@@ -68,7 +68,7 @@ types. Where `NumberString` is present, `number` is disallowed in order to avoid
68
68
 
69
69
  ### Byte primitives
70
70
 
71
- All the classes below extend `Bytes`, therefor the following methods are available on all of them: `toUint8Array`,
71
+ All the classes below extend `Bytes`, therefore the following methods are available on all of them: `toUint8Array`,
72
72
  `toHex`, `toBase64`, `toBase32`, `toUtf8`, `toJSON`, `static keccak256`, `static fromUtf8`.
73
73
 
74
74
  The `toString` method uses `toHex`.
@@ -108,24 +108,25 @@ The `toString` method uses `toHex`.
108
108
 
109
109
  | Name | Description | Creation |
110
110
  | ---------------- | ----------------------------------------------------------------------------------------------- | --------------------------- |
111
- | Chunk | Span, max. 4096 bytes payload; address dervied from content | `makeContentAddressedChunk` |
111
+ | Chunk | Span, max. 4096 bytes payload; address derived from content | `makeContentAddressedChunk` |
112
112
  | SingleOwnerChunk | Identifier, signature, span, max. 4096 bytes payload; address derived from identifier and owner | `makeSingleOwnerChunk` |
113
113
 
114
114
  ### Swarm primitives
115
115
 
116
- | Name | Description | Methods |
117
- | ------------ | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
118
- | MantarayNode | Compact trie with reference values and JSON metadata | `addFork`, `removeFork`, `calculateSelfAddress`, `find`, `findClosest`, `collect`, `marshal`, `unmarshal`, `saveRecursively`, `loadRecursively` |
119
- | MerkleTree | Streaming BMT of chunks | `append`, `finalize`, `static root` |
116
+ | Name | Description | Methods |
117
+ | ------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
118
+ | MantarayNode | Compact trie with reference values and JSON metadata | `addFork`, `removeFork`, `calculateSelfAddress`, `find`, `findClosest`, `collect`, `marshal`, `unmarshal`, `saveRecursively`, `loadRecursively` |
119
+ | ChunkSplitter | Streaming BMT chunk-tree builder | `append`, `finalize`, `static root` |
120
+ | ChunkJoiner | Reconstructs data from a chunk tree | `join`, `static collect` |
120
121
 
121
122
  ### Swarm objects
122
123
 
123
124
  | Name | Description | Creation |
124
125
  | ---------- | ----------------------- | -------------------- |
125
- | SOCWriter | SingleOwnerChunk writer | `bee.makeSOCWriter` |
126
- | SOCReader | SingleOwnerChunk reader | `bee.makeSOCReader` |
127
- | FeedWriter | Feed writer | `bee.makeFeedWriter` |
128
- | FeedReader | Feed reader | `bee.makeFeedReader` |
126
+ | SOCWriter | SingleOwnerChunk writer | `bee.soc.makeWriter` |
127
+ | SOCReader | SingleOwnerChunk reader | `bee.soc.makeReader` |
128
+ | FeedWriter | Feed writer | `bee.feed.makeWriter` |
129
+ | FeedReader | Feed reader | `bee.feed.makeReader` |
129
130
 
130
131
  ### Bee API
131
132
 
@@ -133,83 +134,83 @@ The `toString` method uses `toHex`.
133
134
  - ❌✅✅ - Light node and full node
134
135
  - ✅✅✅ - Ultra-light node, light node and full node
135
136
 
136
- | JS Call | Bee Endpoint | Bee Mode |
137
- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
138
- | `uploadFile` | `POST /bzz` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | ❌✅✅ |
139
- | `uploadFilesFromDirectory` _Node.js_ | `POST /bzz` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | ❌✅✅ |
140
- | `uploadFiles` | `POST /bzz` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | ❌✅✅ |
141
- | `uploadCollection` | `POST /bzz` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | ❌✅✅ |
142
- | `uploadData` | `POST /bytes` [🔗](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post) | ❌✅✅ |
143
- | `uploadChunk` | `POST /chunks` [🔗](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | ❌✅✅ |
144
- | `streamDirectory` _Node.js_ | `POST /chunks` [🔗](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | ❌✅✅ |
145
- | `streamFiles` _Browser_ | `POST /chunks` [🔗](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | ❌✅✅ |
146
- | `SOCWriter.upload` | `POST /soc/:owner/:identifier` [🔗](https://docs.ethswarm.org/api/#tag/Single-owner-chunk/paths/~1soc~1%7Bowner%7D~1%7Bid%7D/post) | ❌✅✅ |
147
- | `FeedReader.download` | `GET /feeds/:owner/:topic` [🔗](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1%7Bowner%7D~1%7Btopic%7D/get) | ✅✅✅ |
148
- | `FeedWriter.updateFeed` | `POST /soc/:owner/:identifier` [🔗](https://docs.ethswarm.org/api/#tag/Single-owner-chunk/paths/~1soc~1%7Bowner%7D~1%7Bid%7D/post) | ❌✅✅ |
149
- | `downloadFile` | `GET /bzz/:reference` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D/get) | ✅✅✅ |
150
- | `downloadFile` | `GET /bzz/:reference/:path` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get) | ✅✅✅ |
151
- | `downloadReadableFile` | `GET /bzz/:reference` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D/get) | ✅✅✅ |
152
- | `downloadData` | `GET /bytes/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/get) | ✅✅✅ |
153
- | `downloadReadableData` | `GET /bytes/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/get) | ✅✅✅ |
154
- | `downloadChunk` | `GET /chunks/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1%7Baddress%7D/get) | ✅✅✅ |
155
- | `createFeedManifest` | `POST /feeds/:owner/:topic` [🔗](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1%7Bowner%7D~1%7Btopic%7D/post) | ❌✅✅ |
156
- | `isConnected` | `GET /` | ✅✅✅ |
157
- | `getHealth` | `GET /health` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1health/get) | ✅✅✅ |
158
- | `getReadiness` | `GET /readiness` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1readiness/get) | ✅✅✅ |
159
- | `getNodeInfo` | `GET /node` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1node/get) | ✅✅✅ |
160
- | `getChainState` | `GET /chainstate` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1chainstate/get) | ❌✅✅ |
161
- | `getRedistributionState` | `GET /redistributionstate` [🔗](https://docs.ethswarm.org/api/#tag/RedistributionState/paths/~1redistributionstate/get) | ❌❌✅ |
162
- | `getReserveState` | `GET /reservestate` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1reservestate/get) | ❌❌✅ |
163
- | `getStatus` | `GET /status` [🔗](https://docs.ethswarm.org/api/#tag/Node-Status/paths/~1status/get) | ✅✅✅ |
164
- | `getWallet` | `GET /wallet` [🔗](https://docs.ethswarm.org/api/#tag/Wallet/paths/~1wallet/get) | ❌✅✅ |
165
- | `getTopology` | `GET /topology` [🔗](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1topology/get) | ✅✅✅ |
166
- | `getAddresses` | `GET /addresses` [🔗](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1addresses/get) | ✅✅✅ |
167
- | `getPeers` | `GET /peers` [🔗](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1peers/get) | ✅✅✅ |
168
- | `getAllBalances` | `GET /balances` [🔗](https://docs.ethswarm.org/api/#tag/Balance/paths/~1balances/get) | ❌✅✅ |
169
- | `getPeerBalance` | `GET /balances/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Balance/paths/~1balances~1%7Baddress%7D/get) | ❌✅✅ |
170
- | `getPastDueConsumptionBalances` | `GET /consumed` [🔗](https://docs.ethswarm.org/api/#tag/Balance/paths/~1consumed/get) | ❌✅✅ |
171
- | `getPastDueConsumptionPeerBalance` | `GET /consumed/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Balance/paths/~1consumed~1%7Baddress%7D/get) | ❌✅✅ |
172
- | `getAllSettlements` | `GET /settlements` [🔗](https://docs.ethswarm.org/api/#tag/Settlements/paths/~1settlements/get) | ❌✅✅ |
173
- | `getSettlements` | `GET /settlements/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Settlements/paths/~1settlements~1%7Baddress%7D/get) | ❌✅✅ |
174
- | `getChequebookAddress` | `GET /chequebook/address` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1address/get) | ❌✅✅ |
175
- | `getChequebookBalance` | `GET /chequebook/balance` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1balance/get) | ❌✅✅ |
176
- | `getLastCheques` | `GET /chequebook/cheque` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cheque/get) | ❌✅✅ |
177
- | `getLastChequesForPeer` | `GET /chequebook/cheque/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cheque~1%7Bpeer-id%7D/get) | ❌✅✅ |
178
- | `getLastCashoutAction` | `GET /chequebook/cashout/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cashout~1%7Bpeer-id%7D/get) | ❌✅✅ |
179
- | `cashoutLastCheque` | `POST /chequebook/cashout/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cashout~1%7Bpeer-id%7D/post) | ❌✅✅ |
180
- | `depositTokens` | `POST /chequebook/deposit` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1deposit/post) | ❌✅✅ |
181
- | `withdrawTokens` | `POST /chequebook/withdraw` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1withdraw/post) | ❌✅✅ |
182
- | `getAllPendingTransactions` | `GET /transactions` [🔗](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions/get) | ❌✅✅ |
183
- | `getPendingTransaction` | `GET /transactions/:id` [🔗](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/get) | ❌✅✅ |
184
- | `rebroadcastTransaction` | `POST /transactions/:id` [🔗](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/post) | ❌✅✅ |
185
- | `cancelTransaction` | `DELETE /transactions/:id` [🔗](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/delete) | ❌✅✅ |
186
- | `createTag` | `POST /tags` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post) | ❌✅✅ |
187
- | `retrieveTag` | `GET /tags/:id` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/get) | ❌✅✅ |
188
- | `getAllTags` | `GET /tags` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get) | ❌✅✅ |
189
- | `deleteTag` | `DELETE /tags/:id` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/delete) | ❌✅✅ |
190
- | `updateTag` | `PATCH /tags/:id` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/patch) | ❌✅✅ |
191
- | `pin` | `POST /pins/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/post) | ✅✅✅ |
192
- | `getAllPins` | `GET /pins` [🔗](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins/get) | ✅✅✅ |
193
- | `getPin` | `GET /pins/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/get) | ✅✅✅ |
194
- | `isReferenceRetrievable` | `GET /stewardship/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1%7Breference%7D/get) | ✅✅✅ |
195
- | `reuploadPinnedData` | `PUT /stewardship/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1%7Breference%7D/put) | ❌✅✅ |
196
- | `unpin` | `DELETE /pins/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/delete) | ✅✅✅ |
197
- | `getGrantees` | `GET /grantee/:reference` [🔗](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee~1%7Breference%7D/get) | ❌✅✅ |
198
- | `createGrantees` | `POST /grantee` [🔗](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee/post) | ❌✅✅ |
199
- | `patchGrantees` | `PATCH /grantee/:reference` [🔗](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee~1%7Breference%7D/patch) | ❌✅✅ |
200
- | `pssSend` | `POST /pss/send/:topic/:target` [🔗](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1%7Btopic%7D~1%7Btargets%7D/post) | ❌✅✅ |
201
- | `pssSubscribe` _Websocket_ | `GET /pss/subscribe/:topic` [🔗](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1%7Btopic%7D/get) | ❌❌✅ |
202
- | `pssReceive` | `GET /pss/subscribe/:topic` [🔗](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1%7Btopic%7D/get) | ❌❌✅ |
203
- | `getPostageBatches` | `GET /stamps` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get) | ❌✅✅ |
204
- | `getGlobalPostageBatches` | `GET /batches` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1batches/get) | ❌✅✅ |
205
- | `getPostageBatch` | `GET /stamps/:batchId` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get) | ❌✅✅ |
206
- | `getPostageBatchBuckets` | `GET /stamps/:batchId/buckets` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D~1buckets/get) | ❌✅✅ |
207
- | `createPostageBatch` | `POST /stamps/:amount/:depth` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bamount%7D~1%7Bdepth%7D/post) | ❌✅✅ |
208
- | `topUpBatch` | `PATCH /stamps/topup/:batchId/:amount` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1topup~1%7Bbatch_id%7D~1%7Bamount%7D/patch) | ❌✅✅ |
209
- | `diluteBatch` | `PATCH /stamps/dilute/:batchId/:depth` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1dilute~1%7Bbatch_id%7D~1%7Bdepth%7D/patch) | ❌✅✅ |
210
- | `createEnvelope` | `POST /envelope/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Envelope/paths/~1envelope~1%7Baddress%7D/post) | ❌✅✅ |
211
- | `getStake` | `GET /stake` [🔗](https://docs.ethswarm.org/api/#tag/Staking/paths/~1stake/get) | ❌❌✅ |
212
- | `depositStake` | `POST /stake` [🔗](https://docs.ethswarm.org/api/#tag/Staking/paths/~1stake~1%7Bamount%7D/post) | ❌❌✅ |
137
+ | JS Call | Bee Endpoint | Bee Mode |
138
+ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
139
+ | `file.upload` | `POST /bzz` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | ❌✅✅ |
140
+ | `collection.uploadFromDirectory` _Node.js_ | `POST /bzz` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | ❌✅✅ |
141
+ | `collection.uploadFromFileList` | `POST /bzz` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | ❌✅✅ |
142
+ | `collection.upload` | `POST /bzz` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | ❌✅✅ |
143
+ | `data.upload` | `POST /bytes` [🔗](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post) | ❌✅✅ |
144
+ | `chunk.upload` | `POST /chunks` [🔗](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | ❌✅✅ |
145
+ | `collection.streamFromDirectory` _Node.js_ | `POST /chunks` [🔗](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | ❌✅✅ |
146
+ | `collection.stream` _Browser_ | `POST /chunks` [🔗](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | ❌✅✅ |
147
+ | `SOCWriter.upload` | `POST /soc/:owner/:identifier` [🔗](https://docs.ethswarm.org/api/#tag/Single-owner-chunk/paths/~1soc~1%7Bowner%7D~1%7Bid%7D/post) | ❌✅✅ |
148
+ | `FeedReader.download` | `GET /feeds/:owner/:topic` [🔗](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1%7Bowner%7D~1%7Btopic%7D/get) | ✅✅✅ |
149
+ | `FeedWriter.uploadReference` | `POST /soc/:owner/:identifier` [🔗](https://docs.ethswarm.org/api/#tag/Single-owner-chunk/paths/~1soc~1%7Bowner%7D~1%7Bid%7D/post) | ❌✅✅ |
150
+ | `file.download` | `GET /bzz/:reference` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D/get) | ✅✅✅ |
151
+ | `file.download` | `GET /bzz/:reference/:path` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get) | ✅✅✅ |
152
+ | `file.downloadReadable` | `GET /bzz/:reference` [🔗](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D/get) | ✅✅✅ |
153
+ | `data.download` | `GET /bytes/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/get) | ✅✅✅ |
154
+ | `data.downloadReadable` | `GET /bytes/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/get) | ✅✅✅ |
155
+ | `chunk.download` | `GET /chunks/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1%7Baddress%7D/get) | ✅✅✅ |
156
+ | `feed.createManifest` | `POST /feeds/:owner/:topic` [🔗](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1%7Bowner%7D~1%7Btopic%7D/post) | ❌✅✅ |
157
+ | `connectivity.isConnected` | `GET /` | ✅✅✅ |
158
+ | `status.getHealth` | `GET /health` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1health/get) | ✅✅✅ |
159
+ | `status.getReadiness` | `GET /readiness` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1readiness/get) | ✅✅✅ |
160
+ | `status.getNodeInfo` | `GET /node` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1node/get) | ✅✅✅ |
161
+ | `status.getChainState` | `GET /chainstate` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1chainstate/get) | ❌✅✅ |
162
+ | `stake.getRedistributionState` | `GET /redistributionstate` [🔗](https://docs.ethswarm.org/api/#tag/RedistributionState/paths/~1redistributionstate/get) | ❌❌✅ |
163
+ | `status.getReserveState` | `GET /reservestate` [🔗](https://docs.ethswarm.org/api/#tag/Status/paths/~1reservestate/get) | ❌❌✅ |
164
+ | `status.get` | `GET /status` [🔗](https://docs.ethswarm.org/api/#tag/Node-Status/paths/~1status/get) | ✅✅✅ |
165
+ | `wallet.getBalance` | `GET /wallet` [🔗](https://docs.ethswarm.org/api/#tag/Wallet/paths/~1wallet/get) | ❌✅✅ |
166
+ | `connectivity.getTopology` | `GET /topology` [🔗](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1topology/get) | ✅✅✅ |
167
+ | `connectivity.getNodeAddresses` | `GET /addresses` [🔗](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1addresses/get) | ✅✅✅ |
168
+ | `connectivity.getPeers` | `GET /peers` [🔗](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1peers/get) | ✅✅✅ |
169
+ | `balance.getAll` | `GET /balances` [🔗](https://docs.ethswarm.org/api/#tag/Balance/paths/~1balances/get) | ❌✅✅ |
170
+ | `balance.getPeer` | `GET /balances/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Balance/paths/~1balances~1%7Baddress%7D/get) | ❌✅✅ |
171
+ | `balance.getAllPastDueConsumption` | `GET /consumed` [🔗](https://docs.ethswarm.org/api/#tag/Balance/paths/~1consumed/get) | ❌✅✅ |
172
+ | `balance.getAllPastDueConsumptionForPeer` | `GET /consumed/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Balance/paths/~1consumed~1%7Baddress%7D/get) | ❌✅✅ |
173
+ | `settlement.getAll` | `GET /settlements` [🔗](https://docs.ethswarm.org/api/#tag/Settlements/paths/~1settlements/get) | ❌✅✅ |
174
+ | `settlement.get` | `GET /settlements/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Settlements/paths/~1settlements~1%7Baddress%7D/get) | ❌✅✅ |
175
+ | `chequebook.getAddress` | `GET /chequebook/address` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1address/get) | ❌✅✅ |
176
+ | `chequebook.getBalance` | `GET /chequebook/balance` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1balance/get) | ❌✅✅ |
177
+ | `cheque.getAllLatest` | `GET /chequebook/cheque` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cheque/get) | ❌✅✅ |
178
+ | `cheque.getAllLatestForPeer` | `GET /chequebook/cheque/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cheque~1%7Bpeer-id%7D/get) | ❌✅✅ |
179
+ | `cheque.getLastCashoutAction` | `GET /chequebook/cashout/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cashout~1%7Bpeer-id%7D/get) | ❌✅✅ |
180
+ | `cheque.cashoutLast` | `POST /chequebook/cashout/:peer` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cashout~1%7Bpeer-id%7D/post) | ❌✅✅ |
181
+ | `chequebook.deposit` | `POST /chequebook/deposit` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1deposit/post) | ❌✅✅ |
182
+ | `chequebook.withdraw` | `POST /chequebook/withdraw` [🔗](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1withdraw/post) | ❌✅✅ |
183
+ | `transaction.getAll` | `GET /transactions` [🔗](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions/get) | ❌✅✅ |
184
+ | `transaction.get` | `GET /transactions/:id` [🔗](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/get) | ❌✅✅ |
185
+ | `transaction.rebroadcast` | `POST /transactions/:id` [🔗](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/post) | ❌✅✅ |
186
+ | `transaction.cancel` | `DELETE /transactions/:id` [🔗](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/delete) | ❌✅✅ |
187
+ | `tag.create` | `POST /tags` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post) | ❌✅✅ |
188
+ | `tag.get` | `GET /tags/:id` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/get) | ❌✅✅ |
189
+ | `tag.getAll` | `GET /tags` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get) | ❌✅✅ |
190
+ | `tag.delete` | `DELETE /tags/:id` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/delete) | ❌✅✅ |
191
+ | `tag.update` | `PATCH /tags/:id` [🔗](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/patch) | ❌✅✅ |
192
+ | `pin.add` | `POST /pins/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/post) | ✅✅✅ |
193
+ | `pin.getAll` | `GET /pins` [🔗](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins/get) | ✅✅✅ |
194
+ | `pin.get` | `GET /pins/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/get) | ✅✅✅ |
195
+ | `data.isRetrievable` | `GET /stewardship/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1%7Breference%7D/get) | ✅✅✅ |
196
+ | `pin.reuploadData` | `PUT /stewardship/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1%7Breference%7D/put) | ❌✅✅ |
197
+ | `pin.remove` | `DELETE /pins/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/delete) | ✅✅✅ |
198
+ | `grantee.get` | `GET /grantee/:reference` [🔗](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee~1%7Breference%7D/get) | ❌✅✅ |
199
+ | `grantee.create` | `POST /grantee` [🔗](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee/post) | ❌✅✅ |
200
+ | `grantee.patch` | `PATCH /grantee/:reference` [🔗](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee~1%7Breference%7D/patch) | ❌✅✅ |
201
+ | `messaging.pssSend` | `POST /pss/send/:topic/:target` [🔗](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1%7Btopic%7D~1%7Btargets%7D/post) | ❌✅✅ |
202
+ | `messaging.pssSubscribe` _Websocket_ | `GET /pss/subscribe/:topic` [🔗](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1%7Btopic%7D/get) | ❌❌✅ |
203
+ | `messaging.pssReceive` | `GET /pss/subscribe/:topic` [🔗](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1%7Btopic%7D/get) | ❌❌✅ |
204
+ | `stamp.getAll` | `GET /stamps` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get) | ❌✅✅ |
205
+ | `stamp.getAllGlobal` | `GET /batches` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1batches/get) | ❌✅✅ |
206
+ | `stamp.get` | `GET /stamps/:batchId` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get) | ❌✅✅ |
207
+ | `stamp.getBuckets` | `GET /stamps/:batchId/buckets` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D~1buckets/get) | ❌✅✅ |
208
+ | `stamp.create` | `POST /stamps/:amount/:depth` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bamount%7D~1%7Bdepth%7D/post) | ❌✅✅ |
209
+ | `stamp.topUp` | `PATCH /stamps/topup/:batchId/:amount` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1topup~1%7Bbatch_id%7D~1%7Bamount%7D/patch) | ❌✅✅ |
210
+ | `stamp.dilute` | `PATCH /stamps/dilute/:batchId/:depth` [🔗](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1dilute~1%7Bbatch_id%7D~1%7Bdepth%7D/patch) | ❌✅✅ |
211
+ | `createEnvelope` | `POST /envelope/:reference` [🔗](https://docs.ethswarm.org/api/#tag/Envelope/paths/~1envelope~1%7Baddress%7D/post) | ❌✅✅ |
212
+ | `stake.get` | `GET /stake` [🔗](https://docs.ethswarm.org/api/#tag/Staking/paths/~1stake/get) | ❌❌✅ |
213
+ | `stake.deposit` | `POST /stake` [🔗](https://docs.ethswarm.org/api/#tag/Staking/paths/~1stake~1%7Bamount%7D/post) | ❌❌✅ |
213
214
 
214
215
  ### Utils
215
216
 
@@ -230,12 +231,12 @@ The `toString` method uses `toHex`.
230
231
 
231
232
  #### Stamps
232
233
 
233
- - `getAmountForTtl`
234
- - `getDepthForCapacity`
234
+ - `getAmountForDuration`
235
+ - `getDepthForSize`
235
236
  - `getStampCost`
236
237
  - `getStampEffectiveBytes`
237
- - `getStampMaximumCapacityBytes`
238
- - `getStampTtlSeconds`
238
+ - `getStampTheoreticalBytes`
239
+ - `getStampDuration`
239
240
  - `getStampUsage`
240
241
 
241
242
  ## Usage
@@ -249,14 +250,14 @@ main()
249
250
 
250
251
  async function main() {
251
252
  const bee = new Bee(SWARM_GATEWAY_URL)
252
- const { reference } = await bee.uploadData(NULL_STAMP, 'Hello, World!')
253
+ const { reference } = await bee.data.upload(NULL_STAMP, 'Hello, World!')
253
254
  console.log(reference.toHex())
254
255
  }
255
256
  ```
256
257
 
257
258
  ### Create or select an existing postage batch
258
259
 
259
- Swarm incentivizes nodes in the network to store content, therefor all uploads require a paid
260
+ Swarm incentivizes nodes in the network to store content, therefore all uploads require a paid
260
261
  [postage batch](https://docs.ethswarm.org/docs/learn/technology/contracts/postage-stamp).
261
262
 
262
263
  ```js
@@ -266,13 +267,13 @@ async function getOrCreatePostageBatch() {
266
267
  const bee = new Bee('http://localhost:1633')
267
268
  let batchId
268
269
 
269
- const batches = await bee.getPostageBatches()
270
+ const batches = await bee.stamp.getAll()
270
271
  const usable = batches.find(x => x.usable)
271
272
 
272
273
  if (usable) {
273
274
  batchId = usable.batchID
274
275
  } else {
275
- batchId = await bee.buyStorage(Size.fromGigabytes(1), Duration.fromDays(7))
276
+ batchId = await bee.storage.buy(Size.fromGigabytes(1), Duration.fromDays(7))
276
277
  }
277
278
  }
278
279
  ```
@@ -286,8 +287,8 @@ import { Bee } from '@ethersphere/bee-js'
286
287
 
287
288
  const bee = new Bee('http://localhost:1633')
288
289
 
289
- const uploadResult = await bee.uploadData(batchId, 'Bee is awesome!')
290
- const data = await bee.downloadData(uploadResult.reference)
290
+ const uploadResult = await bee.data.upload(batchId, 'Bee is awesome!')
291
+ const data = await bee.data.download(uploadResult.reference)
291
292
 
292
293
  console.log(data.toUtf8()) // prints 'Bee is awesome!'
293
294
  ```
@@ -298,7 +299,7 @@ console.log(data.toUtf8()) // prints 'Bee is awesome!'
298
299
  import { Bee } from '@ethersphere/bee-js'
299
300
 
300
301
  const bee = new Bee('http://localhost:1633')
301
- const result = await bee.uploadFile(batchId, file)
302
+ const result = await bee.file.upload(batchId, file)
302
303
  ```
303
304
 
304
305
  ### Upload multiple files or a directory (React)
@@ -307,7 +308,7 @@ const result = await bee.uploadFile(batchId, file)
307
308
  import { Bee } from '@ethersphere/bee-js'
308
309
 
309
310
  const bee = new Bee('http://localhost:1633')
310
- const result = await bee.uploadFiles(batchId, fileList)
311
+ const result = await bee.collection.uploadFromFileList(batchId, fileList)
311
312
  ```
312
313
 
313
314
  ### Upload arbitrary large file (Node.js)
@@ -318,7 +319,7 @@ import { createReadStream } from 'fs'
318
319
 
319
320
  const bee = new Bee('http://localhost:1633')
320
321
  const readable = createReadStream('./path/to/large.bin')
321
- const uploadResult = await bee.uploadFile(batchId, readable)
322
+ const uploadResult = await bee.file.upload(batchId, readable)
322
323
  ```
323
324
 
324
325
  ### Upload arbitrary large directories (Node.js)
@@ -328,7 +329,7 @@ import { Bee } from '@ethersphere/bee-js'
328
329
  import { createReadStream } from 'fs'
329
330
 
330
331
  const bee = new Bee('http://localhost:1633')
331
- const uploadResult = await bee.uploadFilesFromDirectory(batchId, './path/to/gallery/')
332
+ const uploadResult = await bee.collection.uploadFromDirectory(batchId, './path/to/gallery/')
332
333
  ```
333
334
 
334
335
  ### Customize http/https agent and headers
@@ -379,7 +380,7 @@ After making changes, link the package to your project by running `npm link` in
379
380
 
380
381
  [Code coverage](https://bah5acgza26tlmya36bdiu5cdfs3hh22hqthkhfv6cvq2ugxqrv5aw267ydlq.bzz.limo/)
381
382
 
382
- Tests are currently run against a mainnet Bee nodes. This is temporary and this section will be revised in the future.
383
+ Tests are currently run against a mainnet Bee node. This is temporary and this section will be revised in the future.
383
384
 
384
385
  ## License
385
386
 
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBalances = getBalances;
4
+ exports.getPeerBalance = getPeerBalance;
5
+ const balance_1 = require("../types/schema/balance");
6
+ const http_1 = require("../utils/http");
7
+ const balancesEndpoint = 'balances';
8
+ /**
9
+ * Raw HTTP calls for the `/balances` endpoint.
10
+ */
11
+ async function getBalances(requestOptions) {
12
+ const response = await (0, http_1.http)(requestOptions, {
13
+ url: balancesEndpoint,
14
+ responseType: 'json',
15
+ });
16
+ return balance_1.GetAllBalancesResponse.parse(response.data);
17
+ }
18
+ async function getPeerBalance(requestOptions, peer) {
19
+ const response = await (0, http_1.http)(requestOptions, {
20
+ url: `${balancesEndpoint}/${peer}`,
21
+ responseType: 'json',
22
+ });
23
+ return balance_1.GetPeerBalanceResponse.parse(response.data);
24
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGlobalPostageBatch = getGlobalPostageBatch;
4
+ exports.getAllGlobalPostageBatches = getAllGlobalPostageBatches;
5
+ const stamps_1 = require("../types/schema/stamps");
6
+ const http_1 = require("../utils/http");
7
+ const batchesEndpoint = 'batches';
8
+ /**
9
+ * Raw HTTP calls for the `/batches` endpoint.
10
+ */
11
+ async function getGlobalPostageBatch(requestOptions, id) {
12
+ const response = await (0, http_1.http)(requestOptions, {
13
+ method: 'get',
14
+ url: `${batchesEndpoint}/${id}`,
15
+ responseType: 'json',
16
+ });
17
+ return stamps_1.GetGlobalPostageBatchResponse.parse(response.data);
18
+ }
19
+ async function getAllGlobalPostageBatches(requestOptions) {
20
+ const response = await (0, http_1.http)(requestOptions, {
21
+ method: 'get',
22
+ url: batchesEndpoint,
23
+ responseType: 'json',
24
+ });
25
+ return stamps_1.GetGlobalPostageBatchesResponse.parse(response.data).batches;
26
+ }
@@ -4,22 +4,16 @@ exports.upload = upload;
4
4
  exports.head = head;
5
5
  exports.download = download;
6
6
  exports.downloadReadable = downloadReadable;
7
+ const core_sdk_1 = require("@ethersphere/core-sdk");
7
8
  const cafe_utility_1 = require("cafe-utility");
8
9
  const upload_1 = require("../types/schema/upload");
9
- const bytes_1 = require("../utils/bytes");
10
10
  const headers_1 = require("../utils/headers");
11
11
  const http_1 = require("../utils/http");
12
12
  const schema_1 = require("../utils/schema");
13
13
  const type_1 = require("../utils/type");
14
- const typed_bytes_1 = require("../utils/typed-bytes");
15
14
  const endpoint = 'bytes';
16
15
  /**
17
- * Upload data to a Bee node
18
- *
19
- * @param requestOptions Options for making requests
20
- * @param data Data to be uploaded
21
- * @param postageBatchId Postage BatchId that will be assigned to uploaded data
22
- * @param options Additional options like tag, encryption, pinning
16
+ * Raw HTTP calls for the `/bytes` endpoint.
23
17
  */
24
18
  async function upload(requestOptions, data, postageBatchId, options) {
25
19
  const response = await (0, http_1.http)(requestOptions, {
@@ -37,18 +31,11 @@ async function upload(requestOptions, data, postageBatchId, options) {
37
31
  reference: body.reference,
38
32
  tagUid: response.headers['swarm-tag'] ? (0, type_1.makeTagUid)(response.headers['swarm-tag']) : undefined,
39
33
  historyAddress: response.headers['swarm-act-history-address']
40
- ? cafe_utility_1.Optional.of(new typed_bytes_1.Reference(response.headers['swarm-act-history-address']))
34
+ ? cafe_utility_1.Optional.of(new core_sdk_1.Reference(response.headers['swarm-act-history-address']))
41
35
  : cafe_utility_1.Optional.empty(),
42
36
  };
43
37
  }
44
- /**
45
- * Requests content length for a reference
46
- *
47
- * @param requestOptions Options for making requests
48
- * @param hash Bee content reference
49
- */
50
38
  async function head(requestOptions, reference) {
51
- reference = new typed_bytes_1.Reference(reference);
52
39
  const response = await (0, http_1.http)(requestOptions, {
53
40
  url: `${endpoint}/${reference}`,
54
41
  method: 'head',
@@ -58,12 +45,6 @@ async function head(requestOptions, reference) {
58
45
  contentLength: parseInt(response.headers['content-length']),
59
46
  };
60
47
  }
61
- /**
62
- * Download data as a byte array
63
- *
64
- * @param requestOptions Options for making requests
65
- * @param hash Bee content reference
66
- */
67
48
  async function download(requestOptions, resource, options) {
68
49
  if (options) {
69
50
  options = schema_1.DownloadOptionsSchema.parse(options);
@@ -73,14 +54,8 @@ async function download(requestOptions, resource, options) {
73
54
  url: `${endpoint}/${resource}`,
74
55
  headers: (0, headers_1.prepareRequestHeaders)(null, options),
75
56
  });
76
- return new bytes_1.Bytes(response.data);
57
+ return new core_sdk_1.Bytes(response.data);
77
58
  }
78
- /**
79
- * Download data as a readable stream
80
- *
81
- * @param requestOptions Options for making requests
82
- * @param hash Bee content reference
83
- */
84
59
  async function downloadReadable(requestOptions, resource, options) {
85
60
  if (options) {
86
61
  options = schema_1.DownloadOptionsSchema.parse(options);
@@ -4,24 +4,17 @@ exports.uploadFile = uploadFile;
4
4
  exports.downloadFile = downloadFile;
5
5
  exports.downloadFileReadable = downloadFileReadable;
6
6
  exports.uploadCollection = uploadCollection;
7
+ const core_sdk_1 = require("@ethersphere/core-sdk");
7
8
  const cafe_utility_1 = require("cafe-utility");
8
9
  const upload_1 = require("../types/schema/upload");
9
- const bytes_1 = require("../utils/bytes");
10
10
  const collection_1 = require("../utils/collection");
11
11
  const headers_1 = require("../utils/headers");
12
12
  const http_1 = require("../utils/http");
13
13
  const tar_uploader_1 = require("../utils/tar-uploader");
14
14
  const type_1 = require("../utils/type");
15
- const typed_bytes_1 = require("../utils/typed-bytes");
16
15
  const bzzEndpoint = 'bzz';
17
16
  /**
18
- * Upload single file
19
- *
20
- * @param requestOptions Options for making requests
21
- * @param data Files data
22
- * @param postageBatchId Postage BatchId that will be assigned to uploaded data
23
- * @param name Name that will be attached to the uploaded file. Wraps the data into manifest with set index document.
24
- * @param options
17
+ * Raw HTTP calls for the `/bzz` endpoint.
25
18
  */
26
19
  async function uploadFile(requestOptions, data, postageBatchId, name, options) {
27
20
  if ((0, type_1.isReadable)(data) && !options?.contentType) {
@@ -43,17 +36,10 @@ async function uploadFile(requestOptions, data, postageBatchId, name, options) {
43
36
  reference: body.reference,
44
37
  tagUid: response.headers['swarm-tag'] ? (0, type_1.makeTagUid)(response.headers['swarm-tag']) : undefined,
45
38
  historyAddress: response.headers['swarm-act-history-address']
46
- ? cafe_utility_1.Optional.of(new typed_bytes_1.Reference(response.headers['swarm-act-history-address']))
39
+ ? cafe_utility_1.Optional.of(new core_sdk_1.Reference(response.headers['swarm-act-history-address']))
47
40
  : cafe_utility_1.Optional.empty(),
48
41
  };
49
42
  }
50
- /**
51
- * Download single file as a buffer
52
- *
53
- * @param requestOptions Options for making requests
54
- * @param hash Bee file or collection hash
55
- * @param path If hash is collection then this defines path to a single file in the collection
56
- */
57
43
  async function downloadFile(requestOptions, resource, path = '', options) {
58
44
  const response = await (0, http_1.http)(requestOptions, {
59
45
  method: 'GET',
@@ -63,19 +49,12 @@ async function downloadFile(requestOptions, resource, path = '', options) {
63
49
  });
64
50
  const file = {
65
51
  ...(0, headers_1.readFileHeaders)(response.headers),
66
- data: new bytes_1.Bytes(response.data),
52
+ data: new core_sdk_1.Bytes(response.data),
67
53
  };
68
54
  return file;
69
55
  }
70
- /**
71
- * Download single file as a readable stream
72
- *
73
- * @param requestOptions Options for making requests
74
- * @param hash Bee file or collection hash
75
- * @param path If hash is collection then this defines path to a single file in the collection
76
- */
77
56
  async function downloadFileReadable(requestOptions, reference, path = '', options) {
78
- reference = new typed_bytes_1.Reference(reference);
57
+ reference = new core_sdk_1.Reference(reference);
79
58
  const response = await (0, http_1.http)(requestOptions, {
80
59
  method: 'GET',
81
60
  responseType: 'stream',
@@ -90,13 +69,6 @@ async function downloadFileReadable(requestOptions, reference, path = '', option
90
69
  }
91
70
  /*******************************************************************************************************************/
92
71
  // Collections
93
- /**
94
- * Upload collection
95
- * @param requestOptions Options for making requests
96
- * @param collection Collection of Uint8Array buffers to upload
97
- * @param postageBatchId Postage BatchId that will be assigned to uploaded data
98
- * @param options
99
- */
100
72
  async function uploadCollection(requestOptions, collection, postageBatchId, options) {
101
73
  (0, collection_1.assertCollection)(collection);
102
74
  const response = await (0, tar_uploader_1.uploadTar)(requestOptions, collection, postageBatchId, options);
@@ -105,7 +77,7 @@ async function uploadCollection(requestOptions, collection, postageBatchId, opti
105
77
  reference: body.reference,
106
78
  tagUid: response.headers['swarm-tag'] ? (0, type_1.makeTagUid)(response.headers['swarm-tag']) : undefined,
107
79
  historyAddress: response.headers['swarm-act-history-address']
108
- ? cafe_utility_1.Optional.of(new typed_bytes_1.Reference(response.headers['swarm-act-history-address']))
80
+ ? cafe_utility_1.Optional.of(new core_sdk_1.Reference(response.headers['swarm-act-history-address']))
109
81
  : cafe_utility_1.Optional.empty(),
110
82
  };
111
83
  }