Fix seed initialization to use Spark SDK Seed.Mnemonic type

The previous implementation incorrectly converted the mnemonic to bytes:
- OLD: var seed = mnemonic.DeriveSeed(); ... seed.ToList()
- NEW: var seed = new Seed.Mnemonic(mnemonic: mnemonic.ToString(), passphrase: null);

This matches the official Spark SDK C# snippets pattern where ConnectRequest
expects a Seed discriminated union type, not a List<byte>.

Reference: https://github.com/breez/spark-sdk/tree/main/docs/breez-sdk/snippets/csharp
This commit is contained in:
Claude
2025-11-14 15:55:50 +00:00
parent 6a739d06bf
commit ac191bae17

View File

@@ -39,8 +39,8 @@ public class BreezLightningClient : ILightningClient, IDisposable
apiKey = apiKey
};
var seed = mnemonic.DeriveSeed();
var sdk = await BreezSdkSparkMethods.Connect(new ConnectRequest(config, seed.ToList(), workingDir));
var seed = new Seed.Mnemonic(mnemonic: mnemonic.ToString(), passphrase: null);
var sdk = await BreezSdkSparkMethods.Connect(new ConnectRequest(config, seed, workingDir));
return new BreezLightningClient(sdk, network, paymentKey);
}