MultiversX Tracker is Live!

How to test signature is valid offline with nethereum?

Etherum Reddit

More / Etherum Reddit 10 Views

I got a program that's already working.

Try

' Get the nonce for the sender address

Dim nonce = Await HelperNethereum.Polygon.Web3.Eth.Transactions.GetTransactionCount.SendRequestAsync(fromAddress)

' Convert the amount to Wei

Dim valueInWei = Web3.Convert.ToWei(amountToSend)

Dim gasPrice = Await HelperNethereum.Polygon.asyncGetGasPrice

Dim signer = New Nethereum.Signer.LegacyTransactionSigner()

Dim signedTransaction = signer.SignTransaction(

privateKey,

137,

toAddress,

valueInWei,

nonce.Value,

gasPrice,

New HexBigInteger(21000)

)

Dim jsonPayload = New With {

.jsonrpc = "2.0",

.method = "eth_sendRawTransaction",

.params = New String() {"0x" + signedTransaction},

.id = 1

}

' Serialize the payload to JSON

Dim jsonContent = JsonConvert.SerializeObject(jsonPayload)

Dim jsonresult = Await CookieAwareWebClient.downloadString1Async("https://polygon-rpc.com", jsonContent)

Now, it's a test program. I used it to get to know nethereum.

Now After I got signedTransaction, I want to test if signedTransaction is legit.

How do I do so?

ChatGPT keeps giving conflicting answer suggesting using functions that no longer work.

Even Juan Blanco's own answer no longer work

https://ethereum.stackexchange.com/questions/3823/how-can-i-sign-a-transaction-using-c

For example, as far as I know, method web3.OfflineTransactionSigning.GetSenderAddress(encoded);

doesn't work anymore because such functions do not exist.

submitted by /u/Few_Needleworker8744
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments