transaction-retry-tool
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

license npm version

transaction-retry-tool


     _                                  _   _                            _                     _              _ 
    | |                                | | (_)                          | |                   | |            | |
    | |_ _ __ __ _ _ __  ___  __ _  ___| |_ _  ___  _ __ ______ _ __ ___| |_ _ __ _   _ ______| |_ ___   ___ | |
    | __| '__/ _' | '_ \/ __|/ _' |/ __| __| |/ _ \| '_ \______| '__/ _ \ __| '__| | | |______| __/ _ \ / _ \| |
    | |_| | | (_| | | | \__ \ (_| | (__| |_| | (_) | | | |     | | |  __/ |_| |  | |_| |      | || (_) | (_) | |
     \__|_|  \__,_|_| |_|___/\__,_|\___|\__|_|\___/|_| |_|     |_|  \___|\__|_|   \__, |       \__\___/ \___/|_|
                                                                                   __/ |                        
                                                                                  |___/                         

This Hardhat plugin provides two tasks and two functions to help you manage and optimize your transactions on Ethereum compatible blockchain. The two tasks include the ability to retry a transaction and retrieve the current gas cost.

Install Transaction-Retry-Tool

To install the Hardhat Transaction-Retry-Tool Plugin, run the following command in your project directory:

npm i transaction-retry-tool

Next, add the plugin to your hardhat.config.js file:

require("transaction-retry-tool");

And that's it! You can now use the two tasks and functions provided by this plugin to manage and optimize your transactions.

Directories

Tasks

The plugin adds two tasks to the Hardhat CLI:

npx hardhat retry

Task: retry

This task is used to retry a transaction with the current gas price or a specified one.

Usage: hardhat [GLOBAL OPTIONS] retry --tx-hash --signer-key [--gas-price ]

OPTIONS:

  • --tx-hash The transaction hash of the transaction to retry
  • --signer-key The signer private key (or type hardhat to use hardhat.config private key)
  • --gas-price Specify a gas price to retry the transaction with (default: current network gas price) (default: "")

retry: Retry a transaction with the current gas price or specify one

Task: gas-cost

This task is used to retrieve the current gas price on the selected network in wei.

Usage: hardhat [GLOBAL OPTIONS] gas-cost

gas-cost: Get the current gas price on the selected network in wei

Functions

Function allow you to use the transaction retry tool OR get the current gas cost.

const { transactionRetry } = require('hardhat');

transactionRetry.retry(
    txHash: string,
    signerKey: string,
    gasPrice?: string
)
transactionRetry.gasCost()

Directory Tree

transaction-retry-tool/
│   .eslintrc.js
│   .npmignore
│   .prettierrc
│   CONTRIBUTING.md
│   LICENSE
│   awesome-readme.config.js
│   package-lock.json
│   package.json
│   tsconfig.json
│   tsconfig.prod.json
│   tslint.json
└─── .vscode/
└─── src/
   │   README.md
   │   settings.json
   │   README.md
   │   TransactionRetry.ts
   │   getGasCost.ts
   │   index.ts
   │   retryTransaction.ts
   │   serveTasks.ts
   │   type-extensions.ts
   │   utils.ts

Don't hesitate to contribute to this project.

Package Sidebar

Install

npm i transaction-retry-tool

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

46.6 kB

Total Files

39

Last publish

Collaborators

  • marcaurelebesner