|
|
|
scripts/signer-entry.mjs raw
| 1 | import { | | 2 | SimplePool, | | 3 | finalizeEvent, | | 4 | generateSecretKey, | | 5 | getPublicKey, | | 6 | getEventHash, | | 7 | nip44, | | 8 | nip19, | | 9 | verifyEvent, | | 10 | } from "nostr-tools" ; | | 11 | import { | | 12 | BunkerSigner, | | 13 | createNostrConnectURI, | | 14 | parseBunkerInput, | | 15 | } from "nostr-tools/nip46" ; | | 16 | | | 17 | globalThis.NostrSigner = { | | 18 | generateSecretKey, | | 19 | getPublicKey, | | 20 | finalizeEvent, | | 21 | getEventHash, | | 22 | verifyEvent, | | 23 | nip44, | | 24 | SimplePool, | | 25 | BunkerSigner, | | 26 | parseBunkerInput, | | 27 | createNostrConnectURI, | | 28 | npubEncode: nip19.npubEncode, | | 29 | decodeNpub: (value) => { | | 30 | const decoded = nip19.decode(value); | | 31 | if (decoded.type !== "npub" ) throw new Error("expected an npub" ); | | 32 | return decoded.data; | | 33 | }, | | 34 | bytesToHex: (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0" )).join("" ), | | 35 | hexToBytes: (hex) => Uint8Array.from(hex.match(/.{1,2}/g) ?? [], (byte) => parseInt(byte, 16)), | | 36 | }; |
|
|
About| owner | c01503e8035f |
|---|
| visibility | public |
|---|
| head | d730679639bf |
|---|
Maintainers- c01503e8035f owner
- ba1b5beed5b5 agent hermes
Clonehttps://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git
|