@1shotapi/ows-signer 0.2.1 → 0.2.2
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/package.json +1 -1
- package/src/crypto/sign.js +3 -1
package/package.json
CHANGED
package/src/crypto/sign.js
CHANGED
|
@@ -27,10 +27,12 @@ export async function signWithScheme(
|
|
|
27
27
|
lowS: true,
|
|
28
28
|
});
|
|
29
29
|
const compact = sig.toCompactRawBytes();
|
|
30
|
+
// Ethereum ecrecover / OpenZeppelin ECDSA require v ∈ {27, 28}.
|
|
31
|
+
// Noble returns recovery ∈ {0,1} (rarely 2,3); mask to yParity then +27.
|
|
30
32
|
const recovery = sig.recovery ?? 0;
|
|
31
33
|
const out = new Uint8Array(65);
|
|
32
34
|
out.set(compact, 0);
|
|
33
|
-
out[64] = recovery;
|
|
35
|
+
out[64] = 27 + (recovery & 1);
|
|
34
36
|
return to0xHex(out);
|
|
35
37
|
}
|
|
36
38
|
case "secp256k1-bip340":
|