Questions tagged [nethereum]
Questions related to the C# .NET Ethereum Web3 RPC Client Library, named nethereum
140
questions
2
votes
1
answer
209
views
How to sign a transaction using metamask or other wallets in nethereum
I searched a lot on the internet and in the documentation, but I still haven't found the answer to my question.
I want to know how to sign a transaction through an external wallet using the nethereum ...
1
vote
1
answer
25
views
Is this method technically and logically correct?
I am implementing a practice project on the topic of token pre-sale. Currently, I have created the project in such a way that, for example, a user who is going to participate in the token pre-sale ...
0
votes
1
answer
30
views
Nethereum External Signer (C#) extending EthExternalSignerBase issue with SignExternallyAsync
I am currently having issues extending EthExternalSignerBase. I have an API that signs messages, similar to an Amazon KMS.
One of the issues I am running into is deriving the ECDSASignature response, ...
0
votes
0
answers
46
views
The Merge is not yet available for this network! PUSH0 error
We've recently started having trouble deploying contracts for initial testing on a Geth node running in --dev mode. The error is invalid opcode: PUSH0.
We start Geth with
'geth --http --dev --dev....
1
vote
0
answers
22
views
Nethereum listen to an event after send transaction
Solidity code for creating a new contract calling createRainfallPolicy:
event PolicyCreated(address _policy, string _insuredId);
function createRainfallPolicy(/*Params*/) public {
RainfallPolicy ...
0
votes
1
answer
307
views
Sending transaction to Uniswap/Pancakeswap Router using Nethereum failing
I'm trying to send a transaction to the Uniswap or Pancakeswap V3 router using Nethereum for a token swap via "exactInputSingle", but first I'm performing a gas estimate for the transaction. ...
0
votes
0
answers
170
views
How to batch RpcRequests in Nethereum
I am currently trying to understand how to batch requests to an ethereum-node in Nethereum. Unfortunately there is not much of a documentation, I only found one working example that queries the native ...
1
vote
0
answers
149
views
ABI-encoding in Nethereum of a struct that contains a bytes-array (variable size)
I have a custom struct defined in solidity. When calling the decode-function of the contract, I want to decode an encoded MyStruct (in bytes).
This works perfectly as long as a previous defined ...
1
vote
0
answers
88
views
Nethereum - get require output from failed transaction
I can use Remix and get the output from the require function.
require(balanceOf[src] >= wad, "insufficient-balance");
If the require function fails, I get the "insufficient-balance&...
1
vote
0
answers
97
views
Creating a wallet and account
I am using nethereum, and am creating an account. But I believe it is better to create the wallet first. I then save the account to a keystore:
Wallet wallet = new Wallet(Wordlist.English, WordCount....
0
votes
1
answer
23
views
What is the relationship between wallet/accounts and Client Nodes?
For client nodes such as Parity or Beth, does every wallet or account have to be associated to a client node? My understanding is that the client node is the interaction to the exchange.
0
votes
1
answer
80
views
Error connected to Blockchain
Most of the Nethereum samples provide the same simple way to connect:
Using Nethereum.Web3;
var web3 = new Web3("https://mainnet.infura.io");
However this results in the following error:
...
0
votes
0
answers
29
views
Nethereum Keystore and Wallets
I am using Nethereum KeyStore to store privateKeys. It looks like in order to save private keys for the wallet, you will need the account addresses and index ahead of time. What is the index referring ...
0
votes
1
answer
84
views
Nethereum: What is the relationship between Wallets and Accounts?
I am using Nethereum for .net.
I am reading this: https://docs.nethereum.com/en/latest/accounts/
I am also reading this: https://docs.nethereum.com/en/latest/Nethereum.Workbooks/docs/nethereum-...
0
votes
0
answers
30
views
SendTransactionAsync only works with public key
I am trying to call a function from my contract using Netherums "SendTransactionAsync", however, it only works when the source is a public key rather than a private key.
I am using Ganache ...
0
votes
0
answers
11
views
Eth_subscribe NewBlocks freezeing
I'm working on a listener for all confirmed transactions on ethereum mainnet, with a .net core application using nethereum for subscribing for new confirmed blocks. After a while the app freezes (...
0
votes
0
answers
69
views
How do I create an Ethereum unsigned transaction in C# that must be signed externally?
I want to construct a raw unsigned transaction in C# using NEthereum and I use it at an externally signer hardware device for signing.
Please consider that my transaction parameters are:
fromAddress, ...
1
vote
0
answers
65
views
How does one poll for transfer events using Nethereum?
I have a contract deployed on Goerli test network, given the code below, I never see any event changes when I transfer tokens.
public static async Task PollForEvents(JObject pixelBlock)
{
...
0
votes
0
answers
39
views
String value expected for type 'string' error while calling a smart contract
I am trying to call a smart contract from c#.NET. I was given an ABI file and i was able to generate the service classes. But while trying to call the function using CallDeserializingToObjectAsync ...
1
vote
2
answers
587
views
I need to know gas price C# Nethereum
How can I get current gas price?
I want to calculate the gas fee per transaction. I need to multiply Gas Price by _estimatedGas. I looked at the Gas price on https://bscscan.com/ it's 5 Gwei. Can I ...
2
votes
0
answers
64
views
Convert FunctionMessage into ABI string using Nethereum
I want to convert FunctionMessage objects into ABI. Is there any function in Nethereum library to do this work or should I do it using reflection ?
code example:
[Function("balanceOf", "...
0
votes
1
answer
40
views
What is DTOs in Ethereum?
I saw this in
http://docs.nethereum.com/en/latest/introduction/rpc/#dtos
Basically, there is an article whose title is DTO and then there is no explanation whatsoever what s DTO
What is it?
What can ...
1
vote
1
answer
186
views
I cannot see a single event in NEthereum
Say I have this code:
private async void LaunchEventRetrievalLoop()
{
try
{
Debug.Log("Creating event filter");
...
0
votes
1
answer
77
views
What is the difference between a node and a client?
In ethereum, we do not usually interact with the network directly.
We interact with a node or a client.
What's the difference between them?
0
votes
1
answer
123
views
do wallets like metamask interact with infura.io?
I want to create my own wallet using nethereum.
Do I need paid service like infura?
Say I want to send money from one fantom address to another.
Do I need some public ethereum or fantom client?
0
votes
1
answer
367
views
TimeOut excpetion on websocket using Nethereum
I'm working on a frontrunning bot using Nethereum. the problem I'm facing is the following, once I get all the pending transaction hashes through the websocket, I pass the hash trhough ...
0
votes
1
answer
153
views
Nethereum - get Contract Source Code
How can I get a contract source code and contract ABI code using Nethereum? For example like here: https://api.bscscan.com/api?module=contract&action=getsourcecode&address=...
0
votes
0
answers
213
views
Swap Pancakeswap using Nethereum
i dont find any examples or snippets for Nethereum. How can i swap Tokens via Pancakeswap on Nethereum?
Thanks for help
0
votes
0
answers
170
views
Problem returning tokenURI(string) from contract
I'm trying to return information from a contract, most specifically the tokenURI. My problem is that I cannot visualize the result... it seems to be empty when it was supposed to be a string. I must ...
2
votes
1
answer
454
views
How to listen to smart contract emitted events using C#
I have to add/update some data in a database when specific events are emitted by a solidity smart contract. When using web3.js there is a simple method called watch(), but I didn't find anything like ...
1
vote
0
answers
574
views
How to call a contract's function in Nethereum?
I'm trying to call a contract's function but get an error "Function not found". I've made a test contract from this topic https://docs.nethereum.com/en/latest/contracts/calling-transactions-...
1
vote
1
answer
632
views
Why would Pending transactions disappear?
I've been working on integrating with the Polygon blockchain programmatically (using Nethereum) but my contract interactions and send transactions all appear to be pending, then when I search for them ...
1
vote
0
answers
117
views
Result of getting information from ethereum is null
I am writing a simple smart contract using Nethereum using this solidity code:
pragma solidity >=0.4.0 <0.7.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
...
0
votes
1
answer
535
views
ERC721 - mass ownerOf request(or another way get all TokenIDs on address)
I use nethereum for get ownerOf NFT ids
[Function("ownerOf", "address")]
public class OwnerOfFunction : FunctionMessage
{
[Parameter("uint256", "_tokenId", ...
0
votes
1
answer
1k
views
Get balanceOf tokens ERC721 (nethereum)
Just trying get count of uniswap NFT-s on 0x5794d36de0c21211a7906688981371132bd7c6f0 wallet
Step one: Get contract from adress 0xc36442b4a4522e871399cd717abdd847ab11fe88 (Contract address for uniswap ...
0
votes
1
answer
400
views
Is using private key of an account is legal or a good idea in your code?
I was using Nethereum for one of my application, there I found I have to sign transaction before calling a smart contract method, which was OK. I was using infura api.
When I was calling ...
2
votes
1
answer
2k
views
Nethereum and Metamask via Asp.Net?
I'm using Nethereum on the server currently, manually creating Account objects using private keys copied/pasted from a MetaMask wallet. I'm now trying to build access to this functionality through ...
1
vote
0
answers
469
views
How to get the liquidity of a pair in pancakeswap or uniswap?
How can I know in pancakeswap or uniswap when a pair is created and how much liquidity is added?
At the moment what I have thought is to read the "PairCreated" logs of the Factory contract, ...
1
vote
1
answer
739
views
What unit are the Uniswap/PancakeSwap router functions expecting?
I'm looking at this transaction in BSCScan: https://bscscan.com/tx/0x09a19072b2374340de10dc6ac235fcd0ba229ff1eba41e155f5b0a60f9c2e2cd
When looking at Input Data for the method call, the caller ...
1
vote
2
answers
2k
views
Decoding Transaction input data in Nethereum
I'm using Nethereum and see this example of how to decode the Input data of a Transaction object. Nethereum Playground C#
This looks like it assumes that you have to know which function data you're ...
1
vote
2
answers
832
views
How to interact with Smart Contract via Web3/Nethereum without known ABI
Let's say I'm using Web3 or Nethereum, both of which apparently require the contract's ABI to bind the functions.
Is there no way to call smart contract functions without knowing the complete ABI? ...
1
vote
0
answers
765
views
Getting 403 Access Denied after several hours of execution [closed]
I have an application that executes fine for several hours but after a while I start seeing 403 exceptions from the RPC client, usually on internal TranasactionManager calls like "Estimate Gas&...
0
votes
0
answers
156
views
Why ETH Transfer from Nethereum taking longer time then transfering from metamask wallet?
I am sorry for nubby question.
Today i made a ETH transfer of 0.00001 ETH 2 times. One programmatically with Netherium SDK and another directly through metamask wallet to another metamask wallet.
Here ...
1
vote
1
answer
256
views
How to make API calls to AWS Managed Blockchain using Nethereum?
I am testing AWS Ethereum (Preview) using Nethereum and I see this method to get a block:
var block = await web3.Eth.Blocks.GetBlockNumber.SendRequestAsync();
However, the AWS Ehtereum documentation ...
1
vote
2
answers
4k
views
How to call a smart contract function using Nethereum and Infura
I am using Nethereum to call a smart contract function in Ropsten. I am also using Infura.
The function required the contract owner's permission to execute.
This is my code:
var account = new Account(...
1
vote
0
answers
113
views
What argument does contract.GetFunctionSignature expects?
I'm trying to get function by signature from contract using Nethereum.Contracts.Contract.GetFunctionBySignature.
This function seems to expect the signature of function, however how can I generate the ...
2
votes
1
answer
764
views
How to get the Error Message from revert and require on a solidity contract with Nethereum
Is there a way on Nethereum to get the string messages returned from arevert or require are executed on solidity contract?
1
vote
1
answer
2k
views
Get ERC20 balance of token holder as of block number with C# Nethereum and Infura
When this code runs, it throws an error "RpcResponseException: header not found", and I don't understand why or how to fix it. Any advice?
Notes: I am using Nethereum in C#.net and using ...
2
votes
2
answers
856
views
EcRecover signed message does not match PublicAddress
I am trying to create a C# webservice back end API that handles the code logic found in Step #5 here:
https://www.toptal.com/ethereum/one-click-login-flows-a-metamask-tutorial
Their code looks like ...
0
votes
1
answer
271
views
Is it feasible to write a DApp that targets multiple blockchains
This question does not target Ethereum specifically, but I hope you can help me out! If my questions are too specific, I apologize in advance.
I'm trying to utilize Blockchain's immutable + provable ...