Fix build

This commit is contained in:
Dennis Reimann 2023-08-17 17:19:10 +02:00
parent 6a595eb401
commit 3690ff9f81
No known key found for this signature in database
GPG Key ID: 5009E1797F03F8D0
3 changed files with 33 additions and 11 deletions

View File

@ -60,7 +60,7 @@ public class BTCPayConnection : IHostedService, IBTCPayAppServerClient, IHubConn
}
else
{
InvokeConnectionChange();
await Task.Delay(5000);
}
@ -117,7 +117,6 @@ public class BTCPayConnection : IHostedService, IBTCPayAppServerClient, IHubConn
InvokeConnectionChange();
_subscription = Connection.Register<IBTCPayAppServerClient>(this);
_hubProxy = Connection.CreateHubProxy<IBTCPayAppServerHub>();
}
@ -130,7 +129,7 @@ public class BTCPayConnection : IHostedService, IBTCPayAppServerClient, IHubConn
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}");
}
@ -142,7 +141,7 @@ public class BTCPayConnection : IHostedService, IBTCPayAppServerClient, IHubConn
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}");
}
@ -156,7 +155,7 @@ public class BTCPayConnection : IHostedService, IBTCPayAppServerClient, IHubConn
public Task OnReconnected(string? connectionId)
{
InvokeConnectionChange();
_logger.LogInformation($"OnReconnected: {connectionId}");
_logger.LogInformation("OnReconnected: {ConnectionId}", connectionId);
return Task.CompletedTask;
}
@ -166,4 +165,16 @@ public class BTCPayConnection : IHostedService, IBTCPayAppServerClient, IHubConn
_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;
}
}

View File

@ -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)
{

View File

@ -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(),