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)
@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 :)
@juanfranblanco Thanks. I used the 'Query' with the same params as the actual transaction and can see that it returns the amounts of the tokens similar to the 'GetAmountsOutFunction'. So can I just use this query instead of GetAmountsOutFunction as the query does what the GetAmountsOutFunction does and then some? Is GetAmountsOutFunction more performant than the query? Or should I use both? ( use GetAmountsOutFunction until I get amounts and then use the query once before submitting actual transaction)
I was thinking of putting the query call in a try catch block and running the query in an infinite loop until I get an amountOut value for the target token that can then be used in the actual transaction. But as you say, the query will THROW an error if the query call cannot succeed for any reason (other than gas issues as query calls do not use gas params). I should then be able to CATCH this error and discard it while trying the query call again and again in the infinite loop until the query succeeds (token is tradable) and then I will proceed to the actual transaction. What do you think?
hello. I am stuck on a problem of trying to get the ERC20 balance of a token from an address for a given blockNumber.
if I am going about this the wrong way, any advice?