Skip to content
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

bitbox-sdk throws exception when signing transactions after minification #153

Open
devalbo opened this issue Nov 16, 2019 · 3 comments
Open
Labels
Investigation Needed More research is needed

Comments

@devalbo
Copy link

devalbo commented Nov 16, 2019

I have created a React app using the standard React create-react-app (CRA) and then npm installed Bitbox. I can develop my BCH app with no issues in development mode. I can also use the CRA build command to create a production build.

However, when my code calls the sign method of the TransactionBuilder class in the production build, an exception with the message "Expected property "0" of type BigInteger, got n" gets thrown. I've narrowed it down to the use of the typeforce library in the bitcoincashjs-lib files ecdsa.js and ecsignature.js. If I comment out the typeforce lines in those files, my transaction is signed as expected.

I really don't like the idea of ejecting from the CRA configuration just to fix this, especially since I'd like to release my code as a library and I don't want other web devs to not be able to use minification in their build chains.

I'm wondering if this is a known issue, if there are any plans to fix it, or if there are any workarounds that do not require ejecting.

@christroutner
Copy link

I need to look into it, but I'm wondering if this issue is related to the Issue filed for slp-sdk:
Bitcoin-com/slp-sdk#76 (comment)

@christroutner christroutner added the Investigation Needed More research is needed label Nov 18, 2019
@devalbo
Copy link
Author

devalbo commented Nov 18, 2019

This looks very similar to what I've been seeing. I'll post a sample project with the fixes that seem to be working for my particular use case.

@devalbo
Copy link
Author

devalbo commented Nov 18, 2019

@christroutner - Example project here: https://github.com/devalbo/bbtest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigation Needed More research is needed
Projects
None yet
Development

No branches or pull requests

2 participants