Class: BeeDebug
Constructors
constructor
• new BeeDebug(url
, options?
)
Parameters
Name | Type |
---|---|
url | string |
options? | BeeOptions |
Defined in
Properties
url
• Readonly
url: string
URL on which is the Debug API of Bee node exposed
Defined in
Methods
cancelPendingTransaction
▸ cancelPendingTransaction(transactionHash
, gasPrice?
, options?
): Promise
<TransactionHash
>
Cancel currently pending transaction
Parameters
Name | Type |
---|---|
transactionHash | string | TransactionHash |
gasPrice? | NumberString |
options? | RequestOptions |
Returns
Promise
<TransactionHash
>
Defined in
cashoutLastCheque
▸ cashoutLastCheque(address
, options?
): Promise
<string
>
Cashout the last cheque for the peer
Parameters
Name | Type | Description |
---|---|---|
address | string | Address | Swarm address of peer |
options? | CashoutOptions |
Returns
Promise
<string
>
Defined in
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
Name | Type | Description |
---|---|---|
amount | NumberString | Amount that represents the value per chunk, has to be greater or equal zero. |
depth | number | Logarithm of the number of chunks that can be stamped with the batch. |
options? | PostageBatchOptions | Options for creation of postage batch |
Returns
Promise
<BatchId
>
Defined in
depositTokens
▸ depositTokens(amount
, gasPrice?
, options?
): Promise
<string
>
Deposit tokens from overlay address into chequebook
Parameters
Name | Type | Description |
---|---|---|
amount | number | NumberString | Amount of tokens to deposit (must be positive integer) |
gasPrice? | NumberString | Gas Price in WEI for the transaction call |
options? | RequestOptions | - |
Returns
Promise
<string
>
string Hash of the transaction
Defined in
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
Name | Type | Description |
---|---|---|
postageBatchId | string | BatchId | Batch ID |
depth | number | Amount to be added to the batch |
options? | RequestOptions | Request options |
Returns
Promise
<void
>
Defined in
getAllBalances
▸ getAllBalances(options?
): Promise
<BalanceResponse
>
Get the balances with all known peers including prepaid services
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<BalanceResponse
>
Defined in
getAllPendingTransactions
▸ getAllPendingTransactions(options?
): Promise
<TransactionInfo
[]>
Return lists of all current pending transactions that the Bee made
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<TransactionInfo
[]>
Defined in
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
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<PostageBatch
[]>
Defined in
getAllSettlements
▸ getAllSettlements(options?
): Promise
<AllSettlements
>
Get settlements with all known peers and total amount sent or received
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<AllSettlements
>
Defined in
getBlocklist
▸ getBlocklist(options?
): Promise
<Peer
[]>
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<Peer
[]>
Defined in
getChainState
▸ getChainState(options?
): Promise
<ChainState
>
Get chain state
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<ChainState
>
Defined in
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
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<ChequebookAddressResponse
>
Defined in
getChequebookBalance
▸ getChequebookBalance(options?
): Promise
<ChequebookBalanceResponse
>
Get the balance of the chequebook
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<ChequebookBalanceResponse
>
Defined in
getHealth
▸ getHealth(options?
): Promise
<Health
>
Get health of node
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<Health
>
Defined in
getLastCashoutAction
▸ getLastCashoutAction(address
, options?
): Promise
<LastCashoutActionResponse
>
Get last cashout action for the peer
Parameters
Name | Type | Description |
---|---|---|
address | string | Address | Swarm address of peer |
options? | RequestOptions | - |
Returns
Promise
<LastCashoutActionResponse
>
Defined in
getLastCheques
▸ getLastCheques(options?
): Promise
<LastChequesResponse
>
Get last cheques for all peers
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<LastChequesResponse
>
Defined in
getLastChequesForPeer
▸ getLastChequesForPeer(address
, options?
): Promise
<LastChequesForPeerResponse
>
Get last cheques for the peer
Parameters
Name | Type | Description |
---|---|---|
address | string | Address | Swarm address of peer |
options? | RequestOptions | - |
Returns
Promise
<LastChequesForPeerResponse
>
Defined in
getNodeAddresses
▸ getNodeAddresses(options?
): Promise
<NodeAddresses
>
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<NodeAddresses
>
Defined in
getNodeInfo
▸ getNodeInfo(options?
): Promise
<NodeInfo
>
Get mode information of node
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<NodeInfo
>
Defined in
getPastDueConsumptionBalances
▸ getPastDueConsumptionBalances(options?
): Promise
<BalanceResponse
>
Get the past due consumption balances with all known peers
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<BalanceResponse
>
Defined in
getPastDueConsumptionPeerBalance
▸ getPastDueConsumptionPeerBalance(address
, options?
): Promise
<PeerBalance
>
Get the past due consumption balance with a specific peer
Parameters
Name | Type | Description |
---|---|---|
address | string | Address | Swarm address of peer |
options? | RequestOptions | - |
Returns
Promise
<PeerBalance
>
Defined in
getPeerBalance
▸ getPeerBalance(address
, options?
): Promise
<PeerBalance
>
Get the balances with a specific peer including prepaid services
Parameters
Name | Type | Description |
---|---|---|
address | string | Address | Swarm address of peer |
options? | RequestOptions | - |
Returns
Promise
<PeerBalance
>
Defined in
getPeers
▸ getPeers(options?
): Promise
<Peer
[]>
Get list of peers for this node
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<Peer
[]>
Defined in
getPendingTransaction
▸ getPendingTransaction(transactionHash
, options?
): Promise
<TransactionInfo
>
Return transaction information for specific transaction
Parameters
Name | Type |
---|---|
transactionHash | string | TransactionHash |
options? | RequestOptions |
Returns
Promise
<TransactionInfo
>
Defined in
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
Name | Type | Description |
---|---|---|
postageBatchId | string | BatchId | Batch ID |
options? | RequestOptions | - |
Returns
Promise
<PostageBatch
>
Defined in
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
Name | Type | Description |
---|---|---|
postageBatchId | string | BatchId | Batch ID |
options? | RequestOptions | - |
Returns
Promise
<PostageBatchBuckets
>
Defined in
getReserveState
▸ getReserveState(options?
): Promise
<ReserveState
>
Get reserve state
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<ReserveState
>
Defined in
getSettlements
▸ getSettlements(address
, options?
): Promise
<Settlements
>
Get amount of sent and received from settlements with a peer
Parameters
Name | Type | Description |
---|---|---|
address | string | Address | Swarm address of peer |
options? | RequestOptions | - |
Returns
Promise
<Settlements
>
Defined in
getTopology
▸ getTopology(options?
): Promise
<Topology
>
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<Topology
>
Defined in
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
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<BeeVersions
>
Defined in
getWalletBalance
▸ getWalletBalance(options?
): Promise
<WalletBalance
>
Get wallet balances for xDai and BZZ of the Bee node
Parameters
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<WalletBalance
>
Defined in
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
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<boolean
>
Defined in
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
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<boolean
>
Defined in
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
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<boolean
>
Defined in
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
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<boolean
>
Defined in
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
Name | Type |
---|---|
options? | RequestOptions |
Returns
Promise
<boolean
>
true if the Bee node version is supported
Defined in
pingPeer
▸ pingPeer(peer
, options?
): Promise
<PingResponse
>
Parameters
Name | Type |
---|---|
peer | string | Address |
options? | RequestOptions |
Returns
Promise
<PingResponse
>
Defined in
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
Name | Type |
---|---|
transactionHash | string | TransactionHash |
options? | RequestOptions |
Returns
Promise
<TransactionHash
>
Defined in
removePeer
▸ removePeer(peer
, options?
): Promise
<RemovePeerResponse
>
Parameters
Name | Type |
---|---|
peer | string | Address |
options? | RequestOptions |
Returns
Promise
<RemovePeerResponse
>
Defined in
retrieveExtendedTag
▸ retrieveExtendedTag(tagUid
, options?
): Promise
<ExtendedTag
>
Retrieve tag extended information from Bee node
throws
TypeError if tagUid is in not correct format
see
Bee API reference - GET /tags/{uid}
Parameters
Name | Type | Description |
---|---|---|
tagUid | number | Tag | UID or tag object to be retrieved |
options? | RequestOptions | - |
Returns
Promise
<ExtendedTag
>
Defined in
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
Name | Type | Description |
---|---|---|
postageBatchId | string | BatchId | Batch ID |
amount | NumberString | Amount to be added to the batch |
options? | RequestOptions | Request options |
Returns
Promise
<void
>
Defined in
withdrawTokens
▸ withdrawTokens(amount
, gasPrice?
, options?
): Promise
<string
>
Withdraw tokens from the chequebook to the overlay address
Parameters
Name | Type | Description |
---|---|---|
amount | number | NumberString | Amount of tokens to withdraw (must be positive integer) |
gasPrice? | NumberString | Gas Price in WEI for the transaction call |
options? | RequestOptions | - |
Returns
Promise
<string
>
string Hash of the transaction