Пример #1
0
        public string SignTransaction(byte[] privateKey, BigInteger chainId, string to, BigInteger amount, string feeCurrency, string gatewayFeeRecipient, BigInteger gatewayFee,
                                      BigInteger nonce, string data)
        {
            var transaction = new CeloTransactionChainId(to, amount, nonce, feeCurrency, gatewayFeeRecipient, gatewayFee, data, chainId);

            return(SignTransaction(privateKey, transaction));
        }
Пример #2
0
        public Task <string> SignTransactionAsync(ICeloEthExternalSigner externalSigner, BigInteger chainId, string to, BigInteger amount, string feeCurrency, string gatewayFeeRecipient, BigInteger gatewayFee,
                                                  BigInteger nonce, string data)
        {
            var transaction = new CeloTransactionChainId(to, amount, nonce, feeCurrency, gatewayFeeRecipient, gatewayFee, data, chainId);

            return(SignTransactionAsync(externalSigner, transaction));
        }
Пример #3
0
        public Task <string> SignTransactionAsync(ICeloEthExternalSigner externalSigner, BigInteger chainId, string to, BigInteger amount,
                                                  BigInteger nonce, string data)
        {
            var transaction = new CeloTransactionChainId(to, amount, nonce, data, chainId);

            return(SignTransactionAsync(externalSigner, transaction));
        }
Пример #4
0
        public string SignTransaction(byte[] privateKey, BigInteger chainId, string to, BigInteger amount,
                                      BigInteger nonce, string data)
        {
            var transaction = new CeloTransactionChainId(to, amount, nonce, data, chainId);

            return(SignTransaction(privateKey, transaction));
        }
        protected async Task SignRLPTransactionAsync(CeloTransactionChainId transaction)
        {
            if (ExternalSignerTransactionFormat == ExternalSignerTransactionFormat.RLP)
            {
                var signature = await SignAsync(transaction.RawHash, transaction.GetChainIdAsBigInteger());

                transaction.SetSignature(signature);
            }
        }
Пример #6
0
        public bool VerifyTransaction(string rlp, BigInteger chainId)
        {
            var transaction = new CeloTransactionChainId(rlp.HexToByteArray(), chainId);

            return(transaction.Key.VerifyAllowingOnlyLowS(transaction.RawHash, transaction.Signature));
        }
Пример #7
0
        public string GetSenderAddress(string rlp, BigInteger chainId)
        {
            var transaction = new CeloTransactionChainId(rlp.HexToByteArray(), chainId);

            return(transaction.Key.GetPublicAddress());
        }
Пример #8
0
        public byte[] GetPublicKey(string rlp, BigInteger chainId)
        {
            var transaction = new CeloTransactionChainId(rlp.HexToByteArray(), chainId);

            return(transaction.Key.GetPubKey());
        }
Пример #9
0
        private async Task <string> SignTransactionAsync(ICeloEthExternalSigner externalSigner, CeloTransactionChainId transaction)
        {
            await transaction.SignExternallyAsync(externalSigner).ConfigureAwait(false);

            return(transaction.GetRLPEncoded().ToHex());
        }
Пример #10
0
 private string SignTransaction(byte[] privateKey, CeloTransactionChainId transaction)
 {
     transaction.Sign(new EthECKey(privateKey, true));
     return(transaction.GetRLPEncoded().ToHex());
 }
 public abstract Task SignAsync(CeloTransactionChainId transaction);