2

I made a transaction using TransactionSigner.SignTransaction(...), and stored it for future reference. How do I parse it back to get the public key/source wallet address, destination address, nonce, and the amount in Wei?

I tried searching the GitHub repo for Parse method, but found none for transactions.

Pang
  • 9,564
  • 146
  • 81
  • 122
LOST
  • 2,956
  • 3
  • 25
  • 40

1 Answers1

5

You will need to use the Nethereum.Signer.TransactionFactory, https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Signer/TransactionFactory.cs

The TransactionFactory checks based on the RLP the way the transaction has been signed (using a ChainId or the default one).

Depending of the way it was signed you will be returned a Transaction https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Signer/Transaction.cs or a TransactionChainId https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Signer/TransactionChainId.cs

P.S Thanks for referencing this question in Nethereum gitter.

Juan Blanco
  • 421
  • 2
  • 6