(privkey: string)
| 144 | |
| 145 | const publicKeyCache: Record<string, string> = {} |
| 146 | export 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 | |
| 156 | export const signEvent = |
| 157 | (privkey: string | Buffer | undefined) => |
no outgoing calls
no test coverage detected