UNPKG

aa-schnorr-multisig-sdk

Version:

Account Abstraction Schnorr Multi-Signatures SDK

15 lines (14 loc) 570 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.pubKey2Address = exports.hashMsgKeccak256 = void 0; const ethers_1 = require("ethers"); function hashMsgKeccak256(message) { return ethers_1.ethers.utils.solidityKeccak256(["string"], [message]); } exports.hashMsgKeccak256 = hashMsgKeccak256; function pubKey2Address(publicKeyBuffer) { const px = ethers_1.ethers.utils.hexlify(publicKeyBuffer.subarray(1, 33)); const address = `0x${px.slice(-40, px.length)}`; return address; } exports.pubKey2Address = pubKey2Address;