MCPcopy Create free account
hub / github.com/cameri/nostream / getPublicKey

Function getPublicKey

src/utils/event.ts:146–154  ·  view source on GitHub ↗
(privkey: string)

Source from the content-addressed store, hash-verified

144
145const publicKeyCache: Record<string, string> = {}
146export const getPublicKey = (privkey: string) => {
147 if (privkey in publicKeyCache) {
148 return publicKeyCache[privkey]
149 }
150
151 publicKeyCache[privkey] = secp256k1.utils.bytesToHex(secp256k1.getPublicKey(privkey, true).subarray(1))
152
153 return publicKeyCache[privkey]
154}
155
156export const signEvent =
157 (privkey: string | Buffer | undefined) =>

Callers 5

handleRequestMethod · 0.90
getRelayPublicKeyMethod · 0.90
getRelayPublicKeyMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected