juanfranblanco on master
Create2 contract address calcul… (compare)
juanfranblanco on master
More .net 5 Hd wallet .net 5 Hd wallet testing .net 5.0 (compare)
juanfranblanco on master
#655 adding cancellation token … (compare)
juanfranblanco on master
Rsk custom field now uses hex .Net5 initial migration, Abi de… Hd blazor test start migration … (compare)
juanfranblanco on master
Adding a seed to secure random … (compare)
juanfranblanco on master
#654 ManagedAccountTransactionM… Merge branch 'master' of https:… (compare)
juanfranblanco on master
Update bug_report.md (compare)
juanfranblanco on master
Update README.md (compare)
juanfranblanco on master
Signer adding overload DIDs initial commit Merge branch 'master' of https:… (compare)
juanfranblanco on master
Update README.md (compare)
juanfranblanco on master
Update README.md (compare)
juanfranblanco on master
Update README.md (compare)
juanfranblanco on master
#646 fix hdwallet added blazor … (compare)
juanfranblanco on master
Signing performance (start) + … Merge branch 'master' of https:… (compare)
juanfranblanco on master
boolean flag to get compressed … Merge pull request #642 from me… (compare)
juanfranblanco on master
Handling empty reponses eom, re… (compare)
juanfranblanco on master
Websocket client, allow to rece… Merge branch 'master' of https:… (compare)
juanfranblanco on master
Revert "JsonRpc/Logger: fix pos… Merge pull request #638 from Ne… (compare)
juanfranblanco on revert-637-fixPossibleNRE
Revert "JsonRpc/Logger: fix pos… (compare)
juanfranblanco on master
JsonRpc/Logger: fix possible Nu… Merge pull request #637 from kn… (compare)
I'm using EthNewPendingTransactionObservableSubscription
but I'd like to filter on a contract address (Uniswap V2 Router 2). I've tried the following, but it results in no events at all, not even the Uniswap ones:
await subscription.SubscribeAsync(Event<TransferEventDto>.GetEventABI().CreateFilterInput("0x7a250d5630b4cf539739df2c5dacb4c659f2488d"));
Is it possible to do this? Or, even better, can I just subscribe to pending transactions on the Uniswap contract instead?
@juanfranblanco Do you see any problems in the below code?
var ethSwapHandler = web3.Eth.GetContractTransactionHandler<SwapExactETHForTokensFunction>();
var ethSwapDTO = new SwapExactETHForTokensFunction
{
AmountToSend = Web3.Convert.ToWei(wethToTrade), // wethToTrade = 1
AmountOutMin = Web3.Convert.ToWei(amountOutMin), // amountOutMin = 7.25
Path = path,
To = myWallet,
Deadline = ((DateTimeOffset)DateTime.Now).ToUnixTimeSeconds() + 1200,
GasPrice = Web3.Convert.ToWei(gasPriceToUse, UnitConversion.EthUnit.Gwei), // gasPriceToUse = 300 (taken from Etherscan + 200)
Gas = Web3.Convert.ToWei(400000)
};
var transactionEthSwapReceipt = await ethSwapHandler.SendRequestAndWaitForReceiptAsync(uniswapContractAddress, ethSwapDTO);
I wasn't converting the amountOutMin & Gas amounts to Wei before. Could that be the reason for getting the 'insufficient funds for gas * price' error?
@juanfranblanco Can you help me create the syntax for the query? This is the swap code that I use currently -
var wethSwapHandler = web3.Eth.GetContractTransactionHandler<SwapExactTokensForTokensFunction>();
var wethSwapDTO = new SwapExactTokensForTokensFunction
{
AmountIn = Web3.Convert.ToWei(wethToTrade),
AmountOutMin = amountOutMinInWei,
Path = path,
To = myWallet,
Deadline = ((DateTimeOffset)DateTime.Now).ToUnixTimeSeconds() + 1200,
GasPrice = Web3.Convert.ToWei(gasPriceToUse, UnitConversion.EthUnit.Gwei),
Gas = 400000
};
var transactionWethSwapReceipt = await wethSwapHandler.SendRequestAndWaitForReceiptAsync(uniswapContractAddress, wethSwapDTO);
if (transactionWethSwapReceipt.Status.Value == 1)
{
var wethSwapEventOutput = transactionWethSwapReceipt.DecodeAllEvents<TransferEventDTO>();
if (wethSwapEventOutput.Any() && wethSwapEventOutput.Last()?.Event?.Value != null)
I think I need to use 'QueryDeserializingToObjectAsync' method but I dont know what output DTO to use for this. Also, how to check for the error output? Thanks for all the help :)