UNPKG

koinos-rpc

Version:

Typescript library to communicate with Koinos API via RPC

26 lines (25 loc) 995 B
import { Client } from '../Client'; import { Block, BlockTopology } from '../types/Block'; export interface GetBlocksResponse { block_items: Block[]; } export interface GetHighestBlockResponse { topology: BlockTopology; } interface BlockchainStreamOptions { from?: number; to?: number; } export declare class BlockStore { private readonly client; constructor(client: Client); getBlocksById(ids: string[], return_block?: boolean, return_receipt?: boolean): Promise<GetBlocksResponse>; getBlocksByHeight(head_block_id: string, ancestor_start_height: number, num_blocks: number, return_block?: boolean, return_receipt?: boolean): Promise<GetBlocksResponse>; getHighestBlock(): Promise<GetHighestBlockResponse>; getBlockNumbers(options?: BlockchainStreamOptions): AsyncGenerator<number, void, unknown>; getBlocks(options?: BlockchainStreamOptions): AsyncIterable<Block>; private getHighetBlockNumber; private sleep; private call; } export {};