如何解析 Nethereum 中的签名交易?

LOS*_*OST 2 c# ethereum nethereum

我使用 进行了交易TransactionSigner.SignTransaction(...),并将其存储以供将来参考。我如何解析它以获得公钥/源钱包地址、目标地址、随机数和 Wei 金额?

我尝试在 GitHub 存储库中搜索Parse方法,但没有找到用于事务的方法。

小智 5

您将需要使用 Nethereum.Signer.TransactionFactory,https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Signer/TransactionFactory.cs

TransactionFactory 根据 RLP 检查交易的签名方式(使用 ChainId 或默认的)。

根据签名方式,您将返回一个交易https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Signer/Transaction.cs或 TransactionChainId https://github.com/Nethereum /Nethereum/blob/master/src/Netthereum.Signer/TransactionChainId.cs

PS 感谢您在 Nethereum gitter 中引用这个问题。