You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,38 @@ This command generates static content into the `build` directory and can be serv
34
34
Don't forget to find and replace the version number for the whole of the docs folder.
35
35
36
36
37
+
## API Reference (`docs/api`)
38
+
39
+
Everything under `docs/api` is [typedoc](https://typedoc.org) output generated from the bee-js sources and committed to this repository, so the site builds without a bee-js checkout.
40
+
41
+
### Regenerating
42
+
43
+
The generator reads two clones that are not part of this repository:
Check both out at the release you are documenting, then run:
52
+
53
+
```
54
+
$ npm run generate-api
55
+
```
56
+
57
+
This drives typedoc via `typedoc.config.mjs` and reshapes the output into the layout the site expects: it lifts the main entry point's pages out of the `bee-js/src` directory typedoc nests them in, flattens the `Utils` namespace into `docs/api/namespaces/Utils`, folds the namespace class pages into `docs/api/classes` alongside the rest, turns the generated index into `Overview.md`, reduces references to TypeScript's own `lib.*.d.ts` to a machine-independent form, and links the `@ethersphere/core-sdk` re-exports against the core-sdk clone (`scripts/fix-core-sdk-links.mjs`, also runnable on its own as `npm run fix-api-links`).
58
+
59
+
Review the result as a diff against what is already committed. Anything unrelated to the bee-js release you are documenting means the toolchain moved, not the docs.
60
+
61
+
### Things worth knowing before changing it
62
+
63
+
-**`typedoc` and `typedoc-plugin-markdown` are pinned exactly.** A plugin upgrade rewrites unrelated pages and drowns the diff, so upgrade them deliberately, on their own.
64
+
-**The `typescript` devDependency exists only for this step.** Nothing in this repository is TypeScript; typedoc compiles the bee-js sources with it, so it has to track what `sources/bee-js` requires or generation fails with type errors.
65
+
-**`scripts/typedoc-frontmatter-titles.mjs` is not optional.** typedoc escapes markdown characters in page headings (`# Variable: NULL\_OWNER`), and Docusaurus takes the browser tab title, sidebar label, breadcrumbs and prev/next links from that raw heading without undoing the escapes. The plugin adds an unescaped frontmatter `title` instead. The escaping itself is not configurable upstream, and the heading has to stay escaped or MDX parses `\<V\>` as JSX.
66
+
-**The namespace classes reach the reference through extra entry points.** The classes behind `bee.data`, `bee.stamp` and the rest live in `src/modules/*.ts` and are not exported from bee-js's `src/index.ts`, so typedoc would otherwise render them as the unlinkable type of a `Bee` property. `typedoc.config.mjs` adds `src/modules/*.ts` as entry points of their own to give them pages. Their names collide with exported types (`Data`, `Tag`, `Pin`, `Collection`, `Chunk`), which is harmless because each entry point is its own typedoc module — but it is also why nothing may fold those pages together with the exported types of the same name.
67
+
-**Multiple entry points are what puts every page under `bee-js/src`.** typedoc names a module directory after each entry point's path, so the whole reference arrives one subtree down. `generate-api.mjs` moves that subtree up as one piece, which is what keeps the relative links inside it correct without rewriting any of them. Should bee-js move `src/modules` or rename the entry file, that lift is the first thing to break.
68
+
37
69
## Maintainers
38
70
39
71
See what "Maintainer" means [here](https://github.com/ethersphere/repo-maintainer).
There are several open issues with titles only. Maybe they are already fixed. Please assess them:
4
+
5
+
- New functions: getWithdrawableStake, withdrawSurplusStake and migrateStake
6
+
- New functions: withdrawBZZToExternalWallet and withdrawDAIToExternalWallet
7
+
- Deprecation: withdrawTokens and depositTokens
8
+
- new Bytes is unnecessary, simply use toHex() on the returned classes
9
+
10
+
Please note that the methods in these issues are from before the namespace restructuring, so you'll have to cross-check with the wandered method names.
Copy file name to clipboardExpand all lines: docs/api/classes/BZZ.md
+47-17Lines changed: 47 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
1
1
# Class: BZZ
2
2
3
-
Defined in: [bee-js/src/utils/tokens.ts:4](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L4)
3
+
Defined in: [bee-js/src/utils/tokens.ts:4](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L4)
4
4
5
5
## Properties
6
6
7
7
### DIGITS
8
8
9
9
> `readonly``static`**DIGITS**: `16` = `16`
10
10
11
-
Defined in: [bee-js/src/utils/tokens.ts:5](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L5)
11
+
Defined in: [bee-js/src/utils/tokens.ts:5](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L5)
12
12
13
13
## Methods
14
14
15
15
### divide()
16
16
17
17
> **divide**(`other`): `BZZ`
18
18
19
-
Defined in: [bee-js/src/utils/tokens.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L63)
19
+
Defined in: [bee-js/src/utils/tokens.ts:71](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L71)
20
20
21
21
Does not mutate the current BZZ instance.
22
22
@@ -40,7 +40,7 @@ New BZZ instance
40
40
41
41
> **eq**(`other`): `boolean`
42
42
43
-
Defined in: [bee-js/src/utils/tokens.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L83)
43
+
Defined in: [bee-js/src/utils/tokens.ts:91](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L91)
44
44
45
45
#### Parameters
46
46
@@ -58,7 +58,7 @@ Defined in: [bee-js/src/utils/tokens.ts:83](https://github.com/ethersphere/bee-j
58
58
59
59
> **exchangeToDAI**(`daiPerBzz`): [`DAI`](DAI.md)
60
60
61
-
Defined in: [bee-js/src/utils/tokens.ts:87](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L87)
61
+
Defined in: [bee-js/src/utils/tokens.ts:95](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L95)
62
62
63
63
#### Parameters
64
64
@@ -76,7 +76,7 @@ Defined in: [bee-js/src/utils/tokens.ts:87](https://github.com/ethersphere/bee-j
76
76
77
77
> **gt**(`other`): `boolean`
78
78
79
-
Defined in: [bee-js/src/utils/tokens.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L67)
79
+
Defined in: [bee-js/src/utils/tokens.ts:75](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L75)
80
80
81
81
#### Parameters
82
82
@@ -94,7 +94,7 @@ Defined in: [bee-js/src/utils/tokens.ts:67](https://github.com/ethersphere/bee-j
94
94
95
95
> **gte**(`other`): `boolean`
96
96
97
-
Defined in: [bee-js/src/utils/tokens.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L71)
97
+
Defined in: [bee-js/src/utils/tokens.ts:79](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L79)
98
98
99
99
#### Parameters
100
100
@@ -112,7 +112,7 @@ Defined in: [bee-js/src/utils/tokens.ts:71](https://github.com/ethersphere/bee-j
112
112
113
113
> **lt**(`other`): `boolean`
114
114
115
-
Defined in: [bee-js/src/utils/tokens.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L75)
115
+
Defined in: [bee-js/src/utils/tokens.ts:83](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L83)
116
116
117
117
#### Parameters
118
118
@@ -130,7 +130,7 @@ Defined in: [bee-js/src/utils/tokens.ts:75](https://github.com/ethersphere/bee-j
130
130
131
131
> **lte**(`other`): `boolean`
132
132
133
-
Defined in: [bee-js/src/utils/tokens.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L79)
133
+
Defined in: [bee-js/src/utils/tokens.ts:87](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L87)
134
134
135
135
#### Parameters
136
136
@@ -148,7 +148,7 @@ Defined in: [bee-js/src/utils/tokens.ts:79](https://github.com/ethersphere/bee-j
148
148
149
149
> **minus**(`other`): `BZZ`
150
150
151
-
Defined in: [bee-js/src/utils/tokens.ts:53](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L53)
151
+
Defined in: [bee-js/src/utils/tokens.ts:61](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L61)
152
152
153
153
Does not mutate the current BZZ instance.
154
154
@@ -172,7 +172,7 @@ New BZZ instance
172
172
173
173
> **plus**(`other`): `BZZ`
174
174
175
-
Defined in: [bee-js/src/utils/tokens.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L43)
175
+
Defined in: [bee-js/src/utils/tokens.ts:51](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L51)
176
176
177
177
Does not mutate the current BZZ instance.
178
178
@@ -196,19 +196,31 @@ New BZZ instance
196
196
197
197
> **toDecimalString**(): `string`
198
198
199
-
Defined in: [bee-js/src/utils/tokens.ts:29](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L29)
199
+
Defined in: [bee-js/src/utils/tokens.ts:33](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L33)
200
200
201
201
#### Returns
202
202
203
203
`string`
204
204
205
205
***
206
206
207
+
### toFloat()
208
+
209
+
> **toFloat**(): `number`
210
+
211
+
Defined in: [bee-js/src/utils/tokens.ts:37](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L37)
212
+
213
+
#### Returns
214
+
215
+
`number`
216
+
217
+
***
218
+
207
219
### toPLURBigInt()
208
220
209
221
> **toPLURBigInt**(): `bigint`
210
222
211
-
Defined in: [bee-js/src/utils/tokens.ts:25](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L25)
223
+
Defined in: [bee-js/src/utils/tokens.ts:29](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L29)
212
224
213
225
#### Returns
214
226
@@ -220,7 +232,7 @@ Defined in: [bee-js/src/utils/tokens.ts:25](https://github.com/ethersphere/bee-j
220
232
221
233
> **toPLURString**(): `string`
222
234
223
-
Defined in: [bee-js/src/utils/tokens.ts:21](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L21)
235
+
Defined in: [bee-js/src/utils/tokens.ts:25](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L25)
224
236
225
237
#### Returns
226
238
@@ -232,7 +244,7 @@ Defined in: [bee-js/src/utils/tokens.ts:21](https://github.com/ethersphere/bee-j
232
244
233
245
> **toSignificantDigits**(`digits`): `string`
234
246
235
-
Defined in: [bee-js/src/utils/tokens.ts:33](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L33)
247
+
Defined in: [bee-js/src/utils/tokens.ts:41](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L41)
236
248
237
249
#### Parameters
238
250
@@ -250,7 +262,7 @@ Defined in: [bee-js/src/utils/tokens.ts:33](https://github.com/ethersphere/bee-j
250
262
251
263
> `static`**fromDecimalString**(`string`): `BZZ`
252
264
253
-
Defined in: [bee-js/src/utils/tokens.ts:13](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L13)
265
+
Defined in: [bee-js/src/utils/tokens.ts:13](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L13)
254
266
255
267
#### Parameters
256
268
@@ -264,11 +276,29 @@ Defined in: [bee-js/src/utils/tokens.ts:13](https://github.com/ethersphere/bee-j
264
276
265
277
***
266
278
279
+
### fromFloat()
280
+
281
+
> `static`**fromFloat**(`float`): `BZZ`
282
+
283
+
Defined in: [bee-js/src/utils/tokens.ts:21](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L21)
284
+
285
+
#### Parameters
286
+
287
+
##### float
288
+
289
+
`number`
290
+
291
+
#### Returns
292
+
293
+
`BZZ`
294
+
295
+
***
296
+
267
297
### fromPLUR()
268
298
269
299
> `static`**fromPLUR**(`plur`): `BZZ`
270
300
271
-
Defined in: [bee-js/src/utils/tokens.ts:17](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L17)
301
+
Defined in: [bee-js/src/utils/tokens.ts:17](https://github.com/ethersphere/bee-js/blob/bab2b2e5a3874187d29a1c1e6c70f2f645ed53c2/src/utils/tokens.ts#L17)
0 commit comments