UNPKG

opendb_test_rpc

Version:

general purpose library for OpenDB blockchain

29 lines (28 loc) 1.4 kB
import { OpenDBClient } from '../client'; export interface BpInterface { getBlockList(page: number, size: number, since: number): Promise<object>; getBlockByHeight(height: number): Promise<object>; getBlockByHash(hash: string): Promise<object>; getTransactionList(page: number, size: number, since: string): Promise<object>; getTransactionListOfBlock(height: number, from: number, to: number): Promise<Array<object>>; getTransactionByHash(hash: string): Promise<object>; } export declare enum BpMethodType { GET_BLOCK_LIST = "bp_getBlockList", GET_BLOCK_BY_HEIGHT = "bp_getBlockByHeight", GET_BLOCK_BY_HASH = "bp_getBlockByHash", GET_TRANSACTION_LIST = "bp_getTransactionList", GET_TRANSACTION_LIST_OF_BLOCK = "bp_getTransactionListOfBlock", GET_TRANSACTION_BY_HASH = "bp_getTransactionByHash" } export default class Bp implements BpInterface { client: OpenDBClient; private debug; constructor(client: OpenDBClient); getBlockList(page: number, size: number, since?: number): Promise<object>; getBlockByHeight(height: number): Promise<object>; getBlockByHash(hash: string): Promise<object>; getTransactionList(page: number, size: number, since?: string): Promise<object>; getTransactionListOfBlock(height: number, from: number, to: number): Promise<Array<object>>; getTransactionByHash(hash: string): Promise<object>; }