Skip to content

Commit

Permalink
Add head quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Groxan committed Aug 5, 2020
1 parent 3a6af88 commit 7d307c6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
20 changes: 20 additions & 0 deletions Tzkt.Api/Models/State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,25 @@ public class State
/// State of TzKT indexer synchronization
/// </summary>
public bool Synced => KnownLevel == Level;

/// <summary>
/// The height of the block where quotes were updated last time
/// </summary>
public int QuoteLevel { get; set; }

/// <summary>
/// Last known XTZ/BTC price
/// </summary>
public double QuoteBtc { get; set; }

/// <summary>
/// Last known XTZ/EUR price
/// </summary>
public double QuoteEur { get; set; }

/// <summary>
/// Last known XTZ/USD price
/// </summary>
public double QuoteUsd { get; set; }
}
}
7 changes: 5 additions & 2 deletions Tzkt.Api/Repositories/StateRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Dapper;

using Tzkt.Api.Models;
using Tzkt.Api.Services.Cache;
Expand All @@ -30,7 +29,11 @@ public Task<State> Get()
Hash = appState.Hash,
Level = appState.Level,
Protocol = appState.Protocol,
Timestamp = appState.Timestamp
Timestamp = appState.Timestamp,
QuoteLevel = appState.QuoteLevel,
QuoteBtc = appState.QuoteBtc,
QuoteEur = appState.QuoteEur,
QuoteUsd = appState.QuoteUsd
});
}
}
Expand Down

0 comments on commit 7d307c6

Please sign in to comment.