Exemplo n.º 1
0
        public static Transaction Create(string recipientId, ulong amount, string vendorField, string passphrase, string secondPassphrase = null)
        {
            var transaction = new Transaction
            {
                Type        = Enums.TransactionTypes.TRANSFER,
                Fee         = Fee.Get(Enums.TransactionTypes.TRANSFER),
                RecipientId = recipientId,
                Amount      = amount,
                VendorField = vendorField
            };

            return(Builder.Sign(transaction, passphrase, secondPassphrase));
        }
Exemplo n.º 2
0
        public static Transaction Create(List <string> votes, string passphrase, string secondPassphrase = null)
        {
            var transaction = new Transaction
            {
                Type = Enums.TransactionTypes.VOTE,
                Fee  = Fee.Get(Enums.TransactionTypes.VOTE)
            };

            transaction.Asset.Add("votes", votes);
            transaction.RecipientId = Identities.Address.FromPassphrase(passphrase);

            return(Builder.Sign(transaction, passphrase, secondPassphrase));
        }
        public static Transaction Create(string username, string passphrase, string secondPassphrase = null)
        {
            var transaction = new Transaction
            {
                Type = Enums.TransactionTypes.DELEGATE_REGISTRATION,
                Fee  = Fee.Get(Enums.TransactionTypes.DELEGATE_REGISTRATION)
            };

            transaction.Asset.Add("delegate", new Dictionary <string, string>());
            transaction.Asset["delegate"].Add("username", username);

            return(Builder.Sign(transaction, passphrase, secondPassphrase));
        }
Exemplo n.º 4
0
        public static Transaction Create(string passphrase, string secondPassphrase)
        {
            var transaction = new Transaction
            {
                Type = Enums.TransactionTypes.SECOND_SIGNATURE_REGISTRATION,
                Fee = Fee.Get(Enums.TransactionTypes.SECOND_SIGNATURE_REGISTRATION)
            };

            transaction.Asset.Add("signature", new Dictionary<string, string>());
            var publicKey = Encoders.Hex.EncodeData(Identities.PublicKey.FromPassphrase(secondPassphrase).ToBytes());
            transaction.Asset["signature"].Add("publicKey", publicKey);

            return Builder.Sign(transaction, passphrase, secondPassphrase);
        }
        public static Transaction Create(int min, int lifetime, List <string> keysgroup, string passphrase, string secondPassphrase)
        {
            var transaction = new Transaction
            {
                Type = Enums.TransactionTypes.MULTI_SIGNATURE_REGISTRATION
            };

            transaction.Asset.Add("multisignature", new Dictionary <string, dynamic>());
            transaction.Asset["multisignature"].Add("min", min);
            transaction.Asset["multisignature"].Add("lifetime", lifetime);
            transaction.Asset["multisignature"].Add("keysgroup", keysgroup);

            transaction.Fee = Convert.ToUInt64(keysgroup.Count + 1) * Fee.Get(Enums.TransactionTypes.MULTI_SIGNATURE_REGISTRATION);

            return(Builder.Sign(transaction, passphrase, secondPassphrase));
        }