import { Network } from '../utils/network'; import { SignedTransaction } from '../transaction'; export interface SyncInfo { latest_block_hash: string; latest_block_height: number; latest_block_time: string; latest_state_root: string; syncing: boolean; } interface Version { version: string; build: string; } export interface NodeStatusResult { chain_id: string; rpc_addr: string; sync_info: SyncInfo; validators: string[]; version: Version; } export declare type BlockHash = string; export declare type BlockHeight = number; export declare type BlockId = BlockHash | BlockHeight; export declare enum ExecutionStatusBasic { Unknown = "Unknown", Pending = "Pending", Failure = "Failure" } export interface ExecutionStatus { SuccessValue?: string; SuccessReceiptId?: string; Failure?: ExecutionError; } export declare enum FinalExecutionStatusBasic { NotStarted = "NotStarted", Started = "Started", Failure = "Failure" } export interface ExecutionError { error_message: string; error_type: string; } export interface FinalExecutionStatus { SuccessValue?: string; Failure?: ExecutionError; } export interface ExecutionOutcomeWithId { id: string; outcome: ExecutionOutcome; } export interface ExecutionOutcome { logs: string[]; receipt_ids: string[]; gas_burnt: number; status: ExecutionStatus | ExecutionStatusBasic; } export interface FinalExecutionOutcome { status: FinalExecutionStatus | FinalExecutionStatusBasic; transaction: any; transaction_outcome: ExecutionOutcomeWithId; receipts_outcome: ExecutionOutcomeWithId[]; } export interface TotalWeight { num: number; } export interface BlockHeader { approval_mask: string; approval_sigs: string; hash: string; height: number; prev_hash: string; prev_state_root: string; timestamp: number; total_weight: TotalWeight; tx_root: string; } export declare type ChunkHash = string; export declare type ShardId = number; export declare type BlockShardId = [BlockId, ShardId]; export declare type ChunkId = ChunkHash | BlockShardId; export interface ChunkHeader { balance_burnt: string; chunk_hash: ChunkHash; encoded_length: number; encoded_merkle_root: string; gas_limit: number; gas_used: number; height_created: number; height_included: number; outgoing_receipts_root: string; prev_block_hash: string; prev_state_num_parts: number; prev_state_root_hash: string; rent_paid: string; shard_id: number; signature: string; tx_root: string; validator_proposals: any[]; validator_reward: string; } export interface ChunkResult { header: ChunkHeader; receipts: any[]; transactions: Transaction[]; } export interface Transaction { hash: string; public_key: string; signature: string; body: any; } export interface BlockResult { header: BlockHeader; transactions: Transaction[]; } export declare abstract class Provider { abstract getNetwork(): Promise; abstract status(): Promise; abstract sendTransaction(signedTransaction: SignedTransaction): Promise; abstract txStatus(txHash: Uint8Array, accountId: string): Promise; abstract query(path: string, data: string): Promise; abstract block(blockId: BlockId): Promise; abstract chunk(chunkId: ChunkId): Promise; } export declare function getTransactionLastResult(txResult: FinalExecutionOutcome): any; export declare function adaptTransactionResult(txResult: any): FinalExecutionOutcome; export {};