Last active
June 13, 2018 06:35
-
-
Save wangzuo/45d2a04dd9ab2e0a32daf8492b89b3e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IRPCProvider { | |
getNetVersion(): Promise<string>; | |
ping(): Promise<boolean>; | |
getBalance(address: string): Promise<Wei>; | |
estimateGas(tx: Partial<IHexStrTransaction>): Promise<Wei>; | |
getTransactionCount(address: string): Promise<string>; | |
getTransactionByHash(txhash: string): Promise<TransactionData>; | |
getTransactionReceipt(txhash: string): Promise<TransactionReceipt>; | |
sendRawTx(tx: string): Promise<string>; | |
sendCallRequest(txObj: TxObj): Promise<string>; | |
sendCallRequests(txObj: TxObj[]): Promise<string[]>; | |
getCurrentBlock(): Promise<string>; | |
} | |
export interface IProvider extends IRPCProvider { | |
/*Web3 methods*/ | |
sendTransaction(web3Tx: IHexStrWeb3Transaction): Promise<string>; | |
signMessage(msgHex: string, fromAddr: string): Promise<string>; | |
} | |
export type AllProviderMethods = keyof IProvider; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment