# bee-js Documentation > bee-js is the official JavaScript/TypeScript SDK for building applications on Swarm, a decentralised storage and communication network. This file contains all documentation content in a single document following the llmstxt.org standard. ## Overview ## Namespaces - [Utils](./namespaces/Utils/approximateOverheadForRedundancyLevel.md) ## Enumerations - [BeeModes](enumerations/BeeModes.md) - [RedundancyLevel](enumerations/RedundancyLevel.md) - [RedundancyStrategy](enumerations/RedundancyStrategy.md) ## Classes - [BatchId](classes/BatchId.md) - [Bee](classes/Bee.md) - [BeeArgumentError](classes/BeeArgumentError.md) - [BeeDev](classes/BeeDev.md) - [BeeError](classes/BeeError.md) - [BeeResponseError](classes/BeeResponseError.md) - [Bytes](classes/Bytes.md) - [BZZ](classes/BZZ.md) - [DAI](classes/DAI.md) - [Duration](classes/Duration.md) - [EthAddress](classes/EthAddress.md) - [FeedIndex](classes/FeedIndex.md) - [Identifier](classes/Identifier.md) - [MantarayNode](classes/MantarayNode.md) - [PeerAddress](classes/PeerAddress.md) - [PrivateKey](classes/PrivateKey.md) - [PublicKey](classes/PublicKey.md) - [Reference](classes/Reference.md) - [Signature](classes/Signature.md) - [Size](classes/Size.md) - [Span](classes/Span.md) - [Stamper](classes/Stamper.md) - [Topic](classes/Topic.md) - [TransactionId](classes/TransactionId.md) ## Interfaces - [AllSettlements](interfaces/AllSettlements.md) - [AllTagsOptions](interfaces/AllTagsOptions.md) - [BalanceResponse](interfaces/BalanceResponse.md) - [BatchBucket](interfaces/BatchBucket.md) - [BeeOptions](interfaces/BeeOptions.md) - [BeeRequest](interfaces/BeeRequest.md) - [BeeResponse](interfaces/BeeResponse.md) - [BeeVersions](interfaces/BeeVersions.md) - [Bin](interfaces/Bin.md) - [CashoutResult](interfaces/CashoutResult.md) - [ChainState](interfaces/ChainState.md) - [Cheque](interfaces/Cheque.md) - [ChequebookAddressResponse](interfaces/ChequebookAddressResponse.md) - [ChequebookBalanceResponse](interfaces/ChequebookBalanceResponse.md) - [CollectionEntry](interfaces/CollectionEntry.md) - [CollectionUploadOptions](interfaces/CollectionUploadOptions.md) - [Data](interfaces/Data.md) - [DebugStatus](interfaces/DebugStatus.md) - [DownloadOptions](interfaces/DownloadOptions.md) - [Envelope](interfaces/Envelope.md) - [EnvelopeWithBatchId](interfaces/EnvelopeWithBatchId.md) - [FeedReader](interfaces/FeedReader.md) - [FeedWriter](interfaces/FeedWriter.md) - [FileData](interfaces/FileData.md) - [FileHeaders](interfaces/FileHeaders.md) - [FileUploadOptions](interfaces/FileUploadOptions.md) - [GetGranteesResult](interfaces/GetGranteesResult.md) - [GlobalPostageBatch](interfaces/GlobalPostageBatch.md) - [GranteesResult](interfaces/GranteesResult.md) - [GsocMessageHandler](interfaces/GsocMessageHandler.md) - [GsocSubscription](interfaces/GsocSubscription.md) - [Health](interfaces/Health.md) - [LastCashoutActionResponse](interfaces/LastCashoutActionResponse.md) - [LastChequesForPeerResponse](interfaces/LastChequesForPeerResponse.md) - [LastChequesResponse](interfaces/LastChequesResponse.md) - [NodeAddresses](interfaces/NodeAddresses.md) - [NodeInfo](interfaces/NodeInfo.md) - [Peer](interfaces/Peer.md) - [PeerBalance](interfaces/PeerBalance.md) - [Pin](interfaces/Pin.md) - [PingResponse](interfaces/PingResponse.md) - [PostageBatch](interfaces/PostageBatch.md) - [PostageBatchBuckets](interfaces/PostageBatchBuckets.md) - [PostageBatchOptions](interfaces/PostageBatchOptions.md) - [PssMessageHandler](interfaces/PssMessageHandler.md) - [PssSubscription](interfaces/PssSubscription.md) - [Readiness](interfaces/Readiness.md) - [RedistributionState](interfaces/RedistributionState.md) - [RedundantUploadOptions](interfaces/RedundantUploadOptions.md) - [ReferenceInformation](interfaces/ReferenceInformation.md) - [ReferenceResponse](interfaces/ReferenceResponse.md) - [RemovePeerResponse](interfaces/RemovePeerResponse.md) - [ReserveState](interfaces/ReserveState.md) - [Settlements](interfaces/Settlements.md) - [SOCReader](interfaces/SOCReader.md) - [SOCWriter](interfaces/SOCWriter.md) - [Tag](interfaces/Tag.md) - [Topology](interfaces/Topology.md) - [TransactionInfo](interfaces/TransactionInfo.md) - [TransactionOptions](interfaces/TransactionOptions.md) - [TransactionResponse](interfaces/TransactionResponse.md) - [UploadHeaders](interfaces/UploadHeaders.md) - [UploadOptions](interfaces/UploadOptions.md) - [UploadResult](interfaces/UploadResult.md) - [WalletBalance](interfaces/WalletBalance.md) ## Type Aliases - [BeeRequestOptions](type-aliases/BeeRequestOptions.md) - [Collection](type-aliases/Collection.md) - [HookCallback](type-aliases/HookCallback.md) - [HttpMethod](type-aliases/HttpMethod.md) - [NumberString](type-aliases/NumberString.md) ## Variables - [BRANCHES](variables/BRANCHES.md) - [CHUNK\_SIZE](variables/CHUNK_SIZE.md) - [FEED\_INDEX\_HEX\_LENGTH](variables/FEED_INDEX_HEX_LENGTH.md) - [NULL\_ADDRESS](variables/NULL_ADDRESS.md) - [NULL\_IDENTIFIER](variables/NULL_IDENTIFIER.md) - [NULL\_OWNER](variables/NULL_OWNER.md) - [NULL\_STAMP](variables/NULL_STAMP.md) - [NULL\_TOPIC](variables/NULL_TOPIC.md) - [PSS\_TARGET\_HEX\_LENGTH\_MAX](variables/PSS_TARGET_HEX_LENGTH_MAX.md) - [SECTION\_SIZE](variables/SECTION_SIZE.md) - [STAMPS\_DEPTH\_MAX](variables/STAMPS_DEPTH_MAX.md) - [STAMPS\_DEPTH\_MIN](variables/STAMPS_DEPTH_MIN.md) - [SUPPORTED\_BEE\_VERSION](variables/SUPPORTED_BEE_VERSION.md) - [SUPPORTED\_BEE\_VERSION\_EXACT](variables/SUPPORTED_BEE_VERSION_EXACT.md) - [SWARM\_GATEWAY\_URL](variables/SWARM_GATEWAY_URL.md) - [TAGS\_LIMIT\_MAX](variables/TAGS_LIMIT_MAX.md) - [TAGS\_LIMIT\_MIN](variables/TAGS_LIMIT_MIN.md) ## Functions - [toBeeMode](functions/toBeeMode.md) --- ## Class: BZZ Defined in: [bee-js/src/utils/tokens.ts:4](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L4) ## Properties ### DIGITS > `readonly` `static` **DIGITS**: `16` = `16` Defined in: [bee-js/src/utils/tokens.ts:5](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L5) ## Methods ### divide() > **divide**(`other`): `BZZ` Defined in: [bee-js/src/utils/tokens.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L63) Does not mutate the current BZZ instance. #### Parameters ##### other `bigint` Divisor #### Returns `BZZ` New BZZ instance *** ### eq() > **eq**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L83) #### Parameters ##### other `BZZ` #### Returns `boolean` *** ### exchangeToDAI() > **exchangeToDAI**(`daiPerBzz`): [`DAI`](DAI.md) Defined in: [bee-js/src/utils/tokens.ts:87](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L87) #### Parameters ##### daiPerBzz [`DAI`](DAI.md) #### Returns [`DAI`](DAI.md) *** ### gt() > **gt**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L67) #### Parameters ##### other `BZZ` #### Returns `boolean` *** ### gte() > **gte**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L71) #### Parameters ##### other `BZZ` #### Returns `boolean` *** ### lt() > **lt**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L75) #### Parameters ##### other `BZZ` #### Returns `boolean` *** ### lte() > **lte**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L79) #### Parameters ##### other `BZZ` #### Returns `boolean` *** ### minus() > **minus**(`other`): `BZZ` Defined in: [bee-js/src/utils/tokens.ts:53](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L53) Does not mutate the current BZZ instance. #### Parameters ##### other BZZ instance, or amount in PLUR `string` | `bigint` | `BZZ` | [`NumberString`](../type-aliases/NumberString.md) #### Returns `BZZ` New BZZ instance *** ### plus() > **plus**(`other`): `BZZ` Defined in: [bee-js/src/utils/tokens.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L43) Does not mutate the current BZZ instance. #### Parameters ##### other BZZ instance, or amount in PLUR `string` | `bigint` | `BZZ` | [`NumberString`](../type-aliases/NumberString.md) #### Returns `BZZ` New BZZ instance *** ### toDecimalString() > **toDecimalString**(): `string` Defined in: [bee-js/src/utils/tokens.ts:29](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L29) #### Returns `string` *** ### toPLURBigInt() > **toPLURBigInt**(): `bigint` Defined in: [bee-js/src/utils/tokens.ts:25](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L25) #### Returns `bigint` *** ### toPLURString() > **toPLURString**(): `string` Defined in: [bee-js/src/utils/tokens.ts:21](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L21) #### Returns `string` *** ### toSignificantDigits() > **toSignificantDigits**(`digits`): `string` Defined in: [bee-js/src/utils/tokens.ts:33](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L33) #### Parameters ##### digits `number` #### Returns `string` *** ### fromDecimalString() > `static` **fromDecimalString**(`string`): `BZZ` Defined in: [bee-js/src/utils/tokens.ts:13](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L13) #### Parameters ##### string `string` #### Returns `BZZ` *** ### fromPLUR() > `static` **fromPLUR**(`plur`): `BZZ` Defined in: [bee-js/src/utils/tokens.ts:17](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L17) #### Parameters ##### plur `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) #### Returns `BZZ` --- ## Class: BatchId Defined in: [bee-js/src/utils/typed-bytes.ts:147](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L147) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new BatchId**(`bytes`): `BatchId` Defined in: [bee-js/src/utils/typed-bytes.ts:149](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L149) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `BatchId` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `32` = `32` Defined in: [bee-js/src/utils/typed-bytes.ts:148](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L148) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: Bee Defined in: [bee-js/src/bee.ts:142](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L142) The main component that abstracts operations available on the main Bee API. Not all methods are always available as it depends in what mode is Bee node launched in. For example gateway mode and light node mode has only limited set of endpoints enabled. ## Extended by - [`BeeDev`](BeeDev.md) ## Constructors ### Constructor > **new Bee**(`url`, `options?`): `Bee` Defined in: [bee-js/src/bee.ts:168](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L168) #### Parameters ##### url `string` URL on which is the main API of Bee node exposed ##### options? [`BeeOptions`](../interfaces/BeeOptions.md) #### Returns `Bee` ## Properties ### network > `readonly` **network**: `"gnosis"` \| `"sepolia"` Defined in: [bee-js/src/bee.ts:156](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L156) Network on which the Bee node is running *** ### signer? > `readonly` `optional` **signer**: [`PrivateKey`](PrivateKey.md) Defined in: [bee-js/src/bee.ts:151](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L151) Default Signer object used for signing operations, mainly Feeds. *** ### url > `readonly` **url**: `string` Defined in: [bee-js/src/bee.ts:146](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L146) URL on which is the main API of Bee node exposed ## Methods ### buyStorage() > **buyStorage**(`size`, `duration`, `options?`, `requestOptions?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1649](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1649) #### Parameters ##### size [`Size`](Size.md) ##### duration [`Duration`](Duration.md) ##### options? [`PostageBatchOptions`](../interfaces/PostageBatchOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BatchId`](BatchId.md)\> *** ### cancelPendingTransaction() > **cancelPendingTransaction**(`transactionHash`, `gasPrice?`, `options?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1907](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1907) Cancel currently pending transaction #### Parameters ##### transactionHash `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`TransactionId`](TransactionId.md) ##### gasPrice? `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> *** ### cashoutLastCheque() > **cashoutLastCheque**(`address`, `options?`, `requestOptions?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1425](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1425) Cashout the last cheque for the peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`TransactionOptions`](../interfaces/TransactionOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> *** ### checkConnection() > **checkConnection**(`options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:1265](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1265) Ping the Bee node to see if there is a live Bee node on the given URL. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws If connection was not successful throw error *** ### createEnvelope() > **createEnvelope**(`postageBatchId`, `reference`, `options?`): `Promise`\<[`EnvelopeWithBatchId`](../interfaces/EnvelopeWithBatchId.md)\> Defined in: [bee-js/src/bee.ts:1241](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1241) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`EnvelopeWithBatchId`](../interfaces/EnvelopeWithBatchId.md)\> *** ### createFeedManifest() > **createFeedManifest**(`postageBatchId`, `topic`, `owner`, `options?`, `requestOptions?`): `Promise`\<[`Reference`](Reference.md)\> Defined in: [bee-js/src/bee.ts:1132](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1132) Create feed manifest chunk and return the reference to it. Feed manifest chunk allows for a feed to be able to be resolved through `/bzz` endpoint. #### Parameters ##### postageBatchId Postage BatchId to be used to create the Feed Manifest `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### topic Topic in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### owner Owner's ethereum address in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Reference`](Reference.md)\> #### See - [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds) - [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post) *** ### createGrantees() > **createGrantees**(`postageBatchId`, `grantees`, `requestOptions?`): `Promise`\<[`GranteesResult`](../interfaces/GranteesResult.md)\> Defined in: [bee-js/src/bee.ts:345](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L345) Create a grantees list from the given array of public keys. The grantees list can be obtained with the `getGrantees` method. #### Parameters ##### postageBatchId The ID of the postage batch. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### grantees An array of public keys representing the grantees. `string`[] | `Uint8Array`\<`ArrayBufferLike`\>[] | [`PublicKey`](PublicKey.md)[] ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Optional request options. #### Returns `Promise`\<[`GranteesResult`](../interfaces/GranteesResult.md)\> A promise that resolves to a `GranteesResult` object. *** ### createPostageBatch() > **createPostageBatch**(`amount`, `depth`, `options?`, `requestOptions?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1609](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1609) Creates new postage batch from the funds that the node has available in its Ethereum account. For better understanding what each parameter means and what are the optimal values please see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction#keep-your-data-alive). **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY** #### Parameters ##### amount Amount that represents the value per chunk, has to be greater or equal zero. `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### depth `number` Logarithm of the number of chunks that can be stamped with the batch. ##### options? [`PostageBatchOptions`](../interfaces/PostageBatchOptions.md) Options for creation of postage batch ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### Throws BeeArgumentError when negative amount or depth is specified #### Throws TypeError if non-integer value is passed to amount or depth #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post) *** ### createTag() > **createTag**(`options?`): `Promise`\<[`Tag`](../interfaces/Tag.md)\> Defined in: [bee-js/src/bee.ts:649](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L649) Create a new Tag which is meant for tracking progres of syncing data across network. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<[`Tag`](../interfaces/Tag.md)\> #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `POST /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post) *** ### deleteTag() > **deleteTag**(`tagUid`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:701](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L701) Delete Tag #### Parameters ##### tagUid UID or tag object to be retrieved `number` | [`Tag`](../interfaces/Tag.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if tagUid is in not correct format #### Throws BeeResponse error if something went wrong on the Bee node side while deleting the tag. #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `DELETE /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/delete) *** ### depositStake() > **depositStake**(`amount`, `options?`, `requestOptions?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1940](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1940) Deposits given amount of BZZ token (in PLUR unit). Be aware that staked BZZ tokens can **not** be withdrawn. #### Parameters ##### amount Amount of BZZ token (in PLUR unit) to be staked. Minimum is 100_000_000_000_000_000 PLUR (10 BZZ). `string` | `bigint` | [`BZZ`](BZZ.md) | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`TransactionOptions`](../interfaces/TransactionOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> *** ### depositTokens() > **depositTokens**(`amount`, `gasPrice?`, `options?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1446](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1446) Deposit tokens from overlay address into chequebook #### Parameters ##### amount Amount of tokens to deposit (must be positive integer) `string` | `bigint` | [`BZZ`](BZZ.md) | [`NumberString`](../type-aliases/NumberString.md) ##### gasPrice? Gas Price in WEI for the transaction call `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> string Hash of the transaction *** ### diluteBatch() > **diluteBatch**(`postageBatchId`, `depth`, `options?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1786](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1786) Dilute given Postage Batch with new depth (that has to be bigger then the original depth), which allows the Postage Batch to be used for more chunks. For better understanding what each parameter means and what are the optimal values please see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive). #### Parameters ##### postageBatchId Batch ID `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### depth `number` Amount to be added to the batch ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Request options #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1dilute~1%7Bbatch_id%7D~1%7Bdepth%7D/patch) *** ### downloadChunk() > **downloadChunk**(`reference`, `options?`, `requestOptions?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> Defined in: [bee-js/src/bee.ts:321](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L321) Download chunk as a byte array #### Parameters ##### reference Bee chunk reference in hex string (either 64 or 128 chars long) or ENS domain. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{address}/get) *** ### downloadData() > **downloadData**(`resource`, `options?`, `requestOptions?`): `Promise`\<[`Bytes`](Bytes.md)\> Defined in: [bee-js/src/bee.ts:243](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L243) Download data as a byte array #### Parameters ##### resource Swarm reference, Swarm CID, or ENS domain `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Bytes`](Bytes.md)\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get) *** ### downloadFile() > **downloadFile**(`resource`, `path`, `options?`, `requestOptions?`): `Promise`\<[`FileData`](../interfaces/FileData.md)\<[`Bytes`](Bytes.md)\>\> Defined in: [bee-js/src/bee.ts:468](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L468) Download single file. #### Parameters ##### resource Swarm reference, Swarm CID, or ENS domain `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### path `string` = `''` If reference points to manifest, then this parameter defines path to the file ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`FileData`](../interfaces/FileData.md)\<[`Bytes`](Bytes.md)\>\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - Data - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get) *** ### downloadReadableData() > **downloadReadableData**(`resource`, `options?`, `requestOptions?`): `Promise`\<`ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\>\> Defined in: [bee-js/src/bee.ts:265](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L265) Download data as a Readable stream #### Parameters ##### resource Swarm reference, Swarm CID, or ENS domain `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\>\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get) *** ### downloadReadableFile() > **downloadReadableFile**(`reference`, `path`, `options?`, `requestOptions?`): `Promise`\<[`FileData`](../interfaces/FileData.md)\<`ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\>\>\> Defined in: [bee-js/src/bee.ts:493](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L493) Download single file as a readable stream #### Parameters ##### reference Bee file reference in hex string (either 64 or 128 chars long), ENS domain or Swarm CID. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### path `string` = `''` If reference points to manifest / collections, then this parameter defines path to the file ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`FileData`](../interfaces/FileData.md)\<`ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\>\>\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get) *** ### extendStorageDuration() > **extendStorageDuration**(`postageBatchId`, `duration`, `options?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1688](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1688) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### duration [`Duration`](Duration.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BatchId`](BatchId.md)\> *** ### extendStorageSize() > **extendStorageSize**(`postageBatchId`, `size`, `options?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1674](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1674) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### size [`Size`](Size.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BatchId`](BatchId.md)\> *** ### fetchLatestFeedUpdate() > **fetchLatestFeedUpdate**(`topic`, `owner`, `requestOptions?`): `Promise`\<`FeedPayloadResult`\> Defined in: [bee-js/src/bee.ts:1194](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1194) #### Parameters ##### topic `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### owner `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`FeedPayloadResult`\> *** ### getAllBalances() > **getAllBalances**(`options?`): `Promise`\<[`BalanceResponse`](../interfaces/BalanceResponse.md)\> Defined in: [bee-js/src/bee.ts:1325](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1325) Get the balances with all known peers including prepaid services #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BalanceResponse`](../interfaces/BalanceResponse.md)\> *** ### ~~getAllGlobalPostageBatch()~~ > **getAllGlobalPostageBatch**(`options?`): `Promise`\<[`GlobalPostageBatch`](../interfaces/GlobalPostageBatch.md)[]\> Defined in: [bee-js/src/bee.ts:1846](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1846) Return all globally available postage batches. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`GlobalPostageBatch`](../interfaces/GlobalPostageBatch.md)[]\> #### Deprecated Use `getGlobalPostageBatches` instead *** ### getAllPendingTransactions() > **getAllPendingTransactions**(`options?`): `Promise`\<[`TransactionInfo`](../interfaces/TransactionInfo.md)[]\> Defined in: [bee-js/src/bee.ts:1870](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1870) Return lists of all current pending transactions that the Bee made #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionInfo`](../interfaces/TransactionInfo.md)[]\> *** ### getAllPins() > **getAllPins**(`options?`): `Promise`\<[`Reference`](Reference.md)[]\> Defined in: [bee-js/src/bee.ts:766](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L766) Get list of all locally pinned references #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<[`Reference`](Reference.md)[]\> #### See [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) *** ### ~~getAllPostageBatch()~~ > **getAllPostageBatch**(`options?`): `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)[]\> Defined in: [bee-js/src/bee.ts:1838](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1838) Return all postage batches that has the node available. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)[]\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get) #### Deprecated Use `getPostageBatches` instead *** ### getAllSettlements() > **getAllSettlements**(`options?`): `Promise`\<[`AllSettlements`](../interfaces/AllSettlements.md)\> Defined in: [bee-js/src/bee.ts:1506](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1506) Get settlements with all known peers and total amount sent or received #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`AllSettlements`](../interfaces/AllSettlements.md)\> *** ### getAllTags() > **getAllTags**(`options?`, `requestOptions?`): `Promise`\<[`Tag`](../interfaces/Tag.md)[]\> Defined in: [bee-js/src/bee.ts:665](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L665) Fetches all tags. The listing is limited by options.limit. So you have to iterate using options.offset to get all tags. #### Parameters ##### options? [`AllTagsOptions`](../interfaces/AllTagsOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Tag`](../interfaces/Tag.md)[]\> #### Throws TypeError if limit or offset are not numbers or undefined #### Throws BeeArgumentError if limit or offset have invalid options #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `GET /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get) *** ### getBlocklist() > **getBlocklist**(`options?`): `Promise`\<[`Peer`](../interfaces/Peer.md)[]\> Defined in: [bee-js/src/bee.ts:1291](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1291) #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Peer`](../interfaces/Peer.md)[]\> *** ### getChainState() > **getChainState**(`options?`): `Promise`\<[`ChainState`](../interfaces/ChainState.md)\> Defined in: [bee-js/src/bee.ts:1579](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1579) Get chain state #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ChainState`](../interfaces/ChainState.md)\> *** ### getChequebookAddress() > **getChequebookAddress**(`options?`): `Promise`\<[`ChequebookAddressResponse`](../interfaces/ChequebookAddressResponse.md)\> Defined in: [bee-js/src/bee.ts:1371](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1371) 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 #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ChequebookAddressResponse`](../interfaces/ChequebookAddressResponse.md)\> *** ### getChequebookBalance() > **getChequebookBalance**(`options?`): `Promise`\<[`ChequebookBalanceResponse`](../interfaces/ChequebookBalanceResponse.md)\> Defined in: [bee-js/src/bee.ts:1378](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1378) Get the balance of the chequebook #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ChequebookBalanceResponse`](../interfaces/ChequebookBalanceResponse.md)\> *** ### getDurationExtensionCost() > **getDurationExtensionCost**(`postageBatchId`, `duration`, `options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1736](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1736) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### duration [`Duration`](Duration.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> *** ### getExtensionCost() > **getExtensionCost**(`postageBatchId`, `size`, `duration`, `options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1700](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1700) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### size [`Size`](Size.md) ##### duration [`Duration`](Duration.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> *** ### getGlobalPostageBatches() > **getGlobalPostageBatches**(`options?`): `Promise`\<[`GlobalPostageBatch`](../interfaces/GlobalPostageBatch.md)[]\> Defined in: [bee-js/src/bee.ts:1863](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1863) Return all globally available postage batches. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`GlobalPostageBatch`](../interfaces/GlobalPostageBatch.md)[]\> *** ### getGrantees() > **getGrantees**(`reference`, `requestOptions?`): `Promise`\<[`GetGranteesResult`](../interfaces/GetGranteesResult.md)\> Defined in: [bee-js/src/bee.ts:363](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L363) Retrieves the grantees for a given reference. #### Parameters ##### reference The reference. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Optional request options. #### Returns `Promise`\<[`GetGranteesResult`](../interfaces/GetGranteesResult.md)\> A promise that resolves to a `GetGranteesResult` object. *** ### getHealth() > **getHealth**(`options?`): `Promise`\<[`Health`](../interfaces/Health.md)\> Defined in: [bee-js/src/bee.ts:1520](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1520) Get health of node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Health`](../interfaces/Health.md)\> *** ### getLastCashoutAction() > **getLastCashoutAction**(`address`, `options?`): `Promise`\<[`LastCashoutActionResponse`](../interfaces/LastCashoutActionResponse.md)\> Defined in: [bee-js/src/bee.ts:1408](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1408) Get last cashout action for the peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`LastCashoutActionResponse`](../interfaces/LastCashoutActionResponse.md)\> *** ### getLastCheques() > **getLastCheques**(`options?`): `Promise`\<[`LastChequesResponse`](../interfaces/LastChequesResponse.md)\> Defined in: [bee-js/src/bee.ts:1385](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1385) Get last cheques for all peers #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`LastChequesResponse`](../interfaces/LastChequesResponse.md)\> *** ### getLastChequesForPeer() > **getLastChequesForPeer**(`address`, `options?`): `Promise`\<[`LastChequesForPeerResponse`](../interfaces/LastChequesForPeerResponse.md)\> Defined in: [bee-js/src/bee.ts:1394](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1394) Get last cheques for the peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`LastChequesForPeerResponse`](../interfaces/LastChequesForPeerResponse.md)\> *** ### getNodeAddresses() > **getNodeAddresses**(`options?`): `Promise`\<[`NodeAddresses`](../interfaces/NodeAddresses.md)\> Defined in: [bee-js/src/bee.ts:1287](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1287) #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`NodeAddresses`](../interfaces/NodeAddresses.md)\> *** ### getNodeInfo() > **getNodeInfo**(`options?`): `Promise`\<[`NodeInfo`](../interfaces/NodeInfo.md)\> Defined in: [bee-js/src/bee.ts:1534](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1534) Get mode information of node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`NodeInfo`](../interfaces/NodeInfo.md)\> *** ### getPastDueConsumptionBalances() > **getPastDueConsumptionBalances**(`options?`): `Promise`\<[`BalanceResponse`](../interfaces/BalanceResponse.md)\> Defined in: [bee-js/src/bee.ts:1343](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1343) Get the past due consumption balances with all known peers #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BalanceResponse`](../interfaces/BalanceResponse.md)\> *** ### getPastDueConsumptionPeerBalance() > **getPastDueConsumptionPeerBalance**(`address`, `options?`): `Promise`\<[`PeerBalance`](../interfaces/PeerBalance.md)\> Defined in: [bee-js/src/bee.ts:1352](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1352) Get the past due consumption balance with a specific peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PeerBalance`](../interfaces/PeerBalance.md)\> *** ### getPeerBalance() > **getPeerBalance**(`address`, `options?`): `Promise`\<[`PeerBalance`](../interfaces/PeerBalance.md)\> Defined in: [bee-js/src/bee.ts:1334](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1334) Get the balances with a specific peer including prepaid services #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PeerBalance`](../interfaces/PeerBalance.md)\> *** ### getPeers() > **getPeers**(`options?`): `Promise`\<[`Peer`](../interfaces/Peer.md)[]\> Defined in: [bee-js/src/bee.ts:1298](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1298) Get list of peers for this node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Peer`](../interfaces/Peer.md)[]\> *** ### getPendingTransaction() > **getPendingTransaction**(`transactionHash`, `options?`): `Promise`\<[`TransactionInfo`](../interfaces/TransactionInfo.md)\> Defined in: [bee-js/src/bee.ts:1878](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1878) Return transaction information for specific transaction #### Parameters ##### transactionHash `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`TransactionId`](TransactionId.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionInfo`](../interfaces/TransactionInfo.md)\> *** ### getPin() > **getPin**(`reference`, `options?`): `Promise`\<[`Pin`](../interfaces/Pin.md)\> Defined in: [bee-js/src/bee.ts:780](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L780) Get pinning status of chunk with given reference #### Parameters ##### reference Bee data reference in hex string (either 64 or 128 chars long) or ENS domain. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<[`Pin`](../interfaces/Pin.md)\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) *** ### getPostageBatch() > **getPostageBatch**(`postageBatchId`, `options?`): `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)\> Defined in: [bee-js/src/bee.ts:1805](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1805) Return details for specific postage batch. #### Parameters ##### postageBatchId Batch ID `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get) *** ### getPostageBatchBuckets() > **getPostageBatchBuckets**(`postageBatchId`, `options?`): `Promise`\<[`PostageBatchBuckets`](../interfaces/PostageBatchBuckets.md)\> Defined in: [bee-js/src/bee.ts:1822](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1822) Return detailed information related to buckets for specific postage batch. #### Parameters ##### postageBatchId Batch ID `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PostageBatchBuckets`](../interfaces/PostageBatchBuckets.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D~1buckets/get) *** ### getPostageBatches() > **getPostageBatches**(`options?`): `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)[]\> Defined in: [bee-js/src/bee.ts:1856](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1856) Return all postage batches that belong to the node. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)[]\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get) *** ### getReadiness() > **getReadiness**(`options?`): `Promise`\<[`Readiness`](../interfaces/Readiness.md)\> Defined in: [bee-js/src/bee.ts:1527](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1527) Get readiness of node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Readiness`](../interfaces/Readiness.md)\> *** ### getRedistributionState() > **getRedistributionState**(`options?`): `Promise`\<[`RedistributionState`](../interfaces/RedistributionState.md)\> Defined in: [bee-js/src/bee.ts:1960](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1960) Get current status of node in redistribution game #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`RedistributionState`](../interfaces/RedistributionState.md)\> *** ### getRequestOptionsForCall() > `protected` **getRequestOptionsForCall**(`options?`): [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Defined in: [bee-js/src/bee.ts:1983](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1983) #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) *** ### getReserveState() > **getReserveState**(`options?`): `Promise`\<[`ReserveState`](../interfaces/ReserveState.md)\> Defined in: [bee-js/src/bee.ts:1572](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1572) Get reserve state #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ReserveState`](../interfaces/ReserveState.md)\> *** ### getSettlements() > **getSettlements**(`address`, `options?`): `Promise`\<[`Settlements`](../interfaces/Settlements.md)\> Defined in: [bee-js/src/bee.ts:1497](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1497) Get amount of sent and received from settlements with a peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Settlements`](../interfaces/Settlements.md)\> *** ### getSizeExtensionCost() > **getSizeExtensionCost**(`postageBatchId`, `size`, `options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1717](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1717) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### size [`Size`](Size.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> *** ### getStake() > **getStake**(`options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1928](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1928) Gets the staked amount of BZZ (in PLUR unit) as number string. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> *** ### getStatus() > **getStatus**(`options?`): `Promise`\<[`DebugStatus`](../interfaces/DebugStatus.md)\> Defined in: [bee-js/src/bee.ts:1513](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1513) Get status of node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`DebugStatus`](../interfaces/DebugStatus.md)\> *** ### getStorageCost() > **getStorageCost**(`size`, `duration`, `options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1666](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1666) #### Parameters ##### size [`Size`](Size.md) ##### duration [`Duration`](Duration.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> *** ### getTopology() > **getTopology**(`options?`): `Promise`\<[`Topology`](../interfaces/Topology.md)\> Defined in: [bee-js/src/bee.ts:1308](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1308) #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Topology`](../interfaces/Topology.md)\> *** ### getVersions() > **getVersions**(`options?`): `Promise`\<[`BeeVersions`](../interfaces/BeeVersions.md)\> Defined in: [bee-js/src/bee.ts:1565](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1565) Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`) and versions that bee-js supports (properties prefixed with `supported*`). #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BeeVersions`](../interfaces/BeeVersions.md)\> *** ### getWalletBalance() > **getWalletBalance**(`options?`): `Promise`\<[`WalletBalance`](../interfaces/WalletBalance.md)\> Defined in: [bee-js/src/bee.ts:1588](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1588) Get wallet balances for xDai and BZZ of the Bee node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`WalletBalance`](../interfaces/WalletBalance.md)\> *** ### gsocMine() > **gsocMine**(`targetOverlay`, `identifier`, `proximity`): [`PrivateKey`](PrivateKey.md) Defined in: [bee-js/src/bee.ts:1034](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1034) #### Parameters ##### targetOverlay `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PeerAddress`](PeerAddress.md) ##### identifier `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](Identifier.md) ##### proximity `number` = `12` #### Returns [`PrivateKey`](PrivateKey.md) *** ### gsocSend() > **gsocSend**(`postageBatchId`, `signer`, `identifier`, `data`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:1054](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1054) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### signer `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PrivateKey`](PrivateKey.md) ##### identifier `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](Identifier.md) ##### data `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> *** ### gsocSubscribe() > **gsocSubscribe**(`address`, `identifier`, `handler`): [`GsocSubscription`](../interfaces/GsocSubscription.md) Defined in: [bee-js/src/bee.ts:1072](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1072) #### Parameters ##### address `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### identifier `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](Identifier.md) ##### handler [`GsocMessageHandler`](../interfaces/GsocMessageHandler.md) #### Returns [`GsocSubscription`](../interfaces/GsocSubscription.md) *** ### hashDirectory() > **hashDirectory**(`dir`): `Promise`\<[`Reference`](Reference.md)\> Defined in: [bee-js/src/bee.ts:541](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L541) #### Parameters ##### dir `string` #### Returns `Promise`\<[`Reference`](Reference.md)\> *** ### isConnected() > **isConnected**(`options?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:1275](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1275) Ping the Bee node to see if there is a live Bee node on the given URL. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`boolean`\> true if successful, false on error *** ### isFeedRetrievable() > **isFeedRetrievable**(`owner`, `topic`, `index?`, `options?`, `requestOptions?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:842](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L842) Functions that validates if feed is retrievable in the network. If no index is passed then it check for "latest" update, which is a weaker guarantee as nobody can be really sure what is the "latest" update. If index is passed then it validates all previous sequence index chunks if they are available as they are required to correctly resolve the feed upto the given index update. #### Parameters ##### owner `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### topic `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### index? [`FeedIndex`](FeedIndex.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`boolean`\> *** ### isReferenceRetrievable() > **isReferenceRetrievable**(`reference`, `options?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:818](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L818) Checks if content specified by reference is retrievable from the network. #### Parameters ##### reference Bee data reference to be checked in hex string (either 64 or 128 chars long) or ENS domain. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`boolean`\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See [Bee API reference - `GET /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/get) *** ### isSupportedApiVersion() > **isSupportedApiVersion**(`options?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:1555](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1555) Connects to a node and checks if its Main API version matches with the one that bee-js supports. This should be the main way how to check compatibility for your app and Bee node. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`boolean`\> *** ### isSupportedExactVersion() > **isSupportedExactVersion**(`options?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:1543](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1543) Connects to a node and checks if its version matches with the one that bee-js supports. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`boolean`\> *** ### makeFeedReader() > **makeFeedReader**(`topic`, `owner`, `options?`): [`FeedReader`](../interfaces/FeedReader.md) Defined in: [bee-js/src/bee.ts:1159](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1159) Make a new feed reader for downloading feed updates. #### Parameters ##### topic Topic in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### owner Owner's ethereum address in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns [`FeedReader`](../interfaces/FeedReader.md) #### See [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds) *** ### makeFeedWriter() > **makeFeedWriter**(`topic`, `signer?`, `options?`): [`FeedWriter`](../interfaces/FeedWriter.md) Defined in: [bee-js/src/bee.ts:1179](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1179) Make a new feed writer for updating feeds #### Parameters ##### topic Topic in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### signer? The signer's private key or a Signer instance that can sign data `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PrivateKey`](PrivateKey.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns [`FeedWriter`](../interfaces/FeedWriter.md) #### See [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds) *** ### makeSOCReader() > **makeSOCReader**(`ownerAddress`, `options?`): [`SOCReader`](../interfaces/SOCReader.md) Defined in: [bee-js/src/bee.ts:1212](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1212) Returns an object for reading single owner chunks #### Parameters ##### ownerAddress The ethereum address of the owner `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns [`SOCReader`](../interfaces/SOCReader.md) #### See [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks) *** ### makeSOCWriter() > **makeSOCWriter**(`signer?`, `options?`): [`SOCWriter`](../interfaces/SOCWriter.md) Defined in: [bee-js/src/bee.ts:1228](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1228) Returns an object for reading and writing single owner chunks #### Parameters ##### signer? The signer's private key or a Signer instance that can sign data `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PrivateKey`](PrivateKey.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns [`SOCWriter`](../interfaces/SOCWriter.md) #### See [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks) *** ### patchGrantees() > **patchGrantees**(`postageBatchId`, `reference`, `history`, `grantees`, `requestOptions?`): `Promise`\<[`GranteesResult`](../interfaces/GranteesResult.md)\> Defined in: [bee-js/src/bee.ts:382](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L382) Updates the grantees of a specific reference and history. #### Parameters ##### postageBatchId The ID of the postage batch. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### reference The reference. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### history The history. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### grantees The grantees. ###### add? `string`[] \| `Uint8Array`\<`ArrayBufferLike`\>[] \| [`PublicKey`](PublicKey.md)[] ###### revoke? `string`[] \| `Uint8Array`\<`ArrayBufferLike`\>[] \| [`PublicKey`](PublicKey.md)[] ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Optional request options. #### Returns `Promise`\<[`GranteesResult`](../interfaces/GranteesResult.md)\> A Promise that resolves to to a `GranteesResult` object. *** ### pin() > **pin**(`reference`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:739](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L739) Pin local data with given reference #### Parameters ##### reference Data reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if reference is in not correct format #### See [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) *** ### pingPeer() > **pingPeer**(`peer`, `options?`): `Promise`\<[`PingResponse`](../interfaces/PingResponse.md)\> Defined in: [bee-js/src/bee.ts:1312](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1312) #### Parameters ##### peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PingResponse`](../interfaces/PingResponse.md)\> *** ### probeData() > **probeData**(`reference`, `options?`): `Promise`\<[`ReferenceInformation`](../interfaces/ReferenceInformation.md)\> Defined in: [bee-js/src/bee.ts:224](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L224) Requests content length for a `/bytes` reference #### Parameters ##### reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ReferenceInformation`](../interfaces/ReferenceInformation.md)\> #### See [Bee API reference - `HEAD /bytes/`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/head) *** ### pssReceive() > **pssReceive**(`topic`, `timeoutMsec`): `Promise`\<[`Bytes`](Bytes.md)\> Defined in: [bee-js/src/bee.ts:1005](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1005) Receive message with Postal Service for Swarm Because sending a PSS message is slow and CPU intensive, it is not supposed to be used for general messaging but most likely for setting up an encrypted communication channel by sending an one-off message. This is a helper function to wait for exactly one message to arrive and then cancel the subscription. Additionally a timeout can be provided for the message to arrive or else an error will be thrown. **Warning! If connected Bee node is a light node, then he will never receive any message!** This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them. #### Parameters ##### topic [`Topic`](Topic.md) Topic name ##### timeoutMsec `number` = `0` Timeout in milliseconds #### Returns `Promise`\<[`Bytes`](Bytes.md)\> Message in byte array #### See - [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss) - [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get) *** ### pssSend() > **pssSend**(`postageBatchId`, `topic`, `target`, `data`, `recipient?`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:904](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L904) Send data to recipient or target with Postal Service for Swarm. Because sending a PSS message is slow and CPU intensive, it is not supposed to be used for general messaging but most likely for setting up an encrypted communication channel by sending an one-off message. **Warning! If the recipient Bee node is a light node, then he will never receive the message!** This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them. #### Parameters ##### postageBatchId Postage BatchId that will be assigned to sent message `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### topic [`Topic`](Topic.md) Topic name ##### target `string` Target message address prefix. Has a limit on length. Recommend to use `Utils.Pss.makeMaxTarget()` to get the most specific target that Bee node will accept. ##### data Message to be sent `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### recipient? Recipient public key `string` | [`PublicKey`](PublicKey.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if `data`, `batchId`, `target` or `recipient` are in invalid format #### See - [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss) - [Bee API reference - `POST /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1{topic}~1{targets}/post) *** ### pssSubscribe() > **pssSubscribe**(`topic`, `handler`): [`PssSubscription`](../interfaces/PssSubscription.md) Defined in: [bee-js/src/bee.ts:938](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L938) Subscribe to messages for given topic with Postal Service for Swarm **Warning! If connected Bee node is a light node, then he will never receive any message!** This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them. #### Parameters ##### topic [`Topic`](Topic.md) Topic name ##### handler [`PssMessageHandler`](../interfaces/PssMessageHandler.md) Message handler interface #### Returns [`PssSubscription`](../interfaces/PssSubscription.md) Subscription to a given topic #### See - [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss) - [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get) *** ### rchash() > **rchash**(`depth`, `anchor1`, `anchor2`, `options?`): `Promise`\<`number`\> Defined in: [bee-js/src/bee.ts:1255](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1255) Get reserve commitment hash duration seconds #### Parameters ##### depth `number` ##### anchor1 `string` ##### anchor2 `string` ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`number`\> *** ### rebroadcastPendingTransaction() > **rebroadcastPendingTransaction**(`transactionHash`, `options?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1893](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1893) Rebroadcast already created transaction. This is mainly needed when your transaction fall off mempool from other reason is not incorporated into block. #### Parameters ##### transactionHash `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`TransactionId`](TransactionId.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> *** ### removePeer() > **removePeer**(`peer`, `options?`): `Promise`\<[`RemovePeerResponse`](../interfaces/RemovePeerResponse.md)\> Defined in: [bee-js/src/bee.ts:1302](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1302) #### Parameters ##### peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`RemovePeerResponse`](../interfaces/RemovePeerResponse.md)\> *** ### retrieveTag() > **retrieveTag**(`tagUid`, `options?`): `Promise`\<[`Tag`](../interfaces/Tag.md)\> Defined in: [bee-js/src/bee.ts:684](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L684) Retrieve tag information from Bee node #### Parameters ##### tagUid UID or tag object to be retrieved `number` | [`Tag`](../interfaces/Tag.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<[`Tag`](../interfaces/Tag.md)\> #### Throws TypeError if tagUid is in not correct format #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/get) *** ### reuploadPinnedData() > **reuploadPinnedData**(`postageBatchId`, `reference`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:797](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L797) Instructs the Bee node to reupload a locally pinned data into the network. #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### reference Bee data reference to be re-uploaded in hex string (either 64 or 128 chars long) or ENS domain. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws BeeArgumentError if the reference is not locally pinned #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See [Bee API reference - `PUT /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/put) *** ### streamDirectory() > **streamDirectory**(`postageBatchId`, `dir`, `onUploadProgress?`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:545](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L545) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### dir `string` ##### onUploadProgress? (`progress`) => `void` ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> *** ### streamFiles() > **streamFiles**(`postageBatchId`, `files`, `onUploadProgress?`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:564](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L564) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### files `File`[] | `FileList` ##### onUploadProgress? (`progress`) => `void` ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> *** ### topUpBatch() > **topUpBatch**(`postageBatchId`, `amount`, `options?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1761](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1761) Topup a fresh amount of BZZ to given Postage Batch. For better understanding what each parameter means and what are the optimal values please see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive). #### Parameters ##### postageBatchId Batch ID `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### amount Amount to be added to the batch `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Request options #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1topup~1{batch_id}~1{amount}/patch) *** ### unpin() > **unpin**(`reference`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:754](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L754) Unpin local data with given reference #### Parameters ##### reference Data reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if reference is in not correct format #### See [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) *** ### updateTag() > **updateTag**(`tagUid`, `reference`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:722](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L722) Update tag's total chunks count. This is important if you are uploading individual chunks with a tag. Then upon finishing the final root chunk, you can use this method to update the total chunks count for the tag. #### Parameters ##### tagUid UID or tag object to be retrieved `number` | [`Tag`](../interfaces/Tag.md) ##### reference The root reference that contains all the chunks to be counted `string` | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if tagUid is in not correct format #### Throws BeeResponse error if something went wrong on the Bee node side while deleting the tag. #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `PATCH /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/patch) *** ### uploadChunk() > **uploadChunk**(`stamp`, `data`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:288](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L288) Upload chunk to a Bee node #### Parameters ##### stamp `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) | [`EnvelopeWithBatchId`](../interfaces/EnvelopeWithBatchId.md) ##### data Raw chunk to be uploaded `Uint8Array`\<`ArrayBufferLike`\> | `Chunk` ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) Additional options like tag, encryption, pinning, content-type and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> reference is a content hash of the data #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `POST /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) *** ### uploadCollection() > **uploadCollection**(`postageBatchId`, `collection`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:593](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L593) Upload Collection that you can assembly yourself. The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment. This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406 #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### collection [`Collection`](../type-aliases/Collection.md) ##### options? [`CollectionUploadOptions`](../interfaces/CollectionUploadOptions.md) Collections and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> *** ### uploadData() > **uploadData**(`postageBatchId`, `data`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:203](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L203) Upload data to a Bee node #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### data Data to be uploaded `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### options? [`RedundantUploadOptions`](../interfaces/RedundantUploadOptions.md) Additional options like tag, encryption, pinning, content-type and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> reference is a content hash of the data #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `POST /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post) *** ### uploadFile() > **uploadFile**(`postageBatchId`, `data`, `name?`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:420](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L420) Upload single file to a Bee node. #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### data Data or file to be uploaded `string` | `Uint8Array`\<`ArrayBufferLike`\> | `File` | `Readable` ##### name? `string` Optional name of the uploaded file ##### options? [`FileUploadOptions`](../interfaces/FileUploadOptions.md) Additional options like tag, encryption, pinning, content-type and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> reference is a content hash of the file #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) *** ### uploadFiles() > **uploadFiles**(`postageBatchId`, `fileList`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:524](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L524) Upload collection of files to a Bee node Uses the FileList API from the browser. The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment. This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406 #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### fileList list of files to be uploaded `File`[] | `FileList` ##### options? [`CollectionUploadOptions`](../interfaces/CollectionUploadOptions.md) Additional options like tag, encryption, pinning and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) *** ### uploadFilesFromDirectory() > **uploadFilesFromDirectory**(`postageBatchId`, `dir`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:625](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L625) Upload collection of files. Available only in Node.js as it uses the `fs` module. The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment. This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406 #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### dir `string` the path of the files to be uploaded ##### options? [`CollectionUploadOptions`](../interfaces/CollectionUploadOptions.md) Additional options like tag, encryption, pinning and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) *** ### withdrawTokens() > **withdrawTokens**(`amount`, `gasPrice?`, `options?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1470](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1470) Withdraw tokens from the chequebook to the overlay address #### Parameters ##### amount Amount of tokens to withdraw (must be positive integer) `string` | `bigint` | [`BZZ`](BZZ.md) | [`NumberString`](../type-aliases/NumberString.md) ##### gasPrice? Gas Price in WEI for the transaction call `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> string Hash of the transaction --- ## Class: BeeArgumentError Defined in: [bee-js/src/utils/error.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L7) ## Extends - [`BeeError`](BeeError.md) ## Constructors ### Constructor > **new BeeArgumentError**(`message`, `value`): `BeeArgumentError` Defined in: [bee-js/src/utils/error.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L8) #### Parameters ##### message `string` ##### value `unknown` #### Returns `BeeArgumentError` #### Overrides [`BeeError`](BeeError.md).[`constructor`](BeeError.md#constructor) ## Properties ### value > `readonly` **value**: `unknown` Defined in: [bee-js/src/utils/error.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L8) --- ## Class: BeeDev Defined in: [bee-js/src/bee-dev.ts:6](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee-dev.ts#L6) The main component that abstracts operations available on the main Bee API. Not all methods are always available as it depends in what mode is Bee node launched in. For example gateway mode and light node mode has only limited set of endpoints enabled. ## Extends - [`Bee`](Bee.md) ## Constructors ### Constructor > **new BeeDev**(`url`, `options?`): `BeeDev` Defined in: [bee-js/src/bee.ts:168](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L168) #### Parameters ##### url `string` URL on which is the main API of Bee node exposed ##### options? [`BeeOptions`](../interfaces/BeeOptions.md) #### Returns `BeeDev` #### Inherited from [`Bee`](Bee.md).[`constructor`](Bee.md#constructor) ## Properties ### network > `readonly` **network**: `"gnosis"` \| `"sepolia"` Defined in: [bee-js/src/bee.ts:156](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L156) Network on which the Bee node is running #### Inherited from [`Bee`](Bee.md).[`network`](Bee.md#network) *** ### signer? > `readonly` `optional` **signer**: [`PrivateKey`](PrivateKey.md) Defined in: [bee-js/src/bee.ts:151](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L151) Default Signer object used for signing operations, mainly Feeds. #### Inherited from [`Bee`](Bee.md).[`signer`](Bee.md#signer) *** ### url > `readonly` **url**: `string` Defined in: [bee-js/src/bee.ts:146](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L146) URL on which is the main API of Bee node exposed #### Inherited from [`Bee`](Bee.md).[`url`](Bee.md#url) ## Methods ### buyStorage() > **buyStorage**(`size`, `duration`, `options?`, `requestOptions?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1649](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1649) #### Parameters ##### size [`Size`](Size.md) ##### duration [`Duration`](Duration.md) ##### options? [`PostageBatchOptions`](../interfaces/PostageBatchOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### Inherited from [`Bee`](Bee.md).[`buyStorage`](Bee.md#buystorage) *** ### cancelPendingTransaction() > **cancelPendingTransaction**(`transactionHash`, `gasPrice?`, `options?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1907](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1907) Cancel currently pending transaction #### Parameters ##### transactionHash `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`TransactionId`](TransactionId.md) ##### gasPrice? `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> #### Inherited from [`Bee`](Bee.md).[`cancelPendingTransaction`](Bee.md#cancelpendingtransaction) *** ### cashoutLastCheque() > **cashoutLastCheque**(`address`, `options?`, `requestOptions?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1425](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1425) Cashout the last cheque for the peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`TransactionOptions`](../interfaces/TransactionOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> #### Inherited from [`Bee`](Bee.md).[`cashoutLastCheque`](Bee.md#cashoutlastcheque) *** ### checkConnection() > **checkConnection**(`options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:1265](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1265) Ping the Bee node to see if there is a live Bee node on the given URL. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws If connection was not successful throw error #### Inherited from [`Bee`](Bee.md).[`checkConnection`](Bee.md#checkconnection) *** ### createEnvelope() > **createEnvelope**(`postageBatchId`, `reference`, `options?`): `Promise`\<[`EnvelopeWithBatchId`](../interfaces/EnvelopeWithBatchId.md)\> Defined in: [bee-js/src/bee.ts:1241](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1241) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`EnvelopeWithBatchId`](../interfaces/EnvelopeWithBatchId.md)\> #### Inherited from [`Bee`](Bee.md).[`createEnvelope`](Bee.md#createenvelope) *** ### createFeedManifest() > **createFeedManifest**(`postageBatchId`, `topic`, `owner`, `options?`, `requestOptions?`): `Promise`\<[`Reference`](Reference.md)\> Defined in: [bee-js/src/bee.ts:1132](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1132) Create feed manifest chunk and return the reference to it. Feed manifest chunk allows for a feed to be able to be resolved through `/bzz` endpoint. #### Parameters ##### postageBatchId Postage BatchId to be used to create the Feed Manifest `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### topic Topic in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### owner Owner's ethereum address in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Reference`](Reference.md)\> #### See - [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds) - [Bee API reference - `POST /feeds`](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post) #### Inherited from [`Bee`](Bee.md).[`createFeedManifest`](Bee.md#createfeedmanifest) *** ### createGrantees() > **createGrantees**(`postageBatchId`, `grantees`, `requestOptions?`): `Promise`\<[`GranteesResult`](../interfaces/GranteesResult.md)\> Defined in: [bee-js/src/bee.ts:345](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L345) Create a grantees list from the given array of public keys. The grantees list can be obtained with the `getGrantees` method. #### Parameters ##### postageBatchId The ID of the postage batch. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### grantees An array of public keys representing the grantees. `string`[] | `Uint8Array`\<`ArrayBufferLike`\>[] | [`PublicKey`](PublicKey.md)[] ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Optional request options. #### Returns `Promise`\<[`GranteesResult`](../interfaces/GranteesResult.md)\> A promise that resolves to a `GranteesResult` object. #### Inherited from [`Bee`](Bee.md).[`createGrantees`](Bee.md#creategrantees) *** ### createPostageBatch() > **createPostageBatch**(`amount`, `depth`, `options?`, `requestOptions?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1609](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1609) Creates new postage batch from the funds that the node has available in its Ethereum account. For better understanding what each parameter means and what are the optimal values please see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction#keep-your-data-alive). **WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY** #### Parameters ##### amount Amount that represents the value per chunk, has to be greater or equal zero. `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### depth `number` Logarithm of the number of chunks that can be stamped with the batch. ##### options? [`PostageBatchOptions`](../interfaces/PostageBatchOptions.md) Options for creation of postage batch ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### Throws BeeArgumentError when negative amount or depth is specified #### Throws TypeError if non-integer value is passed to amount or depth #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `POST /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post) #### Inherited from [`Bee`](Bee.md).[`createPostageBatch`](Bee.md#createpostagebatch) *** ### createTag() > **createTag**(`options?`): `Promise`\<[`Tag`](../interfaces/Tag.md)\> Defined in: [bee-js/src/bee.ts:649](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L649) Create a new Tag which is meant for tracking progres of syncing data across network. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<[`Tag`](../interfaces/Tag.md)\> #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `POST /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post) #### Inherited from [`Bee`](Bee.md).[`createTag`](Bee.md#createtag) *** ### deleteTag() > **deleteTag**(`tagUid`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:701](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L701) Delete Tag #### Parameters ##### tagUid UID or tag object to be retrieved `number` | [`Tag`](../interfaces/Tag.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if tagUid is in not correct format #### Throws BeeResponse error if something went wrong on the Bee node side while deleting the tag. #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `DELETE /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/delete) #### Inherited from [`Bee`](Bee.md).[`deleteTag`](Bee.md#deletetag) *** ### depositStake() > **depositStake**(`amount`, `options?`, `requestOptions?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1940](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1940) Deposits given amount of BZZ token (in PLUR unit). Be aware that staked BZZ tokens can **not** be withdrawn. #### Parameters ##### amount Amount of BZZ token (in PLUR unit) to be staked. Minimum is 100_000_000_000_000_000 PLUR (10 BZZ). `string` | `bigint` | [`BZZ`](BZZ.md) | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`TransactionOptions`](../interfaces/TransactionOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> #### Inherited from [`Bee`](Bee.md).[`depositStake`](Bee.md#depositstake) *** ### depositTokens() > **depositTokens**(`amount`, `gasPrice?`, `options?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1446](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1446) Deposit tokens from overlay address into chequebook #### Parameters ##### amount Amount of tokens to deposit (must be positive integer) `string` | `bigint` | [`BZZ`](BZZ.md) | [`NumberString`](../type-aliases/NumberString.md) ##### gasPrice? Gas Price in WEI for the transaction call `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> string Hash of the transaction #### Inherited from [`Bee`](Bee.md).[`depositTokens`](Bee.md#deposittokens) *** ### diluteBatch() > **diluteBatch**(`postageBatchId`, `depth`, `options?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1786](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1786) Dilute given Postage Batch with new depth (that has to be bigger then the original depth), which allows the Postage Batch to be used for more chunks. For better understanding what each parameter means and what are the optimal values please see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive). #### Parameters ##### postageBatchId Batch ID `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### depth `number` Amount to be added to the batch ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Request options #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1dilute~1%7Bbatch_id%7D~1%7Bdepth%7D/patch) #### Inherited from [`Bee`](Bee.md).[`diluteBatch`](Bee.md#dilutebatch) *** ### downloadChunk() > **downloadChunk**(`reference`, `options?`, `requestOptions?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> Defined in: [bee-js/src/bee.ts:321](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L321) Download chunk as a byte array #### Parameters ##### reference Bee chunk reference in hex string (either 64 or 128 chars long) or ENS domain. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1{address}/get) #### Inherited from [`Bee`](Bee.md).[`downloadChunk`](Bee.md#downloadchunk) *** ### downloadData() > **downloadData**(`resource`, `options?`, `requestOptions?`): `Promise`\<[`Bytes`](Bytes.md)\> Defined in: [bee-js/src/bee.ts:243](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L243) Download data as a byte array #### Parameters ##### resource Swarm reference, Swarm CID, or ENS domain `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Bytes`](Bytes.md)\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get) #### Inherited from [`Bee`](Bee.md).[`downloadData`](Bee.md#downloaddata) *** ### downloadFile() > **downloadFile**(`resource`, `path`, `options?`, `requestOptions?`): `Promise`\<[`FileData`](../interfaces/FileData.md)\<[`Bytes`](Bytes.md)\>\> Defined in: [bee-js/src/bee.ts:468](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L468) Download single file. #### Parameters ##### resource Swarm reference, Swarm CID, or ENS domain `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### path `string` = `''` If reference points to manifest, then this parameter defines path to the file ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`FileData`](../interfaces/FileData.md)\<[`Bytes`](Bytes.md)\>\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - Data - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get) #### Inherited from [`Bee`](Bee.md).[`downloadFile`](Bee.md#downloadfile) *** ### downloadReadableData() > **downloadReadableData**(`resource`, `options?`, `requestOptions?`): `Promise`\<`ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\>\> Defined in: [bee-js/src/bee.ts:265](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L265) Download data as a Readable stream #### Parameters ##### resource Swarm reference, Swarm CID, or ENS domain `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\>\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1{reference}/get) #### Inherited from [`Bee`](Bee.md).[`downloadReadableData`](Bee.md#downloadreadabledata) *** ### downloadReadableFile() > **downloadReadableFile**(`reference`, `path`, `options?`, `requestOptions?`): `Promise`\<[`FileData`](../interfaces/FileData.md)\<`ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\>\>\> Defined in: [bee-js/src/bee.ts:493](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L493) Download single file as a readable stream #### Parameters ##### reference Bee file reference in hex string (either 64 or 128 chars long), ENS domain or Swarm CID. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### path `string` = `''` If reference points to manifest / collections, then this parameter defines path to the file ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`FileData`](../interfaces/FileData.md)\<`ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\>\>\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `GET /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get) #### Inherited from [`Bee`](Bee.md).[`downloadReadableFile`](Bee.md#downloadreadablefile) *** ### extendStorageDuration() > **extendStorageDuration**(`postageBatchId`, `duration`, `options?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1688](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1688) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### duration [`Duration`](Duration.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### Inherited from [`Bee`](Bee.md).[`extendStorageDuration`](Bee.md#extendstorageduration) *** ### extendStorageSize() > **extendStorageSize**(`postageBatchId`, `size`, `options?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1674](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1674) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### size [`Size`](Size.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### Inherited from [`Bee`](Bee.md).[`extendStorageSize`](Bee.md#extendstoragesize) *** ### fetchLatestFeedUpdate() > **fetchLatestFeedUpdate**(`topic`, `owner`, `requestOptions?`): `Promise`\<`FeedPayloadResult`\> Defined in: [bee-js/src/bee.ts:1194](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1194) #### Parameters ##### topic `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### owner `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`FeedPayloadResult`\> #### Inherited from [`Bee`](Bee.md).[`fetchLatestFeedUpdate`](Bee.md#fetchlatestfeedupdate) *** ### getAllBalances() > **getAllBalances**(`options?`): `Promise`\<[`BalanceResponse`](../interfaces/BalanceResponse.md)\> Defined in: [bee-js/src/bee.ts:1325](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1325) Get the balances with all known peers including prepaid services #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BalanceResponse`](../interfaces/BalanceResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`getAllBalances`](Bee.md#getallbalances) *** ### ~~getAllGlobalPostageBatch()~~ > **getAllGlobalPostageBatch**(`options?`): `Promise`\<[`GlobalPostageBatch`](../interfaces/GlobalPostageBatch.md)[]\> Defined in: [bee-js/src/bee.ts:1846](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1846) Return all globally available postage batches. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`GlobalPostageBatch`](../interfaces/GlobalPostageBatch.md)[]\> #### Deprecated Use `getGlobalPostageBatches` instead #### Inherited from [`Bee`](Bee.md).[`getAllGlobalPostageBatch`](Bee.md#getallglobalpostagebatch) *** ### getAllPendingTransactions() > **getAllPendingTransactions**(`options?`): `Promise`\<[`TransactionInfo`](../interfaces/TransactionInfo.md)[]\> Defined in: [bee-js/src/bee.ts:1870](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1870) Return lists of all current pending transactions that the Bee made #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionInfo`](../interfaces/TransactionInfo.md)[]\> #### Inherited from [`Bee`](Bee.md).[`getAllPendingTransactions`](Bee.md#getallpendingtransactions) *** ### getAllPins() > **getAllPins**(`options?`): `Promise`\<[`Reference`](Reference.md)[]\> Defined in: [bee-js/src/bee.ts:766](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L766) Get list of all locally pinned references #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<[`Reference`](Reference.md)[]\> #### See [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) #### Inherited from [`Bee`](Bee.md).[`getAllPins`](Bee.md#getallpins) *** ### ~~getAllPostageBatch()~~ > **getAllPostageBatch**(`options?`): `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)[]\> Defined in: [bee-js/src/bee.ts:1838](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1838) Return all postage batches that has the node available. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)[]\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get) #### Deprecated Use `getPostageBatches` instead #### Inherited from [`Bee`](Bee.md).[`getAllPostageBatch`](Bee.md#getallpostagebatch) *** ### getAllSettlements() > **getAllSettlements**(`options?`): `Promise`\<[`AllSettlements`](../interfaces/AllSettlements.md)\> Defined in: [bee-js/src/bee.ts:1506](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1506) Get settlements with all known peers and total amount sent or received #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`AllSettlements`](../interfaces/AllSettlements.md)\> #### Inherited from [`Bee`](Bee.md).[`getAllSettlements`](Bee.md#getallsettlements) *** ### getAllTags() > **getAllTags**(`options?`, `requestOptions?`): `Promise`\<[`Tag`](../interfaces/Tag.md)[]\> Defined in: [bee-js/src/bee.ts:665](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L665) Fetches all tags. The listing is limited by options.limit. So you have to iterate using options.offset to get all tags. #### Parameters ##### options? [`AllTagsOptions`](../interfaces/AllTagsOptions.md) Options that affects the request behavior ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Tag`](../interfaces/Tag.md)[]\> #### Throws TypeError if limit or offset are not numbers or undefined #### Throws BeeArgumentError if limit or offset have invalid options #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `GET /tags`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get) #### Inherited from [`Bee`](Bee.md).[`getAllTags`](Bee.md#getalltags) *** ### getBlocklist() > **getBlocklist**(`options?`): `Promise`\<[`Peer`](../interfaces/Peer.md)[]\> Defined in: [bee-js/src/bee.ts:1291](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1291) #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Peer`](../interfaces/Peer.md)[]\> #### Inherited from [`Bee`](Bee.md).[`getBlocklist`](Bee.md#getblocklist) *** ### getChainState() > **getChainState**(`options?`): `Promise`\<[`ChainState`](../interfaces/ChainState.md)\> Defined in: [bee-js/src/bee.ts:1579](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1579) Get chain state #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ChainState`](../interfaces/ChainState.md)\> #### Inherited from [`Bee`](Bee.md).[`getChainState`](Bee.md#getchainstate) *** ### getChequebookAddress() > **getChequebookAddress**(`options?`): `Promise`\<[`ChequebookAddressResponse`](../interfaces/ChequebookAddressResponse.md)\> Defined in: [bee-js/src/bee.ts:1371](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1371) 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 #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ChequebookAddressResponse`](../interfaces/ChequebookAddressResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`getChequebookAddress`](Bee.md#getchequebookaddress) *** ### getChequebookBalance() > **getChequebookBalance**(`options?`): `Promise`\<[`ChequebookBalanceResponse`](../interfaces/ChequebookBalanceResponse.md)\> Defined in: [bee-js/src/bee.ts:1378](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1378) Get the balance of the chequebook #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ChequebookBalanceResponse`](../interfaces/ChequebookBalanceResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`getChequebookBalance`](Bee.md#getchequebookbalance) *** ### getDurationExtensionCost() > **getDurationExtensionCost**(`postageBatchId`, `duration`, `options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1736](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1736) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### duration [`Duration`](Duration.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> #### Inherited from [`Bee`](Bee.md).[`getDurationExtensionCost`](Bee.md#getdurationextensioncost) *** ### getExtensionCost() > **getExtensionCost**(`postageBatchId`, `size`, `duration`, `options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1700](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1700) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### size [`Size`](Size.md) ##### duration [`Duration`](Duration.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> #### Inherited from [`Bee`](Bee.md).[`getExtensionCost`](Bee.md#getextensioncost) *** ### getGlobalPostageBatches() > **getGlobalPostageBatches**(`options?`): `Promise`\<[`GlobalPostageBatch`](../interfaces/GlobalPostageBatch.md)[]\> Defined in: [bee-js/src/bee.ts:1863](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1863) Return all globally available postage batches. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`GlobalPostageBatch`](../interfaces/GlobalPostageBatch.md)[]\> #### Inherited from [`Bee`](Bee.md).[`getGlobalPostageBatches`](Bee.md#getglobalpostagebatches) *** ### getGrantees() > **getGrantees**(`reference`, `requestOptions?`): `Promise`\<[`GetGranteesResult`](../interfaces/GetGranteesResult.md)\> Defined in: [bee-js/src/bee.ts:363](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L363) Retrieves the grantees for a given reference. #### Parameters ##### reference The reference. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Optional request options. #### Returns `Promise`\<[`GetGranteesResult`](../interfaces/GetGranteesResult.md)\> A promise that resolves to a `GetGranteesResult` object. #### Inherited from [`Bee`](Bee.md).[`getGrantees`](Bee.md#getgrantees) *** ### getHealth() > **getHealth**(`options?`): `Promise`\<[`Health`](../interfaces/Health.md)\> Defined in: [bee-js/src/bee.ts:1520](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1520) Get health of node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Health`](../interfaces/Health.md)\> #### Inherited from [`Bee`](Bee.md).[`getHealth`](Bee.md#gethealth) *** ### getLastCashoutAction() > **getLastCashoutAction**(`address`, `options?`): `Promise`\<[`LastCashoutActionResponse`](../interfaces/LastCashoutActionResponse.md)\> Defined in: [bee-js/src/bee.ts:1408](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1408) Get last cashout action for the peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`LastCashoutActionResponse`](../interfaces/LastCashoutActionResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`getLastCashoutAction`](Bee.md#getlastcashoutaction) *** ### getLastCheques() > **getLastCheques**(`options?`): `Promise`\<[`LastChequesResponse`](../interfaces/LastChequesResponse.md)\> Defined in: [bee-js/src/bee.ts:1385](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1385) Get last cheques for all peers #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`LastChequesResponse`](../interfaces/LastChequesResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`getLastCheques`](Bee.md#getlastcheques) *** ### getLastChequesForPeer() > **getLastChequesForPeer**(`address`, `options?`): `Promise`\<[`LastChequesForPeerResponse`](../interfaces/LastChequesForPeerResponse.md)\> Defined in: [bee-js/src/bee.ts:1394](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1394) Get last cheques for the peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`LastChequesForPeerResponse`](../interfaces/LastChequesForPeerResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`getLastChequesForPeer`](Bee.md#getlastchequesforpeer) *** ### getNodeAddresses() > **getNodeAddresses**(`options?`): `Promise`\<[`NodeAddresses`](../interfaces/NodeAddresses.md)\> Defined in: [bee-js/src/bee-dev.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee-dev.ts#L7) #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`NodeAddresses`](../interfaces/NodeAddresses.md)\> #### Overrides [`Bee`](Bee.md).[`getNodeAddresses`](Bee.md#getnodeaddresses) *** ### getNodeInfo() > **getNodeInfo**(`options?`): `Promise`\<[`NodeInfo`](../interfaces/NodeInfo.md)\> Defined in: [bee-js/src/bee.ts:1534](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1534) Get mode information of node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`NodeInfo`](../interfaces/NodeInfo.md)\> #### Inherited from [`Bee`](Bee.md).[`getNodeInfo`](Bee.md#getnodeinfo) *** ### getPastDueConsumptionBalances() > **getPastDueConsumptionBalances**(`options?`): `Promise`\<[`BalanceResponse`](../interfaces/BalanceResponse.md)\> Defined in: [bee-js/src/bee.ts:1343](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1343) Get the past due consumption balances with all known peers #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BalanceResponse`](../interfaces/BalanceResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`getPastDueConsumptionBalances`](Bee.md#getpastdueconsumptionbalances) *** ### getPastDueConsumptionPeerBalance() > **getPastDueConsumptionPeerBalance**(`address`, `options?`): `Promise`\<[`PeerBalance`](../interfaces/PeerBalance.md)\> Defined in: [bee-js/src/bee.ts:1352](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1352) Get the past due consumption balance with a specific peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PeerBalance`](../interfaces/PeerBalance.md)\> #### Inherited from [`Bee`](Bee.md).[`getPastDueConsumptionPeerBalance`](Bee.md#getpastdueconsumptionpeerbalance) *** ### getPeerBalance() > **getPeerBalance**(`address`, `options?`): `Promise`\<[`PeerBalance`](../interfaces/PeerBalance.md)\> Defined in: [bee-js/src/bee.ts:1334](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1334) Get the balances with a specific peer including prepaid services #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PeerBalance`](../interfaces/PeerBalance.md)\> #### Inherited from [`Bee`](Bee.md).[`getPeerBalance`](Bee.md#getpeerbalance) *** ### getPeers() > **getPeers**(`options?`): `Promise`\<[`Peer`](../interfaces/Peer.md)[]\> Defined in: [bee-js/src/bee.ts:1298](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1298) Get list of peers for this node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Peer`](../interfaces/Peer.md)[]\> #### Inherited from [`Bee`](Bee.md).[`getPeers`](Bee.md#getpeers) *** ### getPendingTransaction() > **getPendingTransaction**(`transactionHash`, `options?`): `Promise`\<[`TransactionInfo`](../interfaces/TransactionInfo.md)\> Defined in: [bee-js/src/bee.ts:1878](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1878) Return transaction information for specific transaction #### Parameters ##### transactionHash `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`TransactionId`](TransactionId.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionInfo`](../interfaces/TransactionInfo.md)\> #### Inherited from [`Bee`](Bee.md).[`getPendingTransaction`](Bee.md#getpendingtransaction) *** ### getPin() > **getPin**(`reference`, `options?`): `Promise`\<[`Pin`](../interfaces/Pin.md)\> Defined in: [bee-js/src/bee.ts:780](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L780) Get pinning status of chunk with given reference #### Parameters ##### reference Bee data reference in hex string (either 64 or 128 chars long) or ENS domain. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<[`Pin`](../interfaces/Pin.md)\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) #### Inherited from [`Bee`](Bee.md).[`getPin`](Bee.md#getpin) *** ### getPostageBatch() > **getPostageBatch**(`postageBatchId`, `options?`): `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)\> Defined in: [bee-js/src/bee.ts:1805](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1805) Return details for specific postage batch. #### Parameters ##### postageBatchId Batch ID `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `GET /stamps/${id}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get) #### Inherited from [`Bee`](Bee.md).[`getPostageBatch`](Bee.md#getpostagebatch) *** ### getPostageBatchBuckets() > **getPostageBatchBuckets**(`postageBatchId`, `options?`): `Promise`\<[`PostageBatchBuckets`](../interfaces/PostageBatchBuckets.md)\> Defined in: [bee-js/src/bee.ts:1822](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1822) Return detailed information related to buckets for specific postage batch. #### Parameters ##### postageBatchId Batch ID `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PostageBatchBuckets`](../interfaces/PostageBatchBuckets.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `GET /stamps/${id}/buckets`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D~1buckets/get) #### Inherited from [`Bee`](Bee.md).[`getPostageBatchBuckets`](Bee.md#getpostagebatchbuckets) *** ### getPostageBatches() > **getPostageBatches**(`options?`): `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)[]\> Defined in: [bee-js/src/bee.ts:1856](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1856) Return all postage batches that belong to the node. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PostageBatch`](../interfaces/PostageBatch.md)[]\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `GET /stamps`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get) #### Inherited from [`Bee`](Bee.md).[`getPostageBatches`](Bee.md#getpostagebatches) *** ### getReadiness() > **getReadiness**(`options?`): `Promise`\<[`Readiness`](../interfaces/Readiness.md)\> Defined in: [bee-js/src/bee.ts:1527](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1527) Get readiness of node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Readiness`](../interfaces/Readiness.md)\> #### Inherited from [`Bee`](Bee.md).[`getReadiness`](Bee.md#getreadiness) *** ### getRedistributionState() > **getRedistributionState**(`options?`): `Promise`\<[`RedistributionState`](../interfaces/RedistributionState.md)\> Defined in: [bee-js/src/bee.ts:1960](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1960) Get current status of node in redistribution game #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`RedistributionState`](../interfaces/RedistributionState.md)\> #### Inherited from [`Bee`](Bee.md).[`getRedistributionState`](Bee.md#getredistributionstate) *** ### getRequestOptionsForCall() > `protected` **getRequestOptionsForCall**(`options?`): [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Defined in: [bee-js/src/bee.ts:1983](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1983) #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Inherited from [`Bee`](Bee.md).[`getRequestOptionsForCall`](Bee.md#getrequestoptionsforcall) *** ### getReserveState() > **getReserveState**(`options?`): `Promise`\<[`ReserveState`](../interfaces/ReserveState.md)\> Defined in: [bee-js/src/bee.ts:1572](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1572) Get reserve state #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ReserveState`](../interfaces/ReserveState.md)\> #### Inherited from [`Bee`](Bee.md).[`getReserveState`](Bee.md#getreservestate) *** ### getSettlements() > **getSettlements**(`address`, `options?`): `Promise`\<[`Settlements`](../interfaces/Settlements.md)\> Defined in: [bee-js/src/bee.ts:1497](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1497) Get amount of sent and received from settlements with a peer #### Parameters ##### address Swarm address of peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Settlements`](../interfaces/Settlements.md)\> #### Inherited from [`Bee`](Bee.md).[`getSettlements`](Bee.md#getsettlements) *** ### getSizeExtensionCost() > **getSizeExtensionCost**(`postageBatchId`, `size`, `options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1717](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1717) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### size [`Size`](Size.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> #### Inherited from [`Bee`](Bee.md).[`getSizeExtensionCost`](Bee.md#getsizeextensioncost) *** ### getStake() > **getStake**(`options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1928](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1928) Gets the staked amount of BZZ (in PLUR unit) as number string. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> #### Inherited from [`Bee`](Bee.md).[`getStake`](Bee.md#getstake) *** ### getStatus() > **getStatus**(`options?`): `Promise`\<[`DebugStatus`](../interfaces/DebugStatus.md)\> Defined in: [bee-js/src/bee.ts:1513](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1513) Get status of node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`DebugStatus`](../interfaces/DebugStatus.md)\> #### Inherited from [`Bee`](Bee.md).[`getStatus`](Bee.md#getstatus) *** ### getStorageCost() > **getStorageCost**(`size`, `duration`, `options?`): `Promise`\<[`BZZ`](BZZ.md)\> Defined in: [bee-js/src/bee.ts:1666](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1666) #### Parameters ##### size [`Size`](Size.md) ##### duration [`Duration`](Duration.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BZZ`](BZZ.md)\> #### Inherited from [`Bee`](Bee.md).[`getStorageCost`](Bee.md#getstoragecost) *** ### getTopology() > **getTopology**(`options?`): `Promise`\<[`Topology`](../interfaces/Topology.md)\> Defined in: [bee-js/src/bee-dev.ts:26](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee-dev.ts#L26) #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`Topology`](../interfaces/Topology.md)\> #### Overrides [`Bee`](Bee.md).[`getTopology`](Bee.md#gettopology) *** ### getVersions() > **getVersions**(`options?`): `Promise`\<[`BeeVersions`](../interfaces/BeeVersions.md)\> Defined in: [bee-js/src/bee.ts:1565](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1565) Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`) and versions that bee-js supports (properties prefixed with `supported*`). #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`BeeVersions`](../interfaces/BeeVersions.md)\> #### Inherited from [`Bee`](Bee.md).[`getVersions`](Bee.md#getversions) *** ### getWalletBalance() > **getWalletBalance**(`options?`): `Promise`\<[`WalletBalance`](../interfaces/WalletBalance.md)\> Defined in: [bee-js/src/bee.ts:1588](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1588) Get wallet balances for xDai and BZZ of the Bee node #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`WalletBalance`](../interfaces/WalletBalance.md)\> #### Inherited from [`Bee`](Bee.md).[`getWalletBalance`](Bee.md#getwalletbalance) *** ### gsocMine() > **gsocMine**(`targetOverlay`, `identifier`, `proximity`): [`PrivateKey`](PrivateKey.md) Defined in: [bee-js/src/bee.ts:1034](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1034) #### Parameters ##### targetOverlay `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PeerAddress`](PeerAddress.md) ##### identifier `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](Identifier.md) ##### proximity `number` = `12` #### Returns [`PrivateKey`](PrivateKey.md) #### Inherited from [`Bee`](Bee.md).[`gsocMine`](Bee.md#gsocmine) *** ### gsocSend() > **gsocSend**(`postageBatchId`, `signer`, `identifier`, `data`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:1054](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1054) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### signer `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PrivateKey`](PrivateKey.md) ##### identifier `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](Identifier.md) ##### data `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> #### Inherited from [`Bee`](Bee.md).[`gsocSend`](Bee.md#gsocsend) *** ### gsocSubscribe() > **gsocSubscribe**(`address`, `identifier`, `handler`): [`GsocSubscription`](../interfaces/GsocSubscription.md) Defined in: [bee-js/src/bee.ts:1072](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1072) #### Parameters ##### address `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### identifier `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](Identifier.md) ##### handler [`GsocMessageHandler`](../interfaces/GsocMessageHandler.md) #### Returns [`GsocSubscription`](../interfaces/GsocSubscription.md) #### Inherited from [`Bee`](Bee.md).[`gsocSubscribe`](Bee.md#gsocsubscribe) *** ### hashDirectory() > **hashDirectory**(`dir`): `Promise`\<[`Reference`](Reference.md)\> Defined in: [bee-js/src/bee.ts:541](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L541) #### Parameters ##### dir `string` #### Returns `Promise`\<[`Reference`](Reference.md)\> #### Inherited from [`Bee`](Bee.md).[`hashDirectory`](Bee.md#hashdirectory) *** ### isConnected() > **isConnected**(`options?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:1275](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1275) Ping the Bee node to see if there is a live Bee node on the given URL. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`boolean`\> true if successful, false on error #### Inherited from [`Bee`](Bee.md).[`isConnected`](Bee.md#isconnected) *** ### isFeedRetrievable() > **isFeedRetrievable**(`owner`, `topic`, `index?`, `options?`, `requestOptions?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:842](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L842) Functions that validates if feed is retrievable in the network. If no index is passed then it check for "latest" update, which is a weaker guarantee as nobody can be really sure what is the "latest" update. If index is passed then it validates all previous sequence index chunks if they are available as they are required to correctly resolve the feed upto the given index update. #### Parameters ##### owner `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### topic `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### index? [`FeedIndex`](FeedIndex.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`boolean`\> #### Inherited from [`Bee`](Bee.md).[`isFeedRetrievable`](Bee.md#isfeedretrievable) *** ### isReferenceRetrievable() > **isReferenceRetrievable**(`reference`, `options?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:818](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L818) Checks if content specified by reference is retrievable from the network. #### Parameters ##### reference Bee data reference to be checked in hex string (either 64 or 128 chars long) or ENS domain. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`boolean`\> #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See [Bee API reference - `GET /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/get) #### Inherited from [`Bee`](Bee.md).[`isReferenceRetrievable`](Bee.md#isreferenceretrievable) *** ### isSupportedApiVersion() > **isSupportedApiVersion**(`options?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:1555](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1555) Connects to a node and checks if its Main API version matches with the one that bee-js supports. This should be the main way how to check compatibility for your app and Bee node. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`boolean`\> #### Inherited from [`Bee`](Bee.md).[`isSupportedApiVersion`](Bee.md#issupportedapiversion) *** ### isSupportedExactVersion() > **isSupportedExactVersion**(`options?`): `Promise`\<`boolean`\> Defined in: [bee-js/src/bee.ts:1543](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1543) Connects to a node and checks if its version matches with the one that bee-js supports. #### Parameters ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`boolean`\> #### Inherited from [`Bee`](Bee.md).[`isSupportedExactVersion`](Bee.md#issupportedexactversion) *** ### makeFeedReader() > **makeFeedReader**(`topic`, `owner`, `options?`): [`FeedReader`](../interfaces/FeedReader.md) Defined in: [bee-js/src/bee.ts:1159](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1159) Make a new feed reader for downloading feed updates. #### Parameters ##### topic Topic in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### owner Owner's ethereum address in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns [`FeedReader`](../interfaces/FeedReader.md) #### See [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds) #### Inherited from [`Bee`](Bee.md).[`makeFeedReader`](Bee.md#makefeedreader) *** ### makeFeedWriter() > **makeFeedWriter**(`topic`, `signer?`, `options?`): [`FeedWriter`](../interfaces/FeedWriter.md) Defined in: [bee-js/src/bee.ts:1179](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1179) Make a new feed writer for updating feeds #### Parameters ##### topic Topic in hex or bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Topic`](Topic.md) ##### signer? The signer's private key or a Signer instance that can sign data `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PrivateKey`](PrivateKey.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns [`FeedWriter`](../interfaces/FeedWriter.md) #### See [Bee docs - Feeds](https://docs.ethswarm.org/docs/develop/tools-and-features/feeds) #### Inherited from [`Bee`](Bee.md).[`makeFeedWriter`](Bee.md#makefeedwriter) *** ### makeSOCReader() > **makeSOCReader**(`ownerAddress`, `options?`): [`SOCReader`](../interfaces/SOCReader.md) Defined in: [bee-js/src/bee.ts:1212](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1212) Returns an object for reading single owner chunks #### Parameters ##### ownerAddress The ethereum address of the owner `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns [`SOCReader`](../interfaces/SOCReader.md) #### See [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks) #### Inherited from [`Bee`](Bee.md).[`makeSOCReader`](Bee.md#makesocreader) *** ### makeSOCWriter() > **makeSOCWriter**(`signer?`, `options?`): [`SOCWriter`](../interfaces/SOCWriter.md) Defined in: [bee-js/src/bee.ts:1228](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1228) Returns an object for reading and writing single owner chunks #### Parameters ##### signer? The signer's private key or a Signer instance that can sign data `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PrivateKey`](PrivateKey.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns [`SOCWriter`](../interfaces/SOCWriter.md) #### See [Bee docs - Chunk Types](https://docs.ethswarm.org/docs/develop/tools-and-features/chunk-types#single-owner-chunks) #### Inherited from [`Bee`](Bee.md).[`makeSOCWriter`](Bee.md#makesocwriter) *** ### patchGrantees() > **patchGrantees**(`postageBatchId`, `reference`, `history`, `grantees`, `requestOptions?`): `Promise`\<[`GranteesResult`](../interfaces/GranteesResult.md)\> Defined in: [bee-js/src/bee.ts:382](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L382) Updates the grantees of a specific reference and history. #### Parameters ##### postageBatchId The ID of the postage batch. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### reference The reference. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### history The history. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### grantees The grantees. ###### add? `string`[] \| `Uint8Array`\<`ArrayBufferLike`\>[] \| [`PublicKey`](PublicKey.md)[] ###### revoke? `string`[] \| `Uint8Array`\<`ArrayBufferLike`\>[] \| [`PublicKey`](PublicKey.md)[] ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Optional request options. #### Returns `Promise`\<[`GranteesResult`](../interfaces/GranteesResult.md)\> A Promise that resolves to to a `GranteesResult` object. #### Inherited from [`Bee`](Bee.md).[`patchGrantees`](Bee.md#patchgrantees) *** ### pin() > **pin**(`reference`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:739](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L739) Pin local data with given reference #### Parameters ##### reference Data reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if reference is in not correct format #### See [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) #### Inherited from [`Bee`](Bee.md).[`pin`](Bee.md#pin) *** ### pingPeer() > **pingPeer**(`peer`, `options?`): `Promise`\<[`PingResponse`](../interfaces/PingResponse.md)\> Defined in: [bee-js/src/bee.ts:1312](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1312) #### Parameters ##### peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`PingResponse`](../interfaces/PingResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`pingPeer`](Bee.md#pingpeer) *** ### probeData() > **probeData**(`reference`, `options?`): `Promise`\<[`ReferenceInformation`](../interfaces/ReferenceInformation.md)\> Defined in: [bee-js/src/bee.ts:224](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L224) Requests content length for a `/bytes` reference #### Parameters ##### reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`ReferenceInformation`](../interfaces/ReferenceInformation.md)\> #### See [Bee API reference - `HEAD /bytes/`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/head) #### Inherited from [`Bee`](Bee.md).[`probeData`](Bee.md#probedata) *** ### pssReceive() > **pssReceive**(`topic`, `timeoutMsec`): `Promise`\<[`Bytes`](Bytes.md)\> Defined in: [bee-js/src/bee.ts:1005](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1005) Receive message with Postal Service for Swarm Because sending a PSS message is slow and CPU intensive, it is not supposed to be used for general messaging but most likely for setting up an encrypted communication channel by sending an one-off message. This is a helper function to wait for exactly one message to arrive and then cancel the subscription. Additionally a timeout can be provided for the message to arrive or else an error will be thrown. **Warning! If connected Bee node is a light node, then he will never receive any message!** This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them. #### Parameters ##### topic [`Topic`](Topic.md) Topic name ##### timeoutMsec `number` = `0` Timeout in milliseconds #### Returns `Promise`\<[`Bytes`](Bytes.md)\> Message in byte array #### See - [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss) - [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get) #### Inherited from [`Bee`](Bee.md).[`pssReceive`](Bee.md#pssreceive) *** ### pssSend() > **pssSend**(`postageBatchId`, `topic`, `target`, `data`, `recipient?`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:904](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L904) Send data to recipient or target with Postal Service for Swarm. Because sending a PSS message is slow and CPU intensive, it is not supposed to be used for general messaging but most likely for setting up an encrypted communication channel by sending an one-off message. **Warning! If the recipient Bee node is a light node, then he will never receive the message!** This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them. #### Parameters ##### postageBatchId Postage BatchId that will be assigned to sent message `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### topic [`Topic`](Topic.md) Topic name ##### target `string` Target message address prefix. Has a limit on length. Recommend to use `Utils.Pss.makeMaxTarget()` to get the most specific target that Bee node will accept. ##### data Message to be sent `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### recipient? Recipient public key `string` | [`PublicKey`](PublicKey.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if `data`, `batchId`, `target` or `recipient` are in invalid format #### See - [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss) - [Bee API reference - `POST /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1{topic}~1{targets}/post) #### Inherited from [`Bee`](Bee.md).[`pssSend`](Bee.md#psssend) *** ### pssSubscribe() > **pssSubscribe**(`topic`, `handler`): [`PssSubscription`](../interfaces/PssSubscription.md) Defined in: [bee-js/src/bee.ts:938](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L938) Subscribe to messages for given topic with Postal Service for Swarm **Warning! If connected Bee node is a light node, then he will never receive any message!** This is because light nodes does not fully participate in the data exchange in Swarm network and hence the message won't arrive to them. #### Parameters ##### topic [`Topic`](Topic.md) Topic name ##### handler [`PssMessageHandler`](../interfaces/PssMessageHandler.md) Message handler interface #### Returns [`PssSubscription`](../interfaces/PssSubscription.md) Subscription to a given topic #### See - [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss) - [Bee API reference - `GET /pss`](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1{topic}/get) #### Inherited from [`Bee`](Bee.md).[`pssSubscribe`](Bee.md#psssubscribe) *** ### rchash() > **rchash**(`depth`, `anchor1`, `anchor2`, `options?`): `Promise`\<`number`\> Defined in: [bee-js/src/bee.ts:1255](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1255) Get reserve commitment hash duration seconds #### Parameters ##### depth `number` ##### anchor1 `string` ##### anchor2 `string` ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`number`\> #### Inherited from [`Bee`](Bee.md).[`rchash`](Bee.md#rchash) *** ### rebroadcastPendingTransaction() > **rebroadcastPendingTransaction**(`transactionHash`, `options?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1893](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1893) Rebroadcast already created transaction. This is mainly needed when your transaction fall off mempool from other reason is not incorporated into block. #### Parameters ##### transactionHash `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`TransactionId`](TransactionId.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> #### Inherited from [`Bee`](Bee.md).[`rebroadcastPendingTransaction`](Bee.md#rebroadcastpendingtransaction) *** ### removePeer() > **removePeer**(`peer`, `options?`): `Promise`\<[`RemovePeerResponse`](../interfaces/RemovePeerResponse.md)\> Defined in: [bee-js/src/bee.ts:1302](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1302) #### Parameters ##### peer `string` | [`PeerAddress`](PeerAddress.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`RemovePeerResponse`](../interfaces/RemovePeerResponse.md)\> #### Inherited from [`Bee`](Bee.md).[`removePeer`](Bee.md#removepeer) *** ### retrieveTag() > **retrieveTag**(`tagUid`, `options?`): `Promise`\<[`Tag`](../interfaces/Tag.md)\> Defined in: [bee-js/src/bee.ts:684](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L684) Retrieve tag information from Bee node #### Parameters ##### tagUid UID or tag object to be retrieved `number` | [`Tag`](../interfaces/Tag.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<[`Tag`](../interfaces/Tag.md)\> #### Throws TypeError if tagUid is in not correct format #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `GET /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/get) #### Inherited from [`Bee`](Bee.md).[`retrieveTag`](Bee.md#retrievetag) *** ### reuploadPinnedData() > **reuploadPinnedData**(`postageBatchId`, `reference`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:797](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L797) Instructs the Bee node to reupload a locally pinned data into the network. #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### reference Bee data reference to be re-uploaded in hex string (either 64 or 128 chars long) or ENS domain. `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws BeeArgumentError if the reference is not locally pinned #### Throws TypeError if some of the input parameters is not expected type #### Throws BeeArgumentError if there is passed ENS domain with invalid unicode characters #### See [Bee API reference - `PUT /stewardship`](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1{reference}/put) #### Inherited from [`Bee`](Bee.md).[`reuploadPinnedData`](Bee.md#reuploadpinneddata) *** ### streamDirectory() > **streamDirectory**(`postageBatchId`, `dir`, `onUploadProgress?`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:545](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L545) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### dir `string` ##### onUploadProgress? (`progress`) => `void` ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> #### Inherited from [`Bee`](Bee.md).[`streamDirectory`](Bee.md#streamdirectory) *** ### streamFiles() > **streamFiles**(`postageBatchId`, `files`, `onUploadProgress?`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:564](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L564) #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### files `File`[] | `FileList` ##### onUploadProgress? (`progress`) => `void` ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> #### Inherited from [`Bee`](Bee.md).[`streamFiles`](Bee.md#streamfiles) *** ### topUpBatch() > **topUpBatch**(`postageBatchId`, `amount`, `options?`): `Promise`\<[`BatchId`](BatchId.md)\> Defined in: [bee-js/src/bee.ts:1761](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1761) Topup a fresh amount of BZZ to given Postage Batch. For better understanding what each parameter means and what are the optimal values please see [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive). #### Parameters ##### postageBatchId Batch ID `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### amount Amount to be added to the batch `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Request options #### Returns `Promise`\<[`BatchId`](BatchId.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee Debug API reference - `PATCH /stamps/topup/${id}/${amount}`](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1topup~1{batch_id}~1{amount}/patch) #### Inherited from [`Bee`](Bee.md).[`topUpBatch`](Bee.md#topupbatch) *** ### unpin() > **unpin**(`reference`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:754](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L754) Unpin local data with given reference #### Parameters ##### reference Data reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if reference is in not correct format #### See [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) #### Inherited from [`Bee`](Bee.md).[`unpin`](Bee.md#unpin) *** ### updateTag() > **updateTag**(`tagUid`, `reference`, `options?`): `Promise`\<`void`\> Defined in: [bee-js/src/bee.ts:722](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L722) Update tag's total chunks count. This is important if you are uploading individual chunks with a tag. Then upon finishing the final root chunk, you can use this method to update the total chunks count for the tag. #### Parameters ##### tagUid UID or tag object to be retrieved `number` | [`Tag`](../interfaces/Tag.md) ##### reference The root reference that contains all the chunks to be counted `string` | [`Reference`](Reference.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) Options that affects the request behavior #### Returns `Promise`\<`void`\> #### Throws TypeError if tagUid is in not correct format #### Throws BeeResponse error if something went wrong on the Bee node side while deleting the tag. #### See - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API reference - `PATCH /tags/{uid}`](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1{uid}/patch) #### Inherited from [`Bee`](Bee.md).[`updateTag`](Bee.md#updatetag) *** ### uploadChunk() > **uploadChunk**(`stamp`, `data`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:288](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L288) Upload chunk to a Bee node #### Parameters ##### stamp `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) | [`EnvelopeWithBatchId`](../interfaces/EnvelopeWithBatchId.md) ##### data Raw chunk to be uploaded `Uint8Array`\<`ArrayBufferLike`\> | `Chunk` ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) Additional options like tag, encryption, pinning, content-type and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> reference is a content hash of the data #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `POST /chunks`](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) #### Inherited from [`Bee`](Bee.md).[`uploadChunk`](Bee.md#uploadchunk) *** ### uploadCollection() > **uploadCollection**(`postageBatchId`, `collection`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:593](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L593) Upload Collection that you can assembly yourself. The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment. This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406 #### Parameters ##### postageBatchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### collection [`Collection`](../type-aliases/Collection.md) ##### options? [`CollectionUploadOptions`](../interfaces/CollectionUploadOptions.md) Collections and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> #### Inherited from [`Bee`](Bee.md).[`uploadCollection`](Bee.md#uploadcollection) *** ### uploadData() > **uploadData**(`postageBatchId`, `data`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:203](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L203) Upload data to a Bee node #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### data Data to be uploaded `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### options? [`RedundantUploadOptions`](../interfaces/RedundantUploadOptions.md) Additional options like tag, encryption, pinning, content-type and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> reference is a content hash of the data #### See - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `POST /bytes`](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post) #### Inherited from [`Bee`](Bee.md).[`uploadData`](Bee.md#uploaddata) *** ### uploadFile() > **uploadFile**(`postageBatchId`, `data`, `name?`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:420](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L420) Upload single file to a Bee node. #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### data Data or file to be uploaded `string` | `Uint8Array`\<`ArrayBufferLike`\> | `File` | `Readable` ##### name? `string` Optional name of the uploaded file ##### options? [`FileUploadOptions`](../interfaces/FileUploadOptions.md) Additional options like tag, encryption, pinning, content-type and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> reference is a content hash of the file #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee docs - Upload and download](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) #### Inherited from [`Bee`](Bee.md).[`uploadFile`](Bee.md#uploadfile) *** ### uploadFiles() > **uploadFiles**(`postageBatchId`, `fileList`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:524](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L524) Upload collection of files to a Bee node Uses the FileList API from the browser. The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment. This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406 #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### fileList list of files to be uploaded `File`[] | `FileList` ##### options? [`CollectionUploadOptions`](../interfaces/CollectionUploadOptions.md) Additional options like tag, encryption, pinning and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) #### Inherited from [`Bee`](Bee.md).[`uploadFiles`](Bee.md#uploadfiles) *** ### uploadFilesFromDirectory() > **uploadFilesFromDirectory**(`postageBatchId`, `dir`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/bee.ts:625](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L625) Upload collection of files. Available only in Node.js as it uses the `fs` module. The returned `UploadResult.tag` might be undefined if called in CORS-enabled environment. This will be fixed upon next Bee release. https://github.com/ethersphere/bee-js/issues/406 #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### dir `string` the path of the files to be uploaded ##### options? [`CollectionUploadOptions`](../interfaces/CollectionUploadOptions.md) Additional options like tag, encryption, pinning and request options ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> #### See - [Bee docs - Keep your data alive / Postage stamps](https://docs.ethswarm.org/docs/develop/access-the-swarm/introduction/#keep-your-data-alive) - [Bee docs - Upload directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) #### Inherited from [`Bee`](Bee.md).[`uploadFilesFromDirectory`](Bee.md#uploadfilesfromdirectory) *** ### withdrawTokens() > **withdrawTokens**(`amount`, `gasPrice?`, `options?`): `Promise`\<[`TransactionId`](TransactionId.md)\> Defined in: [bee-js/src/bee.ts:1470](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/bee.ts#L1470) Withdraw tokens from the chequebook to the overlay address #### Parameters ##### amount Amount of tokens to withdraw (must be positive integer) `string` | `bigint` | [`BZZ`](BZZ.md) | [`NumberString`](../type-aliases/NumberString.md) ##### gasPrice? Gas Price in WEI for the transaction call `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) ##### options? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`TransactionId`](TransactionId.md)\> string Hash of the transaction #### Inherited from [`Bee`](Bee.md).[`withdrawTokens`](Bee.md#withdrawtokens) --- ## Class: BeeError Defined in: [bee-js/src/utils/error.ts:1](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L1) ## Extends - `Error` ## Extended by - [`BeeArgumentError`](BeeArgumentError.md) - [`BeeResponseError`](BeeResponseError.md) ## Constructors ### Constructor > **new BeeError**(`message`): `BeeError` Defined in: [bee-js/src/utils/error.ts:2](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L2) #### Parameters ##### message `string` #### Returns `BeeError` #### Overrides `Error.constructor` --- ## Class: BeeResponseError Defined in: [bee-js/src/utils/error.ts:13](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L13) ## Extends - [`BeeError`](BeeError.md) ## Constructors ### Constructor > **new BeeResponseError**(`method`, `url`, `message`, `responseBody?`, `status?`, `statusText?`): `BeeResponseError` Defined in: [bee-js/src/utils/error.ts:14](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L14) #### Parameters ##### method `string` ##### url `string` ##### message `string` ##### responseBody? `unknown` ##### status? `number` ##### statusText? `string` #### Returns `BeeResponseError` #### Overrides [`BeeError`](BeeError.md).[`constructor`](BeeError.md#constructor) ## Properties ### method > **method**: `string` Defined in: [bee-js/src/utils/error.ts:15](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L15) *** ### responseBody? > `optional` **responseBody**: `unknown` Defined in: [bee-js/src/utils/error.ts:18](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L18) *** ### status? > `optional` **status**: `number` Defined in: [bee-js/src/utils/error.ts:19](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L19) *** ### statusText? > `optional` **statusText**: `string` Defined in: [bee-js/src/utils/error.ts:20](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L20) *** ### url > **url**: `string` Defined in: [bee-js/src/utils/error.ts:16](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/error.ts#L16) --- ## Class: Bytes Defined in: [bee-js/src/utils/bytes.ts:6](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L6) ## Extended by - [`PrivateKey`](PrivateKey.md) - [`PublicKey`](PublicKey.md) - [`EthAddress`](EthAddress.md) - [`Identifier`](Identifier.md) - [`Reference`](Reference.md) - [`TransactionId`](TransactionId.md) - [`Span`](Span.md) - [`PeerAddress`](PeerAddress.md) - [`BatchId`](BatchId.md) - [`Signature`](Signature.md) - [`Topic`](Topic.md) - [`FeedIndex`](FeedIndex.md) ## Constructors ### Constructor > **new Bytes**(`bytes`, `byteLength?`): `Bytes` Defined in: [bee-js/src/utils/bytes.ts:10](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L10) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | `Bytes` ##### byteLength? `number` | `number`[] #### Returns `Bytes` ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | `Bytes` #### Returns `boolean` *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): `Bytes` Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns `Bytes` *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): `Bytes` Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns `Bytes` *** ### keccak256() > `static` **keccak256**(`bytes`): `Bytes` Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | `Bytes` #### Returns `Bytes` --- ## Class: DAI Defined in: [bee-js/src/utils/tokens.ts:94](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L94) ## Properties ### DIGITS > `readonly` `static` **DIGITS**: `18` = `18` Defined in: [bee-js/src/utils/tokens.ts:95](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L95) ## Methods ### divide() > **divide**(`other`): `DAI` Defined in: [bee-js/src/utils/tokens.ts:153](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L153) Does not mutate the current DAI instance. #### Parameters ##### other `bigint` Divisor #### Returns `DAI` New DAI instance *** ### eq() > **eq**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:173](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L173) #### Parameters ##### other `DAI` #### Returns `boolean` *** ### exchangeToBZZ() > **exchangeToBZZ**(`daiPerBzz`): [`BZZ`](BZZ.md) Defined in: [bee-js/src/utils/tokens.ts:177](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L177) #### Parameters ##### daiPerBzz `DAI` #### Returns [`BZZ`](BZZ.md) *** ### gt() > **gt**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:157](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L157) #### Parameters ##### other `DAI` #### Returns `boolean` *** ### gte() > **gte**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:161](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L161) #### Parameters ##### other `DAI` #### Returns `boolean` *** ### lt() > **lt**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:165](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L165) #### Parameters ##### other `DAI` #### Returns `boolean` *** ### lte() > **lte**(`other`): `boolean` Defined in: [bee-js/src/utils/tokens.ts:169](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L169) #### Parameters ##### other `DAI` #### Returns `boolean` *** ### minus() > **minus**(`other`): `DAI` Defined in: [bee-js/src/utils/tokens.ts:143](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L143) Does not mutate the current DAI instance. #### Parameters ##### other DAI instance, or amount in PLUR `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) | `DAI` #### Returns `DAI` New DAI instance *** ### plus() > **plus**(`other`): `DAI` Defined in: [bee-js/src/utils/tokens.ts:133](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L133) Does not mutate the current DAI instance. #### Parameters ##### other DAI instance, or amount in PLUR `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) | `DAI` #### Returns `DAI` New DAI instance *** ### toDecimalString() > **toDecimalString**(): `string` Defined in: [bee-js/src/utils/tokens.ts:119](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L119) #### Returns `string` *** ### toSignificantDigits() > **toSignificantDigits**(`digits`): `string` Defined in: [bee-js/src/utils/tokens.ts:123](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L123) #### Parameters ##### digits `number` #### Returns `string` *** ### toWeiBigInt() > **toWeiBigInt**(): `bigint` Defined in: [bee-js/src/utils/tokens.ts:115](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L115) #### Returns `bigint` *** ### toWeiString() > **toWeiString**(): `string` Defined in: [bee-js/src/utils/tokens.ts:111](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L111) #### Returns `string` *** ### fromDecimalString() > `static` **fromDecimalString**(`string`): `DAI` Defined in: [bee-js/src/utils/tokens.ts:103](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L103) #### Parameters ##### string `string` #### Returns `DAI` *** ### fromWei() > `static` **fromWei**(`wei`): `DAI` Defined in: [bee-js/src/utils/tokens.ts:107](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/tokens.ts#L107) #### Parameters ##### wei `string` | `bigint` | [`NumberString`](../type-aliases/NumberString.md) #### Returns `DAI` --- ## Class: Duration Defined in: [bee-js/src/utils/duration.ts:1](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L1) ## Methods ### toDays() > **toDays**(): `number` Defined in: [bee-js/src/utils/duration.ts:48](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L48) #### Returns `number` *** ### toEndDate() > **toEndDate**(`startDate?`): `Date` Defined in: [bee-js/src/utils/duration.ts:60](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L60) #### Parameters ##### startDate? `Date` #### Returns `Date` *** ### toHours() > **toHours**(): `number` Defined in: [bee-js/src/utils/duration.ts:44](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L44) #### Returns `number` *** ### toSeconds() > **toSeconds**(): `number` Defined in: [bee-js/src/utils/duration.ts:40](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L40) #### Returns `number` *** ### toWeeks() > **toWeeks**(): `number` Defined in: [bee-js/src/utils/duration.ts:52](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L52) #### Returns `number` *** ### toYears() > **toYears**(): `number` Defined in: [bee-js/src/utils/duration.ts:56](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L56) #### Returns `number` *** ### fromDays() > `static` **fromDays**(`days`): `Duration` Defined in: [bee-js/src/utils/duration.ts:24](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L24) #### Parameters ##### days `number` #### Returns `Duration` *** ### fromEndDate() > `static` **fromEndDate**(`endDate`, `startDate?`): `Duration` Defined in: [bee-js/src/utils/duration.ts:36](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L36) #### Parameters ##### endDate `Date` ##### startDate? `Date` #### Returns `Duration` *** ### fromHours() > `static` **fromHours**(`hours`): `Duration` Defined in: [bee-js/src/utils/duration.ts:20](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L20) #### Parameters ##### hours `number` #### Returns `Duration` *** ### fromMilliseconds() > `static` **fromMilliseconds**(`milliseconds`): `Duration` Defined in: [bee-js/src/utils/duration.ts:12](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L12) #### Parameters ##### milliseconds `number` #### Returns `Duration` *** ### fromSeconds() > `static` **fromSeconds**(`seconds`): `Duration` Defined in: [bee-js/src/utils/duration.ts:16](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L16) #### Parameters ##### seconds `number` #### Returns `Duration` *** ### fromWeeks() > `static` **fromWeeks**(`weeks`): `Duration` Defined in: [bee-js/src/utils/duration.ts:28](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L28) #### Parameters ##### weeks `number` #### Returns `Duration` *** ### fromYears() > `static` **fromYears**(`years`): `Duration` Defined in: [bee-js/src/utils/duration.ts:32](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/duration.ts#L32) #### Parameters ##### years `number` #### Returns `Duration` --- ## Class: EthAddress Defined in: [bee-js/src/utils/typed-bytes.ts:66](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L66) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new EthAddress**(`bytes`): `EthAddress` Defined in: [bee-js/src/utils/typed-bytes.ts:68](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L68) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `EthAddress` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `20` = `20` Defined in: [bee-js/src/utils/typed-bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L67) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toChecksum() > **toChecksum**(): `string` Defined in: [bee-js/src/utils/typed-bytes.ts:72](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L72) #### Returns `string` *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: FeedIndex Defined in: [bee-js/src/utils/typed-bytes.ts:202](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L202) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new FeedIndex**(`bytes`): `FeedIndex` Defined in: [bee-js/src/utils/typed-bytes.ts:206](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L206) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `FeedIndex` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `8` = `8` Defined in: [bee-js/src/utils/typed-bytes.ts:203](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L203) *** ### MINUS\_ONE > `readonly` `static` **MINUS\_ONE**: `FeedIndex` Defined in: [bee-js/src/utils/typed-bytes.ts:204](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L204) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### next() > **next**(): `FeedIndex` Defined in: [bee-js/src/utils/typed-bytes.ts:218](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L218) #### Returns `FeedIndex` *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toBigInt() > **toBigInt**(): `bigint` Defined in: [bee-js/src/utils/typed-bytes.ts:214](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L214) #### Returns `bigint` *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromBigInt() > `static` **fromBigInt**(`number`): `FeedIndex` Defined in: [bee-js/src/utils/typed-bytes.ts:210](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L210) #### Parameters ##### number `bigint` #### Returns `FeedIndex` *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: Identifier Defined in: [bee-js/src/utils/typed-bytes.ts:77](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L77) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new Identifier**(`bytes`): `Identifier` Defined in: [bee-js/src/utils/typed-bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L79) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `Identifier` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `32` = `32` Defined in: [bee-js/src/utils/typed-bytes.ts:78](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L78) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromString() > `static` **fromString**(`value`): `Identifier` Defined in: [bee-js/src/utils/typed-bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L83) #### Parameters ##### value `string` #### Returns `Identifier` *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: MantarayNode Defined in: [bee-js/src/manifest/manifest.ts:121](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L121) ## Constructors ### Constructor > **new MantarayNode**(`options?`): `MantarayNode` Defined in: [bee-js/src/manifest/manifest.ts:130](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L130) #### Parameters ##### options? `MantarayNodeOptions` #### Returns `MantarayNode` ## Properties ### forks > **forks**: `Map`\<`number`, `Fork`\> Defined in: [bee-js/src/manifest/manifest.ts:127](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L127) *** ### metadata > **metadata**: `undefined` \| `null` \| `Record`\<`string`, `string`\> = `null` Defined in: [bee-js/src/manifest/manifest.ts:125](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L125) *** ### obfuscationKey > **obfuscationKey**: `Uint8Array` Defined in: [bee-js/src/manifest/manifest.ts:122](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L122) *** ### parent > **parent**: `null` \| `MantarayNode` = `null` Defined in: [bee-js/src/manifest/manifest.ts:128](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L128) *** ### path > **path**: `Uint8Array` Defined in: [bee-js/src/manifest/manifest.ts:126](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L126) *** ### selfAddress > **selfAddress**: `null` \| `Uint8Array`\<`ArrayBufferLike`\> = `null` Defined in: [bee-js/src/manifest/manifest.ts:123](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L123) *** ### targetAddress > **targetAddress**: `Uint8Array` Defined in: [bee-js/src/manifest/manifest.ts:124](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L124) ## Accessors ### fullPath #### Get Signature > **get** **fullPath**(): `Uint8Array` Defined in: [bee-js/src/manifest/manifest.ts:156](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L156) ##### Returns `Uint8Array` *** ### fullPathString #### Get Signature > **get** **fullPathString**(): `string` Defined in: [bee-js/src/manifest/manifest.ts:160](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L160) ##### Returns `string` ## Methods ### addFork() > **addFork**(`path`, `reference`, `metadata?`): `void` Defined in: [bee-js/src/manifest/manifest.ts:307](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L307) Adds a fork to the node. #### Parameters ##### path `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) | [`Reference`](Reference.md) ##### metadata? `null` | `Record`\<`string`, `string`\> #### Returns `void` *** ### calculateSelfAddress() > **calculateSelfAddress**(): `Promise`\<[`Reference`](Reference.md)\> Defined in: [bee-js/src/manifest/manifest.ts:387](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L387) Calculates the self address of the node. #### Returns `Promise`\<[`Reference`](Reference.md)\> *** ### collect() > **collect**(`nodes`): `MantarayNode`[] Defined in: [bee-js/src/manifest/manifest.ts:463](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L463) Returns an array of all nodes in the tree which have a target address set. Must be called after `loadRecursively`. #### Parameters ##### nodes `MantarayNode`[] = `[]` #### Returns `MantarayNode`[] *** ### collectAndMap() > **collectAndMap**(): `Record`\<`string`, `string`\> Defined in: [bee-js/src/manifest/manifest.ts:479](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L479) Returns a path:reference map of all nodes in the tree which have a target address set. Must be called after `loadRecursively`. #### Returns `Record`\<`string`, `string`\> *** ### determineType() > **determineType**(): `number` Defined in: [bee-js/src/manifest/manifest.ts:490](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L490) #### Returns `number` *** ### find() > **find**(`path`): `null` \| `MantarayNode` Defined in: [bee-js/src/manifest/manifest.ts:433](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L433) Finds a node in the tree by its path. #### Parameters ##### path `string` | `Uint8Array`\<`ArrayBufferLike`\> #### Returns `null` \| `MantarayNode` *** ### findClosest() > **findClosest**(`path`, `current`): \[`MantarayNode`, `Uint8Array`\<`ArrayBufferLike`\>\] Defined in: [bee-js/src/manifest/manifest.ts:442](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L442) Finds the closest node in the tree to the given path. #### Parameters ##### path `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### current `Uint8Array` = `...` #### Returns \[`MantarayNode`, `Uint8Array`\<`ArrayBufferLike`\>\] *** ### getDocsMetadata() > **getDocsMetadata**(): `object` Defined in: [bee-js/src/manifest/manifest.ts:180](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L180) Returns the `swarm-index-document` and `swarm-error-document` metadata values. #### Returns `object` ##### errorDocument > **errorDocument**: `null` \| `string` ##### indexDocument > **indexDocument**: `null` \| `string` *** ### getRootMetadata() > **getRootMetadata**(): `Optional`\<`Record`\<`string`, `string`\>\> Defined in: [bee-js/src/manifest/manifest.ts:167](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L167) Returns the metadata at the `/` path to access idiomatic properties. #### Returns `Optional`\<`Record`\<`string`, `string`\>\> *** ### loadRecursively() > **loadRecursively**(`bee`, `options?`, `requestOptions?`): `Promise`\<`void`\> Defined in: [bee-js/src/manifest/manifest.ts:416](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L416) Loads the node and its children recursively. #### Parameters ##### bee [`Bee`](Bee.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`void`\> *** ### marshal() > **marshal**(): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> Defined in: [bee-js/src/manifest/manifest.ts:219](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L219) Gets the binary representation of the node. #### Returns `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> *** ### removeFork() > **removeFork**(`path`): `void` Defined in: [bee-js/src/manifest/manifest.ts:362](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L362) Removes a fork from the node. #### Parameters ##### path `string` | `Uint8Array`\<`ArrayBufferLike`\> #### Returns `void` *** ### resolveFeed() > **resolveFeed**(`bee`, `requestOptions?`): `Promise`\<`Optional`\<`FeedPayloadResult`\>\> Defined in: [bee-js/src/manifest/manifest.ts:199](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L199) Attempts to resolve the manifest as a feed, returning the latest update. #### Parameters ##### bee [`Bee`](Bee.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`Optional`\<`FeedPayloadResult`\>\> *** ### saveRecursively() > **saveRecursively**(`bee`, `postageBatchId`, `options?`, `requestOptions?`): `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> Defined in: [bee-js/src/manifest/manifest.ts:398](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L398) Saves the node and its children recursively. #### Parameters ##### bee [`Bee`](Bee.md) ##### postageBatchId `string` | [`BatchId`](BatchId.md) ##### options? [`UploadOptions`](../interfaces/UploadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<[`UploadResult`](../interfaces/UploadResult.md)\> *** ### unmarshal() > `static` **unmarshal**(`bee`, `reference`, `options?`, `requestOptions?`): `Promise`\<`MantarayNode`\> Defined in: [bee-js/src/manifest/manifest.ts:263](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L263) Downloads and unmarshals a MantarayNode from the given reference. Do not forget calling `loadRecursively` on the returned node to load the entire tree. #### Parameters ##### bee [`Bee`](Bee.md) ##### reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](Reference.md) ##### options? [`DownloadOptions`](../interfaces/DownloadOptions.md) ##### requestOptions? [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) #### Returns `Promise`\<`MantarayNode`\> *** ### unmarshalFromData() > `static` **unmarshalFromData**(`data`, `selfAddress`): `MantarayNode` Defined in: [bee-js/src/manifest/manifest.ts:280](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/manifest/manifest.ts#L280) Unmarshals a MantarayNode from the given data. Do not forget calling `loadRecursively` on the returned node to load the entire tree. #### Parameters ##### data `Uint8Array` ##### selfAddress `Uint8Array` #### Returns `MantarayNode` --- ## Class: PeerAddress Defined in: [bee-js/src/utils/typed-bytes.ts:140](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L140) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new PeerAddress**(`bytes`): `PeerAddress` Defined in: [bee-js/src/utils/typed-bytes.ts:142](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L142) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `PeerAddress` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `32` = `32` Defined in: [bee-js/src/utils/typed-bytes.ts:141](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L141) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: PrivateKey Defined in: [bee-js/src/utils/typed-bytes.ts:9](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L9) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new PrivateKey**(`bytes`): `PrivateKey` Defined in: [bee-js/src/utils/typed-bytes.ts:11](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L11) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `PrivateKey` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `32` = `32` Defined in: [bee-js/src/utils/typed-bytes.ts:10](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L10) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### publicKey() > **publicKey**(): [`PublicKey`](PublicKey.md) Defined in: [bee-js/src/utils/typed-bytes.ts:15](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L15) #### Returns [`PublicKey`](PublicKey.md) *** ### sign() > **sign**(`data`): [`Signature`](Signature.md) Defined in: [bee-js/src/utils/typed-bytes.ts:21](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L21) #### Parameters ##### data `string` | `Uint8Array`\<`ArrayBufferLike`\> #### Returns [`Signature`](Signature.md) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: PublicKey Defined in: [bee-js/src/utils/typed-bytes.ts:34](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L34) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new PublicKey**(`bytes`): `PublicKey` Defined in: [bee-js/src/utils/typed-bytes.ts:36](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L36) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `PublicKey` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `64` = `64` Defined in: [bee-js/src/utils/typed-bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L35) ## Methods ### address() > **address**(): [`EthAddress`](EthAddress.md) Defined in: [bee-js/src/utils/typed-bytes.ts:47](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L47) #### Returns [`EthAddress`](EthAddress.md) *** ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toCompressedHex() > **toCompressedHex**(): `string` Defined in: [bee-js/src/utils/typed-bytes.ts:61](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L61) #### Returns `string` *** ### toCompressedUint8Array() > **toCompressedUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/typed-bytes.ts:54](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L54) #### Returns `Uint8Array` *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: Reference Defined in: [bee-js/src/utils/typed-bytes.ts:88](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L88) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new Reference**(`bytes`): `Reference` Defined in: [bee-js/src/utils/typed-bytes.ts:90](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L90) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `Reference` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `32` = `32` Defined in: [bee-js/src/utils/typed-bytes.ts:89](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L89) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toCid() > **toCid**(`type`): `string` Defined in: [bee-js/src/utils/typed-bytes.ts:99](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L99) #### Parameters ##### type `"manifest"` | `"feed"` #### Returns `string` *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### isValid() > `static` **isValid**(`value`): `boolean` Defined in: [bee-js/src/utils/typed-bytes.ts:103](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L103) #### Parameters ##### value `string` #### Returns `boolean` *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: Signature Defined in: [bee-js/src/utils/typed-bytes.ts:154](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L154) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new Signature**(`bytes`): `Signature` Defined in: [bee-js/src/utils/typed-bytes.ts:156](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L156) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `Signature` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `65` = `65` Defined in: [bee-js/src/utils/typed-bytes.ts:155](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L155) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### isValid() > **isValid**(`digest`, `expectedAddress`): `boolean` Defined in: [bee-js/src/utils/typed-bytes.ts:181](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L181) #### Parameters ##### digest `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### expectedAddress `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`EthAddress`](EthAddress.md) #### Returns `boolean` *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### recoverPublicKey() > **recoverPublicKey**(`digest`): [`PublicKey`](PublicKey.md) Defined in: [bee-js/src/utils/typed-bytes.ts:164](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L164) #### Parameters ##### digest `string` | `Uint8Array`\<`ArrayBufferLike`\> #### Returns [`PublicKey`](PublicKey.md) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`): `Signature` Defined in: [bee-js/src/utils/typed-bytes.ts:160](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L160) #### Parameters ##### bytes `Uint8Array` ##### start `number` #### Returns `Signature` #### Overrides [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: Size Defined in: [bee-js/src/utils/size.ts:10](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/size.ts#L10) Represents a size in bytes. Uses 1000 instead of 1024 for converting between units. This is to stay consistent with the Swarm papers on theoretical and effective storage capacity. ## Methods ### toBytes() > **toBytes**(): `number` Defined in: [bee-js/src/utils/size.ts:37](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/size.ts#L37) #### Returns `number` *** ### toFormattedString() > **toFormattedString**(): `string` Defined in: [bee-js/src/utils/size.ts:45](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/size.ts#L45) #### Returns `string` *** ### toGigabytes() > **toGigabytes**(): `number` Defined in: [bee-js/src/utils/size.ts:41](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/size.ts#L41) #### Returns `number` *** ### fromBytes() > `static` **fromBytes**(`bytes`): `Size` Defined in: [bee-js/src/utils/size.ts:21](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/size.ts#L21) #### Parameters ##### bytes `number` #### Returns `Size` *** ### fromGigabytes() > `static` **fromGigabytes**(`gigabytes`): `Size` Defined in: [bee-js/src/utils/size.ts:33](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/size.ts#L33) #### Parameters ##### gigabytes `number` #### Returns `Size` *** ### fromKilobytes() > `static` **fromKilobytes**(`kilobytes`): `Size` Defined in: [bee-js/src/utils/size.ts:25](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/size.ts#L25) #### Parameters ##### kilobytes `number` #### Returns `Size` *** ### fromMegabytes() > `static` **fromMegabytes**(`megabytes`): `Size` Defined in: [bee-js/src/utils/size.ts:29](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/size.ts#L29) #### Parameters ##### megabytes `number` #### Returns `Size` --- ## Class: Span Defined in: [bee-js/src/utils/typed-bytes.ts:121](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L121) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new Span**(`bytes`): `Span` Defined in: [bee-js/src/utils/typed-bytes.ts:123](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L123) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `Span` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `8` = `8` Defined in: [bee-js/src/utils/typed-bytes.ts:122](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L122) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toBigInt() > **toBigInt**(): `bigint` Defined in: [bee-js/src/utils/typed-bytes.ts:131](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L131) #### Returns `bigint` *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromBigInt() > `static` **fromBigInt**(`number`): `Span` Defined in: [bee-js/src/utils/typed-bytes.ts:127](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L127) #### Parameters ##### number `bigint` #### Returns `Span` *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`): `Span` Defined in: [bee-js/src/utils/typed-bytes.ts:135](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L135) #### Parameters ##### bytes `Uint8Array` ##### start `number` #### Returns `Span` #### Overrides [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: Stamper Defined in: [bee-js/src/stamper/stamper.ts:5](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L5) ## Properties ### batchId > **batchId**: [`BatchId`](BatchId.md) Defined in: [bee-js/src/stamper/stamper.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L7) *** ### buckets > **buckets**: `Uint32Array` Defined in: [bee-js/src/stamper/stamper.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L8) *** ### depth > **depth**: `number` Defined in: [bee-js/src/stamper/stamper.ts:9](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L9) *** ### maxSlot > **maxSlot**: `number` Defined in: [bee-js/src/stamper/stamper.ts:10](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L10) *** ### signer > **signer**: [`PrivateKey`](PrivateKey.md) Defined in: [bee-js/src/stamper/stamper.ts:6](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L6) ## Methods ### getState() > **getState**(): `Uint32Array` Defined in: [bee-js/src/stamper/stamper.ts:60](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L60) #### Returns `Uint32Array` *** ### stamp() > **stamp**(`chunk`): [`EnvelopeWithBatchId`](../interfaces/EnvelopeWithBatchId.md) Defined in: [bee-js/src/stamper/stamper.ts:38](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L38) #### Parameters ##### chunk `Chunk` #### Returns [`EnvelopeWithBatchId`](../interfaces/EnvelopeWithBatchId.md) *** ### fromBlank() > `static` **fromBlank**(`signer`, `batchId`, `depth`): `Stamper` Defined in: [bee-js/src/stamper/stamper.ts:25](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L25) #### Parameters ##### signer `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PrivateKey`](PrivateKey.md) ##### batchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### depth `number` #### Returns `Stamper` *** ### fromState() > `static` **fromState**(`signer`, `batchId`, `buckets`, `depth`): `Stamper` Defined in: [bee-js/src/stamper/stamper.ts:29](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/stamper/stamper.ts#L29) #### Parameters ##### signer `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PrivateKey`](PrivateKey.md) ##### batchId `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](BatchId.md) ##### buckets `Uint32Array` ##### depth `number` #### Returns `Stamper` --- ## Class: Topic Defined in: [bee-js/src/utils/typed-bytes.ts:189](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L189) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new Topic**(`bytes`): `Topic` Defined in: [bee-js/src/utils/typed-bytes.ts:191](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L191) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `Topic` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `32` = `32` Defined in: [bee-js/src/utils/typed-bytes.ts:190](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L190) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromString() > `static` **fromString**(`value`): `Topic` Defined in: [bee-js/src/utils/typed-bytes.ts:195](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L195) #### Parameters ##### value `string` #### Returns `Topic` *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Class: TransactionId Defined in: [bee-js/src/utils/typed-bytes.ts:114](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L114) ## Extends - [`Bytes`](Bytes.md) ## Constructors ### Constructor > **new TransactionId**(`bytes`): `TransactionId` Defined in: [bee-js/src/utils/typed-bytes.ts:116](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L116) #### Parameters ##### bytes `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `TransactionId` #### Overrides [`Bytes`](Bytes.md).[`constructor`](Bytes.md#constructor) ## Properties ### bytes > `protected` `readonly` **bytes**: `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L7) #### Inherited from [`Bytes`](Bytes.md).[`bytes`](Bytes.md#bytes) *** ### length > `readonly` **length**: `number` Defined in: [bee-js/src/utils/bytes.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L8) #### Inherited from [`Bytes`](Bytes.md).[`length`](Bytes.md#length) *** ### LENGTH > `readonly` `static` **LENGTH**: `32` = `32` Defined in: [bee-js/src/utils/typed-bytes.ts:115](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/typed-bytes.ts#L115) ## Methods ### equals() > **equals**(`other`): `boolean` Defined in: [bee-js/src/utils/bytes.ts:83](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L83) #### Parameters ##### other `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns `boolean` #### Inherited from [`Bytes`](Bytes.md).[`equals`](Bytes.md#equals) *** ### offset() > **offset**(`index`): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L51) #### Parameters ##### index `number` #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`offset`](Bytes.md#offset) *** ### toBase32() > **toBase32**(): `string` Defined in: [bee-js/src/utils/bytes.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L67) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase32`](Bytes.md#tobase32) *** ### toBase64() > **toBase64**(): `string` Defined in: [bee-js/src/utils/bytes.ts:63](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L63) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toBase64`](Bytes.md#tobase64) *** ### toHex() > **toHex**(): `string` Defined in: [bee-js/src/utils/bytes.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L59) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toHex`](Bytes.md#tohex) *** ### toJSON() > **toJSON**(): `unknown` Defined in: [bee-js/src/utils/bytes.ts:79](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L79) #### Returns `unknown` #### Inherited from [`Bytes`](Bytes.md).[`toJSON`](Bytes.md#tojson) *** ### toString() > **toString**(): `string` Defined in: [bee-js/src/utils/bytes.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L71) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toString`](Bytes.md#tostring) *** ### toUint8Array() > **toUint8Array**(): `Uint8Array` Defined in: [bee-js/src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L55) #### Returns `Uint8Array` #### Inherited from [`Bytes`](Bytes.md).[`toUint8Array`](Bytes.md#touint8array) *** ### toUtf8() > **toUtf8**(): `string` Defined in: [bee-js/src/utils/bytes.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L75) #### Returns `string` #### Inherited from [`Bytes`](Bytes.md).[`toUtf8`](Bytes.md#toutf8) *** ### fromSlice() > `static` **fromSlice**(`bytes`, `start`, `length?`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L43) #### Parameters ##### bytes `Uint8Array` ##### start `number` ##### length? `number` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromSlice`](Bytes.md#fromslice) *** ### fromUtf8() > `static` **fromUtf8**(`utf8`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L39) #### Parameters ##### utf8 `string` #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`fromUtf8`](Bytes.md#fromutf8) *** ### keccak256() > `static` **keccak256**(`bytes`): [`Bytes`](Bytes.md) Defined in: [bee-js/src/utils/bytes.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/bytes.ts#L35) #### Parameters ##### bytes `string` | `ArrayBuffer` | `Uint8Array`\<`ArrayBufferLike`\> | [`Bytes`](Bytes.md) #### Returns [`Bytes`](Bytes.md) #### Inherited from [`Bytes`](Bytes.md).[`keccak256`](Bytes.md#keccak256) --- ## Enumeration: BeeModes Defined in: [bee-js/src/types/debug.ts:129](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L129) ## Enumeration Members ### DEV > **DEV**: `"dev"` Defined in: [bee-js/src/types/debug.ts:133](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L133) *** ### FULL > **FULL**: `"full"` Defined in: [bee-js/src/types/debug.ts:130](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L130) *** ### LIGHT > **LIGHT**: `"light"` Defined in: [bee-js/src/types/debug.ts:131](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L131) *** ### ULTRA\_LIGHT > **ULTRA\_LIGHT**: `"ultra-light"` Defined in: [bee-js/src/types/debug.ts:132](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L132) --- ## Enumeration: RedundancyLevel Defined in: [bee-js/src/types/index.ts:150](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L150) Add redundancy to the data being uploaded so that downloaders can download it with better UX. 0 value is default and does not add any redundancy to the file. ## Enumeration Members ### INSANE > **INSANE**: `3` Defined in: [bee-js/src/types/index.ts:154](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L154) *** ### MEDIUM > **MEDIUM**: `1` Defined in: [bee-js/src/types/index.ts:152](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L152) *** ### OFF > **OFF**: `0` Defined in: [bee-js/src/types/index.ts:151](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L151) *** ### PARANOID > **PARANOID**: `4` Defined in: [bee-js/src/types/index.ts:155](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L155) *** ### STRONG > **STRONG**: `2` Defined in: [bee-js/src/types/index.ts:153](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L153) --- ## Enumeration: RedundancyStrategy Defined in: [bee-js/src/types/index.ts:172](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L172) Specify the retrieve strategy on redundant data. The possible values are NONE, DATA, PROX and RACE. Strategy NONE means no prefetching takes place. Strategy DATA means only data chunks are prefetched. Strategy PROX means only chunks that are close to the node are prefetched. Strategy RACE means all chunks are prefetched: n data chunks and k parity chunks. The first n chunks to arrive are used to reconstruct the file. Multiple strategies can be used in a fallback cascade if the swarm redundancy fallback mode is set to true. The default strategy is NONE, DATA, falling back to PROX, falling back to RACE ## Enumeration Members ### DATA > **DATA**: `1` Defined in: [bee-js/src/types/index.ts:174](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L174) *** ### NONE > **NONE**: `0` Defined in: [bee-js/src/types/index.ts:173](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L173) *** ### PROX > **PROX**: `2` Defined in: [bee-js/src/types/index.ts:175](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L175) *** ### RACE > **RACE**: `3` Defined in: [bee-js/src/types/index.ts:176](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L176) --- ## Function: toBeeMode() > **toBeeMode**(`value`): [`BeeModes`](../enumerations/BeeModes.md) Defined in: [bee-js/src/types/debug.ts:136](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L136) ## Parameters ### value `string` ## Returns [`BeeModes`](../enumerations/BeeModes.md) --- ## Interface: AllSettlements Defined in: [bee-js/src/types/debug.ts:11](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L11) ## Properties ### settlements > **settlements**: [`Settlements`](Settlements.md)[] Defined in: [bee-js/src/types/debug.ts:14](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L14) *** ### totalReceived > **totalReceived**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:12](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L12) *** ### totalSent > **totalSent**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:13](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L13) --- ## Interface: AllTagsOptions Defined in: [bee-js/src/types/index.ts:262](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L262) ## Properties ### limit? > `optional` **limit**: `number` Defined in: [bee-js/src/types/index.ts:263](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L263) *** ### offset? > `optional` **offset**: `number` Defined in: [bee-js/src/types/index.ts:264](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L264) --- ## Interface: BalanceResponse Defined in: [bee-js/src/types/debug.ts:90](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L90) ## Properties ### balances > **balances**: [`PeerBalance`](PeerBalance.md)[] Defined in: [bee-js/src/types/debug.ts:91](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L91) --- ## Interface: BatchBucket Defined in: [bee-js/src/types/index.ts:510](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L510) ## Properties ### bucketID > **bucketID**: `number` Defined in: [bee-js/src/types/index.ts:511](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L511) *** ### collisions > **collisions**: `number` Defined in: [bee-js/src/types/index.ts:512](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L512) --- ## Interface: BeeOptions Defined in: [bee-js/src/types/index.ts:53](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L53) ## Extends - [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md) ## Properties ### baseURL? > `optional` **baseURL**: `string` Defined in: [bee-js/src/types/index.ts:44](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L44) #### Inherited from [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md).[`baseURL`](../type-aliases/BeeRequestOptions.md#baseurl) *** ### endlesslyRetry? > `optional` **endlesslyRetry**: `boolean` Defined in: [bee-js/src/types/index.ts:50](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L50) #### Inherited from [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md).[`endlesslyRetry`](../type-aliases/BeeRequestOptions.md#endlesslyretry) *** ### headers? > `optional` **headers**: `Record`\<`string`, `string`\> Defined in: [bee-js/src/types/index.ts:46](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L46) #### Inherited from [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md).[`headers`](../type-aliases/BeeRequestOptions.md#headers) *** ### httpAgent? > `optional` **httpAgent**: `unknown` Defined in: [bee-js/src/types/index.ts:48](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L48) #### Inherited from [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md).[`httpAgent`](../type-aliases/BeeRequestOptions.md#httpagent) *** ### httpsAgent? > `optional` **httpsAgent**: `unknown` Defined in: [bee-js/src/types/index.ts:49](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L49) #### Inherited from [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md).[`httpsAgent`](../type-aliases/BeeRequestOptions.md#httpsagent) *** ### network? > `optional` **network**: `"gnosis"` \| `"sepolia"` Defined in: [bee-js/src/types/index.ts:61](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L61) Default gnosis when unspecified. *** ### onRequest()? > `optional` **onRequest**: (`request`) => `void` Defined in: [bee-js/src/types/index.ts:47](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L47) #### Parameters ##### request [`BeeRequest`](BeeRequest.md) #### Returns `void` #### Inherited from [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md).[`onRequest`](../type-aliases/BeeRequestOptions.md#onrequest) *** ### signer? > `optional` **signer**: `string` \| `Uint8Array`\<`ArrayBufferLike`\> \| [`PrivateKey`](../classes/PrivateKey.md) Defined in: [bee-js/src/types/index.ts:57](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L57) Signer object or private key of the Signer in form of either hex string or Uint8Array that will be default signer for the instance. *** ### timeout? > `optional` **timeout**: `number` Defined in: [bee-js/src/types/index.ts:45](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L45) #### Inherited from [`BeeRequestOptions`](../type-aliases/BeeRequestOptions.md).[`timeout`](../type-aliases/BeeRequestOptions.md#timeout) --- ## Interface: BeeRequest Defined in: [bee-js/src/types/index.ts:352](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L352) ## Properties ### headers? > `optional` **headers**: `Record`\<`string`, `string`\> Defined in: [bee-js/src/types/index.ts:355](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L355) *** ### method > **method**: `string` Defined in: [bee-js/src/types/index.ts:354](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L354) *** ### params? > `optional` **params**: `Record`\<`string`, `unknown`\> Defined in: [bee-js/src/types/index.ts:356](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L356) *** ### url > **url**: `string` Defined in: [bee-js/src/types/index.ts:353](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L353) --- ## Interface: BeeResponse Defined in: [bee-js/src/types/index.ts:359](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L359) ## Properties ### headers > **headers**: `Record`\<`string`, `string`\> Defined in: [bee-js/src/types/index.ts:360](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L360) *** ### request > **request**: [`BeeRequest`](BeeRequest.md) Defined in: [bee-js/src/types/index.ts:363](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L363) *** ### status > **status**: `number` Defined in: [bee-js/src/types/index.ts:361](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L361) *** ### statusText? > `optional` **statusText**: `string` Defined in: [bee-js/src/types/index.ts:362](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L362) --- ## Interface: BeeVersions Defined in: [bee-js/src/types/debug.ts:122](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L122) ## Properties ### beeApiVersion > **beeApiVersion**: `string` Defined in: [bee-js/src/types/debug.ts:126](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L126) *** ### beeVersion > **beeVersion**: `string` Defined in: [bee-js/src/types/debug.ts:125](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L125) *** ### supportedBeeApiVersion > **supportedBeeApiVersion**: `string` Defined in: [bee-js/src/types/debug.ts:124](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L124) *** ### supportedBeeVersion > **supportedBeeVersion**: `string` Defined in: [bee-js/src/types/debug.ts:123](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L123) --- ## Interface: Bin Defined in: [bee-js/src/types/debug.ts:198](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L198) ## Properties ### connected > **connected**: `number` Defined in: [bee-js/src/types/debug.ts:200](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L200) *** ### connectedPeers > **connectedPeers**: [`Peer`](Peer.md)[] Defined in: [bee-js/src/types/debug.ts:202](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L202) *** ### disconnectedPeers > **disconnectedPeers**: [`Peer`](Peer.md)[] Defined in: [bee-js/src/types/debug.ts:201](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L201) *** ### population > **population**: `number` Defined in: [bee-js/src/types/debug.ts:199](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L199) --- ## Interface: CashoutResult Defined in: [bee-js/src/types/debug.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L51) ## Properties ### bounced > **bounced**: `boolean` Defined in: [bee-js/src/types/debug.ts:54](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L54) *** ### lastPayout > **lastPayout**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:53](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L53) *** ### recipient > **recipient**: `string` Defined in: [bee-js/src/types/debug.ts:52](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L52) --- ## Interface: ChainState Defined in: [bee-js/src/types/debug.ts:260](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L260) ## Properties ### block > **block**: `number` Defined in: [bee-js/src/types/debug.ts:262](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L262) *** ### chainTip > **chainTip**: `number` Defined in: [bee-js/src/types/debug.ts:261](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L261) *** ### currentPrice > **currentPrice**: `number` Defined in: [bee-js/src/types/debug.ts:264](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L264) *** ### totalAmount > **totalAmount**: [`NumberString`](../type-aliases/NumberString.md) Defined in: [bee-js/src/types/debug.ts:263](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L263) --- ## Interface: Cheque Defined in: [bee-js/src/types/debug.ts:69](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L69) ## Properties ### beneficiary > **beneficiary**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/debug.ts:70](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L70) *** ### chequebook > **chequebook**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/debug.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L71) *** ### payout > **payout**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:72](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L72) --- ## Interface: ChequebookAddressResponse Defined in: [bee-js/src/types/debug.ts:30](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L30) ## Properties ### chequebookAddress > **chequebookAddress**: `string` Defined in: [bee-js/src/types/debug.ts:31](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L31) --- ## Interface: ChequebookBalanceResponse Defined in: [bee-js/src/types/debug.ts:34](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L34) ## Properties ### availableBalance > **availableBalance**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:36](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L36) *** ### totalBalance > **totalBalance**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:35](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L35) --- ## Interface: CollectionEntry Defined in: [bee-js/src/types/index.ts:312](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L312) Object represents a file and some of its metadata in [[Directory]] object. ## Properties ### file? > `optional` **file**: `File` Defined in: [bee-js/src/types/index.ts:315](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L315) *** ### fsPath? > `optional` **fsPath**: `string` Defined in: [bee-js/src/types/index.ts:316](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L316) *** ### path > **path**: `string` Defined in: [bee-js/src/types/index.ts:313](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L313) *** ### size > **size**: `number` Defined in: [bee-js/src/types/index.ts:314](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L314) --- ## Interface: CollectionUploadOptions Defined in: [bee-js/src/types/index.ts:218](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L218) ## Extends - [`UploadOptions`](UploadOptions.md) ## Properties ### act? > `optional` **act**: `boolean` Defined in: [bee-js/src/types/index.ts:101](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L101) If set to true, an ACT will be created for the uploaded data. #### Inherited from [`UploadOptions`](UploadOptions.md).[`act`](UploadOptions.md#act) *** ### actHistoryAddress? > `optional` **actHistoryAddress**: `string` \| `Uint8Array`\<`ArrayBufferLike`\> \| [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:103](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L103) #### Inherited from [`UploadOptions`](UploadOptions.md).[`actHistoryAddress`](UploadOptions.md#acthistoryaddress) *** ### deferred? > `optional` **deferred**: `boolean` Defined in: [bee-js/src/types/index.ts:143](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L143) Determines if the uploaded data should be sent to the network immediately (eq. deferred=false) or in a deferred fashion (eq. deferred=true). With deferred style client uploads all the data to Bee node first and only then Bee node starts push the data to network itself. The progress of this upload can be tracked with tags. With non-deferred style client uploads the data to Bee which immediately starts pushing the data to network. The request is only finished once all the data was pushed through the Bee node to the network. In future there will be move to the non-deferred style and even the support for deferred upload will be removed from Bee itself. #### Default ```ts true ``` #### Inherited from [`UploadOptions`](UploadOptions.md).[`deferred`](UploadOptions.md#deferred) *** ### encrypt? > `optional` **encrypt**: `boolean` Defined in: [bee-js/src/types/index.ts:122](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L122) Will encrypt the uploaded data and return longer hash which also includes the decryption key. #### See - [Bee docs - Store with Encryption](https://docs.ethswarm.org/docs/develop/access-the-swarm/store-with-encryption) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) - Reference #### Inherited from [`UploadOptions`](UploadOptions.md).[`encrypt`](UploadOptions.md#encrypt) *** ### errorDocument? > `optional` **errorDocument**: `string` Defined in: [bee-js/src/types/index.ts:233](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L233) Configure custom error document to be returned when a specified path can not be found in collection. #### See - [Bee docs - Upload a directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) *** ### indexDocument? > `optional` **indexDocument**: `string` Defined in: [bee-js/src/types/index.ts:225](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L225) Default file to be returned when the root hash of collection is accessed. #### See - [Bee docs - Upload a directory](https://docs.ethswarm.org/docs/develop/access-the-swarm/upload-and-download#upload-a-directory) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) *** ### pin? > `optional` **pin**: `boolean` Defined in: [bee-js/src/types/index.ts:113](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L113) Will pin the data locally in the Bee node as well. Locally pinned data is possible to reupload to network if it disappear. #### See - [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) #### Inherited from [`UploadOptions`](UploadOptions.md).[`pin`](UploadOptions.md#pin) *** ### redundancyLevel? > `optional` **redundancyLevel**: [`RedundancyLevel`](../enumerations/RedundancyLevel.md) Defined in: [bee-js/src/types/index.ts:235](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L235) *** ### tag? > `optional` **tag**: `number` Defined in: [bee-js/src/types/index.ts:131](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L131) Tags keep track of syncing the data with network. This option allows attach existing Tag UUID to the uploaded data. #### See - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) #### Link Tag #### Inherited from [`UploadOptions`](UploadOptions.md).[`tag`](UploadOptions.md#tag) --- ## Interface: Data Defined in: [bee-js/src/types/index.ts:292](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L292) Helper interface that adds utility functions to work more conveniently with bytes in normal user scenarios. Concretely: text(), hex(), json() ## Extends - `Uint8Array` ## Indexable \[`index`: `number`\]: `number` ## Methods ### hex() > **hex**(): `string` Defined in: [bee-js/src/types/index.ts:301](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L301) Converts the binary data into hex-string. #### Returns `string` *** ### json() > **json**(): `Record`\<`string`, `unknown`\> Defined in: [bee-js/src/types/index.ts:306](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L306) Converts the binary data into string which is then parsed into JSON. #### Returns `Record`\<`string`, `unknown`\> *** ### text() > **text**(): `string` Defined in: [bee-js/src/types/index.ts:296](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L296) Converts the binary data using UTF-8 decoding into string. #### Returns `string` --- ## Interface: DebugStatus Defined in: [bee-js/src/types/debug.ts:94](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L94) ## Properties ### batchCommitment > **batchCommitment**: `number` Defined in: [bee-js/src/types/debug.ts:104](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L104) *** ### beeMode > **beeMode**: [`BeeModes`](../enumerations/BeeModes.md) Defined in: [bee-js/src/types/debug.ts:97](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L97) *** ### committedDepth > **committedDepth**: `number` Defined in: [bee-js/src/types/debug.ts:107](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L107) *** ### connectedPeers > **connectedPeers**: `number` Defined in: [bee-js/src/types/debug.ts:102](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L102) *** ### isReachable > **isReachable**: `boolean` Defined in: [bee-js/src/types/debug.ts:105](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L105) *** ### lastSyncedBlock > **lastSyncedBlock**: `number` Defined in: [bee-js/src/types/debug.ts:106](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L106) *** ### neighborhoodSize > **neighborhoodSize**: `number` Defined in: [bee-js/src/types/debug.ts:103](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L103) *** ### overlay > **overlay**: `string` Defined in: [bee-js/src/types/debug.ts:95](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L95) *** ### proximity > **proximity**: `number` Defined in: [bee-js/src/types/debug.ts:96](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L96) *** ### pullsyncRate > **pullsyncRate**: `number` Defined in: [bee-js/src/types/debug.ts:100](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L100) *** ### reserveSize > **reserveSize**: `number` Defined in: [bee-js/src/types/debug.ts:98](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L98) *** ### reserveSizeWithinRadius > **reserveSizeWithinRadius**: `number` Defined in: [bee-js/src/types/debug.ts:99](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L99) *** ### storageRadius > **storageRadius**: `number` Defined in: [bee-js/src/types/debug.ts:101](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L101) --- ## Interface: DownloadOptions Defined in: [bee-js/src/types/index.ts:179](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L179) ## Properties ### actHistoryAddress? > `optional` **actHistoryAddress**: `string` \| `Uint8Array`\<`ArrayBufferLike`\> \| [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:195](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L195) *** ### actPublisher? > `optional` **actPublisher**: `string` \| `Uint8Array`\<`ArrayBufferLike`\> \| [`PublicKey`](../classes/PublicKey.md) Defined in: [bee-js/src/types/index.ts:193](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L193) *** ### actTimestamp? > `optional` **actTimestamp**: `string` \| `number` Defined in: [bee-js/src/types/index.ts:197](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L197) *** ### fallback? > `optional` **fallback**: `boolean` Defined in: [bee-js/src/types/index.ts:187](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L187) Specify if the retrieve strategies (chunk prefetching on redundant data) are used in a fallback cascade. The default is true. *** ### redundancyStrategy? > `optional` **redundancyStrategy**: [`RedundancyStrategy`](../enumerations/RedundancyStrategy.md) Defined in: [bee-js/src/types/index.ts:183](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L183) Specify the retrieve strategy on redundant data. *** ### timeoutMs? > `optional` **timeoutMs**: `number` Defined in: [bee-js/src/types/index.ts:191](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L191) Specify the timeout for chunk retrieval. The default is 30 seconds. --- ## Interface: Envelope Defined in: [bee-js/src/types/index.ts:572](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L572) ## Extended by - [`EnvelopeWithBatchId`](EnvelopeWithBatchId.md) ## Properties ### index > **index**: `Uint8Array` Defined in: [bee-js/src/types/index.ts:574](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L574) *** ### issuer > **issuer**: `Uint8Array` Defined in: [bee-js/src/types/index.ts:573](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L573) *** ### signature > **signature**: `Uint8Array` Defined in: [bee-js/src/types/index.ts:576](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L576) *** ### timestamp > **timestamp**: `Uint8Array` Defined in: [bee-js/src/types/index.ts:575](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L575) --- ## Interface: EnvelopeWithBatchId Defined in: [bee-js/src/types/index.ts:579](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L579) ## Extends - [`Envelope`](Envelope.md) ## Properties ### batchId > **batchId**: [`BatchId`](../classes/BatchId.md) Defined in: [bee-js/src/types/index.ts:580](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L580) *** ### index > **index**: `Uint8Array` Defined in: [bee-js/src/types/index.ts:574](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L574) #### Inherited from [`Envelope`](Envelope.md).[`index`](Envelope.md#index) *** ### issuer > **issuer**: `Uint8Array` Defined in: [bee-js/src/types/index.ts:573](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L573) #### Inherited from [`Envelope`](Envelope.md).[`issuer`](Envelope.md#issuer) *** ### signature > **signature**: `Uint8Array` Defined in: [bee-js/src/types/index.ts:576](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L576) #### Inherited from [`Envelope`](Envelope.md).[`signature`](Envelope.md#signature) *** ### timestamp > **timestamp**: `Uint8Array` Defined in: [bee-js/src/types/index.ts:575](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L575) #### Inherited from [`Envelope`](Envelope.md).[`timestamp`](Envelope.md#timestamp) --- ## Interface: FeedReader Defined in: [bee-js/src/types/index.ts:369](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L369) FeedReader is an interface for downloading feed updates ## Extended by - [`FeedWriter`](FeedWriter.md) ## Properties ### owner > `readonly` **owner**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/index.ts:370](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L370) *** ### topic > `readonly` **topic**: [`Topic`](../classes/Topic.md) Defined in: [bee-js/src/types/index.ts:371](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L371) ## Methods ### ~~download()~~ > **download**(`options?`): `Promise`\<`FeedPayloadResult`\> Defined in: [bee-js/src/types/index.ts:376](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L376) #### Parameters ##### options? `FeedUpdateOptions` #### Returns `Promise`\<`FeedPayloadResult`\> #### Deprecated Use `downloadReference` or `downloadPayload` instead to disambiguate how the data should be interpreted. *** ### downloadPayload() > **downloadPayload**(`options?`): `Promise`\<`FeedPayloadResult`\> Defined in: [bee-js/src/types/index.ts:386](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L386) Downloads the feed update (latest if no index is specified) and returns it as a payload. #### Parameters ##### options? `FeedUpdateOptions` #### Returns `Promise`\<`FeedPayloadResult`\> *** ### downloadReference() > **downloadReference**(`options?`): `Promise`\<`FeedReferenceResult`\> Defined in: [bee-js/src/types/index.ts:381](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L381) Downloads the feed update (latest if no index is specified) and returns it as a reference. #### Parameters ##### options? `FeedUpdateOptions` #### Returns `Promise`\<`FeedReferenceResult`\> --- ## Interface: FeedWriter Defined in: [bee-js/src/types/index.ts:392](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L392) FeedWriter is an interface for updating feeds ## Extends - [`FeedReader`](FeedReader.md) ## Properties ### owner > `readonly` **owner**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/index.ts:370](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L370) #### Inherited from [`FeedReader`](FeedReader.md).[`owner`](FeedReader.md#owner) *** ### topic > `readonly` **topic**: [`Topic`](../classes/Topic.md) Defined in: [bee-js/src/types/index.ts:371](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L371) #### Inherited from [`FeedReader`](FeedReader.md).[`topic`](FeedReader.md#topic) ## Methods ### ~~download()~~ > **download**(`options?`): `Promise`\<`FeedPayloadResult`\> Defined in: [bee-js/src/types/index.ts:376](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L376) #### Parameters ##### options? `FeedUpdateOptions` #### Returns `Promise`\<`FeedPayloadResult`\> #### Deprecated Use `downloadReference` or `downloadPayload` instead to disambiguate how the data should be interpreted. #### Inherited from [`FeedReader`](FeedReader.md).[`download`](FeedReader.md#download) *** ### downloadPayload() > **downloadPayload**(`options?`): `Promise`\<`FeedPayloadResult`\> Defined in: [bee-js/src/types/index.ts:386](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L386) Downloads the feed update (latest if no index is specified) and returns it as a payload. #### Parameters ##### options? `FeedUpdateOptions` #### Returns `Promise`\<`FeedPayloadResult`\> #### Inherited from [`FeedReader`](FeedReader.md).[`downloadPayload`](FeedReader.md#downloadpayload) *** ### downloadReference() > **downloadReference**(`options?`): `Promise`\<`FeedReferenceResult`\> Defined in: [bee-js/src/types/index.ts:381](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L381) Downloads the feed update (latest if no index is specified) and returns it as a reference. #### Parameters ##### options? `FeedUpdateOptions` #### Returns `Promise`\<`FeedReferenceResult`\> #### Inherited from [`FeedReader`](FeedReader.md).[`downloadReference`](FeedReader.md#downloadreference) *** ### ~~upload()~~ > **upload**(`postageBatchId`, `reference`, `options?`): `Promise`\<[`UploadResult`](UploadResult.md)\> Defined in: [bee-js/src/types/index.ts:404](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L404) Upload a new feed update #### Parameters ##### postageBatchId Postage BatchId to be used to upload the data with `string` | [`BatchId`](../classes/BatchId.md) ##### reference The reference to be stored in the new update `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](../classes/Reference.md) ##### options? `FeedUploadOptions` Additional options like `at` #### Returns `Promise`\<[`UploadResult`](UploadResult.md)\> UpdateResult that points at Single Owner Chunk that contains the new update and pointer to the updated chunk reference. #### Deprecated Use `uploadReference` or `uploadPayload` instead to disambiguate how the data should be interpreted. *** ### uploadPayload() > **uploadPayload**(`postageBatchId`, `payload`, `options?`): `Promise`\<[`UploadResult`](UploadResult.md)\> Defined in: [bee-js/src/types/index.ts:416](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L416) #### Parameters ##### postageBatchId `string` | [`BatchId`](../classes/BatchId.md) ##### payload `string` | `Uint8Array`\<`ArrayBufferLike`\> ##### options? `FeedUploadOptions` #### Returns `Promise`\<[`UploadResult`](UploadResult.md)\> *** ### uploadReference() > **uploadReference**(`postageBatchId`, `reference`, `options?`): `Promise`\<[`UploadResult`](UploadResult.md)\> Defined in: [bee-js/src/types/index.ts:410](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L410) #### Parameters ##### postageBatchId `string` | [`BatchId`](../classes/BatchId.md) ##### reference `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Reference`](../classes/Reference.md) ##### options? `FeedUploadOptions` #### Returns `Promise`\<[`UploadResult`](UploadResult.md)\> --- ## Interface: FileData\ Defined in: [bee-js/src/types/index.ts:273](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L273) ## Extends - [`FileHeaders`](FileHeaders.md) ## Type Parameters ### T `T` ## Properties ### contentType? > `optional` **contentType**: `string` Defined in: [bee-js/src/types/index.ts:270](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L270) #### Inherited from [`FileHeaders`](FileHeaders.md).[`contentType`](FileHeaders.md#contenttype) *** ### data > **data**: `T` Defined in: [bee-js/src/types/index.ts:274](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L274) *** ### name? > `optional` **name**: `string` Defined in: [bee-js/src/types/index.ts:268](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L268) #### Inherited from [`FileHeaders`](FileHeaders.md).[`name`](FileHeaders.md#name) *** ### tagUid? > `optional` **tagUid**: `number` Defined in: [bee-js/src/types/index.ts:269](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L269) #### Inherited from [`FileHeaders`](FileHeaders.md).[`tagUid`](FileHeaders.md#taguid) --- ## Interface: FileHeaders Defined in: [bee-js/src/types/index.ts:267](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L267) ## Extended by - [`FileData`](FileData.md) ## Properties ### contentType? > `optional` **contentType**: `string` Defined in: [bee-js/src/types/index.ts:270](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L270) *** ### name? > `optional` **name**: `string` Defined in: [bee-js/src/types/index.ts:268](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L268) *** ### tagUid? > `optional` **tagUid**: `number` Defined in: [bee-js/src/types/index.ts:269](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L269) --- ## Interface: FileUploadOptions Defined in: [bee-js/src/types/index.ts:200](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L200) ## Extends - [`UploadOptions`](UploadOptions.md) ## Properties ### act? > `optional` **act**: `boolean` Defined in: [bee-js/src/types/index.ts:101](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L101) If set to true, an ACT will be created for the uploaded data. #### Inherited from [`UploadOptions`](UploadOptions.md).[`act`](UploadOptions.md#act) *** ### actHistoryAddress? > `optional` **actHistoryAddress**: `string` \| `Uint8Array`\<`ArrayBufferLike`\> \| [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:103](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L103) #### Inherited from [`UploadOptions`](UploadOptions.md).[`actHistoryAddress`](UploadOptions.md#acthistoryaddress) *** ### contentType? > `optional` **contentType**: `string` Defined in: [bee-js/src/types/index.ts:213](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L213) Specifies given Content-Type so when loaded in browser the file is correctly represented. #### See [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) *** ### deferred? > `optional` **deferred**: `boolean` Defined in: [bee-js/src/types/index.ts:143](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L143) Determines if the uploaded data should be sent to the network immediately (eq. deferred=false) or in a deferred fashion (eq. deferred=true). With deferred style client uploads all the data to Bee node first and only then Bee node starts push the data to network itself. The progress of this upload can be tracked with tags. With non-deferred style client uploads the data to Bee which immediately starts pushing the data to network. The request is only finished once all the data was pushed through the Bee node to the network. In future there will be move to the non-deferred style and even the support for deferred upload will be removed from Bee itself. #### Default ```ts true ``` #### Inherited from [`UploadOptions`](UploadOptions.md).[`deferred`](UploadOptions.md#deferred) *** ### encrypt? > `optional` **encrypt**: `boolean` Defined in: [bee-js/src/types/index.ts:122](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L122) Will encrypt the uploaded data and return longer hash which also includes the decryption key. #### See - [Bee docs - Store with Encryption](https://docs.ethswarm.org/docs/develop/access-the-swarm/store-with-encryption) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) - Reference #### Inherited from [`UploadOptions`](UploadOptions.md).[`encrypt`](UploadOptions.md#encrypt) *** ### pin? > `optional` **pin**: `boolean` Defined in: [bee-js/src/types/index.ts:113](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L113) Will pin the data locally in the Bee node as well. Locally pinned data is possible to reupload to network if it disappear. #### See - [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) #### Inherited from [`UploadOptions`](UploadOptions.md).[`pin`](UploadOptions.md#pin) *** ### redundancyLevel? > `optional` **redundancyLevel**: [`RedundancyLevel`](../enumerations/RedundancyLevel.md) Defined in: [bee-js/src/types/index.ts:215](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L215) *** ### size? > `optional` **size**: `number` Defined in: [bee-js/src/types/index.ts:206](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L206) Specifies Content-Length for the given data. It is required when uploading with Readable. #### See [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) *** ### tag? > `optional` **tag**: `number` Defined in: [bee-js/src/types/index.ts:131](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L131) Tags keep track of syncing the data with network. This option allows attach existing Tag UUID to the uploaded data. #### See - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) #### Link Tag #### Inherited from [`UploadOptions`](UploadOptions.md).[`tag`](UploadOptions.md#tag) --- ## Interface: GetGranteesResult Defined in: [bee-js/src/types/index.ts:71](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L71) ## Properties ### grantees > **grantees**: [`PublicKey`](../classes/PublicKey.md)[] Defined in: [bee-js/src/types/index.ts:74](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L74) *** ### status > **status**: `number` Defined in: [bee-js/src/types/index.ts:72](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L72) *** ### statusText > **statusText**: `string` Defined in: [bee-js/src/types/index.ts:73](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L73) --- ## Interface: GlobalPostageBatch Defined in: [bee-js/src/types/index.ts:455](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L455) ## Properties ### batchID > **batchID**: [`BatchId`](../classes/BatchId.md) Defined in: [bee-js/src/types/index.ts:456](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L456) *** ### batchTTL > **batchTTL**: `number` Defined in: [bee-js/src/types/index.ts:463](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L463) *** ### bucketDepth > **bucketDepth**: `number` Defined in: [bee-js/src/types/index.ts:461](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L461) *** ### depth > **depth**: `number` Defined in: [bee-js/src/types/index.ts:460](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L460) *** ### immutable > **immutable**: `boolean` Defined in: [bee-js/src/types/index.ts:462](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L462) *** ### owner > **owner**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/index.ts:459](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L459) *** ### start > **start**: `number` Defined in: [bee-js/src/types/index.ts:458](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L458) *** ### value > **value**: [`NumberString`](../type-aliases/NumberString.md) Defined in: [bee-js/src/types/index.ts:457](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L457) --- ## Interface: GranteesResult Defined in: [bee-js/src/types/index.ts:64](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L64) ## Properties ### historyref > **historyref**: [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:68](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L68) *** ### ref > **ref**: [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:67](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L67) *** ### status > **status**: `number` Defined in: [bee-js/src/types/index.ts:65](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L65) *** ### statusText > **statusText**: `string` Defined in: [bee-js/src/types/index.ts:66](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L66) --- ## Interface: GsocMessageHandler Defined in: [bee-js/src/types/index.ts:339](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L339) ## Properties ### onError() > **onError**: (`error`, `subscription`) => `void` Defined in: [bee-js/src/types/index.ts:341](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L341) #### Parameters ##### error [`BeeError`](../classes/BeeError.md) ##### subscription [`GsocSubscription`](GsocSubscription.md) #### Returns `void` *** ### onMessage() > **onMessage**: (`message`, `subscription`) => `void` Defined in: [bee-js/src/types/index.ts:340](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L340) #### Parameters ##### message [`Bytes`](../classes/Bytes.md) ##### subscription [`GsocSubscription`](GsocSubscription.md) #### Returns `void` --- ## Interface: GsocSubscription Defined in: [bee-js/src/types/index.ts:334](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L334) ## Properties ### address > `readonly` **address**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/index.ts:335](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L335) *** ### cancel() > **cancel**: () => `void` Defined in: [bee-js/src/types/index.ts:336](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L336) #### Returns `void` --- ## Interface: Health Defined in: [bee-js/src/types/debug.ts:110](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L110) ## Properties ### apiVersion > **apiVersion**: `string` Defined in: [bee-js/src/types/debug.ts:113](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L113) *** ### status > **status**: `"ok"` Defined in: [bee-js/src/types/debug.ts:111](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L111) *** ### version > **version**: `string` Defined in: [bee-js/src/types/debug.ts:112](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L112) --- ## Interface: LastCashoutActionResponse Defined in: [bee-js/src/types/debug.ts:57](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L57) ## Properties ### lastCashedCheque > **lastCashedCheque**: `null` \| [`Cheque`](Cheque.md) Defined in: [bee-js/src/types/debug.ts:61](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L61) *** ### peer > **peer**: `string` Defined in: [bee-js/src/types/debug.ts:58](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L58) *** ### result > **result**: `null` \| [`CashoutResult`](CashoutResult.md) Defined in: [bee-js/src/types/debug.ts:62](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L62) *** ### transactionHash > **transactionHash**: `null` \| `string` Defined in: [bee-js/src/types/debug.ts:60](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L60) *** ### uncashedAmount > **uncashedAmount**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:59](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L59) --- ## Interface: LastChequesForPeerResponse Defined in: [bee-js/src/types/debug.ts:75](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L75) ## Properties ### lastreceived > **lastreceived**: `null` \| [`Cheque`](Cheque.md) Defined in: [bee-js/src/types/debug.ts:77](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L77) *** ### lastsent > **lastsent**: `null` \| [`Cheque`](Cheque.md) Defined in: [bee-js/src/types/debug.ts:78](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L78) *** ### peer > **peer**: `string` Defined in: [bee-js/src/types/debug.ts:76](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L76) --- ## Interface: LastChequesResponse Defined in: [bee-js/src/types/debug.ts:81](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L81) ## Properties ### lastcheques > **lastcheques**: [`LastChequesForPeerResponse`](LastChequesForPeerResponse.md)[] Defined in: [bee-js/src/types/debug.ts:82](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L82) --- ## Interface: NodeAddresses Defined in: [bee-js/src/types/debug.ts:17](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L17) ## Properties ### ethereum > **ethereum**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/debug.ts:20](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L20) *** ### overlay > **overlay**: [`PeerAddress`](../classes/PeerAddress.md) Defined in: [bee-js/src/types/debug.ts:18](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L18) *** ### pssPublicKey > **pssPublicKey**: [`PublicKey`](../classes/PublicKey.md) Defined in: [bee-js/src/types/debug.ts:22](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L22) *** ### publicKey > **publicKey**: [`PublicKey`](../classes/PublicKey.md) Defined in: [bee-js/src/types/debug.ts:21](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L21) *** ### underlay > **underlay**: `string`[] Defined in: [bee-js/src/types/debug.ts:19](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L19) --- ## Interface: NodeInfo Defined in: [bee-js/src/types/debug.ts:172](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L172) Information about Bee node and its configuration ## Properties ### beeMode > **beeMode**: [`BeeModes`](../enumerations/BeeModes.md) Defined in: [bee-js/src/types/debug.ts:176](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L176) Indicates in what mode Bee is running. *** ### chequebookEnabled > **chequebookEnabled**: `boolean` Defined in: [bee-js/src/types/debug.ts:183](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L183) Indicates whether the Bee node has its own deployed chequebook. #### See [Bee docs - Chequebook](https://docs.ethswarm.org/docs/references/glossary/#cheques--chequebook) *** ### swapEnabled > **swapEnabled**: `boolean` Defined in: [bee-js/src/types/debug.ts:190](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L190) Indicates whether SWAP is enabled for the Bee node. #### See [Bee docs - SWAP](https://docs.ethswarm.org/docs/references/glossary/#swap) --- ## Interface: Peer Defined in: [bee-js/src/types/debug.ts:25](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L25) ## Properties ### address > **address**: `string` Defined in: [bee-js/src/types/debug.ts:26](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L26) *** ### fullNode? > `optional` **fullNode**: `boolean` Defined in: [bee-js/src/types/debug.ts:27](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L27) --- ## Interface: PeerBalance Defined in: [bee-js/src/types/debug.ts:85](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L85) ## Properties ### balance > **balance**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:87](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L87) *** ### peer > **peer**: `string` Defined in: [bee-js/src/types/debug.ts:86](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L86) --- ## Interface: Pin Defined in: [bee-js/src/types/index.ts:277](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L277) ## Properties ### reference > **reference**: [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:278](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L278) --- ## Interface: PingResponse Defined in: [bee-js/src/types/debug.ts:250](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L250) ## Properties ### rtt > **rtt**: `string` Defined in: [bee-js/src/types/debug.ts:251](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L251) --- ## Interface: PostageBatch Defined in: [bee-js/src/types/index.ts:466](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L466) ## Properties ### amount > **amount**: [`NumberString`](../type-aliases/NumberString.md) Defined in: [bee-js/src/types/index.ts:480](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L480) *** ### batchID > **batchID**: [`BatchId`](../classes/BatchId.md) Defined in: [bee-js/src/types/index.ts:467](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L467) *** ### blockNumber > **blockNumber**: `number` Defined in: [bee-js/src/types/index.ts:482](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L482) *** ### bucketDepth > **bucketDepth**: `number` Defined in: [bee-js/src/types/index.ts:481](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L481) *** ### depth > **depth**: `number` Defined in: [bee-js/src/types/index.ts:479](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L479) *** ### duration > **duration**: [`Duration`](../classes/Duration.md) Defined in: [bee-js/src/types/index.ts:487](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L487) Estimated time until the batch expires *** ### immutableFlag > **immutableFlag**: `boolean` Defined in: [bee-js/src/types/index.ts:483](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L483) *** ### label > **label**: `string` Defined in: [bee-js/src/types/index.ts:478](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L478) *** ### remainingSize > **remainingSize**: [`Size`](../classes/Size.md) Defined in: [bee-js/src/types/index.ts:503](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L503) Estimated remaining size *** ### size > **size**: [`Size`](../classes/Size.md) Defined in: [bee-js/src/types/index.ts:499](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L499) Effective size *** ### theoreticalSize > **theoreticalSize**: [`Size`](../classes/Size.md) Defined in: [bee-js/src/types/index.ts:507](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L507) Theoretical size in bytes *** ### usable > **usable**: `boolean` Defined in: [bee-js/src/types/index.ts:477](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L477) *** ### usage > **usage**: `number` Defined in: [bee-js/src/types/index.ts:491](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L491) A floating point number from 0 to 1, where 0 is no usage, 1 is full usage. *** ### usageText > **usageText**: `string` Defined in: [bee-js/src/types/index.ts:495](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L495) Human readable usage text, like "50%" or "100%", no fractions *** ### utilization > **utilization**: `number` Defined in: [bee-js/src/types/index.ts:476](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L476) Represents how much of the batch is used up. Max utilization = `2 ** (depth - bucketDepth)` Since the smallest depth is 17, and one batch has 65,536 buckets, and one chunk is 4,096 bytes, the 512MB theoretical max size for the smallest stamp comes from `2 * 65536 * 4096 = 512MB` --- ## Interface: PostageBatchBuckets Defined in: [bee-js/src/types/index.ts:515](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L515) ## Properties ### bucketDepth > **bucketDepth**: `number` Defined in: [bee-js/src/types/index.ts:517](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L517) *** ### buckets > **buckets**: [`BatchBucket`](BatchBucket.md)[] Defined in: [bee-js/src/types/index.ts:519](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L519) *** ### bucketUpperBound > **bucketUpperBound**: `number` Defined in: [bee-js/src/types/index.ts:518](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L518) *** ### depth > **depth**: `number` Defined in: [bee-js/src/types/index.ts:516](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L516) --- ## Interface: PostageBatchOptions Defined in: [bee-js/src/types/index.ts:537](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L537) Options for creation of postage batch ## Properties ### gasPrice? > `optional` **gasPrice**: `string` \| `bigint` \| [`NumberString`](../type-aliases/NumberString.md) Defined in: [bee-js/src/types/index.ts:546](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L546) Sets gas price in Wei for the transaction that creates the postage batch *** ### immutableFlag? > `optional` **immutableFlag**: `boolean` Defined in: [bee-js/src/types/index.ts:551](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L551) Controls whether data can be overwritten that was uploaded with this postage batch. *** ### label? > `optional` **label**: `string` Defined in: [bee-js/src/types/index.ts:541](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L541) Sets label for the postage batch *** ### waitForUsable? > `optional` **waitForUsable**: `boolean` Defined in: [bee-js/src/types/index.ts:563](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L563) The returned Promise will await until the purchased Postage Batch is usable. In other word, it has to have enough block confirmations that Bee pronounce it usable. When turned on, this significantly prolongs the creation of postage batch! If you plan to use the stamp right away for some action with Bee (like uploading using this stamp) it is highly recommended to use this option, otherwise you might get errors "stamp not usable" from Bee. #### Default ```ts true ``` *** ### waitForUsableTimeout? > `optional` **waitForUsableTimeout**: `number` Defined in: [bee-js/src/types/index.ts:569](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L569) When waiting for the postage stamp to become usable, this specify the timeout for the waiting. Default: 120s --- ## Interface: PssMessageHandler Defined in: [bee-js/src/types/index.ts:329](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L329) ## Properties ### onError() > **onError**: (`error`, `subscription`) => `void` Defined in: [bee-js/src/types/index.ts:331](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L331) #### Parameters ##### error [`BeeError`](../classes/BeeError.md) ##### subscription [`PssSubscription`](PssSubscription.md) #### Returns `void` *** ### onMessage() > **onMessage**: (`message`, `subscription`) => `void` Defined in: [bee-js/src/types/index.ts:330](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L330) #### Parameters ##### message [`Bytes`](../classes/Bytes.md) ##### subscription [`PssSubscription`](PssSubscription.md) #### Returns `void` --- ## Interface: PssSubscription Defined in: [bee-js/src/types/index.ts:324](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L324) ## Properties ### cancel() > **cancel**: () => `void` Defined in: [bee-js/src/types/index.ts:326](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L326) #### Returns `void` *** ### topic > `readonly` **topic**: [`Topic`](../classes/Topic.md) Defined in: [bee-js/src/types/index.ts:325](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L325) --- ## Interface: Readiness Defined in: [bee-js/src/types/debug.ts:116](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L116) ## Properties ### apiVersion > **apiVersion**: `string` Defined in: [bee-js/src/types/debug.ts:119](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L119) *** ### status > **status**: `string` Defined in: [bee-js/src/types/debug.ts:117](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L117) *** ### version > **version**: `string` Defined in: [bee-js/src/types/debug.ts:118](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L118) --- ## Interface: RedistributionState Defined in: [bee-js/src/types/debug.ts:151](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L151) ## Properties ### block > **block**: `number` Defined in: [bee-js/src/types/debug.ts:163](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L163) *** ### fees > **fees**: [`DAI`](../classes/DAI.md) Defined in: [bee-js/src/types/debug.ts:165](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L165) *** ### hasSufficientFunds > **hasSufficientFunds**: `boolean` Defined in: [bee-js/src/types/debug.ts:153](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L153) *** ### isFrozen > **isFrozen**: `boolean` Defined in: [bee-js/src/types/debug.ts:154](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L154) *** ### isFullySynced > **isFullySynced**: `boolean` Defined in: [bee-js/src/types/debug.ts:155](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L155) *** ### isHealthy > **isHealthy**: `boolean` Defined in: [bee-js/src/types/debug.ts:166](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L166) *** ### lastFrozenRound > **lastFrozenRound**: `number` Defined in: [bee-js/src/types/debug.ts:160](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L160) *** ### lastPlayedRound > **lastPlayedRound**: `number` Defined in: [bee-js/src/types/debug.ts:159](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L159) *** ### lastSampleDurationSeconds > **lastSampleDurationSeconds**: `number` Defined in: [bee-js/src/types/debug.ts:162](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L162) *** ### lastSelectedRound > **lastSelectedRound**: `number` Defined in: [bee-js/src/types/debug.ts:161](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L161) *** ### lastWonRound > **lastWonRound**: `number` Defined in: [bee-js/src/types/debug.ts:158](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L158) *** ### minimumGasFunds > **minimumGasFunds**: [`DAI`](../classes/DAI.md) Defined in: [bee-js/src/types/debug.ts:152](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L152) *** ### phase > **phase**: `string` Defined in: [bee-js/src/types/debug.ts:156](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L156) *** ### reward > **reward**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:164](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L164) *** ### round > **round**: `number` Defined in: [bee-js/src/types/debug.ts:157](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L157) --- ## Interface: RedundantUploadOptions Defined in: [bee-js/src/types/index.ts:158](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L158) ## Extends - [`UploadOptions`](UploadOptions.md) ## Properties ### act? > `optional` **act**: `boolean` Defined in: [bee-js/src/types/index.ts:101](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L101) If set to true, an ACT will be created for the uploaded data. #### Inherited from [`UploadOptions`](UploadOptions.md).[`act`](UploadOptions.md#act) *** ### actHistoryAddress? > `optional` **actHistoryAddress**: `string` \| `Uint8Array`\<`ArrayBufferLike`\> \| [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:103](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L103) #### Inherited from [`UploadOptions`](UploadOptions.md).[`actHistoryAddress`](UploadOptions.md#acthistoryaddress) *** ### deferred? > `optional` **deferred**: `boolean` Defined in: [bee-js/src/types/index.ts:143](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L143) Determines if the uploaded data should be sent to the network immediately (eq. deferred=false) or in a deferred fashion (eq. deferred=true). With deferred style client uploads all the data to Bee node first and only then Bee node starts push the data to network itself. The progress of this upload can be tracked with tags. With non-deferred style client uploads the data to Bee which immediately starts pushing the data to network. The request is only finished once all the data was pushed through the Bee node to the network. In future there will be move to the non-deferred style and even the support for deferred upload will be removed from Bee itself. #### Default ```ts true ``` #### Inherited from [`UploadOptions`](UploadOptions.md).[`deferred`](UploadOptions.md#deferred) *** ### encrypt? > `optional` **encrypt**: `boolean` Defined in: [bee-js/src/types/index.ts:122](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L122) Will encrypt the uploaded data and return longer hash which also includes the decryption key. #### See - [Bee docs - Store with Encryption](https://docs.ethswarm.org/docs/develop/access-the-swarm/store-with-encryption) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) - Reference #### Inherited from [`UploadOptions`](UploadOptions.md).[`encrypt`](UploadOptions.md#encrypt) *** ### pin? > `optional` **pin**: `boolean` Defined in: [bee-js/src/types/index.ts:113](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L113) Will pin the data locally in the Bee node as well. Locally pinned data is possible to reupload to network if it disappear. #### See - [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) #### Inherited from [`UploadOptions`](UploadOptions.md).[`pin`](UploadOptions.md#pin) *** ### redundancyLevel? > `optional` **redundancyLevel**: [`RedundancyLevel`](../enumerations/RedundancyLevel.md) Defined in: [bee-js/src/types/index.ts:159](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L159) *** ### tag? > `optional` **tag**: `number` Defined in: [bee-js/src/types/index.ts:131](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L131) Tags keep track of syncing the data with network. This option allows attach existing Tag UUID to the uploaded data. #### See - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) #### Link Tag #### Inherited from [`UploadOptions`](UploadOptions.md).[`tag`](UploadOptions.md#tag) --- ## Interface: ReferenceInformation Defined in: [bee-js/src/types/index.ts:281](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L281) ## Properties ### contentLength > **contentLength**: `number` Defined in: [bee-js/src/types/index.ts:282](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L282) --- ## Interface: ReferenceResponse Defined in: [bee-js/src/types/index.ts:344](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L344) ## Properties ### reference > **reference**: [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:345](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L345) --- ## Interface: RemovePeerResponse Defined in: [bee-js/src/types/debug.ts:193](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L193) ## Properties ### code > **code**: `0` Defined in: [bee-js/src/types/debug.ts:195](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L195) *** ### message > **message**: `string` Defined in: [bee-js/src/types/debug.ts:194](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L194) --- ## Interface: ReserveState Defined in: [bee-js/src/types/debug.ts:254](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L254) ## Properties ### commitment > **commitment**: `number` Defined in: [bee-js/src/types/debug.ts:257](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L257) *** ### radius > **radius**: `number` Defined in: [bee-js/src/types/debug.ts:255](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L255) *** ### storageRadius > **storageRadius**: `number` Defined in: [bee-js/src/types/debug.ts:256](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L256) --- ## Interface: SOCReader Defined in: [bee-js/src/types/index.ts:426](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L426) Interface for downloading single owner chunks ## Extended by - [`SOCWriter`](SOCWriter.md) ## Properties ### download() > **download**: (`identifier`) => `Promise`\<`SingleOwnerChunk`\> Defined in: [bee-js/src/types/index.ts:433](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L433) Downloads a single owner chunk #### Parameters ##### identifier The identifier of the chunk `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](../classes/Identifier.md) #### Returns `Promise`\<`SingleOwnerChunk`\> *** ### owner > `readonly` **owner**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/index.ts:427](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L427) --- ## Interface: SOCWriter Defined in: [bee-js/src/types/index.ts:439](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L439) Interface for downloading and uploading single owner chunks ## Extends - [`SOCReader`](SOCReader.md) ## Properties ### download() > **download**: (`identifier`) => `Promise`\<`SingleOwnerChunk`\> Defined in: [bee-js/src/types/index.ts:433](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L433) Downloads a single owner chunk #### Parameters ##### identifier The identifier of the chunk `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](../classes/Identifier.md) #### Returns `Promise`\<`SingleOwnerChunk`\> #### Inherited from [`SOCReader`](SOCReader.md).[`download`](SOCReader.md#download) *** ### owner > `readonly` **owner**: [`EthAddress`](../classes/EthAddress.md) Defined in: [bee-js/src/types/index.ts:427](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L427) #### Inherited from [`SOCReader`](SOCReader.md).[`owner`](SOCReader.md#owner) *** ### upload() > **upload**: (`stamp`, `identifier`, `data`, `options?`) => `Promise`\<[`UploadResult`](UploadResult.md)\> Defined in: [bee-js/src/types/index.ts:447](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L447) Uploads a single owner chunk #### Parameters ##### stamp `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`BatchId`](../classes/BatchId.md) ##### identifier The identifier of the chunk `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`Identifier`](../classes/Identifier.md) ##### data `Uint8Array` The chunk payload data ##### options? [`UploadOptions`](UploadOptions.md) Upload options #### Returns `Promise`\<[`UploadResult`](UploadResult.md)\> --- ## Interface: Settlements Defined in: [bee-js/src/types/debug.ts:5](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L5) ## Properties ### peer > **peer**: `string` Defined in: [bee-js/src/types/debug.ts:6](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L6) *** ### received > **received**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L7) *** ### sent > **sent**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L8) --- ## Interface: Tag Defined in: [bee-js/src/types/index.ts:251](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L251) Object that contains infromation about progress of upload of data to network. ## See [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) ## Properties ### address > **address**: `string` Defined in: [bee-js/src/types/index.ts:258](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L258) *** ### seen > **seen**: `number` Defined in: [bee-js/src/types/index.ts:253](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L253) *** ### sent > **sent**: `number` Defined in: [bee-js/src/types/index.ts:255](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L255) *** ### split > **split**: `number` Defined in: [bee-js/src/types/index.ts:252](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L252) *** ### startedAt > **startedAt**: `string` Defined in: [bee-js/src/types/index.ts:259](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L259) *** ### stored > **stored**: `number` Defined in: [bee-js/src/types/index.ts:254](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L254) *** ### synced > **synced**: `number` Defined in: [bee-js/src/types/index.ts:256](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L256) *** ### uid > **uid**: `number` Defined in: [bee-js/src/types/index.ts:257](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L257) --- ## Interface: Topology Defined in: [bee-js/src/types/debug.ts:205](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L205) ## Properties ### baseAddr > **baseAddr**: `string` Defined in: [bee-js/src/types/debug.ts:206](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L206) *** ### bins > **bins**: `object` Defined in: [bee-js/src/types/debug.ts:214](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L214) #### bin\_0 > **bin\_0**: [`Bin`](Bin.md) #### bin\_1 > **bin\_1**: [`Bin`](Bin.md) #### bin\_10 > **bin\_10**: [`Bin`](Bin.md) #### bin\_11 > **bin\_11**: [`Bin`](Bin.md) #### bin\_12 > **bin\_12**: [`Bin`](Bin.md) #### bin\_13 > **bin\_13**: [`Bin`](Bin.md) #### bin\_14 > **bin\_14**: [`Bin`](Bin.md) #### bin\_15 > **bin\_15**: [`Bin`](Bin.md) #### bin\_16 > **bin\_16**: [`Bin`](Bin.md) #### bin\_17 > **bin\_17**: [`Bin`](Bin.md) #### bin\_18 > **bin\_18**: [`Bin`](Bin.md) #### bin\_19 > **bin\_19**: [`Bin`](Bin.md) #### bin\_2 > **bin\_2**: [`Bin`](Bin.md) #### bin\_20 > **bin\_20**: [`Bin`](Bin.md) #### bin\_21 > **bin\_21**: [`Bin`](Bin.md) #### bin\_22 > **bin\_22**: [`Bin`](Bin.md) #### bin\_23 > **bin\_23**: [`Bin`](Bin.md) #### bin\_24 > **bin\_24**: [`Bin`](Bin.md) #### bin\_25 > **bin\_25**: [`Bin`](Bin.md) #### bin\_26 > **bin\_26**: [`Bin`](Bin.md) #### bin\_27 > **bin\_27**: [`Bin`](Bin.md) #### bin\_28 > **bin\_28**: [`Bin`](Bin.md) #### bin\_29 > **bin\_29**: [`Bin`](Bin.md) #### bin\_3 > **bin\_3**: [`Bin`](Bin.md) #### bin\_30 > **bin\_30**: [`Bin`](Bin.md) #### bin\_31 > **bin\_31**: [`Bin`](Bin.md) #### bin\_4 > **bin\_4**: [`Bin`](Bin.md) #### bin\_5 > **bin\_5**: [`Bin`](Bin.md) #### bin\_6 > **bin\_6**: [`Bin`](Bin.md) #### bin\_7 > **bin\_7**: [`Bin`](Bin.md) #### bin\_8 > **bin\_8**: [`Bin`](Bin.md) #### bin\_9 > **bin\_9**: [`Bin`](Bin.md) *** ### connected > **connected**: `number` Defined in: [bee-js/src/types/debug.ts:208](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L208) *** ### depth > **depth**: `number` Defined in: [bee-js/src/types/debug.ts:211](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L211) *** ### networkAvailability > **networkAvailability**: `string` Defined in: [bee-js/src/types/debug.ts:213](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L213) *** ### nnLowWatermark > **nnLowWatermark**: `number` Defined in: [bee-js/src/types/debug.ts:210](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L210) *** ### population > **population**: `number` Defined in: [bee-js/src/types/debug.ts:207](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L207) *** ### reachability > **reachability**: `string` Defined in: [bee-js/src/types/debug.ts:212](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L212) *** ### timestamp > **timestamp**: `string` Defined in: [bee-js/src/types/debug.ts:209](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L209) --- ## Interface: TransactionInfo Defined in: [bee-js/src/types/index.ts:522](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L522) ## Properties ### created > **created**: `string` Defined in: [bee-js/src/types/index.ts:529](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L529) *** ### data > **data**: `string` Defined in: [bee-js/src/types/index.ts:528](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L528) *** ### description > **description**: `string` Defined in: [bee-js/src/types/index.ts:530](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L530) *** ### gasLimit > **gasLimit**: `number` Defined in: [bee-js/src/types/index.ts:527](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L527) *** ### gasPrice > **gasPrice**: [`NumberString`](../type-aliases/NumberString.md) Defined in: [bee-js/src/types/index.ts:526](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L526) *** ### nonce > **nonce**: `number` Defined in: [bee-js/src/types/index.ts:525](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L525) *** ### to > **to**: `string` Defined in: [bee-js/src/types/index.ts:524](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L524) *** ### transactionHash > **transactionHash**: [`TransactionId`](../classes/TransactionId.md) Defined in: [bee-js/src/types/index.ts:523](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L523) *** ### value > **value**: `string` Defined in: [bee-js/src/types/index.ts:531](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L531) --- ## Interface: TransactionOptions Defined in: [bee-js/src/types/debug.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L39) ## Properties ### gasLimit? > `optional` **gasLimit**: `string` \| `bigint` \| [`NumberString`](../type-aliases/NumberString.md) Defined in: [bee-js/src/types/debug.ts:48](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L48) Gas limit for the cashout transaction in WEI *** ### gasPrice? > `optional` **gasPrice**: `string` \| `bigint` \| [`NumberString`](../type-aliases/NumberString.md) Defined in: [bee-js/src/types/debug.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L43) Gas price for the cashout transaction in WEI --- ## Interface: TransactionResponse Defined in: [bee-js/src/types/debug.ts:65](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L65) ## Properties ### transactionHash > **transactionHash**: [`TransactionId`](../classes/TransactionId.md) Defined in: [bee-js/src/types/debug.ts:66](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L66) --- ## Interface: UploadHeaders Defined in: [bee-js/src/types/index.ts:238](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L238) ## Properties ### swarm-act? > `optional` **swarm-act**: `string` Defined in: [bee-js/src/types/index.ts:239](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L239) *** ### swarm-encrypt? > `optional` **swarm-encrypt**: `string` Defined in: [bee-js/src/types/index.ts:241](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L241) *** ### swarm-pin? > `optional` **swarm-pin**: `string` Defined in: [bee-js/src/types/index.ts:240](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L240) *** ### swarm-postage-batch-id? > `optional` **swarm-postage-batch-id**: `string` Defined in: [bee-js/src/types/index.ts:243](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L243) *** ### swarm-tag? > `optional` **swarm-tag**: `string` Defined in: [bee-js/src/types/index.ts:242](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L242) --- ## Interface: UploadOptions Defined in: [bee-js/src/types/index.ts:97](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L97) ## Extended by - [`RedundantUploadOptions`](RedundantUploadOptions.md) - [`FileUploadOptions`](FileUploadOptions.md) - [`CollectionUploadOptions`](CollectionUploadOptions.md) ## Properties ### act? > `optional` **act**: `boolean` Defined in: [bee-js/src/types/index.ts:101](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L101) If set to true, an ACT will be created for the uploaded data. *** ### actHistoryAddress? > `optional` **actHistoryAddress**: `string` \| `Uint8Array`\<`ArrayBufferLike`\> \| [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:103](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L103) *** ### deferred? > `optional` **deferred**: `boolean` Defined in: [bee-js/src/types/index.ts:143](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L143) Determines if the uploaded data should be sent to the network immediately (eq. deferred=false) or in a deferred fashion (eq. deferred=true). With deferred style client uploads all the data to Bee node first and only then Bee node starts push the data to network itself. The progress of this upload can be tracked with tags. With non-deferred style client uploads the data to Bee which immediately starts pushing the data to network. The request is only finished once all the data was pushed through the Bee node to the network. In future there will be move to the non-deferred style and even the support for deferred upload will be removed from Bee itself. #### Default ```ts true ``` *** ### encrypt? > `optional` **encrypt**: `boolean` Defined in: [bee-js/src/types/index.ts:122](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L122) Will encrypt the uploaded data and return longer hash which also includes the decryption key. #### See - [Bee docs - Store with Encryption](https://docs.ethswarm.org/docs/develop/access-the-swarm/store-with-encryption) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) - Reference *** ### pin? > `optional` **pin**: `boolean` Defined in: [bee-js/src/types/index.ts:113](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L113) Will pin the data locally in the Bee node as well. Locally pinned data is possible to reupload to network if it disappear. #### See - [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) *** ### tag? > `optional` **tag**: `number` Defined in: [bee-js/src/types/index.ts:131](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L131) Tags keep track of syncing the data with network. This option allows attach existing Tag UUID to the uploaded data. #### See - [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) - [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) #### Link Tag --- ## Interface: UploadResult Defined in: [bee-js/src/types/index.ts:80](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L80) Result of upload calls. ## Properties ### historyAddress > **historyAddress**: `Optional`\<[`Reference`](../classes/Reference.md)\> Defined in: [bee-js/src/types/index.ts:94](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L94) History address of the uploaded data with ACT. *** ### reference > **reference**: [`Reference`](../classes/Reference.md) Defined in: [bee-js/src/types/index.ts:84](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L84) Reference of the uploaded data *** ### tagUid? > `optional` **tagUid**: `number` Defined in: [bee-js/src/types/index.ts:89](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L89) Automatically created tag's UID. --- ## Interface: WalletBalance Defined in: [bee-js/src/types/debug.ts:267](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L267) ## Properties ### bzzBalance > **bzzBalance**: [`BZZ`](../classes/BZZ.md) Defined in: [bee-js/src/types/debug.ts:268](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L268) *** ### chainID > **chainID**: `number` Defined in: [bee-js/src/types/debug.ts:270](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L270) *** ### chequebookContractAddress > **chequebookContractAddress**: `string` Defined in: [bee-js/src/types/debug.ts:271](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L271) *** ### nativeTokenBalance > **nativeTokenBalance**: [`DAI`](../classes/DAI.md) Defined in: [bee-js/src/types/debug.ts:269](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L269) *** ### walletAddress > **walletAddress**: `string` Defined in: [bee-js/src/types/debug.ts:272](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/debug.ts#L272) --- ## Function: approximateOverheadForRedundancyLevel() > **approximateOverheadForRedundancyLevel**(`chunks`, `level`, `encrypted`): `number` Defined in: [bee-js/src/utils/redundancy.ts:48](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/redundancy.ts#L48) Returns an approximate multiplier for the overhead of a given redundancy level. Redundancy level is a tradeoff between storage overhead and fault tolerance. Use this number to estimate the amount of chunks that will be stored for a given redundancy level. ## Parameters ### chunks `number` ### level [`RedundancyLevel`](../../enumerations/RedundancyLevel.md) ### encrypted `boolean` ## Returns `number` --- ## Function: getAmountForDuration() > **getAmountForDuration**(`duration`, `pricePerBlock`, `blockTime`): `bigint` Defined in: [bee-js/src/utils/stamps.ts:125](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/stamps.ts#L125) Get the postage batch `amount` required for a given `duration`. ## Parameters ### duration [`Duration`](../../classes/Duration.md) A duration object representing the duration of the storage. ### pricePerBlock `number` The price per block in PLUR. ### blockTime `number` The block time in seconds. ## Returns `bigint` --- ## Function: getCollectionSize() > **getCollectionSize**(`fileList`): `number` Defined in: [bee-js/src/utils/collection.ts:44](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/collection.ts#L44) Calculate cumulative size of files ## Parameters ### fileList list of files to check `File`[] | `FileList` ## Returns `number` size in bytes --- ## Function: getDepthForSize() > **getDepthForSize**(`size`): `number` Defined in: [bee-js/src/utils/stamps.ts:135](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/stamps.ts#L135) Utility function that calculates the depth required for a postage batch to achieve the specified effective size ## Parameters ### size [`Size`](../../classes/Size.md) The effective size of the postage batch ## Returns `number` --- ## Function: getFolderSize() > **getFolderSize**(`dir`): `Promise`\<`number`\> Defined in: [bee-js/src/utils/collection.node.ts:51](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/collection.node.ts#L51) Calculate folder size recursively ## Parameters ### dir `string` the path to the folder to check ## Returns `Promise`\<`number`\> size in bytes --- ## Function: getRedundancyStat() > **getRedundancyStat**(`level?`): `RedundancyStats` Defined in: [bee-js/src/utils/redundancy.ts:121](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/redundancy.ts#L121) ## Parameters ### level? `string` | [`RedundancyLevel`](../../enumerations/RedundancyLevel.md) ## Returns `RedundancyStats` --- ## Function: getRedundancyStats() > **getRedundancyStats**(): `object` Defined in: [bee-js/src/utils/redundancy.ts:107](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/redundancy.ts#L107) ## Returns `object` ### insane > **insane**: `RedundancyStats` ### medium > **medium**: `RedundancyStats` ### paranoid > **paranoid**: `RedundancyStats` ### strong > **strong**: `RedundancyStats` --- ## Function: getStampCost() > **getStampCost**(`depth`, `amount`): [`BZZ`](../../classes/BZZ.md) Defined in: [bee-js/src/utils/stamps.ts:97](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/stamps.ts#L97) Utility function that calculates the cost of a postage batch based on its depth and amount. ## Parameters ### depth `number` ### amount `string` | `bigint` | [`NumberString`](../../type-aliases/NumberString.md) ## Returns [`BZZ`](../../classes/BZZ.md) --- ## Function: getStampDuration() > **getStampDuration**(`amount`, `pricePerBlock`, `blockTime`): [`Duration`](../../classes/Duration.md) Defined in: [bee-js/src/utils/stamps.ts:108](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/stamps.ts#L108) Utility function that calculates the TTL of a postage batch based on its amount, price per block and block time. For more accurate results, get the price per block and block time from the Bee node or the blockchain. ## Parameters ### amount `string` | `bigint` | [`NumberString`](../../type-aliases/NumberString.md) ### pricePerBlock `number` ### blockTime `number` ## Returns [`Duration`](../../classes/Duration.md) The TTL of the postage batch. --- ## Function: getStampEffectiveBytes() > **getStampEffectiveBytes**(`depth`): `number` Defined in: [bee-js/src/utils/stamps.ts:66](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/stamps.ts#L66) Utility function that calculates the effective size of a postage batch based on its depth. Below 22 depth the effective size is 0 Above 34 it's always > 99% ## Parameters ### depth `number` ## Returns `number` The effective size of the postage batch in bytes. --- ## Function: getStampEffectiveBytesBreakpoints() > **getStampEffectiveBytesBreakpoints**(): `Map`\<`number`, `number`\> Defined in: [bee-js/src/utils/stamps.ts:84](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/stamps.ts#L84) ## Returns `Map`\<`number`, `number`\> --- ## Function: getStampTheoreticalBytes() > **getStampTheoreticalBytes**(`depth`): `number` Defined in: [bee-js/src/utils/stamps.ts:29](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/stamps.ts#L29) Utility function that calculates the theoritical maximum size of a postage batch based on its depth. For smaller depths (up to 22), this may provide less accurate results. ## Parameters ### depth `number` ## Returns `number` The maximum theoretical size of the postage batch in bytes. --- ## Function: getStampUsage() > **getStampUsage**(`utilization`, `depth`, `bucketDepth`): `number` Defined in: [bee-js/src/utils/stamps.ts:18](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/stamps.ts#L18) Utility function that calculates usage of postage batch based on its utilization, depth and bucket depth. For smaller depths (up to 20), this may provide less accurate results. ## Parameters ### utilization `number` ### depth `number` ### bucketDepth `number` ## Returns `number` A number between 0 and 1 representing the usage of the postage batch. --- ## Function: makeCollectionFromFileList() > **makeCollectionFromFileList**(`fileList`): [`Collection`](../../type-aliases/Collection.md) Defined in: [bee-js/src/utils/collection.ts:30](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/collection.ts#L30) ## Parameters ### fileList `File`[] | `FileList` ## Returns [`Collection`](../../type-aliases/Collection.md) --- ## Function: makeMaxTarget() > **makeMaxTarget**(`target`): `string` Defined in: [bee-js/src/utils/pss.ts:11](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/pss.ts#L11) Utility function that for given strings/reference takes the most specific target that Bee node will except. ## Parameters ### target is a non-prefixed hex string Bee address `string` | `Uint8Array`\<`ArrayBufferLike`\> | [`PeerAddress`](../../classes/PeerAddress.md) ## Returns `string` ## See [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss) --- ## Type Alias: BeeRequestOptions > **BeeRequestOptions** = `object` Defined in: [bee-js/src/types/index.ts:43](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L43) ## Extended by - [`BeeOptions`](../interfaces/BeeOptions.md) ## Properties ### baseURL? > `optional` **baseURL**: `string` Defined in: [bee-js/src/types/index.ts:44](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L44) *** ### endlesslyRetry? > `optional` **endlesslyRetry**: `boolean` Defined in: [bee-js/src/types/index.ts:50](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L50) *** ### headers? > `optional` **headers**: `Record`\<`string`, `string`\> Defined in: [bee-js/src/types/index.ts:46](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L46) *** ### httpAgent? > `optional` **httpAgent**: `unknown` Defined in: [bee-js/src/types/index.ts:48](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L48) *** ### httpsAgent? > `optional` **httpsAgent**: `unknown` Defined in: [bee-js/src/types/index.ts:49](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L49) *** ### onRequest()? > `optional` **onRequest**: (`request`) => `void` Defined in: [bee-js/src/types/index.ts:47](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L47) #### Parameters ##### request [`BeeRequest`](../interfaces/BeeRequest.md) #### Returns `void` *** ### timeout? > `optional` **timeout**: `number` Defined in: [bee-js/src/types/index.ts:45](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L45) --- ## Type Alias: Collection > **Collection** = [`CollectionEntry`](../interfaces/CollectionEntry.md)[] Defined in: [bee-js/src/types/index.ts:322](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L322) Represents Collections --- ## Type Alias: HookCallback()\ > **HookCallback**\<`V`\> = (`value`) => `void` \| `Promise`\<`void`\> Defined in: [bee-js/src/types/index.ts:350](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L350) ## Type Parameters ### V `V` ## Parameters ### value `V` ## Returns `void` \| `Promise`\<`void`\> --- ## Type Alias: HttpMethod > **HttpMethod** = `"GET"` \| `"DELETE"` \| `"POST"` \| `"PATCH"` \| `"PUT"` Defined in: [bee-js/src/types/index.ts:348](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L348) --- ## Type Alias: NumberString > **NumberString** = `string` & `object` Defined in: [bee-js/src/types/index.ts:586](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L586) With this type a number should be represented in a string ## Type declaration ### \_\_numberString > **\_\_numberString**: `never` --- ## Variable: BRANCHES > `const` **BRANCHES**: `128` = `128` Defined in: [bee-js/src/types/index.ts:23](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L23) --- ## Variable: CHUNK\_SIZE > `const` **CHUNK\_SIZE**: `number` Defined in: [bee-js/src/types/index.ts:24](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L24) --- ## Variable: FEED\_INDEX\_HEX\_LENGTH > `const` **FEED\_INDEX\_HEX\_LENGTH**: `16` = `16` Defined in: [bee-js/src/types/index.ts:41](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L41) --- ## Variable: NULL\_ADDRESS > `const` **NULL\_ADDRESS**: `Uint8Array`\<`ArrayBuffer`\> Defined in: [bee-js/src/utils/constants.ts:6](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/constants.ts#L6) --- ## Variable: NULL\_IDENTIFIER > `const` **NULL\_IDENTIFIER**: `Uint8Array`\<`ArrayBuffer`\> Defined in: [bee-js/src/utils/constants.ts:7](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/constants.ts#L7) --- ## Variable: NULL\_OWNER > `const` **NULL\_OWNER**: `Uint8Array`\<`ArrayBuffer`\> Defined in: [bee-js/src/utils/constants.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/constants.ts#L8) --- ## Variable: NULL\_STAMP > `const` **NULL\_STAMP**: [`BatchId`](../classes/BatchId.md) Defined in: [bee-js/src/utils/constants.ts:4](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/constants.ts#L4) --- ## Variable: NULL\_TOPIC > `const` **NULL\_TOPIC**: [`Topic`](../classes/Topic.md) Defined in: [bee-js/src/utils/constants.ts:5](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/constants.ts#L5) --- ## Variable: PSS\_TARGET\_HEX\_LENGTH\_MAX > `const` **PSS\_TARGET\_HEX\_LENGTH\_MAX**: `4` = `4` Defined in: [bee-js/src/types/index.ts:26](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L26) --- ## Variable: SECTION\_SIZE > `const` **SECTION\_SIZE**: `32` = `32` Defined in: [bee-js/src/types/index.ts:22](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L22) --- ## Variable: STAMPS\_DEPTH\_MAX > `const` **STAMPS\_DEPTH\_MAX**: `255` = `255` Defined in: [bee-js/src/types/index.ts:36](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L36) Maximal depth that can be used for creation of postage batch --- ## Variable: STAMPS\_DEPTH\_MIN > `const` **STAMPS\_DEPTH\_MIN**: `17` = `17` Defined in: [bee-js/src/types/index.ts:31](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L31) Minimal depth that can be used for creation of postage batch --- ## Variable: SUPPORTED\_BEE\_VERSION > `const` **SUPPORTED\_BEE\_VERSION**: `string` Defined in: [bee-js/src/modules/debug/status.ts:9](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/modules/debug/status.ts#L9) --- ## Variable: SUPPORTED\_BEE\_VERSION\_EXACT > `const` **SUPPORTED\_BEE\_VERSION\_EXACT**: `"2.4.0-390a402e"` = `'2.4.0-390a402e'` Defined in: [bee-js/src/modules/debug/status.ts:8](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/modules/debug/status.ts#L8) --- ## Variable: SWARM\_GATEWAY\_URL > `const` **SWARM\_GATEWAY\_URL**: `"https://api.gateway.ethswarm.org"` = `'https://api.gateway.ethswarm.org'` Defined in: [bee-js/src/utils/constants.ts:3](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/utils/constants.ts#L3) --- ## Variable: TAGS\_LIMIT\_MAX > `const` **TAGS\_LIMIT\_MAX**: `1000` = `1000` Defined in: [bee-js/src/types/index.ts:39](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L39) --- ## Variable: TAGS\_LIMIT\_MIN > `const` **TAGS\_LIMIT\_MIN**: `1` = `1` Defined in: [bee-js/src/types/index.ts:38](https://github.com/ethersphere/bee-js/blob/3abbe2b1b264d6b586511a56e93badb2236bd09d/src/types/index.ts#L38) --- ## ACT (Access Control Trie) ACT, or Access Control Trie, is a decentralized permission system built into the Swarm network that allows you to restrict access to uploaded content. When you upload data to Swarm using ACT, only the original uploader and users with public keys listed in an associated grantee list are able to retrieve and decrypt that data. The grantee list is published separately and cryptographically referenced during upload and download operations. ACT is ideal for use cases such as the serialized release of content like a podcast or newsletter where the publisher wishes to limit access to subscribers only. :::warning Once a file is uploaded with ACT, any node whose public key is on the ACT grantees list referenced during the upload ***will have permanent access to that file*** as long as the file reference and history reference returned from the upload has been shared with them. Updating the grantees list to remove a public key ***will not revoke access*** to the content retroactively. Likewise, re-uploading the content using the new grantees list will also ***not retroactively revoke access*** to the content. ::: ## Requirements The use of ACT requires the following: * A Bee light node running on with synced postage batch data. (Running at `http://localhost:1633` by default) * A valid postage batch ID. [Buy one](./buying-storage.md#purchasing-storage) if needed. * Public keys of the nodes you want to grant access to. * The **public key of the publishing node**. This can be obtained using the [`bee.getNodeAddresses()` method](./status.md#3-get-node-addresses). ## Create Grantees List First we create a grantees list with the public keys of anyone we want to grant access to. #### Example Script: The example script below performs the following key operations: 1. Initializes a Bee client. 2. Defines a list of grantee public keys. 3. Specifies a valid postage batch ID. 4. Calls `bee.createGrantees()` to create a new grantee list. 5. Logs the resulting `ref` and `historyref`. ```js // Initialize Bee instance const bee = new Bee('http://localhost:1633'); // Grantee's public key (replace with the actual key(s) of the node(s) you wish to grant access to) const grantees = [ new PublicKey('027d0c4759f689ea3dd3eb79222870671c492cb99f3fade275bcbf0ea39cd0ef6e'), ]; // Your postage batch ID (replace with your own valid postage batch ID) const postageBatchId = new BatchId('0258a225fe8da54cc6537eb8b12fcf6706c7873dbe19b9381d31729aa0405398'); async function createGranteeList() { try { // Create the grantee list using `bee.createGrantees()` method const response = await bee.createGrantees(postageBatchId, grantees); // Log the response (ref and history ref) console.log('Grantee List Created Successfully:'); console.log('Reference:', response.ref.toHex()); console.log('History Reference:', response.historyref.toHex()); } catch (error) { console.error('Error creating grantee list:', error); } } // Call the function to create the grantee list createGranteeList(); ``` Example output: ```bash Grantee List Created Successfully: Reference: 69da034fdae049eed9a22ec48b98a08ed5d363d48076f88c44ffe3367a18e306cae6aaf1cfce72d59262b9fb9293e15469c01c6a2626bb62478116cc98fb303b History Reference: 18d6f58a1d3c8253a5fc47023d49e9011236ead43724e595e898e1b422b77b19 ``` The first 64 byte (128 hex digit) reference `Grantee List Reference` (`ref`) is used on its own for reviewing the list contents and updating the list. The second reference 32 byte (64 hex digit) `History Reference` (`historyref`) is used for uploading with ACT and is also used along with the first `ref` for creating a new updated grantee list based on the original list referred to by the `ref`. ## Update Grantees List :::info Although we refer to this operation as an "update", due to Swarm's immutable nature, the original list is not modified by this operation. Rather a new list is created with the specified grantee keys added or removed from the original list. This operation ***DOES NOT*** retroactively add or remove access to content uploaded with the original ACT list. ::: To update a grantees list, call the `bee.patchGrantees()` method with the following arguments: * A valid postage batch ID * The original list’s `ref` and `historyref` * An object specifying public keys to `add` or `revoke` ```js bee.patchGrantees(postageBatchId, ref, historyref, { add: [grantee1, grantee2], revoke: [], }); ``` Calling this method returns the new list’s updated `ref` and `historyref`, which you should use for future updates or access. #### Example Script: The example script below performs the following key steps: 1. Initializes the Bee client and defines two public keys to add as grantees. 2. Provides the existing grantee list’s `ref` and `historyref`, and a valid postage batch ID. 3. Calls `bee.patchGrantees()` to add the new keys to the list. 4. Logs the updated grantee list’s `ref` and `historyref`. ```js // Initialize Bee instance const bee = new Bee('http://localhost:1633'); // Grantee's public key(s) to be added (replace with the actual key) const grantee1 = new PublicKey('027d0c4759f689ea3dd3eb79222870671c492cb99f3fade275bcbf0ea39cd0ef6e'); const grantee2 = new PublicKey('03636056d1e08f100c5acaf14d10070102de9444c97b2e8215305ab3e97254ede6'); // Grantee list reference and history reference returned from initial list creation const granteeListRef = new Reference('69da034fdae049eed9a22ec48b98a08ed5d363d48076f88c44ffe3367a18e306cae6aaf1cfce72d59262b9fb9293e15469c01c6a2626bb62478116cc98fb303b') const granteeHistoryRef = new Reference('18d6f58a1d3c8253a5fc47023d49e9011236ead43724e595e898e1b422b77b19') // Your postage batch ID (replace with a valid one) const postageBatchId = new BatchId('0258a225fe8da54cc6537eb8b12fcf6706c7873dbe19b9381d31729aa0405398'); // Function to update the grantee list by adding the new public key async function updateGranteeList() { try { // Call the patchGrantees function to add the new public key const response = await bee.patchGrantees(postageBatchId, granteeListRef, granteeHistoryRef, { add: [grantee1, grantee2], // Add the new grantee revoke: [], }); // Log the updated grantee list references console.log('Grantee List Updated Successfully:'); console.log('Updated Reference:', response.ref.toHex()); console.log('Updated History Reference:', response.historyref.toHex()); } catch (error) { console.error('Error updating grantee list:', error.message); if (error.response) { // If there's an error, log the full response for more details console.error('Response Status:', error.response.status); console.error('Response Body:', JSON.stringify(error.response.body, null, 2)); } } } // Call the function to update the grantee list updateGranteeList(); ``` Example output: ```bash Grantee List Updated Successfully: Updated Reference: a029324c42e7911032b83155f487d545b6e07b521a90fce90a266f308c0a455417e71bc03621868da2f6e84357ba772cb03b408fce79862b03d2e082004eccd8 Updated History Reference: d904f0790acb7edfda6a078176d64ec026b40298bfdbceb82956533e31489fcd ``` ## Get Grantees List In order to view the members of our grantees list we need to use the 64 byte `ref` returned when we create or update a list. We will view both our original list and the updated list based on the original list using the respective `ref` from each list: :::info The grantee list is encrypted, and only the owner can view the grantee list, make sure to use the owner node when using the `bee.getGrantees()` method. ::: #### Example Script: The example script below performs the following operations: 1. Initializes a Bee client. 2. Defines two existing grantee list 64 byte `ref` copied from the results of our previous example scripts. 3. Calls `bee.getGrantees()` for each `ref` to retrieve the corresponding grantee list. 4. Logs the status, status text, and list of grantee public keys in compressed hex format. ```js // Initialize Bee instance const bee = new Bee('http://localhost:1633'); // Grantee list references (the reference returned from the `bee.createGrantees()` function) const granteeListRef_01 = new Reference('69da034fdae049eed9a22ec48b98a08ed5d363d48076f88c44ffe3367a18e306cae6aaf1cfce72d59262b9fb9293e15469c01c6a2626bb62478116cc98fb303b'); const granteeListRef_02 = new Reference('a029324c42e7911032b83155f487d545b6e07b521a90fce90a266f308c0a455417e71bc03621868da2f6e84357ba772cb03b408fce79862b03d2e082004eccd8'); // Function to get the grantee list async function getGranteeList(granteeListRef) { try { // Call the getGrantees function with the reference const result = await bee.getGrantees(granteeListRef); // Log the full response console.log('Grantee List Retrieved:'); console.log('Status:', result.status); console.log('Status Text:', result.statusText); // Log the grantee lists as arrays of their hex string representations console.log('Grantees:', result.grantees.map(grantee => grantee.toCompressedHex())); } catch (error) { console.error('Error retrieving grantee list:', error); } } // Call the function to fetch the grantee list getGranteeList(granteeListRef_01); getGranteeList(granteeListRef_02); ``` Example output: ```bash Grantee List Retrieved: Status: 200 Status Text: OK Grantees: [ '027d0c4759f689ea3dd3eb79222870671c492cb99f3fade275bcbf0ea39cd0ef6e' ] Grantee List Retrieved: Status: 200 Status Text: OK Grantees: [ '027d0c4759f689ea3dd3eb79222870671c492cb99f3fade275bcbf0ea39cd0ef6e', '03636056d1e08f100c5acaf14d10070102de9444c97b2e8215305ab3e97254ede6' ] ``` The first list of grantees contains the first public key we gave access to when we created the list, while the second one contains both the first and the second one we added when we created our second list based on the first one. ## Upload With ACT We can upload our content with either of the two lists we created depending on which set of users we wish to give access too. In the example below, we use both lists. #### Example Script: The example script below performs the following operations: 1. Initializes a Bee client. 2. Defines a postage batch ID and two ACT grantee list 32 byte `historyref` hashes returned from the operations in the previous examples. 3. Defines a string to upload as a sample file. 4. Calls `bee.uploadFile()` twice with ACT enabled, specifying a `historyRef` each time to enforce access control. 5. Logs the resulting Swarm reference and history reference after each upload. ```js // Initialize Bee instance const bee = new Bee('http://localhost:1633'); // Your postage batch ID (replace with a valid one) const postageBatchId = new BatchId('0258a225fe8da54cc6537eb8b12fcf6706c7873dbe19b9381d31729aa0405398'); // Grantee list reference (the reference returned from the `bee.createGrantees()` function) const historyRef_01 = new Reference('18d6f58a1d3c8253a5fc47023d49e9011236ead43724e595e898e1b422b77b19'); const historyRef_02 = new Reference('d904f0790acb7edfda6a078176d64ec026b40298bfdbceb82956533e31489fcd'); // Sample data to upload const fileData = 'This is a sample string that will be uploaded securely using ACT.'; async function uploadWithACT(historyRef) { try { // Upload the string with ACT enabled const result = await bee.uploadFile(postageBatchId, fileData, 'samplefile.txt', { act: true, // Enable ACT for the uploaded data actHistoryAddress: historyRef, // Provide the grantee list reference for ACT contentType: 'text/plain', }); console.log('File uploaded successfully with ACT:'); console.log('Reference:', result.reference.toHex()); console.log("History reference") console.log(result.historyAddress.value.toHex()) } catch (error) { console.error('Error uploading file with ACT:', error); } } // Call the function to upload the file with each `historyref` uploadWithACT(historyRef_01); uploadWithACT(historyRef_02); ``` Example output: ```bash File uploaded successfully with ACT: Reference: e227acea84e1d55e90baa93a698e79577a5b1c54513925b61476386798b41728 History reference 18d6f58a1d3c8253a5fc47023d49e9011236ead43724e595e898e1b422b77b19 File uploaded successfully with ACT: Reference: e227acea84e1d55e90baa93a698e79577a5b1c54513925b61476386798b41728 History reference d904f0790acb7edfda6a078176d64ec026b40298bfdbceb82956533e31489fcd ``` The reference hash is the same for each upload since the content is the same. The reference hash along with a `historyref` and the uploader's public key are required in order to access the content uploaded with ACT. You can choose which `historyref` to share depending on which set of public keys you wish to authorize to download the content. ## Download With ACT In order to download using ACT, we must pass in the public key from the grantee list creator along with the file reference and history reference returned from the file upload operation: #### Example Script: The example script below performs the following operations: 1. Initializes a Bee client. 2. Defines a publisher public key and associated file reference + history references for ACT-protected content using the references returned from the upload operation. 3. Calls `bee.downloadFile()` with ACT options (`actPublisher` and `actHistoryAddress`) to access protected data. 4. Logs the decoded file content. ```js // Initialize Bee instance const bee = new Bee('http://localhost:1633') // Publisher public key used during upload const publisherPublicKey = new PublicKey('0295562f9c1013d1db29f7aaa0c997c4bb3f1fc053bd0ed49a3d98584490cc8f96'); // File reference and history reference returned from upload operation const fileRef_01 = new Reference('e227acea84e1d55e90baa93a698e79577a5b1c54513925b61476386798b41728'); const historyRef_01 = new Reference('18d6f58a1d3c8253a5fc47023d49e9011236ead43724e595e898e1b422b77b19'); // Function to download ACT-protected content async function downloadWithACT(fileRef, historyRef, publisherPubKey) { try { const result = await bee.downloadFile(fileRef, './', { actPublisher: publisherPubKey, actHistoryAddress: historyRef }) console.log('Content:', result.data.toUtf8()) } catch (error) { console.error(`Error downloading from reference ${fileRef}:`, error) } } downloadWithACT( fileRef_01, historyRef_01, publisherPublicKey ) ``` Example terminal output: ```bash Content: This is a sample string that will be uploaded securely using ACT. ``` In the example above, we used the history reference from the file uploaded using the grantees list with only one public key included (`027d0c4759f689ea3dd3eb79222870671c492cb99f3fade275bcbf0ea39cd0ef6e`), and so it will only be able to be retrieved and decrypted by the node with that public key. If any other node attempts to download this content then a 404 error will be returned. --- ## Buying Storage Storage on Swarm is rented by purchasing "postage stamp batches". Each batch entitles its owner to store a certain amount of storage space on Swarm for the lifetime of the batch. The cost of the batch increases with the storage size and duration. ### Requirements To use the example scripts below, you need: - An instance of `bee-js`'s `Bee` [initialized](./getting-started.md) using the API endpoint of a currently operating Bee node ### Checking Storage Costs We can use the `bee.getStorageCost` method along with our desired storage `Size` (amount of data to upload) and `Duration` (the batch lifetime) to get an estimated storage cost: :::tip The per byte storage cost decreases as the storage `Size` of the batch increases, so it is more cost effective to purchase a single large batch rather than multiple smaller ones. Costs remain constant with respect to changes in total `Duration`, however, so there is no discount for purchasing batches with longer lifetime. ::: ```javascript const bee = new Bee('http://localhost:1633') // Get cost in BZZ to store 4 GB for ~1 day const bzz = await bee.getStorageCost(Size.fromGigabytes(1), Duration.fromDays(1)) // Prints "0.325" given the storage cost of 44908 PLUR at time of writing console.log(bzz.toSignificantDigits(3)) ``` :::warning The actual lifetime of the batch may be higher or lower than the specified `Duration` due to Swarm's dynamic pricing model. The amount that the price can change each day is limited, however, so you don't need to worry about a rapid increase in price causing your batch to unexpectedly expire over the course of a few hours. You can view the current price of storage on [Swarmscan](https://swarmscan.io/). ::: ### Purchasing Storage The `bee.buyStorage` method abstracts away some of the lower level details of :::tip When purchasing storage with `bee.buyStorage`, a postage batch will be bought with *at least* enough space to upload the specified amount of data. However since storage on Swarm comes in [***discrete sizes***](./buying-storage.md#batch-size-breakpoints), the actual amount of space will likely be greater than specified. ::: The `bee.buyStorage` method takes instances of the [`Size` and `Duration` utility classes](./buying-storage.md#utility-classes) and purchases a postage batch which can upload *at least* as much data as the given `Size` and store it for the given `Duration` (the actual duration of storage may be longer or shorter depending on the change in storage price over time), and then save the postage batch data locally. The transaction usually only takes a few seconds but may take up to a minute. ```javascript const bee = new Bee('http://localhost:1633') // Purchase a batch to store 1 GB const batchId = await bee.buyStorage(Size.fromGigabytes(1), Duration.fromDays(1)) ``` Once the purchase transaction is complete, the method will return a unique postage batch id. The lifetime of the batch starts counting down from the moment of purchase. The batch in the example above will expire in about 24 hours. ### Extending Storage Size :::tip Just as with buying storage, since storage comes only in [***discrete sizes***](./buying-storage.md#batch-size-breakpoints), the actual amount of additional space when extending the storage size of an existing batch will typically be greater than specified. ::: If we need to upload more data, then we can extend a batch's storage size using the `bee.extendStorageSize` method. Note that in order to increase the batch size using the `extendStorageSize` method, you must choose a size which is above the current [batch's size breakpoint](./buying-storage.md#batch-size-breakpoints). :::tip As mentioned [above](./buying-storage.md#batch-size-breakpoints), the per byte cost decreases as the storage size of a batch increases, so it's more cost effective to increase the storage size an existing batch rather than buying a new, smaller batch. The exception to this rule is if we no longer wish to store the previously uploaded data. In that case we SHOULD buy an all new postage batch, as extending the size of an existing batch would require us to continue paying for the already uploaded data which we no longer need. ::: First we estimate the cost to extend the storage size with the `bee.getSizeExtensionCost` method: ```javascript const bee = new Bee('http://localhost:1633') // Request all local postage batches const batches = await bee.getAllPostageBatch() const batchId = batches[0].batchID // Instantiate a Size instance for 36 GB with newSize const newSize = Size.fromGigabytes(5) // Return an instance of the BZZ class const sizeExtentionCost = await bee.getSizeExtensionCost(batchId, newSize) // Use the BZZ.toDecimalString instance method to convert to a readable BZZ string const cost = sizeExtentionCost.toDecimalString() // Prints current cost to increase size console.log(cost) ``` If the price is acceptable, then we can proceed to extend the batch size using `bee.extendStorageSize`: ```javascript const bee = new Bee('http://localhost:1633') // Request all local postage batches const batches = await bee.getAllPostageBatch() // Print results to the terminal console.log(batches) // Get batch ID of first batch in list const batchId = batches[0].batchID // Instantiate a Size instance for 36 GB with newSize const newSize = Size.fromGigabytes(5) // Extends batch size and returns the batch ID const result = await bee.extendStorageSize(batchId, newSize) // Log result if successful console.log(result) ``` We can check that we successfully extended the batch size by [checking batch status](./buying-storage.md#checking-storage-status): ```javascript [ { batchID: BatchId { bytes: [Uint8Array], length: 32 }, utilization: 0, usable: true, label: '', depth: 23, amount: '1714407552', bucketDepth: 16, blockNumber: 39145214, immutableFlag: true, usage: 0, usageText: '0%', size: Size { bytes: 17028686336 }, remainingSize: Size { bytes: 17028686336 }, theoreticalSize: Size { bytes: 34359738368 }, duration: Duration { seconds: 94453 } } ] ``` Here we can see that our batch `size` was successfully extended from ~4.93 GB to ~17.03 GB. *See [above](./buying-storage.md#batch-size-breakpoints) to understand why `size` was extended to ~17.03 even though 5 GB was used as input.* ### Extending Storage Duration If we want our data to remain available on Swarm for a longer period of time, we can extend the duration of a postage batch using the `bee.extendStorageDuration` method. Extending the duration means adding more BZZ to the batch so that the data stays alive longer on the network. Before extending the duration, we can estimate the cost using the `bee.getDurationExtensionCost` method: ```javascript const bee = new Bee('http://localhost:1633') // Request all local postage batches const batches = await bee.getAllPostageBatch() // Select the batch ID of the first batch in the list const batchId = batches[0].batchID // Create a new Duration instance for 0.01 days const additionalDuration = Duration.fromDays(.01) // Estimate the cost of extending the duration const durationExtensionCost = await bee.getDurationExtensionCost(batchId, additionalDuration) // Convert the BZZ value into a readable string const cost = durationExtensionCost.toDecimalString() // Print the estimated cost console.log(cost) ``` Once we know the cost and decide to proceed, we can use `bee.extendStorageDuration` to extend the batch duration: ```javascript const bee = new Bee('http://localhost:1633') // Request all local postage batches const batches = await bee.getAllPostageBatch() // Select the batch ID of the first batch in the list const batchId = batches[0].batchID // Create a Duration instance for 0.1 additional days const additionalDuration = Duration.fromDays(.01) // Extend the duration of the batch const result = await bee.extendStorageDuration(batchId, additionalDuration) // Log the result console.log(result) ``` We can verify that the extension was successful by [checking the batch status](./buying-storage.md#checking-storage-status). You'll notice the `duration` value on the batch will have increased, reflecting the newly extended storage time: ```javascript [ { batchID: BatchId { bytes: [Uint8Array], length: 32 }, utilization: 0, usable: true, label: '', depth: 23, amount: '1722164236', bucketDepth: 16, blockNumber: 39145214, immutableFlag: true, usage: 0, usageText: '0%', size: Size { bytes: 17028686336 }, remainingSize: Size { bytes: 17028686336 }, theoreticalSize: Size { bytes: 34359738368 }, duration: Duration { seconds: 94132 } } ] ``` Here we can see that the `duration` value (measured in seconds) has increased, confirming that the batch will now remain alive on the Swarm network for longer. :::tip If you're storing important or long-lived data, it's a good idea to periodically check and extend the duration of your batches to ensure your data doesn't expire unexpectedly. ::: ### Estimating Combined Size and Duration Extension Cost If we want to **increase both the storage size and duration** of a postage batch, we can use the `Bee.getExtensionCost` method to estimate the **total cost** of the extension. This is useful when you're planning to keep data alive for longer *and* want to increase capacity for uploading more data at the same time. The `getExtensionCost` method combines both aspects β€” size and duration β€” into a single cost calculation, making it easier to understand the overall expense upfront. Here’s how to use it: ```javascript const bee = new Bee('http://localhost:1633') // Request all local postage batches const batches = await bee.getAllPostageBatch() // Choose a batch to extend const batchId = batches[0].batchID // Define a new desired size (e.g., 10 GB) const newSize = Size.fromGigabytes(10) // Define a new additional duration (e.g., 14 days) const additionalDuration = Duration.fromDays(14) // Estimate total BZZ cost for extending both size and duration const totalCost = await bee.getExtensionCost(batchId, newSize, additionalDuration) // Convert to a readable string const cost = totalCost.toDecimalString() // Print total estimated cost console.log(cost) ``` This method helps you determine if it's more economical to **extend** an existing batch or **create a new one**, especially when both dimensionsβ€”storage and timeβ€”need to grow. :::tip If you're unsure whether to extend a batch or start fresh, compare the output of `getExtensionCost` with the cost of a new batch using the [Postage Stamp Pricing Guide](./buying-storage.md#batch-size-breakpoints). In many cases, extending is cheaper, especially for larger and longer-lived batches. ::: If you're happy with the cost, you can then proceed to extend the **size** and **duration** individually by calling `extendStorageSize` and `extendStorageDuration` as shown in the previous sections. ### Checking Batch Status You can check the status of purchased batches using the `bee.getAllPostageBatch` method: ```javascript const bee = new Bee('http://localhost:1633') // Request all local postage batches const batches = await bee.getAllPostageBatch() // Print results to the terminal console.log(batches) ``` The results printed to the terminal will include all the currently valid postage batches we've purchased: ```bash [ { batchID: BatchId { bytes: [Uint8Array], length: 32 }, utilization: 0, usable: true, label: '', depth: 22, amount: '931958784', bucketDepth: 16, blockNumber: 39105960, immutableFlag: true, usage: 0, usageText: '0%', size: Size { bytes: 4925468496 }, remainingSize: Size { bytes: 4925468496 }, theoreticalSize: Size { bytes: 17179869184 }, duration: Duration { seconds: 84348 } } ] ``` We can disregard many of these values since they are only needed for advanced usage. There are several values we do need to pay attention to however: - `usable` - it takes a short time for a batch to become usable (usually less than a minute) after purchase. Once usable, `usable` will change from `false` to `true`. - `usage` - indicates how much of the batch has been used as a value between `1` and `0`. - `usageText` - converts the `usage` value to a percentage value rounded to the nearest whole number which is then converted to text. - `size` - the amount of data in bytes which the batch can safely store. - `remainingSize` - the amount of date in bytes remaining from `size` which is still available to be used. - `duration` - an estimate of the remaining batch lifetime in seconds. For an explanation of the remaining values, refer to the "Advanced" section below. :::tip Note that although 1 GB was specified as input for the `bee.buyStorage`, the `size` value is ~4.93 GB. Refer to the [section about batch sizes](./buying-storage.md#batch-size-breakpoints) above to understand why. ::: ### Selecting a Batch Any method in `bee-js` which writes data to Swarm requires the batch id of a valid, usable postage batch with remaining space to upload data. The example script below exports a function which looks for the first usable postage batch with remaining space and returns the id of the batch. :::tip notice This function is used throughout the examples here in the docs. ::: ```javascript const bee = new Bee('http://localhost:1633') export async function getBatch(bee, criteriaFn) { const batches = await bee.getAllPostageBatch() const matchingBatch = batches.find(criteriaFn) if (!matchingBatch) { throw new Error('No postage batch matched the provided criteria.') } return matchingBatch.batchID.toString() } ``` To use it, save the script to a file called `getBatch.js` so we can import the it in our other scripts. ```javascript const bee = new Bee('http://localhost:1633') // Define the selection criteria as a named function function isUsableWithFreeSpace(batch) { return batch.usable && batch.remainingSize?.bytes > 0 } const batchId = getBatch(bee, isUsableWithFreeSpace) ``` If you need a batch with specific characteristics (such as a batch with at least 10 GB remaining space or a mutable batch), then you should [inspect](./buying-storage.md#checking-batch-status) your postage batches' status using `bee.getAllPostageBatch` in order to check if a batch with your desired characteristics exists and return its id. ### Batch Size Breakpoints Batches are bought in discrete size intervals as shown in the table below. As the effective volume increases, so does the discount percentage, which eventually converges to around 68% with larger volumes. *Costs are recorded at time of writing and are subject to change. Use the `bee.getStorageCost` method for current price.* | Breakpoint | Effective Volume | xBZZ / day / GB Cost | % Discount | |--------------------|------------------|------------------------|-------------| | 1 | 4.93 GB | 0.066 | 0% | | 2 | 17.03 GB | 0.038 | 42% | | 3 | 44.21 GB | 0.030 | 55% | | 4 | 102.78 GB | 0.025 | 62% | | 5 | 225.86 GB | 0.023 | 65% | | 6 | 480.43 GB | 0.022 | 67% | | 7 | 1.00 TB | 0.021 | 68% | | 8 | 2.06 TB | 0.021 | 68% | When purchasing a batch / estimating batch price, `bee-js` will round up to the nearest effective volume. For example, if the `bee.buyStorage` method is used to buy a batch with 1 GB as input, `bee-js` will round up to the first breakpoint and buy a batch with 4.93 GB effective volume. If 5 GB is used as input, then `bee-js` will round up to the second breakpoint of 17.03 GB since 5 GB is larger than the first breakpoint of 4.93 GB. Refer to the [Bee documentation](https://docs.ethswarm.org/docs/concepts/incentives/postage-stamps#effective-utilisation-table) for a more in-depth understanding of batch utilization. ### Utility Classes #### `Size` The `Size` class represents a storage size in **bytes**, with helper methods for creating and converting values. ##### Creating a Size instance The class includes two *static* methods for creating an instance of the `Size` class from either raw bytes or from gigabytes: - `Size.fromBytes` - `Size.fromGigabytes` ```javascript // Create a Size instance from raw bytes const sizeA = Size.fromBytes(5000000000) // Or from gigabytes const sizeB = Size.fromGigabytes(5) // β†’ 5 GB = 5,000,000,000 bytes ``` ##### Converting and formatting The class also includes three *instance* methods for getting the value from an existing `Size` instance as either raw bytes, gigabytes, or formatted text: - `size.toBytes` - `size.toGigabytes` - `size.toFormattedString` ```javascript // Using `sizeB` from the previous example sizeB.toBytes() // β†’ 5000000000 sizeB.toGigabytes() // β†’ 5 sizeB.toFormattedString() // β†’ '5.00 GB' ``` #### `Duration` The `Duration` class represents a length of time in **seconds**, with helper methods for creating and converting durations in various common time units. :::tip All of the helper methods for `Duration` take numbers as input except for `toEndDate` `fromEndDate` which both take a [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) object as input. ::: ##### Creating a Duration instance The class includes several *static* methods for creating a `Duration` instance from values like milliseconds, seconds, days, or even from dates: - `Duration.fromMilliseconds` - `Duration.fromSeconds` - `Duration.fromHours` - `Duration.fromDays` - `Duration.fromWeeks` - `Duration.fromYears` - `Duration.fromEndDate` ```javascript // Create a duration of 3 days const durationA = Duration.fromDays(3) // Create a duration from now until a future date const endDate = new Date('2025-04-01T12:00:00Z') const durationB = Duration.fromEndDate(endDate) ``` ##### Converting and formatting The class also includes several *instance* methods for converting a `Duration` instance into different time units or for getting a future date from a starting point: - `duration.toSeconds` - `duration.toHours` - `duration.toDays` - `duration.toWeeks` - `duration.toYears` - `duration.toEndDate` ```javascript // Using `durationA` from the previous example durationA.toSeconds() // β†’ 259200 durationA.toDays() // β†’ 3 durationA.toEndDate() // β†’ Date object 3 days from now // You can also specify a custom starting date const startDate = new Date('2025-01-01T00:00:00Z') durationA.toEndDate(startDate) // β†’ Date object 3 days after Jan 1 ``` This class is useful when: - Setting how long data should remain available in Swarm - Estimating or displaying expiration time for postage batches - Working with `bee.buyStorage`, `bee.getStorageCost`, or `bee.extendStorageDuration` --- ## Chequebook Management On Swarm, when downloading data from the network, nodes pay each other for forwarding data in the form of cheques. If you will be downloading a significant amount of data from the network, it is important that you fund your chequebook with BZZ so your node can issue and then pay for cheques. You can also fund your chequebook by running a full node and getting paid in BZZ for forwarding chunks to other nodes, however this may not be enough depending on your download volume. :::tip If using your node for downloads, it's recommended to actively monitor your node's chequebook balance and top it up once the balance begins to run low. ::: ### Requirements To use the example scripts below, you need: - An instance of `bee-js`'s `Bee` [initialized](./getting-started.md) using the API endpoint of a currently operating ***FULL*** Bee node. - Some BZZ to fund your chequebook. ### 1. Deposit to Chequebook from Node Wallet Deposits a specified amount of BZZ into the chequebook from your node wallet. This ensures that your node can issue cheques for transactions. ```javascript const amount = new BZZ.fromDecimalString('1') // Deposit 1 BZZ const transactionHash = await bee.depositTokens(amount) console.log('Deposit transaction hash:', transactionHash.toHex()) ``` ```bash Deposit transaction hash: 85362b9d3ed2ba520b12e4e6523546832064365621ece8b3881cd1dfd40365ec ``` ### 2. Get Chequebook Balance Retrieves the current balance of the chequebook. This helps you ensure that you have enough BZZ to continue issuing cheques. ```javascript const chequebookBalance = await bee.getChequebookBalance() console.log('Chequebook Balance:', chequebookBalance) ``` ```bash Chequebook Balance: { availableBalance: BZZ { state: FixedPointNumber { value: 10000000000000000n, scale: 16 } }, totalBalance: BZZ { state: FixedPointNumber { value: 10000000000000000n, scale: 16 } } } ``` ### 3. Withdraw from Chequebook to Node Wallet Withdraws a specified amount of BZZ from the chequebook to the node wallet. You may need to withdraw if you want to transfer BZZ to another account or for other uses. ```javascript const amountToWithdraw = new BZZ.fromDecimalString('1') // Withdraw 1 BZZ const withdrawalHash = await bee.withdrawTokens(amountToWithdraw) console.log('Withdraw transaction hash:', withdrawalHash.toHex()) ``` ```bash Withdraw transaction hash: 7674b1070406f60c317d26d5155521d674e5494db8f90cabbf46de0e22fc5556 ``` ### 4. Get Cheques Retrieves information about the last sent and received cheques from peers, either for all peers or for a specific peer. #### Get Last Cheques for All Peers This method retrieves the most recent cheques sent or received for all peers. Each entry includes details like the recipient, chequebook address, and payout amount. ```javascript const lastCheques = await bee.getLastCheques() console.log('Last Cheques for all peers:', lastCheques) ``` ```bash Last Cheques for all peers: { lastcheques: [ { peer: '10f68a7f7fe8b85e04ae0c869c02852f1b568b145c7f59179feef0601d9f1bf7', lastreceived: null, lastsent: { beneficiary: [EthAddress], chequebook: [EthAddress], payout: [BZZ] } }, ... ] } ``` #### Get Cheques for a Specific Peer Fetches the last cheques for a particular peer. This can help you track your cheques for specific interactions. ```javascript const peerAddress = '10f68a7f7fe8b85e04ae0c869c02852f1b568b145c7f59179feef0601d9f1bf7' const lastChequesForPeer = await bee.getLastChequesForPeer(peerAddress) console.log(`Last cheques for peer ${peerAddress}:`, lastChequesForPeer) ``` ```bash Last cheques for peer 10f68a7f7fe8b85e04ae0c869c02852f1b568b145c7f59179feef0601d9f1bf7: { peer: '10f68a7f7fe8b85e04ae0c869c02852f1b568b145c7f59179feef0601d9f1bf7', lastreceived: null, lastsent: { beneficiary: EthAddress { bytes: [Uint8Array], length: 20 }, chequebook: EthAddress { bytes: [Uint8Array], length: 20 }, payout: BZZ { state: [FixedPointNumber] } } } ``` ### 5. Cash-out Cheque Cash out a cheque for a specific peer. This method allows you to retrieve funds from a cheque that has been issued to you by a peer. #### Cashout the Last Cheque ```javascript const peerAddress = '10f68a7f7fe8b85e04ae0c869c02852f1b568b145c7f59179feef0601d9f1bf7' const transactionId = await bee.cashoutLastCheque(peerAddress) console.log('Cashout transaction ID:', transactionId) ``` ```bash Cashout transaction ID: dabb1d1b129d4c6317b96db23d9ca2d417aec9961f9a4d52f6b24e165b525eb8 ``` --- ## Getting Started ## About *bee-js* `bee-js` simplifies development on Swarm by abstracting away many of finer details and quirks of the Bee API so that you can focus on building your dream DAPP with minimal hassle. It's the easiest way to get started developing on Swarm. ## Installation ```sh npm install @ethersphere/bee-js --save ``` ```sh yarn add @ethersphere/bee-js --save ``` ```html ``` After that you need to import the Bee class and create a bee instance connecting to your Bee node (here we assume it runs on localhost on default port). Be aware, if you will pass invalid URL the constructor will throw an exception! ```js const bee = new Bee('http://localhost:1633') ``` That’s it! now you can use the `bee` object. :::info Run your own Bee node You can find out more about running Bee node in the [Bee docs](https://docs.ethswarm.org/docs/installation/quick-start) ::: :::tip Using ` ``` ::: ## Quickstart With *create-swarm-app* The `create-swarm-app` tool makes it easy to get started developing on Swarm. With a single command, it generates the basic scaffolding for a `bee-js` project in your chosen development environment (CommonJS, ESM, TypeScript, or Vite + TypeScript). :::note WSL WARNING The `create-swarm-app` tool is compatible with Windows, macOS, and Linux. However, using it in combination with [WSL](https://learn.microsoft.com/en-us/windows/wsl/) is discouraged due to potential compatibility issues that may require additional troubleshooting. That said, the `bee-js` library itself works seamlessly within WSL. If you prefer to develop your project using WSL, you can use `create-swarm-app` to generate the project files on the Windows side, then move them into your WSL environment for development. ::: You can use [`create-swarm-app`](https://www.npmjs.com/package/create-swarm-app) to quickly set up scaffolding for a `bee-js` project with the following command: ```bash npm init swarm-app@latest app-name app-type ``` Replace "app-name" with your app's name, and "app-type" with the type of app you want. Supported types are `node`, `node-esm`, `node-ts` and `vite-tsx`. Start a Swarm project using TypeScript: ```bash npm init swarm-app@latest my-dapp node-ts ``` Your project structure will look like: ```bash . β”œβ”€β”€ package.json β”œβ”€β”€ src β”‚Β Β  β”œβ”€β”€ config.ts β”‚Β Β  └── index.ts └── tsconfig.json ``` or using Vite and TypeScript: ```bash npm init swarm-app@latest my-dapp vite-tsx ``` Your project structure will look like: ```bash tree . . β”œβ”€β”€ index.html β”œβ”€β”€ package.json β”œβ”€β”€ src β”‚Β Β  β”œβ”€β”€ App.tsx β”‚Β Β  β”œβ”€β”€ config.ts β”‚Β Β  └── index.tsx └── tsconfig.json ``` The exact results will differ slightly depending on which `app-type` you use, but they will all include a `config.ts` or `config.js` file where the Bee node's API endpoint must be specified. The endpoint is set to the default Bee API endpoint of `http://localhost:1633`, if your node uses a different endpoint you will need to update it in the config file. --- ## GSOC The GSOC (Graffiti Several Owner Chunk) feature allows a **full node** to receive messages from many other nodes using a shared Single Owner Chunk (SOC). This enables real-time messaging over Swarm. ## Overview GSOC messages are updates to a pre-mined SOC that lands in the **neighborhood** of the recipient node. Only full nodes receive these updates because light nodes do not sync neighborhood chunks. However, **any node** (light or full) can send GSOC messages. ### GSOC vs PSS GSOC shares some similarities with PSS - both features allow for full nodes to receive messages from other nodes. However, there are several key differences: - Unlike PSS, **GSOC only needs to mine the target chunk once**β€”multiple messages reuse it, making it **faster, cheaper**, and **more efficient** for recurring updates. - Unlike PSS, **No encryption** is used by default, making it unsuitable for handling sensitive data. - Unlike PSS, **GSOC chunks are not meant to be retrieved directly**. The SOC used to initiate a GSOC connection is used to listen for incoming messages only, the chunk itself is not meant to be retrieved since the incoming messages are not actually used to update the SOC since double-signing an SOC is undefined behavior. ## Requirements To use the example scripts below, you need: - A Bee full node with a fully synced reserve for receiving GSOC messages. - A light node for sending GSOC messages. - The batch ID of a usable postage batch. If you don't have one already, you will need to [buy a batch](./buying-storage.md#purchasing-storage) to upload data. If you do have one, you will need to [get and save](./buying-storage.md#selecting-a-batch) its batch ID. ## Create an Identifier (Receiver and Sender) Identifiers in GSOC are similar to topics in PSS β€” they define the stream of messages a receiver node is subscribed to. The sender must use the same identifier so that their messages are received. Each identifier is a 32 byte (64-digit) hex string. It can be initialized with a 32 byte hex string of your choice or can be created from any arbitrary string using the `Identifier` utility class. You can also use the zero-initialized `NULL_IDENTIFIER` as a default identifier for cases where you don't need a unique identifier: ```js // Use default (all zeros): const identifier = NULL_IDENTIFIER // From a hex string: const identifier = new Identifier('6527217e549e84f98e51b1d8b1ead62ff5cad59acd9713825754555d6975f103') // From a human-readable string: const identifier = Identifier.fromString('chat:v1') ``` - Use `NULL_IDENTIFIER` is a 64 digit hex string of all zeros - use it for quick testing or when uniqueness doesn't matter. - Use any hex string to initialize a new `Identifier` object . - Use `Identifier.fromString()` to generate an identifier derived from your string of choice (allows for easy to remember human readable identifiers `"notifications"`, `"chat:user1"`). ## Get Target Overlay (Receiver Node) This step **is performed by the receiving full node** to retrieve its overlay address. This overlay address is then shared with the sender node to use as a target overlay for its GSOC messages: ```js const bee = new Bee('http://localhost:1633') async function checkAddresses() { const addresses = await bee.getNodeAddresses() console.log('Node Addresses:', addresses) } checkAddresses() ``` Example output: ```bash Node Addresses: Overlay: 1e2054bec3e681aeb0b365a1f9a574a03782176bd3ec0bcf810ebcaf551e4070 Ethereum: 9a73f283cd9211b96b5ec63f7a81a0ddc847cd93 Public Key: 7d0c4759f689ea3dd3eb79222870671c492cb99f3fade275bcbf0ea39cd0ef6e25edd43c99985983e49aa528f3f2b6711085354a31acb4e7b03559b02ec868f0 PSS Public Key: 5ade58d20be7e04ee8f875eabeebf9c53375a8fc73917683155c7c0b572f47ef790daa3328f48482663954d12f6e4739f748572c1e86bfa89af99f17e7dd4d33 Underlay: [ '/ip4/127.0.0.1/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j', '/ip4/172.17.0.2/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j', '/ip6/::1/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j' ] ``` The `Overlay` should be saved and shared with sender nodes. ## Set Up a Listener (Receiver Node) This must be run on a full node. It mines a key that lands within its own neighborhood and starts listening. ```js const bee = new Bee('http://localhost:1633') const identifier = Identifier.fromString(NULL_IDENTIFIER) async function listen() { const { overlay } = await bee.getNodeAddresses() // The signer is initialized using the receiving node's own overlay and chosen identifier const signer = bee.gsocMine(overlay, identifier) // A GSOC subscription is established using the blockchain address derived from the signer and the identifier bee.gsocSubscribe(signer.publicKey().address(), identifier, { // A callback function is used to handle incoming updates - you can include your application logic here onMessage: message => console.log('Received:', message.toUtf8()), onError: error => console.error('Subscription error:', error), }) console.log('Listening for GSOC updates...') } listen() ``` ## Send a Message (Sender Node) The sending node must have a ***usable postage batch id*** and also know the ***target overlay address*** and ***identifier*** in order to send a message: ```js const bee = new Bee('http://localhost:1643') // The identifier is initialized using the same data as the receiving node const identifier = Identifier.fromString(NULL_IDENTIFIER) const batchId = '6c84b6d3f5273b969c3df875cde7ccd9920f5580122929aedaf440bfe4484405' const recipientOverlay = '1e2054bec3e681aeb0b365a1f9a574a03782176bd3ec0bcf810ebcaf551e4070' async function sendMessage() { // The signer is initialized using the overlay address and identifier shared by the receiving node const signer = bee.gsocMine(recipientOverlay, identifier) // bee.gsocSend() is called with the batch id, initialized signer, identifier, and message payload in order to send a GSOC message await bee.gsocSend(batchId, signer, identifier, 'Hello via GSOC!') console.log('Message sent') } sendMessage() ``` For more information about GSOC, refer to the [Bee documentation](https://docs.ethswarm.org/docs/develop/tools-and-features/gsoc). --- ## Manifests ## 🚧 Under Construction 🚧 :::caution 🚧 This page is under construction This section is still being worked on. Check back soon for updates! ::: * Intro on what Manifests (a.k.a Mantaray nodes) are * Show an example of loading manifests Gist * Show an example of working with loaded manifests * Show creating a manifest from zero, working with it, saving --- ## SDK Overview This page serves as a complete reference to all publicly available classes, methods, types, and utilities provided by the `bee-js` SDK. After getting started, this is the place to explore everything you can do with `bee-js` and revisit whenever you need a reminder of how a function works or what a type represents. ### Type interfaces `NumberString` is a branded type for marking strings that represent numbers. It interops with `string` and `bigint` types. Where `NumberString` is present, `number` is disallowed in order to avoid pitfalls with unsafe large values. ### Byte primitives All the classes below extend `Bytes`, therefor the following methods are available on all of them: `toUint8Array`, `toHex`, `toBase64`, `toBase32`, `toUtf8`, `toJSON`, `static keccak256`, `static fromUtf8`. The `toString` method uses `toHex`. `Bytes` and its subclasses may be constructed with `new` from `Uint8Array` or hex `string`. #### Elliptic | Name | Description | Methods | | ---------- | ------------------------- | ------------------------------------------------------ | | PrivateKey | 32 bytes private key | `publicKey`, `sign` | | PublicKey | 64 bytes public key | `address`, `toCompressedUint8Array`, `toCompressedHex` | | EthAddress | 20 bytes Ethereum address | `toChecksum` | | Signature | 65 bytes signature | `recoverPublicKey` | #### Swarm | Name | Description | Methods | | ------------- | ----------------------------------- | ------------------------------- | | Reference | 32/64 bytes reference (chunk, feed) | `toCid` | | Identifier | 32 bytes identifier (SOC, Feed) | - | | TransactionId | 32 bytes transaction ID | - | | FeedIndex | 8 bytes feed index (BE) | `static fromBigInt`, `toBigInt` | | Topic | 32 bytes topic | `static fromString` | | PeerAddress | 32 bytes peer address | - | | BatchId | 32 bytes batch ID | - | | Span | 8 bytes span (LE) | `static fromBigInt`, `toBigInt` | ### Tokens | Name | Description | Methods | | ---- | --------------------------- | ------------------------------------------------------------------------------------------------ | | DAI | ERC20 DAI token (18 digits) | `static fromDecimalString`, `static fromWei`, `toWeiString`, `toWeiBigInt`, `toDecimalString` | | BZZ | ERC20 BZZ token (16 digits) | `static fromDecimalString`, `static fromPLUR`, `toPLURString`, `toPLURBigInt`, `toDecimalString` | ### Swarm chunks | Name | Description | Creation | | ---------------- | ----------------------------------------------------------------------------------------------- | --------------------------- | | Chunk | Span, max. 4096 bytes payload; address dervied from content | `makeContentAddressedChunk` | | SingleOwnerChunk | Identifier, signature, span, max. 4096 bytes payload; address derived from identifier and owner | `makeSingleOwnerChunk` | ### Swarm primitives | Name | Description | Methods | | ------------ | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | MantarayNode | Compact trie with reference values and JSON metadata | `addFork`, `removeFork`, `calculateSelfAddress`, `find`, `findClosest`, `collect`, `marshal`, `unmarshal`, `saveRecursively`, `loadRecursively` | | MerkleTree | Streaming BMT of chunks | `append`, `finalize`, `static root` | ### Swarm objects | Name | Description | Creation | | ---------- | ----------------------- | -------------------- | | SOCWriter | SingleOwnerChunk writer | `bee.makeSOCWriter` | | SOCReader | SingleOwnerChunk reader | `bee.makeSOCReader` | | FeedWriter | Feed writer | `bee.makeFeedWriter` | | FeedReader | Feed reader | `bee.makeFeedReader` | ### Bee API Each `bee-js` method corresponds to a particular endpoint from the API. The chart below maps each method to its corresponding API endpoint. Refer to the [Bee API specifications](https://docs.ethswarm.org/api/) for more details about each endpoint. It also specifies which [node type](https://docs.ethswarm.org/docs/bee/working-with-bee/node-types) is supported for each method/endpoint. - βŒβŒβœ… - Full node only - βŒβœ…βœ… - Light node and full node - βœ…βœ…βœ… - Ultra-light node, light node and full node | JS Call | Bee Endpoint | Bee Mode | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | | `uploadFile` | `POST /bzz` [πŸ”—](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | βŒβœ…βœ… | | `uploadFilesFromDirectory` _Node.js_ | `POST /bzz` [πŸ”—](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | βŒβœ…βœ… | | `uploadFiles` | `POST /bzz` [πŸ”—](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | βŒβœ…βœ… | | `uploadCollection` | `POST /bzz` [πŸ”—](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post) | βŒβœ…βœ… | | `uploadData` | `POST /bytes` [πŸ”—](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes/post) | βŒβœ…βœ… | | `uploadChunk` | `POST /chunks` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | βŒβœ…βœ… | | `streamDirectory` _Node.js_ | `POST /chunks` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | βŒβœ…βœ… | | `streamFiles` _Browser_ | `POST /chunks` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks/post) | βŒβœ…βœ… | | `SOCWriter.upload` | `POST /soc/:owner/:identifier` [πŸ”—](https://docs.ethswarm.org/api/#tag/Single-owner-chunk/paths/~1soc~1%7Bowner%7D~1%7Bid%7D/post) | βŒβœ…βœ… | | `FeedReader.download` | `GET /feeds/:owner/:topic` [πŸ”—](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1%7Bowner%7D~1%7Btopic%7D/get) | βœ…βœ…βœ… | | `FeedWriter.updateFeed` | `POST /soc/:owner/:identifier` [πŸ”—](https://docs.ethswarm.org/api/#tag/Single-owner-chunk/paths/~1soc~1%7Bowner%7D~1%7Bid%7D/post) | βŒβœ…βœ… | | `downloadFile` | `GET /bzz/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D/get) | βœ…βœ…βœ… | | `downloadFile` | `GET /bzz/:reference/:path` [πŸ”—](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D~1%7Bpath%7D/get) | βœ…βœ…βœ… | | `downloadReadableFile` | `GET /bzz/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz~1%7Breference%7D/get) | βœ…βœ…βœ… | | `downloadData` | `GET /bytes/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/get) | βœ…βœ…βœ… | | `downloadReadableData` | `GET /bytes/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Bytes/paths/~1bytes~1%7Breference%7D/get) | βœ…βœ…βœ… | | `downloadChunk` | `GET /chunks/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chunk/paths/~1chunks~1%7Baddress%7D/get) | βœ…βœ…βœ… | | `createFeedManifest` | `POST /feeds/:owner/:topic` [πŸ”—](https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1%7Bowner%7D~1%7Btopic%7D/post) | βŒβœ…βœ… | | `isConnected` | `GET /` | βœ…βœ…βœ… | | `getHealth` | `GET /health` [πŸ”—](https://docs.ethswarm.org/api/#tag/Status/paths/~1health/get) | βœ…βœ…βœ… | | `getReadiness` | `GET /readiness` [πŸ”—](https://docs.ethswarm.org/api/#tag/Status/paths/~1readiness/get) | βœ…βœ…βœ… | | `getNodeInfo` | `GET /node` [πŸ”—](https://docs.ethswarm.org/api/#tag/Status/paths/~1node/get) | βœ…βœ…βœ… | | `getChainState` | `GET /chainstate` [πŸ”—](https://docs.ethswarm.org/api/#tag/Status/paths/~1chainstate/get) | βŒβœ…βœ… | | `getRedistributionState` | `GET /redistributionstate` [πŸ”—](https://docs.ethswarm.org/api/#tag/RedistributionState/paths/~1redistributionstate/get) | βŒβŒβœ… | | `getReserveState` | `GET /reservestate` [πŸ”—](https://docs.ethswarm.org/api/#tag/Status/paths/~1reservestate/get) | βŒβŒβœ… | | `getStatus` | `GET /status` [πŸ”—](https://docs.ethswarm.org/api/#tag/Node-Status/paths/~1status/get) | βœ…βœ…βœ… | | `getWallet` | `GET /wallet` [πŸ”—](https://docs.ethswarm.org/api/#tag/Wallet/paths/~1wallet/get) | βŒβœ…βœ… | | `getTopology` | `GET /topology` [πŸ”—](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1topology/get) | βœ…βœ…βœ… | | `getAddresses` | `GET /addresses` [πŸ”—](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1addresses/get) | βœ…βœ…βœ… | | `getPeers` | `GET /peers` [πŸ”—](https://docs.ethswarm.org/api/#tag/Connectivity/paths/~1peers/get) | βœ…βœ…βœ… | | `getAllBalances` | `GET /balances` [πŸ”—](https://docs.ethswarm.org/api/#tag/Balance/paths/~1balances/get) | βŒβœ…βœ… | | `getPeerBalance` | `GET /balances/:peer` [πŸ”—](https://docs.ethswarm.org/api/#tag/Balance/paths/~1balances~1%7Baddress%7D/get) | βŒβœ…βœ… | | `getPastDueConsumptionBalances` | `GET /consumed` [πŸ”—](https://docs.ethswarm.org/api/#tag/Balance/paths/~1consumed/get) | βŒβœ…βœ… | | `getPastDueConsumptionPeerBalance` | `GET /consumed/:peer` [πŸ”—](https://docs.ethswarm.org/api/#tag/Balance/paths/~1consumed~1%7Baddress%7D/get) | βŒβœ…βœ… | | `getAllSettlements` | `GET /settlements` [πŸ”—](https://docs.ethswarm.org/api/#tag/Settlements/paths/~1settlements/get) | βŒβœ…βœ… | | `getSettlements` | `GET /settlements/:peer` [πŸ”—](https://docs.ethswarm.org/api/#tag/Settlements/paths/~1settlements~1%7Baddress%7D/get) | βŒβœ…βœ… | | `getChequebookAddress` | `GET /chequebook/address` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1address/get) | βŒβœ…βœ… | | `getChequebookBalance` | `GET /chequebook/balance` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1balance/get) | βŒβœ…βœ… | | `getLastCheques` | `GET /chequebook/cheque` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cheque/get) | βŒβœ…βœ… | | `getLastChequesForPeer` | `GET /chequebook/cheque/:peer` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cheque~1%7Bpeer-id%7D/get) | βŒβœ…βœ… | | `getLastCashoutAction` | `GET /chequebook/cashout/:peer` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cashout~1%7Bpeer-id%7D/get) | βŒβœ…βœ… | | `cashoutLastCheque` | `POST /chequebook/cashout/:peer` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1cashout~1%7Bpeer-id%7D/post) | βŒβœ…βœ… | | `depositTokens` | `POST /chequebook/deposit` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1deposit/post) | βŒβœ…βœ… | | `withdrawTokens` | `POST /chequebook/withdraw` [πŸ”—](https://docs.ethswarm.org/api/#tag/Chequebook/paths/~1chequebook~1withdraw/post) | βŒβœ…βœ… | | `getAllPendingTransactions` | `GET /transactions` [πŸ”—](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions/get) | βŒβœ…βœ… | | `getPendingTransaction` | `GET /transactions/:id` [πŸ”—](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/get) | βŒβœ…βœ… | | `rebroadcastTransaction` | `POST /transactions/:id` [πŸ”—](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/post) | βŒβœ…βœ… | | `cancelTransaction` | `DELETE /transactions/:id` [πŸ”—](https://docs.ethswarm.org/api/#tag/Transaction/paths/~1transactions~1%7BtxHash%7D/delete) | βŒβœ…βœ… | | `createTag` | `POST /tags` [πŸ”—](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/post) | βŒβœ…βœ… | | `retrieveTag` | `GET /tags/:id` [πŸ”—](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/get) | βŒβœ…βœ… | | `getAllTags` | `GET /tags` [πŸ”—](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags/get) | βŒβœ…βœ… | | `deleteTag` | `DELETE /tags/:id` [πŸ”—](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/delete) | βŒβœ…βœ… | | `updateTag` | `PATCH /tags/:id` [πŸ”—](https://docs.ethswarm.org/api/#tag/Tag/paths/~1tags~1%7Buid%7D/patch) | βŒβœ…βœ… | | `pin` | `POST /pins/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/post) | βœ…βœ…βœ… | | `getAllPins` | `GET /pins` [πŸ”—](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins/get) | βœ…βœ…βœ… | | `getPin` | `GET /pins/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/get) | βœ…βœ…βœ… | | `isReferenceRetrievable` | `GET /stewardship/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1%7Breference%7D/get) | βœ…βœ…βœ… | | `reuploadPinnedData` | `PUT /stewardship/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Stewardship/paths/~1stewardship~1%7Breference%7D/put) | βŒβœ…βœ… | | `unpin` | `DELETE /pins/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Pinning/paths/~1pins~1%7Breference%7D/delete) | βœ…βœ…βœ… | | `getGrantees` | `GET /grantee/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee~1%7Breference%7D/get) | βŒβœ…βœ… | | `createGrantees` | `POST /grantee` [πŸ”—](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee/post) | βŒβœ…βœ… | | `patchGrantees` | `PATCH /grantee/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/ACT/paths/~1grantee~1%7Breference%7D/patch) | βŒβœ…βœ… | | `pssSend` | `POST /pss/send/:topic/:target` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1send~1%7Btopic%7D~1%7Btargets%7D/post) | βŒβœ…βœ… | | `pssSubscribe` _Websocket_ | `GET /pss/subscribe/:topic` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1%7Btopic%7D/get) | βŒβŒβœ… | | `pssReceive` | `GET /pss/subscribe/:topic` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postal-Service-for-Swarm/paths/~1pss~1subscribe~1%7Btopic%7D/get) | βŒβŒβœ… | | `getAllPostageBatch` | `GET /stamps` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps/get) | βŒβœ…βœ… | | `getGlobalPostageBatches` | `GET /batches` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1batches/get) | βŒβœ…βœ… | | `getPostageBatch` | `GET /stamps/:batchId` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D/get) | βŒβœ…βœ… | | `getPostageBatchBuckets` | `GET /stamps/:batchId/buckets` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bbatch_id%7D~1buckets/get) | βŒβœ…βœ… | | `createPostageBatch` | `POST /stamps/:amount/:depth` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1%7Bamount%7D~1%7Bdepth%7D/post) | βŒβœ…βœ… | | `topUpBatch` | `PATCH /stamps/topup/:batchId/:amount` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1topup~1%7Bbatch_id%7D~1%7Bamount%7D/patch) | βŒβœ…βœ… | | `diluteBatch` | `PATCH /stamps/dilute/:batchId/:depth` [πŸ”—](https://docs.ethswarm.org/api/#tag/Postage-Stamps/paths/~1stamps~1dilute~1%7Bbatch_id%7D~1%7Bdepth%7D/patch) | βŒβœ…βœ… | | `createEnvelope` | `POST /envelope/:reference` [πŸ”—](https://docs.ethswarm.org/api/#tag/Envelope/paths/~1envelope~1%7Baddress%7D/post) | βŒβœ…βœ… | | `getStake` | `GET /stake` [πŸ”—](https://docs.ethswarm.org/api/#tag/Staking/paths/~1stake/get) | βŒβŒβœ… | | `depositStake` | `POST /stake` [πŸ”—](https://docs.ethswarm.org/api/#tag/Staking/paths/~1stake~1%7Bamount%7D/post) | βŒβŒβœ… | ### Utils #### General - `getCollectionSize` - `getFolderSize` #### PSS - `makeMaxTarget` #### Erasure Coding - `approximateOverheadForRedundancyLevel` - `getRedundancyStat` - `getRedundancyStats` #### Stamps - `getStampCost` - `getStampEffectiveBytes` - `getStampUsage` --- ## Pinning Pinning allows you to guarantee that content will always be available by storing it **locally on your own Bee node**. However, pinning ***does not*** guarantee availability across the Swarm network. Therefore you must use pinning along with the **stewardship utilities** included in `bee-js` to monitor the availability of your pinned content and reupload it if needed. In this section, you'll learn how to: - Pin content - Check whether pinned content is still retrievable from the network - Reupload missing content - View all currently pinned references - Remove pins that are no longer required ## Pinning and Unpinning Content To pin a reference (so it remains stored on your node): ```js await bee.pin(reference) console.log('Reference pinned locally.') ``` To stop tracking and remove it from local pin storage: ```js await bee.unpin(reference) console.log('Reference unpinned and no longer tracked.') ``` ## Checking if a Reference is Retrievable Use `isReferenceRetrievable(reference)` to verify if the content for a given Swarm reference is currently accessible on the network: ```js const isAvailable = await bee.isReferenceRetrievable(reference) if (isAvailable) { console.log('Data is retrievable from the network.') } else { console.log('Data is missing from the network.') } ``` ## Reuploading Pinned Data If content is missing but was previously pinned, you can reupload it using `reuploadPinnedData(postageBatchId, reference)`: ```js await bee.reuploadPinnedData(postageBatchId, reference) console.log('Data has been reuploaded to the network.') ``` ## Listing All Pinned References You can get all currently pinned references with: ```js const pins = await bee.getAllPins() console.log('Pinned references:', pins.map(ref => ref.toHex())) ``` To check if a specific reference is pinned: ```js const pinStatus = await bee.getPin(reference) console.log('Pin info:', pinStatus) ``` ## Example Script The following script automates the process of checking all locally pinned references, verifying their retrievability from the network, and reuploading any that are missing. This ensures that your pinned data remains available even if it has dropped out of the Swarm network. ```js const bee = new Bee('http://localhost:1633') const postageBatchId = "129903062bedc4eca6fc1c232ed385e93dda72f711caa1ead6018334dd801cee" async function reuploadMissingPins() { try { // Get all currently pinned references const pinnedRefs = await bee.getAllPins() if (!pinnedRefs.length) { console.log("No pinned references found.") return } console.log(`Found ${pinnedRefs.length} pinned references.`) let repaired = 0 // Loop through all references and check retrievability for (const ref of pinnedRefs) { const reference = ref.toHex() const isAvailable = await bee.isReferenceRetrievable(reference) if (isAvailable) { console.log(`βœ… ${reference} is retrievable.`) } else { console.log(`⚠️ ${reference} is missing β€” reuploading...`) await bee.reuploadPinnedData(postageBatchId, reference) console.log(`πŸ” Reuploaded ${reference}`) repaired++ } } console.log(`\nDone. ${repaired} reference(s) were reuploaded.`) } catch (error) { console.error("Error:", error.message) } } reuploadMissingPins() ``` Example terminal output: ```bash Found 2 pinned references. ⚠️ 1880ff0bbd23997dfa46921ba2ab0098824d967fe60c6ca1ae2e8fd722f4db78 is missing β€” reuploading... πŸ” Reuploaded 1880ff0bbd23997dfa46921ba2ab0098824d967fe60c6ca1ae2e8fd722f4db78 βœ… fd79d5e0ebd8407e422f53ce1d7c4c41ebf403be55143900f8d1490560294780 is retrievable. Done. 1 reference(s) were reuploaded. ``` --- ## Postal Service over Swarm Swarm supports sending encrypted messages over the network using a system called **Postal Service over Swarm** (PSS). These messages are embedded in regular Swarm traffic and routed to specific nodes based on their overlay address. ## What Is PSS? PSS provides a pub/sub-like functionality for secure messaging. Full nodes can listen for messages on a specific **topic**, and other nodes (light or full) can send them payloads using the recipient node's **overlay address** and optionally encrypted using the recipient's **PSS public key**. Messages can be received via **subscription** or by a **one-off listener**. :::caution Only full nodes can receive messages since PSS messages are sent as a part of the chunk syncing process which only full nodes take part in. ::: ## Requirements To use the example scripts below, you need: - A Bee full node with a fully synced reserve for receiving PSS messages. - A light node for sending PSS messages. - The batch ID of a usable postage batch. If you don't have one already, you will need to [buy a batch](./buying-storage.md#purchasing-storage) to upload data. If you do have one, you will need to [get and save](./buying-storage.md#selecting-a-batch) its batch ID. ## Get Recipient Info (Full Node Only) This step **must be performed by the receiving full node**. It retrieves the node’s **overlay address** and **PSS public key**, which must then be shared with the sending node: - The **overlay address** is **required** as the routing target. - The **PSS public key** is **optional** and only needed for encryption. ```js const bee = new Bee('http://localhost:1633') async function checkAddresses() { const addresses = await bee.getNodeAddresses() console.log('Node Addresses:', addresses) } checkAddresses() ``` Example output: ```bash Node Addresses: Overlay: 1e2054bec3e681aeb0b365a1f9a574a03782176bd3ec0bcf810ebcaf551e4070 Ethereum: 9a73f283cd9211b96b5ec63f7a81a0ddc847cd93 Public Key: 7d0c4759f689ea3dd3eb79222870671c492cb99f3fade275bcbf0ea39cd0ef6e25edd43c99985983e49aa528f3f2b6711085354a31acb4e7b03559b02ec868f0 PSS Public Key: 5ade58d20be7e04ee8f875eabeebf9c53375a8fc73917683155c7c0b572f47ef790daa3328f48482663954d12f6e4739f748572c1e86bfa89af99f17e7dd4d33 Underlay: [ '/ip4/127.0.0.1/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j', '/ip4/172.17.0.2/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j', '/ip6/::1/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j' ] ``` The `Overlay` and `PSS Public Key` values should be shared with the sending node. The sender (which can be a light node or a full node) needs the **overlay address** to generate the message target, and can optionally use the **PSS public key** to encrypt the message. ## Listen for Messages (Full Node) You can listen on a topic using both **continuous subscription** and **one-time receive**: - `bee.pssSubscribe()` is used to set up a continuous subscription. - `bee.pssReceive()` is used to set up a listener on a timeout which closes after receiving a message. ```js const bee = new Bee('http://localhost:1633') // Generate a topic from a unique string const topic = Topic.fromString('pss-demo') console.log('Subscribing to topic:', topic.toHex()) // Continuous subscription bee.pssSubscribe(topic, { onMessage: msg => console.log('Received via subscription:', msg.toUtf8()), onError: err => console.error('Subscription error:', err.message), }) // One-time receive (3 hour timeout) async function receiveOnce() { try { console.log('Waiting for one-time message...') const message = await bee.pssReceive(topic, 1000 * 60 * 60 * 3) console.log('One-time received:', message.toUtf8()) } catch (err) { console.error('pssReceive error or timeout:', err.message) } } receiveOnce() ``` In this script we generate a `topic` from our chosen string with the `Topic.fromString()` method. Then we subscribe to listen for incoming pss messages for that topic with the `bee.pssSubscribe()` method, and we also set up a listener for receiving a single message with the `bee.pssReceive()` method. When a chunk with a PSS message for that topic is synced into our node's neighborhood, it will be received and handled by our node with the `onMessage` callback function when using the `bee.pssSubscribe()` or through the return value of the `bee.pssReceive()` method in our `receiveOnce` function. ## Send Message (Light or Full Node) The sender must provide: - A valid **postage batch ID** - The recipient’s **overlay address** (used to generate the routing target) - Optionally the **PSS public key** for encryption ```js const bee = new Bee('http://localhost:1643') const BATCH_ID = '6d8118c693423eef41796d58edbbffb76881806a0f44da728bf80f0c1aafa783' // The overlay address of the receiving node const recipientOverlay = '1e2054bec3e681aeb0b365a1f9a574a03782176bd3ec0bcf810ebcaf551e4070' // Generate a topic using the same string shared by the receiving node const topic = Topic.fromString('pss-demo') // Set the number of leading prefix bits to mine for the chunk bearing the PSS message const target = Utils.makeMaxTarget(recipientOverlay) // The PSS message payload const message = 'Hello from the light node!' async function send() { try { await bee.pssSend(BATCH_ID, topic, target, message) console.log('Message sent via PSS.') } catch (err) { console.error('Failed to send message:', err.message) } } send() ``` ## Encrypt with PSS Public Key To encrypt the message specifically for the recipient, include their **PSS public key** in the send call: ```js const recipientPssPublicKey = '5ade58d20be7e04ee8f875eabeebf9c53375a8fc73917683155c7c0b572f47ef790daa3328f48482663954d12f6e4739f748572c1e86bfa89af99f17e7dd4d33' await bee.pssSend(BATCH_ID, topic, target, message, recipientPssPublicKey) ``` The message will then be encrypted using the PSS public key of the recipient node before sending and will only be decryptable by the recipient node (although the message bearing the PSS chunk will be received by all nodes in the same neighborhood as the recipient, it will only be decryptable by the recipient node). --- ## SOC and Feeds Swarm provides the ability to store content in content-addressed [chunks](https://docs.ethswarm.org/docs/concepts/DISC/#content-addressed-chunks-and-single-owner-chunks) (CAC) whose addresses are derived from the chunk data, or Single Owner Chunks (SOC) whose addresses are derived from the uploader's address and chosen identifier. With single owner chunks, a user can assign arbitrary data to an address and attest chunk integrity with their digital signature. Feeds are a unique feature of Swarm which simulate the publishing of mutable content on Swarm's immutable storage. ***Feeds constitute the primary use case for SOCs.*** Developers can use Feeds to version revisions of a mutable resource by indexing sequential updates to a topic at predictably calculated addresses. Because Feeds are built on top of SOCs, their interfaces are somewhat similar and use common concepts. ## Requirements Interactions with SOC and feeds require the following: * A fully initialized Bee light node running with fully synced postage batch data (running at `http://localhost:1633` by default). * A valid postage batch ID. * A dedicated Ethereum-compatible publisher private key to sign updates. Do **not** use the private key of your Bee node or any wallet that holds funds. :::tip You can use the `PrivateKey` class to generate a dedicated publisher key for signing SOC and feed updates: ```js const crypto = require('crypto'); const { PrivateKey } = require('@ethersphere/bee-js'); // Generate 32 random bytes and construct a private key const hexKey = '0x' + crypto.randomBytes(32).toString('hex'); const privateKey = new PrivateKey(hexKey); console.log('Private key:', privateKey.toHex()); console.log('Public address:', privateKey.publicKey().address().toHex()); ```` Example output: ```bash Private key: 634fb5a872396d9693e5c9f9d7233cfa93f395c093371017ff44aa9ae6564cdd Public address: 8d3766440f0d7b949a5e32995d09619a7f86e632 ``` Store this key securely. Anyone with access to it can publish to your feed or SOC. *It is recommended to use a separate publishing key for each feed or SOC. This limits the damage if a key is ever exposed β€” a compromised key should only allow publishing to one resource, not all of them.* ::: ## Single Owner Chunks Bee-js calculates a SOC Swarm reference hash as the keccak256 hash of the concatenation of the `identifier` and `owner` Ethereum address. The `identifier` is a 32 byte long arbitrary value (by default a hex string or a `Uint8Array`). The `owner` is an Ethereum address that consists of 20 bytes in a format of a hex string or `Uint8Array`. :::info SOCs are powerful and flexible low-level feature which provide the foundation upon which higher level abstractions such as [GSOC](./gsoc.md) and [feeds](./soc-and-feeds.md#feeds) are built. For most common use cases developers are recommended to use these higher level abstractions rather than interacting directly with SOCs themselves. ::: :::warning SOCs are immutable! You might be tempted to modify a SOC's content to "update" the chunk. Reuploading of an SOC is discouraged as its behavior is undefined. Either use a different `identifier`, or you might be looking for feeds if you need to perform multiple updates to the same content. ::: ### Uploading SOCs To write a Single Owner Chunk (SOC), use the `makeSOCWriter()` method from the Bee client. This method requires a signer, which can be an instance of `PrivateKey`, a raw Ethereum private key as a hex string (with or without the `0x` prefix), or a `Uint8Array` representing the private key. The signer is used to cryptographically sign the chunk, using the same format Ethereum uses for signing transactions. Once the `SOCWriter` is created, you can upload an SOC by providing a `postageBatchId`, a 32-byte `identifier`, and the `data` payload. :::info Default `signer` When you are instantiating `Bee` class you can pass an Ethereum private key as the default signer that will be used if you won't specify it directly for the `makeSOCWriter`. ::: :::warning Your assets and/or privacy may be at risk We recommend using dedicated publisher private keys when writing to SOCs or Feeds. Never use the private keys of your node or a wallet that holds funds, as this may allow others to sign messages on your behalf, compromise your privacy, or lead to the loss of assets. Store your publisher keys securely, as anyone with access to them can publish updates to your feed. ::: ```js // Define your Ethereum private key (don't use your node's or real wallet's private keys) const privateKey = new PrivateKey('0x634fb5a872396d9693e5c9f9d7233cfa93f395c093371017ff44aa9ae6564cdd') // Print the identifier and address which can be used to retrieve the SOC console.log("SOC identifier") console.log(new Bytes(NULL_IDENTIFIER).toHex()) // Print Ethereum address console.log("Ethereum address") console.log(privateKey.publicKey().address().toHex()) // Initialize Bee client with default signer and Swarm node URL const bee = new Bee('http://localhost:1643', { signer: privateKey }) // Replace with your own valid postage batch ID here const postageBatchId = 'f2949db4cfa4f5140ed3ef29f651d189175a8cb9534c992d3c3212b17f0b67f7' // Create the SOC writer const socWriter = bee.makeSOCWriter(privateKey) // The data you want to store in the SOC const data = 'this is my sample data' async function uploadSOC() { try { // Upload the data to the SOC using the postage batch and identifier const response = await socWriter.upload(postageBatchId, NULL_IDENTIFIER, data) // Log the human-readable reference (hex string) console.log("SOC reference:") console.log("Reference (Hex):", response.reference.toHex()) } catch (error) { // Handle any errors during the upload console.error("Error uploading SOC:", error) } } // Call the function to write the SOC uploadSOC() ``` Example output: ```bash SOC identifier 0000000000000000000000000000000000000000000000000000000000000000 Ethereum address 8d3766440f0d7b949a5e32995d09619a7f86e632 SOC reference: Reference (Hex): 9d453ebb73b2fedaaf44ceddcf7a0aa37f3e3d6453fea5841c31f0ea6d61dc85 ``` In this example: - `privateKey` (initialized using our [previously generated](#requirements) publisher key) is used to initialize the writer as `socWriter` which is used to sign the SOC. - `NULL_IDENTIFIER` is the 32-byte value used as the identifier (can be replaced with any user-defined value). - `socWriter.upload()` signs and uploads the data, returning a `reference` as confirmation. The `identifier` and Ethereum address together determine the SOC address and must match exactly when retrieving the chunk later. The returned `reference` is included as part of the upload response, but unlike non-SOC uploads, the returned reference is not used to retrieve the chunk, rather the `identifier` and Ethereum address are used (see next section for example usage). ### Retrieving SOCs To retrieve a previously uploaded SOC, you must know the Ethereum address of the owner (the signer used to upload the SOC) and the exact 32-byte `identifier` used during upload. These two values uniquely determine the SOC address in Swarm. To download a SOC in bee-js, use the `makeSOCReader()` method. This method takes the owner's Ethereum address (as a `EthAddress` instance, a hex string, or a `Uint8Array`) and returns a `SOCReader` object. You can then call `.download(identifier)` on the reader to retrieve the chunk's data. :::info SOC address is derived from the identifier and owner Unlike uploads using content addressed chunks which are retrieved by their Swarm reference hash, SOCs are retrieved using the combination of `identifier` and `owner`, not their Swarm reference hash. ::: ```js // Initialize Bee client pointing to the Swarm node const bee = new Bee('http://localhost:1633') // The owner's Ethereum address (20 bytes) const owner = '8d3766440f0d7b949a5e32995d09619a7f86e632' // Create a SOC reader object bound to the owner const socReader = bee.makeSOCReader(owner) async function readSOC() { try { // Download the SOC using the identifier const response = await socReader.download(NULL_IDENTIFIER) // Log the data console.log("SOC Data:", response.payload.toUtf8()) // Optionally, you can use the data in other ways (e.g., process, display, etc.) } catch (error) { // Handle any errors during download console.error("Error downloading SOC:", error) } } // Call the function to read the SOC readSOC() ``` In this example: - The `owner` is the Ethereum address used to retrieve the SOC (derived from the private key [previously generated](#requirements)). - `NULL_IDENTIFIER` is the same default identifier used in the earlier upload example. - The returned payload is a `Bytes` object, and `.toUtf8()` converts it to a human-readable string. Make sure the `owner` and `identifier` values match exactly what was used during upload β€” any mismatch will result in the chunk not being found. ## Feeds Feeds are an abstraction built on top of Single Owner Chunks (SOCs) that **simulate mutable content** in Swarm. They enable sequenced updates over time while maintaining a stable access point. Feeds are ideal for dynamic content like apps, messages, or websites. Each update is stored in a new immutable chunk at a deterministically calculated address. > Although feeds appear "mutable," no data is ever modifiedβ€”new updates are simply written to new indexes. Similar to how an SOC is defined by an `owner` and `identifier`, a feed is defined by: * `owner`: an Ethereum-compatible address * `topic`: a unique 32-byte identifier ### Concepts * **Feed Writing**: Publishers sign and write updates associated with specific topics to specific indices using their private key. * **Append-Only Behavior and Index Resolution**: Feeds are typically used in an append-only fashion, though skipping indices is possible. However, the latest update is resolved as the highest *consecutive* index. Updates at non-consecutively written indices must be retrieved explicitly. * **No Overwriting**: Each index can be written only once. Updates are permanent. * **Feed Reading**: Readers resolve updates using the `owner` and `topic`. By default, if no index is specified they fetch the latest consecutively written index. * **Payloads**: Feed payloads include strings, JSON, or Swarm references. Payload size is limited to a single 4β€―KB chunk. ### Creating and Updating Feeds Using Topics This script demonstrates how to create two distinct feeds using different topics and update them using two methods: `uploadPayload()` and `upload()`. * **`upload()`**: Used for uploading references to other content on Swarm. * **`uploadPayload()`**: Directly stores an arbitrary data payload in the feed. Although it is possible to update feeds with an arbitrary data payload using `uploadPayload()`, for most use cases the content should be uploaded separately (such as with `bee.uploadFile()`), and the feed will be updated with the reference of that upload using the `upload()` method. The script below performs the following steps: 1. Initializes the Bee client and derives the feed owner address from a private key (which we have [previously generated](#requirements)). 2. Uses the `uploadPayload()` method to upload a plain text string as a **payload update** to the feed with topic `"payload-update"`. 3. Uploads the same string as a file to Swarm and obtains a reference. 4. Uses the `upload()` method to upload the obtained reference as a **reference update** to the feed with topic `"reference-update"`. ```js const BEE_URL = 'http://localhost:1643' // Make sure to replace with a valid batch ID const POSTAGE_BATCH_ID = 'c119705f257c0015a062b17929e3ca3269e158231324707f2ea6e72c5c9f9b78' // Any Ethereum style private key can be used, ideally dedicated to this feed only. Using your node or wallet's key is strongly discouraged. const privateKey = new PrivateKey('0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef') const bee = new Bee(BEE_URL) const owner = privateKey.publicKey().address() // This owner address can be shared along with the topic to enable anyone to retrieve updates from the feed console.log('Feed owner address:') console.log(owner.toHex()) async function run() { const message = 'This is a test announcement.' const topic1 = Topic.fromString('payload-update') // The writer is constructed from the topic and private key, and can be used for writing feed updates (it also supports reading from feeds) const writer1 = bee.makeFeedWriter(topic1, privateKey) await writer1.uploadPayload(POSTAGE_BATCH_ID, message) console.log('βœ… First feed updated with payload.') const result = await bee.uploadFile(POSTAGE_BATCH_ID, message, 'announcement.txt') console.log(result) console.log(result.reference.toHex()) // The second writer is constructed using a new topic and the same private key const topic2 = Topic.fromString('reference-update') const writer2 = bee.makeFeedWriter(topic2, privateKey) await writer2.upload(POSTAGE_BATCH_ID, result.reference) console.log('βœ… Second feed updated with reference.') } run().catch(console.error) ``` ### Retrieving from Feeds by Topic and Owner This script demonstrates how to retrieve data from feeds using their `topic` and `owner`. There are two primary methods used for reading from feeds: * **`downloadPayload()`** – Used to read the raw payload written directly to the feed. * **`downloadReference()`** – Used to read a Swarm reference from the feed. The returned reference can then be passed to `downloadFile()` to retrieve the associated file. The script performs the following steps: 1. Initializes the Bee client and derives the feed owner address from a private key. 2. Reads the latest **payload update** from the feed with topic `"payload-update"` using `downloadPayload()`. 3. Reads the latest **reference update** from the feed with topic `"reference-update"` using `downloadReference()`, then retrieves the associated file from Swarm using `downloadFile()`. Feed readers always require a topic and an owner address. By default, they fetch the latest *consecutively written* update. To retrieve a specific update, an explicit index can be provided. :::warning While not explicitly enforced, it is strongly recommended to use feeds in an append-only fashion. If instead non-consecutive updates are performed, the only way to discover updates at higher non-consecutively written indexes is to iterate one by one through all indexes up to the number of the index with the update. ::: ```js const BEE_URL = 'http://localhost:1643' async function run() { const bee = new Bee(BEE_URL) const privateKey = new PrivateKey('0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef') const owner = privateKey.publicKey().address() // Read from payload-update feed const topic1 = Topic.fromString('payload-update') const reader1 = bee.makeFeedReader(topic1, owner) console.log('\n Reading latest update for feed: "payload-update"') try { const latest = await reader1.downloadPayload() const text = latest.payload.toUtf8() console.log('Message (as plain text):', text) console.log('Feed index:', BigInt(`0x${Buffer.from(latest.feedIndex.bytes).toString('hex')}`)) console.log('Next index:', BigInt(`0x${Buffer.from(latest.feedIndexNext.bytes).toString('hex')}`)) } catch (error) { console.warn('❌ Failed to read update:', error.message) } // Read from reference-update feed const topic2 = Topic.fromString('reference-update') const reader2 = bee.makeFeedReader(topic2, owner) console.log('\n Reading latest update for feed: "reference-update"') try { const latest = await reader2.downloadReference() const referenceHex = latest.reference.toHex() console.log('Swarm reference (hex):', referenceHex) const file = await bee.downloadFile(referenceHex) console.log('Retrieved file content:', file.data.toUtf8()) console.log('Feed index:', BigInt(`0x${Buffer.from(latest.feedIndex.bytes).toString('hex')}`)) console.log('Next index:', BigInt(`0x${Buffer.from(latest.feedIndexNext.bytes).toString('hex')}`)) } catch (error) { console.warn('❌ Failed to read update:', error.message) } } run().catch(console.error) ``` ### Using Feed Manifests for Fixed References Feed manifests allow you to expose a feed through a **stable Swarm reference** that always resolves to the latest update. This is especially useful for hosting evolving content like websites or files, without needing to share a new Swarm reference each time content changes. With a manifest, you can: * Retrieve the **latest feed update** through a static `/bzz//` URL. * Share a single reference that always resolves to the **current content**. * Enable compatibility with public gateways and ENS domains. The script below performs the following steps: 1. Initializes the Bee client and creates a feed manifest using a topic and owner. 2. Checks the current feed index or starts from index 0. 3. Uploads two updates to Swarm and stores their references in the feed at consecutive indices. 4. After each update, retrieves the content using the same manifest reference, confirming it resolves to the latest. ```js const BEE_URL = 'http://localhost:1643' const POSTAGE_BATCH_ID = 'c119705f257c0015a062b17929e3ca3269e158231324707f2ea6e72c5c9f9b78' const bee = new Bee(BEE_URL) const privateKey = new PrivateKey('0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef') const owner = privateKey.publicKey().address() console.log('Feed owner:', owner.toHex()) const topic = Topic.fromString('uploaded-reference-demo') const manifestReference = await bee.createFeedManifest(POSTAGE_BATCH_ID, topic, owner) console.log('\n Manifest created:') console.log('Ref:', manifestReference.toString()) console.log('URL:', `${BEE_URL}/bzz/${manifestReference.toString()}/`) const reader = bee.makeFeedReader(topic, owner) let index try { const latest = await reader.download() index = latest.feedIndexNext const latestIndex = BigInt(`0x${Buffer.from(latest.feedIndex.bytes).toString('hex')}`) console.log(`\n Latest index: ${latestIndex}`) } catch { index = FeedIndex.fromBigInt(0n) console.log('\n No updates yet. Starting at index 0') } for (let i = 0; i < 2; i++) { const content = `Update ${BigInt(`0x${Buffer.from(index.bytes).toString('hex')}`)}` const upload = await bee.uploadFile(POSTAGE_BATCH_ID, content, `update-${i}.txt`) const writer = bee.makeFeedWriter(topic, privateKey) await writer.upload(POSTAGE_BATCH_ID, upload.reference, { index }) console.log(`\nβœ… Updated to index ${BigInt(`0x${Buffer.from(index.bytes).toString('hex')}`)}: "${content}"`) const result = await bee.downloadFile(manifestReference) console.log(` Retrieved via manifest: "${result.data.toUtf8()}"`) console.log(`URL: ${BEE_URL}/bzz/${manifestReference.toString()}/`) index = index.next() } ``` ### Non-Sequential Feed Updates (Discouraged) Although feeds are typically updated in a sequential, append-only manner, it is possible to manually write to a specific index using the `index` option. However, only the **highest consecutively filled index** is considered the latest. Any gaps will result in newer updates at higher indices being ignored when resolving the latest feed content. For example: ```js await writer.uploadPayload(POSTAGE_BATCH_ID, 'Initial update') // Goes to index 0 await writer.uploadPayload(POSTAGE_BATCH_ID, 'Out-of-order update', { index: 5 }) ``` Now, attempting to read the latest update without specifying an index will still return the update at index 0: ```js const latest = await reader.downloadPayload() console.log(latest.payload.toUtf8()) // β†’ "Initial update" ``` To read the out-of-order update at index 5, you must explicitly specify it: ```js const manual = await reader.downloadPayload({ index: 5 }) console.log(manual.payload.toUtf8()) // β†’ "Out-of-order update" ``` :::caution Manually writing to skipped indices is supported but not recommended. It is recommended to use the default behavior when performing feed updates (no `index` specified) to maintain a clean, append-only feed history and ensure new updates are easily discoverable. ::: --- ## Staking Operating a Bee full node and staking BZZ makes you eligible to participate in the redistribution game β€” a mechanism for earning additional BZZ through by sharing disk space with the Swarm network. This guide shows how to use `bee-js` to deposit stake and check your node's staking status. :::danger ⚠️ **Important:** Staked BZZ is **non-refundable** β€” once deposited, it **cannot be withdrawn**. ::: :::info Currently, `bee-js` supports depositing stake and checking staking status, but does **not yet support** advanced features like [partial stake withdrawals](https://docs.ethswarm.org/docs/bee/working-with-bee/staking#partial-stake-withdrawals) or [reserve doubling](https://docs.ethswarm.org/docs/bee/working-with-bee/staking#reserve-doubling). For a complete guide to the requirements and configuration for staking, refer to the [Bee documentation](https://docs.ethswarm.org/docs/bee/working-with-bee/staking). ::: ## Stake BZZ To stake, use the `depositStake` method provided by `bee-js`. It accepts a value in PLUR, the smallest unit of BZZ (like wei in Ethereum). The `BZZ` utility class simplifies conversion from decimal string to PLUR. ```js const bee = new Bee('http://localhost:1633') async function main() { // Convert 10 BZZ to PLUR const amount = BZZ.fromDecimalString('10') const txHash = await bee.depositStake(amount) console.log('Stake deposited. Transaction hash:', txHash.toHex()) } main().catch(console.error) ``` Example output: ```bash Stake deposited. Transaction hash: e1b86eebc54b465d84ab278da94a387e9786076557ab8f3fe04ba1b52dc065c8 ``` A successful staking transaction will return the transaction hash which you can look up on a blockchain explorer like [Gnosisscan](https://gnosisscan.io/tx/0xe1b86eebc54b465d84ab278da94a387e9786076557ab8f3fe04ba1b52dc065c8). ## Check Staking Status After staking, you can confirm the deposited amount and monitor your node’s participation in the redistribution game: ```js const bee = new Bee('http://localhost:1633') async function main() { const stake = await bee.getStake() const redistributionState = await bee.getRedistributionState() console.log('Current staked amount:', stake.toDecimalString(), 'BZZ') console.log('\nRedistribution State:') console.log(JSON.stringify(redistributionState, null, 2)) } main().catch(console.error) ``` Example output: ```bash Current staked amount: 10.0000000000000001 BZZ Redistribution State: { "minimumGasFunds": { "state": "274506772500000" }, "hasSufficientFunds": true, "isFrozen": false, "isFullySynced": true, "phase": "claim", "round": 261311, "lastWonRound": 0, "lastPlayedRound": 0, "lastFrozenRound": 0, "lastSelectedRound": 0, "lastSampleDurationSeconds": 0, "block": 39719372, "reward": { "state": "0" }, "fees": { "state": "0" }, "isHealthy": true } ``` For details on interpreting these values, refer to the [staking status section](https://docs.ethswarm.org/docs/bee/working-with-bee/staking#check-status) of the Bee documentation. --- ## Checking Node Status To understand and monitor the status of your Bee node, `bee-js` provides a set of helpful methods. In this guide, we'll walk through how to retrieve and log the data needed to give a complete overview of your node's current status. ### Requirements To use the example scripts below, you need: - An instance of the `Bee` class from `bee-js` [initialized](./getting-started.md) using the API endpoint of a currently operating Bee node. ### 1. Node Health and Readiness Use this to access the health and readiness endpoint return values used for container orchestration tools like Kubernetes. ```js const bee = new Bee('http://localhost:1633') async function checkHealthAndReadiness() { const health = await bee.getHealth() const readiness = await bee.getReadiness() console.log('Health:', health) console.log('Readiness:', readiness) } checkHealthAndReadiness() ``` Output: ```bash Health: { apiVersion: '7.3.0', version: '2.5.0-5ec231ba', status: 'ok' } Readiness: { apiVersion: '7.3.0', version: '2.5.0-5ec231ba', status: 'ready' } ``` ### 2. Get Node Topology Use this to inspect how many peers you're connected to, and the state of your neighborhood. ```js const bee = new Bee('http://localhost:1633') async function checkTopology() { const topology = await bee.getTopology() console.log('Topology:', topology) } checkTopology() ``` Output: *(Bins 1 - 30 omitted from `bins` result)* ```bash Topology: { baseAddr: '1e2054bec3e681aeb0b365a1f9a574a03782176bd3ec0bcf810ebcaf551e4070', population: 5619, connected: 135, timestamp: '2025-03-26T07:54:05.921263981Z', nnLowWatermark: 3, depth: 10, reachability: 'Public', networkAvailability: 'Available', bins: { bin_0: { population: 2714, connected: 16, connectedPeers: [Array], disconnectedPeers: [Array] }, ... bin_31: { population: 0, connected: 0, connectedPeers: [], disconnectedPeers: [] } } } ``` ### 3. Get Node Addresses This will give you the overlay address, underlay addresses, and Ethereum address associated with your Bee node (the address is an Ethereum style address however it is for a Gnosis Chain account, not mainnet Ethereum). ```js const bee = new Bee('http://localhost:1633') async function checkAddresses() { const addresses = await bee.getNodeAddresses() console.log('Node Addresses:', addresses) } checkAddresses() ``` Output: ```bash Node Addresses: Overlay: 1e2054bec3e681aeb0b365a1f9a574a03782176bd3ec0bcf810ebcaf551e4070 Ethereum: 9a73f283cd9211b96b5ec63f7a81a0ddc847cd93 Public Key: 7d0c4759f689ea3dd3eb79222870671c492cb99f3fade275bcbf0ea39cd0ef6e25edd43c99985983e49aa528f3f2b6711085354a31acb4e7b03559b02ec868f0 PSS Public Key: 5ade58d20be7e04ee8f875eabeebf9c53375a8fc73917683155c7c0b572f47ef790daa3328f48482663954d12f6e4739f748572c1e86bfa89af99f17e7dd4d33 Underlay: [ '/ip4/127.0.0.1/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j', '/ip4/172.17.0.2/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j', '/ip6/::1/tcp/1634/p2p/QmcpSJPHuuQYRgDkNfwziihVcpuVteoNxePvfzaJyp9z7j' ] ``` ### 4. Get Version and API Compatibility Use these methods to check your node's version number and the API version number, and to check whether the API version is supported by `bee-js`. ```js const bee = new Bee('http://localhost:1633') async function checkVersions() { const versions = await bee.getVersions() const isSupported = await bee.isSupportedApiVersion() console.log('Node Versions:', versions) console.log('Is Supported API Version:', isSupported) } checkVersions() ``` Output: ```bash Node Versions: { supportedBeeVersion: '2.4.0-390a402e', supportedBeeApiVersion: '7.2.0', beeVersion: '2.5.0-5ec231ba', beeApiVersion: '7.3.0' } Is Supported API Version: true ``` ### 5. Get Node Info This provides general information such as node mode (e.g., full, light), and whether chequebook and SWAP are enabled. ```js const bee = new Bee('http://localhost:1633') async function getNodeInfo() { const info = await bee.getNodeInfo() console.log('Node Info:', info) } getNodeInfo() ``` Output: ```bash Node Info: { beeMode: 'light', chequebookEnabled: true, swapEnabled: true } ``` ### 6. Get Chain State Shows blockchain-related info such as the current price for storage. ```js const bee = new Bee('http://localhost:1633') async function getChainState() { const state = await bee.getChainState() console.log('Chain State:', state) } getChainState() ``` Output: ```bash Chain State: { block: 39230575, chainTip: 39230580, totalAmount: '204168626286', currentPrice: 41699 } ``` ### 7. Get Reserve State This tells you about your node’s local reserve size and storage metrics. ```js const bee = new Bee('http://localhost:1633') async function getReserveState() { const reserveState = await bee.getReserveState() console.log('Reserve State:', reserveState) } getReserveState() ``` Output: ```bash Reserve State: { commitment: 17360879616, radius: 13, storageRadius: 0 } ``` ### Run All Checks Together You can combine all of the above into one function to quickly inspect the full status of your node: ```js const bee = new Bee('http://localhost:1633') async function checkHealthAndReadiness() { const health = await bee.getHealth() const readiness = await bee.getReadiness() console.log('Health:', health) console.log('Readiness:', readiness) } async function checkTopology() { const topology = await bee.getTopology() console.log('Topology:', topology) } async function checkAddresses() { const addresses = await bee.getNodeAddresses() console.log('Node Addresses:') console.log('Overlay:', new Bytes(addresses.overlay.bytes).toHex()) console.log('Ethereum:', new Bytes(addresses.ethereum.bytes).toHex()) console.log('Public Key:', new Bytes(addresses.publicKey.bytes).toHex()) console.log('PSS Public Key:', new Bytes(addresses.pssPublicKey.bytes).toHex()) console.log('Underlay:', addresses.underlay) } async function checkVersions() { const versions = await bee.getVersions() const isSupported = await bee.isSupportedApiVersion() console.log('Node Versions:', versions) console.log('Is Supported API Version:', isSupported) } async function getNodeInfo() { const info = await bee.getNodeInfo() console.log('Node Info:', info) } async function getChainState() { const state = await bee.getChainState() console.log('Chain State:', state) } async function getReserveState() { const reserveState = await bee.getReserveState() console.log('Reserve State:', reserveState) } async function checkNodeStatus() { console.log('\n\n=== Node Health and Readiness ===') await checkHealthAndReadiness() console.log('\n\n=== Node Topology ===') await checkTopology() console.log('\n\n=== Node Addresses ===') await checkAddresses() console.log('\n\n=== Version and API Compatibility ===') await checkVersions() console.log('\n\n=== Node Info ===') await getNodeInfo() console.log('\n\n=== Chain State ===') await getChainState() console.log('\n\n=== Reserve State ===') await getReserveState() } checkNodeStatus() ``` --- ## Tracking Uploads You can track the progress of deferred uploads using "tags". Each tag tracks how many chunks were **split**, **stored**, **seen**, and **synced** by the network. By creating a tag before uploading and passing it to the upload function, you make the upload *trackable, allowing you to confirm whether your uploaded data has been fully synced. :::info Tracking with tags is used ***only for [deferred uploads](./upload-download.md#deferred-uploads)***. That is because when content is uploaded in a deferred manner, the content's reference hash will be returned *immediately*, often before the content has been fully synced to the network. Therefore tags should be used in order to confirm when the content has been fully synced and is retrievable. With direct uploads, the reference hash is not returned until after the content has already been uploaded and fully synced to the network, so there is no need to track it after uploading. ::: ## How It Works ### 1. Create a Tag Before uploading, create a new tag using `bee.createTag()`. This returns a unique tag UID that will be used to monitor the upload. ```js const tag = await bee.createTag() console.log("Created new tag with UID:", tag.uid) ``` Alternatively, you can use an existing tag from `bee.getAllTags()` (useful for testing or reuse): ```js const allTags = await bee.getAllTags() if (allTags.length > 0) { tag = allTags[0] console.log("Using existing tag with UID:", tag.uid) } ``` ### 2. Upload a File with the Tag To enable tracking, pass the tag UID into the upload options under the `tag` key: ```js const result = await bee.uploadFile(postageBatchId, fileData, 'nodes.json', { tag: tag.uid, contentType: 'application/json' }) ``` This links the upload to your tag so you can monitor its progress. ### 3. Track Tag Progress Use `bee.retrieveTag(tagUid)` to monitor upload progress. Chunks that have **already been synced in the past** are counted in `seen`, while newly synced ones are in `synced`. Poll repeatedly until: ```text synced + seen === split ``` This indicates that all chunks have either just synced or were already present in the network. ```js const tag = await bee.retrieveTag(tagUid) console.log(` - Total split: ${tag.split}`) console.log(` - Synced: ${tag.synced}`) console.log(` - Seen: ${tag.seen}`) ``` ## Example Script ```js const bee = new Bee('http://localhost:1633') const postageBatchId = "129903062bedc4eca6fc1c232ed385e93dda72f711caa1ead6018334dd801cee" async function waitForTagSync(tagUid, interval = 800) { while (true) { const tag = await bee.retrieveTag(tagUid) console.log(`Progress (Tag ${tagUid}):`) console.log(` - Total split: ${tag.split}`) console.log(` - Stored: ${tag.stored}`) console.log(` - Seen: ${tag.seen}`) console.log(` - Synced: ${tag.synced}`) if (tag.split > 0 && tag.synced + tag.seen >= tag.split) { console.log("Upload fully synced!") break } await new Promise(resolve => setTimeout(resolve, interval)) } } async function uploadNodesJsonWithTag() { try { const fileData = await fs.readFile('./nodes.json') const tag = await bee.createTag() console.log("Created new tag with UID:", tag.uid) const result = await bee.uploadFile(postageBatchId, fileData, 'nodes.json', { tag: tag.uid, contentType: 'application/json' }) console.log("Uploaded reference:", result.reference.toHex()) await waitForTagSync(tag.uid) } catch (error) { console.error("Error uploading nodes.json:", error.message) } } uploadNodesJsonWithTag() ``` ### Example Terminal Output ```bash Created new tag with UID: 85 Uploaded reference: 78e5247e97b1a3362b6c3f054924dce734e0ffd7df0cb5ed9b636cb6a4a14d93 Progress (Tag 85): - Total split: 1078 - Stored: 0 - Seen: 0 - Synced: 546 Progress (Tag 85): - Total split: 1078 - Stored: 0 - Seen: 0 - Synced: 1078 Upload fully synced! ``` ## Deleting Tags You can delete tags you no longer need using their uid: ```js await bee.deleteTag(tag.uid) console.log("Deleted tag:", tag.uid) ``` ## References - [Bee docs – Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing) - [Bee API Reference – `/tags`](https://docs.ethswarm.org/api/#tag/Tag) --- ## Upload and Download Uploading and downloading with Swarm is easy with `bee-js`. Based on your needs you can either upload unstructured data directly, single files, lists of files, or entire directories. Each upload will return a Swarm reference hash, which is a unique identifier for the upload that can be used to download the uploaded content. ## Requirements To use the example scripts below, you need: - An instance of `bee-js`'s `Bee` [initialized](./getting-started.md) as `bee` using the API endpoint of a currently operating Bee node. - The batch ID of a previously purchased usable postage batch with enough `remainingSize` left to upload the desired data. If you don't have one already, you will need to [buy a batch](./buying-storage.md#purchasing-storage) to upload data. If you do have one, you will need to [get and save](./buying-storage.md#selecting-a-batch) its batch ID. ## Arbitrary Data You can upload and retrieve any `string` or `Uint8Array` data with the `uploadData` and `downloadData` functions. When you download data the return type is `Bytes`. The `Bytes` class includes various convenience functions like: - `toUtf8()` that converts the bytes into UTF-8 encoded string - `toHex()` that converts the bytes to a hex string - `toJSON()` that converts the bytes into JSON object :::info The `Bytes` class is a core data type in `bee-js`. It includes a variety of useful utility methods which you can learn more about on the [Utility Classes](./utilities.md) page. ::: ```js const bee = new Bee('http://localhost:1633') const postageBatchId = "129903062bedc4eca6fc1c232ed385e93dda72f711caa1ead6018334dd801cee" const jsonData = { message: "Bee is awesome!", features: ["decentralized", "reliable", "scalable"], version: 1.0 }; const jsonString = JSON.stringify(jsonData); const result = await bee.uploadData(postageBatchId, jsonString) // Prints the 64 character long hex string Swarm reference - make sure to save the reference in order to access the content later console.log(result.reference.toHex()) // Use the Swarm reference hash to download the data const retrievedData = await bee.downloadData(result.reference) console.log(retrievedData) // Prints the raw data console.log(retrievedData.toUtf8()) // Prints the data as UTF-8 text console.log(retrievedData.toJSON()) // Prints the data as JSON ``` :::info Tip A Swarm reference or hash is a 64 character long hex string which is the address of the uploaded data, file, or directory. It must saved so it can be used later to retrieve the uploaded content. ::: Example terminal output: ```bash e2d9d04da9f8a000ddcc50e1b86fbff00c6202b406a9dd7aa55d283747858c33 Bytes { bytes: , length: 92 } {"message":"Bee is awesome!","features":["decentralized","reliable","scalable"],"version":1} { message: 'Bee is awesome!', features: [ 'decentralized', 'reliable', 'scalable' ], version: 1 } ``` ## Single Files The `uploadFile` function accepts a `string`, `Uint8Array`, Node.js `Readable` stream, or browser `File` object as input data, along with an optional filename and upload options. :::info When working with browsers you can use the [`File` interface](https://developer.mozilla.org/en-US/docs/Web/API/File). The filename is taken from the `File` object itself, but can be overwritten through the second argument of the `uploadFile` function. ::: ```js const bee = new Bee('http://localhost:1633') const postageBatchId = "ec4d7e3acbd626471b33135164335dfcb0bed889dd4a951c09da8ea7b59c1fc9" async function uploadFromDisk() { try { // Read the file from the local file system const filePath = "./textfile.txt" const fileData = readFileSync(filePath) // Upload the file data const result = await bee.uploadFile(postageBatchId, fileData, "textfile.txt", { contentType: "text/plain" }) // Print the reference hash used to retrieve the content console.log(result.reference.toHex()) // Download the file const retrievedFile = await bee.downloadFile(result.reference.toHex()) console.log(retrievedFile.name) // Prints 'textfile.txt' console.log(retrievedFile.contentType) // Prints 'text/plain' console.log(retrievedFile.data.toUtf8()) // Prints file content return result.reference.toHex() } catch (error) { console.error("Error:", error.message) } } uploadFromDisk() ``` Example terminal output: ```bash textfile.txt application/x-www-form-urlencoded this is a sample file 0dca369c5a1a1ef5be1f5e293089c695920323805568382d9e97e3cd17678a3a ``` ## Multiple Files For uploading multiple files at once in a browser environment you can use the `uploadFiles` function. *Note that it preserves the relative paths of all uploaded files, so the full paths (e.g. "folder/nested.txt") must be used when downloading them.* :::caution Browser Only The `uploadFiles` function is only supported for **browser environments**, as it requires input in the form of a [`FileList`](https://developer.mozilla.org/en-US/docs/Web/API/FileList) or array of [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) objects. While `File` is available in Node v20+, it is still not fully supported and may not always work as expected. ::: ```js const bee = new Bee('http://localhost:1633') const postageBatchId = "ec4d7e3acbd626471b33135164335dfcb0bed889dd4a951c09da8ea7b59c1fc9" async function uploadFiles() { try { // Create 3 File objects from strings with nested paths const rootFile = new File(["Root file content"], "root.txt", { type: "text/plain" }) const nestedFile = new File(["Nested file content"], "folder/nested.txt", { type: "text/plain" }) const deepFile = new File(["Deeply nested file content"], "folder/subfolder/deep.txt", { type: "text/plain" }) // Upload all files const result = await bee.uploadFiles(postageBatchId, [rootFile, nestedFile, deepFile]) console.log("Files uploaded with reference:", result.reference.toHex()) // Download each file by full path const downloadedRoot = await bee.downloadFile(result.reference, 'root.txt') const downloadedNested = await bee.downloadFile(result.reference, 'folder/nested.txt') const downloadedDeep = await bee.downloadFile(result.reference, 'folder/subfolder/deep.txt') // Display contents console.log("Root file:", downloadedRoot.data.toUtf8()) console.log("Nested file:", downloadedNested.data.toUtf8()) console.log("Deep file:", downloadedDeep.data.toUtf8()) return result.reference.toHex() } catch (error) { console.error("Error:", error.message) } } uploadFiles() ``` ## Directories :::info `uploadFilesFromDirectory` is not available in the browser as it relies on [`fs` from NodeJS](https://nodejs.org/api/fs.html). ::: The `uploadFilesFromDirectory` function takes a directory path as input and recursively uploads all files within it, including those in all nested subdirectories, while preserving their relative paths. *When downloading files later, you must use the full relative paths exactly as they appeared during upload.* Let's assume we have the following file structure: ```bash . β”œβ”€β”€ folder β”‚Β Β  β”œβ”€β”€ nested.txt β”‚Β Β  └── subfolder β”‚Β Β  └── deep.txt └── root.txt ``` ```js const bee = new Bee('http://localhost:1633') const postageBatchId = "ec4d7e3acbd626471b33135164335dfcb0bed889dd4a951c09da8ea7b59c1fc9" async function uploadDirectory() { try { // Upload the current directory (where the script is run) const result = await bee.uploadFilesFromDirectory(postageBatchId, process.cwd()) console.log("Directory uploaded successfully!") console.log("Swarm reference:", result.reference.toHex()) // Download each file using its relative path const root = await bee.downloadFile(result.reference, 'root.txt') const nested = await bee.downloadFile(result.reference, 'folder/nested.txt') const deep = await bee.downloadFile(result.reference, 'folder/subfolder/deep.txt') // Print out file contents console.log("root.txt:", root.data.toUtf8()) console.log("folder/nested.txt:", nested.data.toUtf8()) console.log("folder/subfolder/deep.txt:", deep.data.toUtf8()) } catch (error) { console.error("Error during upload or download:", error.message) } } uploadDirectory() ``` Example terminal output: ```bash Directory uploaded successfully! Swarm reference: 3e42f7cfbeec140129211fa24b9b57b2bff5932416dc8ff30b44c8446b259e92 root.txt: Root level content folder/nested.txt: Nested content folder/subfolder/deep.txt: Deeply nested content ``` ## Upload Options The `uploadData`, `uploadFile`, `uploadFiles`, and other similar methods accept an **options object** as their third argument. This object lets you modify how the upload is handled β€” for example, enabling encryption, pinning data locally, or attaching a tag to track the upload. ### Pinning If you set `pin: true`, the uploaded data will be **stored locally** on your Bee node, even if it becomes unavailable on the wider Swarm network. This lets your node re-upload the content if needed: ```js await bee.uploadData(postageBatchId, 'my content', { pin: true }) ``` :::info Pinning is local only. It doesn't make data permanent across the network. ::: More info: - [Bee docs – Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning) ### Encryption You can enable **client-side encryption** by setting `encrypt: true`. This encrypts the content before uploading and returns a longer Swarm reference that includes the decryption key. **Example:** ```js await bee.uploadData(postageBatchId, 'sensitive content', { encrypt: true }) ``` When you later download the content, `bee-js` will decrypt it automatically if the reference contains the embedded key. More info: - [Store with Encryption](https://docs.ethswarm.org/docs/develop/access-the-swarm/store-with-encryption) ### Tags Tags let you **track upload progress** through the Bee API. You can create a new tag using `bee.createTag()`, then pass its ID when uploading. **Example:** ```js const tag = await bee.createTag() await bee.uploadData(postageBatchId, 'track me', { tag: tag.uid }) ``` You can use the tag ID to monitor syncing status: how many chunks were split, stored, seen, and synced. See [here](./upload-download.md#using-tags-to-monitor-upload-progress) for more info on creating, monitoring, and managing tags. ### Deferred Uploads By default, uploads are **deferred**, meaning the client sends the data to the Bee node, generates and returns the Swarm reference hash, and the node starts syncing it to the network **in the background**. The function returns as soon as the chunks are processed and a Swarm reference is generated β€” **even before the data is actually available on the network**. This can be risky if you assume the data is already retrievable using the returned reference. **To ensure reliability, it is recommended to set `deferred: false`** unless you're explicitly tracking the upload using tags. **Recommended usage:** ```js await bee.uploadData(postageBatchId, 'data', { deferred: false }) ``` :::tip If you do use `deferred: true`, make sure to use a [tag](./tracking-uploads.md) to track upload progress and confirm the success of the upload. ::: --- ## Utility Classes `bee-js` includes a variety of utility classes with methods for working with different data types, keys, signatures, addresses, token values, content references, hashing, and more. ## *Bytes* - Data Conversions & Manipulation The `Bytes` class in `bee-js` provides a convenient wrapper for manipulating byte arrays, converting between encodings, slicing, hashing, and more. It’s used throughout `bee-js` as the basis for other utility classes like `Signature`, `Reference`, `PrivateKey`, and more, all of which extend the `Bytes` class. It is also a **core data type** used throughout the SDK as expected input/returned data type for various methods. ```js // Import Bytes class ``` ### Hashing with `keccak256` **Methods:** - `Bytes.fromUtf8()`: Converts a UTF-8 string to a `Bytes` instance. - `Bytes.keccak256()`: Computes the keccak256 hash of the given byte input. - `toHex()`: Converts the byte data to a hexadecimal string. ```js // --- Hashing with keccak256 --- console.log('--- keccak256 Hashing ---') console.log('Empty string hash:', Bytes.keccak256(Bytes.fromUtf8('')).toHex()) console.log('Hello, world! hash:', Bytes.keccak256(Bytes.fromUtf8('Hello, world!')).toHex()) ``` ```bash --- keccak256 Hashing --- Empty string hash: c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 Hello, world! hash: b6e16d27ac5ab427a7f68900ac5559ce272dc6c37c82b3e052246c82244c50e4 ``` ### Creating *Bytes* Instances **Methods:** - `Bytes.fromUtf8()`: Creates a `Bytes` instance from a UTF-8 string. - `Bytes.fromSlice()`: Creates a `Bytes` instance from a slice of a `Uint8Array`. - `new Bytes(...)`: Constructs a new `Bytes` instance from various inputs like strings, `ArrayBuffer`, or `Uint8Array`. - `toHex()`: Converts the byte data to a hexadecimal string. ```js // --- Creating Bytes instances --- console.log('\n--- Creating Bytes Instances ---') const bytesFromString = Bytes.fromUtf8('Swarm') console.log('From UTF-8 string:', bytesFromString.toHex()) const source = new Uint8Array([1, 2, 3, 4, 5]) const slice = Bytes.fromSlice(source, 1, 3) console.log('From slice of Uint8Array:', slice.toHex()) const fromHex = new Bytes('0xdeadbeef') console.log('From hex string:', fromHex.toHex()) const cloned = new Bytes(fromHex) console.log('Cloned Bytes instance:', cloned.toHex()) const fromArray = new Bytes(new Uint8Array([16, 32, 48])) console.log('From raw Uint8Array:', fromArray.toHex()) ``` ```bash --- Creating Bytes Instances --- From UTF-8 string: 537761726d From slice of Uint8Array: 020304 From hex string: deadbeef Cloned Bytes instance: deadbeef From raw Uint8Array: 102030 ``` ### Accessing and Converting Bytes **Methods:** - `toUint8Array()`: Converts the `Bytes` instance to a `Uint8Array`. - `toHex()`: Converts the byte data to a hexadecimal string. - `toBase64()`: Converts the byte data to a Base64-encoded string. - `toBase32()`: Converts the byte data to a Base32-encoded string. - `toUtf8()`: Converts the byte data to a UTF-8 string. - `toString()`: Converts the byte data to a hexadecimal string (alias for `toHex()`). - `toJSON()`: Parses the byte data (assumed to be a JSON string) and returns the corresponding JavaScript object. ```javascript // --- Accessing and Converting Bytes --- console.log('\n--- Accessing and Converting Bytes ---') const data = Bytes.fromUtf8('hello') console.log('toUint8Array():', data.toUint8Array()) console.log('toHex():', data.toHex()) console.log('toBase64():', data.toBase64()) console.log('toBase32():', data.toBase32()) console.log('toUtf8():', data.toUtf8()) console.log('toString():', data.toString()) const json = Bytes.fromUtf8('{"a": 1, "b": true}') console.log('toJSON():', json.toJSON()) ``` ```bash --- Accessing and Converting Bytes --- toUint8Array(): Uint8Array(5) [ 104, 101, 108, 108, 111 ] toHex(): 68656c6c6f toBase64(): aGVsbG8= toBase32(): NBSWY3DP toUtf8(): hello toString(): 68656c6c6f toJSON(): { a: 1, b: true } ``` ## *PrivateKey* - Key Management & Signing The `PrivateKey` class extends the `Bytes` class. It is initialized with an Ethereum-style private key, which can then be used for signing arbitrary messages. It also has methods for returning the derived Ethereum address and public key. ```javascript // This example shows interoperability of crypto types // Initialize PrivateKey with 32-byte hexadecimal private key const signer = new PrivateKey('0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef') console.log('PrivateKey initialized:', signer.toHex()) // Message to be signed const message = 'Hello world!' console.log('Message to sign:', message) // Message signing const signature = signer.sign(message) // type Signature console.log('Generated signature:', signature.toHex()) // Public key derivation const recovered = signature.recoverPublicKey(message) // type PublicKey console.log('Recovered public key:', recovered.toHex()) // Ethereum account address derivation const address = recovered.address() // type EthAddress console.log('Recovered Ethereum address:', address.toHex()) ``` ```bash PrivateKey initialized: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef Message to sign: Hello world! Generated signature: 0f0b277880c01e1ed39ad3fadcbd1d317c89ed4ecc9048072a18b370eff3162f5519fa0fa307ed66bac9645bf6e1e5350b3e91a99bcf7104ecfcb6d8443b81301c Recovered public key: 4646ae5047316b4230d0086c8acec687f00b1cd9d1dc634f6cb358ac0a9a8ffffe77b4dd0a4bfb95851f3b7355c781dd60f8418fc8a65d14907aff47c903a559 Recovered Ethereum address: fcad0b19bb29d4674531d6f115237e16afce377c ``` ## *BZZ* and *DAI* - Token Conversions & Formatting ```javascript ``` **Initializing and formatting BZZ and DAI tokens.** ```javascript // --- BZZ Initialization --- console.log('--- BZZ Initialization ---') const bzz = BZZ.fromDecimalString('13.37') console.log('BZZ in PLUR String:', bzz.toPLURString()) console.log('BZZ as PLUR BigInt:', bzz.toPLURBigInt()) console.log('BZZ in Decimal String:', bzz.toDecimalString()) ``` ```bash --- BZZ Initialization --- BZZ in PLUR String: 133700000000000000 BZZ as PLUR BigInt: 133700000000000000n BZZ in Decimal String: 13.3700000000000000 ``` **DAI token initialization, converting from Wei to Decimal string and back.** ```javascript // --- DAI Initialization --- console.log('--- DAI Initialization ---') const daiFromWei = DAI.fromWei('4596417133719887384') console.log('DAI from Wei to Decimal String:', daiFromWei.toDecimalString()) console.log('DAI from Decimal String to Wei BigInt:', DAI.fromDecimalString('4.596417133719887384').toWeiBigInt()) console.log('DAI from Decimal String to Wei String:', DAI.fromDecimalString('4.596417133719887384').toWeiString()) ``` ```bash --- DAI Initialization --- DAI from Wei to Decimal String: 4.596417133719887384 DAI from Decimal String to Wei BigInt: 4596417133719887384n DAI from Decimal String to Wei String: 4596417133719887384 ``` **Performing arithmetic on BZZ tokens by sending and receiving amounts.** ```javascript // --- BZZ Arithmetic --- console.log('--- BZZ Arithmetic ---') const sent = BZZ.fromDecimalString('1.89') const received = BZZ.fromDecimalString('45.600000061124') console.log('BZZ after arithmetic (sent + received):', sent.plus('401100000000000000').minus(received).toDecimalString()) ``` ```bash --- BZZ Arithmetic --- BZZ after arithmetic (sent + received): -3.6000000611240000 ``` **Converting BZZ tokens to DAI tokens using a specified exchange rate.** ```javascript // --- Convert BZZ to DAI --- console.log('--- Convert BZZ to DAI ---') const exchangeRate = DAI.fromDecimalString('0.3659') const bzzForExchange = BZZ.fromDecimalString('1000') console.log('BZZ exchanged to DAI at rate 0.3659:', bzzForExchange.exchangeToDAI(exchangeRate).toDecimalString()) ``` ```bash --- Convert BZZ to DAI --- BZZ exchanged to DAI at rate 0.3659: 365.900000000000000000 ``` **Converting DAI tokens to BZZ tokens using the same exchange rate.** ```javascript // --- Convert DAI to BZZ --- console.log('--- Convert DAI to BZZ ---') const dai = DAI.fromDecimalString('2.591923154542010243') console.log('DAI exchanged to BZZ at rate 0.3659:', dai.exchangeToBZZ(exchangeRate).toDecimalString()) ``` ```bash --- Convert DAI to BZZ --- DAI exchanged to BZZ at rate 0.3659: 7.0836926880076803 ``` ## *Reference* - Reference Hashes and CIDs The `Reference` class is used to represent content reference hashes and CIDs, and conversions between them. ```javascript const hash = '44ef8a919a7a2a6fe36712d4512047db406cc7ac5c06da7731e0cb87bab10ff9' const cid = 'bah5acgzaitxyvem2pivg7y3hclkfcich3nagzr5mlqdnu5zr4dfypovrb74q' // Convert CID to hash (Hex) console.log('CID to Hash (Hex):', new Reference(cid).toHex()) // Convert Hash (Hex) to CID (Accepts 'manifest' or 'feed' types) console.log('Hash to CID (manifest type):', new Reference(hash).toCid('manifest')) ``` ```bash CID to Hash (Hex): 44ef8a919a7a2a6fe36712d4512047db406cc7ac5c06da7731e0cb87bab10ff9 Hash to CID (manifest type): bah5acgzaitxyvem2pivg7y3hclkfcich3nagzr5mlqdnu5zr4dfypovrb74q ``` --- ## bee-js - The Swarm JS Library `bee-js` is a JavaScript SDK for building applications using the Swarm decentralized storage and communication network. It allows you to interact with a local or remote [Bee node](https://docs.ethswarm.org/docs/) within your NodeJS project. The following documentation will guide you through installing and using `bee-js`. Take your first steps with `bee-js` in the [Getting Started section](./getting-started). :::info Note on Ethereum addresses Ethereum addresses / keys are mentioned throughout the documentation. Please not that this refers to the Ethereum format only, and does not indicate the Ethereum blockchain itself. Swarm is built on the Gnosis Blockchain which is a fork of Ethereum, and uses the same key and addressing schemes. ::: ## Development We'd love you to join us! Are you up to the challenge of helping us to create bee-js and the other incredible technologies we're building? Have a look at our Github - [Ethersphere](https://github.com/ethersphere). ## Community There is a vibrant and buzzing community behind Swarm, get involved in one of our group channels. - [Official Swarm website](https://ethswarm.org) - [Discord room](https://discord.gg/ykCupZMuww) - [Twitter @ethswarm](https://twitter.com/ethswarm) - [Reddit channel](https://www.reddit.com/r/ethswarm/) ## Reporting a bug If anything isn't working, [get in touch and let us know!](https://github.com/ethersphere/bee-js/issues) Every Bee is important to us and we'll get right to work on fixing it for you as soon as possible. 🐝 ## Examples We have repo with some examples that might be interesting for you to see. Check it out [here](https://github.com/ethersphere/examples-js). --- ## Community * [`try-out-swarm`](https://github.com/Solar-Punk-Ltd/try-out-swarm) - a quick bootstrap for Swarm including shell scripts for Bee and typescript scripts using `bee-js`