Closed satsie closed 4 years ago
Hey, thanks for the issue.
extendedPubkey
you have given is the compressed pubkey (33 bytes), not an extended one (78 bytes).
The extended pubkey is basically the bytes contained in an xpub but excluding the 4 byte checksum (for base58check).
So just grab your xpub, and run a base58check.decode on it, and use that 78 byte buffer instead.
Also just FYI, TypeScript Errors will always happen at transpile time, so if something errors when you run it, that is not a problem with TypeScript.
Thanks for your report. Let me know if you have any other questions.
Ah! Thank you so much! This has been driving me crazy for the last several days and I finally got it to work using your advice. Really appreciate it, and thanks for the work you do being a maintainer of bitcoinjs.
Hello, I've been experiencing issues with types, specifically Buffers. I keep getting errors similar to this one:
I printed the object out before the error was thrown and by all accounts, it appears to meet the requirements of having 2 buffers (
masterFingerprint
,extendedPubkey
) and a String (path
).This is the method I am calling,
psbt.updateGlobal()
: https://github.com/bitcoinjs/bitcoinjs-lib/blob/v5.1.6/src/psbt.js#L471 The code looks something like this (some fake values substituted in here):I'm using VS Code and did a number of things to clean up my workspace so now when I right click and look up the definition of
Buffer
, it takes me to the same place as right clicking for the definition of Buffer in the bitcoinjs-lib and bip174 libraries. For much of my code I was able to get around this error by calling certain libraries directly like bip32 and following the sample code exactly. I am not importing another definition for Buffer anywhere.The only discrepancy I can find is bitcoinjs-lib is using
@types/node
version 10.12.18 (https://github.com/bitcoinjs/bitcoinjs-lib/blob/v5.1.6/package.json#L48), while bip174 is using version 12.0.8. Could this cause problems? I see that in September there was a PR where part of the description was "Update @types/node and fix problems" (https://github.com/bitcoinjs/bitcoinjs-lib/pull/1476). Does this PR fix this issue? If so, is there a timeline for release? Thanks very much! 🙏