LtbLightning / bdk-rn

Bitcoin Development Kit - React Native Module
MIT License
50 stars 15 forks source link

createWallet: Use`descriptor` if set, otherwise, use `mnemonic`. Throw if none or both are set. #9

Closed BitcoinZavior closed 2 years ago

BitcoinZavior commented 2 years ago

A simpler API could be to use descriptor if set, otherwise, use mnemonic. Throw if none or both are set.

_Originally posted by @testerez in https://github.com/LtbLightning/bdk-rn/pull/6#discussion_r930035906_

For createWallet:

Remove useDescriptor argument. instead modify logic to use descriptor if set, otherwise, use mnemonic. Throw error if none or both are set. if mnemonic flow is chosen network should be specified but password can be optional the rest of the arguments should use default values.