fix wallet setup binding

This commit is contained in:
Kukks 2023-08-17 10:43:28 +02:00
parent 613e3b8239
commit 24c6ca7e12
No known key found for this signature in database
GPG Key ID: 8E5530D9D1C93097
2 changed files with 6 additions and 5 deletions

View File

@ -20,7 +20,8 @@
private async Task Callback(BTCPayServerOnchainWalletConfigure.ChosenConfiguration obj)
{
var kp = new KeyPath("m/84'/0'/0'");
var mKey = new Mnemonic(obj.Mnemonic).DeriveExtKey();
var seed = new Mnemonic(obj.Mnemonic ?? State.Value.PairConfig.PairingResult.ExistingWalletSeed);
var mKey = seed.DeriveExtKey();
var xpub = mKey.Derive(kp).Neuter().ToString(Network.Main);
if (obj is {UseExisting: false,SetStore: true})
{
@ -33,7 +34,7 @@
}
Dispatcher.Dispatch(new RootState.WalletConfigLoadedAction(new WalletConfig()
{
Mnemonic = obj.Mnemonic,
Mnemonic = seed.ToString(),
DerivationPath = kp.ToString(),
StandaloneMode = false
}));

View File

@ -18,10 +18,10 @@
}
<ValidationEditContext Model="this" @ref="_validationEditContext" Validate="Validate" OnValidSubmit="OnSubmit">
<MudRadioGroup Label="Wallet Creation Options" @bind-Value="SelectedOption" For="() => SelectedOption">
<MudRadioGroup Label="Wallet Creation Options" @bind-SelectedOption="@SelectedOption" For="() => SelectedOption">
@foreach (var option in Options)
{
<MudRadio T="string" Value="@option.Key">@option.Value</MudRadio>
<MudRadio T="string" Option="@option.Key">@option.Value</MudRadio>
}
</MudRadioGroup>
@if (IsMnemonicRequired)
@ -148,5 +148,5 @@
Mnemonic = new Mnemonic(Wordlist.English, WordCount.Twelve).ToString();
}
public record ChosenConfiguration(bool UseExisting, bool SetStore, string Mnemonic);
public record ChosenConfiguration(bool UseExisting, bool SetStore, string? Mnemonic);
}