https://github.com/marc-aurele-besner/transaction-retry-tool
Tool to retry transactions on a blockchain
https://github.com/marc-aurele-besner/transaction-retry-tool
blockchain ethereum ethers hardhat solidity transaction
Last synced: about 2 months ago
JSON representation
Tool to retry transactions on a blockchain
- Host: GitHub
- URL: https://github.com/marc-aurele-besner/transaction-retry-tool
- Owner: marc-aurele-besner
- License: mit
- Created: 2022-09-06T18:46:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T02:56:03.000Z (over 1 year ago)
- Last Synced: 2024-05-01T19:03:24.899Z (about 1 year ago)
- Topics: blockchain, ethereum, ethers, hardhat, solidity, transaction
- Language: TypeScript
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/js/transaction-retry-tool)# 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:
```bash
npm i transaction-retry-tool
```Next, add the plugin to your hardhat.config.js file:
```js
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
- [.vscode/](./.vscode/)
- [src/](./src/)- [.eslintrc.js](./.eslintrc.js)
- [.npmignore](./.npmignore)
- [.prettierrc](./.prettierrc)
- [CONTRIBUTING.md](./CONTRIBUTING.md)
- [LICENSE](./LICENSE)
- [awesome-readme.config.js](./awesome-readme.config.js)
- [package-lock.json](./package-lock.json)
- [package.json](./package.json)
- [tsconfig.json](./tsconfig.json)
- [tsconfig.prod.json](./tsconfig.prod.json)
- [tslint.json](./tslint.json)
## Tasks
The plugin adds two tasks to the Hardhat CLI:
```bash
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.
```js
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.