Skip to main content

Questions tagged [nethereum]

Questions related to the C# .NET Ethereum Web3 RPC Client Library, named nethereum

Filter by
Sorted by
Tagged with
4 votes
1 answer
52 views

How to sign Ethereum message in C#

I`m trying to convert this code to c# const message = response.data.message; const jsonProvider = new ethers.providers.JsonRpcProvider(RPC_URL) const ethersSigner = new ethers.Wallet(privatekey, ...
Jānis Kļaviņš's user avatar
1 vote
0 answers
15 views

Create Call Data for function input using Nethereum

I want to call it a smart contract function. I am signing the transaction using Metamask so I need to create call data for the transaction. I want to use Nethereum for creating the call data of the ...
Shubhankar Banerjee's user avatar
1 vote
0 answers
83 views

Send Tron transaction with Ethereum compatible address

Is it possible to make a transaction for the Tron network with the Nethereum library? As you know, Tron addresses can be converted to Ethereum format with the help of the following site https://...
Hoda Parsafar's user avatar
0 votes
1 answer
83 views

Decode "pending transactions" from socket without calling RPC for every transaction?

Initial goal: catch transactions from address (when address calls "swap" events or "addliquidity" events, or does transfer on PancakeSwap router). I want to catch that kind of ...
Danik Logan's user avatar
0 votes
0 answers
69 views

PancakeSwapV2 router "getAmountsOut" function returns wrong value

I'm struggling with "getAmountsOut" function, which works kinda fine for BNB/CAKE or CAKE/BNB. But it in some cases it just returns straight wrong values. Code: public async Task<decimal&...
Danik Logan's user avatar
1 vote
2 answers
266 views

Nethereum: any pancakeswap contract function call results in "execution_reverted", all transactions fail with same error

I'm completely new to web3, and I do realise that there is small portion of information on the web3 for developers, especially when it comes to debugging and issue solving. My main goal is just to ...
Danik Logan's user avatar
0 votes
0 answers
18 views

Nethereum when sending transaction to contract Number was less than the array's lower bound in the first dimension. (Parameter 'destinationIndex')

Hello i have problem with simply smartcontract: [Function("saveData")] public class SmartContractDataFunc : FunctionMessage { [Parameter("uint256","_id", ...
Kamil's user avatar
  • 143
1 vote
1 answer
38 views

Async call to GetBlockWithTransactionsByNumber frequently returns 'NULL' block (Nethereum)

Calling GetBlockWithTransactionsByNumber asynchronoulsy from within a ProcessorForContract frequently returns NULLs. If I execute the following: HexBigInteger blockNumber = new HexBigInteger(sl.Log....
Kodo's user avatar
  • 111
0 votes
2 answers
81 views

Interacting with deployed smartcontract with Nethereum(.NET) and Infura

I'm able to deploy my contract to sepolia. I have ABI, Bytecode of deployed contract. in .NET environment in register method I have: { var senderAddress = "...
michal's user avatar
  • 13
2 votes
1 answer
580 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 ...
Ali's user avatar
  • 63
1 vote
1 answer
26 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 ...
Ali's user avatar
  • 63
0 votes
1 answer
91 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, ...
k9b's user avatar
  • 103
0 votes
0 answers
121 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....
ThomasS's user avatar
  • 13
1 vote
0 answers
30 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 ...
Farceg's user avatar
  • 11
0 votes
1 answer
540 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. ...
Calculon's user avatar
1 vote
0 answers
233 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 ...
Alexander Schmidt's user avatar
1 vote
0 answers
159 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&...
Dumber_Texan2's user avatar
1 vote
0 answers
193 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....
HoboJeff's user avatar
0 votes
1 answer
30 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.
HoboJeff's user avatar
0 votes
1 answer
130 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: ...
Calvin's user avatar
  • 1
0 votes
1 answer
118 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-...
HoboJeff's user avatar
1 vote
0 answers
94 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) { ...
ZackOfAllTrades's user avatar
1 vote
2 answers
979 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 ...
Oleg's user avatar
  • 11
2 votes
0 answers
90 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", "...
user19291301's user avatar
0 votes
1 answer
44 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 ...
user4951's user avatar
  • 253
1 vote
1 answer
263 views

I cannot see a single event in NEthereum

Say I have this code: private async void LaunchEventRetrievalLoop() { try { Debug.Log("Creating event filter"); ...
Luis Masuelli's user avatar
0 votes
1 answer
129 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?
user4951's user avatar
  • 253
0 votes
1 answer
146 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?
user4951's user avatar
  • 253
0 votes
1 answer
514 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 ...
ramy ben haj yahia's user avatar
0 votes
1 answer
182 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=...
SanderNsk's user avatar
0 votes
0 answers
250 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
Thomas 's user avatar
0 votes
0 answers
183 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 ...
SergioAAV's user avatar
2 votes
1 answer
684 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 ...
Angelo Schuler Piletti's user avatar
1 vote
0 answers
639 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-...
Xed's user avatar
  • 11
1 vote
1 answer
819 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 ...
Gith's user avatar
  • 13
1 vote
0 answers
129 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 { ...
Karyna Dorosh's user avatar
0 votes
1 answer
553 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", ...
Potion's user avatar
  • 103
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 ...
Potion's user avatar
  • 103
0 votes
1 answer
435 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 ...
Md. Nahiduzzaman Rose's user avatar
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 ...
user1142433's user avatar
1 vote
0 answers
487 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, ...
jeissoni22's user avatar
1 vote
1 answer
770 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 ...
user1142433's user avatar
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 ...
user1142433's user avatar
1 vote
2 answers
931 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? ...
user1142433's user avatar
1 vote
0 answers
802 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&...
Ofek's user avatar
  • 111
0 votes
0 answers
169 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 ...
Yogesh's user avatar
  • 101
1 vote
1 answer
279 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 ...
Primico's user avatar
  • 111
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(...
Anh Vũ Nguyễn's user avatar
1 vote
0 answers
119 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 ...
user65462's user avatar
2 votes
1 answer
890 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?
elranu's user avatar
  • 121