Hello, this is not a bad idea, but the issue here is that the validation should apply to all coins, not just Bitcoin. As you know the plugin supports a number of coin adapters. There are two possible solutions:
- Coin adapters can provide their own validation function for the [wallets_withdraw] UI. Then I can start with Bitcoin and proceed.
- Coin adapters can provide hookable javascript events so that users can provide their own validation function.
I believe the best approach would be a mixture of the two: Make the withdraw UI hookable with javascript validation functions and then the Bitcoin and other adapters can provide validators.
I will make a note of this and will implement it when time permits.
Keep in mind that even if a user enters an invalid address, they will eventually be notified by email because the withdraw operation will fail at the wallet level and this will be propagated to the user. Admittedly a javascript-level validation can save some time but any check that you can do with javascript, the wallet will do as well.
Thanks for your suggestion. Let me know what you think about the proposed solution.
regards,
Alex
Thread Starter
iztalo
(@iztalo)
Yes, I agree with this solution. Thanks for the answer.
This has now been implemented in 2.5.0.
Have a look at the release post for more information:
https://www.dashed-slug.net/javascript-address-validators-menu-item-balances/
To see an example of how to append a validator, have a look at the accompanying PDF documentation. The PDF documentation is available in the bundle download that you can get from http://dashed-slug.net/downloads.
A Bitcoin validator is added into the built-in Bitcoin core node adapter and more validators will be added to the other coin adapters soon.
regards,
Alex
Thread Starter
iztalo
(@iztalo)
You are the best, bro! Thanks a lot!