public static TransactionApi CreateTransaction(string recipientId, long satoshiAmount, string vendorField,
                                                       string passphrase, string secondPassphrase = null)
        {
            var tx = new TransactionApi(0, recipientId, satoshiAmount, SmartHoldemNetApi.Instance.NetworkSettings.Fee.Send, vendorField);

            tx.Timestamp = Slot.GetTime();
            tx.Sign(passphrase);
            tx.StrBytes = Encoders.Hex.EncodeData(tx.ToBytes());
            if (secondPassphrase != null)
            {
                tx.SecondSign(secondPassphrase);
            }

            tx.Id = Crypto.GetId(tx);
            return(tx);
        }
        public static TransactionApi CreateVote(List <string> votes, string passphrase, string secondPassphrase = null)
        {
            var tx = new TransactionApi(3, 0, SmartHoldemNetApi.Instance.NetworkSettings.Fee.Vote);

            tx.asset.Add("votes", votes);
            tx.Timestamp   = Slot.GetTime();
            tx.RecipientId = Crypto.GetAddress(Crypto.GetKeys(passphrase), SmartHoldemNetApi.Instance.NetworkSettings.BytePrefix);
            tx.Sign(passphrase);
            tx.StrBytes = Encoders.Hex.EncodeData(tx.ToBytes());
            if (secondPassphrase != null)
            {
                tx.SecondSign(secondPassphrase);
            }

            tx.Id = Crypto.GetId(tx);

            return(tx);
        }
Example #3
0
 public static byte[] GetBytes(TransactionApi t, bool skipSignature = true, bool skipSecondSignature = true)
 {
     return(t.ToBytes(skipSignature, skipSecondSignature));
 }