@generationsoftware/pt-v5-autotasks-library
Advanced tools
Comparing version 1.2.1 to 1.2.2
import { printSpacer } from '../utils/index.js'; | ||
export const sendPopulatedTx = async (provider, wallet, populatedTx, gasLimit, txParams) => { | ||
printSpacer(); | ||
const feeData = await provider.getFeeData(); | ||
const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas; | ||
const maxFeePerGas = feeData.maxFeePerGas; | ||
const gasPrice = await provider.getGasPrice(); | ||
const sendTransactionArgs = { | ||
@@ -11,12 +9,8 @@ data: populatedTx.data, | ||
gasLimit, | ||
gasPrice, | ||
}; | ||
const args = { | ||
...sendTransactionArgs, | ||
maxPriorityFeePerGas, | ||
maxFeePerGas, | ||
}; | ||
if (txParams && txParams.value) { | ||
args.value = txParams.value; | ||
sendTransactionArgs.value = txParams.value; | ||
} | ||
const tx = await wallet.sendTransaction(args); | ||
const tx = await wallet.sendTransaction(sendTransactionArgs); | ||
printSpacer(); | ||
@@ -23,0 +17,0 @@ return tx; |
@@ -456,2 +456,5 @@ import { ethers, BigNumber } from 'ethers'; | ||
logStringValue(`Native (Gas) Token ${NETWORK_NATIVE_TOKEN_INFO[chainId].symbol} Market Rate (USD):`, `$${nativeTokenMarketRateUsd}`); | ||
const gasPrice = await provider.getGasPrice(); | ||
logBigNumber('Recent Gas Price (wei):', gasPrice, NETWORK_NATIVE_TOKEN_INFO[chainId].decimals, NETWORK_NATIVE_TOKEN_INFO[chainId].symbol); | ||
logStringValue('Recent Gas Price (gwei):', `${ethers.utils.formatUnits(gasPrice, 'gwei')} gwei`); | ||
logBigNumber('Estimated gas limit (wei):', estimatedGasLimit, 18, NETWORK_NATIVE_TOKEN_INFO[chainId].symbol); | ||
@@ -472,2 +475,5 @@ printSpacer(); | ||
logStringValue(`Native (Gas) Token ${NETWORK_NATIVE_TOKEN_INFO[chainId].symbol} Market Rate (USD):`, `$${nativeTokenMarketRateUsd}`); | ||
const gasPrice = await provider.getGasPrice(); | ||
logBigNumber('Recent Gas Price (wei):', gasPrice, NETWORK_NATIVE_TOKEN_INFO[chainId].decimals, NETWORK_NATIVE_TOKEN_INFO[chainId].symbol); | ||
logStringValue('Recent Gas Price (gwei):', `${ethers.utils.formatUnits(gasPrice, 'gwei')} gwei`); | ||
logBigNumber('Estimated gas limit (wei):', estimatedGasLimit, 18, NETWORK_NATIVE_TOKEN_INFO[chainId].symbol); | ||
@@ -474,0 +480,0 @@ printSpacer(); |
@@ -222,2 +222,6 @@ import nodeFetch from 'node-fetch'; | ||
let claimPrizesParams = buildParams(vault, tier, claimsSlice, rewardRecipient, estimateMinVrgdaFeePerClaim); | ||
const gasPrice = await provider.getGasPrice(); | ||
logBigNumber('Recent Gas Price (wei):', gasPrice, NETWORK_NATIVE_TOKEN_INFO[chainId].decimals, NETWORK_NATIVE_TOKEN_INFO[chainId].symbol); | ||
logStringValue('Recent Gas Price (gwei):', `${ethers.utils.formatUnits(gasPrice, 'gwei')} gwei`); | ||
printSpacer(); | ||
let estimatedGasLimitForOne = await getEstimatedGasLimit(claimerContract, claimPrizesParams); | ||
@@ -224,0 +228,0 @@ if (!estimatedGasLimitForOne || estimatedGasLimitForOne.eq(0)) { |
@@ -134,7 +134,5 @@ import { Contract, BigNumber, Wallet, Signer } from 'ethers'; | ||
gasLimit: number; | ||
} | ||
export interface WalletSendTransactionArgs extends SendTransactionArgs { | ||
gasPrice?: BigNumber; | ||
maxPriorityFeePerGas?: BigNumber; | ||
maxFeePerGas?: BigNumber; | ||
gasPrice?: BigNumber; | ||
value?: BigNumber; | ||
@@ -141,0 +139,0 @@ } |
{ | ||
"name": "@generationsoftware/pt-v5-autotasks-library", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Library of shared utils to run PoolTogether v5 hyperstructure autotasks.", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
442904
7318