public static OffChainTransactionViewModel Create(string transactionId,
                                                   AssetViewModel asset,
                                                   DateTime dateTime,
                                                   string hubAddress,
                                                   string address1,
                                                   string address2,
                                                   decimal address1Quantity,
                                                   decimal address2Quantity,
                                                   decimal address1QuantityDiff,
                                                   decimal address2QuantityDiff,
                                                   MixedTransactionType type)
 {
     return(new OffChainTransactionViewModel
     {
         TransactionId = transactionId,
         Address1 = address1,
         Address2 = address2,
         Address1Quantity = address1Quantity,
         Address2Quantity = address2Quantity,
         DateTime = dateTime,
         HubAddress = hubAddress,
         Asset = asset,
         Address1QuantityDiff = address1QuantityDiff,
         Address2QuantityDiff = address2QuantityDiff,
         Type = type
     });
 }
        public static OnchainTransaction Create(string transactionId, MixedTransactionType transactionType)
        {
            if (!string.IsNullOrEmpty(transactionId))
            {
                return(new OnchainTransaction
                {
                    TransactionId = transactionId,
                    Type = transactionType
                });
            }

            return(null);
        }
        public static OffchainTransaction Create(OffchainTransactionDataContract source,
                                                 OffchainTransactionMetadataContract metadata, MixedTransactionType type)
        {
            if (source != null)
            {
                return(new OffchainTransaction
                {
                    Address1 = metadata.ClientAddress1,
                    AssetId = metadata.AssetId,
                    Address1Quantity = source.Address1Quantity,
                    Address1QuantityDiff = source.Address1QuantityDiff,
                    Address2 = metadata.ClientAddress2,
                    Address2Quantity = source.Address2Quantity,
                    Address2QuantityDiff = source.Address2QuantityDiff,
                    DateTime = source.Date,
                    HubAddress = metadata.HubAddress,
                    IsColored = metadata.IsColored,
                    TransactionId = source.TransactionId,
                    Type = type
                });
            }

            return(null);
        }