@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
@@ -34,11 +34,11 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Collection = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
37
38
  const chunk_stream_1 = require("../utils/chunk-stream");
38
39
  const collection_1 = require("../utils/collection");
39
40
  const collection_node_1 = require("../utils/collection.node");
40
41
  const schema_1 = require("../utils/schema");
41
- const typed_bytes_1 = require("../utils/typed-bytes");
42
42
  const api = __importStar(require("../api/bzz"));
43
43
  /**
44
44
  * Collection (multi-file) operations backed by the `/bzz` endpoint.
@@ -58,7 +58,7 @@ class Collection {
58
58
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
59
59
  */
60
60
  async upload(postageBatchId, collection, options, requestOptions) {
61
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
61
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
62
62
  (0, collection_1.assertCollection)(collection);
63
63
  if (options) {
64
64
  options = schema_1.CollectionUploadOptionsSchema.parse(options);
@@ -74,7 +74,7 @@ class Collection {
74
74
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
75
75
  */
76
76
  async uploadFromFileList(postageBatchId, fileList, options, requestOptions) {
77
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
77
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
78
78
  if (options) {
79
79
  options = schema_1.CollectionUploadOptionsSchema.parse(options);
80
80
  }
@@ -92,7 +92,7 @@ class Collection {
92
92
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
93
93
  */
94
94
  async uploadFromDirectory(postageBatchId, dir, options, requestOptions) {
95
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
95
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
96
96
  if (options) {
97
97
  options = schema_1.CollectionUploadOptionsSchema.parse(options);
98
98
  }
@@ -112,7 +112,7 @@ class Collection {
112
112
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
113
113
  */
114
114
  async stream(postageBatchId, files, onUploadProgress, options, requestOptions) {
115
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
115
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
116
116
  return (0, chunk_stream_1.streamFiles)(this.context.bee, files, batchId, onUploadProgress, options, this.context.getRequestOptionsForCall(requestOptions));
117
117
  }
118
118
  /**
@@ -128,7 +128,7 @@ class Collection {
128
128
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
129
129
  */
130
130
  async streamFromDirectory(postageBatchId, dir, onUploadProgress, options, requestOptions) {
131
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
131
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
132
132
  return (0, chunk_stream_1.streamDirectory)(this.context.bee, dir, batchId, onUploadProgress, options, this.context.getRequestOptionsForCall(requestOptions));
133
133
  }
134
134
  /**
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Connectivity = void 0;
37
- const typed_bytes_1 = require("../utils/typed-bytes");
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
38
38
  const api = __importStar(require("../api/connectivity"));
39
39
  /**
40
40
  * Peer, topology and network connectivity operations.
@@ -116,7 +116,7 @@ class Connectivity {
116
116
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
117
117
  */
118
118
  async removePeer(peer, requestOptions) {
119
- const address = new typed_bytes_1.PeerAddress(peer);
119
+ const address = new core_sdk_1.PeerAddress(peer);
120
120
  return api.removePeer(this.context.getRequestOptionsForCall(requestOptions), address);
121
121
  }
122
122
  /**
@@ -134,7 +134,7 @@ class Connectivity {
134
134
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
135
135
  */
136
136
  async ping(peer, requestOptions) {
137
- const address = new typed_bytes_1.PeerAddress(peer);
137
+ const address = new core_sdk_1.PeerAddress(peer);
138
138
  return api.ping(this.context.getRequestOptionsForCall(requestOptions), address);
139
139
  }
140
140
  }
@@ -34,12 +34,12 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Data = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
38
+ const bytes = __importStar(require("../api/bytes"));
39
+ const stewardship = __importStar(require("../api/stewardship"));
37
40
  const resource_locator_1 = require("../utils/resource-locator");
38
41
  const schema_1 = require("../utils/schema");
39
42
  const type_1 = require("../utils/type");
40
- const typed_bytes_1 = require("../utils/typed-bytes");
41
- const bytes = __importStar(require("../api/bytes"));
42
- const stewardship = __importStar(require("../api/stewardship"));
43
43
  /**
44
44
  * Raw data operations backed by the `/bytes` endpoint.
45
45
  *
@@ -60,7 +60,7 @@ class Data {
60
60
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
61
61
  */
62
62
  async upload(postageBatchId, data, options, requestOptions) {
63
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
63
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
64
64
  (0, type_1.assertData)(data);
65
65
  if (options) {
66
66
  options = schema_1.RedundantUploadOptionsSchema.parse(options);
@@ -102,7 +102,7 @@ class Data {
102
102
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
103
103
  */
104
104
  async probe(reference, requestOptions) {
105
- const ref = new typed_bytes_1.Reference(reference);
105
+ const ref = new core_sdk_1.Reference(reference);
106
106
  return bytes.head(this.context.getRequestOptionsForCall(requestOptions), ref);
107
107
  }
108
108
  /**
@@ -112,7 +112,7 @@ class Data {
112
112
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
113
113
  */
114
114
  async isRetrievable(reference, requestOptions) {
115
- const ref = new typed_bytes_1.Reference(reference);
115
+ const ref = new core_sdk_1.Reference(reference);
116
116
  return stewardship.isRetrievable(this.context.getRequestOptionsForCall(requestOptions), ref);
117
117
  }
118
118
  }
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Feed = void 0;
4
+ const core_sdk_1 = require("@ethersphere/core-sdk");
4
5
  const cafe_utility_1 = require("cafe-utility");
5
6
  const feed_1 = require("../api/feed");
6
7
  const feed_2 = require("../feed");
7
8
  const retrievable_1 = require("../feed/retrievable");
8
9
  const schema_1 = require("../utils/schema");
9
- const typed_bytes_1 = require("../utils/typed-bytes");
10
10
  /**
11
11
  * Feed operations.
12
12
  *
@@ -24,7 +24,7 @@ class Feed {
24
24
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
25
25
  */
26
26
  makeReader(topic, owner, requestOptions) {
27
- return (0, feed_2.makeFeedReader)(this.context.getRequestOptionsForCall(requestOptions), new typed_bytes_1.Topic(topic), new typed_bytes_1.EthAddress(owner));
27
+ return (0, feed_2.makeFeedReader)(this.context.getRequestOptionsForCall(requestOptions), new core_sdk_1.Topic(topic), new core_sdk_1.EthAddress(owner));
28
28
  }
29
29
  /**
30
30
  * Makes a new feed writer for updating feeds.
@@ -34,11 +34,11 @@ class Feed {
34
34
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
35
35
  */
36
36
  makeWriter(topic, signer, requestOptions) {
37
- const key = signer ? new typed_bytes_1.PrivateKey(signer) : this.context.signer;
37
+ const key = signer ? new core_sdk_1.PrivateKey(signer) : this.context.signer;
38
38
  if (!key) {
39
39
  throw Error('No signer provided');
40
40
  }
41
- return (0, feed_2.makeFeedWriter)(this.context.getRequestOptionsForCall(requestOptions), new typed_bytes_1.Topic(topic), key);
41
+ return (0, feed_2.makeFeedWriter)(this.context.getRequestOptionsForCall(requestOptions), new core_sdk_1.Topic(topic), key);
42
42
  }
43
43
  /**
44
44
  * Creates a feed manifest chunk and returns the reference to it.
@@ -50,9 +50,9 @@ class Feed {
50
50
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
51
51
  */
52
52
  async createManifest(postageBatchId, topic, owner, options, requestOptions) {
53
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
54
- const feedTopic = new typed_bytes_1.Topic(topic);
55
- const feedOwner = new typed_bytes_1.EthAddress(owner);
53
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
54
+ const feedTopic = new core_sdk_1.Topic(topic);
55
+ const feedOwner = new core_sdk_1.EthAddress(owner);
56
56
  if (options) {
57
57
  options = schema_1.UploadOptionsSchema.parse(options);
58
58
  }
@@ -66,7 +66,7 @@ class Feed {
66
66
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
67
67
  */
68
68
  async fetchLatestUpdate(topic, owner, requestOptions) {
69
- return (0, feed_1.fetchLatestFeedUpdate)(this.context.getRequestOptionsForCall(requestOptions), new typed_bytes_1.EthAddress(owner), new typed_bytes_1.Topic(topic));
69
+ return (0, feed_1.fetchLatestFeedUpdate)(this.context.getRequestOptionsForCall(requestOptions), new core_sdk_1.EthAddress(owner), new core_sdk_1.Topic(topic));
70
70
  }
71
71
  /**
72
72
  * Validates whether a feed is retrievable in the network.
@@ -78,8 +78,8 @@ class Feed {
78
78
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
79
79
  */
80
80
  async isRetrievable(owner, topic, index, options, requestOptions) {
81
- const feedOwner = new typed_bytes_1.EthAddress(owner);
82
- const feedTopic = new typed_bytes_1.Topic(topic);
81
+ const feedOwner = new core_sdk_1.EthAddress(owner);
82
+ const feedTopic = new core_sdk_1.Topic(topic);
83
83
  if (options) {
84
84
  options = schema_1.DownloadOptionsSchema.parse(options);
85
85
  }
@@ -34,11 +34,11 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.File = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
37
38
  const file_1 = require("../utils/file");
38
39
  const resource_locator_1 = require("../utils/resource-locator");
39
40
  const schema_1 = require("../utils/schema");
40
41
  const type_1 = require("../utils/type");
41
- const typed_bytes_1 = require("../utils/typed-bytes");
42
42
  const api = __importStar(require("../api/bzz"));
43
43
  /**
44
44
  * Single-file operations backed by the `/bzz` endpoint.
@@ -61,7 +61,7 @@ class File {
61
61
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
62
62
  */
63
63
  async upload(postageBatchId, data, name, options, requestOptions) {
64
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
64
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
65
65
  (0, type_1.assertFileData)(data);
66
66
  if (options) {
67
67
  options = schema_1.FileUploadOptionsSchema.parse(options);
@@ -103,7 +103,7 @@ class File {
103
103
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
104
104
  */
105
105
  async downloadReadable(reference, path = '', options, requestOptions) {
106
- const ref = new typed_bytes_1.Reference(reference);
106
+ const ref = new core_sdk_1.Reference(reference);
107
107
  if (options) {
108
108
  options = schema_1.DownloadOptionsSchema.parse(options);
109
109
  }
@@ -34,8 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Grantee = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
37
38
  const api = __importStar(require("../api/grantee"));
38
- const typed_bytes_1 = require("../utils/typed-bytes");
39
39
  /**
40
40
  * Grantee (access control) operations.
41
41
  *
@@ -53,8 +53,8 @@ class Grantee {
53
53
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
54
54
  */
55
55
  async create(postageBatchId, grantees, requestOptions) {
56
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
57
- const publicKeys = grantees.map(x => new typed_bytes_1.PublicKey(x));
56
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
57
+ const publicKeys = grantees.map(x => new core_sdk_1.PublicKey(x));
58
58
  return api.createGrantees(this.context.getRequestOptionsForCall(requestOptions), batchId, publicKeys);
59
59
  }
60
60
  /**
@@ -64,7 +64,7 @@ class Grantee {
64
64
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
65
65
  */
66
66
  async get(reference, requestOptions) {
67
- const ref = new typed_bytes_1.Reference(reference);
67
+ const ref = new core_sdk_1.Reference(reference);
68
68
  return api.getGrantees(this.context.getRequestOptionsForCall(requestOptions), ref);
69
69
  }
70
70
  /**
@@ -77,12 +77,12 @@ class Grantee {
77
77
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
78
78
  */
79
79
  async patch(postageBatchId, reference, history, grantees, requestOptions) {
80
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
81
- const ref = new typed_bytes_1.Reference(reference);
82
- const historyRef = new typed_bytes_1.Reference(history);
80
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
81
+ const ref = new core_sdk_1.Reference(reference);
82
+ const historyRef = new core_sdk_1.Reference(history);
83
83
  const publicKeys = {
84
- add: grantees.add?.map(x => new typed_bytes_1.PublicKey(x)) ?? [],
85
- revoke: grantees.revoke?.map(x => new typed_bytes_1.PublicKey(x)) ?? [],
84
+ add: grantees.add?.map(x => new core_sdk_1.PublicKey(x)) ?? [],
85
+ revoke: grantees.revoke?.map(x => new core_sdk_1.PublicKey(x)) ?? [],
86
86
  };
87
87
  return api.patchGrantees(this.context.getRequestOptionsForCall(requestOptions), batchId, ref, historyRef, publicKeys);
88
88
  }
@@ -39,15 +39,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Messaging = void 0;
40
40
  const cafe_utility_1 = require("cafe-utility");
41
41
  const isomorphic_ws_1 = __importDefault(require("isomorphic-ws"));
42
- const cac_1 = require("../chunk/cac");
43
- const soc_1 = require("../chunk/soc");
42
+ const core_sdk_1 = require("@ethersphere/core-sdk");
44
43
  const pssApi = __importStar(require("../api/pss"));
45
- const bytes_1 = require("../utils/bytes");
44
+ const soc_1 = require("../chunk/soc");
46
45
  const data_1 = require("../utils/data");
47
46
  const error_1 = require("../utils/error");
48
47
  const schema_1 = require("../utils/schema");
49
48
  const type_1 = require("../utils/type");
50
- const typed_bytes_1 = require("../utils/typed-bytes");
51
49
  const PSS_ENDPOINT = 'pss';
52
50
  const GSOC_ENDPOINT = 'gsoc';
53
51
  /**
@@ -74,9 +72,9 @@ class Messaging {
74
72
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
75
73
  */
76
74
  async pssSend(postageBatchId, topic, target, data, recipient, requestOptions) {
77
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
75
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
78
76
  (0, type_1.assertData)(data);
79
- const recipientKey = recipient ? new typed_bytes_1.PublicKey(recipient) : undefined;
77
+ const recipientKey = recipient ? new core_sdk_1.PublicKey(recipient) : undefined;
80
78
  await pssApi.send(this.context.getRequestOptionsForCall(requestOptions), batchId, topic, target, data, recipientKey);
81
79
  }
82
80
  /**
@@ -95,7 +93,7 @@ class Messaging {
95
93
  ws.onmessage = async (event) => {
96
94
  const data = await (0, data_1.prepareWebsocketData)(event.data);
97
95
  if (data.length) {
98
- handler.onMessage(new bytes_1.Bytes(data), subscription);
96
+ handler.onMessage(new core_sdk_1.Bytes(data), subscription);
99
97
  }
100
98
  };
101
99
  ws.onerror = event => {
@@ -154,11 +152,11 @@ class Messaging {
154
152
  * @param proximity
155
153
  */
156
154
  gsocMine(targetOverlay, identifier, proximity = 12) {
157
- const overlay = new typed_bytes_1.PeerAddress(targetOverlay);
158
- const id = new typed_bytes_1.Identifier(identifier);
155
+ const overlay = new core_sdk_1.PeerAddress(targetOverlay);
156
+ const id = new core_sdk_1.Identifier(identifier);
159
157
  const start = 0xb33n;
160
158
  for (let i = 0n; i < 0xffffn; i++) {
161
- const signer = new typed_bytes_1.PrivateKey(cafe_utility_1.Binary.numberToUint256(start + i, 'BE'));
159
+ const signer = new core_sdk_1.PrivateKey((0, core_sdk_1.numberToUint256)(start + i, 'BE'));
162
160
  const socAddress = (0, soc_1.makeSOCAddress)(id, signer.publicKey().address());
163
161
  // TODO: test the significance of the hardcoded 256
164
162
  const actualProximity = 256 - cafe_utility_1.Binary.proximity(socAddress.toUint8Array(), overlay.toUint8Array());
@@ -181,10 +179,10 @@ class Messaging {
181
179
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
182
180
  */
183
181
  async gsocSend(postageBatchId, signer, identifier, data, options, requestOptions) {
184
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
185
- const key = new typed_bytes_1.PrivateKey(signer);
186
- const id = new typed_bytes_1.Identifier(identifier);
187
- const cac = (0, cac_1.makeContentAddressedChunk)(data);
182
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
183
+ const key = new core_sdk_1.PrivateKey(signer);
184
+ const id = new core_sdk_1.Identifier(identifier);
185
+ const cac = (0, core_sdk_1.makeContentAddressedChunk)(data);
188
186
  const soc = cac.toSingleOwnerChunk(id, key);
189
187
  return (0, soc_1.uploadSingleOwnerChunk)(this.context.getRequestOptionsForCall(requestOptions), soc, batchId, options);
190
188
  }
@@ -198,8 +196,8 @@ class Messaging {
198
196
  * @param handler
199
197
  */
200
198
  gsocSubscribe(address, identifier, handler) {
201
- const ethAddress = new typed_bytes_1.EthAddress(address);
202
- const id = new typed_bytes_1.Identifier(identifier);
199
+ const ethAddress = new core_sdk_1.EthAddress(address);
200
+ const id = new core_sdk_1.Identifier(identifier);
203
201
  handler = schema_1.GsocMessageHandlerSchema.parse(handler);
204
202
  const socAddress = (0, soc_1.makeSOCAddress)(id, ethAddress);
205
203
  const ws = this.openWebSocket(`${GSOC_ENDPOINT}/subscribe/${socAddress.toHex()}`);
@@ -208,7 +206,7 @@ class Messaging {
208
206
  ws.onmessage = async (event) => {
209
207
  const data = await (0, data_1.prepareWebsocketData)(event.data);
210
208
  if (data.length) {
211
- handler.onMessage(new bytes_1.Bytes(data), subscription);
209
+ handler.onMessage(new core_sdk_1.Bytes(data), subscription);
212
210
  }
213
211
  };
214
212
  ws.onerror = event => {
@@ -34,9 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Pin = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
37
38
  const pinApi = __importStar(require("../api/pin"));
38
39
  const stewardshipApi = __importStar(require("../api/stewardship"));
39
- const typed_bytes_1 = require("../utils/typed-bytes");
40
40
  /**
41
41
  * Local pinning operations.
42
42
  *
@@ -53,7 +53,7 @@ class Pin {
53
53
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
54
54
  */
55
55
  async add(reference, requestOptions) {
56
- const ref = new typed_bytes_1.Reference(reference);
56
+ const ref = new core_sdk_1.Reference(reference);
57
57
  await pinApi.pin(this.context.getRequestOptionsForCall(requestOptions), ref);
58
58
  }
59
59
  /**
@@ -63,7 +63,7 @@ class Pin {
63
63
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
64
64
  */
65
65
  async remove(reference, requestOptions) {
66
- const ref = new typed_bytes_1.Reference(reference);
66
+ const ref = new core_sdk_1.Reference(reference);
67
67
  await pinApi.unpin(this.context.getRequestOptionsForCall(requestOptions), ref);
68
68
  }
69
69
  /**
@@ -81,7 +81,7 @@ class Pin {
81
81
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
82
82
  */
83
83
  async get(reference, requestOptions) {
84
- const ref = new typed_bytes_1.Reference(reference);
84
+ const ref = new core_sdk_1.Reference(reference);
85
85
  return pinApi.getPin(this.context.getRequestOptionsForCall(requestOptions), ref);
86
86
  }
87
87
  /**
@@ -92,8 +92,8 @@ class Pin {
92
92
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
93
93
  */
94
94
  async reuploadData(postageBatchId, reference, requestOptions) {
95
- const batchId = new typed_bytes_1.BatchId(postageBatchId);
96
- const ref = new typed_bytes_1.Reference(reference);
95
+ const batchId = new core_sdk_1.BatchId(postageBatchId);
96
+ const ref = new core_sdk_1.Reference(reference);
97
97
  await stewardshipApi.reupload(this.context.getRequestOptionsForCall(requestOptions), batchId, ref);
98
98
  }
99
99
  }
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Settlement = void 0;
37
- const typed_bytes_1 = require("../utils/typed-bytes");
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
38
38
  const api = __importStar(require("../api/settlement"));
39
39
  /**
40
40
  * Settlement operations. Related to the bandwidth incentives and the chequebook.
@@ -52,7 +52,7 @@ class Settlement {
52
52
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
53
53
  */
54
54
  async get(address, requestOptions) {
55
- const peer = new typed_bytes_1.PeerAddress(address);
55
+ const peer = new core_sdk_1.PeerAddress(address);
56
56
  return api.getSettlements(this.context.getRequestOptionsForCall(requestOptions), peer);
57
57
  }
58
58
  /**
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Soc = void 0;
4
+ const core_sdk_1 = require("@ethersphere/core-sdk");
4
5
  const soc_1 = require("../chunk/soc");
5
- const typed_bytes_1 = require("../utils/typed-bytes");
6
6
  /**
7
7
  * Single owner chunk (SOC) reader/writer operations.
8
8
  *
@@ -19,7 +19,7 @@ class Soc {
19
19
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
20
20
  */
21
21
  makeReader(ownerAddress, requestOptions) {
22
- const owner = new typed_bytes_1.EthAddress(ownerAddress);
22
+ const owner = new core_sdk_1.EthAddress(ownerAddress);
23
23
  return {
24
24
  owner,
25
25
  download: soc_1.downloadSingleOwnerChunk.bind(null, this.context.getRequestOptionsForCall(requestOptions), owner),
@@ -32,7 +32,7 @@ class Soc {
32
32
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
33
33
  */
34
34
  makeWriter(signer, requestOptions) {
35
- const key = signer ? new typed_bytes_1.PrivateKey(signer) : this.context.signer;
35
+ const key = signer ? new core_sdk_1.PrivateKey(signer) : this.context.signer;
36
36
  if (!key) {
37
37
  throw Error('No signer provided');
38
38
  }
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Stamp = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
37
38
  const cafe_utility_1 = require("cafe-utility");
38
39
  const zod_1 = require("zod");
39
40
  const types_1 = require("../types");
@@ -41,7 +42,6 @@ const error_1 = require("../utils/error");
41
42
  const schema_1 = require("../utils/schema");
42
43
  const stamps_1 = require("../utils/stamps");
43
44
  const type_1 = require("../utils/type");
44
- const typed_bytes_1 = require("../utils/typed-bytes");
45
45
  const stampApi = __importStar(require("../api/stamp"));
46
46
  const batchesApi = __importStar(require("../api/batches"));
47
47
  /**
@@ -90,7 +90,7 @@ class Stamp {
90
90
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
91
91
  */
92
92
  async updateLabel(postageBatchId, label, requestOptions) {
93
- const id = new typed_bytes_1.BatchId(postageBatchId);
93
+ const id = new core_sdk_1.BatchId(postageBatchId);
94
94
  await stampApi.updateLabel(this.context.getRequestOptionsForCall(requestOptions), id, label);
95
95
  }
96
96
  /**
@@ -115,7 +115,7 @@ class Stamp {
115
115
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
116
116
  */
117
117
  async topUp(postageBatchId, amount, requestOptions) {
118
- const id = new typed_bytes_1.BatchId(postageBatchId);
118
+ const id = new core_sdk_1.BatchId(postageBatchId);
119
119
  const amountString = (0, type_1.asNumberString)(amount, { min: 1n, name: 'amount' });
120
120
  return stampApi.topUpBatch(this.context.getRequestOptionsForCall(requestOptions), id, amountString);
121
121
  }
@@ -127,7 +127,7 @@ class Stamp {
127
127
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
128
128
  */
129
129
  async dilute(postageBatchId, depth, requestOptions) {
130
- const id = new typed_bytes_1.BatchId(postageBatchId);
130
+ const id = new core_sdk_1.BatchId(postageBatchId);
131
131
  const depthNumber = zod_1.z.number().int().min(18).max(255).parse(depth);
132
132
  return stampApi.diluteBatch(this.context.getRequestOptionsForCall(requestOptions), id, depthNumber);
133
133
  }
@@ -140,7 +140,7 @@ class Stamp {
140
140
  * @param erasureCodeLevel Assume that uploads with this postage batch are erasure coded, which skews the capacity.
141
141
  */
142
142
  async get(postageBatchId, requestOptions, encryption, erasureCodeLevel) {
143
- const id = new typed_bytes_1.BatchId(postageBatchId);
143
+ const id = new core_sdk_1.BatchId(postageBatchId);
144
144
  return stampApi.getPostageBatch(this.context.getRequestOptionsForCall(requestOptions), id, encryption, erasureCodeLevel);
145
145
  }
146
146
  /**
@@ -150,7 +150,7 @@ class Stamp {
150
150
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
151
151
  */
152
152
  async getGlobal(postageBatchId, requestOptions) {
153
- const id = new typed_bytes_1.BatchId(postageBatchId);
153
+ const id = new core_sdk_1.BatchId(postageBatchId);
154
154
  return batchesApi.getGlobalPostageBatch(this.context.getRequestOptionsForCall(requestOptions), id);
155
155
  }
156
156
  /**
@@ -160,7 +160,7 @@ class Stamp {
160
160
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
161
161
  */
162
162
  async getBuckets(postageBatchId, requestOptions) {
163
- const id = new typed_bytes_1.BatchId(postageBatchId);
163
+ const id = new core_sdk_1.BatchId(postageBatchId);
164
164
  return stampApi.getPostageBatchBuckets(this.context.getRequestOptionsForCall(requestOptions), id);
165
165
  }
166
166
  /**
@@ -34,10 +34,10 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Tag = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
37
38
  const api = __importStar(require("../api/tag"));
38
39
  const schema_1 = require("../utils/schema");
39
40
  const type_1 = require("../utils/type");
40
- const typed_bytes_1 = require("../utils/typed-bytes");
41
41
  /**
42
42
  * Tag operations for tracking upload and synchronization progress.
43
43
  *
@@ -95,7 +95,7 @@ class Tag {
95
95
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
96
96
  */
97
97
  async update(tagUid, reference, requestOptions) {
98
- const ref = new typed_bytes_1.Reference(reference);
98
+ const ref = new core_sdk_1.Reference(reference);
99
99
  const uid = (0, type_1.makeTagUid)(tagUid);
100
100
  await api.updateTag(this.context.getRequestOptionsForCall(requestOptions), uid, ref);
101
101
  }
@@ -34,8 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Transaction = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
37
38
  const type_1 = require("../utils/type");
38
- const typed_bytes_1 = require("../utils/typed-bytes");
39
39
  const api = __importStar(require("../api/transaction"));
40
40
  /**
41
41
  * Pending transaction operations for the Bee node's `/transactions` queue.
@@ -61,7 +61,7 @@ class Transaction {
61
61
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
62
62
  */
63
63
  async get(transactionHash, requestOptions) {
64
- const hash = new typed_bytes_1.TransactionId(transactionHash);
64
+ const hash = new core_sdk_1.TransactionId(transactionHash);
65
65
  return api.getTransaction(this.context.getRequestOptionsForCall(requestOptions), hash);
66
66
  }
67
67
  /**
@@ -73,7 +73,7 @@ class Transaction {
73
73
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
74
74
  */
75
75
  async rebroadcast(transactionHash, requestOptions) {
76
- const hash = new typed_bytes_1.TransactionId(transactionHash);
76
+ const hash = new core_sdk_1.TransactionId(transactionHash);
77
77
  return api.rebroadcastTransaction(this.context.getRequestOptionsForCall(requestOptions), hash);
78
78
  }
79
79
  /**
@@ -84,7 +84,7 @@ class Transaction {
84
84
  * @param requestOptions Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
85
85
  */
86
86
  async cancel(transactionHash, gasPrice, requestOptions) {
87
- const hash = new typed_bytes_1.TransactionId(transactionHash);
87
+ const hash = new core_sdk_1.TransactionId(transactionHash);
88
88
  const gasPriceString = gasPrice ? (0, type_1.asNumberString)(gasPrice, { min: 0n, name: 'gasPrice' }) : undefined;
89
89
  return api.cancelTransaction(this.context.getRequestOptionsForCall(requestOptions), hash, gasPriceString);
90
90
  }
@@ -34,8 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Wallet = void 0;
37
+ const core_sdk_1 = require("@ethersphere/core-sdk");
37
38
  const tokens_1 = require("../utils/tokens");
38
- const typed_bytes_1 = require("../utils/typed-bytes");
39
39
  const api = __importStar(require("../api/wallet"));
40
40
  /**
41
41
  * Node wallet operations (balances and external withdrawals).
@@ -63,7 +63,7 @@ class Wallet {
63
63
  */
64
64
  async withdrawBZZ(amount, address, requestOptions) {
65
65
  const bzz = amount instanceof tokens_1.BZZ ? amount : tokens_1.BZZ.fromPLUR(amount);
66
- const ethAddress = new typed_bytes_1.EthAddress(address);
66
+ const ethAddress = new core_sdk_1.EthAddress(address);
67
67
  return api.withdrawBZZ(this.context.getRequestOptionsForCall(requestOptions), bzz, ethAddress);
68
68
  }
69
69
  /**
@@ -75,7 +75,7 @@ class Wallet {
75
75
  */
76
76
  async withdrawDAI(amount, address, requestOptions) {
77
77
  const dai = amount instanceof tokens_1.DAI ? amount : tokens_1.DAI.fromWei(amount);
78
- const ethAddress = new typed_bytes_1.EthAddress(address);
78
+ const ethAddress = new core_sdk_1.EthAddress(address);
79
79
  return api.withdrawDAI(this.context.getRequestOptionsForCall(requestOptions), dai, ethAddress);
80
80
  }
81
81
  }
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TransactionHashResponse = exports.GetLastChequesResponse = exports.GetLastChequesForPeerResponse = exports.GetLastCashoutActionResponse = exports.GetChequebookBalanceResponse = exports.GetChequebookAddressResponse = void 0;
4
+ const core_sdk_1 = require("@ethersphere/core-sdk");
4
5
  const zod_1 = require("zod");
5
6
  const tokens_1 = require("../../utils/tokens");
6
7
  const type_1 = require("../../utils/type");
7
- const typed_bytes_1 = require("../../utils/typed-bytes");
8
8
  const ChequeSchema = zod_1.z.object({
9
- beneficiary: zod_1.z.string().transform(s => new typed_bytes_1.EthAddress(s)),
10
- chequebook: zod_1.z.string().transform(s => new typed_bytes_1.EthAddress(s)),
9
+ beneficiary: zod_1.z.string().transform(s => new core_sdk_1.EthAddress(s)),
10
+ chequebook: zod_1.z.string().transform(s => new core_sdk_1.EthAddress(s)),
11
11
  payout: zod_1.z.string().transform(s => tokens_1.BZZ.fromPLUR((0, type_1.asNumberString)(s, { name: 'payout' }))),
12
12
  });
13
13
  const CashoutResultSchema = zod_1.z.object({
@@ -16,7 +16,7 @@ const CashoutResultSchema = zod_1.z.object({
16
16
  bounced: zod_1.z.boolean(),
17
17
  });
18
18
  exports.GetChequebookAddressResponse = zod_1.z.object({
19
- chequebookAddress: zod_1.z.string().transform(s => new typed_bytes_1.EthAddress(s)),
19
+ chequebookAddress: zod_1.z.string().transform(s => new core_sdk_1.EthAddress(s)),
20
20
  });
21
21
  exports.GetChequebookBalanceResponse = zod_1.z.object({
22
22
  availableBalance: zod_1.z.string().transform(s => tokens_1.BZZ.fromPLUR((0, type_1.asNumberString)(s, { name: 'availableBalance' }))),
@@ -45,5 +45,5 @@ exports.GetLastChequesResponse = zod_1.z.object({
45
45
  })),
46
46
  });
47
47
  exports.TransactionHashResponse = zod_1.z.object({
48
- transactionHash: zod_1.z.string().transform(s => new typed_bytes_1.TransactionId(s)),
48
+ transactionHash: zod_1.z.string().transform(s => new core_sdk_1.TransactionId(s)),
49
49
  });