Comparing version 0.0.4 to 0.0.5
@@ -54,5 +54,4 @@ 'use strict'; | ||
fromBlock: 'earliest' | ||
}).then(function (_ref) { | ||
var result = _ref.result; | ||
return (0, _utils.pollWithObservable)(ethClient.getFilterChanges, 1000, result).subscribe(function (res) { | ||
}).then(function (res) { | ||
return (0, _utils.pollWithObservable)(ethClient.getFilterChanges, 1000, res).subscribe(function (res) { | ||
return observer.next(res); | ||
@@ -84,3 +83,3 @@ }, function (err) { | ||
}).then(function (res) { | ||
var txHash = res.result; | ||
var txHash = res; | ||
observer.next({ | ||
@@ -87,0 +86,0 @@ txHash: txHash |
@@ -45,3 +45,3 @@ 'use strict'; | ||
ethClient.sendTransaction(params).then(function (res) { | ||
var txHash = res.result; | ||
var txHash = res; | ||
observer.next({ | ||
@@ -48,0 +48,0 @@ txHash: txHash |
@@ -40,3 +40,4 @@ 'use strict'; | ||
this.coinbase = this.coinbase.bind(this); | ||
this.getAccounts = this.getAccounts.bind(this); | ||
this.getCoinbase = this.getCoinbase.bind(this); | ||
this.newFilter = this.newFilter.bind(this); | ||
@@ -59,18 +60,26 @@ this.getFilterChanges = this.getFilterChanges.bind(this); | ||
if (res.data.error) throw res.data.error; | ||
return res.data; | ||
return res.data.result; | ||
}); | ||
} | ||
}, { | ||
key: 'accounts', | ||
key: 'getAccounts', | ||
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_accounts | ||
value: function accounts() { | ||
value: function getAccounts() { | ||
return this.send('eth_accounts'); | ||
} | ||
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getbalance | ||
}, { | ||
key: 'getBalance', | ||
value: function getBalance(address, blockParam) { | ||
return this.send('eth_getBalance', [address, blockParam]); | ||
} | ||
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_coinbase | ||
}, { | ||
key: 'coinbase', | ||
value: function coinbase() { | ||
key: 'getCoinbase', | ||
value: function getCoinbase() { | ||
return this.send('eth_coinbase'); | ||
@@ -77,0 +86,0 @@ } |
@@ -19,7 +19,5 @@ 'use strict'; | ||
var pollFunc = function pollFunc() { | ||
return func.apply(undefined, args).then(function (_ref) { | ||
var result = _ref.result; | ||
return func.apply(undefined, args).then(function (res) { | ||
clearTimeout(pollTimeoutId); | ||
observer.next(result); | ||
observer.next(res); | ||
pollTimeoutId = setTimeout(pollFunc, pollTimeoutMS); | ||
@@ -44,5 +42,5 @@ }, function (err) { | ||
return func.apply(undefined, args).then(function (res) { | ||
if (res.result) { | ||
if (res) { | ||
clearTimeout(pollTimeoutId); | ||
resolve(res.result); | ||
resolve(res); | ||
} else { | ||
@@ -49,0 +47,0 @@ clearTimeout(pollTimeoutId); |
@@ -1,2 +0,2 @@ | ||
import Eth from './src'; | ||
import Eth from './src/main'; | ||
@@ -3,0 +3,0 @@ const client = new Eth('http://localhost:8543'); |
{ | ||
"name": "ethjs", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "lib/main.js", | ||
@@ -5,0 +5,0 @@ "author": "Tarrence van As <tarrence13@gmail.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20683
327