Exemplo n.º 1
0
        public Task <string> SignTransactionAsync(IEthExternalSigner externalSigner, string to, BigInteger amount, BigInteger nonce,
                                                  BigInteger gasPrice,
                                                  BigInteger gasLimit)
        {
            var transaction = new LegacyTransaction(to, amount, nonce, gasPrice, gasLimit);

            return(SignTransactionAsync(externalSigner, transaction));
        }
Exemplo n.º 2
0
        protected async Task SignRLPTransactionAsync(LegacyTransaction transaction)
        {
            if (ExternalSignerTransactionFormat == ExternalSignerTransactionFormat.RLP)
            {
                var signature = await SignAsync(transaction.GetRLPEncodedRaw()).ConfigureAwait(false);

                transaction.SetSignature(signature);
            }
        }
Exemplo n.º 3
0
        protected async Task SignHashTransactionAsync(LegacyTransaction transaction)
        {
            if (ExternalSignerTransactionFormat == ExternalSignerTransactionFormat.Hash)
            {
                var signature = await SignAsync(transaction.RawHash).ConfigureAwait(false);

                transaction.SetSignature(signature);
            }
        }
Exemplo n.º 4
0
 public abstract Task SignAsync(LegacyTransaction transaction);
Exemplo n.º 5
0
        public string SignTransaction(byte[] privateKey, string to, BigInteger amount, BigInteger nonce, string data)
        {
            var transaction = new LegacyTransaction(to, amount, nonce, data);

            return(SignTransaction(privateKey, transaction));
        }
Exemplo n.º 6
0
        private async Task <string> SignTransactionAsync(IEthExternalSigner externalSigner, LegacyTransaction transaction)
        {
            await transaction.SignExternallyAsync(externalSigner).ConfigureAwait(false);

            return(transaction.GetRLPEncoded().ToHex());
        }
Exemplo n.º 7
0
 private string SignTransaction(byte[] privateKey, LegacyTransaction transaction)
 {
     transaction.Sign(new EthECKey(privateKey, true));
     return(transaction.GetRLPEncoded().ToHex());
 }