Exemple #1
0
        public Task <(string hash, string signedTransaction)> SignTransactionAsync(
            string transactionContext, IReadOnlyList <string> privateKeys)
        {
            if (privateKeys.Count != 1)
            {
                throw new ArgumentException("Only single private key is allowed");
            }

            var key = KeyPair.CreateFromPrivateKey(privateKeys[0]);
            var signedTransaction = TransferTransaction.FromJson(transactionContext).SignWith(key);
            var result            = (
                signedTransaction.Hash,
                signedTransaction.ToJson()
                );

            return(Task.FromResult(result));
        }