Skip to content

Instantly share code, notes, and snippets.

@wangzuo
Last active June 13, 2018 06:35
Show Gist options
  • Save wangzuo/45d2a04dd9ab2e0a32daf8492b89b3e4 to your computer and use it in GitHub Desktop.
Save wangzuo/45d2a04dd9ab2e0a32daf8492b89b3e4 to your computer and use it in GitHub Desktop.

Revisions

  1. wangzuo revised this gist Jun 13, 2018. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion IRPCProvider.ts
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,12 @@ export interface IRPCProvider {
    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;
  2. wangzuo created this gist Jun 13, 2018.
    13 changes: 13 additions & 0 deletions IRPCProvider.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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>;
    }