Skip to content
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.

Commit

Permalink
Merge branch 'stable' into light-wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
kosecki123 authored Feb 4, 2018
2 parents af81f01 + 4cdd2ba commit c9b4566
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eac.js",
"version": "1.1.3",
"version": "1.1.4",
"description": "Commnandline tool to interact with the Ethereum Alarm Clock contracts.",
"main": "./src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/eac.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ethUtil = require("ethereumjs-util")

// Parse the command line options using commander.
program
.version("1.1.3")
.version("1.1.4")
.option(
"--scan <spread>",
"sets the scanning spread (ie +- from current block",
Expand Down
75 changes: 75 additions & 0 deletions src/txRequest/txRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,81 @@ class TxRequest {
})
}

/**
* Proxy
* @param {string} toAddress Ethereum address
* @param {string} data Hex encoded data for the transaction to proxy
* @param {Object} params Transaction object including `from`, `gas`, `gasPrice` and `value`.
*/
proxy(toAddress, data, params) {
return new Promise((resolve, reject) => {
this.instance.proxy(toAddress, data, params, (err, txHash) => {
if (err) reject(err)
else {
Util.waitForTransactionToBeMined(this.web3, txHash)
.then(resolve) // resolves the receipt
.catch(reject) // rejects the error
}
})
})
}

/**
* Pull Payments
*/

refundClaimDeposit(params) {
return new Promise((resolve, reject) => {
this.instance.refundClaimDeposit(params, (err, txHash) => {
if (err) reject(err)
else {
Util.waitForTransactionToBeMined(this.web3, txHash)
.then(resolve)
.catch(reject)
}
})
})
}

sendFee(params) {
return new Promise((resolve, reject) => {
this.instance.sendFee(params, (err, txHash) => {
if (err) reject(err)
else {
Util.waitForTransactionToBeMined(this.web3, txHash)
.then(resolve)
.catch(reject)
}
})
})
}

sendBounty(params) {
return new Promise((resolve, reject) => {
this.instance.sendBounty(params, (err, txHash) => {
if (err) reject(err)
else {
Util.waitForTransactionToBeMined(this.web3, txHash)
.then(resolve)
.catch(reject)
}
})
})
}

sendOwnerEther(params) {
return new Promise((resolve, reject) => {
this.instance.sendOwnerEther(params, (err, txHash) => {
if (err) reject(err)
else {
Util.waitForTransactionToBeMined(this.web3, txHash)
.then(resolve)
.catch(reject)
}
})
})
}

/**
* Misc.
*/
Expand Down

0 comments on commit c9b4566

Please sign in to comment.