import { logging , rpc , u , wallet } from "@cityofzion/neon-core" ; import { PastTransaction , Provider } from "../common" ; import { getBalance , getClaims , getMaxClaimAmount } from "./core" ; const log = logging . default ( "api" ) ; export class NeoCli implements Provider { public get name ( ) : string { return `NeoCli[${ this . url }]` ; } private url : string ; private rpc : rpc . RPCClient ; public constructor ( url ) { this . url = url ; this . rpc = new rpc . RPCClient ( url ) ; log . info ( `Created NeoCli Provider: ${ this . url }` ) ; } public getRPCEndpoint ( _noCache ? ) { return Promise . resolve ( this . url ) ; } public getBalance ( address ) { return getBalance ( this . url , address ) ; } public getClaims ( address ) { return getClaims ( this . url , address ) ; } public getMaxClaimAmount ( address ) { return getMaxClaimAmount ( this . url , address ) ; } public getHeight ( ) { return this . rpc . getBlockCount ( ) ; } public getTransactionHistory ( _address ) { throw new Error ( "Method not implemented." ) ; } } export default NeoCli ;