-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the new BitBox02 library #1406
Comments
Hi @shonsirsha, thanks for the heads up. Sure, feel free to make the PR and we'll review it 👍 When it comes to the lib size, we are currently tackling the problem by using async imports so it's not a pressing issue for us. Nevertheless, updating the lib would streamline/simplify our current integration which relies on manually added type definitions |
Hey @refi93 , I noticed that when using any instance of the new Reproducible commit: shonsirsha@49b8151 (see More detail:The app crashes from anything as simple as the following: import * as bitbox from "bitbox-api"
// ....
useEffect(() => {
console.log('Bitbox module:', bitbox)
}, []) This I've also tried installing the I'm wondering if there's anything specific I should know about the error handling in this project, or anything in particular in the Adalite app you'd suggest me taking a look at? Thanks a lot. Note: keeping only the import statement didn't cause the crash. Crash screenshots: renders |
Hi @shonsirsha , useEffect(() => {
const fn = async () => {
const bitbox = await import('bitbox-api')
bitbox.bitbox02ConnectAuto(() => {
console.log('Onclose')
}).then((x) => {
console.log('Debug bitbox connect', x)
}).catch((e) => console.error('BB lib error', e))
}
fn()
}, []) or for some reason that I don't understand yet, const bitbox = require('bitbox-api') TBH I'm not sure why an ordinary All in all, I think it would anyway be the most sensible to load the bitbox lib asynchronously when actually used because the wasm module is ~725kB which while not that much, is still quite significant for a lib that is relevant only for a small fraction of users. |
Hey, a new BitBox02 library is available: https://www.npmjs.com/package/bitbox-api which replaces the current
bitbox02-api
(deprecated).This new one is much smaller in size, comes with TS, is a proper ES6 module, and based on WASM. Would you be open to use this? If so, I'd be happy to contribute to this effort.
This is the sandbox for the new library, and you could also find some more information one the Bitbox02 Developer Resources.
Thanks.
The text was updated successfully, but these errors were encountered: