UNPKG

@waku/enr

Version:
11 lines 459 B
import { publicKeyFromRaw } from "@libp2p/crypto/keys"; import { peerIdFromPublicKey } from "@libp2p/peer-id"; export const ERR_TYPE_NOT_IMPLEMENTED = "Keypair type not implemented"; export function createPeerIdFromPublicKey(publicKey) { const pubKey = publicKeyFromRaw(publicKey); if (pubKey.type !== "secp256k1") { throw new Error(ERR_TYPE_NOT_IMPLEMENTED); } return peerIdFromPublicKey(pubKey); } //# sourceMappingURL=peer_id.js.map