Home Reference Source Test
public class | source

Accounts

Extends:

Observable → Accounts

Static Method Summary

Static Public Methods
public static

async createVolatile(): Promise<Accounts>

Generate an Accounts object that loses it's data after usage.

public static

async getPersistent(jdb: *): Promise<Accounts>

Generate an Accounts object that is persisted to the local storage.

Constructor Summary

Public Constructor
public

constructor(accountsTree: AccountsTree)

Member Summary

Public Members
public get

Method Summary

Public Methods
public

abort(): Promise

public

commit(): Promise

public

async commitBlock(block: Block, transactionCache: TransactionCache): Promise

public

async commitBlockBody(body: BlockBody, blockHeight: number, transactionCache: TransactionCache): Promise

public

async gatherToBePrunedAccounts(transactions: Array<Transaction>, blockHeight: number, transactionCache: TransactionCache): Promise<Array<PrunedAccount>>

public

async get(address: Address, accountType: Account.Type, tree: AccountsTree): Promise<Account>

Gets the Account-object for an address.

public

getAccountsProof(addresses: Array<Address>): Promise<AccountsProof>

public

getAccountsTreeChunk(startPrefix: string): Promise<AccountsTreeChunk>

public

hash(): Promise<Hash>

public

async initialize(genesisBlock: Block, encodedAccounts: string): Promise<void>

public
public

async revertBlock(block: Block, transactionCache: TransactionCache): Promise

public

async revertBlockBody(body: BlockBody, blockHeight: number, transactionCache: TransactionCache): Promise

public

async snapshot(tx: Accounts): Promise<Accounts>

public

async transaction(enableWatchdog: boolean): Promise<Accounts>

Inherited Summary

From class Observable
public static get

WILDCARD: string: string

public

bubble(observable: Observable, types: ...string)

public

fire(type: string, args: ...*): Promise | null

public

off(type: string, id: number)

public

on(type: string, callback: Function): number

Static Public Methods

public static async createVolatile(): Promise<Accounts> source

Generate an Accounts object that loses it's data after usage.

Return:

Promise<Accounts>

Accounts object

public static async getPersistent(jdb: *): Promise<Accounts> source

Generate an Accounts object that is persisted to the local storage.

Params:

NameTypeAttributeDescription
jdb *

Return:

Promise<Accounts>

Accounts object

Public Constructors

public constructor(accountsTree: AccountsTree) source

Override:

Observable#constructor

Params:

NameTypeAttributeDescription
accountsTree AccountsTree

Public Members

public get tx: Transaction source

Public Methods

public abort(): Promise source

Return:

Promise

public commit(): Promise source

Return:

Promise

public async commitBlock(block: Block, transactionCache: TransactionCache): Promise source

Params:

NameTypeAttributeDescription
block Block
transactionCache TransactionCache

Return:

Promise

public async commitBlockBody(body: BlockBody, blockHeight: number, transactionCache: TransactionCache): Promise source

Params:

NameTypeAttributeDescription
body BlockBody
blockHeight number
transactionCache TransactionCache

Return:

Promise

public async gatherToBePrunedAccounts(transactions: Array<Transaction>, blockHeight: number, transactionCache: TransactionCache): Promise<Array<PrunedAccount>> source

Params:

NameTypeAttributeDescription
transactions Array<Transaction>
blockHeight number
transactionCache TransactionCache

Return:

Promise<Array<PrunedAccount>>

public async get(address: Address, accountType: Account.Type, tree: AccountsTree): Promise<Account> source

Gets the Account-object for an address.

Params:

NameTypeAttributeDescription
address Address
accountType Account.Type
  • optional
tree AccountsTree
  • optional

Return:

Promise<Account>

public getAccountsProof(addresses: Array<Address>): Promise<AccountsProof> source

Params:

NameTypeAttributeDescription
addresses Array<Address>

Return:

Promise<AccountsProof>

public getAccountsTreeChunk(startPrefix: string): Promise<AccountsTreeChunk> source

Params:

NameTypeAttributeDescription
startPrefix string

Return:

Promise<AccountsTreeChunk>

public hash(): Promise<Hash> source

Return:

Promise<Hash>

public async initialize(genesisBlock: Block, encodedAccounts: string): Promise<void> source

Params:

NameTypeAttributeDescription
genesisBlock Block
encodedAccounts string

Return:

Promise<void>

public partialAccountsTree(): Promise<PartialAccountsTree> source

Return:

Promise<PartialAccountsTree>

public async revertBlock(block: Block, transactionCache: TransactionCache): Promise source

Params:

NameTypeAttributeDescription
block Block
transactionCache TransactionCache

Return:

Promise

public async revertBlockBody(body: BlockBody, blockHeight: number, transactionCache: TransactionCache): Promise source

Params:

NameTypeAttributeDescription
body BlockBody
blockHeight number
transactionCache TransactionCache

Return:

Promise

public async snapshot(tx: Accounts): Promise<Accounts> source

Params:

NameTypeAttributeDescription
tx Accounts
  • optional

Return:

Promise<Accounts>

public async transaction(enableWatchdog: boolean): Promise<Accounts> source

Params:

NameTypeAttributeDescription
enableWatchdog boolean
  • optional

Return:

Promise<Accounts>