Skip to main content

Class: Balance

Defined in: bee-js/src/modules/balance.ts:12

SWAP balance operations. Related to the bandwidth incentives and the chequebook.

Accessed as bee.balance.

Constructors

Constructor

new Balance(context): Balance

Defined in: bee-js/src/modules/balance.ts:13

Parameters

context

BeeContext

Returns

Balance

Methods

getAll()

getAll(requestOptions?): Promise<BalanceResponse>

Defined in: bee-js/src/modules/balance.ts:20

Gets the SWAP balances with all known peers including prepaid services.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<BalanceResponse>


getAllPastDueConsumption()

getAllPastDueConsumption(requestOptions?): Promise<BalanceResponse>

Defined in: bee-js/src/modules/balance.ts:41

Gets the past due consumption balances for all known peers.

Parameters

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<BalanceResponse>


getAllPastDueConsumptionForPeer()

getAllPastDueConsumptionForPeer(address, requestOptions?): Promise<PeerBalance>

Defined in: bee-js/src/modules/balance.ts:51

Gets the past due consumption balance for a specific peer.

Parameters

address

Swarm address of peer

string | PeerAddress

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<PeerBalance>


getPeer()

getPeer(address, requestOptions?): Promise<PeerBalance>

Defined in: bee-js/src/modules/balance.ts:30

Gets the SWAP balances for a specific peer including prepaid services.

Parameters

address

Swarm address of peer

string | PeerAddress

requestOptions?

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns

Promise<PeerBalance>

💬 Get Help