https://github.com/nodefactoryio/web3-server-wallet
Ethereum wallet for backend (server) services that sends transactions with monitoring.
https://github.com/nodefactoryio/web3-server-wallet
ethereum gas-price typescript wallets web3
Last synced: 9 months ago
JSON representation
Ethereum wallet for backend (server) services that sends transactions with monitoring.
- Host: GitHub
- URL: https://github.com/nodefactoryio/web3-server-wallet
- Owner: NodeFactoryIo
- License: mit
- Created: 2020-06-10T11:03:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T09:46:02.000Z (over 3 years ago)
- Last Synced: 2025-02-13T16:18:51.310Z (about 1 year ago)
- Topics: ethereum, gas-price, typescript, wallets, web3
- Language: TypeScript
- Homepage:
- Size: 612 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Web3-server-wallet
This repository contains TypeScript implementation of monitor service for transactions on
the ethereum netowork.
For ethers@4.0.X use web3-server-wallet@0.1.X!
# Usage
Install with `yarn add @nodefactory/web3-server-wallet` or `npm i @nodefactory/web3-server-wallet`
Example of usage:
```typescript
import {ServerWeb3Wallet, TxMonitorService} from "@nodefactory/web3-server-wallet";
const wallet = await ServerWeb3Wallet.create(walletSource, walletStorage);
const monitorService = new TxMonitorService(wallet);
monitorService.start()
wallet.sendTransaction(transactionRequest);
```
Monitor service will automatically check if sent transaction is dropped and resubmit it with
higher gas price and track its progress.
This package requires for [IWalletTransactionStorage](src/@types/wallet.ts) and [IWalletSourceStorage](src/@types/wallets.ts) interface to be implemented to store sent transactions and available wallets.
### Gas Price
This package uses [eth gas station api](https://www.ethgasstation.info/) by default and GAS_STATION_API_KEY should be in process.env for it to work.
It will fallback to provider.estimateGasPrice if gas station estimation does not work.
## License
[MIT](LICENSE)