btc-wallet 0.5.96-beta → 0.5.97-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/dist/index.js +16 -2
- package/dist/index.js.map +2 -2
- package/esm/index.js +16 -2
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/esm/index.js
CHANGED
|
@@ -3907,7 +3907,21 @@ function signMessage(message) {
|
|
|
3907
3907
|
const publicKey = yield getPublicKey();
|
|
3908
3908
|
const signature = yield signMessage2(message);
|
|
3909
3909
|
const signatureBase58 = bs582.encode(Buffer.from(signature, "base64"));
|
|
3910
|
-
const
|
|
3910
|
+
const publicKeyBuffer = Buffer.from(publicKey, "hex");
|
|
3911
|
+
let uncompressedPublicKey;
|
|
3912
|
+
if (publicKeyBuffer.length === 33) {
|
|
3913
|
+
const decompressed = ecc.pointCompress(publicKeyBuffer, false);
|
|
3914
|
+
if (!decompressed) {
|
|
3915
|
+
throw new Error("Failed to decompress public key");
|
|
3916
|
+
}
|
|
3917
|
+
uncompressedPublicKey = decompressed;
|
|
3918
|
+
} else if (publicKeyBuffer.length === 65) {
|
|
3919
|
+
uncompressedPublicKey = publicKeyBuffer;
|
|
3920
|
+
} else {
|
|
3921
|
+
throw new Error(`Invalid public key length: ${publicKeyBuffer.length}`);
|
|
3922
|
+
}
|
|
3923
|
+
const publicKeyWithoutPrefix = uncompressedPublicKey.subarray(1);
|
|
3924
|
+
const publicKeyBase58 = bs582.encode(publicKeyWithoutPrefix);
|
|
3911
3925
|
return {
|
|
3912
3926
|
signature,
|
|
3913
3927
|
publicKey,
|
|
@@ -5362,7 +5376,7 @@ function getGroup(state) {
|
|
|
5362
5376
|
|
|
5363
5377
|
// src/index.ts
|
|
5364
5378
|
var getVersion = () => {
|
|
5365
|
-
return "0.5.
|
|
5379
|
+
return "0.5.97-beta";
|
|
5366
5380
|
};
|
|
5367
5381
|
if (typeof window !== "undefined") {
|
|
5368
5382
|
window.__BTC_WALLET_VERSION = getVersion();
|