@openclaw/nostr 2026.5.20 → 2026.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@noble/ciphers/LICENSE +22 -0
- package/node_modules/@noble/ciphers/README.md +608 -0
- package/node_modules/@noble/ciphers/_arx.d.ts +81 -0
- package/node_modules/@noble/ciphers/_arx.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/_arx.js +258 -0
- package/node_modules/@noble/ciphers/_arx.js.map +1 -0
- package/node_modules/@noble/ciphers/_poly1305.d.ts +48 -0
- package/node_modules/@noble/ciphers/_poly1305.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/_poly1305.js +319 -0
- package/node_modules/@noble/ciphers/_poly1305.js.map +1 -0
- package/node_modules/@noble/ciphers/_polyval.d.ts +62 -0
- package/node_modules/@noble/ciphers/_polyval.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/_polyval.js +231 -0
- package/node_modules/@noble/ciphers/_polyval.js.map +1 -0
- package/node_modules/@noble/ciphers/aes.d.ts +231 -0
- package/node_modules/@noble/ciphers/aes.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/aes.js +1281 -0
- package/node_modules/@noble/ciphers/aes.js.map +1 -0
- package/node_modules/@noble/ciphers/chacha.d.ts +75 -0
- package/node_modules/@noble/ciphers/chacha.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/chacha.js +385 -0
- package/node_modules/@noble/ciphers/chacha.js.map +1 -0
- package/node_modules/@noble/ciphers/ff1.d.ts +9 -0
- package/node_modules/@noble/ciphers/ff1.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/ff1.js +160 -0
- package/node_modules/@noble/ciphers/ff1.js.map +1 -0
- package/node_modules/@noble/ciphers/index.d.ts +2 -0
- package/node_modules/@noble/ciphers/index.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/index.js +27 -0
- package/node_modules/@noble/ciphers/index.js.map +1 -0
- package/node_modules/@noble/ciphers/package.json +81 -0
- package/node_modules/@noble/ciphers/salsa.d.ts +30 -0
- package/node_modules/@noble/ciphers/salsa.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/salsa.js +260 -0
- package/node_modules/@noble/ciphers/salsa.js.map +1 -0
- package/node_modules/@noble/ciphers/src/_arx.ts +338 -0
- package/node_modules/@noble/ciphers/src/_poly1305.ts +360 -0
- package/node_modules/@noble/ciphers/src/_polyval.ts +272 -0
- package/node_modules/@noble/ciphers/src/aes.ts +1439 -0
- package/node_modules/@noble/ciphers/src/chacha.ts +367 -0
- package/node_modules/@noble/ciphers/src/ff1.ts +162 -0
- package/node_modules/@noble/ciphers/src/index.ts +25 -0
- package/node_modules/@noble/ciphers/src/salsa.ts +255 -0
- package/node_modules/@noble/ciphers/src/utils.ts +497 -0
- package/node_modules/@noble/ciphers/src/webcrypto.ts +125 -0
- package/node_modules/@noble/ciphers/utils.d.ts +171 -0
- package/node_modules/@noble/ciphers/utils.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/utils.js +343 -0
- package/node_modules/@noble/ciphers/utils.js.map +1 -0
- package/node_modules/@noble/ciphers/webcrypto.d.ts +30 -0
- package/node_modules/@noble/ciphers/webcrypto.d.ts.map +1 -0
- package/node_modules/@noble/ciphers/webcrypto.js +99 -0
- package/node_modules/@noble/ciphers/webcrypto.js.map +1 -0
- package/node_modules/@noble/curves/LICENSE +21 -0
- package/node_modules/@noble/curves/README.md +1037 -0
- package/node_modules/@noble/curves/abstract/bls.d.ts +128 -0
- package/node_modules/@noble/curves/abstract/bls.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/bls.js +372 -0
- package/node_modules/@noble/curves/abstract/bls.js.map +1 -0
- package/node_modules/@noble/curves/abstract/curve.d.ts +195 -0
- package/node_modules/@noble/curves/abstract/curve.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/curve.js +457 -0
- package/node_modules/@noble/curves/abstract/curve.js.map +1 -0
- package/node_modules/@noble/curves/abstract/edwards.d.ts +184 -0
- package/node_modules/@noble/curves/abstract/edwards.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/edwards.js +558 -0
- package/node_modules/@noble/curves/abstract/edwards.js.map +1 -0
- package/node_modules/@noble/curves/abstract/fft.d.ts +127 -0
- package/node_modules/@noble/curves/abstract/fft.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/fft.js +426 -0
- package/node_modules/@noble/curves/abstract/fft.js.map +1 -0
- package/node_modules/@noble/curves/abstract/hash-to-curve.d.ts +90 -0
- package/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/hash-to-curve.js +207 -0
- package/node_modules/@noble/curves/abstract/hash-to-curve.js.map +1 -0
- package/node_modules/@noble/curves/abstract/modular.d.ts +159 -0
- package/node_modules/@noble/curves/abstract/modular.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/modular.js +555 -0
- package/node_modules/@noble/curves/abstract/modular.js.map +1 -0
- package/node_modules/@noble/curves/abstract/montgomery.d.ts +25 -0
- package/node_modules/@noble/curves/abstract/montgomery.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/montgomery.js +153 -0
- package/node_modules/@noble/curves/abstract/montgomery.js.map +1 -0
- package/node_modules/@noble/curves/abstract/oprf.d.ts +282 -0
- package/node_modules/@noble/curves/abstract/oprf.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/oprf.js +297 -0
- package/node_modules/@noble/curves/abstract/oprf.js.map +1 -0
- package/node_modules/@noble/curves/abstract/poseidon.d.ts +68 -0
- package/node_modules/@noble/curves/abstract/poseidon.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/poseidon.js +300 -0
- package/node_modules/@noble/curves/abstract/poseidon.js.map +1 -0
- package/node_modules/@noble/curves/abstract/tower.d.ts +95 -0
- package/node_modules/@noble/curves/abstract/tower.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/tower.js +742 -0
- package/node_modules/@noble/curves/abstract/tower.js.map +1 -0
- package/node_modules/@noble/curves/abstract/weierstrass.d.ts +325 -0
- package/node_modules/@noble/curves/abstract/weierstrass.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/weierstrass.js +1222 -0
- package/node_modules/@noble/curves/abstract/weierstrass.js.map +1 -0
- package/node_modules/@noble/curves/bls12-381.d.ts +10 -0
- package/node_modules/@noble/curves/bls12-381.d.ts.map +1 -0
- package/node_modules/@noble/curves/bls12-381.js +688 -0
- package/node_modules/@noble/curves/bls12-381.js.map +1 -0
- package/node_modules/@noble/curves/bn254.d.ts +66 -0
- package/node_modules/@noble/curves/bn254.d.ts.map +1 -0
- package/node_modules/@noble/curves/bn254.js +190 -0
- package/node_modules/@noble/curves/bn254.js.map +1 -0
- package/node_modules/@noble/curves/ed25519.d.ts +101 -0
- package/node_modules/@noble/curves/ed25519.d.ts.map +1 -0
- package/node_modules/@noble/curves/ed25519.js +462 -0
- package/node_modules/@noble/curves/ed25519.js.map +1 -0
- package/node_modules/@noble/curves/ed448.d.ts +91 -0
- package/node_modules/@noble/curves/ed448.d.ts.map +1 -0
- package/node_modules/@noble/curves/ed448.js +442 -0
- package/node_modules/@noble/curves/ed448.js.map +1 -0
- package/node_modules/@noble/curves/index.d.ts +2 -0
- package/node_modules/@noble/curves/index.d.ts.map +1 -0
- package/node_modules/@noble/curves/index.js +33 -0
- package/node_modules/@noble/curves/index.js.map +1 -0
- package/node_modules/@noble/curves/misc.d.ts +15 -0
- package/node_modules/@noble/curves/misc.d.ts.map +1 -0
- package/node_modules/@noble/curves/misc.js +103 -0
- package/node_modules/@noble/curves/misc.js.map +1 -0
- package/node_modules/@noble/curves/nist.d.ts +36 -0
- package/node_modules/@noble/curves/nist.d.ts.map +1 -0
- package/node_modules/@noble/curves/nist.js +146 -0
- package/node_modules/@noble/curves/nist.js.map +1 -0
- package/node_modules/@noble/curves/package.json +98 -0
- package/node_modules/@noble/curves/secp256k1.d.ts +76 -0
- package/node_modules/@noble/curves/secp256k1.d.ts.map +1 -0
- package/node_modules/@noble/curves/secp256k1.js +283 -0
- package/node_modules/@noble/curves/secp256k1.js.map +1 -0
- package/node_modules/@noble/curves/src/abstract/bls.ts +604 -0
- package/node_modules/@noble/curves/src/abstract/curve.ts +633 -0
- package/node_modules/@noble/curves/src/abstract/edwards.ts +789 -0
- package/node_modules/@noble/curves/src/abstract/fft.ts +521 -0
- package/node_modules/@noble/curves/src/abstract/hash-to-curve.ts +292 -0
- package/node_modules/@noble/curves/src/abstract/modular.ts +621 -0
- package/node_modules/@noble/curves/src/abstract/montgomery.ts +187 -0
- package/node_modules/@noble/curves/src/abstract/oprf.ts +600 -0
- package/node_modules/@noble/curves/src/abstract/poseidon.ts +333 -0
- package/node_modules/@noble/curves/src/abstract/tower.ts +864 -0
- package/node_modules/@noble/curves/src/abstract/weierstrass.ts +1562 -0
- package/node_modules/@noble/curves/src/bls12-381.ts +775 -0
- package/node_modules/@noble/curves/src/bn254.ts +219 -0
- package/node_modules/@noble/curves/src/ed25519.ts +533 -0
- package/node_modules/@noble/curves/src/ed448.ts +525 -0
- package/node_modules/@noble/curves/src/index.ts +31 -0
- package/node_modules/@noble/curves/src/misc.ts +140 -0
- package/node_modules/@noble/curves/src/nist.ts +204 -0
- package/node_modules/@noble/curves/src/secp256k1.ts +327 -0
- package/node_modules/@noble/curves/src/utils.ts +306 -0
- package/node_modules/@noble/curves/src/webcrypto.ts +403 -0
- package/node_modules/@noble/curves/utils.d.ts +103 -0
- package/node_modules/@noble/curves/utils.d.ts.map +1 -0
- package/node_modules/@noble/curves/utils.js +241 -0
- package/node_modules/@noble/curves/utils.js.map +1 -0
- package/node_modules/@noble/curves/webcrypto.d.ts +99 -0
- package/node_modules/@noble/curves/webcrypto.d.ts.map +1 -0
- package/node_modules/@noble/curves/webcrypto.js +256 -0
- package/node_modules/@noble/curves/webcrypto.js.map +1 -0
- package/node_modules/@noble/hashes/LICENSE +21 -0
- package/node_modules/@noble/hashes/README.md +575 -0
- package/node_modules/@noble/hashes/_blake.d.ts +14 -0
- package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_blake.js +45 -0
- package/node_modules/@noble/hashes/_blake.js.map +1 -0
- package/node_modules/@noble/hashes/_md.d.ts +49 -0
- package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_md.js +147 -0
- package/node_modules/@noble/hashes/_md.js.map +1 -0
- package/node_modules/@noble/hashes/_u64.d.ts +55 -0
- package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_u64.js +67 -0
- package/node_modules/@noble/hashes/_u64.js.map +1 -0
- package/node_modules/@noble/hashes/argon2.d.ts +32 -0
- package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/argon2.js +391 -0
- package/node_modules/@noble/hashes/argon2.js.map +1 -0
- package/node_modules/@noble/hashes/blake1.d.ts +110 -0
- package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake1.js +485 -0
- package/node_modules/@noble/hashes/blake1.js.map +1 -0
- package/node_modules/@noble/hashes/blake2.d.ts +120 -0
- package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2.js +417 -0
- package/node_modules/@noble/hashes/blake2.js.map +1 -0
- package/node_modules/@noble/hashes/blake3.d.ts +54 -0
- package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake3.js +255 -0
- package/node_modules/@noble/hashes/blake3.js.map +1 -0
- package/node_modules/@noble/hashes/eskdf.d.ts +50 -0
- package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/eskdf.js +161 -0
- package/node_modules/@noble/hashes/eskdf.js.map +1 -0
- package/node_modules/@noble/hashes/hkdf.d.ts +36 -0
- package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/hkdf.js +84 -0
- package/node_modules/@noble/hashes/hkdf.js.map +1 -0
- package/node_modules/@noble/hashes/hmac.d.ts +36 -0
- package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
- package/node_modules/@noble/hashes/hmac.js +90 -0
- package/node_modules/@noble/hashes/hmac.js.map +1 -0
- package/node_modules/@noble/hashes/index.d.ts +2 -0
- package/node_modules/@noble/hashes/index.d.ts.map +1 -0
- package/node_modules/@noble/hashes/index.js +34 -0
- package/node_modules/@noble/hashes/index.js.map +1 -0
- package/node_modules/@noble/hashes/legacy.d.ts +71 -0
- package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
- package/node_modules/@noble/hashes/legacy.js +281 -0
- package/node_modules/@noble/hashes/legacy.js.map +1 -0
- package/node_modules/@noble/hashes/package.json +93 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts +29 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/pbkdf2.js +97 -0
- package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
- package/node_modules/@noble/hashes/scrypt.d.ts +33 -0
- package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
- package/node_modules/@noble/hashes/scrypt.js +216 -0
- package/node_modules/@noble/hashes/scrypt.js.map +1 -0
- package/node_modules/@noble/hashes/sha2.d.ts +199 -0
- package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha2.js +397 -0
- package/node_modules/@noble/hashes/sha2.js.map +1 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts +149 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha3-addons.js +420 -0
- package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
- package/node_modules/@noble/hashes/sha3.d.ts +58 -0
- package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha3.js +254 -0
- package/node_modules/@noble/hashes/sha3.js.map +1 -0
- package/node_modules/@noble/hashes/src/_blake.ts +50 -0
- package/node_modules/@noble/hashes/src/_md.ts +156 -0
- package/node_modules/@noble/hashes/src/_u64.ts +91 -0
- package/node_modules/@noble/hashes/src/argon2.ts +493 -0
- package/node_modules/@noble/hashes/src/blake1.ts +536 -0
- package/node_modules/@noble/hashes/src/blake2.ts +489 -0
- package/node_modules/@noble/hashes/src/blake3.ts +275 -0
- package/node_modules/@noble/hashes/src/eskdf.ts +188 -0
- package/node_modules/@noble/hashes/src/hkdf.ts +94 -0
- package/node_modules/@noble/hashes/src/hmac.ts +94 -0
- package/node_modules/@noble/hashes/src/index.ts +32 -0
- package/node_modules/@noble/hashes/src/legacy.ts +293 -0
- package/node_modules/@noble/hashes/src/pbkdf2.ts +129 -0
- package/node_modules/@noble/hashes/src/scrypt.ts +249 -0
- package/node_modules/@noble/hashes/src/sha2.ts +469 -0
- package/node_modules/@noble/hashes/src/sha3-addons.ts +530 -0
- package/node_modules/@noble/hashes/src/sha3.ts +295 -0
- package/node_modules/@noble/hashes/src/utils.ts +338 -0
- package/node_modules/@noble/hashes/src/webcrypto.ts +168 -0
- package/node_modules/@noble/hashes/utils.d.ts +130 -0
- package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
- package/node_modules/@noble/hashes/utils.js +242 -0
- package/node_modules/@noble/hashes/utils.js.map +1 -0
- package/node_modules/@noble/hashes/webcrypto.d.ts +62 -0
- package/node_modules/@noble/hashes/webcrypto.d.ts.map +1 -0
- package/node_modules/@noble/hashes/webcrypto.js +126 -0
- package/node_modules/@noble/hashes/webcrypto.js.map +1 -0
- package/node_modules/@scure/base/LICENSE +21 -0
- package/node_modules/@scure/base/README.md +226 -0
- package/node_modules/@scure/base/index.d.ts +294 -0
- package/node_modules/@scure/base/index.d.ts.map +1 -0
- package/node_modules/@scure/base/index.js +704 -0
- package/node_modules/@scure/base/index.js.map +1 -0
- package/node_modules/@scure/base/index.ts +857 -0
- package/node_modules/@scure/base/package.json +58 -0
- package/node_modules/@scure/bip32/LICENSE +21 -0
- package/node_modules/@scure/bip32/README.md +158 -0
- package/node_modules/@scure/bip32/index.d.ts +60 -0
- package/node_modules/@scure/bip32/index.d.ts.map +1 -0
- package/node_modules/@scure/bip32/index.js +283 -0
- package/node_modules/@scure/bip32/index.js.map +1 -0
- package/node_modules/@scure/bip32/index.ts +317 -0
- package/node_modules/@scure/bip32/package.json +57 -0
- package/node_modules/@scure/bip39/LICENSE +21 -0
- package/node_modules/@scure/bip39/README.md +134 -0
- package/node_modules/@scure/bip39/index.d.ts +75 -0
- package/node_modules/@scure/bip39/index.js +149 -0
- package/node_modules/@scure/bip39/package.json +70 -0
- package/node_modules/@scure/bip39/src/index.ts +161 -0
- package/node_modules/@scure/bip39/wordlists/czech.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/czech.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/english.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/english.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/french.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/french.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/italian.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/italian.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/japanese.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/japanese.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/korean.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/korean.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/portuguese.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/portuguese.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/simplified-chinese.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/simplified-chinese.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/spanish.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/spanish.js +2048 -0
- package/node_modules/@scure/bip39/wordlists/traditional-chinese.d.ts +1 -0
- package/node_modules/@scure/bip39/wordlists/traditional-chinese.js +2048 -0
- package/node_modules/nostr-tools/LICENSE +24 -0
- package/node_modules/nostr-tools/README.md +454 -0
- package/node_modules/nostr-tools/lib/cjs/abstract-pool.js +889 -0
- package/node_modules/nostr-tools/lib/cjs/abstract-pool.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/abstract-relay.js +596 -0
- package/node_modules/nostr-tools/lib/cjs/abstract-relay.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/core.js +63 -0
- package/node_modules/nostr-tools/lib/cjs/core.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/fakejson.js +66 -0
- package/node_modules/nostr-tools/lib/cjs/fakejson.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/filter.js +111 -0
- package/node_modules/nostr-tools/lib/cjs/filter.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/index.js +3666 -0
- package/node_modules/nostr-tools/lib/cjs/index.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/kinds.js +273 -0
- package/node_modules/nostr-tools/lib/cjs/kinds.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip04.js +61 -0
- package/node_modules/nostr-tools/lib/cjs/nip04.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip05.js +76 -0
- package/node_modules/nostr-tools/lib/cjs/nip05.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip06.js +82 -0
- package/node_modules/nostr-tools/lib/cjs/nip06.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip07.js +18 -0
- package/node_modules/nostr-tools/lib/cjs/nip07.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip10.js +124 -0
- package/node_modules/nostr-tools/lib/cjs/nip10.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip11.js +39 -0
- package/node_modules/nostr-tools/lib/cjs/nip11.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip13.js +83 -0
- package/node_modules/nostr-tools/lib/cjs/nip13.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip17.js +343 -0
- package/node_modules/nostr-tools/lib/cjs/nip17.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip18.js +188 -0
- package/node_modules/nostr-tools/lib/cjs/nip18.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip19.js +217 -0
- package/node_modules/nostr-tools/lib/cjs/nip19.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip21.js +140 -0
- package/node_modules/nostr-tools/lib/cjs/nip21.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip22.js +154 -0
- package/node_modules/nostr-tools/lib/cjs/nip22.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip25.js +159 -0
- package/node_modules/nostr-tools/lib/cjs/nip25.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip27.js +269 -0
- package/node_modules/nostr-tools/lib/cjs/nip27.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip28.js +220 -0
- package/node_modules/nostr-tools/lib/cjs/nip28.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip29.js +499 -0
- package/node_modules/nostr-tools/lib/cjs/nip29.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip30.js +53 -0
- package/node_modules/nostr-tools/lib/cjs/nip30.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip39.js +42 -0
- package/node_modules/nostr-tools/lib/cjs/nip39.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip40.js +63 -0
- package/node_modules/nostr-tools/lib/cjs/nip40.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip42.js +41 -0
- package/node_modules/nostr-tools/lib/cjs/nip42.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip44.js +167 -0
- package/node_modules/nostr-tools/lib/cjs/nip44.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip46.js +1455 -0
- package/node_modules/nostr-tools/lib/cjs/nip46.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip47.js +168 -0
- package/node_modules/nostr-tools/lib/cjs/nip47.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip49.js +77 -0
- package/node_modules/nostr-tools/lib/cjs/nip49.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip54.js +35 -0
- package/node_modules/nostr-tools/lib/cjs/nip54.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip55.js +103 -0
- package/node_modules/nostr-tools/lib/cjs/nip55.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip57.js +274 -0
- package/node_modules/nostr-tools/lib/cjs/nip57.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip58.js +117 -0
- package/node_modules/nostr-tools/lib/cjs/nip58.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip59.js +320 -0
- package/node_modules/nostr-tools/lib/cjs/nip59.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip75.js +70 -0
- package/node_modules/nostr-tools/lib/cjs/nip75.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip77.js +519 -0
- package/node_modules/nostr-tools/lib/cjs/nip77.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip94.js +142 -0
- package/node_modules/nostr-tools/lib/cjs/nip94.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip98.js +230 -0
- package/node_modules/nostr-tools/lib/cjs/nip98.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nip99.js +153 -0
- package/node_modules/nostr-tools/lib/cjs/nip99.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/nipb7.js +184 -0
- package/node_modules/nostr-tools/lib/cjs/nipb7.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/package.json +1 -0
- package/node_modules/nostr-tools/lib/cjs/pool.js +989 -0
- package/node_modules/nostr-tools/lib/cjs/pool.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/pure.js +130 -0
- package/node_modules/nostr-tools/lib/cjs/pure.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/references.js +210 -0
- package/node_modules/nostr-tools/lib/cjs/references.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/relay.js +704 -0
- package/node_modules/nostr-tools/lib/cjs/relay.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/signer.js +130 -0
- package/node_modules/nostr-tools/lib/cjs/signer.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/utils.js +150 -0
- package/node_modules/nostr-tools/lib/cjs/utils.js.map +7 -0
- package/node_modules/nostr-tools/lib/cjs/wasm.js +103 -0
- package/node_modules/nostr-tools/lib/cjs/wasm.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/abstract-pool.js +866 -0
- package/node_modules/nostr-tools/lib/esm/abstract-pool.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/abstract-relay.js +573 -0
- package/node_modules/nostr-tools/lib/esm/abstract-relay.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/core.js +42 -0
- package/node_modules/nostr-tools/lib/esm/core.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/fakejson.js +45 -0
- package/node_modules/nostr-tools/lib/esm/fakejson.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/filter.js +88 -0
- package/node_modules/nostr-tools/lib/esm/filter.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/index.js +3649 -0
- package/node_modules/nostr-tools/lib/esm/index.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/kinds.js +250 -0
- package/node_modules/nostr-tools/lib/esm/kinds.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip04.js +40 -0
- package/node_modules/nostr-tools/lib/esm/nip04.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip05.js +55 -0
- package/node_modules/nostr-tools/lib/esm/nip05.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip06.js +61 -0
- package/node_modules/nostr-tools/lib/esm/nip06.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip07.js +0 -0
- package/node_modules/nostr-tools/lib/esm/nip07.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip10.js +103 -0
- package/node_modules/nostr-tools/lib/esm/nip10.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip11.js +18 -0
- package/node_modules/nostr-tools/lib/esm/nip11.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip13.js +62 -0
- package/node_modules/nostr-tools/lib/esm/nip13.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip17.js +320 -0
- package/node_modules/nostr-tools/lib/esm/nip17.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip18.js +165 -0
- package/node_modules/nostr-tools/lib/esm/nip18.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip19.js +196 -0
- package/node_modules/nostr-tools/lib/esm/nip19.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip21.js +117 -0
- package/node_modules/nostr-tools/lib/esm/nip21.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip22.js +133 -0
- package/node_modules/nostr-tools/lib/esm/nip22.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip25.js +136 -0
- package/node_modules/nostr-tools/lib/esm/nip25.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip27.js +246 -0
- package/node_modules/nostr-tools/lib/esm/nip27.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip28.js +197 -0
- package/node_modules/nostr-tools/lib/esm/nip28.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip29.js +476 -0
- package/node_modules/nostr-tools/lib/esm/nip29.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip30.js +32 -0
- package/node_modules/nostr-tools/lib/esm/nip30.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip39.js +21 -0
- package/node_modules/nostr-tools/lib/esm/nip39.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip40.js +42 -0
- package/node_modules/nostr-tools/lib/esm/nip40.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip42.js +18 -0
- package/node_modules/nostr-tools/lib/esm/nip42.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip44.js +146 -0
- package/node_modules/nostr-tools/lib/esm/nip44.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip46.js +1432 -0
- package/node_modules/nostr-tools/lib/esm/nip46.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip47.js +145 -0
- package/node_modules/nostr-tools/lib/esm/nip47.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip49.js +56 -0
- package/node_modules/nostr-tools/lib/esm/nip49.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip54.js +14 -0
- package/node_modules/nostr-tools/lib/esm/nip54.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip55.js +82 -0
- package/node_modules/nostr-tools/lib/esm/nip55.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip57.js +253 -0
- package/node_modules/nostr-tools/lib/esm/nip57.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip58.js +94 -0
- package/node_modules/nostr-tools/lib/esm/nip58.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip59.js +297 -0
- package/node_modules/nostr-tools/lib/esm/nip59.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip75.js +47 -0
- package/node_modules/nostr-tools/lib/esm/nip75.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip77.js +498 -0
- package/node_modules/nostr-tools/lib/esm/nip77.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip94.js +119 -0
- package/node_modules/nostr-tools/lib/esm/nip94.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip98.js +209 -0
- package/node_modules/nostr-tools/lib/esm/nip98.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nip99.js +130 -0
- package/node_modules/nostr-tools/lib/esm/nip99.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/nipb7.js +163 -0
- package/node_modules/nostr-tools/lib/esm/nipb7.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/pool.js +966 -0
- package/node_modules/nostr-tools/lib/esm/pool.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/pure.js +109 -0
- package/node_modules/nostr-tools/lib/esm/pure.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/references.js +187 -0
- package/node_modules/nostr-tools/lib/esm/references.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/relay.js +681 -0
- package/node_modules/nostr-tools/lib/esm/relay.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/signer.js +107 -0
- package/node_modules/nostr-tools/lib/esm/signer.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/utils.js +129 -0
- package/node_modules/nostr-tools/lib/esm/utils.js.map +7 -0
- package/node_modules/nostr-tools/lib/esm/wasm.js +82 -0
- package/node_modules/nostr-tools/lib/esm/wasm.js.map +7 -0
- package/node_modules/nostr-tools/lib/nostr.bundle.js +7336 -0
- package/node_modules/nostr-tools/lib/nostr.bundle.js.map +7 -0
- package/node_modules/nostr-tools/lib/types/abstract-pool.d.ts +60 -0
- package/node_modules/nostr-tools/lib/types/abstract-relay.d.ts +110 -0
- package/node_modules/nostr-tools/lib/types/benchmarks.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/core.d.ts +32 -0
- package/node_modules/nostr-tools/lib/types/core.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/fakejson.d.ts +6 -0
- package/node_modules/nostr-tools/lib/types/fakejson.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/filter.d.ts +19 -0
- package/node_modules/nostr-tools/lib/types/filter.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/helpers.d.ts +2 -0
- package/node_modules/nostr-tools/lib/types/index.d.ts +31 -0
- package/node_modules/nostr-tools/lib/types/kinds.d.ts +200 -0
- package/node_modules/nostr-tools/lib/types/kinds.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip04.d.ts +2 -0
- package/node_modules/nostr-tools/lib/types/nip04.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip05.d.ts +17 -0
- package/node_modules/nostr-tools/lib/types/nip05.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip06.d.ts +15 -0
- package/node_modules/nostr-tools/lib/types/nip06.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip07.d.ts +13 -0
- package/node_modules/nostr-tools/lib/types/nip10.d.ts +24 -0
- package/node_modules/nostr-tools/lib/types/nip10.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip11.d.ts +266 -0
- package/node_modules/nostr-tools/lib/types/nip11.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip13.d.ts +8 -0
- package/node_modules/nostr-tools/lib/types/nip13.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip17.d.ts +15 -0
- package/node_modules/nostr-tools/lib/types/nip17.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip18.d.ts +22 -0
- package/node_modules/nostr-tools/lib/types/nip18.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip19.d.ts +81 -0
- package/node_modules/nostr-tools/lib/types/nip19.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip21.d.ts +34 -0
- package/node_modules/nostr-tools/lib/types/nip21.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip22.d.ts +36 -0
- package/node_modules/nostr-tools/lib/types/nip22.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip25.d.ts +15 -0
- package/node_modules/nostr-tools/lib/types/nip25.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip27.d.ts +32 -0
- package/node_modules/nostr-tools/lib/types/nip27.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip28.d.ts +46 -0
- package/node_modules/nostr-tools/lib/types/nip28.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip29.d.ts +265 -0
- package/node_modules/nostr-tools/lib/types/nip30.d.ts +22 -0
- package/node_modules/nostr-tools/lib/types/nip30.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip39.d.ts +2 -0
- package/node_modules/nostr-tools/lib/types/nip39.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip40.d.ts +10 -0
- package/node_modules/nostr-tools/lib/types/nip40.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip42.d.ts +5 -0
- package/node_modules/nostr-tools/lib/types/nip42.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip44.d.ts +18 -0
- package/node_modules/nostr-tools/lib/types/nip44.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip46.d.ts +119 -0
- package/node_modules/nostr-tools/lib/types/nip47.d.ts +11 -0
- package/node_modules/nostr-tools/lib/types/nip47.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip49.d.ts +3 -0
- package/node_modules/nostr-tools/lib/types/nip49.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip54.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip54.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip55.d.ts +30 -0
- package/node_modules/nostr-tools/lib/types/nip55.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip57.d.ts +25 -0
- package/node_modules/nostr-tools/lib/types/nip57.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip58.d.ts +134 -0
- package/node_modules/nostr-tools/lib/types/nip58.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip59.d.ts +12 -0
- package/node_modules/nostr-tools/lib/types/nip59.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip75.d.ts +61 -0
- package/node_modules/nostr-tools/lib/types/nip75.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip77.d.ts +102 -0
- package/node_modules/nostr-tools/lib/types/nip77.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip94.d.ts +87 -0
- package/node_modules/nostr-tools/lib/types/nip94.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip98.d.ts +74 -0
- package/node_modules/nostr-tools/lib/types/nip98.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nip99.d.ts +92 -0
- package/node_modules/nostr-tools/lib/types/nip99.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/nipb7.d.ts +23 -0
- package/node_modules/nostr-tools/lib/types/nipb7.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/pool.d.ts +6 -0
- package/node_modules/nostr-tools/lib/types/pool.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/pure.d.ts +8 -0
- package/node_modules/nostr-tools/lib/types/pure.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/references.d.ts +10 -0
- package/node_modules/nostr-tools/lib/types/references.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/relay.d.ts +11 -0
- package/node_modules/nostr-tools/lib/types/relay.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/signer.d.ts +11 -0
- package/node_modules/nostr-tools/lib/types/test-helpers.d.ts +14 -0
- package/node_modules/nostr-tools/lib/types/utils.d.ts +9 -0
- package/node_modules/nostr-tools/lib/types/utils.test.d.ts +1 -0
- package/node_modules/nostr-tools/lib/types/wasm.d.ts +8 -0
- package/node_modules/nostr-tools/package.json +330 -0
- package/node_modules/nostr-wasm/README.md +91 -0
- package/node_modules/nostr-wasm/dist/api/emsimp.d.ts +3 -0
- package/node_modules/nostr-wasm/dist/api/nostr.d.ts +45 -0
- package/node_modules/nostr-wasm/dist/api/secp256k1-types.d.ts +124 -0
- package/node_modules/nostr-wasm/dist/api/secp256k1.d.ts +41 -0
- package/node_modules/nostr-wasm/dist/api/types.d.ts +124 -0
- package/node_modules/nostr-wasm/dist/api/wasm-env.d.ts +3 -0
- package/node_modules/nostr-wasm/dist/gen/wasm.d.ts +27 -0
- package/node_modules/nostr-wasm/dist/generate.d.ts +1 -0
- package/node_modules/nostr-wasm/dist/gzipped.d.ts +3 -0
- package/node_modules/nostr-wasm/dist/gzipped.js +44 -0
- package/node_modules/nostr-wasm/dist/headless.d.ts +2 -0
- package/node_modules/nostr-wasm/dist/main.d.ts +3 -0
- package/node_modules/nostr-wasm/dist/main.js +9 -0
- package/node_modules/nostr-wasm/dist/nostr.js +248 -0
- package/node_modules/nostr-wasm/dist/secp256k1.js +230 -0
- package/node_modules/nostr-wasm/dist/types.d.ts +22 -0
- package/node_modules/nostr-wasm/package.json +37 -0
- package/node_modules/nostr-wasm/public/out/secp256k1.js +1 -0
- package/node_modules/nostr-wasm/public/out/secp256k1.wasm +0 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +191 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1823 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +153 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
- package/node_modules/zod/src/v4/core/util.ts +983 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +41 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +599 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/node_modules/zod/v4/core/api.cjs +1227 -0
- package/node_modules/zod/v4/core/api.d.cts +325 -0
- package/node_modules/zod/v4/core/api.d.ts +325 -0
- package/node_modules/zod/v4/core/api.js +1087 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +575 -0
- package/node_modules/zod/v4/core/core.cjs +85 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +78 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +216 -0
- package/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/node_modules/zod/v4/core/errors.js +185 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/node_modules/zod/v4/core/regexes.js +139 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2270 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/node_modules/zod/v4/core/schemas.js +2239 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/node_modules/zod/v4/core/util.cjs +734 -0
- package/node_modules/zod/v4/core/util.d.cts +200 -0
- package/node_modules/zod/v4/core/util.d.ts +200 -0
- package/node_modules/zod/v4/core/util.js +674 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/zod/v4/locales/en.cjs +140 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +113 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +152 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +125 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +111 -0
- package/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/node_modules/zod/v4/locales/index.js +52 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +137 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +110 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1083 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/node_modules/zod/v4/mini/schemas.js +961 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/npm-shrinkwrap.json +137 -0
- package/package.json +9 -8
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// pure.ts
|
|
2
|
+
import { schnorr } from "@noble/curves/secp256k1.js";
|
|
3
|
+
import { bytesToHex as bytesToHex2, hexToBytes as hexToBytes2 } from "@noble/hashes/utils.js";
|
|
4
|
+
|
|
5
|
+
// core.ts
|
|
6
|
+
var verifiedSymbol = Symbol("verified");
|
|
7
|
+
var isRecord = (obj) => obj instanceof Object;
|
|
8
|
+
function validateEvent(event) {
|
|
9
|
+
if (!isRecord(event))
|
|
10
|
+
return false;
|
|
11
|
+
if (typeof event.kind !== "number")
|
|
12
|
+
return false;
|
|
13
|
+
if (typeof event.content !== "string")
|
|
14
|
+
return false;
|
|
15
|
+
if (typeof event.created_at !== "number")
|
|
16
|
+
return false;
|
|
17
|
+
if (typeof event.pubkey !== "string")
|
|
18
|
+
return false;
|
|
19
|
+
if (!event.pubkey.match(/^[a-f0-9]{64}$/))
|
|
20
|
+
return false;
|
|
21
|
+
if (!Array.isArray(event.tags))
|
|
22
|
+
return false;
|
|
23
|
+
for (let i2 = 0; i2 < event.tags.length; i2++) {
|
|
24
|
+
let tag = event.tags[i2];
|
|
25
|
+
if (!Array.isArray(tag))
|
|
26
|
+
return false;
|
|
27
|
+
for (let j = 0; j < tag.length; j++) {
|
|
28
|
+
if (typeof tag[j] !== "string")
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// pure.ts
|
|
36
|
+
import { sha256 } from "@noble/hashes/sha2.js";
|
|
37
|
+
|
|
38
|
+
// utils.ts
|
|
39
|
+
import { bytesToHex, hexToBytes } from "@noble/hashes/utils.js";
|
|
40
|
+
var utf8Decoder = new TextDecoder("utf-8");
|
|
41
|
+
var utf8Encoder = new TextEncoder();
|
|
42
|
+
|
|
43
|
+
// pure.ts
|
|
44
|
+
var JS = class {
|
|
45
|
+
generateSecretKey() {
|
|
46
|
+
return schnorr.utils.randomSecretKey();
|
|
47
|
+
}
|
|
48
|
+
getPublicKey(secretKey) {
|
|
49
|
+
return bytesToHex2(schnorr.getPublicKey(secretKey));
|
|
50
|
+
}
|
|
51
|
+
finalizeEvent(t, secretKey) {
|
|
52
|
+
const event = t;
|
|
53
|
+
event.pubkey = bytesToHex2(schnorr.getPublicKey(secretKey));
|
|
54
|
+
event.id = getEventHash(event);
|
|
55
|
+
event.sig = bytesToHex2(schnorr.sign(hexToBytes2(getEventHash(event)), secretKey));
|
|
56
|
+
event[verifiedSymbol] = true;
|
|
57
|
+
return event;
|
|
58
|
+
}
|
|
59
|
+
verifyEvent(event) {
|
|
60
|
+
if (typeof event[verifiedSymbol] === "boolean")
|
|
61
|
+
return event[verifiedSymbol];
|
|
62
|
+
try {
|
|
63
|
+
const hash = getEventHash(event);
|
|
64
|
+
if (hash !== event.id) {
|
|
65
|
+
event[verifiedSymbol] = false;
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
const valid = schnorr.verify(hexToBytes2(event.sig), hexToBytes2(hash), hexToBytes2(event.pubkey));
|
|
69
|
+
event[verifiedSymbol] = valid;
|
|
70
|
+
return valid;
|
|
71
|
+
} catch (err) {
|
|
72
|
+
event[verifiedSymbol] = false;
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
function serializeEvent(evt) {
|
|
78
|
+
if (!validateEvent(evt))
|
|
79
|
+
throw new Error("can't serialize event with wrong or missing properties");
|
|
80
|
+
return JSON.stringify([0, evt.pubkey, evt.created_at, evt.kind, evt.tags, evt.content]);
|
|
81
|
+
}
|
|
82
|
+
function getEventHash(event) {
|
|
83
|
+
let eventHash = sha256(utf8Encoder.encode(serializeEvent(event)));
|
|
84
|
+
return bytesToHex2(eventHash);
|
|
85
|
+
}
|
|
86
|
+
var i = new JS();
|
|
87
|
+
var generateSecretKey = i.generateSecretKey;
|
|
88
|
+
var getPublicKey = i.getPublicKey;
|
|
89
|
+
var finalizeEvent = i.finalizeEvent;
|
|
90
|
+
var verifyEvent = i.verifyEvent;
|
|
91
|
+
|
|
92
|
+
// kinds.ts
|
|
93
|
+
var ShortTextNote = 1;
|
|
94
|
+
var Repost = 6;
|
|
95
|
+
var GenericRepost = 16;
|
|
96
|
+
|
|
97
|
+
// nip18.ts
|
|
98
|
+
function finishRepostEvent(t, reposted, relayUrl, privateKey) {
|
|
99
|
+
let kind;
|
|
100
|
+
const tags = [...t.tags ?? [], ["e", reposted.id, relayUrl], ["p", reposted.pubkey]];
|
|
101
|
+
if (reposted.kind === ShortTextNote) {
|
|
102
|
+
kind = Repost;
|
|
103
|
+
} else {
|
|
104
|
+
kind = GenericRepost;
|
|
105
|
+
tags.push(["k", String(reposted.kind)]);
|
|
106
|
+
}
|
|
107
|
+
return finalizeEvent(
|
|
108
|
+
{
|
|
109
|
+
kind,
|
|
110
|
+
tags,
|
|
111
|
+
content: t.content === "" || reposted.tags?.find((tag) => tag[0] === "-") ? "" : JSON.stringify(reposted),
|
|
112
|
+
created_at: t.created_at
|
|
113
|
+
},
|
|
114
|
+
privateKey
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function getRepostedEventPointer(event) {
|
|
118
|
+
if (![Repost, GenericRepost].includes(event.kind)) {
|
|
119
|
+
return void 0;
|
|
120
|
+
}
|
|
121
|
+
let lastETag;
|
|
122
|
+
let lastPTag;
|
|
123
|
+
for (let i2 = event.tags.length - 1; i2 >= 0 && (lastETag === void 0 || lastPTag === void 0); i2--) {
|
|
124
|
+
const tag = event.tags[i2];
|
|
125
|
+
if (tag.length >= 2) {
|
|
126
|
+
if (tag[0] === "e" && lastETag === void 0) {
|
|
127
|
+
lastETag = tag;
|
|
128
|
+
} else if (tag[0] === "p" && lastPTag === void 0) {
|
|
129
|
+
lastPTag = tag;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (lastETag === void 0) {
|
|
134
|
+
return void 0;
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
id: lastETag[1],
|
|
138
|
+
relays: [lastETag[2], lastPTag?.[2]].filter((x) => typeof x === "string"),
|
|
139
|
+
author: lastPTag?.[1]
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function getRepostedEvent(event, { skipVerification } = {}) {
|
|
143
|
+
const pointer = getRepostedEventPointer(event);
|
|
144
|
+
if (pointer === void 0 || event.content === "") {
|
|
145
|
+
return void 0;
|
|
146
|
+
}
|
|
147
|
+
let repostedEvent;
|
|
148
|
+
try {
|
|
149
|
+
repostedEvent = JSON.parse(event.content);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
return void 0;
|
|
152
|
+
}
|
|
153
|
+
if (repostedEvent.id !== pointer.id) {
|
|
154
|
+
return void 0;
|
|
155
|
+
}
|
|
156
|
+
if (!skipVerification && !verifyEvent(repostedEvent)) {
|
|
157
|
+
return void 0;
|
|
158
|
+
}
|
|
159
|
+
return repostedEvent;
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
finishRepostEvent,
|
|
163
|
+
getRepostedEvent,
|
|
164
|
+
getRepostedEventPointer
|
|
165
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../pure.ts", "../../core.ts", "../../utils.ts", "../../kinds.ts", "../../nip18.ts"],
|
|
4
|
+
"sourcesContent": ["import { schnorr } from '@noble/curves/secp256k1.js'\nimport { bytesToHex, hexToBytes } from '@noble/hashes/utils.js'\nimport { Nostr, Event, EventTemplate, UnsignedEvent, VerifiedEvent, verifiedSymbol, validateEvent } from './core.ts'\nimport { sha256 } from '@noble/hashes/sha2.js'\n\nimport { utf8Encoder } from './utils.ts'\n\nclass JS implements Nostr {\n generateSecretKey(): Uint8Array {\n return schnorr.utils.randomSecretKey()\n }\n getPublicKey(secretKey: Uint8Array): string {\n return bytesToHex(schnorr.getPublicKey(secretKey))\n }\n finalizeEvent(t: EventTemplate, secretKey: Uint8Array): VerifiedEvent {\n const event = t as VerifiedEvent\n event.pubkey = bytesToHex(schnorr.getPublicKey(secretKey))\n event.id = getEventHash(event)\n event.sig = bytesToHex(schnorr.sign(hexToBytes(getEventHash(event)), secretKey))\n event[verifiedSymbol] = true\n return event\n }\n verifyEvent(event: Event): event is VerifiedEvent {\n if (typeof event[verifiedSymbol] === 'boolean') return event[verifiedSymbol]\n\n try {\n const hash = getEventHash(event)\n if (hash !== event.id) {\n event[verifiedSymbol] = false\n return false\n }\n\n const valid = schnorr.verify(hexToBytes(event.sig), hexToBytes(hash), hexToBytes(event.pubkey))\n event[verifiedSymbol] = valid\n return valid\n } catch (err) {\n event[verifiedSymbol] = false\n return false\n }\n }\n}\n\nexport function serializeEvent(evt: UnsignedEvent): string {\n if (!validateEvent(evt)) throw new Error(\"can't serialize event with wrong or missing properties\")\n return JSON.stringify([0, evt.pubkey, evt.created_at, evt.kind, evt.tags, evt.content])\n}\n\nexport function getEventHash(event: UnsignedEvent): string {\n let eventHash = sha256(utf8Encoder.encode(serializeEvent(event)))\n return bytesToHex(eventHash)\n}\n\nconst i: JS = new JS()\n\nexport const generateSecretKey = i.generateSecretKey\nexport const getPublicKey = i.getPublicKey\nexport const finalizeEvent = i.finalizeEvent\nexport const verifyEvent = i.verifyEvent\nexport * from './core.ts'\n", "export interface Nostr {\n generateSecretKey(): Uint8Array\n getPublicKey(secretKey: Uint8Array): string\n finalizeEvent(event: EventTemplate, secretKey: Uint8Array): VerifiedEvent\n verifyEvent(event: Event): event is VerifiedEvent\n}\n\n/** Designates a verified event signature. */\nexport const verifiedSymbol = Symbol('verified')\n\nexport type NostrEvent = {\n kind: number\n tags: string[][]\n content: string\n created_at: number\n pubkey: string\n id: string\n sig: string\n [verifiedSymbol]?: boolean\n}\n\nexport type Event = NostrEvent\nexport type EventTemplate = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at'>\nexport type UnsignedEvent = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey'>\n\n/** An event whose signature has been verified. */\nexport interface VerifiedEvent extends Event {\n [verifiedSymbol]: true\n}\n\nconst isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\n\nexport function validateEvent<T>(event: T): event is T & UnsignedEvent {\n if (!isRecord(event)) return false\n if (typeof event.kind !== 'number') return false\n if (typeof event.content !== 'string') return false\n if (typeof event.created_at !== 'number') return false\n if (typeof event.pubkey !== 'string') return false\n if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false\n\n if (!Array.isArray(event.tags)) return false\n for (let i = 0; i < event.tags.length; i++) {\n let tag = event.tags[i]\n if (!Array.isArray(tag)) return false\n for (let j = 0; j < tag.length; j++) {\n if (typeof tag[j] !== 'string') return false\n }\n }\n\n return true\n}\n\n/**\n * Sort events in reverse-chronological order by the `created_at` timestamp,\n * and then by the event `id` (lexicographically) in case of ties.\n * This mutates the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort((a: NostrEvent, b: NostrEvent): number => {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at\n }\n return a.id.localeCompare(b.id)\n })\n}\n", "import type { NostrEvent } from './core.ts'\n\nexport const utf8Decoder: TextDecoder = new TextDecoder('utf-8')\nexport const utf8Encoder: TextEncoder = new TextEncoder()\n\nexport { bytesToHex, hexToBytes } from '@noble/hashes/utils.js'\n\nexport function normalizeURL(url: string): string {\n try {\n if (url.indexOf('://') === -1) url = 'wss://' + url\n let p = new URL(url)\n if (p.protocol === 'http:') p.protocol = 'ws:'\n else if (p.protocol === 'https:') p.protocol = 'wss:'\n p.pathname = p.pathname.replace(/\\/+/g, '/')\n if (p.pathname.endsWith('/')) p.pathname = p.pathname.slice(0, -1)\n if ((p.port === '80' && p.protocol === 'ws:') || (p.port === '443' && p.protocol === 'wss:')) p.port = ''\n p.searchParams.sort()\n p.hash = ''\n return p.toString()\n } catch (e) {\n throw new Error(`Invalid URL: ${url}`)\n }\n}\n\nexport function insertEventIntoDescendingList(sortedArray: NostrEvent[], event: NostrEvent): NostrEvent[] {\n const [idx, found] = binarySearch(sortedArray, b => {\n if (event.id === b.id) return 0\n if (event.created_at === b.created_at) return -1\n return b.created_at - event.created_at\n })\n if (!found) {\n sortedArray.splice(idx, 0, event)\n }\n return sortedArray\n}\n\nexport function insertEventIntoAscendingList(sortedArray: NostrEvent[], event: NostrEvent): NostrEvent[] {\n const [idx, found] = binarySearch(sortedArray, b => {\n if (event.id === b.id) return 0\n if (event.created_at === b.created_at) return -1\n return event.created_at - b.created_at\n })\n if (!found) {\n sortedArray.splice(idx, 0, event)\n }\n return sortedArray\n}\n\nexport function binarySearch<T>(arr: T[], compare: (b: T) => number): [number, boolean] {\n let start = 0\n let end = arr.length - 1\n\n while (start <= end) {\n const mid = Math.floor((start + end) / 2)\n const cmp = compare(arr[mid])\n\n if (cmp === 0) {\n return [mid, true]\n }\n\n if (cmp < 0) {\n end = mid - 1\n } else {\n start = mid + 1\n }\n }\n\n return [start, false]\n}\n\nexport function mergeReverseSortedLists(list1: NostrEvent[], list2: NostrEvent[]): NostrEvent[] {\n const result: NostrEvent[] = new Array(list1.length + list2.length)\n result.length = 0\n let i1 = 0\n let i2 = 0\n let sameTimestampIds: string[] = []\n\n while (i1 < list1.length && i2 < list2.length) {\n let next: NostrEvent\n if (list1[i1]?.created_at > list2[i2]?.created_at) {\n next = list1[i1]\n i1++\n } else {\n next = list2[i2]\n i2++\n }\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n while (i1 < list1.length) {\n const next = list1[i1]\n i1++\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n while (i2 < list2.length) {\n const next = list2[i2]\n i2++\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n return result\n}\n", "import { NostrEvent, validateEvent } from './pure.ts'\n\n/** Events are **regular**, which means they're all expected to be stored by relays. */\nexport function isRegularKind(kind: number): boolean {\n return kind < 10000 && kind !== 0 && kind !== 3\n}\n\n/** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */\nexport function isReplaceableKind(kind: number): boolean {\n return kind === 0 || kind === 3 || (10000 <= kind && kind < 20000)\n}\n\n/** Events are **ephemeral**, which means they are not expected to be stored by relays. */\nexport function isEphemeralKind(kind: number): boolean {\n return 20000 <= kind && kind < 30000\n}\n\n/** Events are **addressable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. */\nexport function isAddressableKind(kind: number): boolean {\n return 30000 <= kind && kind < 40000\n}\n\n/** Classification of the event kind. */\nexport type KindClassification = 'regular' | 'replaceable' | 'ephemeral' | 'parameterized' | 'unknown'\n\n/** Determine the classification of this kind of event if known, or `unknown`. */\nexport function classifyKind(kind: number): KindClassification {\n if (isRegularKind(kind)) return 'regular'\n if (isReplaceableKind(kind)) return 'replaceable'\n if (isEphemeralKind(kind)) return 'ephemeral'\n if (isAddressableKind(kind)) return 'parameterized'\n return 'unknown'\n}\n\nexport function isKind<T extends number>(event: unknown, kind: T | Array<T>): event is NostrEvent & { kind: T } {\n const kindAsArray: number[] = kind instanceof Array ? kind : [kind]\n return (validateEvent(event) && kindAsArray.includes(event.kind)) || false\n}\n\nexport const Metadata = 0\nexport type Metadata = typeof Metadata\nexport const ShortTextNote = 1\nexport type ShortTextNote = typeof ShortTextNote\nexport const RecommendRelay = 2\nexport type RecommendRelay = typeof RecommendRelay\nexport const Contacts = 3\nexport type Contacts = typeof Contacts\nexport const EncryptedDirectMessage = 4\nexport type EncryptedDirectMessage = typeof EncryptedDirectMessage\nexport const EventDeletion = 5\nexport type EventDeletion = typeof EventDeletion\nexport const Repost = 6\nexport type Repost = typeof Repost\nexport const Reaction = 7\nexport type Reaction = typeof Reaction\nexport const BadgeAward = 8\nexport type BadgeAward = typeof BadgeAward\nexport const ChatMessage = 9\nexport type ChatMessage = typeof ChatMessage\nexport const ForumThread = 11\nexport type ForumThread = typeof ForumThread\nexport const Seal = 13\nexport type Seal = typeof Seal\nexport const PrivateDirectMessage = 14\nexport type PrivateDirectMessage = typeof PrivateDirectMessage\nexport const FileMessage = 15\nexport type FileMessage = typeof FileMessage\nexport const GenericRepost = 16\nexport type GenericRepost = typeof GenericRepost\nexport const Photo = 20\nexport type Photo = typeof Photo\nexport const NormalVideo = 21\nexport type NormalVideo = typeof NormalVideo\nexport const ShortVideo = 22\nexport type ShortVideo = typeof ShortVideo\nexport const ChannelCreation = 40\nexport type ChannelCreation = typeof ChannelCreation\nexport const ChannelMetadata = 41\nexport type ChannelMetadata = typeof ChannelMetadata\nexport const ChannelMessage = 42\nexport type ChannelMessage = typeof ChannelMessage\nexport const ChannelHideMessage = 43\nexport type ChannelHideMessage = typeof ChannelHideMessage\nexport const ChannelMuteUser = 44\nexport type ChannelMuteUser = typeof ChannelMuteUser\nexport const OpenTimestamps = 1040\nexport type OpenTimestamps = typeof OpenTimestamps\nexport const GiftWrap = 1059\nexport type GiftWrap = typeof GiftWrap\nexport const Poll = 1068\nexport type Poll = typeof Poll\nexport const FileMetadata = 1063\nexport type FileMetadata = typeof FileMetadata\nexport const Comment = 1111\nexport type Comment = typeof Comment\nexport const LiveChatMessage = 1311\nexport type LiveChatMessage = typeof LiveChatMessage\nexport const Voice = 1222\nexport type Voice = typeof Voice\nexport const VoiceComment = 1244\nexport type VoiceComment = typeof VoiceComment\nexport const ProblemTracker = 1971\nexport type ProblemTracker = typeof ProblemTracker\nexport const Report = 1984\nexport type Report = typeof Report\nexport const Reporting = 1984\nexport type Reporting = typeof Reporting\nexport const Label = 1985\nexport type Label = typeof Label\nexport const CommunityPostApproval = 4550\nexport type CommunityPostApproval = typeof CommunityPostApproval\nexport const JobRequest = 5999\nexport type JobRequest = typeof JobRequest\nexport const JobResult = 6999\nexport type JobResult = typeof JobResult\nexport const JobFeedback = 7000\nexport type JobFeedback = typeof JobFeedback\nexport const ZapGoal = 9041\nexport type ZapGoal = typeof ZapGoal\nexport const ZapRequest = 9734\nexport type ZapRequest = typeof ZapRequest\nexport const Zap = 9735\nexport type Zap = typeof Zap\nexport const Highlights = 9802\nexport type Highlights = typeof Highlights\nexport const PollResponse = 1018\nexport type PollResponse = typeof PollResponse\nexport const Mutelist = 10000\nexport type Mutelist = typeof Mutelist\nexport const Pinlist = 10001\nexport type Pinlist = typeof Pinlist\nexport const RelayList = 10002\nexport type RelayList = typeof RelayList\nexport const BookmarkList = 10003\nexport type BookmarkList = typeof BookmarkList\nexport const CommunitiesList = 10004\nexport type CommunitiesList = typeof CommunitiesList\nexport const PublicChatsList = 10005\nexport type PublicChatsList = typeof PublicChatsList\nexport const BlockedRelaysList = 10006\nexport type BlockedRelaysList = typeof BlockedRelaysList\nexport const SearchRelaysList = 10007\nexport type SearchRelaysList = typeof SearchRelaysList\nexport const FavoriteRelays = 10012\nexport type FavoriteRelays = typeof FavoriteRelays\nexport const InterestsList = 10015\nexport type InterestsList = typeof InterestsList\nexport const UserEmojiList = 10030\nexport type UserEmojiList = typeof UserEmojiList\nexport const DirectMessageRelaysList = 10050\nexport type DirectMessageRelaysList = typeof DirectMessageRelaysList\nexport const FileServerPreference = 10096\nexport type FileServerPreference = typeof FileServerPreference\nexport const BlossomServerList = 10063\nexport type BlossomServerList = typeof BlossomServerList\nexport const NWCWalletInfo = 13194\nexport type NWCWalletInfo = typeof NWCWalletInfo\nexport const LightningPubRPC = 21000\nexport type LightningPubRPC = typeof LightningPubRPC\nexport const ClientAuth = 22242\nexport type ClientAuth = typeof ClientAuth\nexport const NWCWalletRequest = 23194\nexport type NWCWalletRequest = typeof NWCWalletRequest\nexport const NWCWalletResponse = 23195\nexport type NWCWalletResponse = typeof NWCWalletResponse\nexport const NostrConnect = 24133\nexport type NostrConnect = typeof NostrConnect\nexport const HTTPAuth = 27235\nexport type HTTPAuth = typeof HTTPAuth\nexport const Followsets = 30000\nexport type Followsets = typeof Followsets\nexport const Genericlists = 30001\nexport type Genericlists = typeof Genericlists\nexport const Relaysets = 30002\nexport type Relaysets = typeof Relaysets\nexport const Bookmarksets = 30003\nexport type Bookmarksets = typeof Bookmarksets\nexport const Curationsets = 30004\nexport type Curationsets = typeof Curationsets\nexport const ProfileBadges = 30008\nexport type ProfileBadges = typeof ProfileBadges\nexport const BadgeDefinition = 30009\nexport type BadgeDefinition = typeof BadgeDefinition\nexport const Interestsets = 30015\nexport type Interestsets = typeof Interestsets\nexport const CreateOrUpdateStall = 30017\nexport type CreateOrUpdateStall = typeof CreateOrUpdateStall\nexport const CreateOrUpdateProduct = 30018\nexport type CreateOrUpdateProduct = typeof CreateOrUpdateProduct\nexport const LongFormArticle = 30023\nexport type LongFormArticle = typeof LongFormArticle\nexport const DraftLong = 30024\nexport type DraftLong = typeof DraftLong\nexport const Emojisets = 30030\nexport type Emojisets = typeof Emojisets\nexport const Application = 30078\nexport type Application = typeof Application\nexport const LiveEvent = 30311\nexport type LiveEvent = typeof LiveEvent\nexport const UserStatuses = 30315\nexport type UserStatuses = typeof UserStatuses\nexport const ClassifiedListing = 30402\nexport type ClassifiedListing = typeof ClassifiedListing\nexport const DraftClassifiedListing = 30403\nexport type DraftClassifiedListing = typeof DraftClassifiedListing\nexport const Date = 31922\nexport type Date = typeof Date\nexport const Time = 31923\nexport type Time = typeof Time\nexport const Calendar = 31924\nexport type Calendar = typeof Calendar\nexport const CalendarEventRSVP = 31925\nexport type CalendarEventRSVP = typeof CalendarEventRSVP\nexport const RelayReview = 31987\nexport type RelayReview = typeof RelayReview\nexport const Handlerrecommendation = 31989\nexport type Handlerrecommendation = typeof Handlerrecommendation\nexport const Handlerinformation = 31990\nexport type Handlerinformation = typeof Handlerinformation\nexport const CommunityDefinition = 34550\nexport type CommunityDefinition = typeof CommunityDefinition\nexport const GroupMetadata = 39000\nexport type GroupMetadata = typeof GroupMetadata\n", "import { GenericRepost, Repost, ShortTextNote } from './kinds.ts'\nimport { EventPointer } from './nip19.ts'\nimport { Event, finalizeEvent, verifyEvent } from './pure.ts'\n\nexport type RepostEventTemplate = {\n /**\n * Pass only non-nip18 tags if you have to.\n * Nip18 tags ('e' and 'p' tags pointing to the reposted event) will be added automatically.\n */\n tags?: string[][]\n\n /**\n * Pass an empty string to NOT include the stringified JSON of the reposted event.\n * Any other content will be ignored and replaced with the stringified JSON of the reposted event.\n * @default Stringified JSON of the reposted event\n */\n content?: ''\n\n created_at: number\n}\n\nexport function finishRepostEvent(\n t: RepostEventTemplate,\n reposted: Event,\n relayUrl: string,\n privateKey: Uint8Array,\n): Event {\n let kind: Repost | GenericRepost\n const tags = [...(t.tags ?? []), ['e', reposted.id, relayUrl], ['p', reposted.pubkey]]\n if (reposted.kind === ShortTextNote) {\n kind = Repost\n } else {\n kind = GenericRepost\n tags.push(['k', String(reposted.kind)])\n }\n\n return finalizeEvent(\n {\n kind,\n tags,\n content: t.content === '' || reposted.tags?.find(tag => tag[0] === '-') ? '' : JSON.stringify(reposted),\n created_at: t.created_at,\n },\n privateKey,\n )\n}\n\nexport function getRepostedEventPointer(event: Event): undefined | EventPointer {\n if (![Repost, GenericRepost].includes(event.kind)) {\n return undefined\n }\n\n let lastETag: undefined | string[]\n let lastPTag: undefined | string[]\n\n for (let i = event.tags.length - 1; i >= 0 && (lastETag === undefined || lastPTag === undefined); i--) {\n const tag = event.tags[i]\n if (tag.length >= 2) {\n if (tag[0] === 'e' && lastETag === undefined) {\n lastETag = tag\n } else if (tag[0] === 'p' && lastPTag === undefined) {\n lastPTag = tag\n }\n }\n }\n\n if (lastETag === undefined) {\n return undefined\n }\n\n return {\n id: lastETag[1],\n relays: [lastETag[2], lastPTag?.[2]].filter((x): x is string => typeof x === 'string'),\n author: lastPTag?.[1],\n }\n}\n\nexport type GetRepostedEventOptions = {\n skipVerification?: boolean\n}\n\nexport function getRepostedEvent(event: Event, { skipVerification }: GetRepostedEventOptions = {}): undefined | Event {\n const pointer = getRepostedEventPointer(event)\n\n if (pointer === undefined || event.content === '') {\n return undefined\n }\n\n let repostedEvent: undefined | Event\n\n try {\n repostedEvent = JSON.parse(event.content) as Event\n } catch (error) {\n return undefined\n }\n\n if (repostedEvent.id !== pointer.id) {\n return undefined\n }\n\n if (!skipVerification && !verifyEv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AAK,MAAM,MAAM,OAAO;AAAA,EAC1C,SAAS,OAAP;AACA,WAAO;AAAA,EACT;AAEA,MAAI,cAAc,OAAO,QAAQ,IAAI;AACnC,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,oBAAoB,CAAC,YAAY,aAAa,GAAG;AACpD,WAAO;AAAA,EACT;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": ["bytesToHex", "hexToBytes", "i", "bytesToHex", "hexToBytes", "i"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
// nip19.ts
|
|
2
|
+
import { bytesToHex as bytesToHex2, concatBytes, hexToBytes as hexToBytes2 } from "@noble/hashes/utils.js";
|
|
3
|
+
import { bech32 } from "@scure/base";
|
|
4
|
+
|
|
5
|
+
// utils.ts
|
|
6
|
+
import { bytesToHex, hexToBytes } from "@noble/hashes/utils.js";
|
|
7
|
+
var utf8Decoder = new TextDecoder("utf-8");
|
|
8
|
+
var utf8Encoder = new TextEncoder();
|
|
9
|
+
|
|
10
|
+
// nip19.ts
|
|
11
|
+
var NostrTypeGuard = {
|
|
12
|
+
isNProfile: (value) => /^nprofile1[a-z\d]+$/.test(value || ""),
|
|
13
|
+
isNEvent: (value) => /^nevent1[a-z\d]+$/.test(value || ""),
|
|
14
|
+
isNAddr: (value) => /^naddr1[a-z\d]+$/.test(value || ""),
|
|
15
|
+
isNSec: (value) => /^nsec1[a-z\d]{58}$/.test(value || ""),
|
|
16
|
+
isNPub: (value) => /^npub1[a-z\d]{58}$/.test(value || ""),
|
|
17
|
+
isNote: (value) => /^note1[a-z\d]+$/.test(value || ""),
|
|
18
|
+
isNcryptsec: (value) => /^ncryptsec1[a-z\d]+$/.test(value || "")
|
|
19
|
+
};
|
|
20
|
+
var Bech32MaxSize = 5e3;
|
|
21
|
+
var BECH32_REGEX = /[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;
|
|
22
|
+
function integerToUint8Array(number) {
|
|
23
|
+
const uint8Array = new Uint8Array(4);
|
|
24
|
+
uint8Array[0] = number >> 24 & 255;
|
|
25
|
+
uint8Array[1] = number >> 16 & 255;
|
|
26
|
+
uint8Array[2] = number >> 8 & 255;
|
|
27
|
+
uint8Array[3] = number & 255;
|
|
28
|
+
return uint8Array;
|
|
29
|
+
}
|
|
30
|
+
function decodeNostrURI(nip19code) {
|
|
31
|
+
try {
|
|
32
|
+
if (nip19code.startsWith("nostr:"))
|
|
33
|
+
nip19code = nip19code.substring(6);
|
|
34
|
+
return decode(nip19code);
|
|
35
|
+
} catch (_err) {
|
|
36
|
+
return { type: "invalid", data: null };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function decode(code) {
|
|
40
|
+
let { prefix, words } = bech32.decode(code, Bech32MaxSize);
|
|
41
|
+
let data = new Uint8Array(bech32.fromWords(words));
|
|
42
|
+
switch (prefix) {
|
|
43
|
+
case "nprofile": {
|
|
44
|
+
let tlv = parseTLV(data);
|
|
45
|
+
if (!tlv[0]?.[0])
|
|
46
|
+
throw new Error("missing TLV 0 for nprofile");
|
|
47
|
+
if (tlv[0][0].length !== 32)
|
|
48
|
+
throw new Error("TLV 0 should be 32 bytes");
|
|
49
|
+
return {
|
|
50
|
+
type: "nprofile",
|
|
51
|
+
data: {
|
|
52
|
+
pubkey: bytesToHex2(tlv[0][0]),
|
|
53
|
+
relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : []
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
case "nevent": {
|
|
58
|
+
let tlv = parseTLV(data);
|
|
59
|
+
if (!tlv[0]?.[0])
|
|
60
|
+
throw new Error("missing TLV 0 for nevent");
|
|
61
|
+
if (tlv[0][0].length !== 32)
|
|
62
|
+
throw new Error("TLV 0 should be 32 bytes");
|
|
63
|
+
if (tlv[2] && tlv[2][0].length !== 32)
|
|
64
|
+
throw new Error("TLV 2 should be 32 bytes");
|
|
65
|
+
if (tlv[3] && tlv[3][0].length !== 4)
|
|
66
|
+
throw new Error("TLV 3 should be 4 bytes");
|
|
67
|
+
return {
|
|
68
|
+
type: "nevent",
|
|
69
|
+
data: {
|
|
70
|
+
id: bytesToHex2(tlv[0][0]),
|
|
71
|
+
relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : [],
|
|
72
|
+
author: tlv[2]?.[0] ? bytesToHex2(tlv[2][0]) : void 0,
|
|
73
|
+
kind: tlv[3]?.[0] ? parseInt(bytesToHex2(tlv[3][0]), 16) : void 0
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
case "naddr": {
|
|
78
|
+
let tlv = parseTLV(data);
|
|
79
|
+
if (!tlv[0]?.[0])
|
|
80
|
+
throw new Error("missing TLV 0 for naddr");
|
|
81
|
+
if (!tlv[2]?.[0])
|
|
82
|
+
throw new Error("missing TLV 2 for naddr");
|
|
83
|
+
if (tlv[2][0].length !== 32)
|
|
84
|
+
throw new Error("TLV 2 should be 32 bytes");
|
|
85
|
+
if (!tlv[3]?.[0])
|
|
86
|
+
throw new Error("missing TLV 3 for naddr");
|
|
87
|
+
if (tlv[3][0].length !== 4)
|
|
88
|
+
throw new Error("TLV 3 should be 4 bytes");
|
|
89
|
+
return {
|
|
90
|
+
type: "naddr",
|
|
91
|
+
data: {
|
|
92
|
+
identifier: utf8Decoder.decode(tlv[0][0]),
|
|
93
|
+
pubkey: bytesToHex2(tlv[2][0]),
|
|
94
|
+
kind: parseInt(bytesToHex2(tlv[3][0]), 16),
|
|
95
|
+
relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : []
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
case "nsec":
|
|
100
|
+
return { type: prefix, data };
|
|
101
|
+
case "npub":
|
|
102
|
+
case "note":
|
|
103
|
+
return { type: prefix, data: bytesToHex2(data) };
|
|
104
|
+
default:
|
|
105
|
+
throw new Error(`unknown prefix ${prefix}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function parseTLV(data) {
|
|
109
|
+
let result = {};
|
|
110
|
+
let rest = data;
|
|
111
|
+
while (rest.length > 0) {
|
|
112
|
+
let t = rest[0];
|
|
113
|
+
let l = rest[1];
|
|
114
|
+
let v = rest.slice(2, 2 + l);
|
|
115
|
+
rest = rest.slice(2 + l);
|
|
116
|
+
if (v.length < l)
|
|
117
|
+
throw new Error(`not enough data to read on TLV ${t}`);
|
|
118
|
+
result[t] = result[t] || [];
|
|
119
|
+
result[t].push(v);
|
|
120
|
+
}
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
function nsecEncode(key) {
|
|
124
|
+
return encodeBytes("nsec", key);
|
|
125
|
+
}
|
|
126
|
+
function npubEncode(hex) {
|
|
127
|
+
return encodeBytes("npub", hexToBytes2(hex));
|
|
128
|
+
}
|
|
129
|
+
function noteEncode(hex) {
|
|
130
|
+
return encodeBytes("note", hexToBytes2(hex));
|
|
131
|
+
}
|
|
132
|
+
function encodeBech32(prefix, data) {
|
|
133
|
+
let words = bech32.toWords(data);
|
|
134
|
+
return bech32.encode(prefix, words, Bech32MaxSize);
|
|
135
|
+
}
|
|
136
|
+
function encodeBytes(prefix, bytes) {
|
|
137
|
+
return encodeBech32(prefix, bytes);
|
|
138
|
+
}
|
|
139
|
+
function nprofileEncode(profile) {
|
|
140
|
+
let data = encodeTLV({
|
|
141
|
+
0: [hexToBytes2(profile.pubkey)],
|
|
142
|
+
1: (profile.relays || []).map((url) => utf8Encoder.encode(url))
|
|
143
|
+
});
|
|
144
|
+
return encodeBech32("nprofile", data);
|
|
145
|
+
}
|
|
146
|
+
function neventEncode(event) {
|
|
147
|
+
let kindArray;
|
|
148
|
+
if (event.kind !== void 0) {
|
|
149
|
+
kindArray = integerToUint8Array(event.kind);
|
|
150
|
+
}
|
|
151
|
+
let data = encodeTLV({
|
|
152
|
+
0: [hexToBytes2(event.id)],
|
|
153
|
+
1: (event.relays || []).map((url) => utf8Encoder.encode(url)),
|
|
154
|
+
2: event.author ? [hexToBytes2(event.author)] : [],
|
|
155
|
+
3: kindArray ? [new Uint8Array(kindArray)] : []
|
|
156
|
+
});
|
|
157
|
+
return encodeBech32("nevent", data);
|
|
158
|
+
}
|
|
159
|
+
function naddrEncode(addr) {
|
|
160
|
+
let kind = new ArrayBuffer(4);
|
|
161
|
+
new DataView(kind).setUint32(0, addr.kind, false);
|
|
162
|
+
let data = encodeTLV({
|
|
163
|
+
0: [utf8Encoder.encode(addr.identifier)],
|
|
164
|
+
1: (addr.relays || []).map((url) => utf8Encoder.encode(url)),
|
|
165
|
+
2: [hexToBytes2(addr.pubkey)],
|
|
166
|
+
3: [new Uint8Array(kind)]
|
|
167
|
+
});
|
|
168
|
+
return encodeBech32("naddr", data);
|
|
169
|
+
}
|
|
170
|
+
function encodeTLV(tlv) {
|
|
171
|
+
let entries = [];
|
|
172
|
+
Object.entries(tlv).reverse().forEach(([t, vs]) => {
|
|
173
|
+
vs.forEach((v) => {
|
|
174
|
+
let entry = new Uint8Array(v.length + 2);
|
|
175
|
+
entry.set([parseInt(t)], 0);
|
|
176
|
+
entry.set([v.length], 1);
|
|
177
|
+
entry.set(v, 2);
|
|
178
|
+
entries.push(entry);
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
return concatBytes(...entries);
|
|
182
|
+
}
|
|
183
|
+
export {
|
|
184
|
+
BECH32_REGEX,
|
|
185
|
+
Bech32MaxSize,
|
|
186
|
+
NostrTypeGuard,
|
|
187
|
+
decode,
|
|
188
|
+
decodeNostrURI,
|
|
189
|
+
encodeBytes,
|
|
190
|
+
naddrEncode,
|
|
191
|
+
neventEncode,
|
|
192
|
+
noteEncode,
|
|
193
|
+
nprofileEncode,
|
|
194
|
+
npubEncode,
|
|
195
|
+
nsecEncode
|
|
196
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../nip19.ts", "../../utils.ts"],
|
|
4
|
+
"sourcesContent": ["import { bytesToHex, concatBytes, hexToBytes } from '@noble/hashes/utils.js'\nimport { bech32 } from '@scure/base'\n\nimport { utf8Decoder, utf8Encoder } from './utils.ts'\n\nexport type NProfile = `nprofile1${string}`\nexport type NEvent = `nevent1${string}`\nexport type NAddr = `naddr1${string}`\nexport type NSec = `nsec1${string}`\nexport type NPub = `npub1${string}`\nexport type Note = `note1${string}`\nexport type Ncryptsec = `ncryptsec1${string}`\n\nexport const NostrTypeGuard = {\n isNProfile: (value?: string | null): value is NProfile => /^nprofile1[a-z\\d]+$/.test(value || ''),\n isNEvent: (value?: string | null): value is NEvent => /^nevent1[a-z\\d]+$/.test(value || ''),\n isNAddr: (value?: string | null): value is NAddr => /^naddr1[a-z\\d]+$/.test(value || ''),\n isNSec: (value?: string | null): value is NSec => /^nsec1[a-z\\d]{58}$/.test(value || ''),\n isNPub: (value?: string | null): value is NPub => /^npub1[a-z\\d]{58}$/.test(value || ''),\n isNote: (value?: string | null): value is Note => /^note1[a-z\\d]+$/.test(value || ''),\n isNcryptsec: (value?: string | null): value is Ncryptsec => /^ncryptsec1[a-z\\d]+$/.test(value || ''),\n}\n\nexport const Bech32MaxSize = 5000\n\n/**\n * Bech32 regex.\n * @see https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32\n */\nexport const BECH32_REGEX = /[\\x21-\\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/\n\nfunction integerToUint8Array(number: number) {\n // Create a Uint8Array with enough space to hold a 32-bit integer (4 bytes).\n const uint8Array = new Uint8Array(4)\n\n // Use bitwise operations to extract the bytes.\n uint8Array[0] = (number >> 24) & 0xff // Most significant byte (MSB)\n uint8Array[1] = (number >> 16) & 0xff\n uint8Array[2] = (number >> 8) & 0xff\n uint8Array[3] = number & 0xff // Least significant byte (LSB)\n\n return uint8Array\n}\n\nexport type ProfilePointer = {\n pubkey: string // hex\n relays?: string[]\n}\n\nexport type EventPointer = {\n id: string // hex\n relays?: string[]\n author?: string\n kind?: number\n}\n\nexport type AddressPointer = {\n identifier: string\n pubkey: string\n kind: number\n relays?: string[]\n}\n\nexport function decodeNostrURI(nip19code: string): ReturnType<typeof decode> | { type: 'invalid'; data: null } {\n try {\n if (nip19code.startsWith('nostr:')) nip19code = nip19code.substring(6)\n return decode(nip19code)\n } catch (_err) {\n return { type: 'invalid', data: null }\n }\n}\n\nexport type DecodedNevent = {\n type: 'nevent'\n data: EventPointer\n}\n\nexport type DecodedNprofile = {\n type: 'nprofile'\n data: ProfilePointer\n}\n\nexport type DecodedNaddr = {\n type: 'naddr'\n data: AddressPointer\n}\n\nexport type DecodedNsec = {\n type: 'nsec'\n data: Uint8Array\n}\n\nexport type DecodedNpub = {\n type: 'npub'\n data: string\n}\n\nexport type DecodedNote = {\n type: 'note'\n data: string\n}\n\nexport type DecodedResult = DecodedNevent | DecodedNprofile | DecodedNaddr | DecodedNpub | DecodedNsec | DecodedNote\n\nexport function decode(nip19: NEvent): DecodedNevent\nexport function decode(nip19: NProfile): DecodedNprofile\nexport function decode(nip19: NAddr): DecodedNaddr\nexport function decode(nip19: NSec): DecodedNsec\nexport function decode(nip19: NPub): DecodedNpub\nexport function decode(nip19: Note): DecodedNote\nexport function decode(code: string): DecodedResult\nexport function decode(code: string): DecodedResult {\n let { prefix, words } = bech32.decode(code as `${string}1${string}`, Bech32MaxSize)\n let data = new Uint8Array(bech32.fromWords(words))\n\n switch (prefix) {\n case 'nprofile': {\n let tlv = parseTLV(data)\n if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nprofile')\n if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes')\n\n return {\n type: 'nprofile',\n data: {\n pubkey: bytesToHex(tlv[0][0]),\n relays: tlv[1] ? tlv[1].map(d => utf8Decoder.decode(d)) : [],\n },\n }\n }\n case 'nevent': {\n let tlv = parseTLV(data)\n if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nevent')\n if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes')\n if (tlv[2] && tlv[2][0].length !== 32) throw new Error('TLV 2 should be 32 bytes')\n if (tlv[3] && tlv[3][0].length !== 4) throw new Error('TLV 3 should be 4 bytes')\n\n return {\n type: 'nevent',\n data: {\n id: bytesToHex(tlv[0][0]),\n relays: tlv[1] ? tlv[1].map(d => utf8Decoder.decode(d)) : [],\n author: tlv[2]?.[0] ? bytesToHex(tlv[2][0]) : undefined,\n kind: tlv[3]?.[0] ? parseInt(bytesToHex(tlv[3][0]), 16) : undefined,\n },\n }\n }\n\n case 'naddr': {\n let tlv = parseTLV(data)\n if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for naddr')\n if (!tlv[2]?.[0]) throw new Error('missing TLV 2 for naddr')\n if (tlv[2][0].length !== 32) throw new Error('TLV 2 should be 32 bytes')\n if (!tlv[3]?.[0]) throw new Error('missing TLV 3 for naddr')\n if (tlv[3][0].length !== 4) throw new Error('TLV 3 should be 4 bytes')\n\n return {\n type: 'naddr',\n data: {\n identifier: utf8Decoder.decode(tlv[0][0]),\n pubkey: bytesToHex(tlv[2][0]),\n kind: parseInt(bytesToHex(tlv[3][0]), 16),\n relays: tlv[1] ? tlv[1].map(d => utf8Decoder.decode(d)) : [],\n },\n }\n }\n\n case 'nsec':\n return { type: prefix, data }\n\n case 'npub':\n case 'note':\n return { type: prefix, data: bytesToHex(data) }\n\n default:\n throw new Error(`unknown prefix ${prefix}`)\n }\n}\n\ntype TLV = { [t: number]: Uint8Array[] }\n\nfunction parseTLV(data: Uint8Array): TLV {\n let result: TLV = {}\n let rest = data\n while (rest.length > 0) {\n let t = rest[0]\n let l = rest[1]\n let v = rest.slice(2, 2 + l)\n rest = rest.slice(2 + l)\n if (v.length < l) throw new Error(`not enough data to read on TLV ${t}`)\n result[t] = result[t] || []\n result[t].push(v)\n }\n return result\n}\n\nexport function nsecEncode(key: Uint8Array): NSec {\n return encodeBytes('nsec', key)\n}\n\nexport function npubEncode(hex: string): NPub {\n return encodeBytes('npub', hexToBytes(hex))\n}\n\nexport function noteEncode(hex: string): Note {\n return encodeBytes('note', hexToBytes(hex))\n}\n\nfunction encodeBech32<Prefix extends string>(prefix: Prefix, data: Uint8Array): `${Prefix}1${string}` {\n let words = bech32.toWords(data)\n return bech32.encode(prefix, words, Bech32MaxSize) as `${Prefix}1${string}`\n}\n\nexport function encodeBytes<Prefix extends string>(prefix: Prefix, bytes: Uint8Array): `${Prefix}1${string}` {\n return encodeBech32(prefix, bytes)\n}\n\nexport function nprofileEncode(profile: ProfilePointer): NProfile {\n let data = encodeTLV({\n 0: [hexToBytes(profile.pubkey)],\n 1: (profile.relays || []).map(url => utf8Encoder.encode(url)),\n })\n return encodeBech32('nprofile', data)\n}\n\nexport function neventEncode(event: EventPointer): NEvent {\n let kindArray\n if (event.kind !== undefined) {\n kindArray = integerToUint8Array(event.kind)\n }\n\n let data = encodeTLV({\n 0: [hexToBytes(event.id)],\n 1: (event.relays || []).map(url => utf8Encoder.encode(url)),\n 2: event.author ? [hexToBytes(event.author)] : [],\n 3: kindArray ? [new Uint8Array(kindArray)] : [],\n })\n\n return encodeBech32('nevent', data)\n}\n\nexport function naddrEncode(addr: AddressPointer): NAddr {\n let kind = new ArrayBuffer(4)\n new DataView(kind).setUint32(0, addr.kind, false)\n\n let data = encodeTLV({\n 0: [utf8Encoder.encode(addr.identifier)],\n 1: (addr.relays || []).map(url => utf8Encoder.encode(url)),\n 2: [hexToBytes(addr.pubkey)],\n 3: [new Uint8Array(kind)],\n })\n return encodeBech32('naddr', data)\n}\n\nfunction encodeTLV(tlv: TLV): Uint8Array {\n let entries: Uint8Array[] = []\n\n Object.entries(tlv)\n .reverse()\n .forEach(([t, vs]) => {\n vs.forEach(v => {\n let entry = new Uint8Array(v.length + 2)\n entry.set([parseInt(t)], 0)\n entry.set([v.length], 1)\n entry.set(v, 2)\n entries.push(entry)\n })\n })\n\n return concatBytes(...entries)\n}\n", "import type { NostrEvent } from './core.ts'\n\nexport const utf8Decoder: TextDecoder = new TextDecoder('utf-8')\nexport const utf8Encoder: TextEncoder = new TextEncoder()\n\nexport { bytesToHex, hexToBytes } from '@noble/hashes/utils.js'\n\nexport function normalizeURL(url: string): string {\n try {\n if (url.indexOf('://') === -1) url = 'wss://' + url\n let p = new URL(url)\n if (p.protocol === 'http:') p.protocol = 'ws:'\n else if (p.protocol === 'https:') p.protocol = 'wss:'\n p.pathname = p.pathname.replace(/\\/+/g, '/')\n if (p.pathname.endsWith('/')) p.pathname = p.pathname.slice(0, -1)\n if ((p.port === '80' && p.protocol === 'ws:') || (p.port === '443' && p.protocol === 'wss:')) p.port = ''\n p.searchParams.sort()\n p.hash = ''\n return p.toString()\n } catch (e) {\n throw new Error(`Invalid URL: ${url}`)\n }\n}\n\nexport function insertEventIntoDescendingList(sortedArray: NostrEvent[], event: NostrEvent): NostrEvent[] {\n const [idx, found] = binarySearch(sortedArray, b => {\n if (event.id === b.id) return 0\n if (event.created_at === b.created_at) return -1\n return b.created_at - event.created_at\n })\n if (!found) {\n sortedArray.splice(idx, 0, event)\n }\n return sortedArray\n}\n\nexport function insertEventIntoAscendingList(sortedArray: NostrEvent[], event: NostrEvent): NostrEvent[] {\n const [idx, found] = binarySearch(sortedArray, b => {\n if (event.id === b.id) return 0\n if (event.created_at === b.created_at) return -1\n return event.created_at - b.created_at\n })\n if (!found) {\n sortedArray.splice(idx, 0, event)\n }\n return sortedArray\n}\n\nexport function binarySearch<T>(arr: T[], compare: (b: T) => number): [number, boolean] {\n let start = 0\n let end = arr.length - 1\n\n while (start <= end) {\n const mid = Math.floor((start + end) / 2)\n const cmp = compare(arr[mid])\n\n if (cmp === 0) {\n return [mid, true]\n }\n\n if (cmp < 0) {\n end = mid - 1\n } else {\n start = mid + 1\n }\n }\n\n return [start, false]\n}\n\nexport function mergeReverseSortedLists(list1: NostrEvent[], list2: NostrEvent[]): NostrEvent[] {\n const result: NostrEvent[] = new Array(list1.length + list2.length)\n result.length = 0\n let i1 = 0\n let i2 = 0\n let sameTimestampIds: string[] = []\n\n while (i1 < list1.length && i2 < list2.length) {\n let next: NostrEvent\n if (list1[i1]?.created_at > list2[i2]?.created_at) {\n next = list1[i1]\n i1++\n } else {\n next = list2[i2]\n i2++\n }\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n while (i1 < list1.length) {\n const next = list1[i1]\n i1++\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n while (i2 < list2.length) {\n const next = list2[i2]\n i2++\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n return result\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,cAAAA,aAAY,aAAa,cAAAC,mBAAkB;AACpD,SAAS,cAAc;;;ACIvB,SAAS,YAAY,kBAAkB;AAHhC,IAAM,cAA2B,IAAI,YAAY,OAAO;AACxD,IAAM,cAA2B,IAAI,YAAY;;;ADUjD,IAAM,iBAAiB;AAAA,EAC5B,YAAY,CAAC,UAA6C,sBAAsB,KAAK,SAAS,EAAE;AAAA,EAChG,UAAU,CAAC,UAA2C,oBAAoB,KAAK,SAAS,EAAE;AAAA,EAC1F,SAAS,CAAC,UAA0C,mBAAmB,KAAK,SAAS,EAAE;AAAA,EACvF,QAAQ,CAAC,UAAyC,qBAAqB,KAAK,SAAS,EAAE;AAAA,EACvF,QAAQ,CAAC,UAAyC,qBAAqB,KAAK,SAAS,EAAE;AAAA,EACvF,QAAQ,CAAC,UAAyC,kBAAkB,KAAK,SAAS,EAAE;AAAA,EACpF,aAAa,CAAC,UAA8C,uBAAuB,KAAK,SAAS,EAAE;AACrG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K,KAAK;AAAA,IACpB,CAAC;AAAA,EACH,CAAC;AAEH,SAAO,YAAY,GAAG,OAAO;AAC/B;",
|
|
6
|
+
"names": ["bytesToHex", "hexToBytes", "bytesToHex", "hexToBytes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// nip19.ts
|
|
2
|
+
import { bytesToHex as bytesToHex2, concatBytes, hexToBytes as hexToBytes2 } from "@noble/hashes/utils.js";
|
|
3
|
+
import { bech32 } from "@scure/base";
|
|
4
|
+
|
|
5
|
+
// utils.ts
|
|
6
|
+
import { bytesToHex, hexToBytes } from "@noble/hashes/utils.js";
|
|
7
|
+
var utf8Decoder = new TextDecoder("utf-8");
|
|
8
|
+
var utf8Encoder = new TextEncoder();
|
|
9
|
+
|
|
10
|
+
// nip19.ts
|
|
11
|
+
var Bech32MaxSize = 5e3;
|
|
12
|
+
var BECH32_REGEX = /[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;
|
|
13
|
+
function decode(code) {
|
|
14
|
+
let { prefix, words } = bech32.decode(code, Bech32MaxSize);
|
|
15
|
+
let data = new Uint8Array(bech32.fromWords(words));
|
|
16
|
+
switch (prefix) {
|
|
17
|
+
case "nprofile": {
|
|
18
|
+
let tlv = parseTLV(data);
|
|
19
|
+
if (!tlv[0]?.[0])
|
|
20
|
+
throw new Error("missing TLV 0 for nprofile");
|
|
21
|
+
if (tlv[0][0].length !== 32)
|
|
22
|
+
throw new Error("TLV 0 should be 32 bytes");
|
|
23
|
+
return {
|
|
24
|
+
type: "nprofile",
|
|
25
|
+
data: {
|
|
26
|
+
pubkey: bytesToHex2(tlv[0][0]),
|
|
27
|
+
relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : []
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
case "nevent": {
|
|
32
|
+
let tlv = parseTLV(data);
|
|
33
|
+
if (!tlv[0]?.[0])
|
|
34
|
+
throw new Error("missing TLV 0 for nevent");
|
|
35
|
+
if (tlv[0][0].length !== 32)
|
|
36
|
+
throw new Error("TLV 0 should be 32 bytes");
|
|
37
|
+
if (tlv[2] && tlv[2][0].length !== 32)
|
|
38
|
+
throw new Error("TLV 2 should be 32 bytes");
|
|
39
|
+
if (tlv[3] && tlv[3][0].length !== 4)
|
|
40
|
+
throw new Error("TLV 3 should be 4 bytes");
|
|
41
|
+
return {
|
|
42
|
+
type: "nevent",
|
|
43
|
+
data: {
|
|
44
|
+
id: bytesToHex2(tlv[0][0]),
|
|
45
|
+
relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : [],
|
|
46
|
+
author: tlv[2]?.[0] ? bytesToHex2(tlv[2][0]) : void 0,
|
|
47
|
+
kind: tlv[3]?.[0] ? parseInt(bytesToHex2(tlv[3][0]), 16) : void 0
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
case "naddr": {
|
|
52
|
+
let tlv = parseTLV(data);
|
|
53
|
+
if (!tlv[0]?.[0])
|
|
54
|
+
throw new Error("missing TLV 0 for naddr");
|
|
55
|
+
if (!tlv[2]?.[0])
|
|
56
|
+
throw new Error("missing TLV 2 for naddr");
|
|
57
|
+
if (tlv[2][0].length !== 32)
|
|
58
|
+
throw new Error("TLV 2 should be 32 bytes");
|
|
59
|
+
if (!tlv[3]?.[0])
|
|
60
|
+
throw new Error("missing TLV 3 for naddr");
|
|
61
|
+
if (tlv[3][0].length !== 4)
|
|
62
|
+
throw new Error("TLV 3 should be 4 bytes");
|
|
63
|
+
return {
|
|
64
|
+
type: "naddr",
|
|
65
|
+
data: {
|
|
66
|
+
identifier: utf8Decoder.decode(tlv[0][0]),
|
|
67
|
+
pubkey: bytesToHex2(tlv[2][0]),
|
|
68
|
+
kind: parseInt(bytesToHex2(tlv[3][0]), 16),
|
|
69
|
+
relays: tlv[1] ? tlv[1].map((d) => utf8Decoder.decode(d)) : []
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
case "nsec":
|
|
74
|
+
return { type: prefix, data };
|
|
75
|
+
case "npub":
|
|
76
|
+
case "note":
|
|
77
|
+
return { type: prefix, data: bytesToHex2(data) };
|
|
78
|
+
default:
|
|
79
|
+
throw new Error(`unknown prefix ${prefix}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function parseTLV(data) {
|
|
83
|
+
let result = {};
|
|
84
|
+
let rest = data;
|
|
85
|
+
while (rest.length > 0) {
|
|
86
|
+
let t = rest[0];
|
|
87
|
+
let l = rest[1];
|
|
88
|
+
let v = rest.slice(2, 2 + l);
|
|
89
|
+
rest = rest.slice(2 + l);
|
|
90
|
+
if (v.length < l)
|
|
91
|
+
throw new Error(`not enough data to read on TLV ${t}`);
|
|
92
|
+
result[t] = result[t] || [];
|
|
93
|
+
result[t].push(v);
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// nip21.ts
|
|
99
|
+
var NOSTR_URI_REGEX = new RegExp(`nostr:(${BECH32_REGEX.source})`);
|
|
100
|
+
function test(value) {
|
|
101
|
+
return typeof value === "string" && new RegExp(`^${NOSTR_URI_REGEX.source}$`).test(value);
|
|
102
|
+
}
|
|
103
|
+
function parse(uri) {
|
|
104
|
+
const match = uri.match(new RegExp(`^${NOSTR_URI_REGEX.source}$`));
|
|
105
|
+
if (!match)
|
|
106
|
+
throw new Error(`Invalid Nostr URI: ${uri}`);
|
|
107
|
+
return {
|
|
108
|
+
uri: match[0],
|
|
109
|
+
value: match[1],
|
|
110
|
+
decoded: decode(match[1])
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
NOSTR_URI_REGEX,
|
|
115
|
+
parse,
|
|
116
|
+
test
|
|
117
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../nip19.ts", "../../utils.ts", "../../nip21.ts"],
|
|
4
|
+
"sourcesContent": ["import { bytesToHex, concatBytes, hexToBytes } from '@noble/hashes/utils.js'\nimport { bech32 } from '@scure/base'\n\nimport { utf8Decoder, utf8Encoder } from './utils.ts'\n\nexport type NProfile = `nprofile1${string}`\nexport type NEvent = `nevent1${string}`\nexport type NAddr = `naddr1${string}`\nexport type NSec = `nsec1${string}`\nexport type NPub = `npub1${string}`\nexport type Note = `note1${string}`\nexport type Ncryptsec = `ncryptsec1${string}`\n\nexport const NostrTypeGuard = {\n isNProfile: (value?: string | null): value is NProfile => /^nprofile1[a-z\\d]+$/.test(value || ''),\n isNEvent: (value?: string | null): value is NEvent => /^nevent1[a-z\\d]+$/.test(value || ''),\n isNAddr: (value?: string | null): value is NAddr => /^naddr1[a-z\\d]+$/.test(value || ''),\n isNSec: (value?: string | null): value is NSec => /^nsec1[a-z\\d]{58}$/.test(value || ''),\n isNPub: (value?: string | null): value is NPub => /^npub1[a-z\\d]{58}$/.test(value || ''),\n isNote: (value?: string | null): value is Note => /^note1[a-z\\d]+$/.test(value || ''),\n isNcryptsec: (value?: string | null): value is Ncryptsec => /^ncryptsec1[a-z\\d]+$/.test(value || ''),\n}\n\nexport const Bech32MaxSize = 5000\n\n/**\n * Bech32 regex.\n * @see https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32\n */\nexport const BECH32_REGEX = /[\\x21-\\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/\n\nfunction integerToUint8Array(number: number) {\n // Create a Uint8Array with enough space to hold a 32-bit integer (4 bytes).\n const uint8Array = new Uint8Array(4)\n\n // Use bitwise operations to extract the bytes.\n uint8Array[0] = (number >> 24) & 0xff // Most significant byte (MSB)\n uint8Array[1] = (number >> 16) & 0xff\n uint8Array[2] = (number >> 8) & 0xff\n uint8Array[3] = number & 0xff // Least significant byte (LSB)\n\n return uint8Array\n}\n\nexport type ProfilePointer = {\n pubkey: string // hex\n relays?: string[]\n}\n\nexport type EventPointer = {\n id: string // hex\n relays?: string[]\n author?: string\n kind?: number\n}\n\nexport type AddressPointer = {\n identifier: string\n pubkey: string\n kind: number\n relays?: string[]\n}\n\nexport function decodeNostrURI(nip19code: string): ReturnType<typeof decode> | { type: 'invalid'; data: null } {\n try {\n if (nip19code.startsWith('nostr:')) nip19code = nip19code.substring(6)\n return decode(nip19code)\n } catch (_err) {\n return { type: 'invalid', data: null }\n }\n}\n\nexport type DecodedNevent = {\n type: 'nevent'\n data: EventPointer\n}\n\nexport type DecodedNprofile = {\n type: 'nprofile'\n data: ProfilePointer\n}\n\nexport type DecodedNaddr = {\n type: 'naddr'\n data: AddressPointer\n}\n\nexport type DecodedNsec = {\n type: 'nsec'\n data: Uint8Array\n}\n\nexport type DecodedNpub = {\n type: 'npub'\n data: string\n}\n\nexport type DecodedNote = {\n type: 'note'\n data: string\n}\n\nexport type DecodedResult = DecodedNevent | DecodedNprofile | DecodedNaddr | DecodedNpub | DecodedNsec | DecodedNote\n\nexport function decode(nip19: NEvent): DecodedNevent\nexport function decode(nip19: NProfile): DecodedNprofile\nexport function decode(nip19: NAddr): DecodedNaddr\nexport function decode(nip19: NSec): DecodedNsec\nexport function decode(nip19: NPub): DecodedNpub\nexport function decode(nip19: Note): DecodedNote\nexport function decode(code: string): DecodedResult\nexport function decode(code: string): DecodedResult {\n let { prefix, words } = bech32.decode(code as `${string}1${string}`, Bech32MaxSize)\n let data = new Uint8Array(bech32.fromWords(words))\n\n switch (prefix) {\n case 'nprofile': {\n let tlv = parseTLV(data)\n if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nprofile')\n if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes')\n\n return {\n type: 'nprofile',\n data: {\n pubkey: bytesToHex(tlv[0][0]),\n relays: tlv[1] ? tlv[1].map(d => utf8Decoder.decode(d)) : [],\n },\n }\n }\n case 'nevent': {\n let tlv = parseTLV(data)\n if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nevent')\n if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes')\n if (tlv[2] && tlv[2][0].length !== 32) throw new Error('TLV 2 should be 32 bytes')\n if (tlv[3] && tlv[3][0].length !== 4) throw new Error('TLV 3 should be 4 bytes')\n\n return {\n type: 'nevent',\n data: {\n id: bytesToHex(tlv[0][0]),\n relays: tlv[1] ? tlv[1].map(d => utf8Decoder.decode(d)) : [],\n author: tlv[2]?.[0] ? bytesToHex(tlv[2][0]) : undefined,\n kind: tlv[3]?.[0] ? parseInt(bytesToHex(tlv[3][0]), 16) : undefined,\n },\n }\n }\n\n case 'naddr': {\n let tlv = parseTLV(data)\n if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for naddr')\n if (!tlv[2]?.[0]) throw new Error('missing TLV 2 for naddr')\n if (tlv[2][0].length !== 32) throw new Error('TLV 2 should be 32 bytes')\n if (!tlv[3]?.[0]) throw new Error('missing TLV 3 for naddr')\n if (tlv[3][0].length !== 4) throw new Error('TLV 3 should be 4 bytes')\n\n return {\n type: 'naddr',\n data: {\n identifier: utf8Decoder.decode(tlv[0][0]),\n pubkey: bytesToHex(tlv[2][0]),\n kind: parseInt(bytesToHex(tlv[3][0]), 16),\n relays: tlv[1] ? tlv[1].map(d => utf8Decoder.decode(d)) : [],\n },\n }\n }\n\n case 'nsec':\n return { type: prefix, data }\n\n case 'npub':\n case 'note':\n return { type: prefix, data: bytesToHex(data) }\n\n default:\n throw new Error(`unknown prefix ${prefix}`)\n }\n}\n\ntype TLV = { [t: number]: Uint8Array[] }\n\nfunction parseTLV(data: Uint8Array): TLV {\n let result: TLV = {}\n let rest = data\n while (rest.length > 0) {\n let t = rest[0]\n let l = rest[1]\n let v = rest.slice(2, 2 + l)\n rest = rest.slice(2 + l)\n if (v.length < l) throw new Error(`not enough data to read on TLV ${t}`)\n result[t] = result[t] || []\n result[t].push(v)\n }\n return result\n}\n\nexport function nsecEncode(key: Uint8Array): NSec {\n return encodeBytes('nsec', key)\n}\n\nexport function npubEncode(hex: string): NPub {\n return encodeBytes('npub', hexToBytes(hex))\n}\n\nexport function noteEncode(hex: string): Note {\n return encodeBytes('note', hexToBytes(hex))\n}\n\nfunction encodeBech32<Prefix extends string>(prefix: Prefix, data: Uint8Array): `${Prefix}1${string}` {\n let words = bech32.toWords(data)\n return bech32.encode(prefix, words, Bech32MaxSize) as `${Prefix}1${string}`\n}\n\nexport function encodeBytes<Prefix extends string>(prefix: Prefix, bytes: Uint8Array): `${Prefix}1${string}` {\n return encodeBech32(prefix, bytes)\n}\n\nexport function nprofileEncode(profile: ProfilePointer): NProfile {\n let data = encodeTLV({\n 0: [hexToBytes(profile.pubkey)],\n 1: (profile.relays || []).map(url => utf8Encoder.encode(url)),\n })\n return encodeBech32('nprofile', data)\n}\n\nexport function neventEncode(event: EventPointer): NEvent {\n let kindArray\n if (event.kind !== undefined) {\n kindArray = integerToUint8Array(event.kind)\n }\n\n let data = encodeTLV({\n 0: [hexToBytes(event.id)],\n 1: (event.relays || []).map(url => utf8Encoder.encode(url)),\n 2: event.author ? [hexToBytes(event.author)] : [],\n 3: kindArray ? [new Uint8Array(kindArray)] : [],\n })\n\n return encodeBech32('nevent', data)\n}\n\nexport function naddrEncode(addr: AddressPointer): NAddr {\n let kind = new ArrayBuffer(4)\n new DataView(kind).setUint32(0, addr.kind, false)\n\n let data = encodeTLV({\n 0: [utf8Encoder.encode(addr.identifier)],\n 1: (addr.relays || []).map(url => utf8Encoder.encode(url)),\n 2: [hexToBytes(addr.pubkey)],\n 3: [new Uint8Array(kind)],\n })\n return encodeBech32('naddr', data)\n}\n\nfunction encodeTLV(tlv: TLV): Uint8Array {\n let entries: Uint8Array[] = []\n\n Object.entries(tlv)\n .reverse()\n .forEach(([t, vs]) => {\n vs.forEach(v => {\n let entry = new Uint8Array(v.length + 2)\n entry.set([parseInt(t)], 0)\n entry.set([v.length], 1)\n entry.set(v, 2)\n entries.push(entry)\n })\n })\n\n return concatBytes(...entries)\n}\n", "import type { NostrEvent } from './core.ts'\n\nexport const utf8Decoder: TextDecoder = new TextDecoder('utf-8')\nexport const utf8Encoder: TextEncoder = new TextEncoder()\n\nexport { bytesToHex, hexToBytes } from '@noble/hashes/utils.js'\n\nexport function normalizeURL(url: string): string {\n try {\n if (url.indexOf('://') === -1) url = 'wss://' + url\n let p = new URL(url)\n if (p.protocol === 'http:') p.protocol = 'ws:'\n else if (p.protocol === 'https:') p.protocol = 'wss:'\n p.pathname = p.pathname.replace(/\\/+/g, '/')\n if (p.pathname.endsWith('/')) p.pathname = p.pathname.slice(0, -1)\n if ((p.port === '80' && p.protocol === 'ws:') || (p.port === '443' && p.protocol === 'wss:')) p.port = ''\n p.searchParams.sort()\n p.hash = ''\n return p.toString()\n } catch (e) {\n throw new Error(`Invalid URL: ${url}`)\n }\n}\n\nexport function insertEventIntoDescendingList(sortedArray: NostrEvent[], event: NostrEvent): NostrEvent[] {\n const [idx, found] = binarySearch(sortedArray, b => {\n if (event.id === b.id) return 0\n if (event.created_at === b.created_at) return -1\n return b.created_at - event.created_at\n })\n if (!found) {\n sortedArray.splice(idx, 0, event)\n }\n return sortedArray\n}\n\nexport function insertEventIntoAscendingList(sortedArray: NostrEvent[], event: NostrEvent): NostrEvent[] {\n const [idx, found] = binarySearch(sortedArray, b => {\n if (event.id === b.id) return 0\n if (event.created_at === b.created_at) return -1\n return event.created_at - b.created_at\n })\n if (!found) {\n sortedArray.splice(idx, 0, event)\n }\n return sortedArray\n}\n\nexport function binarySearch<T>(arr: T[], compare: (b: T) => number): [number, boolean] {\n let start = 0\n let end = arr.length - 1\n\n while (start <= end) {\n const mid = Math.floor((start + end) / 2)\n const cmp = compare(arr[mid])\n\n if (cmp === 0) {\n return [mid, true]\n }\n\n if (cmp < 0) {\n end = mid - 1\n } else {\n start = mid + 1\n }\n }\n\n return [start, false]\n}\n\nexport function mergeReverseSortedLists(list1: NostrEvent[], list2: NostrEvent[]): NostrEvent[] {\n const result: NostrEvent[] = new Array(list1.length + list2.length)\n result.length = 0\n let i1 = 0\n let i2 = 0\n let sameTimestampIds: string[] = []\n\n while (i1 < list1.length && i2 < list2.length) {\n let next: NostrEvent\n if (list1[i1]?.created_at > list2[i2]?.created_at) {\n next = list1[i1]\n i1++\n } else {\n next = list2[i2]\n i2++\n }\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n while (i1 < list1.length) {\n const next = list1[i1]\n i1++\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n while (i2 < list2.length) {\n const next = list2[i2]\n i2++\n\n if (result.length > 0 && result[result.length - 1].created_at === next.created_at) {\n if (sameTimestampIds.includes(next.id)) continue\n } else {\n sameTimestampIds.length = 0\n }\n result.push(next)\n sameTimestampIds.push(next.id)\n }\n\n return result\n}\n", "import { AddressPointer, BECH32_REGEX, decode, EventPointer, ProfilePointer } from './nip19.ts'\n\n/** Nostr URI regex, eg `nostr:npub1...` */\nexport const NOSTR_URI_REGEX: RegExp = new RegExp(`nostr:(${BECH32_REGEX.source})`)\n\n/** Test whether the value is a Nostr URI. */\nexport function test(value: unknown): value is `nostr:${string}` {\n return typeof value === 'string' && new RegExp(`^${NOSTR_URI_REGEX.source}$`).test(value)\n}\n\n/** Parsed Nostr URI data. */\nexport interface NostrURI {\n /** Full URI including the `nostr:` protocol. */\n uri: `nostr:${string}`\n /** The bech32-encoded data (eg `npub1...`). */\n value: string\n /** Decoded bech32 string, according to NIP-19. */\n decoded:\n | {\n type: 'nevent'\n data: EventPointer\n }\n | {\n type: 'nprofile'\n data: ProfilePointer\n }\n | {\n type: 'naddr'\n data: AddressPointer\n }\n | {\n type: 'npub'\n data: string\n }\n | {\n type: 'nsec'\n data: Uint8Array\n }\n | {\n type: 'note'\n data: string\n }\n}\n\n/** Parse and decode a Nostr URI. */\nexport function parse(uri: string): NostrURI {\n const match = uri.match(new RegExp(`^${NOSTR_URI_REGEX.source}$`))\n if (!match) throw new Error(`Invalid Nostr URI: ${uri}`)\n return {\n uri: match[0] as `nostr:${string}`,\n value: match[1],\n decoded: decode(match[1]),\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,cAAAA,aAAY,aAAa,cAAAC,mBAAkB;AACpD,SAAS,cAAc;;;ACIvB,SAAS,YAAY,kBAAkB;AAHhC,IAAM,cAA2B,IAAI,YAAY,OAAO;AACxD,IAAM,cAA2B,IAAI,YAAY;;;ADoBjD,IAAM,gBAAgB;AAMtB,IAAM,eAAe;AAkFrB,SAAS,OAAO,MAA6B;AAClD,MAAI,EAAE,QAAQ,MAAM,IAAI,OAAO,OAAO,MAA+B,aAAa;AAClF,MAAI,OAAO,IAAI,WAAW,OAAO,UAAU,KAAK,CAAC;AAEjD,UAAQ,QAAQ;AAAA,IACd,KAAK,YAAY;AACf,UAAI,MAAM,SAAS,IAAI;AACvB,UAAI,CAAC,IAAI,KAAK;AAAI,cAAM,IAAI,MAAM,4BAA4B;AAC9D,UAAI,IAAI,GAAG,GAAG,WAAW;AAAI,cAAM,IAAI,MAAM,0BAA0B;AAEvE,aAAO;AAAA,QACL,MAAM;AAAA,QACN,MAAM;AAAA,UACJ,QAAQC,YAAW,IAAI,GAAG,EAAE;AAAA,UAC5B,QAAQ,IAAI,KAAK,IAAI,GAAG,IAAI,OAAK,YAAY,OAAO,CAAC,CAAC,IAAI,CAAC;AAAA,QAC7D;AAAA,MACF;AAAA,IACF;AAAA,IACA,KAAK,UAAU;AACb,UAAI,MAAM,SAAS,IAAI;AACvB,UAAI,CAAC,IAAI,KAAK;AAAI,cAAM,IAAI,MAAM,0BAA0B;AAC5D,UAAI,IAAI,GAAG,GAAG,WAAW;AAAI,cAAM,IAAI,MAAM,0BAA0B;AACvE,UAAI,IAAI,MAAM,IAAI,GAAG,GAAG,WAAW;AAAI,cAAM,IA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