Blockchain

The Blockchain object keeps the state of all accounts and contracts.

Methods#

constructor(config: THydraConfig): void#

Creates a new blockchain object

createAccount(accountName: string,ownerAuth?: TAuthority, activeAuth?: TAuthority): Account#

Creates a new account

sendTransaction(transaction: TTransaction): Promise<TTransactionTrace>#

Executes a transactions

getDeferredTransactions(): TDeferredTransaction[]#

Gets all deferred transactions

clearDeferredTransactions(): void#

Clears all deferred transactions

setCurrentTime(date: Date): void#

Sets the current time of the blockchain changing the value returned by eosio::current_time_point and similar intrinsics.

setProtocolFeature(featureName: TProtocolFeature, enable: boolean): void#

Enable or disable an EOSIO protocol feature

Fields#

contractTemplates: Dictionary<ContractTemplate>#

Gets configured contract templates that can be used for setContract. Contract templates are configured through the config parameter in the constructor

accounts: Dictionary<Account>#

Gets all user-created and default-created accounts. Keyed by account name