コード例 #1
0
 private static Transaccion CreateTokenTransaccion(TokenCsvRow row, string key)
 {
     if (string.Equals(row.To, key))
     {
         return(CreateTokenDeposito(row));
     }
     if (string.Equals(row.From, key))
     {
         return(CreateTokenRetirada(row));
     }
     return(null);
 }
コード例 #2
0
        private static Transaccion CreateTokenRetirada(TokenCsvRow row)
        {
            Transaccion transaccion = new Transaccion
            {
                Id             = Guid.NewGuid(),
                Tipo           = "retirada",
                Exchange       = row.From,
                Cantidad_Venta = row.Value,
                Divisa_Venta   = row.TokenSymbol,
                Detalles       = row.To,
                Comentarios    = row.ContractAddress,
                Fecha          = row.TimestampUTC
            };

            return(transaccion);
        }
コード例 #3
0
ファイル: TokenCsvRow.cs プロジェクト: pedroec1/Trackrypto
        public static TokenCsvRow FromCsv(string csvLine)
        {
            List <string> values = new List <string>();

            csvLine.Split(',').ToList().ForEach(value => values.Add(value.Trim('\"')));

            TokenCsvRow csvRow = new TokenCsvRow
            {
                Txhash          = values[0],
                UnixTimestamp   = Convert.ToInt32(values[1]),
                TimestampUTC    = Convert.ToDateTime(values[2]),
                From            = values[3],
                To              = values[4],
                Value           = Convert.ToDecimal(values[5], CultureInfo.InvariantCulture),
                ContractAddress = values[6],
                TokenName       = values[7],
                TokenSymbol     = values[8]
            };

            return(csvRow);
        }
コード例 #4
0
        public static Transaccion GetTokenTransaccion(string line, string key)
        {
            var row = TokenCsvRow.FromCsv(line);

            return(CreateTokenTransaccion(row, key));
        }