Closed testerez closed 2 years ago
@testerez Shortly the following method will be added, to create wallet with descriptor or with mnemonic:
const response = await BdkRn.createWallet({
mnemonic: 'daring erase travel point pull loud peanut apart attack lobster cross surprise',
password: '',
descriptor: '',
useDescriptor: false,
network: '',
blockChainConfigUrl: '',
blockChainSocket5: '',
retry: '',
timeOut: '',
blockChainName: ''
});
Ok, so the consumer will choose to use either mnemonic
or descriptor
. Is it something you plan to implement soon? Can I help?
Also, would it make sense to rather stick to the bdk API?
Yes, A PR is open with the new changes, refer to the readme for the new interface: https://github.com/LtbLightning/bdk-rn/tree/modify-create-wallet-interface#generatemnemomic
The bdk API will still work, in terms of bitcoin applications, there could be a number of scenarios where product team might want to use a descriptor or a mnemonic, This will provide flexibility to implement any use case.
As far as I understand,
bdk-rn
currently allows to create a wallet only from a mnemonic. Would it make sense to havecreateWallet
taking a simple descriptor and exposegenerateExtendedKey
andrestoreExtendedKey
so that the client app has more control?Is it what this comment is about? https://github.com/LtbLightning/bdk-rn/blob/edb9ebf64c8012bb89f56bdc17df5f645b17e8d3/android/src/main/java/io/ltbl/bdkrn/BdkFunctions.kt#L104