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); }
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); }
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); }
public static Transaccion GetTokenTransaccion(string line, string key) { var row = TokenCsvRow.FromCsv(line); return(CreateTokenTransaccion(row, key)); }