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

Commit

Permalink
Add maker miner fees UI (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
matsakiv authored Jan 14, 2021
1 parent 6a41906 commit 554d305
Show file tree
Hide file tree
Showing 16 changed files with 440 additions and 495 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build release

on:
push:
tags:
- "*.*.*"

jobs:
build:
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Restore NuGet Packages
run: nuget restore Atomex.Client.Wpf.sln
- name: Build
run: msbuild /p:Configuration="Release" /clp:ErrorsOnly
- name: Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: true
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build and run tests

on: push

jobs:
build:
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Restore NuGet Packages
run: nuget restore Atomex.Client.Wpf.sln
- name: Build
run: msbuild /p:Configuration="Release" /clp:ErrorsOnly
34 changes: 0 additions & 34 deletions .gitlab-ci.yml

This file was deleted.

1 change: 0 additions & 1 deletion Atomex.Client.Wpf/Atomex.Client.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@
<Compile Include="ViewModels\SendViewModels\TezosSendViewModel.cs" />
<Compile Include="ViewModels\SendViewModels\SendViewModel.cs" />
<Compile Include="ViewModels\SendViewModels\SendViewModelCreator.cs" />
<Compile Include="ViewModels\TokensConversionViewModel.cs" />
<Compile Include="ViewModels\TransactionViewModels\TezosFA12TransactionViewModel.cs" />
<Compile Include="ViewModels\TransactionViewModels\TezosFA2TransactionViewModel.cs" />
<Compile Include="ViewModels\TransactionViewModels\TezosNYXTransactionViewModel.cs" />
Expand Down
18 changes: 18 additions & 0 deletions Atomex.Client.Wpf/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Atomex.Client.Wpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,10 @@ NOTE: Do not sign out or close the application until the swap is completed, othe
<data name="CvLowFees" xml:space="preserve">
<value>Warning: too low fees</value>
</data>
<data name="CvSufficientNetworkFee" xml:space="preserve">
<value>Sufficient network fee for this amount ({0} is {1}).</value>
</data>
<data name="CvTooHighNetworkFee" xml:space="preserve">
<value>Too high network fee for this amount ({0} is {1})!</value>
</data>
</root>
1 change: 1 addition & 0 deletions Atomex.Client.Wpf/Resources/Icons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<PathGeometry x:Key="Octicons.Clippy">M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z</PathGeometry>
<PathGeometry x:Key="Octicons.Sync">M10.24 7.4a4.15 4.15 0 01-1.2 3.6 4.346 4.346 0 01-5.41.54L4.8 10.4.5 9.8l.6 4.2 1.31-1.26c2.36 1.74 5.7 1.57 7.84-.54a5.876 5.876 0 001.74-4.46l-1.75-.34zM2.96 5a4.346 4.346 0 015.41-.54L7.2 5.6l4.3.6-.6-4.2-1.31 1.26c-2.36-1.74-5.7-1.57-7.85.54C.5 5.03-.06 6.65.01 8.26l1.75.35A4.17 4.17 0 012.96 5z</PathGeometry>
<PathGeometry x:Key="Octicons.Alert">M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 000 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 00.01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z</PathGeometry>

<!-- FontAwesome -->

Expand Down
1 change: 1 addition & 0 deletions Atomex.Client.Wpf/Themes/blue.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<SolidColorBrush x:Key="DefaultTextBoxCuretBrush" Color="{DynamicResource DefaultTextBoxCuretColor}"/>
<SolidColorBrush x:Key="DefaultSubstrateBrush" Color="{DynamicResource DefaultSubstrateColor}"/>
<SolidColorBrush x:Key="WarningForegroundBrush" Color="Gold"/>
<SolidColorBrush x:Key="CriticalWarningForegroundBrush" Color="#ef6a41"/>
<SolidColorBrush x:Key="FieldHeaderBackgroundBrush" Color="#214174"/>
<SolidColorBrush x:Key="DefaultAmountForegroundBrush" Color="#eeff00"/>
<SolidColorBrush x:Key="DefaultAmountInBaseForegroundBrush" Color="DarkGray"/>
Expand Down
37 changes: 21 additions & 16 deletions Atomex.Client.Wpf/ViewModels/ConversionConfirmationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Serilog;

using Atomex.Blockchain.Abstract;
using Atomex.Client.Wpf.Common;
using Atomex.Client.Wpf.Controls;
Expand All @@ -11,7 +13,6 @@
using Atomex.Client.Wpf.ViewModels.CurrencyViewModels;
using Atomex.Common;
using Atomex.Core;
using Serilog;

namespace Atomex.Client.Wpf.ViewModels
{
Expand Down Expand Up @@ -51,19 +52,22 @@ public class ConversionConfirmationViewModel : BaseViewModel
public decimal EstimatedPaymentFeeInBase { get; set; }
public decimal EstimatedRedeemFee { get; set; }
public decimal EstimatedRedeemFeeInBase { get; set; }
public decimal EstimatedMakerMinerFee { get; set; }
public decimal EstimatedMakerMinerFeeInBase { get; set; }
public decimal EstimatedTotalMinerFeeInBase { get; set; }

public decimal RewardForRedeem { get; set; }
public decimal RewardForRedeemInBase { get; set; }
public bool HasRewardForRedeem { get; set; }

private ICommand _backCommand;
public ICommand BackCommand => _backCommand ?? (_backCommand = new Command(() =>
public ICommand BackCommand => _backCommand ??= new Command(() =>
{
DialogViewer.HideDialog(Dialogs.Convert);
}));
});

private ICommand _nextCommand;
public ICommand NextCommand => _nextCommand ?? (_nextCommand = new Command(Send));
public ICommand NextCommand => _nextCommand ??= new Command(Send);

#if DEBUG
public ConversionConfirmationViewModel()
Expand Down Expand Up @@ -149,12 +153,12 @@ private async Task<Error> ConvertAsync()
if (Amount > 0 && !fromWallets.Any())
return new Error(Errors.SwapError, Resources.CvInsufficientFunds);

var symbol = App.Account.Symbols.SymbolByCurrencies(FromCurrency, ToCurrency);
var symbol = App.Account.Symbols.SymbolByCurrencies(FromCurrency, ToCurrency);
var baseCurrency = App.Account.Currencies.GetByName(symbol.Base);
var side = symbol.OrderSideForBuyCurrency(ToCurrency);
var terminal = App.Terminal;
var price = EstimatedPrice;
var orderPrice = EstimatedOrderPrice;
var side = symbol.OrderSideForBuyCurrency(ToCurrency);
var terminal = App.Terminal;
var price = EstimatedPrice;
var orderPrice = EstimatedOrderPrice;

if (price == 0)
return new Error(Errors.NoLiquidity, Resources.CvNoLiquidity);
Expand All @@ -171,13 +175,14 @@ private async Task<Error> ConvertAsync()

var order = new Order
{
Symbol = symbol.Name,
TimeStamp = DateTime.UtcNow,
Price = orderPrice,
Qty = qty,
Side = side,
Type = OrderType.FillOrKill,
FromWallets = fromWallets.ToList()
Symbol = symbol.Name,
TimeStamp = DateTime.UtcNow,
Price = orderPrice,
Qty = qty,
Side = side,
Type = OrderType.FillOrKill,
FromWallets = fromWallets.ToList(),
MakerMinerFee = EstimatedMakerMinerFee
};

await order.CreateProofOfPossessionAsync(account);
Expand Down
Loading

0 comments on commit 554d305

Please sign in to comment.