@ethersphere/bee-js 13.0.0-upcoming.gcfb9756 → 13.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 (201) hide show
  1. package/README.md +104 -103
  2. package/dist/cjs/api/bytes.js +3 -4
  3. package/dist/cjs/api/bzz.js +5 -6
  4. package/dist/cjs/api/chunk.js +3 -3
  5. package/dist/cjs/api/envelope.js +3 -2
  6. package/dist/cjs/api/feed.js +4 -5
  7. package/dist/cjs/api/pin.js +2 -2
  8. package/dist/cjs/api/soc.js +2 -2
  9. package/dist/cjs/bee.js +18 -19
  10. package/dist/cjs/chunk/soc.js +21 -63
  11. package/dist/cjs/feed/identifier.js +3 -4
  12. package/dist/cjs/feed/index.js +17 -19
  13. package/dist/cjs/feed/retrievable.js +2 -2
  14. package/dist/cjs/index.js +18 -8
  15. package/dist/cjs/manifest/manifest.js +97 -333
  16. package/dist/cjs/modules/balance.js +3 -3
  17. package/dist/cjs/modules/cheque.js +4 -4
  18. package/dist/cjs/modules/chunk.js +8 -8
  19. package/dist/cjs/modules/collection.js +6 -6
  20. package/dist/cjs/modules/connectivity.js +3 -3
  21. package/dist/cjs/modules/data.js +6 -6
  22. package/dist/cjs/modules/feed.js +10 -10
  23. package/dist/cjs/modules/file.js +3 -3
  24. package/dist/cjs/modules/grantee.js +9 -9
  25. package/dist/cjs/modules/messaging.js +15 -17
  26. package/dist/cjs/modules/pin.js +6 -6
  27. package/dist/cjs/modules/settlement.js +2 -2
  28. package/dist/cjs/modules/soc.js +3 -3
  29. package/dist/cjs/modules/stamp.js +7 -7
  30. package/dist/cjs/modules/tag.js +2 -2
  31. package/dist/cjs/modules/transaction.js +4 -4
  32. package/dist/cjs/modules/wallet.js +3 -3
  33. package/dist/cjs/types/schema/chequebook.js +5 -5
  34. package/dist/cjs/types/schema/connectivity.js +5 -5
  35. package/dist/cjs/types/schema/envelope.js +5 -5
  36. package/dist/cjs/types/schema/grantee.js +4 -4
  37. package/dist/cjs/types/schema/stake.js +2 -2
  38. package/dist/cjs/types/schema/stamps.js +4 -4
  39. package/dist/cjs/types/schema/states.js +2 -2
  40. package/dist/cjs/types/schema/transactions.js +3 -3
  41. package/dist/cjs/types/schema/upload.js +2 -2
  42. package/dist/cjs/utils/chunk-stream.browser.js +24 -16
  43. package/dist/cjs/utils/chunk-stream.js +17 -9
  44. package/dist/cjs/utils/constants.js +3 -3
  45. package/dist/cjs/utils/expose.js +4 -4
  46. package/dist/cjs/utils/headers.js +4 -4
  47. package/dist/cjs/utils/http.js +3 -1
  48. package/dist/cjs/utils/pss.js +2 -2
  49. package/dist/cjs/utils/resource-locator.js +2 -2
  50. package/dist/cjs/utils/schema.js +4 -4
  51. package/dist/cjs/utils/stamps.js +15 -130
  52. package/dist/cjs/utils/type.js +2 -2
  53. package/dist/codemod/index.js +141 -0
  54. package/dist/codemod/transforms/v13.js +524 -0
  55. package/dist/index.browser.min.js +2 -1
  56. package/dist/index.browser.min.js.LICENSE.txt +3 -0
  57. package/dist/index.browser.min.js.map +1 -1
  58. package/dist/mjs/api/bytes.js +1 -2
  59. package/dist/mjs/api/bzz.js +1 -2
  60. package/dist/mjs/api/chunk.js +1 -1
  61. package/dist/mjs/api/envelope.js +3 -2
  62. package/dist/mjs/api/feed.js +1 -2
  63. package/dist/mjs/api/pin.js +1 -1
  64. package/dist/mjs/api/soc.js +1 -1
  65. package/dist/mjs/bee.js +13 -14
  66. package/dist/mjs/chunk/soc.js +11 -49
  67. package/dist/mjs/feed/identifier.js +2 -3
  68. package/dist/mjs/feed/index.js +6 -8
  69. package/dist/mjs/feed/retrievable.js +1 -1
  70. package/dist/mjs/index.js +2 -5
  71. package/dist/mjs/manifest/manifest.js +95 -339
  72. package/dist/mjs/modules/balance.js +1 -1
  73. package/dist/mjs/modules/cheque.js +1 -1
  74. package/dist/mjs/modules/chunk.js +1 -1
  75. package/dist/mjs/modules/collection.js +1 -1
  76. package/dist/mjs/modules/connectivity.js +1 -1
  77. package/dist/mjs/modules/data.js +3 -3
  78. package/dist/mjs/modules/feed.js +1 -1
  79. package/dist/mjs/modules/file.js +1 -1
  80. package/dist/mjs/modules/grantee.js +1 -1
  81. package/dist/mjs/modules/messaging.js +3 -5
  82. package/dist/mjs/modules/pin.js +1 -1
  83. package/dist/mjs/modules/settlement.js +1 -1
  84. package/dist/mjs/modules/soc.js +1 -1
  85. package/dist/mjs/modules/stamp.js +1 -1
  86. package/dist/mjs/modules/tag.js +1 -1
  87. package/dist/mjs/modules/transaction.js +1 -1
  88. package/dist/mjs/modules/wallet.js +1 -1
  89. package/dist/mjs/types/schema/chequebook.js +1 -1
  90. package/dist/mjs/types/schema/connectivity.js +1 -1
  91. package/dist/mjs/types/schema/envelope.js +5 -5
  92. package/dist/mjs/types/schema/grantee.js +1 -1
  93. package/dist/mjs/types/schema/stake.js +1 -1
  94. package/dist/mjs/types/schema/stamps.js +1 -1
  95. package/dist/mjs/types/schema/states.js +1 -1
  96. package/dist/mjs/types/schema/transactions.js +1 -1
  97. package/dist/mjs/types/schema/upload.js +1 -1
  98. package/dist/mjs/utils/chunk-stream.browser.js +28 -18
  99. package/dist/mjs/utils/chunk-stream.js +21 -11
  100. package/dist/mjs/utils/constants.js +1 -1
  101. package/dist/mjs/utils/expose.js +1 -1
  102. package/dist/mjs/utils/headers.js +1 -1
  103. package/dist/mjs/utils/http.js +6 -1
  104. package/dist/mjs/utils/pss.js +1 -1
  105. package/dist/mjs/utils/resource-locator.js +1 -1
  106. package/dist/mjs/utils/schema.js +1 -1
  107. package/dist/mjs/utils/stamps.js +5 -99
  108. package/dist/mjs/utils/type.js +2 -2
  109. package/dist/types/api/balance.d.ts +1 -1
  110. package/dist/types/api/batches.d.ts +1 -1
  111. package/dist/types/api/bytes.d.ts +3 -3
  112. package/dist/types/api/bzz.d.ts +1 -2
  113. package/dist/types/api/chequebook.d.ts +1 -1
  114. package/dist/types/api/chunk.d.ts +1 -1
  115. package/dist/types/api/connectivity.d.ts +1 -1
  116. package/dist/types/api/consumed.d.ts +1 -1
  117. package/dist/types/api/envelope.d.ts +1 -1
  118. package/dist/types/api/feed.d.ts +1 -2
  119. package/dist/types/api/grantee.d.ts +1 -1
  120. package/dist/types/api/pin.d.ts +1 -1
  121. package/dist/types/api/pss.d.ts +1 -1
  122. package/dist/types/api/settlement.d.ts +1 -1
  123. package/dist/types/api/soc.d.ts +1 -1
  124. package/dist/types/api/stake.d.ts +1 -1
  125. package/dist/types/api/stamp.d.ts +1 -1
  126. package/dist/types/api/stewardship.d.ts +1 -1
  127. package/dist/types/api/tag.d.ts +1 -1
  128. package/dist/types/api/transaction.d.ts +1 -1
  129. package/dist/types/api/wallet.d.ts +1 -1
  130. package/dist/types/bee.d.ts +11 -13
  131. package/dist/types/chunk/soc.d.ts +3 -48
  132. package/dist/types/feed/identifier.d.ts +1 -1
  133. package/dist/types/feed/index.d.ts +1 -3
  134. package/dist/types/feed/retrievable.d.ts +1 -1
  135. package/dist/types/index.d.ts +17 -20
  136. package/dist/types/manifest/manifest.d.ts +24 -33
  137. package/dist/types/modules/balance.d.ts +1 -1
  138. package/dist/types/modules/cheque.d.ts +1 -1
  139. package/dist/types/modules/chequebook.d.ts +1 -1
  140. package/dist/types/modules/chunk.d.ts +1 -2
  141. package/dist/types/modules/collection.d.ts +2 -2
  142. package/dist/types/modules/connectivity.d.ts +1 -1
  143. package/dist/types/modules/context.d.ts +1 -1
  144. package/dist/types/modules/data.d.ts +3 -3
  145. package/dist/types/modules/feed.d.ts +1 -1
  146. package/dist/types/modules/file.d.ts +1 -2
  147. package/dist/types/modules/grantee.d.ts +1 -1
  148. package/dist/types/modules/messaging.d.ts +1 -2
  149. package/dist/types/modules/pin.d.ts +1 -1
  150. package/dist/types/modules/settlement.d.ts +1 -1
  151. package/dist/types/modules/soc.d.ts +1 -1
  152. package/dist/types/modules/stake.d.ts +1 -1
  153. package/dist/types/modules/stamp.d.ts +1 -1
  154. package/dist/types/modules/storage.d.ts +1 -1
  155. package/dist/types/modules/tag.d.ts +1 -1
  156. package/dist/types/modules/transaction.d.ts +1 -1
  157. package/dist/types/modules/wallet.d.ts +1 -1
  158. package/dist/types/types/debug.d.ts +1 -1
  159. package/dist/types/types/index.d.ts +2 -11
  160. package/dist/types/types/schema/chequebook.d.ts +1 -1
  161. package/dist/types/types/schema/connectivity.d.ts +1 -1
  162. package/dist/types/types/schema/grantee.d.ts +1 -1
  163. package/dist/types/types/schema/stake.d.ts +1 -1
  164. package/dist/types/types/schema/stamps.d.ts +1 -1
  165. package/dist/types/types/schema/states.d.ts +1 -1
  166. package/dist/types/types/schema/transactions.d.ts +1 -1
  167. package/dist/types/types/schema/upload.d.ts +1 -1
  168. package/dist/types/utils/chunk-stream.browser.d.ts +1 -1
  169. package/dist/types/utils/chunk-stream.d.ts +2 -2
  170. package/dist/types/utils/constants.d.ts +1 -1
  171. package/dist/types/utils/expose.d.ts +1 -1
  172. package/dist/types/utils/headers.d.ts +1 -1
  173. package/dist/types/utils/pss.d.ts +1 -1
  174. package/dist/types/utils/resource-locator.d.ts +1 -1
  175. package/dist/types/utils/schema.d.ts +1 -1
  176. package/dist/types/utils/stamps.d.ts +2 -27
  177. package/dist/types/utils/tar-uploader.browser.d.ts +1 -1
  178. package/dist/types/utils/tar-uploader.d.ts +1 -1
  179. package/dist/types/utils/type.d.ts +1 -1
  180. package/package.json +7 -2
  181. package/dist/cjs/chunk/bmt.js +0 -37
  182. package/dist/cjs/chunk/cac.js +0 -43
  183. package/dist/cjs/stamper/stamper.js +0 -44
  184. package/dist/cjs/utils/bytes.js +0 -116
  185. package/dist/cjs/utils/cid.js +0 -37
  186. package/dist/cjs/utils/redundancy.js +0 -133
  187. package/dist/cjs/utils/typed-bytes.js +0 -186
  188. package/dist/mjs/chunk/bmt.js +0 -34
  189. package/dist/mjs/chunk/cac.js +0 -34
  190. package/dist/mjs/stamper/stamper.js +0 -40
  191. package/dist/mjs/utils/bytes.js +0 -102
  192. package/dist/mjs/utils/cid.js +0 -32
  193. package/dist/mjs/utils/redundancy.js +0 -98
  194. package/dist/mjs/utils/typed-bytes.js +0 -167
  195. package/dist/types/chunk/bmt.d.ts +0 -16
  196. package/dist/types/chunk/cac.d.ts +0 -40
  197. package/dist/types/stamper/stamper.d.ts +0 -15
  198. package/dist/types/utils/bytes.d.ts +0 -19
  199. package/dist/types/utils/cid.d.ts +0 -10
  200. package/dist/types/utils/redundancy.d.ts +0 -21
  201. package/dist/types/utils/typed-bytes.d.ts +0 -69
@@ -1,5 +1,5 @@
1
+ import { BatchId, Reference } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions } from '../types';
2
- import { BatchId, Reference } from '../utils/typed-bytes';
3
3
  /**
4
4
  * Raw HTTP calls for the `/stewardship` endpoint.
5
5
  */
@@ -1,5 +1,5 @@
1
+ import { Reference } from '@ethersphere/core-sdk';
1
2
  import type { AllTagsOptions, BeeRequestOptions, Tag as TagData } from '../types';
2
- import { Reference } from '../utils/typed-bytes';
3
3
  /** Creates a new tag. */
4
4
  export declare function createTag(requestOptions: BeeRequestOptions): Promise<TagData>;
5
5
  /** Fetches all tags in a paginated manner. */
@@ -1,5 +1,5 @@
1
+ import { TransactionId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, NumberString, TransactionInfo } from '../types';
2
- import { TransactionId } from '../utils/typed-bytes';
3
3
  /**
4
4
  * Raw HTTP calls for the `/transactions` endpoint.
5
5
  */
@@ -1,6 +1,6 @@
1
+ import { EthAddress, TransactionId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, WalletBalance } from '../types';
2
3
  import { BZZ, DAI } from '../utils/tokens';
3
- import { EthAddress, TransactionId } from '../utils/typed-bytes';
4
4
  /**
5
5
  * Raw HTTP calls for the `/wallet` endpoint.
6
6
  */
@@ -1,29 +1,27 @@
1
- import { Chunk } from './chunk/cac';
1
+ import { BatchId, Bytes, Chunk, EthAddress, Identifier, PrivateKey, Reference, Span } from '@ethersphere/core-sdk';
2
2
  import { SingleOwnerChunk } from './chunk/soc';
3
3
  import { Balance } from './modules/balance';
4
4
  import { Cheque } from './modules/cheque';
5
5
  import { Chequebook } from './modules/chequebook';
6
- import { Connectivity } from './modules/connectivity';
7
- import { Settlement } from './modules/settlement';
8
- import { Stake } from './modules/stake';
9
- import { Stamp } from './modules/stamp';
10
- import { Storage } from './modules/storage';
11
- import { Status } from './modules/status';
12
- import { Wallet } from './modules/wallet';
13
- import { Transaction } from './modules/transaction';
14
6
  import { Chunk as ChunkNamespace } from './modules/chunk';
15
7
  import { Collection } from './modules/collection';
8
+ import { Connectivity } from './modules/connectivity';
16
9
  import { Data } from './modules/data';
17
- import { File as FileNamespace } from './modules/file';
18
10
  import { Feed } from './modules/feed';
19
- import { Soc } from './modules/soc';
11
+ import { File as FileNamespace } from './modules/file';
20
12
  import { Grantee } from './modules/grantee';
21
13
  import { Messaging } from './modules/messaging';
22
14
  import { Pin } from './modules/pin';
15
+ import { Settlement } from './modules/settlement';
16
+ import { Soc } from './modules/soc';
17
+ import { Stake } from './modules/stake';
18
+ import { Stamp } from './modules/stamp';
19
+ import { Status } from './modules/status';
20
+ import { Storage } from './modules/storage';
23
21
  import { Tag } from './modules/tag';
22
+ import { Transaction } from './modules/transaction';
23
+ import { Wallet } from './modules/wallet';
24
24
  import type { BeeOptions, BeeRequestOptions, EnvelopeWithBatchId } from './types';
25
- import { Bytes } from './utils/bytes';
26
- import { BatchId, EthAddress, Identifier, PrivateKey, Reference, Span } from './utils/typed-bytes';
27
25
  /**
28
26
  * The main component that abstracts operations available on the Bee API.
29
27
  *
@@ -1,51 +1,7 @@
1
+ import { BatchId, Bytes, Chunk, EthAddress, Identifier, PrivateKey, Reference, SingleOwnerChunk, Span, makeSOCAddress } from '@ethersphere/core-sdk';
1
2
  import { BeeRequestOptions, UploadOptions, UploadResult } from '../types';
2
- import { Bytes } from '../utils/bytes';
3
- import { BatchId, EthAddress, Identifier, PrivateKey, Reference, Signature, Span } from '../utils/typed-bytes';
4
- import { Chunk } from './cac';
5
- /**
6
- * Single Owner Chunk (SOC) is a chunk type where the address is determined by the owner and an arbitrary identifier.
7
- * Its integrity is attested by the owner's digital signature.
8
- *
9
- * Similar to Content Addressed Chunks (CAC), SOCs have a maximum payload size of 4096 bytes.
10
- *
11
- * - `span` indicates the size of the `payload` in bytes.
12
- * - `payload` contains the actual data or the body of the chunk.
13
- * - `data` contains the full chunk data - `span` and `payload`.
14
- * - `address` is the Swarm hash (or reference) of the chunk.
15
- * - `identifier` is an arbitrary identifier selected by the uploader.
16
- * - `signature` is the digital signature of the owner over the identifier and the underlying CAC address.
17
- * - `owner` is the Ethereum address of the chunk owner.
18
- */
19
- export interface SingleOwnerChunk {
20
- /**
21
- * Contains the full chunk data - `span` + `payload`.
22
- */
23
- readonly data: Uint8Array;
24
- /**
25
- * Indicates the size of the `payload` in bytes.
26
- */
27
- span: Span;
28
- /**
29
- * Contains the actual data or the body of the chunk.
30
- */
31
- payload: Bytes;
32
- /**
33
- * The Swarm hash (or reference) of the chunk.
34
- */
35
- address: Reference;
36
- /**
37
- * An arbitrary identifier selected by the uploader.
38
- */
39
- identifier: Identifier;
40
- /**
41
- * The digital signature of the owner over the identifier and the underlying CAC address.
42
- */
43
- signature: Signature;
44
- /**
45
- * The Ethereum address of the chunk owner.
46
- */
47
- owner: EthAddress;
48
- }
3
+ export { makeSOCAddress };
4
+ export type { SingleOwnerChunk };
49
5
  /**
50
6
  * Unmarshals arbitrary data into a Single Owner Chunk.
51
7
  * Throws an error if the data is not a valid SOC.
@@ -56,7 +12,6 @@ export interface SingleOwnerChunk {
56
12
  * @returns a single owner chunk or throws error
57
13
  */
58
14
  export declare function unmarshalSingleOwnerChunk(data: Bytes | Uint8Array, address: Reference | Uint8Array | string): SingleOwnerChunk;
59
- export declare function makeSOCAddress(identifier: Identifier, address: EthAddress): Reference;
60
15
  /**
61
16
  * Creates a single owner chunk object
62
17
  *
@@ -1,2 +1,2 @@
1
- import { FeedIndex, Identifier, Topic } from '../utils/typed-bytes';
1
+ import { FeedIndex, Identifier, Topic } from '@ethersphere/core-sdk';
2
2
  export declare function makeFeedIdentifier(topic: Topic, index: FeedIndex | number): Identifier;
@@ -1,9 +1,7 @@
1
1
  import { Optional } from 'cafe-utility';
2
- import { Chunk } from '../chunk/cac';
2
+ import { BatchId, Bytes, Chunk, EthAddress, FeedIndex, PrivateKey, Reference, Topic } from '@ethersphere/core-sdk';
3
3
  import { FeedUpdateOptions } from '../api/feed';
4
4
  import { BeeRequestOptions, FeedReader, FeedWriter, UploadOptions, UploadResult } from '../types';
5
- import { Bytes } from '../utils/bytes';
6
- import { BatchId, EthAddress, FeedIndex, PrivateKey, Reference, Topic } from '../utils/typed-bytes';
7
5
  export interface Epoch {
8
6
  time: number;
9
7
  level: number;
@@ -1,4 +1,4 @@
1
+ import { EthAddress, FeedIndex, Topic } from '@ethersphere/core-sdk';
1
2
  import { Bee } from '../bee';
2
3
  import { BeeRequestOptions, DownloadOptions } from '../types';
3
- import { EthAddress, FeedIndex, Topic } from '../utils/typed-bytes';
4
4
  export declare function areAllSequentialFeedsUpdateRetrievable(bee: Bee, owner: EthAddress, topic: Topic, index: FeedIndex, options: DownloadOptions | undefined, requestOptions: BeeRequestOptions): Promise<boolean>;
@@ -1,26 +1,23 @@
1
1
  import { Bee } from './bee';
2
- import { Stamper } from './stamper/stamper';
3
- export { MerkleTree } from 'cafe-utility';
4
- export type { Chunk } from './chunk/cac';
2
+ export { BatchId, Bytes, ChunkBuilder, ChunkSplitter, EthAddress, FeedIndex, Identifier, PeerAddress, PrivateKey, PublicKey, Reference, Signature, Span, Stamper, Topic, TransactionId, } from '@ethersphere/core-sdk';
3
+ export type { Chunk } from '@ethersphere/core-sdk';
5
4
  export type { SingleOwnerChunk } from './chunk/soc';
6
5
  export { MantarayNode } from './manifest/manifest';
7
6
  export { SUPPORTED_BEE_VERSION, SUPPORTED_BEE_VERSION_EXACT } from './version';
8
7
  export * from './types';
9
- export { Bytes } from './utils/bytes';
10
8
  export * from './utils/constants';
11
9
  export { Duration } from './utils/duration';
12
10
  export * from './utils/error';
13
11
  export * as Utils from './utils/expose';
14
12
  export { Size } from './utils/size';
15
13
  export * from './utils/tokens';
16
- export * from './utils/typed-bytes';
17
14
  export type { UploadProgress } from './utils/upload-progress';
18
- export { Bee, Stamper };
15
+ export { Bee };
19
16
  declare global {
20
17
  interface Window {
21
18
  BeeJs: {
22
19
  Bee: typeof import('./bee').Bee;
23
- Stamper: typeof import('./stamper/stamper').Stamper;
20
+ Stamper: typeof import('@ethersphere/core-sdk').Stamper;
24
21
  Utils: typeof import('./utils/expose');
25
22
  Duration: typeof import('./utils/duration').Duration;
26
23
  Size: typeof import('./utils/size').Size;
@@ -28,19 +25,19 @@ declare global {
28
25
  BeeArgumentError: typeof import('./utils/error').BeeArgumentError;
29
26
  BeeResponseError: typeof import('./utils/error').BeeResponseError;
30
27
  MantarayNode: typeof import('./manifest/manifest').MantarayNode;
31
- MerkleTree: typeof import('cafe-utility').MerkleTree;
32
- PrivateKey: typeof import('./utils/typed-bytes').PrivateKey;
33
- PublicKey: typeof import('./utils/typed-bytes').PublicKey;
34
- EthAddress: typeof import('./utils/typed-bytes').EthAddress;
35
- Identifier: typeof import('./utils/typed-bytes').Identifier;
36
- Reference: typeof import('./utils/typed-bytes').Reference;
37
- TransactionId: typeof import('./utils/typed-bytes').TransactionId;
38
- Span: typeof import('./utils/typed-bytes').Span;
39
- PeerAddress: typeof import('./utils/typed-bytes').PeerAddress;
40
- BatchId: typeof import('./utils/typed-bytes').BatchId;
41
- Signature: typeof import('./utils/typed-bytes').Signature;
42
- Topic: typeof import('./utils/typed-bytes').Topic;
43
- FeedIndex: typeof import('./utils/typed-bytes').FeedIndex;
28
+ ChunkSplitter: typeof import('@ethersphere/core-sdk').ChunkSplitter;
29
+ PrivateKey: typeof import('@ethersphere/core-sdk').PrivateKey;
30
+ PublicKey: typeof import('@ethersphere/core-sdk').PublicKey;
31
+ EthAddress: typeof import('@ethersphere/core-sdk').EthAddress;
32
+ Identifier: typeof import('@ethersphere/core-sdk').Identifier;
33
+ Reference: typeof import('@ethersphere/core-sdk').Reference;
34
+ TransactionId: typeof import('@ethersphere/core-sdk').TransactionId;
35
+ Span: typeof import('@ethersphere/core-sdk').Span;
36
+ PeerAddress: typeof import('@ethersphere/core-sdk').PeerAddress;
37
+ BatchId: typeof import('@ethersphere/core-sdk').BatchId;
38
+ Signature: typeof import('@ethersphere/core-sdk').Signature;
39
+ Topic: typeof import('@ethersphere/core-sdk').Topic;
40
+ FeedIndex: typeof import('@ethersphere/core-sdk').FeedIndex;
44
41
  };
45
42
  }
46
43
  }
@@ -1,35 +1,27 @@
1
- import { Optional, Uint8ArrayReader } from 'cafe-utility';
1
+ import { Optional } from 'cafe-utility';
2
2
  import { Bee, BeeRequestOptions, DownloadOptions, UploadOptions, UploadResult } from '..';
3
3
  import { FeedPayloadResult } from '../api/feed';
4
- import { Bytes } from '../utils/bytes';
5
- import { BatchId, Reference } from '../utils/typed-bytes';
6
- export declare class Fork {
7
- prefix: Uint8Array;
8
- node: MantarayNode;
9
- constructor(prefix: Uint8Array, node: MantarayNode);
10
- static split(a: Fork, b: Fork): Fork;
11
- marshal(): Uint8Array;
12
- static unmarshal(reader: Uint8ArrayReader, addressLength: number): Fork;
13
- }
14
- interface MantarayNodeOptions {
15
- selfAddress?: Uint8Array;
16
- targetAddress?: Uint8Array;
17
- obfuscationKey?: Uint8Array;
18
- metadata?: Record<string, string> | null;
19
- path?: Uint8Array | null;
20
- parent?: MantarayNode | null;
21
- type?: number | null;
22
- }
4
+ import { BatchId, Bytes, MantarayNode as CoreMantarayNode, Reference } from '@ethersphere/core-sdk';
5
+ /**
6
+ * bee-js's Bee-client-coupled view of a Mantaray node: the trie structure,
7
+ * marshaling, and byte-level operations all delegate to core-sdk's
8
+ * `MantarayNode`; this class only adds what needs a live `Bee` instance
9
+ * (uploading/downloading, ACT history, feed resolution).
10
+ */
23
11
  export declare class MantarayNode {
24
- obfuscationKey: Uint8Array;
25
- selfAddress: Uint8Array | null;
26
- targetAddress: Uint8Array;
27
- metadata: Record<string, string> | undefined | null;
28
- path: Uint8Array;
29
- forks: Map<number, Fork>;
30
- parent: MantarayNode | null;
31
- type: number | null;
32
- constructor(options?: MantarayNodeOptions);
12
+ readonly core: CoreMantarayNode;
13
+ constructor(core?: CoreMantarayNode);
14
+ get obfuscationKey(): Uint8Array;
15
+ get selfAddress(): Uint8Array | null;
16
+ get targetAddress(): Uint8Array;
17
+ get metadata(): Record<string, string> | undefined | null;
18
+ get path(): Uint8Array;
19
+ get forks(): Map<number, {
20
+ prefix: Uint8Array;
21
+ node: CoreMantarayNode;
22
+ }>;
23
+ get parent(): CoreMantarayNode | null;
24
+ get type(): number | null;
33
25
  get fullPath(): Uint8Array;
34
26
  get fullPathString(): string;
35
27
  /**
@@ -86,17 +78,17 @@ export declare class MantarayNode {
86
78
  /**
87
79
  * Finds a node in the tree by its path.
88
80
  */
89
- find(path: string | Uint8Array): MantarayNode | null;
81
+ find(path: string | Uint8Array): CoreMantarayNode | null;
90
82
  /**
91
83
  * Finds the closest node in the tree to the given path.
92
84
  */
93
- findClosest(path: string | Uint8Array, current?: Uint8Array): [MantarayNode, Uint8Array];
85
+ findClosest(path: string | Uint8Array, current?: Uint8Array): [CoreMantarayNode, Uint8Array];
94
86
  /**
95
87
  * Returns an array of all nodes in the tree which have a target address set.
96
88
  *
97
89
  * Must be called after `loadRecursively`.
98
90
  */
99
- collect(nodes?: MantarayNode[]): MantarayNode[];
91
+ collect(nodes?: CoreMantarayNode[]): CoreMantarayNode[];
100
92
  /**
101
93
  * Returns a path:reference map of all nodes in the tree which have a target address set.
102
94
  *
@@ -105,4 +97,3 @@ export declare class MantarayNode {
105
97
  collectAndMap(): Record<string, string>;
106
98
  determineType(): number;
107
99
  }
108
- export {};
@@ -1,5 +1,5 @@
1
+ import { PeerAddress } from '@ethersphere/core-sdk';
1
2
  import type { BalanceResponse, BeeRequestOptions, PeerBalance } from '../types';
2
- import { PeerAddress } from '../utils/typed-bytes';
3
3
  import type { BeeContext } from './context';
4
4
  /**
5
5
  * SWAP balance operations. Related to the bandwidth incentives and the chequebook.
@@ -1,5 +1,5 @@
1
+ import { PeerAddress, TransactionId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, TransactionOptions } from '../types';
2
- import { PeerAddress, TransactionId } from '../utils/typed-bytes';
3
3
  import type { BeeContext } from './context';
4
4
  /**
5
5
  * Cheque operations (last cheques and cashouts).
@@ -1,6 +1,6 @@
1
+ import { TransactionId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, ChequebookAddressResponse, ChequebookBalanceResponse, NumberString } from '../types';
2
3
  import { BZZ } from '../utils/tokens';
3
- import { TransactionId } from '../utils/typed-bytes';
4
4
  import type { BeeContext } from './context';
5
5
  /**
6
6
  * Chequebook contract operations (address, balance, deposit, withdraw).
@@ -1,8 +1,7 @@
1
- import { Chunk as ContentAddressedChunk } from '../chunk/cac';
1
+ import { BatchId, Chunk as ContentAddressedChunk, Reference } from '@ethersphere/core-sdk';
2
2
  import { SingleOwnerChunk } from '../chunk/soc';
3
3
  import type { BeeRequestOptions, DownloadOptions, EnvelopeWithBatchId, UploadOptions } from '../types';
4
4
  import { UploadResult } from '../types';
5
- import { BatchId, Reference } from '../utils/typed-bytes';
6
5
  import type { BeeContext } from './context';
7
6
  /**
8
7
  * Chunk operations backed by the `/chunks` endpoint.
@@ -1,6 +1,6 @@
1
+ import { BatchId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, CollectionUploadOptions, UploadOptions, UploadResult } from '../types';
2
3
  import { Collection as CollectionData } from '../types';
3
- import { BatchId } from '../utils/typed-bytes';
4
4
  import { UploadProgress } from '../utils/upload-progress';
5
5
  import type { BeeContext } from './context';
6
6
  /**
@@ -73,5 +73,5 @@ export declare class Collection {
73
73
  *
74
74
  * @param dir
75
75
  */
76
- hashDirectory(dir: string): Promise<import("../utils/typed-bytes").Reference>;
76
+ hashDirectory(dir: string): Promise<import("@ethersphere/core-sdk").Reference>;
77
77
  }
@@ -1,6 +1,6 @@
1
+ import { PeerAddress } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, Peer, PingResponse, RemovePeerResponse, Topology } from '../types';
2
3
  import { NodeAddresses } from '../types/debug';
3
- import { PeerAddress } from '../utils/typed-bytes';
4
4
  import type { BeeContext } from './context';
5
5
  /**
6
6
  * Peer, topology and network connectivity operations.
@@ -1,6 +1,6 @@
1
+ import { PrivateKey } from '@ethersphere/core-sdk';
1
2
  import type { Bee } from '../bee';
2
3
  import type { BeeRequestOptions } from '../types';
3
- import type { PrivateKey } from '../utils/typed-bytes';
4
4
  /**
5
5
  * Facade a Bee instance hands to each module (namespace) class.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BatchId, Bytes, Reference } from '@ethersphere/core-sdk';
2
+ import { Readable } from 'stream';
1
3
  import type { BeeRequestOptions, DownloadOptions, RedundantUploadOptions, ReferenceInformation, UploadResult } from '../types';
2
- import { Bytes } from '../utils/bytes';
3
- import { BatchId, Reference } from '../utils/typed-bytes';
4
4
  import type { BeeContext } from './context';
5
5
  /**
6
6
  * Raw data operations backed by the `/bytes` endpoint.
@@ -20,7 +20,7 @@ export declare class Data {
20
20
  * @param options Additional options like tag, encryption, pinning, content-type and request options.
21
21
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
22
22
  */
23
- upload(postageBatchId: BatchId | Uint8Array | string, data: string | Uint8Array, options?: RedundantUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
23
+ upload(postageBatchId: BatchId | Uint8Array | string, data: string | Uint8Array | Blob | Readable, options?: RedundantUploadOptions, requestOptions?: BeeRequestOptions): Promise<UploadResult>;
24
24
  /**
25
25
  * Downloads raw data through the `GET /bytes/{reference}` endpoint.
26
26
  *
@@ -1,7 +1,7 @@
1
+ import { BatchId, EthAddress, FeedIndex, PrivateKey, Reference, Topic } from '@ethersphere/core-sdk';
1
2
  import type { FeedPayloadResult } from '../api/feed';
2
3
  import type { BeeRequestOptions, DownloadOptions, FeedReader, FeedWriter } from '../types';
3
4
  import { UploadOptions } from '../types';
4
- import { BatchId, EthAddress, FeedIndex, PrivateKey, Reference, Topic } from '../utils/typed-bytes';
5
5
  import type { BeeContext } from './context';
6
6
  /**
7
7
  * Feed operations.
@@ -1,7 +1,6 @@
1
+ import { BatchId, Bytes, Reference } from '@ethersphere/core-sdk';
1
2
  import { Readable } from 'stream';
2
3
  import type { BeeRequestOptions, DownloadOptions, FileData, FileUploadOptions, UploadResult } from '../types';
3
- import { Bytes } from '../utils/bytes';
4
- import { BatchId, Reference } from '../utils/typed-bytes';
5
4
  import type { BeeContext } from './context';
6
5
  /**
7
6
  * Single-file operations backed by the `/bzz` endpoint.
@@ -1,5 +1,5 @@
1
+ import { BatchId, PublicKey, Reference } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, GetGranteesResult, GranteesResult } from '../types';
2
- import { BatchId, PublicKey, Reference } from '../utils/typed-bytes';
3
3
  import type { BeeContext } from './context';
4
4
  /**
5
5
  * Grantee (access control) operations.
@@ -1,6 +1,5 @@
1
+ import { BatchId, Bytes, EthAddress, Identifier, PeerAddress, PrivateKey, PublicKey, Topic } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, GsocMessageHandler, GsocSubscription, PssMessageHandler, PssSubscription, UploadOptions } from '../types';
2
- import { Bytes } from '../utils/bytes';
3
- import { BatchId, EthAddress, Identifier, PeerAddress, PrivateKey, PublicKey, Topic } from '../utils/typed-bytes';
4
3
  import type { BeeContext } from './context';
5
4
  /**
6
5
  * Messaging protocols — PSS (Postal Service for Swarm) and GSOC. Method names keep
@@ -1,5 +1,5 @@
1
+ import { BatchId, Reference } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, Pin as PinData } from '../types';
2
- import { BatchId, Reference } from '../utils/typed-bytes';
3
3
  import type { BeeContext } from './context';
4
4
  /**
5
5
  * Local pinning operations.
@@ -1,5 +1,5 @@
1
+ import { PeerAddress } from '@ethersphere/core-sdk';
1
2
  import type { AllSettlements, BeeRequestOptions, Settlements } from '../types';
2
- import { PeerAddress } from '../utils/typed-bytes';
3
3
  import type { BeeContext } from './context';
4
4
  /**
5
5
  * Settlement operations. Related to the bandwidth incentives and the chequebook.
@@ -1,5 +1,5 @@
1
+ import { EthAddress, PrivateKey } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, SOCReader, SOCWriter } from '../types';
2
- import { EthAddress, PrivateKey } from '../utils/typed-bytes';
3
3
  import type { BeeContext } from './context';
4
4
  /**
5
5
  * Single owner chunk (SOC) reader/writer operations.
@@ -1,6 +1,6 @@
1
+ import { TransactionId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, NumberString, RedistributionState, TransactionOptions } from '../types';
2
3
  import { BZZ } from '../utils/tokens';
3
- import { TransactionId } from '../utils/typed-bytes';
4
4
  import type { BeeContext } from './context';
5
5
  /**
6
6
  * Staking operations.
@@ -1,7 +1,7 @@
1
+ import { BatchId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, GlobalPostageBatch, NumberString, PostageBatch, PostageBatchBuckets, PostageBatchOptions, RedundancyLevel } from '../types';
2
3
  import type { Duration } from '../utils/duration';
3
4
  import { BZZ } from '../utils/tokens';
4
- import { BatchId } from '../utils/typed-bytes';
5
5
  import type { BeeContext } from './context';
6
6
  /**
7
7
  * Low-level postage batch (stamp) operations.
@@ -1,8 +1,8 @@
1
+ import { BatchId, TransactionId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, PostageBatchOptions, RedundancyLevel } from '../types';
2
3
  import type { Duration } from '../utils/duration';
3
4
  import type { Size } from '../utils/size';
4
5
  import type { BZZ } from '../utils/tokens';
5
- import type { BatchId, TransactionId } from '../utils/typed-bytes';
6
6
  import type { BeeContext } from './context';
7
7
  /**
8
8
  * Ergonomic storage operations expressed in terms of size and duration.
@@ -1,5 +1,5 @@
1
+ import { Reference } from '@ethersphere/core-sdk';
1
2
  import type { AllTagsOptions, BeeRequestOptions, Tag as TagData } from '../types';
2
- import { Reference } from '../utils/typed-bytes';
3
3
  import type { BeeContext } from './context';
4
4
  /**
5
5
  * Tag operations for tracking upload and synchronization progress.
@@ -1,5 +1,5 @@
1
+ import { TransactionId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, NumberString, TransactionInfo } from '../types';
2
- import { TransactionId } from '../utils/typed-bytes';
3
3
  import type { BeeContext } from './context';
4
4
  /**
5
5
  * Pending transaction operations for the Bee node's `/transactions` queue.
@@ -1,6 +1,6 @@
1
+ import { EthAddress, TransactionId } from '@ethersphere/core-sdk';
1
2
  import type { BeeRequestOptions, NumberString, WalletBalance } from '../types';
2
3
  import { BZZ, DAI } from '../utils/tokens';
3
- import { EthAddress, TransactionId } from '../utils/typed-bytes';
4
4
  import type { BeeContext } from './context';
5
5
  /**
6
6
  * Node wallet operations (balances and external withdrawals).
@@ -1,5 +1,5 @@
1
+ import { EthAddress, PeerAddress, PublicKey, TransactionId } from '@ethersphere/core-sdk';
1
2
  import { BZZ, DAI } from '../utils/tokens';
2
- import { EthAddress, PeerAddress, PublicKey, TransactionId } from '../utils/typed-bytes';
3
3
  import { NumberString } from './index';
4
4
  export interface Settlements {
5
5
  peer: string;
@@ -1,12 +1,11 @@
1
+ import { BatchId, Bytes, EthAddress, Identifier, PrivateKey, PublicKey, Reference, Topic, TransactionId } from '@ethersphere/core-sdk';
1
2
  import { Optional } from 'cafe-utility';
2
3
  import type { SingleOwnerChunk } from '../chunk/soc';
3
4
  import type { FeedUploadOptions } from '../feed';
4
5
  import type { FeedPayloadResult, FeedReferenceResult, FeedUpdateOptions } from '../api/feed';
5
- import { Bytes } from '../utils/bytes';
6
6
  import { Duration } from '../utils/duration';
7
7
  import type { BeeError } from '../utils/error';
8
8
  import { Size } from '../utils/size';
9
- import { BatchId, EthAddress, Identifier, PrivateKey, PublicKey, Reference, Topic, TransactionId } from '../utils/typed-bytes';
10
9
  export * from './debug';
11
10
  export declare const SECTION_SIZE = 32;
12
11
  export declare const BRANCHES = 128;
@@ -516,15 +515,7 @@ export interface PostageBatchOptions {
516
515
  */
517
516
  waitForUsableTimeout?: number;
518
517
  }
519
- export interface Envelope {
520
- issuer: Uint8Array;
521
- index: Uint8Array;
522
- timestamp: Uint8Array;
523
- signature: Uint8Array;
524
- }
525
- export interface EnvelopeWithBatchId extends Envelope {
526
- batchId: BatchId;
527
- }
518
+ export type { Envelope, EnvelopeWithBatchId } from '@ethersphere/core-sdk';
528
519
  /**
529
520
  * With this type a number should be represented in a string
530
521
  */
@@ -1,6 +1,6 @@
1
+ import { EthAddress, TransactionId } from '@ethersphere/core-sdk';
1
2
  import { z } from 'zod';
2
3
  import { BZZ } from '../../utils/tokens';
3
- import { EthAddress, TransactionId } from '../../utils/typed-bytes';
4
4
  export declare const GetChequebookAddressResponse: z.ZodObject<{
5
5
  chequebookAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthAddress, string>>;
6
6
  }, z.core.$strip>;
@@ -1,5 +1,5 @@
1
+ import { EthAddress, PeerAddress, PublicKey } from '@ethersphere/core-sdk';
1
2
  import { z } from 'zod';
2
- import { EthAddress, PeerAddress, PublicKey } from '../../utils/typed-bytes';
3
3
  export declare const GetNodeAddressesResponse: z.ZodObject<{
4
4
  overlay: z.ZodPipe<z.ZodString, z.ZodTransform<PeerAddress, string>>;
5
5
  underlay: z.ZodArray<z.ZodString>;
@@ -1,5 +1,5 @@
1
+ import { PublicKey, Reference } from '@ethersphere/core-sdk';
1
2
  import { z } from 'zod';
2
- import { PublicKey, Reference } from '../../utils/typed-bytes';
3
3
  export declare const GetGranteesBodyResponse: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PublicKey, string>>>;
4
4
  export declare const GranteesResultBodyResponse: z.ZodObject<{
5
5
  ref: z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>;
@@ -1,6 +1,6 @@
1
+ import { TransactionId } from '@ethersphere/core-sdk';
1
2
  import { z } from 'zod';
2
3
  import { BZZ, DAI } from '../../utils/tokens';
3
- import { TransactionId } from '../../utils/typed-bytes';
4
4
  export declare const GetStakeResponse: z.ZodObject<{
5
5
  stakedAmount: z.ZodPipe<z.ZodString, z.ZodTransform<BZZ, string>>;
6
6
  }, z.core.$strip>;
@@ -1,5 +1,5 @@
1
+ import { BatchId, EthAddress } from '@ethersphere/core-sdk';
1
2
  import { z } from 'zod';
2
- import { BatchId, EthAddress } from '../../utils/typed-bytes';
3
3
  export declare const RawPostageBatchSchema: z.ZodObject<{
4
4
  batchID: z.ZodString;
5
5
  utilization: z.ZodNumber;
@@ -1,6 +1,6 @@
1
+ import { TransactionId } from '@ethersphere/core-sdk';
1
2
  import { z } from 'zod';
2
3
  import { BZZ, DAI } from '../../utils/tokens';
3
- import { TransactionId } from '../../utils/typed-bytes';
4
4
  export declare const GetReserveStateResponse: z.ZodObject<{
5
5
  commitment: z.ZodNumber;
6
6
  radius: z.ZodNumber;
@@ -1,5 +1,5 @@
1
+ import { TransactionId } from '@ethersphere/core-sdk';
1
2
  import { z } from 'zod';
2
- import { TransactionId } from '../../utils/typed-bytes';
3
3
  export declare const GetAllTransactionsResponse: z.ZodObject<{
4
4
  pendingTransactions: z.ZodArray<z.ZodObject<{
5
5
  transactionHash: z.ZodPipe<z.ZodString, z.ZodTransform<TransactionId, string>>;