btc-wallet 0.5.97-beta → 0.5.98-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.js CHANGED
@@ -3906,7 +3906,16 @@ function signMessage(message) {
3906
3906
  const { signMessage: signMessage2, getPublicKey } = getBtcProvider();
3907
3907
  const publicKey = yield getPublicKey();
3908
3908
  const signature = yield signMessage2(message);
3909
- const signatureBase58 = bs582.encode(Buffer.from(signature, "base64"));
3909
+ const signatureBuffer = Buffer.from(signature, "base64");
3910
+ let signatureWithoutPrefix;
3911
+ if (signatureBuffer.length === 65) {
3912
+ signatureWithoutPrefix = signatureBuffer.subarray(1);
3913
+ } else if (signatureBuffer.length === 64) {
3914
+ signatureWithoutPrefix = signatureBuffer;
3915
+ } else {
3916
+ throw new Error(`Invalid signature length: ${signatureBuffer.length}`);
3917
+ }
3918
+ const signatureBase58 = bs582.encode(signatureWithoutPrefix);
3910
3919
  const publicKeyBuffer = Buffer.from(publicKey, "hex");
3911
3920
  let uncompressedPublicKey;
3912
3921
  if (publicKeyBuffer.length === 33) {
@@ -5376,7 +5385,7 @@ function getGroup(state) {
5376
5385
 
5377
5386
  // src/index.ts
5378
5387
  var getVersion = () => {
5379
- return "0.5.97-beta";
5388
+ return "0.5.98-beta";
5380
5389
  };
5381
5390
  if (typeof window !== "undefined") {
5382
5391
  window.__BTC_WALLET_VERSION = getVersion();