Class: BeeDev
Defined in: bee-js/src/bee-dev.ts:6
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
Constructors
Constructor
new BeeDev(
url
,options?
):BeeDev
Defined in: bee-js/src/bee.ts:168
Parameters
url
string
URL on which is the main API of Bee node exposed
options?
Returns
BeeDev
Inherited from
Properties
network
readonly
network:"gnosis"
|"sepolia"
Defined in: bee-js/src/bee.ts:156
Network on which the Bee node is running
Inherited from
signer?
readonly
optional
signer:PrivateKey
Defined in: bee-js/src/bee.ts:151
Default Signer object used for signing operations, mainly Feeds.
Inherited from
url
readonly
url:string
Defined in: bee-js/src/bee.ts:146
URL on which is the main API of Bee node exposed
Inherited from
Methods
buyStorage()
buyStorage(
size
,duration
,options?
,requestOptions?
):Promise
<BatchId
>
Defined in: bee-js/src/bee.ts:1649
Parameters
size
duration
options?
requestOptions?
Returns
Promise
<BatchId
>
Inherited from
cancelPendingTransaction()
cancelPendingTransaction(
transactionHash
,gasPrice?
,options?
):Promise
<TransactionId
>
Defined in: bee-js/src/bee.ts:1907
Cancel currently pending transaction
Parameters
transactionHash
string
| Uint8Array
<ArrayBufferLike
> | TransactionId
gasPrice?
string
| bigint
| NumberString
options?
Returns
Promise
<TransactionId
>
Inherited from
cashoutLastCheque()
cashoutLastCheque(
address
,options?
,requestOptions?
):Promise
<TransactionId
>
Defined in: bee-js/src/bee.ts:1425
Cashout the last cheque for the peer
Parameters
address
Swarm address of peer
string
| PeerAddress
options?
requestOptions?
Returns
Promise
<TransactionId
>
Inherited from
checkConnection()
checkConnection(
options?
):Promise
<void
>
Defined in: bee-js/src/bee.ts:1265
Ping the Bee node to see if there is a live Bee node on the given URL.
Parameters
options?
Options that affects the request behavior
Returns
Promise
<void
>
Throws
If connection was not successful throw error
Inherited from
createEnvelope()
createEnvelope(
postageBatchId
,reference
,options?
):Promise
<EnvelopeWithBatchId
>
Defined in: bee-js/src/bee.ts:1241
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
reference
string
| Uint8Array
<ArrayBufferLike
> | Reference
options?
Returns
Promise
<EnvelopeWithBatchId
>
Inherited from
createFeedManifest()
createFeedManifest(
postageBatchId
,topic
,owner
,options?
,requestOptions?
):Promise
<Reference
>
Defined in: bee-js/src/bee.ts:1132
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
topic
Topic in hex or bytes
string
| Uint8Array
<ArrayBufferLike
> | Topic
owner
Owner's ethereum address in hex or bytes
string
| Uint8Array
<ArrayBufferLike
> | EthAddress
options?
Options that affects the request behavior
requestOptions?
Returns
Promise
<Reference
>
See
Inherited from
createGrantees()
createGrantees(
postageBatchId
,grantees
,requestOptions?
):Promise
<GranteesResult
>
Defined in: bee-js/src/bee.ts:345
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
grantees
An array of public keys representing the grantees.
string
[] | Uint8Array
<ArrayBufferLike
>[] | PublicKey
[]
requestOptions?
Optional request options.
Returns
Promise
<GranteesResult
>
A promise that resolves to a GranteesResult
object.
Inherited from
createPostageBatch()
createPostageBatch(
amount
,depth
,options?
,requestOptions?
):Promise
<BatchId
>
Defined in: bee-js/src/bee.ts:1609
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.
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
depth
number
Logarithm of the number of chunks that can be stamped with the batch.
options?
Options for creation of postage batch
requestOptions?
Returns
Promise
<BatchId
>
Throws
BeeArgumentError when negative amount or depth is specified
Throws
TypeError if non-integer value is passed to amount or depth
See
Inherited from
createTag()
createTag(
options?
):Promise
<Tag
>
Defined in: bee-js/src/bee.ts:649
Create a new Tag which is meant for tracking progres of syncing data across network.
Parameters
options?
Options that affects the request behavior
Returns
Promise
<Tag
>
See
Inherited from
deleteTag()
deleteTag(
tagUid
,options?
):Promise
<void
>
Defined in: bee-js/src/bee.ts:701
Delete Tag
Parameters
tagUid
UID or tag object to be retrieved
number
| Tag
options?
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
Inherited from
depositStake()
depositStake(
amount
,options?
,requestOptions?
):Promise
<TransactionId
>
Defined in: bee-js/src/bee.ts:1940
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
| NumberString
options?
requestOptions?
Returns
Promise
<TransactionId
>
Inherited from
depositTokens()
depositTokens(
amount
,gasPrice?
,options?
):Promise
<TransactionId
>
Defined in: bee-js/src/bee.ts:1446
Deposit tokens from overlay address into chequebook
Parameters
amount
Amount of tokens to deposit (must be positive integer)
string
| bigint
| BZZ
| NumberString
gasPrice?
Gas Price in WEI for the transaction call
string
| bigint
| NumberString
options?
Returns
Promise
<TransactionId
>
string Hash of the transaction
Inherited from
diluteBatch()
diluteBatch(
postageBatchId
,depth
,options?
):Promise
<BatchId
>
Defined in: bee-js/src/bee.ts:1786
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.
Parameters
postageBatchId
Batch ID
string
| Uint8Array
<ArrayBufferLike
> | BatchId
depth
number
Amount to be added to the batch
options?
Request options
Returns
Promise
<BatchId
>
See
- Bee docs - Keep your data alive / Postage stamps
- Bee Debug API reference -
PATCH /stamps/topup/${id}/${amount}
Inherited from
downloadChunk()
downloadChunk(
reference
,options?
,requestOptions?
):Promise
<Uint8Array
<ArrayBufferLike
>>
Defined in: bee-js/src/bee.ts:321
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
options?
Options that affects the request behavior
requestOptions?
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
Inherited from
downloadData()
downloadData(
resource
,options?
,requestOptions?
):Promise
<Bytes
>
Defined in: bee-js/src/bee.ts:243
Download data as a byte array
Parameters
resource
Swarm reference, Swarm CID, or ENS domain
string
| Uint8Array
<ArrayBufferLike
> | Reference
options?
Options that affects the request behavior
requestOptions?
Returns
Promise
<Bytes
>
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
Inherited from
downloadFile()
downloadFile(
resource
,path
,options?
,requestOptions?
):Promise
<FileData
<Bytes
>>
Defined in: bee-js/src/bee.ts:468
Download single file.
Parameters
resource
Swarm reference, Swarm CID, or ENS domain
string
| Uint8Array
<ArrayBufferLike
> | Reference
path
string
= ''
If reference points to manifest, then this parameter defines path to the file
options?
Options that affects the request behavior
requestOptions?
Returns
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
Inherited from
downloadReadableData()
downloadReadableData(
resource
,options?
,requestOptions?
):Promise
<ReadableStream
<Uint8Array
<ArrayBufferLike
>>>
Defined in: bee-js/src/bee.ts:265
Download data as a Readable stream
Parameters
resource
Swarm reference, Swarm CID, or ENS domain
string
| Uint8Array
<ArrayBufferLike
> | Reference
options?
Options that affects the request behavior
requestOptions?
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
Inherited from
downloadReadableFile()
downloadReadableFile(
reference
,path
,options?
,requestOptions?
):Promise
<FileData
<ReadableStream
<Uint8Array
<ArrayBufferLike
>>>>
Defined in: bee-js/src/bee.ts:493
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
path
string
= ''
If reference points to manifest / collections, then this parameter defines path to the file
options?
Options that affects the request behavior
requestOptions?
Returns
Promise
<FileData
<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
Inherited from
extendStorageDuration()
extendStorageDuration(
postageBatchId
,duration
,options?
):Promise
<BatchId
>
Defined in: bee-js/src/bee.ts:1688
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
duration
options?
Returns
Promise
<BatchId
>
Inherited from
extendStorageSize()
extendStorageSize(
postageBatchId
,size
,options?
):Promise
<BatchId
>
Defined in: bee-js/src/bee.ts:1674
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
size
options?
Returns
Promise
<BatchId
>
Inherited from
fetchLatestFeedUpdate()
fetchLatestFeedUpdate(
topic
,owner
,requestOptions?
):Promise
<FeedPayloadResult
>
Defined in: bee-js/src/bee.ts:1194
Parameters
topic
string
| Uint8Array
<ArrayBufferLike
> | Topic
owner
string
| Uint8Array
<ArrayBufferLike
> | EthAddress
requestOptions?
Returns
Promise
<FeedPayloadResult
>
Inherited from
getAllBalances()
getAllBalances(
options?
):Promise
<BalanceResponse
>
Defined in: bee-js/src/bee.ts:1325
Get the balances with all known peers including prepaid services
Parameters
options?
Returns
Promise
<BalanceResponse
>
Inherited from
getAllGlobalPostageBatch()
getAllGlobalPostageBatch(
options?
):Promise
<GlobalPostageBatch
[]>
Defined in: bee-js/src/bee.ts:1846
Return all globally available postage batches.
Parameters
options?
Returns
Promise
<GlobalPostageBatch
[]>
Deprecated
Use getGlobalPostageBatches
instead
Inherited from
getAllPendingTransactions()
getAllPendingTransactions(
options?
):Promise
<TransactionInfo
[]>
Defined in: bee-js/src/bee.ts:1870
Return lists of all current pending transactions that the Bee made
Parameters
options?
Returns
Promise
<TransactionInfo
[]>
Inherited from
getAllPins()
getAllPins(
options?
):Promise
<Reference
[]>
Defined in: bee-js/src/bee.ts:766
Get list of all locally pinned references
Parameters
options?
Options that affects the request behavior
Returns
Promise
<Reference
[]>
See
Inherited from
getAllPostageBatch()
getAllPostageBatch(
options?
):Promise
<PostageBatch
[]>
Defined in: bee-js/src/bee.ts:1838
Return all postage batches that has the node available.
Parameters
options?
Returns
Promise
<PostageBatch
[]>
See
Deprecated
Use getPostageBatches
instead
Inherited from
getAllSettlements()
getAllSettlements(
options?
):Promise
<AllSettlements
>
Defined in: bee-js/src/bee.ts:1506
Get settlements with all known peers and total amount sent or received
Parameters
options?
Returns
Promise
<AllSettlements
>
Inherited from
getAllTags()
getAllTags(
options?
,requestOptions?
):Promise
<Tag
[]>
Defined in: bee-js/src/bee.ts:665
Fetches all tags.
The listing is limited by options.limit. So you have to iterate using options.offset to get all tags.
Parameters
options?
Options that affects the request behavior
requestOptions?
Returns
Promise
<Tag
[]>
Throws
TypeError if limit or offset are not numbers or undefined
Throws
BeeArgumentError if limit or offset have invalid options
See
Inherited from
getBlocklist()
getBlocklist(
options?
):Promise
<Peer
[]>
Defined in: bee-js/src/bee.ts:1291
Parameters
options?
Returns
Promise
<Peer
[]>
Inherited from
getChainState()
getChainState(
options?
):Promise
<ChainState
>
Defined in: bee-js/src/bee.ts:1579
Get chain state
Parameters
options?
Returns
Promise
<ChainState
>
Inherited from
getChequebookAddress()
getChequebookAddress(
options?
):Promise
<ChequebookAddressResponse
>
Defined in: bee-js/src/bee.ts:1371
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?
Returns
Promise
<ChequebookAddressResponse
>
Inherited from
getChequebookBalance()
getChequebookBalance(
options?
):Promise
<ChequebookBalanceResponse
>
Defined in: bee-js/src/bee.ts:1378
Get the balance of the chequebook
Parameters
options?
Returns
Promise
<ChequebookBalanceResponse
>
Inherited from
getDurationExtensionCost()
getDurationExtensionCost(
postageBatchId
,duration
,options?
):Promise
<BZZ
>
Defined in: bee-js/src/bee.ts:1736
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
duration
options?
Returns
Promise
<BZZ
>
Inherited from
getExtensionCost()
getExtensionCost(
postageBatchId
,size
,duration
,options?
):Promise
<BZZ
>
Defined in: bee-js/src/bee.ts:1700
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
size
duration
options?
Returns
Promise
<BZZ
>
Inherited from
getGlobalPostageBatches()
getGlobalPostageBatches(
options?
):Promise
<GlobalPostageBatch
[]>
Defined in: bee-js/src/bee.ts:1863
Return all globally available postage batches.
Parameters
options?
Returns
Promise
<GlobalPostageBatch
[]>
Inherited from
getGrantees()
getGrantees(
reference
,requestOptions?
):Promise
<GetGranteesResult
>
Defined in: bee-js/src/bee.ts:363
Retrieves the grantees for a given reference.
Parameters
reference
The reference.
string
| Uint8Array
<ArrayBufferLike
> | Reference
requestOptions?
Optional request options.
Returns
Promise
<GetGranteesResult
>
A promise that resolves to a GetGranteesResult
object.
Inherited from
getHealth()
getHealth(
options?
):Promise
<Health
>
Defined in: bee-js/src/bee.ts:1520
Get health of node
Parameters
options?
Returns
Promise
<Health
>
Inherited from
getLastCashoutAction()
getLastCashoutAction(
address
,options?
):Promise
<LastCashoutActionResponse
>
Defined in: bee-js/src/bee.ts:1408
Get last cashout action for the peer
Parameters
address
Swarm address of peer
string
| PeerAddress
options?
Returns
Promise
<LastCashoutActionResponse
>
Inherited from
getLastCheques()
getLastCheques(
options?
):Promise
<LastChequesResponse
>
Defined in: bee-js/src/bee.ts:1385
Get last cheques for all peers
Parameters
options?
Returns
Promise
<LastChequesResponse
>
Inherited from
getLastChequesForPeer()
getLastChequesForPeer(
address
,options?
):Promise
<LastChequesForPeerResponse
>
Defined in: bee-js/src/bee.ts:1394
Get last cheques for the peer
Parameters
address
Swarm address of peer
string
| PeerAddress
options?
Returns
Promise
<LastChequesForPeerResponse
>
Inherited from
getNodeAddresses()
getNodeAddresses(
options?
):Promise
<NodeAddresses
>
Defined in: bee-js/src/bee-dev.ts:7
Parameters
options?
Returns
Promise
<NodeAddresses
>
Overrides
getNodeInfo()
getNodeInfo(
options?
):Promise
<NodeInfo
>
Defined in: bee-js/src/bee.ts:1534
Get mode information of node
Parameters
options?
Returns
Promise
<NodeInfo
>
Inherited from
getPastDueConsumptionBalances()
getPastDueConsumptionBalances(
options?
):Promise
<BalanceResponse
>
Defined in: bee-js/src/bee.ts:1343
Get the past due consumption balances with all known peers
Parameters
options?
Returns
Promise
<BalanceResponse
>
Inherited from
Bee
.getPastDueConsumptionBalances
getPastDueConsumptionPeerBalance()
getPastDueConsumptionPeerBalance(
address
,options?
):Promise
<PeerBalance
>
Defined in: bee-js/src/bee.ts:1352
Get the past due consumption balance with a specific peer
Parameters
address
Swarm address of peer
string
| PeerAddress
options?
Returns
Promise
<PeerBalance
>
Inherited from
Bee
.getPastDueConsumptionPeerBalance
getPeerBalance()
getPeerBalance(
address
,options?
):Promise
<PeerBalance
>
Defined in: bee-js/src/bee.ts:1334
Get the balances with a specific peer including prepaid services
Parameters
address
Swarm address of peer
string
| PeerAddress
options?
Returns
Promise
<PeerBalance
>
Inherited from
getPeers()
getPeers(
options?
):Promise
<Peer
[]>
Defined in: bee-js/src/bee.ts:1298
Get list of peers for this node
Parameters
options?
Returns
Promise
<Peer
[]>
Inherited from
getPendingTransaction()
getPendingTransaction(
transactionHash
,options?
):Promise
<TransactionInfo
>
Defined in: bee-js/src/bee.ts:1878
Return transaction information for specific transaction
Parameters
transactionHash
string
| Uint8Array
<ArrayBufferLike
> | TransactionId
options?
Returns
Promise
<TransactionInfo
>
Inherited from
getPin()
getPin(
reference
,options?
):Promise
<Pin
>
Defined in: bee-js/src/bee.ts:780
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
options?
Options that affects the request behavior
Returns
Promise
<Pin
>
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
Inherited from
getPostageBatch()
getPostageBatch(
postageBatchId
,options?
):Promise
<PostageBatch
>
Defined in: bee-js/src/bee.ts:1805
Return details for specific postage batch.
Parameters
postageBatchId
Batch ID
string
| Uint8Array
<ArrayBufferLike
> | BatchId
options?
Returns
Promise
<PostageBatch
>
See
Inherited from
getPostageBatchBuckets()
getPostageBatchBuckets(
postageBatchId
,options?
):Promise
<PostageBatchBuckets
>
Defined in: bee-js/src/bee.ts:1822
Return detailed information related to buckets for specific postage batch.
Parameters
postageBatchId
Batch ID
string
| Uint8Array
<ArrayBufferLike
> | BatchId
options?
Returns
Promise
<PostageBatchBuckets
>
See
- Bee docs - Keep your data alive / Postage stamps
- Bee Debug API reference -
GET /stamps/${id}/buckets
Inherited from
getPostageBatches()
getPostageBatches(
options?
):Promise
<PostageBatch
[]>
Defined in: bee-js/src/bee.ts:1856
Return all postage batches that belong to the node.
Parameters
options?
Returns
Promise
<PostageBatch
[]>
See
Inherited from
getReadiness()
getReadiness(
options?
):Promise
<Readiness
>
Defined in: bee-js/src/bee.ts:1527
Get readiness of node
Parameters
options?
Returns
Promise
<Readiness
>
Inherited from
getRedistributionState()
getRedistributionState(
options?
):Promise
<RedistributionState
>
Defined in: bee-js/src/bee.ts:1960
Get current status of node in redistribution game
Parameters
options?
Returns
Promise
<RedistributionState
>
Inherited from
getRequestOptionsForCall()
protected
getRequestOptionsForCall(options?
):BeeRequestOptions
Defined in: bee-js/src/bee.ts:1983
Parameters
options?
Returns
Inherited from
getReserveState()
getReserveState(
options?
):Promise
<ReserveState
>
Defined in: bee-js/src/bee.ts:1572
Get reserve state
Parameters
options?
Returns
Promise
<ReserveState
>
Inherited from
getSettlements()
getSettlements(
address
,options?
):Promise
<Settlements
>
Defined in: bee-js/src/bee.ts:1497
Get amount of sent and received from settlements with a peer
Parameters
address
Swarm address of peer
string
| PeerAddress
options?
Returns
Promise
<Settlements
>
Inherited from
getSizeExtensionCost()
getSizeExtensionCost(
postageBatchId
,size
,options?
):Promise
<BZZ
>
Defined in: bee-js/src/bee.ts:1717
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
size
options?
Returns
Promise
<BZZ
>
Inherited from
getStake()
getStake(
options?
):Promise
<BZZ
>
Defined in: bee-js/src/bee.ts:1928
Gets the staked amount of BZZ (in PLUR unit) as number string.
Parameters
options?
Returns
Promise
<BZZ
>
Inherited from
getStatus()
getStatus(
options?
):Promise
<DebugStatus
>
Defined in: bee-js/src/bee.ts:1513
Get status of node
Parameters
options?
Returns
Promise
<DebugStatus
>
Inherited from
getStorageCost()
getStorageCost(
size
,duration
,options?
):Promise
<BZZ
>
Defined in: bee-js/src/bee.ts:1666
Parameters
size
duration
options?
Returns
Promise
<BZZ
>
Inherited from
getTopology()
getTopology(
options?
):Promise
<Topology
>
Defined in: bee-js/src/bee-dev.ts:26
Parameters
options?
Returns
Promise
<Topology
>
Overrides
getVersions()
getVersions(
options?
):Promise
<BeeVersions
>
Defined in: bee-js/src/bee.ts:1565
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?
Returns
Promise
<BeeVersions
>
Inherited from
getWalletBalance()
getWalletBalance(
options?
):Promise
<WalletBalance
>
Defined in: bee-js/src/bee.ts:1588
Get wallet balances for xDai and BZZ of the Bee node
Parameters
options?
Returns
Promise
<WalletBalance
>
Inherited from
gsocMine()
gsocMine(
targetOverlay
,identifier
,proximity
):PrivateKey
Defined in: bee-js/src/bee.ts:1034
Parameters
targetOverlay
string
| Uint8Array
<ArrayBufferLike
> | PeerAddress
identifier
string
| Uint8Array
<ArrayBufferLike
> | Identifier
proximity
number
= 12
Returns
Inherited from
gsocSend()
gsocSend(
postageBatchId
,signer
,identifier
,data
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:1054
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
signer
string
| Uint8Array
<ArrayBufferLike
> | PrivateKey
identifier
string
| Uint8Array
<ArrayBufferLike
> | Identifier
data
string
| Uint8Array
<ArrayBufferLike
>
options?
requestOptions?
Returns
Promise
<UploadResult
>
Inherited from
gsocSubscribe()
gsocSubscribe(
address
,identifier
,handler
):GsocSubscription
Defined in: bee-js/src/bee.ts:1072
Parameters
address
string
| Uint8Array
<ArrayBufferLike
> | EthAddress
identifier
string
| Uint8Array
<ArrayBufferLike
> | Identifier
handler
Returns
Inherited from
hashDirectory()
hashDirectory(
dir
):Promise
<Reference
>
Defined in: bee-js/src/bee.ts:541
Parameters
dir
string
Returns
Promise
<Reference
>
Inherited from
isConnected()
isConnected(
options?
):Promise
<boolean
>
Defined in: bee-js/src/bee.ts:1275
Ping the Bee node to see if there is a live Bee node on the given URL.
Parameters
options?
Options that affects the request behavior
Returns
Promise
<boolean
>
true if successful, false on error
Inherited from
isFeedRetrievable()
isFeedRetrievable(
owner
,topic
,index?
,options?
,requestOptions?
):Promise
<boolean
>
Defined in: bee-js/src/bee.ts:842
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
topic
string
| Uint8Array
<ArrayBufferLike
> | Topic
index?
options?
requestOptions?
Returns
Promise
<boolean
>
Inherited from
isReferenceRetrievable()
isReferenceRetrievable(
reference
,options?
):Promise
<boolean
>
Defined in: bee-js/src/bee.ts:818
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
options?
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
Inherited from
isSupportedApiVersion()
isSupportedApiVersion(
options?
):Promise
<boolean
>
Defined in: bee-js/src/bee.ts:1555
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?
Returns
Promise
<boolean
>
Inherited from
isSupportedExactVersion()
isSupportedExactVersion(
options?
):Promise
<boolean
>
Defined in: bee-js/src/bee.ts:1543
Connects to a node and checks if its version matches with the one that bee-js supports.
Parameters
options?
Returns
Promise
<boolean
>
Inherited from
makeFeedReader()
makeFeedReader(
topic
,owner
,options?
):FeedReader
Defined in: bee-js/src/bee.ts:1159
Make a new feed reader for downloading feed updates.
Parameters
topic
Topic in hex or bytes
string
| Uint8Array
<ArrayBufferLike
> | Topic
owner
Owner's ethereum address in hex or bytes
string
| Uint8Array
<ArrayBufferLike
> | EthAddress
options?
Options that affects the request behavior
Returns
See
Inherited from
makeFeedWriter()
makeFeedWriter(
topic
,signer?
,options?
):FeedWriter
Defined in: bee-js/src/bee.ts:1179
Make a new feed writer for updating feeds
Parameters
topic
Topic in hex or bytes
string
| Uint8Array
<ArrayBufferLike
> | Topic
signer?
The signer's private key or a Signer instance that can sign data
string
| Uint8Array
<ArrayBufferLike
> | PrivateKey
options?
Options that affects the request behavior
Returns
See
Inherited from
makeSOCReader()
makeSOCReader(
ownerAddress
,options?
):SOCReader
Defined in: bee-js/src/bee.ts:1212
Returns an object for reading single owner chunks
Parameters
ownerAddress
The ethereum address of the owner
string
| Uint8Array
<ArrayBufferLike
> | EthAddress
options?
Options that affects the request behavior
Returns
See
Inherited from
makeSOCWriter()
makeSOCWriter(
signer?
,options?
):SOCWriter
Defined in: bee-js/src/bee.ts:1228
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
options?
Options that affects the request behavior
Returns
See
Inherited from
patchGrantees()
patchGrantees(
postageBatchId
,reference
,history
,grantees
,requestOptions?
):Promise
<GranteesResult
>
Defined in: bee-js/src/bee.ts:382
Updates the grantees of a specific reference and history.
Parameters
postageBatchId
The ID of the postage batch.
string
| Uint8Array
<ArrayBufferLike
> | BatchId
reference
The reference.
string
| Uint8Array
<ArrayBufferLike
> | Reference
history
The history.
string
| Uint8Array
<ArrayBufferLike
> | Reference
grantees
The grantees.
add?
string
[] | Uint8Array
<ArrayBufferLike
>[] | PublicKey
[]
revoke?
string
[] | Uint8Array
<ArrayBufferLike
>[] | PublicKey
[]
requestOptions?
Optional request options.
Returns
Promise
<GranteesResult
>
A Promise that resolves to to a GranteesResult
object.
Inherited from
pin()
pin(
reference
,options?
):Promise
<void
>
Defined in: bee-js/src/bee.ts:739
Pin local data with given reference
Parameters
reference
Data reference
string
| Uint8Array
<ArrayBufferLike
> | Reference
options?
Options that affects the request behavior
Returns
Promise
<void
>
Throws
TypeError if reference is in not correct format
See
Inherited from
pingPeer()
pingPeer(
peer
,options?
):Promise
<PingResponse
>
Defined in: bee-js/src/bee.ts:1312
Parameters
peer
string
| PeerAddress
options?
Returns
Promise
<PingResponse
>
Inherited from
probeData()
probeData(
reference
,options?
):Promise
<ReferenceInformation
>
Defined in: bee-js/src/bee.ts:224
Requests content length for a /bytes
reference
Parameters
reference
string
| Uint8Array
<ArrayBufferLike
> | Reference
options?
Returns
Promise
<ReferenceInformation
>
See
Bee API reference - HEAD /bytes/
Inherited from
pssReceive()
pssReceive(
topic
,timeoutMsec
):Promise
<Bytes
>
Defined in: bee-js/src/bee.ts:1005
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 name
timeoutMsec
number
= 0
Timeout in milliseconds
Returns
Promise
<Bytes
>
Message in byte array
See
Inherited from
pssSend()
pssSend(
postageBatchId
,topic
,target
,data
,recipient?
,options?
):Promise
<void
>
Defined in: bee-js/src/bee.ts:904
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
topic
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
options?
Options that affects the request behavior
Returns
Promise
<void
>
Throws
TypeError if data
, batchId
, target
or recipient
are in invalid format
See
Inherited from
pssSubscribe()
pssSubscribe(
topic
,handler
):PssSubscription
Defined in: bee-js/src/bee.ts:938
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 name
handler
Message handler interface
Returns
Subscription to a given topic
See
Inherited from
rchash()
rchash(
depth
,anchor1
,anchor2
,options?
):Promise
<number
>
Defined in: bee-js/src/bee.ts:1255
Get reserve commitment hash duration seconds
Parameters
depth
number
anchor1
string
anchor2
string
options?
Returns
Promise
<number
>
Inherited from
rebroadcastPendingTransaction()
rebroadcastPendingTransaction(
transactionHash
,options?
):Promise
<TransactionId
>
Defined in: bee-js/src/bee.ts:1893
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
options?
Returns
Promise
<TransactionId
>
Inherited from
Bee
.rebroadcastPendingTransaction
removePeer()
removePeer(
peer
,options?
):Promise
<RemovePeerResponse
>
Defined in: bee-js/src/bee.ts:1302
Parameters
peer
string
| PeerAddress
options?
Returns
Promise
<RemovePeerResponse
>
Inherited from
retrieveTag()
retrieveTag(
tagUid
,options?
):Promise
<Tag
>
Defined in: bee-js/src/bee.ts:684
Retrieve tag information from Bee node
Parameters
tagUid
UID or tag object to be retrieved
number
| Tag
options?
Options that affects the request behavior
Returns
Promise
<Tag
>
Throws
TypeError if tagUid is in not correct format
See
Inherited from
reuploadPinnedData()
reuploadPinnedData(
postageBatchId
,reference
,options?
):Promise
<void
>
Defined in: bee-js/src/bee.ts:797
Instructs the Bee node to reupload a locally pinned data into the network.
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
reference
Bee data reference to be re-uploaded in hex string (either 64 or 128 chars long) or ENS domain.
string
| Uint8Array
<ArrayBufferLike
> | Reference
options?
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
Inherited from
streamDirectory()
streamDirectory(
postageBatchId
,dir
,onUploadProgress?
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:545
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
dir
string
onUploadProgress?
(progress
) => void
options?
requestOptions?
Returns
Promise
<UploadResult
>
Inherited from
streamFiles()
streamFiles(
postageBatchId
,files
,onUploadProgress?
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:564
Parameters
postageBatchId
string
| Uint8Array
<ArrayBufferLike
> | BatchId
files
File
[] | FileList
onUploadProgress?
(progress
) => void
options?
requestOptions?
Returns
Promise
<UploadResult
>
Inherited from
topUpBatch()
topUpBatch(
postageBatchId
,amount
,options?
):Promise
<BatchId
>
Defined in: bee-js/src/bee.ts:1761
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.
Parameters
postageBatchId
Batch ID
string
| Uint8Array
<ArrayBufferLike
> | BatchId
amount
Amount to be added to the batch
string
| bigint
| NumberString
options?
Request options
Returns
Promise
<BatchId
>
See
- Bee docs - Keep your data alive / Postage stamps
- Bee Debug API reference -
PATCH /stamps/topup/${id}/${amount}
Inherited from
unpin()
unpin(
reference
,options?
):Promise
<void
>
Defined in: bee-js/src/bee.ts:754
Unpin local data with given reference
Parameters
reference
Data reference
string
| Uint8Array
<ArrayBufferLike
> | Reference
options?
Options that affects the request behavior
Returns
Promise
<void
>
Throws
TypeError if reference is in not correct format
See
Inherited from
updateTag()
updateTag(
tagUid
,reference
,options?
):Promise
<void
>
Defined in: bee-js/src/bee.ts:722
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
reference
The root reference that contains all the chunks to be counted
string
| Reference
options?
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
Inherited from
uploadChunk()
uploadChunk(
stamp
,data
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:288
Upload chunk to a Bee node
Parameters
stamp
string
| Uint8Array
<ArrayBufferLike
> | BatchId
| EnvelopeWithBatchId
data
Raw chunk to be uploaded
Uint8Array
<ArrayBufferLike
> | Chunk
options?
Additional options like tag, encryption, pinning, content-type and request options
requestOptions?
Returns
Promise
<UploadResult
>
reference is a content hash of the data
See
Inherited from
uploadCollection()
uploadCollection(
postageBatchId
,collection
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:593
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
collection
options?
Collections and request options
requestOptions?
Returns
Promise
<UploadResult
>
Inherited from
uploadData()
uploadData(
postageBatchId
,data
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:203
Upload data to a Bee node
Parameters
postageBatchId
Postage BatchId to be used to upload the data with
string
| Uint8Array
<ArrayBufferLike
> | BatchId
data
Data to be uploaded
string
| Uint8Array
<ArrayBufferLike
>
options?
Additional options like tag, encryption, pinning, content-type and request options
requestOptions?
Returns
Promise
<UploadResult
>
reference is a content hash of the data
See
Inherited from
uploadFile()
uploadFile(
postageBatchId
,data
,name?
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:420
Upload single file to a Bee node.
Parameters
postageBatchId
Postage BatchId to be used to upload the data with
string
| Uint8Array
<ArrayBufferLike
> | BatchId
data
Data or file to be uploaded
string
| Uint8Array
<ArrayBufferLike
> | File
| Readable
name?
string
Optional name of the uploaded file
options?
Additional options like tag, encryption, pinning, content-type and request options
requestOptions?
Returns
Promise
<UploadResult
>
reference is a content hash of the file
See
- Bee docs - Keep your data alive / Postage stamps
- Bee docs - Upload and download
- Bee API reference -
POST /bzz
Inherited from
uploadFiles()
uploadFiles(
postageBatchId
,fileList
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:524
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
fileList
list of files to be uploaded
File
[] | FileList
options?
Additional options like tag, encryption, pinning and request options
requestOptions?
Returns
Promise
<UploadResult
>
See
- Bee docs - Keep your data alive / Postage stamps
- Bee docs - Upload directory
- Bee API reference -
POST /bzz
Inherited from
uploadFilesFromDirectory()
uploadFilesFromDirectory(
postageBatchId
,dir
,options?
,requestOptions?
):Promise
<UploadResult
>
Defined in: bee-js/src/bee.ts:625
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
dir
string
the path of the files to be uploaded
options?
Additional options like tag, encryption, pinning and request options
requestOptions?
Returns
Promise
<UploadResult
>
See
- Bee docs - Keep your data alive / Postage stamps
- Bee docs - Upload directory
- Bee API reference -
POST /bzz
Inherited from
withdrawTokens()
withdrawTokens(
amount
,gasPrice?
,options?
):Promise
<TransactionId
>
Defined in: bee-js/src/bee.ts:1470
Withdraw tokens from the chequebook to the overlay address
Parameters
amount
Amount of tokens to withdraw (must be positive integer)
string
| bigint
| BZZ
| NumberString
gasPrice?
Gas Price in WEI for the transaction call
string
| bigint
| NumberString
options?
Returns
Promise
<TransactionId
>
string Hash of the transaction