https://github.com/raineorshine/wait-transaction
A promisified web3.eth.sendTransaction that waits for confirmation.
https://github.com/raineorshine/wait-transaction
ethereum solidity
Last synced: 6 months ago
JSON representation
A promisified web3.eth.sendTransaction that waits for confirmation.
- Host: GitHub
- URL: https://github.com/raineorshine/wait-transaction
- Owner: raineorshine
- License: mit
- Created: 2016-05-18T20:05:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T18:10:45.000Z (over 7 years ago)
- Last Synced: 2025-04-11T04:02:31.311Z (6 months ago)
- Topics: ethereum, solidity
- Language: JavaScript
- Homepage:
- Size: 38.1 KB
- Stars: 12
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wait-transaction
A promisified web3.eth.sendTransaction that waits for confirmation.## Install
```sh
$ npm install --save wait-transaction
```## Usage
```js
// pass a valid web3 instance that the providers set
const waitTransaction = require('wait-transaction')(web3)waitTransaction({ from: web3.eth.accounts[0], to: emptyAccount.address, value: 1000 })
.then(() => web3.eth.getBalance(emptyAccount.address).valueOf())
.then(balance => assert.equal(1000, balance))
```Options:
```js
require('wait-transaction')(web, {
maxAttempts: 240 // number of attempts to check that the transaction was mined before giving up
timeInterval: 1000 // number of milliseconds between attempts
})
```## License
MIT