parent
40ae81a5bc
commit
d61358d7cf
@ -0,0 +1,22 @@ |
|||||||
|
import { RPCMethod } from './rpc'; |
||||||
|
import { Messenger } from '../messenger/messenger'; |
||||||
|
|
||||||
|
class Blockchain { |
||||||
|
messenger: Messenger; |
||||||
|
|
||||||
|
constructor(messenger: Messenger) { |
||||||
|
this.messenger = messenger; |
||||||
|
} |
||||||
|
|
||||||
|
getBalance = async (address: string) => { |
||||||
|
const result = await this.messenger.send(RPCMethod.GetBalance, address); |
||||||
|
return result; |
||||||
|
}; |
||||||
|
|
||||||
|
getLatestBlock = async () => { |
||||||
|
const result = await this.messenger.send(RPCMethod.GetLatestBlock, ''); |
||||||
|
return result; |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
export { Blockchain }; |
Loading…
Reference in new issue