An open API service indexing awesome lists of open source software.

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.

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)