@lit-protocol/vincent-scaffold-sdk
Version:
Shared build configuration and utilities for Vincent abilities and policies
15 lines (14 loc) • 461 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toEthAddress = toEthAddress;
/**
* Converts a PKP string to a checksummed Ethereum address
* @param pkpPublicKey - The PKP string to convert
* @returns A checksummed Ethereum address
*/
function toEthAddress(pkpPublicKey) {
if (!pkpPublicKey.startsWith("0x")) {
pkpPublicKey = `0x${pkpPublicKey}`;
}
return ethers.utils.computeAddress(pkpPublicKey);
}