Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1.2 KB

README.md

File metadata and controls

35 lines (22 loc) · 1.2 KB

Web3-server-wallet

This repository contains TypeScript implementation of monitor service for transactions on the ethereum netowork.

For [email protected] use [email protected]!

Usage

Install with yarn add @nodefactory/web3-server-wallet or npm i @nodefactory/web3-server-wallet

Example of usage:

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 and IWalletSourceStorage interface to be implemented to store sent transactions and available wallets.

Gas Price

This package uses eth gas station api 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