Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
matsakiv committed Jul 12, 2021
1 parent 553a22b commit 1642e01
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Atomex.Client.Core
Submodule Atomex.Client.Core updated 29 files
+2 −2 Atomex.Client.Core/AtomexApp.cs
+1 −0 Atomex.Client.Core/Core/Currency.cs
+1 −0 Atomex.Client.Core/Currencies/Abstract/ICurrenciesProvider.cs
+2 −1 Atomex.Client.Core/Currencies/Bitcoin.cs
+1 −1 Atomex.Client.Core/Currencies/Currencies.cs
+82 −1 Atomex.Client.Core/Currencies/CurrenciesProvider.cs
+1 −0 Atomex.Client.Core/Currencies/Ethereum.cs
+1 −0 Atomex.Client.Core/Currencies/EthereumTokens/ERC20.cs
+1 −0 Atomex.Client.Core/Currencies/Litecoin.cs
+1 −0 Atomex.Client.Core/Currencies/Tezos.cs
+1 −0 Atomex.Client.Core/Currencies/TezosTokens/FA12.cs
+1 −0 Atomex.Client.Core/Currencies/TezosTokens/FA2.cs
+1 −0 Atomex.Client.Core/Currencies/TezosTokens/NYX.cs
+2 −2 Atomex.Client.Core/IAtomexApp.cs
+1 −1 Atomex.Client.Core/LiteDb/LiteDbAccountDataRepository.cs
+4 −4 Atomex.Client.Core/LiteDb/LiteDbMigrationManager.cs
+6 −6 Atomex.Client.Core/LiteDb/LiteDbMigrations.cs
+1 −1 Atomex.Client.Core/Services/Abstract/IAtomexClient.cs
+1 −1 Atomex.Client.Core/Services/Abstract/ICurrenciesUpdater.cs
+1 −1 Atomex.Client.Core/Services/Abstract/ISymbolsUpdater.cs
+7 −5 Atomex.Client.Core/Services/CurrenciesUpdater.cs
+4 −3 Atomex.Client.Core/Services/SymbolsUpdater.cs
+3 −2 Atomex.Client.Core/Services/TerminalChangedEventArgs.cs
+1 −1 Atomex.Client.Core/Services/TerminalErrorEventArgs.cs
+1 −1 Atomex.Client.Core/Services/TerminalService.cs
+1 −1 Atomex.Client.Core/Services/TerminalServiceEventArgs.cs
+16 −15 Atomex.Client.Core/Services/WebSocketAtomexClient.cs
+1 −1 Atomex.Client.Core/ViewModels/Helpers.cs
+149 −451 Atomex.Client.Core/currencies.json
23 changes: 17 additions & 6 deletions Atomex.Client.Wpf/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
Expand All @@ -13,7 +14,7 @@
using Atomex.Core;
using Atomex.MarketData.Bitfinex;
using Atomex.Updates;
using Atomex.Subsystems;
using Atomex.Services;

namespace Atomex.Client.Wpf
{
Expand All @@ -35,10 +36,20 @@ public partial class App
.GetAssemblies()
.FirstOrDefault(a => a.GetName().Name == "Atomex.Client.Core");

private static IConfiguration CurrenciesConfiguration { get; } = new ConfigurationBuilder()
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddEmbeddedJsonFile(CoreAssembly, "currencies.json")
.Build();
private static string CurrenciesConfigurationJson
{
get
{
var coreAssembly = CoreAssembly;
var resourceName = "currencies.json";
var resourceNames = coreAssembly.GetManifestResourceNames();
var fullFileName = resourceNames.FirstOrDefault(n => n.EndsWith(resourceName));
var stream = coreAssembly.GetManifestResourceStream(fullFileName!);

using StreamReader reader = new(stream!);
return reader.ReadToEnd();
}
}

private static IConfiguration SymbolsConfiguration { get; } = new ConfigurationBuilder()
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
Expand Down Expand Up @@ -68,7 +79,7 @@ protected override void OnStartup(StartupEventArgs e)

Log.Information("Application startup");

var currenciesProvider = new CurrenciesProvider(CurrenciesConfiguration);
var currenciesProvider = new CurrenciesProvider(CurrenciesConfigurationJson);
var symbolsProvider = new SymbolsProvider(SymbolsConfiguration);

// init Atomex client app
Expand Down
11 changes: 5 additions & 6 deletions Atomex.Client.Wpf/Common/DesignTime.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Linq;
using System.Reflection;

using Microsoft.Extensions.Configuration;

using Atomex.Abstract;
using Atomex.Common.Configuration;
using Atomex.Core;
using Microsoft.Extensions.Configuration;

namespace Atomex.Client.Wpf.Common
{
Expand All @@ -24,10 +26,7 @@ public static class DesignTime
.Build()
.GetSection(Network.TestNet.ToString());

public static readonly ICurrencies Currencies
= new Currencies(CurrenciesConfiguration);

public static readonly ISymbols Symbols
= new Symbols(SymbolsConfiguration);
public static ICurrencies Currencies => new Currencies(CurrenciesConfiguration);
public static ISymbols Symbols => new Symbols(SymbolsConfiguration);
}
}
2 changes: 1 addition & 1 deletion Atomex.Client.Wpf/ViewModels/BuyWithCardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
using Atomex.Client.Wpf.ViewModels.Abstract;
using Atomex.Client.Wpf.ViewModels.CurrencyViewModels;
using Atomex.Core;
using Atomex.Subsystems;
using Atomex.Wallet.Abstract;
using Atomex.Services;

namespace Atomex.Client.Wpf.ViewModels
{
Expand Down
2 changes: 1 addition & 1 deletion Atomex.Client.Wpf/ViewModels/ConversionViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
using Atomex.Core;
using Atomex.MarketData;
using Atomex.MarketData.Abstract;
using Atomex.Subsystems;
using Atomex.Swaps;
using Atomex.Client.Wpf.Common;
using Atomex.Client.Wpf.Controls;
using Atomex.Client.Wpf.Properties;
using Atomex.Client.Wpf.ViewModels.Abstract;
using Atomex.Client.Wpf.ViewModels.CurrencyViewModels;
using Atomex.Swaps.Helpers;
using Atomex.Services;

namespace Atomex.Client.Wpf.ViewModels
{
Expand Down
4 changes: 2 additions & 2 deletions Atomex.Client.Wpf/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
using Atomex.Common;
using Atomex.MarketData;
using Atomex.MarketData.Abstract;
using Atomex.Subsystems;
using Atomex.Subsystems.Abstract;
using Atomex.Updates;
using Atomex.Wallet;
using Atomex.Wallet.Abstract;
using Atomex.Services.Abstract;
using Atomex.Services;

namespace Atomex.Client.Wpf.ViewModels
{
Expand Down
2 changes: 1 addition & 1 deletion Atomex.Client.Wpf/ViewModels/MyWalletsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Atomex.Client.Wpf.Controls;
using Atomex.Common;
using Atomex.Core;
using Atomex.Subsystems;
using Atomex.Services;
using Atomex.Wallet;
using Atomex.Wallet.Abstract;

Expand Down
2 changes: 1 addition & 1 deletion Atomex.Client.Wpf/ViewModels/PortfolioViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
using System.Linq;
using System.Windows.Media;
using Atomex.Common;
using Atomex.Subsystems;
using Atomex.Client.Wpf.Common;
using Atomex.Client.Wpf.ViewModels.Abstract;
using OxyPlot;
using OxyPlot.Series;
using OxyPlot.Wpf;
using PieSeries = OxyPlot.Series.PieSeries;
using Atomex.Client.Wpf.ViewModels.CurrencyViewModels;
using Atomex.Services;

namespace Atomex.Client.Wpf.ViewModels
{
Expand Down
2 changes: 1 addition & 1 deletion Atomex.Client.Wpf/ViewModels/StartViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using Atomex.Client.Wpf.Common;
using Atomex.Client.Wpf.Controls;
using Atomex.Subsystems;
using Atomex.Services;
using Atomex.Wallet.Abstract;

namespace Atomex.Client.Wpf.ViewModels
Expand Down
2 changes: 1 addition & 1 deletion Atomex.Client.Wpf/ViewModels/WalletsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using Atomex.Subsystems;
using Atomex.Client.Wpf.Common;
using Atomex.Client.Wpf.Controls;
using Atomex.Client.Wpf.ViewModels.Abstract;
using Atomex.Client.Wpf.ViewModels.CurrencyViewModels;
using Atomex.Client.Wpf.ViewModels.WalletViewModels;
using Atomex.Services;

namespace Atomex.Client.Wpf.ViewModels
{
Expand Down

0 comments on commit 1642e01

Please sign in to comment.