Home Reference Source
public class | source

Balance

Balance class Service used to retrieve different balances from the Casper network

Constructor Summary

Public Constructor
public

Constructor

Member Summary

Public Members
public
public
public

Method Summary

Public Methods
public

Retrieve current user stake balance from the network from all validators.

public

Retrieve current user balance from the network.

public

async fetchBalanceOfPublicKey(publicKey: *): Promise<String>

Retrieve balance of a public key from the network.

public

async fetchStakeBalance(validatorPublicKey: string): Promise<BigNumber>

Retrieve current user stake balance from the network for a given validator.

public

Retrieve current validator balance from the network.

public

Retrieve validator info with cache era based

Public Constructors

public constructor(keyManager: AbstractKeyManager, client: ClientCasper) source

Constructor

Params:

NameTypeAttributeDescription
keyManager AbstractKeyManager

Instance of a KeyManager

client ClientCasper

Instance of CasperClient

Public Members

public client: ClientCasper source

public keyManager: AbstractKeyManager source

public validatorsInfo: ValidatorsInfoResult source

Public Methods

public async fetchAllStakeBalance(): Promise<*[]> source

Retrieve current user stake balance from the network from all validators.

Return:

Promise<*[]>

Current stake balance of the user

public async fetchBalance(): Promise<String> source

Retrieve current user balance from the network.

Return:

Promise<String>

Current balance of the user in CSPR

public async fetchBalanceOfPublicKey(publicKey: *): Promise<String> source

Retrieve balance of a public key from the network.

Params:

NameTypeAttributeDescription
publicKey *

Return:

Promise<String>

Current balance of the public key in CSPR

public async fetchStakeBalance(validatorPublicKey: string): Promise<BigNumber> source

Retrieve current user stake balance from the network for a given validator.

Params:

NameTypeAttributeDescription
validatorPublicKey string

Public key of the validator

Return:

Promise<BigNumber>

Current stake balance of the user

public async fetchValidatorBalance(): Promise<Object> source

Retrieve current validator balance from the network.

Return:

Promise<Object>

Current balance of the validator

public async getValidatorsInfo(): Promise<*> source

Retrieve validator info with cache era based

Return:

Promise<*>