@runonflux/aa-schnorr-multisig-sdk
Version:
Account Abstraction Schnorr Multi-Signatures SDK
14 lines (13 loc) • 571 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.hashMsgKeccak256 = hashMsgKeccak256;
exports.pubKey2Address = pubKey2Address;
const ethers_1 = require("ethers");
function hashMsgKeccak256(message) {
return ethers_1.ethers.solidityPackedKeccak256(["string"], [message]);
}
function pubKey2Address(publicKeyBuffer) {
const publicKeyHash = Buffer.from(ethers_1.ethers.getBytes(ethers_1.ethers.keccak256(publicKeyBuffer.subarray(1))));
const address = `0x${publicKeyHash.subarray(-20).toString("hex")}`;
return address;
}