Skip to main content

Class: Chequebook

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

Chequebook contract operations (address, balance, deposit, withdraw).

Accessed as bee.chequebook.

Constructors

Constructor

new Chequebook(context): Chequebook

Defined in: bee-js/src/modules/chequebook.ts:14

Parameters

context

BeeContext

Returns

Chequebook

Methods

deposit()

deposit(amount, gasPrice?, requestOptions?): Promise<TransactionId>

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

Deposits tokens from the node wallet into the chequebook.

Parameters

amount

Amount of BZZ tokens to deposit. If not providing a BZZ instance, the amount is denoted in PLUR.

string | bigint | BZZ | NumberString

gasPrice?

Gas Price in WEI for the transaction call

string | bigint | NumberString

requestOptions?

BeeRequestOptions

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

Returns

Promise<TransactionId>


getAddress()

getAddress(requestOptions?): Promise<ChequebookAddressResponse>

Defined in: bee-js/src/modules/chequebook.ts:21

Gets the address of the deployed chequebook.

Parameters

requestOptions?

BeeRequestOptions

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

Returns

Promise<ChequebookAddressResponse>


getBalance()

getBalance(requestOptions?): Promise<ChequebookBalanceResponse>

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

Gets the balance of the chequebook.

Parameters

requestOptions?

BeeRequestOptions

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

Returns

Promise<ChequebookBalanceResponse>


withdraw()

withdraw(amount, gasPrice?, requestOptions?): Promise<TransactionId>

Defined in: bee-js/src/modules/chequebook.ts:61

Withdraws tokens from the chequebook to the node wallet.

Parameters

amount

Amount of BZZ tokens to withdraw. If not providing a BZZ instance, the amount is denoted in PLUR.

string | bigint | BZZ | NumberString

gasPrice?

Gas Price in WEI for the transaction call.

string | bigint | NumberString

requestOptions?

BeeRequestOptions

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

Returns

Promise<TransactionId>

💬 Get Help