UNPKG

koinos-rpc

Version:

Typescript library to communicate with Koinos API via RPC

48 lines (47 loc) 1.45 kB
import { Client } from '../Client'; import { BlockTopology } from '../types/Block'; interface HeadInfoResponse { head_topology: BlockTopology; last_irreversible_block: number; head_state_merkle_root: string; head_block_time: number; } interface GetChainIdResponse { chain_id: string; } interface GetForkHeadsResponse { last_irreversible_block: BlockTopology; fork_heads: BlockTopology[]; } interface GetAccountNonceResponse { nonce: string; } interface GetAccountRcResponse { rc: string; } interface GetResourceLimitsResponse { resource_limit_data: { disk_storage_limit: string; disk_storage_cost: string; network_bandwidth_limit: string; network_bandwidth_cost: string; compute_bandwidth_limit: string; compute_bandwidth_cost: string; }; } interface ReadContractResponse { result: any; } export declare class Chain { private readonly client; constructor(client: Client); getHeadInfo(): Promise<HeadInfoResponse>; getChainId(): Promise<GetChainIdResponse>; getForkHeads(): Promise<GetForkHeadsResponse>; getAccountNonce(account: string): Promise<GetAccountNonceResponse>; getAccountRC(account: string): Promise<GetAccountRcResponse>; getResourceLimits(): Promise<GetResourceLimitsResponse>; readContract(contract_id: string, entry_point: number, args: any): Promise<ReadContractResponse>; private call; } export {};