Yes, currently the createWallet is somewhat confusing as it does not enforce passing correct arguments. For instance, we can pass both mnemonic and descriptor or neither of them. These will be caught at compile time or run time but still it is a little confusing.
I would suggest to create different factory constructors like createWalletFromMnemonic, createWalletFromDescriptor for creating from descriptor only, createWalletFromPathDescriptor for creating from both descriptor and changeDescriptor etc. This way the API will be lot less confusing and we can avoid so many runtime errors.
I would suggest to create different factory constructors like
createWalletFromMnemonic
,createWalletFromDescriptor
for creating from descriptor only,createWalletFromPathDescriptor
for creating from both descriptor and changeDescriptor etc. This way the API will be lot less confusing and we can avoid so many runtime errors.Originally posted by @MrUnfunny in https://github.com/LtbLightning/bdk-flutter/issues/17#issuecomment-1265408870