/// /// import { ECPoint } from '@neo-one/client-common'; import BN from 'bn.js'; import { Observable } from 'rxjs'; import { Account, AccountKey, AccountUpdate } from './Account'; import { AccountUnclaimed, AccountUnclaimedKey, AccountUnclaimedsKey } from './AccountUnclaimed'; import { AccountUnspent, AccountUnspentKey, AccountUnspentsKey } from './AccountUnspent'; import { Action, ActionKey, ActionsKey } from './action'; import { Asset, AssetKey, AssetUpdate } from './Asset'; import { Block, BlockKey } from './Block'; import { BlockData, BlockDataKey } from './BlockData'; import { CallReceipt } from './CallReceipt'; import { Contract, ContractKey } from './Contract'; import { Header, HeaderKey } from './Header'; import { InvocationData, InvocationDataKey } from './InvocationData'; import { ConsensusPayload } from './payload'; import { DeserializeWireContext, SerializeJSONContext } from './Serializable'; import { Settings } from './Settings'; import { StorageItem, StorageItemKey, StorageItemsKey, StorageItemUpdate } from './StorageItem'; import { FeeContext, Input, InvocationTransaction, Output, OutputKey, Transaction, TransactionKey } from './transaction'; import { TransactionData, TransactionDataKey, TransactionDataUpdate } from './TransactionData'; import { Validator, ValidatorKey } from './Validator'; import { ValidatorsCount, ValidatorsCountUpdate } from './ValidatorsCount'; import { VerifyScriptResult } from './vm'; export interface ReadMetadataStorage { readonly get: () => Promise; readonly tryGet: () => Promise; } export interface ReadStorage { readonly get: (key: Key) => Promise; readonly tryGet: (key: Key) => Promise; } export interface ReadAllStorage extends ReadStorage { readonly all$: Observable; } export interface ReadGetAllStorage extends ReadStorage { readonly getAll$: (key: PartialKey) => Observable; } export interface AddMetadataStorage { readonly add: (add: Value) => Promise; } export interface AddStorage { readonly add: (add: Value) => Promise; } export interface AddUpdateMetadataStorage extends AddMetadataStorage { readonly update: (value: Value, update: Update) => Promise; } export interface AddUpdateStorage extends AddStorage { readonly update: (value: Value, update: Update) => Promise; } export interface DeleteMetadataStorage { readonly delete: () => Promise; } export interface DeleteStorage { readonly delete: (key: Key) => Promise; } export interface AddUpdateDeleteMetadataStorage extends AddUpdateMetadataStorage, DeleteMetadataStorage { } export interface AddDeleteStorage extends AddStorage, DeleteStorage { } export interface AddUpdateDeleteStorage extends AddUpdateStorage, DeleteStorage { } interface ReadAddStorage extends ReadStorage, AddStorage { } interface ReadAddDeleteStorage extends ReadStorage, AddStorage, DeleteStorage { } interface ReadAddUpdateMetadataStorage extends ReadMetadataStorage, AddUpdateMetadataStorage { } interface ReadAddUpdateStorage extends ReadStorage, AddUpdateStorage { } interface ReadGetAllAddDeleteStorage extends ReadGetAllStorage, AddDeleteStorage { } interface ReadAllAddStorage extends ReadAllStorage, AddStorage { } interface ReadAllAddUpdateDeleteStorage extends ReadAllStorage, AddUpdateDeleteStorage { } interface ReadGetAllAddStorage extends ReadGetAllStorage, AddStorage { } interface ReadGetAllAddUpdateDeleteStorage extends ReadGetAllStorage, AddUpdateDeleteStorage { } export interface BlockchainStorage { readonly account: ReadAllStorage; readonly accountUnclaimed: ReadGetAllStorage; readonly accountUnspent: ReadGetAllStorage; readonly action: ReadGetAllStorage; readonly asset: ReadStorage; readonly block: ReadStorage; readonly blockData: ReadStorage; readonly header: ReadStorage; readonly transaction: ReadStorage; readonly transactionData: ReadStorage; readonly output: ReadStorage; readonly contract: ReadStorage; readonly storageItem: ReadGetAllStorage; readonly validator: ReadAllStorage; readonly invocationData: ReadStorage; readonly validatorsCount: ReadMetadataStorage; } export interface VerifyTransactionResult { readonly verifications: readonly VerifyScriptResult[]; } export interface Blockchain extends BlockchainStorage { readonly settings: Settings; readonly deserializeWireContext: DeserializeWireContext; readonly serializeJSONContext: SerializeJSONContext; readonly feeContext: FeeContext; readonly currentBlock: Block; readonly previousBlock: Block | undefined; readonly currentHeader: Header; readonly currentBlockIndex: number; readonly block$: Observable; readonly isPersistingBlock: boolean; readonly persistBlock: (options: { readonly block: Block; readonly unsafe?: boolean; }) => Promise; readonly persistHeaders: (headers: readonly Header[]) => Promise; readonly verifyBlock: (block: Block) => Promise; readonly verifyTransaction: (param0: { readonly transaction: Transaction; readonly memPool?: readonly Transaction[]; }) => Promise; readonly verifyConsensusPayload: (payload: ConsensusPayload) => Promise; readonly getValidators: (transactions: readonly Transaction[]) => Promise; readonly invokeScript: (script: Buffer) => Promise; readonly invokeTransaction: (transaction: InvocationTransaction) => Promise; readonly calculateClaimAmount: (inputs: readonly Input[]) => Promise; readonly updateSettings: (settings: Settings) => void; readonly stop: () => Promise; readonly reset: () => Promise; } export interface WriteBlockchain { readonly settings: Blockchain['settings']; readonly currentBlock: Blockchain['currentBlock']; readonly currentHeader: Blockchain['currentHeader']; readonly currentBlockIndex: number; readonly getValidators: Blockchain['getValidators']; readonly account: ReadAllAddUpdateDeleteStorage; readonly accountUnclaimed: ReadGetAllAddDeleteStorage; readonly accountUnspent: ReadGetAllAddDeleteStorage; readonly action: ReadGetAllAddStorage; readonly asset: ReadAddUpdateStorage; readonly block: ReadAddStorage; readonly blockData: ReadAddStorage; readonly header: ReadAddStorage; readonly transaction: ReadAddStorage; readonly transactionData: ReadAddUpdateStorage; readonly output: Blockchain['output']; readonly contract: ReadAddDeleteStorage; readonly storageItem: ReadGetAllAddUpdateDeleteStorage; readonly validator: ReadAllAddStorage; readonly invocationData: ReadAddStorage; readonly validatorsCount: ReadAddUpdateMetadataStorage; } export {};