Skip to main content

Class: BeeDebug

Constructors

constructor

new BeeDebug(url, options?)

Parameters

NameType
urlstring
options?BeeOptions

Defined in

bee-js/src/bee-debug.ts:79

Properties

url

Readonly url: string

URL on which is the Debug API of Bee node exposed

Defined in

bee-js/src/bee-debug.ts:71

Methods

cancelPendingTransaction

cancelPendingTransaction(transactionHash, gasPrice?, options?): Promise<TransactionHash>

Cancel currently pending transaction

Parameters

NameType
transactionHashstring | TransactionHash
gasPrice?NumberString
options?RequestOptions

Returns

Promise<TransactionHash>

Defined in

bee-js/src/bee-debug.ts:673


cashoutLastCheque

cashoutLastCheque(address, options?): Promise<string>

Cashout the last cheque for the peer

Parameters

NameTypeDescription
addressstring | AddressSwarm address of peer
options?CashoutOptions

Returns

Promise<string>

Defined in

bee-js/src/bee-debug.ts:293


createPostageBatch

createPostageBatch(amount, depth, options?): Promise<BatchId>

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

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

see Bee Debug API reference - POST /stamps

Parameters

NameTypeDescription
amountNumberStringAmount that represents the value per chunk, has to be greater or equal zero.
depthnumberLogarithm of the number of chunks that can be stamped with the batch.
options?PostageBatchOptionsOptions for creation of postage batch

Returns

Promise<BatchId>

Defined in

bee-js/src/bee-debug.ts:515


depositTokens

depositTokens(amount, gasPrice?, options?): Promise<string>

Deposit tokens from overlay address into chequebook

Parameters

NameTypeDescription
amountnumber | NumberStringAmount of tokens to deposit (must be positive integer)
gasPrice?NumberStringGas Price in WEI for the transaction call
options?RequestOptions-

Returns

Promise<string>

string Hash of the transaction

Defined in

bee-js/src/bee-debug.ts:307


diluteBatch

diluteBatch(postageBatchId, depth, options?): Promise<void>

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.

WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY

see Bee docs - Keep your data alive / Postage stamps

see Bee Debug API reference - PATCH /stamps/topup/${id}/${amount}

Parameters

NameTypeDescription
postageBatchIdstring | BatchIdBatch ID
depthnumberAmount to be added to the batch
options?RequestOptionsRequest options

Returns

Promise<void>

Defined in

bee-js/src/bee-debug.ts:576


getAllBalances

getAllBalances(options?): Promise<BalanceResponse>

Get the balances with all known peers including prepaid services

Parameters

NameType
options?RequestOptions

Returns

Promise<BalanceResponse>

Defined in

bee-js/src/bee-debug.ts:185


getAllPendingTransactions

getAllPendingTransactions(options?): Promise<TransactionInfo[]>

Return lists of all current pending transactions that the Bee made

Parameters

NameType
options?RequestOptions

Returns

Promise<TransactionInfo[]>

Defined in

bee-js/src/bee-debug.ts:632


getAllPostageBatch

getAllPostageBatch(options?): Promise<PostageBatch[]>

Return all postage batches that has the node available.

see Bee docs - Keep your data alive / Postage stamps

see Bee Debug API reference - GET /stamps

Parameters

NameType
options?RequestOptions

Returns

Promise<PostageBatch[]>

Defined in

bee-js/src/bee-debug.ts:623


getAllSettlements

getAllSettlements(options?): Promise<AllSettlements>

Get settlements with all known peers and total amount sent or received

Parameters

NameType
options?RequestOptions

Returns

Promise<AllSettlements>

Defined in

bee-js/src/bee-debug.ts:363


getBlocklist

getBlocklist(options?): Promise<Peer[]>

Parameters

NameType
options?RequestOptions

Returns

Promise<Peer[]>

Defined in

bee-js/src/bee-debug.ts:119


getChainState

getChainState(options?): Promise<ChainState>

Get chain state

Parameters

NameType
options?RequestOptions

Returns

Promise<ChainState>

Defined in

bee-js/src/bee-debug.ts:481


getChequebookAddress

getChequebookAddress(options?): Promise<ChequebookAddressResponse>

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

NameType
options?RequestOptions

Returns

Promise<ChequebookAddressResponse>

Defined in

bee-js/src/bee-debug.ts:234


getChequebookBalance

getChequebookBalance(options?): Promise<ChequebookBalanceResponse>

Get the balance of the chequebook

Parameters

NameType
options?RequestOptions

Returns

Promise<ChequebookBalanceResponse>

Defined in

bee-js/src/bee-debug.ts:243


getHealth

getHealth(options?): Promise<Health>

Get health of node

Parameters

NameType
options?RequestOptions

Returns

Promise<Health>

Defined in

bee-js/src/bee-debug.ts:372


getLastCashoutAction

getLastCashoutAction(address, options?): Promise<LastCashoutActionResponse>

Get last cashout action for the peer

Parameters

NameTypeDescription
addressstring | AddressSwarm address of peer
options?RequestOptions-

Returns

Promise<LastCashoutActionResponse>

Defined in

bee-js/src/bee-debug.ts:278


getLastCheques

getLastCheques(options?): Promise<LastChequesResponse>

Get last cheques for all peers

Parameters

NameType
options?RequestOptions

Returns

Promise<LastChequesResponse>

Defined in

bee-js/src/bee-debug.ts:252


getLastChequesForPeer

getLastChequesForPeer(address, options?): Promise<LastChequesForPeerResponse>

Get last cheques for the peer

Parameters

NameTypeDescription
addressstring | AddressSwarm address of peer
options?RequestOptions-

Returns

Promise<LastChequesForPeerResponse>

Defined in

bee-js/src/bee-debug.ts:263


getNodeAddresses

getNodeAddresses(options?): Promise<NodeAddresses>

Parameters

NameType
options?RequestOptions

Returns

Promise<NodeAddresses>

Defined in

bee-js/src/bee-debug.ts:113


getNodeInfo

getNodeInfo(options?): Promise<NodeInfo>

Get mode information of node

Parameters

NameType
options?RequestOptions

Returns

Promise<NodeInfo>

Defined in

bee-js/src/bee-debug.ts:381


getPastDueConsumptionBalances

getPastDueConsumptionBalances(options?): Promise<BalanceResponse>

Get the past due consumption balances with all known peers

Parameters

NameType
options?RequestOptions

Returns

Promise<BalanceResponse>

Defined in

bee-js/src/bee-debug.ts:206


getPastDueConsumptionPeerBalance

getPastDueConsumptionPeerBalance(address, options?): Promise<PeerBalance>

Get the past due consumption balance with a specific peer

Parameters

NameTypeDescription
addressstring | AddressSwarm address of peer
options?RequestOptions-

Returns

Promise<PeerBalance>

Defined in

bee-js/src/bee-debug.ts:217


getPeerBalance

getPeerBalance(address, options?): Promise<PeerBalance>

Get the balances with a specific peer including prepaid services

Parameters

NameTypeDescription
addressstring | AddressSwarm address of peer
options?RequestOptions-

Returns

Promise<PeerBalance>

Defined in

bee-js/src/bee-debug.ts:196


getPeers

getPeers(options?): Promise<Peer[]>

Get list of peers for this node

Parameters

NameType
options?RequestOptions

Returns

Promise<Peer[]>

Defined in

bee-js/src/bee-debug.ts:152


getPendingTransaction

getPendingTransaction(transactionHash, options?): Promise<TransactionInfo>

Return transaction information for specific transaction

Parameters

NameType
transactionHashstring | TransactionHash
options?RequestOptions

Returns

Promise<TransactionInfo>

Defined in

bee-js/src/bee-debug.ts:642


getPostageBatch

getPostageBatch(postageBatchId, options?): Promise<PostageBatch>

Return details for specific postage batch.

see Bee docs - Keep your data alive / Postage stamps

see Bee Debug API reference - GET /stamps/${id}

Parameters

NameTypeDescription
postageBatchIdstring | BatchIdBatch ID
options?RequestOptions-

Returns

Promise<PostageBatch>

Defined in

bee-js/src/bee-debug.ts:592


getPostageBatchBuckets

getPostageBatchBuckets(postageBatchId, options?): Promise<PostageBatchBuckets>

Return detailed information related to buckets for specific postage batch.

see Bee docs - Keep your data alive / Postage stamps

see Bee Debug API reference - GET /stamps/${id}/buckets

Parameters

NameTypeDescription
postageBatchIdstring | BatchIdBatch ID
options?RequestOptions-

Returns

Promise<PostageBatchBuckets>

Defined in

bee-js/src/bee-debug.ts:607


getReserveState

getReserveState(options?): Promise<ReserveState>

Get reserve state

Parameters

NameType
options?RequestOptions

Returns

Promise<ReserveState>

Defined in

bee-js/src/bee-debug.ts:472


getSettlements

getSettlements(address, options?): Promise<Settlements>

Get amount of sent and received from settlements with a peer

Parameters

NameTypeDescription
addressstring | AddressSwarm address of peer
options?RequestOptions-

Returns

Promise<Settlements>

Defined in

bee-js/src/bee-debug.ts:353


getTopology

getTopology(options?): Promise<Topology>

Parameters

NameType
options?RequestOptions

Returns

Promise<Topology>

Defined in

bee-js/src/bee-debug.ts:165


getVersions

getVersions(options?): Promise<BeeVersions>

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

NameType
options?RequestOptions

Returns

Promise<BeeVersions>

Defined in

bee-js/src/bee-debug.ts:463


getWalletBalance

getWalletBalance(options?): Promise<WalletBalance>

Get wallet balances for xDai and BZZ of the Bee node

Parameters

NameType
options?RequestOptions

Returns

Promise<WalletBalance>

Defined in

bee-js/src/bee-debug.ts:492


isSupportedApiVersion

isSupportedApiVersion(options?): Promise<boolean>

Connects to a node and checks if its Main and Debug API versions 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

NameType
options?RequestOptions

Returns

Promise<boolean>

Defined in

bee-js/src/bee-debug.ts:451


isSupportedDebugApiVersion

isSupportedDebugApiVersion(options?): Promise<boolean>

Connects to a node and checks if its Debug API version matches with the one that bee-js supports.

This is useful if you are not using Bee class in your application and want to make sure about compatibility.

Parameters

NameType
options?RequestOptions

Returns

Promise<boolean>

Defined in

bee-js/src/bee-debug.ts:437


isSupportedExactVersion

isSupportedExactVersion(options?): Promise<boolean>

Connects to a node and checks if its version matches with the one that bee-js supports.

Be aware that this is the most strict version check and most probably you will want to use more relaxed API-versions based checks like BeeDebug.isSupportedApiVersion(), BeeDebug.isSupportedMainApiVersion() or BeeDebug.isSupportedDebugApiVersion() based on your use-case.

Parameters

NameType
options?RequestOptions

Returns

Promise<boolean>

Defined in

bee-js/src/bee-debug.ts:409


isSupportedMainApiVersion

isSupportedMainApiVersion(options?): Promise<boolean>

Connects to a node and checks if its main's API version matches with the one that bee-js supports.

This is useful if you are not using BeeDebug class (for anything else then this check) and want to make sure about compatibility.

Parameters

NameType
options?RequestOptions

Returns

Promise<boolean>

Defined in

bee-js/src/bee-debug.ts:423


isSupportedVersion

isSupportedVersion(options?): Promise<boolean>

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

deprecated Use BeeDebug.isSupportedExactVersion() instead

Parameters

NameType
options?RequestOptions

Returns

Promise<boolean>

true if the Bee node version is supported

Defined in

bee-js/src/bee-debug.ts:393


pingPeer

pingPeer(peer, options?): Promise<PingResponse>

Parameters

NameType
peerstring | Address
options?RequestOptions

Returns

Promise<PingResponse>

Defined in

bee-js/src/bee-debug.ts:171


rebroadcastPendingTransaction

rebroadcastPendingTransaction(transactionHash, options?): Promise<TransactionHash>

Rebroadcast already created transaction. This is mainly needed when your transaction fall off mempool from other reason is not incorporated into block.

Parameters

NameType
transactionHashstring | TransactionHash
options?RequestOptions

Returns

Promise<TransactionHash>

Defined in

bee-js/src/bee-debug.ts:658


removePeer

removePeer(peer, options?): Promise<RemovePeerResponse>

Parameters

NameType
peerstring | Address
options?RequestOptions

Returns

Promise<RemovePeerResponse>

Defined in

bee-js/src/bee-debug.ts:158


retrieveExtendedTag

retrieveExtendedTag(tagUid, options?): Promise<ExtendedTag>

Retrieve tag extended information from Bee node

throws TypeError if tagUid is in not correct format

see Bee docs - Syncing / Tags

see Bee API reference - GET /tags/{uid}

Parameters

NameTypeDescription
tagUidnumber | TagUID or tag object to be retrieved
options?RequestOptions-

Returns

Promise<ExtendedTag>

Defined in

bee-js/src/bee-debug.ts:135


topUpBatch

topUpBatch(postageBatchId, amount, options?): Promise<void>

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.

WARNING: THIS CREATES TRANSACTIONS THAT SPENDS MONEY

see Bee docs - Keep your data alive / Postage stamps

see Bee Debug API reference - PATCH /stamps/topup/${id}/${amount}

Parameters

NameTypeDescription
postageBatchIdstring | BatchIdBatch ID
amountNumberStringAmount to be added to the batch
options?RequestOptionsRequest options

Returns

Promise<void>

Defined in

bee-js/src/bee-debug.ts:552


withdrawTokens

withdrawTokens(amount, gasPrice?, options?): Promise<string>

Withdraw tokens from the chequebook to the overlay address

Parameters

NameTypeDescription
amountnumber | NumberStringAmount of tokens to withdraw (must be positive integer)
gasPrice?NumberStringGas Price in WEI for the transaction call
options?RequestOptions-

Returns

Promise<string>

string Hash of the transaction

Defined in

bee-js/src/bee-debug.ts:329