UNPKG

@neo-one/node-blockchain-esnext-esm

Version:

NEO•ONE NEO blockchain implementation.

55 lines (54 loc) 3.71 kB
import { Account, AccountKey, AccountUnclaimed, AccountUnclaimedKey, AccountUnclaimedsKey, AccountUnspent, AccountUnspentKey, AccountUnspentsKey, AccountUpdate, Action, ActionKey, ActionsKey, Asset, AssetKey, AssetUpdate, Block, BlockchainStorage, BlockData, BlockDataKey, ChangeSet, Contract, ContractKey, Header, InvocationData, InvocationDataKey, StorageItem, StorageItemKey, StorageItemsKey, StorageItemUpdate, Transaction, TransactionData, TransactionDataKey, TransactionDataUpdate, TransactionKey, Validator, ValidatorKey, ValidatorsCount, ValidatorsCountUpdate, ValidatorUpdate, VM, WriteBlockchain } from '@neo-one/node-core-esnext-esm'; import { BlockLikeStorageCache, OutputStorageCache, ReadAddDeleteStorageCache, ReadAddStorageCache, ReadAddUpdateMetadataStorageCache, ReadAddUpdateStorageCache, ReadAllAddUpdateDeleteStorageCache, ReadGetAllAddDeleteStorageCache, ReadGetAllAddStorageCache, ReadGetAllAddUpdateDeleteStorageCache, TrackedChangeSet } from './StorageCache'; interface WriteBatchBlockchainOptions { readonly settings: WriteBlockchain['settings']; readonly currentBlock: WriteBlockchain['currentBlock'] | undefined; readonly currentHeader: WriteBlockchain['currentHeader'] | undefined; readonly storage: BlockchainStorage; readonly vm: VM; readonly getValidators: WriteBlockchain['getValidators']; } export declare class WriteBatchBlockchain { readonly settings: WriteBlockchain['settings']; readonly account: ReadAllAddUpdateDeleteStorageCache<AccountKey, Account, AccountUpdate>; readonly accountUnspent: ReadGetAllAddDeleteStorageCache<AccountUnspentKey, AccountUnspentsKey, AccountUnspent>; readonly accountUnclaimed: ReadGetAllAddDeleteStorageCache<AccountUnclaimedKey, AccountUnclaimedsKey, AccountUnclaimed>; readonly action: ReadGetAllAddStorageCache<ActionKey, ActionsKey, Action>; readonly asset: ReadAddUpdateStorageCache<AssetKey, Asset, AssetUpdate>; readonly block: BlockLikeStorageCache<Block>; readonly blockData: ReadAddStorageCache<BlockDataKey, BlockData>; readonly header: BlockLikeStorageCache<Header>; readonly transaction: ReadAddStorageCache<TransactionKey, Transaction>; readonly transactionData: ReadAddUpdateStorageCache<TransactionDataKey, TransactionData, TransactionDataUpdate>; readonly output: OutputStorageCache; readonly contract: ReadAddDeleteStorageCache<ContractKey, Contract>; readonly storageItem: ReadGetAllAddUpdateDeleteStorageCache<StorageItemKey, StorageItemsKey, StorageItem, StorageItemUpdate>; readonly validator: ReadAllAddUpdateDeleteStorageCache<ValidatorKey, Validator, ValidatorUpdate>; readonly invocationData: ReadAddStorageCache<InvocationDataKey, InvocationData>; readonly validatorsCount: ReadAddUpdateMetadataStorageCache<ValidatorsCount, ValidatorsCountUpdate>; readonly getValidators: WriteBlockchain['getValidators']; private readonly currentBlockInternal; private readonly currentHeaderInternal; private readonly storage; private readonly vm; private readonly caches; constructor(options: WriteBatchBlockchainOptions); get currentBlock(): Block; get currentBlockIndex(): number; get currentHeader(): Header; getChangeSet(): ChangeSet; getTrackedChangeSet(): TrackedChangeSet<any, any, any>; persistBlock(block: Block): Promise<void>; private persistUTXOTransactions; private persistTransactions; private persistTransaction; private processStateTransaction; private updateAccounts; private getOutputWithInput; private getInputOutputs; private groupByAddress; private updateAccount; private updateCoins; private updateCoin; } export {};