Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisreimann committed Aug 17, 2023
1 parent 6a595eb commit 3690ff9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
23 changes: 17 additions & 6 deletions BTCPayApp.Core/BTCPayConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private async Task TryStayConnected()
}
else
{

InvokeConnectionChange();
await Task.Delay(5000);
}
Expand Down Expand Up @@ -117,7 +117,6 @@ private async Task StartOrReplace()
InvokeConnectionChange();
_subscription = Connection.Register<IBTCPayAppServerClient>(this);
_hubProxy = Connection.CreateHubProxy<IBTCPayAppServerHub>();

}


Expand All @@ -130,7 +129,7 @@ public Task StopAsync(CancellationToken cancellationToken)

public Task<string> ClientMethod1(string user, string message)
{
_logger.LogInformation($"ClientMethod1: {user}, {message}");
_logger.LogInformation("ClientMethod1: {User}, {Message}", user, message);
return Task.FromResult($"[Success] Call ClientMethod1 : {user}, {message}");
}

Expand All @@ -142,7 +141,7 @@ public Task ClientMethod2()

public Task<string> ClientMethod3(string user, string message, CancellationToken cancellationToken)
{
_logger.LogInformation($"ClientMethod3: {user}, {message}");
_logger.LogInformation("ClientMethod3: {User}, {Message}", user, message);
return Task.FromResult($"[Success] Call ClientMethod3 : {user}, {message}");
}

Expand All @@ -156,7 +155,7 @@ public Task OnClosed(Exception? exception)
public Task OnReconnected(string? connectionId)
{
InvokeConnectionChange();
_logger.LogInformation($"OnReconnected: {connectionId}");
_logger.LogInformation("OnReconnected: {ConnectionId}", connectionId);
return Task.CompletedTask;
}

Expand All @@ -166,4 +165,16 @@ public Task OnReconnecting(Exception? exception)
_logger.LogError(exception, "OnReconnecting");
return Task.CompletedTask;
}
}

public Task OnTransactionDetected(string txid)
{
_logger.LogInformation("OnTransactionDetected: {Txid}", txid);
return Task.CompletedTask;
}

public Task NewBlock(string block)
{
_logger.LogInformation("NewBlock: {Block}", block);
return Task.CompletedTask;
}
}
10 changes: 9 additions & 1 deletion BTCPayApp.UI/Pages/Dashboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
}
else
{
<MudAlert Severity="Severity.Error">Your wallet is not configured — <a href="@Routes.WalletSetup">set up a wallet</a>.</MudAlert>
<MudAlert Severity="Severity.Error">
Your wallet is not configured.
<MudButton Href="@Routes.WalletSetup"
Variant="Variant.Filled"
EndIcon="@Icons.Custom.Brands.GitHub"
Color="Color.Primary">
Set up a wallet
</MudButton>
</MudAlert>
}
@if (State.Value.PairConfig is not null)
{
Expand Down
11 changes: 7 additions & 4 deletions BTCPayApp.UI/Pages/WalletSetup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@
@code {
private async Task Callback(BTCPayServerOnchainWalletConfigure.ChosenConfiguration obj)
{
var config = State.Value.PairConfig;
if (config is null) return;

var kp = new KeyPath("m/84'/0'/0'");
var seed = new Mnemonic(obj.Mnemonic ?? State.Value.PairConfig.PairingResult.ExistingWalletSeed);
var seed = new Mnemonic(obj.Mnemonic ?? config.PairingResult.ExistingWalletSeed);
var mKey = seed.DeriveExtKey();
var xpub = mKey.Derive(kp).Neuter().ToString(Network.Main);
if (obj is {UseExisting: false,SetStore: true})
if (obj is { UseExisting: false, SetStore: true })
{
await BTCPayConnection.Client.UpdateStoreOnChainPaymentMethod(State.Value.PairConfig.PairingResult.StoreId, "BTC", new UpdateOnChainPaymentMethodRequest()
await BTCPayConnection.Client.UpdateStoreOnChainPaymentMethod(config.PairingResult.StoreId, "BTC", new UpdateOnChainPaymentMethodRequest
{
Enabled = true,
DerivationScheme = xpub,
AccountKeyPath = new RootedKeyPath(mKey, kp)
});
}
Dispatcher.Dispatch(new RootState.WalletConfigLoadedAction(new WalletConfig()
Dispatcher.Dispatch(new RootState.WalletConfigLoadedAction(new WalletConfig
{
Mnemonic = seed.ToString(),
DerivationPath = kp.ToString(),
Expand Down

0 comments on commit 3690ff9

Please sign in to comment.