/// <inheritdoc /> public Task <Bytes> SendTransaction(SignedTransaction signedTransaction) { var requestId = GetCurrentUnixTime(); var request = new Request(requestId, "icx_sendTransaction", signedTransaction.GetProperties()); return(_provider.SendRequestAsync(request, FindConverter <Bytes>())); }
public static SignedTransaction Deserialize(string transactionSerialized) { var(transaction, rpcObject) = TransactionDeserializer.DeserializeToTransactionAndRpc(transactionSerialized); var signature = rpcObject.GetItem("signature"); if (signature == null) { throw new InvalidOperationException("Signature is not provided"); } var sign = Base64.Decode(signature.ToString()); var sender = transaction.GetFrom(); var props = GetTransactionProperties(transaction); var transactionHash = GetTransactionHash(props); if (!EcdsaSignature.VerifySignature(sender, sign, transactionHash)) { throw new ArgumentException("Signature does not match", nameof(transactionSerialized)); } var signedTransaction = new SignedTransaction(transaction, rpcObject); return(signedTransaction); }