import { BinaryWriter, BlockJSON, ECPoint, UInt160, UInt256 } from '@neo-one/client-common-browserify'; import BN from 'bn.js'; import { Account, AccountKey } from './Account'; import { Asset, AssetKey } from './Asset'; import { BlockBase } from './BlockBase'; import { Header, HeaderKey } from './Header'; import { DeserializeWireBaseOptions, DeserializeWireOptions, SerializableJSON, SerializableWire, SerializeJSONContext } from './Serializable'; import { FeeContext, Input, Output, OutputKey, RegisterTransaction, Transaction, TransactionType } from './transaction'; import { Validator } from './Validator'; import { VerifyScript } from './vm'; import { Witness } from './Witness'; export interface BlockAdd { readonly version?: number; readonly previousHash: UInt256; readonly merkleRoot?: UInt256; readonly timestamp: number; readonly index: number; readonly consensusData: BN; readonly nextConsensus: UInt160; readonly script?: Witness; readonly hash?: UInt256; readonly transactions: readonly Transaction[]; } export interface BlockKey { readonly hashOrIndex: UInt256 | number; } export interface BlockVerifyOptions { readonly genesisBlock: Block; readonly tryGetBlock: (block: BlockKey) => Promise; readonly tryGetHeader: (header: HeaderKey) => Promise
; readonly isSpent: (key: OutputKey) => Promise; readonly getAsset: (key: AssetKey) => Promise; readonly getOutput: (key: OutputKey) => Promise; readonly tryGetAccount: (key: AccountKey) => Promise; readonly getValidators: (transactions: readonly Transaction[]) => Promise; readonly standbyValidators: readonly ECPoint[]; readonly getAllValidators: () => Promise; readonly calculateClaimAmount: (inputs: readonly Input[]) => Promise; readonly verifyScript: VerifyScript; readonly currentHeight: number; readonly governingToken: RegisterTransaction; readonly utilityToken: RegisterTransaction; readonly fees: { [K in TransactionType]?: BN; }; readonly registerValidatorFee: BN; readonly completely?: boolean; } export declare class Block extends BlockBase implements SerializableWire, SerializableJSON { static calculateNetworkFee(context: FeeContext, transactions: readonly Transaction[]): Promise; static deserializeWireBase(options: DeserializeWireBaseOptions): Block; static deserializeWire(options: DeserializeWireOptions): Block; readonly transactions: readonly Transaction[]; protected readonly sizeExclusive: () => number; private readonly headerInternal; constructor({ version, previousHash, timestamp, index, consensusData, nextConsensus, script, hash, transactions, merkleRoot, }: BlockAdd); readonly header: Header; clone({ transactions, script, }: { readonly transactions: readonly Transaction[]; readonly script: Witness; }): Block; getNetworkFee(context: FeeContext): Promise; getSystemFee(context: FeeContext): BN; verify(options: BlockVerifyOptions): Promise; serializeWireBase(writer: BinaryWriter): void; serializeJSON(context: SerializeJSONContext): Promise; private verifyBase; private verifyComplete; private verifyConsensus; private verifyTransactions; private verifyNetworkFee; }