Comparing version 0.1.1 to 0.1.2
@@ -66,3 +66,7 @@ { | ||
"message": "transaction failed" | ||
}, | ||
"TRANSACTION_NOT_CONFIRMED": { | ||
"error": 501, | ||
"message": "polled network but could not confirm transaction" | ||
} | ||
} |
20
index.js
@@ -59,4 +59,10 @@ /** | ||
defaultGas: "0x2fd618", | ||
// Maximum number of transaction verification attempts | ||
TX_POLL_MAX: 12, | ||
// Transaction polling interval | ||
TX_POLL_INTERVAL: 12000, | ||
DEFAULT_GAS: "0x2fd618", | ||
nodes: ["http://eth1.augur.net:8545"], | ||
@@ -511,3 +517,3 @@ | ||
tx.to = tx.to || ""; | ||
tx.gas = (tx.gas) ? abi.prefix_hex(tx.gas.toString(16)) : this.defaultGas; | ||
tx.gas = (tx.gas) ? abi.prefix_hex(tx.gas.toString(16)) : this.DEFAULT_GAS; | ||
return this.broadcast(this.marshal("call", tx), f); | ||
@@ -518,3 +524,3 @@ }, | ||
tx.to = tx.to || ""; | ||
tx.gas = (tx.gas) ? abi.prefix_hex(tx.gas.toString(16)) : this.defaultGas; | ||
tx.gas = (tx.gas) ? abi.prefix_hex(tx.gas.toString(16)) : this.DEFAULT_GAS; | ||
return this.broadcast(this.marshal("sendTransaction", tx), f); | ||
@@ -524,3 +530,3 @@ }, | ||
tx.to = tx.to || ""; | ||
tx.gas = (tx.gas) ? abi.prefix_hex(tx.gas.toString(16)) : this.defaultGas; | ||
tx.gas = (tx.gas) ? abi.prefix_hex(tx.gas.toString(16)) : this.DEFAULT_GAS; | ||
return this.broadcast(this.marshal("sendTransaction", tx), f); | ||
@@ -791,11 +797,11 @@ }, | ||
if (count !== undefined) { | ||
if (count < this.constants.TX_POLL_MAX) { | ||
if (count < this.TX_POLL_MAX) { | ||
if (count === 0) { | ||
this.notifications[txhash] = [setTimeout(function () { | ||
this.txNotify(count + 1, callreturn, itx, txhash, returns, onSent, onSuccess, onFailed); | ||
}.bind(this), this.constants.TX_POLL_INTERVAL)]; | ||
}.bind(this), this.TX_POLL_INTERVAL)]; | ||
} else { | ||
this.notifications[txhash].push(setTimeout(function () { | ||
this.txNotify(count + 1, callreturn, itx, txhash, returns, onSent, onSuccess, onFailed); | ||
}.bind(this), this.constants.TX_POLL_INTERVAL)); | ||
}.bind(this), this.TX_POLL_INTERVAL)); | ||
} | ||
@@ -802,0 +808,0 @@ } else { |
{ | ||
"name": "ethrpc", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Ethereum JSON RPC", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1188559
24017