-
Ethers Version5.6.9 Search TermsNo response Describe the ProblemI am creating and sending a transaction but the transaction never goes trough tried with Kovan and Ropsten testnets neither works. I am using this provider. https://ropsten.infura.io/v3/ff21ecb60a304fc09a7b37e3d979f778. Also getTransaction() returns null. Code Snippetasync signTransaction(privateKey: string, txData: TransactionSendDataDto) {
const provider = new ethers.providers.JsonRpcProvider(EthereumConstants.PROVIDER_URL_KOVAN);
const wallet = new ethers.Wallet(privateKey, provider);
const gasPrice = await this.getGasPrice()
const newTransaction : ethers.providers.TransactionRequest = {
to: txData.to,
value: ethers.utils.parseEther(txData.value),
from: txData.from,
gasLimit: 21000,
nonce: await provider.getTransactionCount(txData.from),
};
const signedTransaction = await wallet.signTransaction(newTransaction);
return signedTransaction;
}
async sendTransaction(signedTransaction: string) {
const provider = new ethers.providers.JsonRpcProvider(EthereumConstants.PROVIDER_URL_KOVAN);
const transaction = await provider.sendTransaction(signedTransaction);
transaction.wait();
return transaction;
} response:
Contract ABINo response ErrorsNo response EnvironmentEthereum (mainnet/ropsten/rinkeby/goerli) Environment (Other)No response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Your gas price is 0, so the network will not accept that transaction. The chain ID isn’t defined either, which makes me think the network is not responding well to the chain ID call. The Kovan and Ropsten networks are both being subset, so they may not work well in general. The Görli network should be used for most purposes these days. |
Beta Was this translation helpful? Give feedback.
Your gas price is 0, so the network will not accept that transaction. The chain ID isn’t defined either, which makes me think the network is not responding well to the chain ID call.
The Kovan and Ropsten networks are both being subset, so they may not work well in general. The Görli network should be used for most purposes these days.