Skip to content

Commit

Permalink
Fixed issue with function removed in ETH RPC provider
Browse files Browse the repository at this point in the history
  • Loading branch information
grandsmarquis committed Apr 3, 2019
1 parent f7ce36b commit 62a6529
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/providers/ethereum/EthereumRPCProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export default class EthereumRPCProvider extends JsonRpcProvider {
return ensureHexStandardFormat(txHash)
}

async sendRawTransaction (hash) {
const txHash = await this.jsonrpc('eth_sendRawTransaction', hash)
return txHash
}

async signMessage (message, from) {
from = ensureHexEthFormat(from)
message = ensureHexEthFormat(Buffer.from(message).toString('hex'))
Expand Down Expand Up @@ -76,6 +81,16 @@ export default class EthereumRPCProvider extends JsonRpcProvider {
return this.jsonrpc('eth_getTransactionReceipt', txHash)
}

async getTransactionCount (address) {
const count = await this.jsonrpc('eth_getTransactionCount', ensureHexEthFormat(address))
return parseInt(count, '16')
}

async getGasPrice () {
const gasPrice = await this.jsonrpc('eth_gasPrice')
return parseInt(gasPrice, '16')
}

async getBalance (addresses) {
addresses = addresses
.map(address => String(address))
Expand Down

0 comments on commit 62a6529

Please sign in to comment.