@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,82 @@
|
|
|
1
|
+
// nip55.ts
|
|
2
|
+
function encodeParams(params) {
|
|
3
|
+
return new URLSearchParams(params).toString();
|
|
4
|
+
}
|
|
5
|
+
function filterUndefined(obj) {
|
|
6
|
+
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== void 0));
|
|
7
|
+
}
|
|
8
|
+
function buildUri({
|
|
9
|
+
base,
|
|
10
|
+
type,
|
|
11
|
+
callbackUrl,
|
|
12
|
+
returnType = "signature",
|
|
13
|
+
compressionType = "none",
|
|
14
|
+
...params
|
|
15
|
+
}) {
|
|
16
|
+
const baseParams = {
|
|
17
|
+
type,
|
|
18
|
+
compressionType,
|
|
19
|
+
returnType,
|
|
20
|
+
callbackUrl,
|
|
21
|
+
id: params.id,
|
|
22
|
+
current_user: params.currentUser,
|
|
23
|
+
permissions: params.permissions && params.permissions.length > 0 ? encodeURIComponent(JSON.stringify(params.permissions)) : void 0,
|
|
24
|
+
pubKey: params.pubKey,
|
|
25
|
+
plainText: params.plainText,
|
|
26
|
+
encryptedText: params.encryptedText,
|
|
27
|
+
appName: params.appName
|
|
28
|
+
};
|
|
29
|
+
const filteredParams = filterUndefined(baseParams);
|
|
30
|
+
return `${base}?${encodeParams(filteredParams)}`;
|
|
31
|
+
}
|
|
32
|
+
function buildDefaultUri(type, params) {
|
|
33
|
+
return buildUri({
|
|
34
|
+
base: "nostrsigner:",
|
|
35
|
+
type,
|
|
36
|
+
...params
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function getPublicKeyUri({ permissions = [], ...params }) {
|
|
40
|
+
return buildDefaultUri("get_public_key", { permissions, ...params });
|
|
41
|
+
}
|
|
42
|
+
function signEventUri({ eventJson, ...params }) {
|
|
43
|
+
return buildUri({
|
|
44
|
+
base: `nostrsigner:${encodeURIComponent(JSON.stringify(eventJson))}`,
|
|
45
|
+
type: "sign_event",
|
|
46
|
+
...params
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function encryptUri(type, params) {
|
|
50
|
+
return buildDefaultUri(type, { ...params, plainText: params.content });
|
|
51
|
+
}
|
|
52
|
+
function decryptUri(type, params) {
|
|
53
|
+
return buildDefaultUri(type, { ...params, encryptedText: params.content });
|
|
54
|
+
}
|
|
55
|
+
function encryptNip04Uri(params) {
|
|
56
|
+
return encryptUri("nip04_encrypt", params);
|
|
57
|
+
}
|
|
58
|
+
function decryptNip04Uri(params) {
|
|
59
|
+
return decryptUri("nip04_decrypt", params);
|
|
60
|
+
}
|
|
61
|
+
function encryptNip44Uri(params) {
|
|
62
|
+
return encryptUri("nip44_encrypt", params);
|
|
63
|
+
}
|
|
64
|
+
function decryptNip44Uri(params) {
|
|
65
|
+
return decryptUri("nip44_decrypt", params);
|
|
66
|
+
}
|
|
67
|
+
function decryptZapEventUri({ eventJson, ...params }) {
|
|
68
|
+
return buildUri({
|
|
69
|
+
base: `nostrsigner:${encodeURIComponent(JSON.stringify(eventJson))}`,
|
|
70
|
+
type: "decrypt_zap_event",
|
|
71
|
+
...params
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
decryptNip04Uri,
|
|
76
|
+
decryptNip44Uri,
|
|
77
|
+
decryptZapEventUri,
|
|
78
|
+
encryptNip04Uri,
|
|
79
|
+
encryptNip44Uri,
|
|
80
|
+
getPublicKeyUri,
|
|
81
|
+
signEventUri
|
|
82
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../nip55.ts"],
|
|
4
|
+
"sourcesContent": ["type BaseParams = {\n callbackUrl?: string\n returnType?: 'signature' | 'event'\n compressionType?: 'none' | 'gzip'\n}\n\ntype PermissionsParams = BaseParams & {\n permissions?: { type: string; kind?: number }[]\n}\n\ntype EventUriParams = BaseParams & {\n eventJson: Record<string, unknown>\n id?: string\n currentUser?: string\n}\n\ntype EncryptDecryptParams = BaseParams & {\n pubKey: string\n content: string\n id?: string\n currentUser?: string\n}\n\ntype UriParams = BaseParams & {\n base: string\n type: string\n id?: string\n currentUser?: string\n permissions?: { type: string; kind?: number }[]\n pubKey?: string\n plainText?: string\n encryptedText?: string\n appName?: string\n}\n\nfunction encodeParams(params: Record<string, unknown>): string {\n return new URLSearchParams(params as Record<string, string>).toString()\n}\n\nfunction filterUndefined<T extends Record<string, unknown>>(obj: T): T {\n return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined)) as T\n}\n\nfunction buildUri({\n base,\n type,\n callbackUrl,\n returnType = 'signature',\n compressionType = 'none',\n ...params\n}: UriParams): string {\n const baseParams = {\n type,\n compressionType,\n returnType,\n callbackUrl,\n id: params.id,\n current_user: params.currentUser,\n permissions:\n params.permissions && params.permissions.length > 0\n ? encodeURIComponent(JSON.stringify(params.permissions))\n : undefined,\n pubKey: params.pubKey,\n plainText: params.plainText,\n encryptedText: params.encryptedText,\n appName: params.appName,\n }\n\n const filteredParams = filterUndefined(baseParams)\n return `${base}?${encodeParams(filteredParams)}`\n}\n\nfunction buildDefaultUri(type: string, params: Partial<UriParams>): string {\n return buildUri({\n base: 'nostrsigner:',\n type,\n ...params,\n })\n}\n\nexport function getPublicKeyUri({ permissions = [], ...params }: PermissionsParams): string {\n return buildDefaultUri('get_public_key', { permissions, ...params })\n}\n\nexport function signEventUri({ eventJson, ...params }: EventUriParams): string {\n return buildUri({\n base: `nostrsigner:${encodeURIComponent(JSON.stringify(eventJson))}`,\n type: 'sign_event',\n ...params,\n })\n}\n\nfunction encryptUri(type: 'nip44_encrypt' | 'nip04_encrypt', params: EncryptDecryptParams): string {\n return buildDefaultUri(type, { ...params, plainText: params.content })\n}\n\nfunction decryptUri(type: 'nip44_decrypt' | 'nip04_decrypt', params: EncryptDecryptParams): string {\n return buildDefaultUri(type, { ...params, encryptedText: params.content })\n}\n\nexport function encryptNip04Uri(params: EncryptDecryptParams): string {\n return encryptUri('nip04_encrypt', params)\n}\n\nexport function decryptNip04Uri(params: EncryptDecryptParams): string {\n return decryptUri('nip04_decrypt', params)\n}\n\nexport function encryptNip44Uri(params: EncryptDecryptParams): string {\n return encryptUri('nip44_encrypt', params)\n}\n\nexport function decryptNip44Uri(params: EncryptDecryptParams): string {\n return decryptUri('nip44_decrypt', params)\n}\n\nexport function decryptZapEventUri({ eventJson, ...params }: EventUriParams): string {\n return buildUri({\n base: `nostrsigner:${encodeURIComponent(JSON.stringify(eventJson))}`,\n type: 'decrypt_zap_event',\n ...params,\n })\n}\n"],
|
|
5
|
+
"mappings": ";AAmCA,SAAS,aAAa,QAAyC;AAC7D,SAAO,IAAI,gBAAgB,MAAgC,EAAE,SAAS;AACxE;AAEA,SAAS,gBAAmD,KAAW;AACrE,SAAO,OAAO,YAAY,OAAO,QAAQ,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,MAAS,CAAC;AAC1F;AAEA,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,kBAAkB;AAAA,KACf;AACL,GAAsB;AACpB,QAAM,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,IAAI,OAAO;AAAA,IACX,cAAc,OAAO;AAAA,IACrB,aACE,OAAO,eAAe,OAAO,YAAY,SAAS,IAC9C,mBAAmB,KAAK,UAAU,OAAO,WAAW,CAAC,IACrD;AAAA,IACN,QAAQ,OAAO;AAAA,IACf,WAAW,OAAO;AAAA,IAClB,eAAe,OAAO;AAAA,IACtB,SAAS,OAAO;AAAA,EAClB;AAEA,QAAM,iBAAiB,gBAAgB,UAAU;AACjD,SAAO,GAAG,QAAQ,aAAa,cAAc;AAC/C;AAEA,SAAS,gBAAgB,MAAc,QAAoC;AACzE,SAAO,SAAS;AAAA,IACd,MAAM;AAAA,IACN;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;AAEO,SAAS,gBAAgB,EAAE,cAAc,CAAC,MAAM,OAAO,GAA8B;AAC1F,SAAO,gBAAgB,kBAAkB,EAAE,aAAa,GAAG,OAAO,CAAC;AACrE;AAEO,SAAS,aAAa,EAAE,cAAc,OAAO,GAA2B;AAC7E,SAAO,SAAS;AAAA,IACd,MAAM,eAAe,mBAAmB,KAAK,UAAU,SAAS,CAAC;AAAA,IACjE,MAAM;AAAA,IACN,GAAG;AAAA,EACL,CAAC;AACH;AAEA,SAAS,WAAW,MAAyC,QAAsC;AACjG,SAAO,gBAAgB,MAAM,EAAE,GAAG,QAAQ,WAAW,OAAO,QAAQ,CAAC;AACvE;AAEA,SAAS,WAAW,MAAyC,QAAsC;AACjG,SAAO,gBAAgB,MAAM,EAAE,GAAG,QAAQ,eAAe,OAAO,QAAQ,CAAC;AAC3E;AAEO,SAAS,gBAAgB,QAAsC;AACpE,SAAO,WAAW,iBAAiB,MAAM;AAC3C;AAEO,SAAS,gBAAgB,QAAsC;AACpE,SAAO,WAAW,iBAAiB,MAAM;AAC3C;AAEO,SAAS,gBAAgB,QAAsC;AACpE,SAAO,WAAW,iBAAiB,MAAM;AAC3C;AAEO,SAAS,gBAAgB,QAAsC;AACpE,SAAO,WAAW,iBAAiB,MAAM;AAC3C;AAEO,SAAS,mBAAmB,EAAE,cAAc,OAAO,GAA2B;AACnF,SAAO,SAAS;AAAA,IACd,MAAM,eAAe,mBAAmB,KAAK,UAAU,SAAS,CAAC;AAAA,IACjE,MAAM;AAAA,IACN,GAAG;AAAA,EACL,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// nip57.ts
|
|
2
|
+
import { bech32 } from "@scure/base";
|
|
3
|
+
|
|
4
|
+
// pure.ts
|
|
5
|
+
import { schnorr } from "@noble/curves/secp256k1.js";
|
|
6
|
+
import { bytesToHex as bytesToHex2, hexToBytes as hexToBytes2 } from "@noble/hashes/utils.js";
|
|
7
|
+
|
|
8
|
+
// core.ts
|
|
9
|
+
var verifiedSymbol = Symbol("verified");
|
|
10
|
+
var isRecord = (obj) => obj instanceof Object;
|
|
11
|
+
function validateEvent(event) {
|
|
12
|
+
if (!isRecord(event))
|
|
13
|
+
return false;
|
|
14
|
+
if (typeof event.kind !== "number")
|
|
15
|
+
return false;
|
|
16
|
+
if (typeof event.content !== "string")
|
|
17
|
+
return false;
|
|
18
|
+
if (typeof event.created_at !== "number")
|
|
19
|
+
return false;
|
|
20
|
+
if (typeof event.pubkey !== "string")
|
|
21
|
+
return false;
|
|
22
|
+
if (!event.pubkey.match(/^[a-f0-9]{64}$/))
|
|
23
|
+
return false;
|
|
24
|
+
if (!Array.isArray(event.tags))
|
|
25
|
+
return false;
|
|
26
|
+
for (let i2 = 0; i2 < event.tags.length; i2++) {
|
|
27
|
+
let tag = event.tags[i2];
|
|
28
|
+
if (!Array.isArray(tag))
|
|
29
|
+
return false;
|
|
30
|
+
for (let j = 0; j < tag.length; j++) {
|
|
31
|
+
if (typeof tag[j] !== "string")
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// pure.ts
|
|
39
|
+
import { sha256 } from "@noble/hashes/sha2.js";
|
|
40
|
+
|
|
41
|
+
// utils.ts
|
|
42
|
+
import { bytesToHex, hexToBytes } from "@noble/hashes/utils.js";
|
|
43
|
+
var utf8Decoder = new TextDecoder("utf-8");
|
|
44
|
+
var utf8Encoder = new TextEncoder();
|
|
45
|
+
|
|
46
|
+
// pure.ts
|
|
47
|
+
var JS = class {
|
|
48
|
+
generateSecretKey() {
|
|
49
|
+
return schnorr.utils.randomSecretKey();
|
|
50
|
+
}
|
|
51
|
+
getPublicKey(secretKey) {
|
|
52
|
+
return bytesToHex2(schnorr.getPublicKey(secretKey));
|
|
53
|
+
}
|
|
54
|
+
finalizeEvent(t, secretKey) {
|
|
55
|
+
const event = t;
|
|
56
|
+
event.pubkey = bytesToHex2(schnorr.getPublicKey(secretKey));
|
|
57
|
+
event.id = getEventHash(event);
|
|
58
|
+
event.sig = bytesToHex2(schnorr.sign(hexToBytes2(getEventHash(event)), secretKey));
|
|
59
|
+
event[verifiedSymbol] = true;
|
|
60
|
+
return event;
|
|
61
|
+
}
|
|
62
|
+
verifyEvent(event) {
|
|
63
|
+
if (typeof event[verifiedSymbol] === "boolean")
|
|
64
|
+
return event[verifiedSymbol];
|
|
65
|
+
try {
|
|
66
|
+
const hash = getEventHash(event);
|
|
67
|
+
if (hash !== event.id) {
|
|
68
|
+
event[verifiedSymbol] = false;
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const valid = schnorr.verify(hexToBytes2(event.sig), hexToBytes2(hash), hexToBytes2(event.pubkey));
|
|
72
|
+
event[verifiedSymbol] = valid;
|
|
73
|
+
return valid;
|
|
74
|
+
} catch (err) {
|
|
75
|
+
event[verifiedSymbol] = false;
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
function serializeEvent(evt) {
|
|
81
|
+
if (!validateEvent(evt))
|
|
82
|
+
throw new Error("can't serialize event with wrong or missing properties");
|
|
83
|
+
return JSON.stringify([0, evt.pubkey, evt.created_at, evt.kind, evt.tags, evt.content]);
|
|
84
|
+
}
|
|
85
|
+
function getEventHash(event) {
|
|
86
|
+
let eventHash = sha256(utf8Encoder.encode(serializeEvent(event)));
|
|
87
|
+
return bytesToHex2(eventHash);
|
|
88
|
+
}
|
|
89
|
+
var i = new JS();
|
|
90
|
+
var generateSecretKey = i.generateSecretKey;
|
|
91
|
+
var getPublicKey = i.getPublicKey;
|
|
92
|
+
var finalizeEvent = i.finalizeEvent;
|
|
93
|
+
var verifyEvent = i.verifyEvent;
|
|
94
|
+
|
|
95
|
+
// kinds.ts
|
|
96
|
+
function isReplaceableKind(kind) {
|
|
97
|
+
return kind === 0 || kind === 3 || 1e4 <= kind && kind < 2e4;
|
|
98
|
+
}
|
|
99
|
+
function isAddressableKind(kind) {
|
|
100
|
+
return 3e4 <= kind && kind < 4e4;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// nip57.ts
|
|
104
|
+
var _fetch;
|
|
105
|
+
try {
|
|
106
|
+
_fetch = fetch;
|
|
107
|
+
} catch {
|
|
108
|
+
}
|
|
109
|
+
function useFetchImplementation(fetchImplementation) {
|
|
110
|
+
_fetch = fetchImplementation;
|
|
111
|
+
}
|
|
112
|
+
async function getZapEndpoint(metadata) {
|
|
113
|
+
try {
|
|
114
|
+
let lnurl = "";
|
|
115
|
+
let { lud06, lud16 } = JSON.parse(metadata.content);
|
|
116
|
+
if (lud16) {
|
|
117
|
+
let [name, domain] = lud16.split("@");
|
|
118
|
+
lnurl = new URL(`/.well-known/lnurlp/${name}`, `https://${domain}`).toString();
|
|
119
|
+
} else if (lud06) {
|
|
120
|
+
let { words } = bech32.decode(lud06, 1e3);
|
|
121
|
+
let data = bech32.fromWords(words);
|
|
122
|
+
lnurl = utf8Decoder.decode(data);
|
|
123
|
+
} else {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
let res = await _fetch(lnurl);
|
|
127
|
+
let body = await res.json();
|
|
128
|
+
if (body.allowsNostr && body.nostrPubkey) {
|
|
129
|
+
return body.callback;
|
|
130
|
+
}
|
|
131
|
+
} catch (err) {
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
function makeZapRequest(params) {
|
|
136
|
+
let zr = {
|
|
137
|
+
kind: 9734,
|
|
138
|
+
created_at: Math.round(Date.now() / 1e3),
|
|
139
|
+
content: params.comment || "",
|
|
140
|
+
tags: [
|
|
141
|
+
["p", "pubkey" in params ? params.pubkey : params.event.pubkey],
|
|
142
|
+
["amount", params.amount.toString()],
|
|
143
|
+
["relays", ...params.relays]
|
|
144
|
+
]
|
|
145
|
+
};
|
|
146
|
+
if ("event" in params) {
|
|
147
|
+
zr.tags.push(["e", params.event.id]);
|
|
148
|
+
if (isReplaceableKind(params.event.kind)) {
|
|
149
|
+
const a = ["a", `${params.event.kind}:${params.event.pubkey}:`];
|
|
150
|
+
zr.tags.push(a);
|
|
151
|
+
} else if (isAddressableKind(params.event.kind)) {
|
|
152
|
+
let d = params.event.tags.find(([t, v]) => t === "d" && v);
|
|
153
|
+
if (!d)
|
|
154
|
+
throw new Error("d tag not found or is empty");
|
|
155
|
+
const a = ["a", `${params.event.kind}:${params.event.pubkey}:${d[1]}`];
|
|
156
|
+
zr.tags.push(a);
|
|
157
|
+
}
|
|
158
|
+
zr.tags.push(["k", params.event.kind.toString()]);
|
|
159
|
+
}
|
|
160
|
+
return zr;
|
|
161
|
+
}
|
|
162
|
+
function validateZapRequest(zapRequestString) {
|
|
163
|
+
let zapRequest;
|
|
164
|
+
try {
|
|
165
|
+
zapRequest = JSON.parse(zapRequestString);
|
|
166
|
+
} catch (err) {
|
|
167
|
+
return "Invalid zap request JSON.";
|
|
168
|
+
}
|
|
169
|
+
if (!validateEvent(zapRequest))
|
|
170
|
+
return "Zap request is not a valid Nostr event.";
|
|
171
|
+
if (!verifyEvent(zapRequest))
|
|
172
|
+
return "Invalid signature on zap request.";
|
|
173
|
+
let p = zapRequest.tags.find(([t, v]) => t === "p" && v);
|
|
174
|
+
if (!p)
|
|
175
|
+
return "Zap request doesn't have a 'p' tag.";
|
|
176
|
+
if (!p[1].match(/^[a-f0-9]{64}$/))
|
|
177
|
+
return "Zap request 'p' tag is not valid hex.";
|
|
178
|
+
let e = zapRequest.tags.find(([t, v]) => t === "e" && v);
|
|
179
|
+
if (e && !e[1].match(/^[a-f0-9]{64}$/))
|
|
180
|
+
return "Zap request 'e' tag is not valid hex.";
|
|
181
|
+
let relays = zapRequest.tags.find(([t, v]) => t === "relays" && v);
|
|
182
|
+
if (!relays)
|
|
183
|
+
return "Zap request doesn't have a 'relays' tag.";
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
function makeZapReceipt({
|
|
187
|
+
zapRequest,
|
|
188
|
+
preimage,
|
|
189
|
+
bolt11,
|
|
190
|
+
paidAt
|
|
191
|
+
}) {
|
|
192
|
+
let zr = JSON.parse(zapRequest);
|
|
193
|
+
let tagsFromZapRequest = zr.tags.filter(([t]) => t === "e" || t === "p" || t === "a");
|
|
194
|
+
let zap = {
|
|
195
|
+
kind: 9735,
|
|
196
|
+
created_at: Math.round(paidAt.getTime() / 1e3),
|
|
197
|
+
content: "",
|
|
198
|
+
tags: [...tagsFromZapRequest, ["P", zr.pubkey], ["bolt11", bolt11], ["description", zapRequest]]
|
|
199
|
+
};
|
|
200
|
+
if (preimage) {
|
|
201
|
+
zap.tags.push(["preimage", preimage]);
|
|
202
|
+
}
|
|
203
|
+
return zap;
|
|
204
|
+
}
|
|
205
|
+
function getSatoshisAmountFromBolt11(bolt11) {
|
|
206
|
+
if (bolt11.length < 50) {
|
|
207
|
+
return 0;
|
|
208
|
+
}
|
|
209
|
+
bolt11 = bolt11.substring(0, 50);
|
|
210
|
+
const idx = bolt11.lastIndexOf("1");
|
|
211
|
+
if (idx === -1) {
|
|
212
|
+
return 0;
|
|
213
|
+
}
|
|
214
|
+
const hrp = bolt11.substring(0, idx);
|
|
215
|
+
if (!hrp.startsWith("lnbc")) {
|
|
216
|
+
return 0;
|
|
217
|
+
}
|
|
218
|
+
const amount = hrp.substring(4);
|
|
219
|
+
if (amount.length < 1) {
|
|
220
|
+
return 0;
|
|
221
|
+
}
|
|
222
|
+
const char = amount[amount.length - 1];
|
|
223
|
+
const digit = char.charCodeAt(0) - "0".charCodeAt(0);
|
|
224
|
+
const isDigit = digit >= 0 && digit <= 9;
|
|
225
|
+
let cutPoint = amount.length - 1;
|
|
226
|
+
if (isDigit) {
|
|
227
|
+
cutPoint++;
|
|
228
|
+
}
|
|
229
|
+
if (cutPoint < 1) {
|
|
230
|
+
return 0;
|
|
231
|
+
}
|
|
232
|
+
const num = parseInt(amount.substring(0, cutPoint));
|
|
233
|
+
switch (char) {
|
|
234
|
+
case "m":
|
|
235
|
+
return num * 1e5;
|
|
236
|
+
case "u":
|
|
237
|
+
return num * 100;
|
|
238
|
+
case "n":
|
|
239
|
+
return num / 10;
|
|
240
|
+
case "p":
|
|
241
|
+
return num / 1e4;
|
|
242
|
+
default:
|
|
243
|
+
return num * 1e8;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
export {
|
|
247
|
+
getSatoshisAmountFromBolt11,
|
|
248
|
+
getZapEndpoint,
|
|
249
|
+
makeZapReceipt,
|
|
250
|
+
makeZapRequest,
|
|
251
|
+
useFetchImplementation,
|
|
252
|
+
validateZapRequest
|
|
253
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../nip57.ts", "../../pure.ts", "../../core.ts", "../../utils.ts", "../../kinds.ts"],
|
|
4
|
+
"sourcesContent": ["import { bech32 } from '@scure/base'\n\nimport { NostrEvent, validateEvent, verifyEvent, type Event, type EventTemplate } from './pure.ts'\nimport { utf8Decoder } from './utils.ts'\nimport { isReplaceableKind, isAddressableKind } from './kinds.ts'\n\nvar _fetch: any\n\ntry {\n _fetch = fetch\n} catch {}\n\nexport function useFetchImplementation(fetchImplementation: any) {\n _fetch = fetchImplementation\n}\n\nexport async function getZapEndpoint(metadata: Event): Promise<null | string> {\n try {\n let lnurl: string = ''\n let { lud06, lud16 } = JSON.parse(metadata.content)\n if (lud16) {\n let [name, domain] = lud16.split('@')\n lnurl = new URL(`/.well-known/lnurlp/${name}`, `https://${domain}`).toString()\n } else if (lud06) {\n let { words } = bech32.decode(lud06, 1000)\n let data = bech32.fromWords(words)\n lnurl = utf8Decoder.decode(data)\n } else {\n return null\n }\n\n let res = await _fetch(lnurl)\n let body = await res.json()\n\n if (body.allowsNostr && body.nostrPubkey) {\n return body.callback\n }\n } catch (err) {\n /*-*/\n }\n\n return null\n}\n\ntype ProfileZap = {\n pubkey: string\n amount: number\n comment?: string\n relays: string[]\n}\n\ntype EventZap = {\n event: NostrEvent\n amount: number\n comment?: string\n relays: string[]\n}\n\nexport function makeZapRequest(params: ProfileZap | EventZap): EventTemplate {\n let zr: EventTemplate = {\n kind: 9734,\n created_at: Math.round(Date.now() / 1000),\n content: params.comment || '',\n tags: [\n ['p', 'pubkey' in params ? params.pubkey : params.event.pubkey],\n ['amount', params.amount.toString()],\n ['relays', ...params.relays],\n ],\n }\n\n if ('event' in params) {\n zr.tags.push(['e', params.event.id])\n if (isReplaceableKind(params.event.kind)) {\n const a = ['a', `${params.event.kind}:${params.event.pubkey}:`]\n zr.tags.push(a)\n } else if (isAddressableKind(params.event.kind)) {\n let d = params.event.tags.find(([t, v]) => t === 'd' && v)\n if (!d) throw new Error('d tag not found or is empty')\n const a = ['a', `${params.event.kind}:${params.event.pubkey}:${d[1]}`]\n zr.tags.push(a)\n }\n zr.tags.push(['k', params.event.kind.toString()])\n }\n\n return zr\n}\n\nexport function validateZapRequest(zapRequestString: string): string | null {\n let zapRequest: Event\n\n try {\n zapRequest = JSON.parse(zapRequestString)\n } catch (err) {\n return 'Invalid zap request JSON.'\n }\n\n if (!validateEvent(zapRequest)) return 'Zap request is not a valid Nostr event.'\n\n if (!verifyEvent(zapRequest)) return 'Invalid signature on zap request.'\n\n let p = zapRequest.tags.find(([t, v]) => t === 'p' && v)\n if (!p) return \"Zap request doesn't have a 'p' tag.\"\n if (!p[1].match(/^[a-f0-9]{64}$/)) return \"Zap request 'p' tag is not valid hex.\"\n\n let e = zapRequest.tags.find(([t, v]) => t === 'e' && v)\n if (e && !e[1].match(/^[a-f0-9]{64}$/)) return \"Zap request 'e' tag is not valid hex.\"\n\n let relays = zapRequest.tags.find(([t, v]) => t === 'relays' && v)\n if (!relays) return \"Zap request doesn't have a 'relays' tag.\"\n\n return null\n}\n\nexport function makeZapReceipt({\n zapRequest,\n preimage,\n bolt11,\n paidAt,\n}: {\n zapRequest: string\n preimage?: string\n bolt11: string\n paidAt: Date\n}): EventTemplate {\n let zr: Event = JSON.parse(zapRequest)\n let tagsFromZapRequest = zr.tags.filter(([t]) => t === 'e' || t === 'p' || t === 'a')\n\n let zap: EventTemplate = {\n kind: 9735,\n created_at: Math.round(paidAt.getTime() / 1000),\n content: '',\n tags: [...tagsFromZapRequest, ['P', zr.pubkey], ['bolt11', bolt11], ['description', zapRequest]],\n }\n\n if (preimage) {\n zap.tags.push(['preimage', preimage])\n }\n\n return zap\n}\n\nexport function getSatoshisAmountFromBolt11(bolt11: string): number {\n if (bolt11.length < 50) {\n return 0\n }\n bolt11 = bolt11.substring(0, 50)\n const idx = bolt11.lastIndexOf('1')\n if (idx === -1) {\n return 0\n }\n const hrp = bolt11.substring(0, idx)\n if (!hrp.startsWith('lnbc')) {\n return 0\n }\n const amount = hrp.substring(4) // equivalent to strings.CutPrefix\n\n if (amount.length < 1) {\n return 0\n }\n\n // if last character is a digit, then the amount can just be interpreted as BTC\n const char = amount[amount.length - 1]\n const digit = char.charCodeAt(0) - '0'.charCodeAt(0)\n const isDigit = digit >= 0 && digit <= 9\n\n let cutPoint = amount.length - 1\n if (isDigit) {\n cutPoint++\n }\n\n if (cutPoint < 1) {\n return 0\n }\n\n const num = parseInt(amount.substring(0, cutPoint))\n\n switch (char) {\n case 'm':\n return num * 100000\n case 'u':\n return num * 100\n case 'n':\n return num / 10\n case 'p':\n return num / 10000\n default:\n return num * 100000000\n }\n}\n", "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"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,cAAc;;;ACAvB,SAAS,eAAe;AACxB,SAAS,cAAAA,aAAY,cAAAC,mBAAkB;;;ACOhC,IAAM,iBAAiB,OAAO,UAAU;AAsB/C,IAAM,WAAW,CAAC,QAAiD,eAAe;AAE3E,SAAS,cAAiB,OAAsC;AACrE,MAAI,CAAC,SAAS,KAAK;AAAG,WAAO;AAC7B,MAAI,OAAO,MAAM,SAAS;AAAU,WAAO;AAC3C,MAAI,OAAO,MAAM,YAAY;AAAU,WAAO;AAC9C,MAAI,OAAO,MAAM,eAAe;AAAU,WAAO;AACjD,MAAI,OAAO,MAAM,WAAW;AAAU,WAAO;AAC7C,MAAI,CAAC,MAAM,OAAO,MAAM,gBAAgB;AAAG,WAAO;AAElD,MAAI,CAAC,MAAM,QAAQ,MAAM,IAAI;AAAG,WAAO;AACvC,WAASC,KAAI,GAAGA,KAAI,MAAM,KAAK,QAAQA,MAAK;AAC1C,QAAI,MAAM,MAAM,KAAKA;AACrB,QAAI,CAAC,MAAM,QAAQ,GAAG;AAAG,aAAO;AAChC,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,UAAI,OAAO,IAAI,OAAO;AAAU,eAAO;AAAA,IACzC;AAAA,EACF;AAEA,SAAO;AACT;;;AD/CA,SAAS,cAAc;;;AEEvB,SAAS,YAAY,kBAAkB;AAHhC,IAAM,cAA2B,IAAI,YAAY,OAAO;AACxD,IAAM,cAA2B,IAAI,YAAY;;;AFIxD,IAAM,KAAN,MAA0B;AAAA,EACxB,oBAAgC;AAC9B,WAAO,QAAQ,MAAM,gBAAgB;AAAA,EACvC;AAAA,EACA,aAAa,WAA+B;AAC1C,WAAOC,YAAW,QAAQ,aAAa,SAAS,CAAC;AAAA,EACnD;AAAA,EACA,cAAc,GAAkB,WAAsC;AACpE,UAAM,QAAQ;AACd,UAAM,SAASA,YAAW,QAAQ,aAAa,SAAS,CAAC;AACzD,UAAM,KAAK,aAAa,KAAK;AAC7B,UAAM,MAAMA,YAAW,QAAQ,KAAKC,YAAW,aAAa,KAAK,CAAC,GAAG,SAAS,CAAC;AAC/E,UAAM,kBAAkB;AACxB,WAAO;AAAA,EACT;AAAA,EACA,YAAY,OAAsC;AAChD,QAAI,OAAO,MAAM,oBAAoB;AAAW,aAAO,MAAM;AAE7D,QAAI;AACF,YAAM,OAAO,aAAa,KAAK;AAC/B,UAAI,SAAS,MAAM,IAAI;AACrB,cAAM,kBAAkB;AACxB,eAAO;AAAA,MACT;AAEA,YAAM,QAAQ,QAAQ,OAAOA,YAAW,MAAM,GAAG,GAAGA,YAAW,IAAI,GAAGA,YAAW,MAAM,MAAM,CAAC;AAC9F,YAAM,kBAAkB;AACxB,aAAO;AAAA,IACT,SAAS,KAAP;AACA,YAAM,kBAAkB;AACxB,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEO,SAAS,eAAe,KAA4B;AACzD,MAAI,CAAC,cAAc,GAAG;AAAG,UAAM,IAAI,MAAM,wDAAwD;AACjG,SAAO,KAAK,UAAU,CAAC,GAAG,IAAI,QAAQ,IAAI,YAAY,IAAI,MAAM,IAAI,MAAM,IAAI,OAAO,CAAC;AACxF;AAEO,SAAS,aAAa,OAA8B;AACzD,MAAI,YAAY,OAAO,YAAY,OAAO,eAAe,KAAK,CAAC,CAAC;AAChE,SAAOD,YAAW,SAAS;AAC7B;AAEA,IAAM,IAAQ,IAAI,GAAG;AAEd,IAAM,oBAAoB,EAAE;AAC5B,IAAM,eAAe,EAAE;AACvB,IAAM,gBAAgB,EAAE;AACxB,IAAM,cAAc,EAAE;;;AGjDtB,SAAS,kBAAkB,MAAuB;AACvD,SAAO,SAAS,KAAK,SAAS,KAAM,OAAS,QAAQ,OAAO;AAC9D;AAQO,SAAS,kBAAkB,MAAuB;AACvD,SAAO,OAAS,QAAQ,OAAO;AACjC;;;AJdA,IAAI;AAEJ,IAAI;AACF,WAAS;AACX,QAAE;AAAO;AAEF,SAAS,uBAAuB,qBAA0B;AAC/D,WAAS;AACX;AAEA,eAAsB,eAAe,UAAyC;AAC5E,MAAI;AACF,QAAI,QAAgB;AACpB,QAAI,EAAE,OAAO,MAAM,IAAI,KAAK,MAAM,SAAS,OAAO;AAClD,QAAI,OAAO;AACT,UAAI,CAAC,MAAM,MAAM,IAAI,MAAM,MAAM,GAAG;AACpC,cAAQ,IAAI,IAAI,uBAAuB,QAAQ,WAAW,QAAQ,EAAE,SAAS;AAAA,IAC/E,WAAW,OAAO;AAChB,UAAI,EAAE,MAAM,IAAI,OAAO,OAAO,OAAO,GAAI;AACzC,UAAI,OAAO,OAAO,UAAU,KAAK;AACjC,cAAQ,YAAY,OAAO,IAAI;AAAA,IACjC,OAAO;AACL,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,MAAM,OAAO,KAAK;AAC5B,QAAI,OAAO,MAAM,IAAI,KAAK;AAE1B,QAAI,KAAK,eAAe,KAAK,aAAa;AACxC,aAAO,KAAK;AAAA,IACd;AAAA,EACF,SAAS,KAAP;AAAA,EAEF;AAEA,SAAO;AACT;AAgBO,SAAS,eAAe,QAA8C;AAC3E,MAAI,KAAoB;AAAA,IACtB,MAAM;AAAA,IACN,YAAY,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;AAAA,IACxC,SAAS,OAAO,WAAW;AAAA,IAC3B,MAAM;AAAA,MACJ,CAAC,KAAK,YAAY,SAAS,OAAO,SAAS,OAAO,MAAM,MAAM;AAAA,MAC9D,CAAC,UAAU,OAAO,OAAO,SAAS,CAAC;AAAA,MACnC,CAAC,UAAU,GAAG,OAAO,MAAM;AAAA,IAC7B;AAAA,EACF;AAEA,MAAI,WAAW,QAAQ;AACrB,OAAG,KAAK,KAAK,CAAC,KAAK,OAAO,MAAM,EAAE,CAAC;AACnC,QAAI,kBAAkB,OAAO,MAAM,IAAI,GAAG;AACxC,YAAM,IAAI,CAAC,KAAK,GAAG,OAAO,MAAM,QAAQ,OAAO,MAAM,SAAS;AAC9D,SAAG,KAAK,KAAK,CAAC;AAAA,IAChB,WAAW,kBAAkB,OAAO,MAAM,IAAI,GAAG;AAC/C,UAAI,IAAI,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,OAAO,CAAC;AACzD,UAAI,CAAC;AAAG,cAAM,IAAI,MAAM,6BAA6B;AACrD,YAAM,IAAI,CAAC,KAAK,GAAG,OAAO,MAAM,QAAQ,OAAO,MAAM,UAAU,EAAE,IAAI;AACrE,SAAG,KAAK,KAAK,CAAC;AAAA,IAChB;AACA,OAAG,KAAK,KAAK,CAAC,KAAK,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC;AAAA,EAClD;AAEA,SAAO;AACT;AAEO,SAAS,mBAAmB,kBAAyC;AAC1E,MAAI;AAEJ,MAAI;AACF,iBAAa,KAAK,MAAM,gBAAgB;AAAA,EAC1C,SAAS,KAAP;AACA,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,cAAc,UAAU;AAAG,WAAO;AAEvC,MAAI,CAAC,YAAY,UAAU;AAAG,WAAO;AAErC,MAAI,IAAI,WAAW,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,OAAO,CAAC;AACvD,MAAI,CAAC;AAAG,WAAO;AACf,MAAI,CAAC,EAAE,GAAG,MAAM,gBAAgB;AAAG,WAAO;AAE1C,MAAI,IAAI,WAAW,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,OAAO,CAAC;AACvD,MAAI,KAAK,CAAC,EAAE,GAAG,MAAM,gBAAgB;AAAG,WAAO;AAE/C,MAAI,SAAS,WAAW,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,YAAY,CAAC;AACjE,MAAI,CAAC;AAAQ,WAAO;AAEpB,SAAO;AACT;AAEO,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKkB;AAChB,MAAI,KAAY,KAAK,MAAM,UAAU;AACrC,MAAI,qBAAqB,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,OAAO,MAAM,OAAO,MAAM,GAAG;AAEpF,MAAI,MAAqB;AAAA,IACvB,MAAM;AAAA,IACN,YAAY,KAAK,MAAM,OAAO,QAAQ,IAAI,GAAI;AAAA,IAC9C,SAAS;AAAA,IACT,MAAM,CAAC,GAAG,oBAAoB,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,UAAU,MAAM,GAAG,CAAC,eAAe,UAAU,CAAC;AAAA,EACjG;AAEA,MAAI,UAAU;AACZ,QAAI,KAAK,KAAK,CAAC,YAAY,QAAQ,CAAC;AAAA,EACtC;AAEA,SAAO;AACT;AAEO,SAAS,4BAA4B,QAAwB;AAClE,MAAI,OAAO,SAAS,IAAI;AACtB,WAAO;AAAA,EACT;AACA,WAAS,OAAO,UAAU,GAAG,EAAE;AAC/B,QAAM,MAAM,OAAO,YAAY,GAAG;AAClC,MAAI,QAAQ,IAAI;AACd,WAAO;AAAA,EACT;AACA,QAAM,MAAM,OAAO,UAAU,GAAG,GAAG;AACnC,MAAI,CAAC,IAAI,WAAW,MAAM,GAAG;AAC3B,WAAO;AAAA,EACT;AACA,QAAM,SAAS,IAAI,UAAU,CAAC;AAE9B,MAAI,OAAO,SAAS,GAAG;AACrB,WAAO;AAAA,EACT;AAGA,QAAM,OAAO,OAAO,OAAO,SAAS;AACpC,QAAM,QAAQ,KAAK,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC;AACnD,QAAM,UAAU,SAAS,KAAK,SAAS;AAEvC,MAAI,WAAW,OAAO,SAAS;AAC/B,MAAI,SAAS;AACX;AAAA,EACF;AAEA,MAAI,WAAW,GAAG;AAChB,WAAO;AAAA,EACT;AAEA,QAAM,MAAM,SAAS,OAAO,UAAU,GAAG,QAAQ,CAAC;AAElD,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO,MAAM;AAAA,IACf,KAAK;AACH,aAAO,MAAM;AAAA,IACf,KAAK;AACH,aAAO,MAAM;AAAA,IACf,KAAK;AACH,aAAO,MAAM;AAAA,IACf;AACE,aAAO,MAAM;AAAA,EACjB;AACF;",
|
|
6
|
+
"names": ["bytesToHex", "hexToBytes", "i", "bytesToHex", "hexToBytes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// kinds.ts
|
|
2
|
+
var BadgeAward = 8;
|
|
3
|
+
var ProfileBadges = 30008;
|
|
4
|
+
var BadgeDefinition = 30009;
|
|
5
|
+
|
|
6
|
+
// nip58.ts
|
|
7
|
+
function generateBadgeDefinitionEventTemplate({
|
|
8
|
+
d,
|
|
9
|
+
description,
|
|
10
|
+
image,
|
|
11
|
+
name,
|
|
12
|
+
thumbs
|
|
13
|
+
}) {
|
|
14
|
+
const tags = [["d", d]];
|
|
15
|
+
name && tags.push(["name", name]);
|
|
16
|
+
description && tags.push(["description", description]);
|
|
17
|
+
image && tags.push(["image", ...image]);
|
|
18
|
+
if (thumbs) {
|
|
19
|
+
for (const thumb of thumbs) {
|
|
20
|
+
tags.push(["thumb", ...thumb]);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const eventTemplate = {
|
|
24
|
+
content: "",
|
|
25
|
+
created_at: Math.floor(Date.now() / 1e3),
|
|
26
|
+
kind: BadgeDefinition,
|
|
27
|
+
tags
|
|
28
|
+
};
|
|
29
|
+
return eventTemplate;
|
|
30
|
+
}
|
|
31
|
+
function validateBadgeDefinitionEvent(event) {
|
|
32
|
+
if (event.kind !== BadgeDefinition)
|
|
33
|
+
return false;
|
|
34
|
+
const requiredTags = ["d"];
|
|
35
|
+
for (const tag of requiredTags) {
|
|
36
|
+
if (!event.tags.find(([t]) => t == tag))
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
function generateBadgeAwardEventTemplate({ a, p }) {
|
|
42
|
+
const tags = [["a", a]];
|
|
43
|
+
for (const _p of p) {
|
|
44
|
+
tags.push(["p", ..._p]);
|
|
45
|
+
}
|
|
46
|
+
const eventTemplate = {
|
|
47
|
+
content: "",
|
|
48
|
+
created_at: Math.floor(Date.now() / 1e3),
|
|
49
|
+
kind: BadgeAward,
|
|
50
|
+
tags
|
|
51
|
+
};
|
|
52
|
+
return eventTemplate;
|
|
53
|
+
}
|
|
54
|
+
function validateBadgeAwardEvent(event) {
|
|
55
|
+
if (event.kind !== BadgeAward)
|
|
56
|
+
return false;
|
|
57
|
+
const requiredTags = ["a", "p"];
|
|
58
|
+
for (const tag of requiredTags) {
|
|
59
|
+
if (!event.tags.find(([t]) => t == tag))
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
function generateProfileBadgesEventTemplate({ badges }) {
|
|
65
|
+
const tags = [["d", "profile_badges"]];
|
|
66
|
+
for (const badge of badges) {
|
|
67
|
+
tags.push(["a", badge.a], ["e", ...badge.e]);
|
|
68
|
+
}
|
|
69
|
+
const eventTemplate = {
|
|
70
|
+
content: "",
|
|
71
|
+
created_at: Math.floor(Date.now() / 1e3),
|
|
72
|
+
kind: ProfileBadges,
|
|
73
|
+
tags
|
|
74
|
+
};
|
|
75
|
+
return eventTemplate;
|
|
76
|
+
}
|
|
77
|
+
function validateProfileBadgesEvent(event) {
|
|
78
|
+
if (event.kind !== ProfileBadges)
|
|
79
|
+
return false;
|
|
80
|
+
const requiredTags = ["d"];
|
|
81
|
+
for (const tag of requiredTags) {
|
|
82
|
+
if (!event.tags.find(([t]) => t == tag))
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
generateBadgeAwardEventTemplate,
|
|
89
|
+
generateBadgeDefinitionEventTemplate,
|
|
90
|
+
generateProfileBadgesEventTemplate,
|
|
91
|
+
validateBadgeAwardEvent,
|
|
92
|
+
validateBadgeDefinitionEvent,
|
|
93
|
+
validateProfileBadgesEvent
|
|
94
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../kinds.ts", "../../nip58.ts"],
|
|
4
|
+
"sourcesContent": ["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 { Event, EventTemplate } from './core.ts'\nimport {\n BadgeAward as BadgeAwardKind,\n BadgeDefinition as BadgeDefinitionKind,\n ProfileBadges as ProfileBadgesKind,\n} from './kinds.ts'\n\n/**\n * Represents the structure for defining a badge within the Nostr network.\n * This structure is used to create templates for badge definition events,\n * facilitating the recognition and awarding of badges to users for various achievements.\n */\nexport type BadgeDefinition = {\n /**\n * A unique identifier for the badge. This is used to distinguish badges\n * from one another and should be unique across all badge definitions.\n * Typically, this could be a short, descriptive string.\n */\n d: string\n\n /**\n * An optional short name for the badge. This provides a human-readable\n * title for the badge, making it easier to recognize and refer to.\n */\n name?: string\n\n /**\n * An optional description for the badge. This field can be used to\n * provide more detailed information about the badge, such as the criteria\n * for its awarding or its significance.\n */\n description?: string\n\n /**\n * An optional image URL and dimensions for the badge. The first element\n * of the tuple is the URL pointing to a high-resolution image representing\n * the badge, and the second element specifies the image's dimensions in\n * the format \"widthxheight\". The recommended dimensions are 1024x1024 pixels.\n */\n image?: [string, string]\n\n /**\n * An optional list of thumbnail images for the badge. Each element in the\n * array is a tuple, where the first element is the URL pointing to a thumbnail\n * version of the badge image, and the second element specifies the thumbnail's\n * dimensions in the format \"widthxheight\". Multiple thumbnails can be provided\n * to support different display sizes.\n */\n thumbs?: Array<[string, string]>\n}\n\n/**\n * Represents the structure for awarding a badge to one or more recipients\n * within the Nostr network. This structure is used to create templates for\n * badge award events, which are immutable and signify the recognition of\n * individuals' achievements or contributions.\n */\nexport type BadgeAward = {\n /**\n * A reference to the Badge Definition event. This is typically composed\n * of the event ID of the badge definition. It establishes a clear linkage\n * between the badge being awarded and its original definition, ensuring\n * that recipients are awarded the correct badge.\n */\n a: string\n\n /**\n * An array of p tags, each containing a pubkey and its associated relays.\n */\n p: string[][]\n}\n\n/**\n * Represents the collection of badges a user chooses to display on their profile.\n * This structure is crucial for applications that allow users to showcase achievements\n * or recognitions in the form of badges, following the specifications of NIP-58.\n */\nexport type ProfileBadges = {\n /**\n * A unique identifier for the profile badges collection. According to NIP-58,\n * this should be set to \"profile_badges\" to differentiate it from other event types.\n */\n d: 'profile_badges'\n\n /**\n * A list of badges that the user has elected to display on their profile. Each item\n * in the array represents a specific badge, including references to both its definition\n * and the award event.\n */\n badges: Array<{\n /**\n * The event address of the badge definition. This is a reference to the specific badge\n * being displayed, linking back to the badge's original definition event. It allows\n * clients to fetch and display the badge's details, such as its name, description,\n * and image.\n */\n a: string\n\n /**\n * The event id of the badge award with corresponding relays. This references the event\n * in which the badge was awarded to the user. It is crucial for verifying the\n * authenticity of the badge display, ensuring that the user was indeed awarded the\n * badge they are choosing to display.\n */\n e: string[]\n }>\n}\n\n/**\n * Generates an EventTemplate based on the provided BadgeDefinition.\n *\n * @param {BadgeDefinition} badgeDefinition - The BadgeDefinition object.\n * @returns {EventTemplate} - The generated EventTemplate object.\n */\nexport function generateBadgeDefinitionEventTemplate({\n d,\n description,\n image,\n name,\n thumbs,\n}: BadgeDefinition): EventTemplate {\n // Mandatory tags\n const tags: string[][] = [['d', d]]\n\n // Append optional tags\n name && tags.push(['name', name])\n description && tags.push(['description', description])\n image && tags.push(['image', ...image])\n if (thumbs) {\n for (const thumb of thumbs) {\n tags.push(['thumb', ...thumb])\n }\n }\n\n // Construct the EventTemplate object\n const eventTemplate: EventTemplate = {\n content: '',\n created_at: Math.floor(Date.now() / 1000),\n kind: BadgeDefinitionKind,\n tags,\n }\n\n return eventTemplate\n}\n\n/**\n * Validates a badge definition event.\n *\n * @param event - The event to validate.\n * @returns A boolean indicating whether the event is a valid badge definition event.\n */\nexport function validateBadgeDefinitionEvent(event: Event): boolean {\n if (event.kind !== BadgeDefinitionKind) return false\n\n const requiredTags = ['d'] as const\n for (const tag of requiredTags) {\n if (!event.tags.find(([t]) => t == tag)) return false\n }\n\n return true\n}\n\n/**\n * Generates an EventTemplate based on the provided BadgeAward.\n *\n * @param {BadgeAward} badgeAward - The BadgeAward object.\n * @returns {EventTemplate} - The generated EventTemplate object.\n */\nexport function generateBadgeAwardEventTemplate({ a, p }: BadgeAward): EventTemplate {\n // Mandatory tags\n const tags: string[][] = [['a', a]]\n for (const _p of p) {\n tags.push(['p', ..._p])\n }\n\n // Construct the EventTemplate object\n const eventTemplate: EventTemplate = {\n content: '',\n created_at: Math.floor(Date.now() / 1000),\n kind: BadgeAwardKind,\n tags,\n }\n\n return eventTemplate\n}\n\n/**\n * Validates a badge award event.\n *\n * @param event - The event to validate.\n * @returns A boolean indicating whether the event is a valid badge award event.\n */\nexport function validateBadgeAwardEvent(event: Event): boolean {\n if (event.kind !== BadgeAwardKind) return false\n\n const requiredTags = ['a', 'p'] as const\n for (const tag of requiredTags) {\n if (!event.tags.find(([t]) => t == tag)) return false\n }\n\n return true\n}\n\n/**\n * Generates an EventTemplate based on the provided ProfileBadges.\n *\n * @param {ProfileBadges} profileBadges - The ProfileBadges object.\n * @returns {EventTemplate} - The generated EventTemplate object.\n */\nexport function generateProfileBadgesEventTemplate({ badges }: ProfileBadges): EventTemplate {\n // Mandatory tags\n const tags: string[][] = [['d', 'profile_badges']]\n\n // Append optional tags\n for (const badge of badges) {\n tags.push(['a', badge.a], ['e', ...badge.e])\n }\n\n // Construct the EventTemplate object\n const eventTemplate: EventTemplate = {\n content: '',\n created_at: Math.floor(Date.now() / 1000),\n kind: ProfileBadgesKind,\n tags,\n }\n\n return eventTemplate\n}\n\n/**\n * Validates a profile badges event.\n *\n * @param event - The event to validate.\n * @returns A boolean indicating whether the event is a valid profile badges event.\n */\nexport function validateProfileBadgesEvent(event: Event): boolean {\n if (event.kind !== ProfileBadgesKind) return false\n\n const requiredTags = ['d'] as const\n for (const tag of requiredTags) {\n if (!event.tags.find(([t]) => t == tag)) return false\n }\n\n return true\n}\n"],
|
|
5
|
+
"mappings": ";AAuDO,IAAM,aAAa;AA4HnB,IAAM,gBAAgB;AAEtB,IAAM,kBAAkB;;;ACnExB,SAAS,qCAAqC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmC;AAEjC,QAAM,OAAmB,CAAC,CAAC,KAAK,CAAC,CAAC;AAGlC,UAAQ,KAAK,KAAK,CAAC,QAAQ,IAAI,CAAC;AAChC,iBAAe,KAAK,KAAK,CAAC,eAAe,WAAW,CAAC;AACrD,WAAS,KAAK,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;AACtC,MAAI,QAAQ;AACV,eAAW,SAAS,QAAQ;AAC1B,WAAK,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;AAAA,IAC/B;AAAA,EACF;AAGA,QAAM,gBAA+B;AAAA,IACnC,SAAS;AAAA,IACT,YAAY,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;AAAA,IACxC,MAAM;AAAA,IACN;AAAA,EACF;AAEA,SAAO;AACT;AAQO,SAAS,6BAA6B,OAAuB;AAClE,MAAI,MAAM,SAAS;AAAqB,WAAO;AAE/C,QAAM,eAAe,CAAC,GAAG;AACzB,aAAW,OAAO,cAAc;AAC9B,QAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG;AAAG,aAAO;AAAA,EAClD;AAEA,SAAO;AACT;AAQO,SAAS,gCAAgC,EAAE,GAAG,EAAE,GAA8B;AAEnF,QAAM,OAAmB,CAAC,CAAC,KAAK,CAAC,CAAC;AAClC,aAAW,MAAM,GAAG;AAClB,SAAK,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;AAAA,EACxB;AAGA,QAAM,gBAA+B;AAAA,IACnC,SAAS;AAAA,IACT,YAAY,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;AAAA,IACxC,MAAM;AAAA,IACN;AAAA,EACF;AAEA,SAAO;AACT;AAQO,SAAS,wBAAwB,OAAuB;AAC7D,MAAI,MAAM,SAAS;AAAgB,WAAO;AAE1C,QAAM,eAAe,CAAC,KAAK,GAAG;AAC9B,aAAW,OAAO,cAAc;AAC9B,QAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG;AAAG,aAAO;AAAA,EAClD;AAEA,SAAO;AACT;AAQO,SAAS,mCAAmC,EAAE,OAAO,GAAiC;AAE3F,QAAM,OAAmB,CAAC,CAAC,KAAK,gBAAgB,CAAC;AAGjD,aAAW,SAAS,QAAQ;AAC1B,SAAK,KAAK,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;AAAA,EAC7C;AAGA,QAAM,gBAA+B;AAAA,IACnC,SAAS;AAAA,IACT,YAAY,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;AAAA,IACxC,MAAM;AAAA,IACN;AAAA,EACF;AAEA,SAAO;AACT;AAQO,SAAS,2BAA2B,OAAuB;AAChE,MAAI,MAAM,SAAS;AAAmB,WAAO;AAE7C,QAAM,eAAe,CAAC,GAAG;AACzB,aAAW,OAAO,cAAc;AAC9B,QAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG;AAAG,aAAO;AAAA,EAClD;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|