import { Account , Info , SendTxBody , TxHistory } from './models' ; export * from './models' ; export * as middleware from './middleware' ; export * from './websocket' ; /**
 * Generic api error for handling failed requests
 */ export class ApiError extends Error { statusCode : number ; constructor ( name , statusCode , message ? ) { super ( message ) ; this . name = name ; this . statusCode = statusCode ; } } /**
 * BaseAPI implementation which all coinstacks must conform to.
 *
 * Included are doc comments and a the route decorator (@Get, @Post, etc)
 * The route decorator is commented out in the interface, but should be used in the implementation class.
 *
 * Typescript is unable to enforce decorators on interface functions and
 * also will not enforce more than the first argument for each function.
 * Please ensure these match when adding a new coinstack api,
 * or update all coinstack api implementations on any changes to the base interface.
 */ export interface BaseAPI { returns { Promise < Info > } getInfo ( ) : Promise < Info > ; param { string } pubkey returns { Promise < Account > } getAccount ( pubkey ) : Promise < Account > ; param { string } pubkey param { number } page param { number } pageSize param { string } contract returns { Promise < TxHistory > } getTxHistory ( pubkey , page ? , pageSize ? , contract ? ) : Promise < TxHistory > ; param { SendTxBody } body returns { Promise < string > } sendTx ( body ) : Promise < string > ; }