Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bee-js
Submodule bee-js updated 66 files
+3 −0 .github/config.yaml
+0 −78 .github/workflows/ci.yaml
+1 −0 .github/workflows/release_github.yaml
+152 −0 .github/workflows/tests.yaml
+49 −0 CHANGELOG.md
+11 −9 README.md
+5 −0 jest-puppeteer.config.js
+6 −91 package-lock.json
+10 −12 package.json
+66 −15 src/bee-debug.ts
+127 −36 src/bee.ts
+1 −1 src/chunk/bmt.ts
+11 −18 src/chunk/cac.ts
+0 −18 src/chunk/owner.ts
+54 −61 src/chunk/signer.ts
+15 −34 src/chunk/soc.ts
+47 −56 src/feed/index.ts
+9 −14 src/feed/topic.ts
+1 −1 src/feed/type.ts
+5 −0 src/index.ts
+7 −6 src/modules/bytes.ts
+7 −5 src/modules/collection.ts
+6 −6 src/modules/debug/chequebook.ts
+40 −2 src/modules/debug/connectivity.ts
+33 −0 src/modules/debug/status.ts
+6 −5 src/modules/feed.ts
+6 −9 src/modules/file.ts
+13 −13 src/modules/pinning.ts
+13 −0 src/modules/status.ts
+48 −0 src/types/debug.ts
+142 −7 src/types/index.ts
+13 −0 src/types/webpack-bundle-analyzer/index.d.ts
+12 −1 src/utils/bytes.ts
+24 −0 src/utils/data.browser.ts
+29 −18 src/utils/data.ts
+115 −21 src/utils/eth.ts
+1 −1 src/utils/hash.ts
+128 −35 src/utils/hex.ts
+24 −0 src/utils/type.ts
+52 −0 src/utils/url.ts
+108 −1 test/bee-class.browser.spec.ts
+130 −38 test/bee-class.spec.ts
+5 −4 test/bee.sh
+48 −0 test/chunk/cac.spec.ts
+91 −21 test/chunk/signer.spec.ts
+3 −40 test/chunk/soc.spec.ts
+21 −20 test/feed/index.spec.ts
+8 −4 test/modules/bytes.spec.ts
+8 −4 test/modules/chunk.spec.ts
+19 −15 test/modules/collection.spec.ts
+20 −17 test/modules/debug/chequebook.spec.ts
+57 −3 test/modules/debug/connectivity.spec.ts
+38 −0 test/modules/debug/status.spec.ts
+15 −10 test/modules/feed.spec.ts
+19 −11 test/modules/file.spec.ts
+37 −13 test/modules/pinning.spec.ts
+10 −0 test/modules/status.spec.ts
+24 −4 test/utils.ts
+32 −0 test/utils/bytes.spec.ts
+85 −2 test/utils/eth.spec.ts
+68 −70 test/utils/hex.spec.ts
+31 −0 test/utils/type.spec.ts
+0 −13 tsconfig.d.json
+5 −2 tsconfig.json
+0 −7 tsconfig.typedoc.json
+1 −2 typedoc.json
219 changes: 127 additions & 92 deletions docs/api/classes/bee.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/api/classes/beeargumenterror.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Name | Type |

Inherited from: [BeeError](beeerror.md)

Defined in: [bee-js/src/utils/error.ts:7](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/error.ts#L7)
Defined in: [bee-js/src/utils/error.ts:7](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/error.ts#L7)

## Properties

Expand Down
147 changes: 110 additions & 37 deletions docs/api/classes/beedebug.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ Name | Type |

**Returns:** [*BeeDebug*](beedebug.md)

Defined in: [bee-js/src/bee-debug.ts:28](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L28)
Defined in: [bee-js/src/bee-debug.ts:36](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L36)

## Properties

### url

• `Readonly` **url**: *string*

Defined in: [bee-js/src/bee-debug.ts:36](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L36)

## Methods

### cashoutLastCheque
Expand All @@ -50,25 +52,25 @@ Name | Type | Description |

**Returns:** *Promise*<[*CashoutResponse*](../interfaces/cashoutresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:134](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L134)
Defined in: [bee-js/src/bee-debug.ts:161](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L161)

___

### depositTokens

▸ **depositTokens**(`amount`: *number*): *Promise*<[*DepositTokensResponse*](../interfaces/deposittokensresponse.md)\>
▸ **depositTokens**(`amount`: *number* \| BigInt): *Promise*<[*DepositTokensResponse*](../interfaces/deposittokensresponse.md)\>

Deposit tokens from overlay address into chequebook

#### Parameters:

Name | Type | Description |
:------ | :------ | :------ |
`amount` | *number* | Amount of tokens to deposit |
`amount` | *number* \| BigInt | Amount of tokens to deposit (must be positive integer) |

**Returns:** *Promise*<[*DepositTokensResponse*](../interfaces/deposittokensresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:143](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L143)
Defined in: [bee-js/src/bee-debug.ts:170](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L170)

___

Expand All @@ -80,7 +82,7 @@ Get the balances with all known peers including prepaid services

**Returns:** *Promise*<[*BalanceResponse*](../interfaces/balanceresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:57](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L57)
Defined in: [bee-js/src/bee-debug.ts:81](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L81)

___

Expand All @@ -92,31 +94,56 @@ Get settlements with all known peers and total amount sent or received

**Returns:** *Promise*<[*AllSettlements*](../interfaces/allsettlements.md)\>

Defined in: [bee-js/src/bee-debug.ts:172](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L172)
Defined in: [bee-js/src/bee-debug.ts:207](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L207)

___

### getBlocklist

▸ **getBlocklist**(): *Promise*<[*Peer*](../interfaces/peer.md)[]\>

**Returns:** *Promise*<[*Peer*](../interfaces/peer.md)[]\>

Defined in: [bee-js/src/bee-debug.ts:51](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L51)

___

### getChequebookAddress

▸ **getChequebookAddress**(): *Promise*<[*ChequebookAddressResponse*](../interfaces/chequebookaddressresponse.md)\>

Get the address of the chequebook contract used
Get the address of the chequebook contract used.

**Warning:** The address is returned with 0x prefix unlike all other calls.
https://github.com/ethersphere/bee/issues/1443

**Returns:** *Promise*<[*ChequebookAddressResponse*](../interfaces/chequebookaddressresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:93](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L93)
Defined in: [bee-js/src/bee-debug.ts:120](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L120)

___

### getChequeubookBalance
### getChequebookBalance

▸ **getChequeubookBalance**(): *Promise*<[*ChequebookBalanceResponse*](../interfaces/chequebookbalanceresponse.md)\>
▸ **getChequebookBalance**(): *Promise*<[*ChequebookBalanceResponse*](../interfaces/chequebookbalanceresponse.md)\>

Get the balance of the chequebook

**Returns:** *Promise*<[*ChequebookBalanceResponse*](../interfaces/chequebookbalanceresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:100](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L100)
Defined in: [bee-js/src/bee-debug.ts:127](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L127)

___

### getHealth

▸ **getHealth**(): *Promise*<[*Health*](../interfaces/health.md)\>

Get health of node

**Returns:** *Promise*<[*Health*](../interfaces/health.md)\>

Defined in: [bee-js/src/bee-debug.ts:214](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L214)

___

Expand All @@ -134,7 +161,7 @@ Name | Type | Description |

**Returns:** *Promise*<[*LastCashoutActionResponse*](../interfaces/lastcashoutactionresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:125](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L125)
Defined in: [bee-js/src/bee-debug.ts:152](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L152)

___

Expand All @@ -146,7 +173,7 @@ Get last cheques for all peers

**Returns:** *Promise*<[*LastChequesResponse*](../interfaces/lastchequesresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:107](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L107)
Defined in: [bee-js/src/bee-debug.ts:134](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L134)

___

Expand All @@ -164,17 +191,17 @@ Name | Type | Description |

**Returns:** *Promise*<[*LastChequesForPeerResponse*](../interfaces/lastchequesforpeerresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:116](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L116)
Defined in: [bee-js/src/bee-debug.ts:143](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L143)

___

### getOverlayAddress
### getNodeAddresses

▸ **getOverlayAddress**(): *Promise*<string\>
▸ **getNodeAddresses**(): *Promise*<[*NodeAddresses*](../interfaces/nodeaddresses.md)\>

**Returns:** *Promise*<string\>
**Returns:** *Promise*<[*NodeAddresses*](../interfaces/nodeaddresses.md)\>

Defined in: [bee-js/src/bee-debug.ts:31](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L31)
Defined in: [bee-js/src/bee-debug.ts:47](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L47)

___

Expand All @@ -186,7 +213,7 @@ Get the past due consumption balances with all known peers

**Returns:** *Promise*<[*BalanceResponse*](../interfaces/balanceresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:73](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L73)
Defined in: [bee-js/src/bee-debug.ts:97](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L97)

___

Expand All @@ -204,7 +231,7 @@ Name | Type | Description |

**Returns:** *Promise*<[*PeerBalance*](../interfaces/peerbalance.md)\>

Defined in: [bee-js/src/bee-debug.ts:82](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L82)
Defined in: [bee-js/src/bee-debug.ts:106](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L106)

___

Expand All @@ -222,7 +249,7 @@ Name | Type | Description |

**Returns:** *Promise*<[*PeerBalance*](../interfaces/peerbalance.md)\>

Defined in: [bee-js/src/bee-debug.ts:66](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L66)
Defined in: [bee-js/src/bee-debug.ts:90](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L90)

___

Expand All @@ -234,17 +261,7 @@ Get list of peers for this node

**Returns:** *Promise*<[*Peer*](../interfaces/peer.md)[]\>

Defined in: [bee-js/src/bee-debug.ts:46](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L46)

___

### getPssPublicKey

▸ **getPssPublicKey**(): *Promise*<string\>

**Returns:** *Promise*<string\>

Defined in: [bee-js/src/bee-debug.ts:37](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L37)
Defined in: [bee-js/src/bee-debug.ts:58](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L58)

___

Expand All @@ -262,22 +279,78 @@ Name | Type | Description |

**Returns:** *Promise*<[*Settlements*](../interfaces/settlements.md)\>

Defined in: [bee-js/src/bee-debug.ts:165](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L165)
Defined in: [bee-js/src/bee-debug.ts:200](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L200)

___

### getTopology

▸ **getTopology**(): *Promise*<[*Topology*](../interfaces/topology.md)\>

**Returns:** *Promise*<[*Topology*](../interfaces/topology.md)\>

Defined in: [bee-js/src/bee-debug.ts:66](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L66)

___

### isSupportedVersion

▸ **isSupportedVersion**(): *Promise*<boolean\>

Connnects to a node and checks if it is a supported Bee version by the bee-js

**Returns:** *Promise*<boolean\>

true if the Bee node version is supported

Defined in: [bee-js/src/bee-debug.ts:223](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L223)

___

### pingPeer

▸ **pingPeer**(`peer`: *string*): *Promise*<[*PingResponse*](../interfaces/pingresponse.md)\>

#### Parameters:

Name | Type |
:------ | :------ |
`peer` | *string* |

**Returns:** *Promise*<[*PingResponse*](../interfaces/pingresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:70](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L70)

___

### removePeer

▸ **removePeer**(`peer`: *string*): *Promise*<[*RemovePeerResponse*](../interfaces/removepeerresponse.md)\>

#### Parameters:

Name | Type |
:------ | :------ |
`peer` | *string* |

**Returns:** *Promise*<[*RemovePeerResponse*](../interfaces/removepeerresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:62](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L62)

___

### withdrawTokens

▸ **withdrawTokens**(`amount`: *number*): *Promise*<[*WithdrawTokensResponse*](../interfaces/withdrawtokensresponse.md)\>
▸ **withdrawTokens**(`amount`: *number* \| BigInt): *Promise*<[*WithdrawTokensResponse*](../interfaces/withdrawtokensresponse.md)\>

Withdraw tokens from the chequebook to the overlay address

#### Parameters:

Name | Type | Description |
:------ | :------ | :------ |
`amount` | *number* | Amount of tokens to withdraw |
`amount` | *number* \| BigInt | Amount of tokens to withdraw (must be positive integer) |

**Returns:** *Promise*<[*WithdrawTokensResponse*](../interfaces/withdrawtokensresponse.md)\>

Defined in: [bee-js/src/bee-debug.ts:152](https://github.com/ethersphere/bee-js/blob/7dfd556/src/bee-debug.ts#L152)
Defined in: [bee-js/src/bee-debug.ts:183](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/bee-debug.ts#L183)
2 changes: 1 addition & 1 deletion docs/api/classes/beeerror.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Name | Type |

**Returns:** [*BeeError*](beeerror.md)

Defined in: [bee-js/src/utils/error.ts:1](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/error.ts#L1)
Defined in: [bee-js/src/utils/error.ts:1](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/error.ts#L1)

## Properties

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/beerequesterror.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Name | Type |

Inherited from: [BeeError](beeerror.md)

Defined in: [bee-js/src/utils/error.ts:13](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/error.ts#L13)
Defined in: [bee-js/src/utils/error.ts:13](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/error.ts#L13)

## Properties

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/beeresponseerror.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Name | Type |

Inherited from: [BeeError](beeerror.md)

Defined in: [bee-js/src/utils/error.ts:19](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/error.ts#L19)
Defined in: [bee-js/src/utils/error.ts:19](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/error.ts#L19)

## Properties

Expand Down
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.bytesatoffset.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Name | Type | Description |

**Returns:** [*Bytes*](../interfaces/utils.bytes.bytes.md)<Length\>

Defined in: [bee-js/src/utils/bytes.ts:88](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L88)
Defined in: [bee-js/src/utils/bytes.ts:91](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L91)
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.bytesequal.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ Name | Type | Description |

**Returns:** *boolean*

Defined in: [bee-js/src/utils/bytes.ts:115](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L115)
Defined in: [bee-js/src/utils/bytes.ts:118](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L118)
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.flexbytesatoffset.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ Name | Type | Description |

**Returns:** [*FlexBytes*](../interfaces/utils.bytes.flexbytes.md)<Min, Max\>

Defined in: [bee-js/src/utils/bytes.ts:100](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L100)
Defined in: [bee-js/src/utils/bytes.ts:103](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L103)
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.isbytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Name | Type | Description |

**Returns:** b is Bytes<Length\>

Defined in: [bee-js/src/utils/bytes.ts:31](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L31)
Defined in: [bee-js/src/utils/bytes.ts:34](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L34)
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.isflexbytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Name | Type | Description |

**Returns:** b is FlexBytes<Min, Max\>

Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L55)
Defined in: [bee-js/src/utils/bytes.ts:58](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L58)
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.makebytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Name | Type | Description |

**Returns:** [*Bytes*](../interfaces/utils.bytes.bytes.md)<Length\>

Defined in: [bee-js/src/utils/bytes.ts:124](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L124)
Defined in: [bee-js/src/utils/bytes.ts:127](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L127)
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.verifybytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Name | Type | Description |

**Returns:** [*Bytes*](../interfaces/utils.bytes.bytes.md)<Length\> \| *never*

Defined in: [bee-js/src/utils/bytes.ts:41](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L41)
Defined in: [bee-js/src/utils/bytes.ts:44](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L44)
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.verifybytesatoffset.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Name | Type | Description |

**Returns:** [*Bytes*](../interfaces/utils.bytes.bytes.md)<Length\>

Defined in: [bee-js/src/utils/bytes.ts:135](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L135)
Defined in: [bee-js/src/utils/bytes.ts:138](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L138)
2 changes: 1 addition & 1 deletion docs/api/functions/utils.bytes.verifyflexbytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Name | Type | Description |

**Returns:** [*FlexBytes*](../interfaces/utils.bytes.flexbytes.md)<Min, Max\> \| *never*

Defined in: [bee-js/src/utils/bytes.ts:70](https://github.com/ethersphere/bee-js/blob/7dfd556/src/utils/bytes.ts#L70)
Defined in: [bee-js/src/utils/bytes.ts:73](https://github.com/ethersphere/bee-js/blob/0ac3a7d/src/utils/bytes.ts#L73)
Loading