@mountainpath9/overlord-ethers
v1.0.3
Published
This library contains functions and types to extend the `@mountainpath9/overlord-core` library for use with ethersjs.
Downloads
184
Readme
ethers.js support for overlord
This library contains functions and types to extend the @mountainpath9/overlord-core
library for use with ethersjs.
In addition to rexporting all from @mountainpath9/overlord-core
the following functions are provided:
function getProvider(ctx: TaskContext, chainId: number): Promise<Provider>;
function getSigner(ctx: TaskContext, provider: Provider, walletName: string): Promise<Signer>;
function createTransactionManager(ctx: TaskContext, signer: Signer, provider: Provider, params: TxSubmissionParams);
and a global nonce manager:
let NONCE_MANAGER: NonceManager
The TransactionManager
submits transactions to the blockchain, with controls to subsequently increase the gas tip,
and ultimately cancel the transaction if unsuccessful:
export interface TransactionManager {
/**
* Sign and submit the given transaction and wait
* for it to be mined. This interface combines these
* operations so that an implementation can lock the current
* nonce until the transaction has been successfully mined.
*
* If the transaction fails to be mined, this will throw an
* exception.
*/
submitAndWait(tx: ContractTransaction): Promise<TransactionReceipt>;
}