You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Generate a new private key
var privateKey = EthECKey.GenerateKey().GetPrivateKey();
// Create a new account with the generated private key
var signer = new Account(privateKey);
// Initialize the Web3 instances with the signer account
var provider = new Web3(signer, Config.ETH_URL);
var wallet = new Account(Config.ETH_KEY);
var tx = new TransactionInput
{
From = wallet.Address,
To = signer.Address,
Value = amount.ToHexBigInteger(),
Nonce = await provider.Eth.Transactions.GetTransactionCount.SendRequestAsync(wallet.Address),
GasPrice = await provider.Eth.GasPrice.SendRequestAsync(),
ChainId = await provider.Eth.ChainId.SendRequestAsync(),
MaxFeePerGas = new HexBigInteger(875000000),
};
var estimatedGas = await provider.Eth.TransactionManager.EstimateGasAsync(tx);
`
My signer.Address is "0xDAf8F18fd376Eb28457baa60B7B974a2A8423bb2CCF643Eb02bF68258cdBb7a2".
My ETH_URL is "http://localhost:8545"
I am using Nethereum.Web3 Version="4.19.0"
Nethereum.Accounts Version="4.19.0"
in a .net core 7.0 app.
The text was updated successfully, but these errors were encountered:
Hi, I am getting this exception when trying to estimate gas for a transaction:
Message:
Nethereum.JsonRpc.Client.RpcResponseException : The field to must have byte length of 20: eth_estimateGas
Stack Trace:
ClientBase.HandleRpcError(RpcResponseMessage response, String reqMsg)
ClientBase.SendInnerRequestAsync[T](RpcRequestMessage reqMsg, String route)
ClientBase.SendRequestAsync[T](RpcRequest request, String route)
TestHelpers.Fund(SignerOrProvider signer, BigInteger amount, String fundingKey)
TestHelpers.FundL1(SignerOrProvider l1Signer, BigInteger amount)
CustomERC20Tests.SetupState()
CustomERC20Tests.SetUp()
GenericAdapter
1.BlockUntilCompleted() NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter) AsyncToSyncAdapter.Await[TResult](Func
1 invoke)AsyncToSyncAdapter.Await(Func`1 invoke)
SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method)
SetUpTearDownItem.RunSetUp(TestExecutionContext context)
<>c__DisplayClass1_0.b__0()
DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
My code snippet:
`
`
My signer.Address is "0xDAf8F18fd376Eb28457baa60B7B974a2A8423bb2CCF643Eb02bF68258cdBb7a2".
My ETH_URL is "http://localhost:8545"
I am using Nethereum.Web3 Version="4.19.0"
Nethereum.Accounts Version="4.19.0"
in a .net core 7.0 app.
The text was updated successfully, but these errors were encountered: