diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..41583e3 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@jsr:registry=https://npm.jsr.io diff --git a/bun.lockb b/bun.lockb deleted file mode 100755 index 3134477..0000000 Binary files a/bun.lockb and /dev/null differ diff --git a/nip06.ts b/nip06.ts index dba9f01..9970949 100644 --- a/nip06.ts +++ b/nip06.ts @@ -1,5 +1,5 @@ import { bytesToHex } from '@noble/hashes/utils.js' -import { wordlist } from '@scure/bip39/wordlists/english' +import { wordlist } from '@scure/bip39/wordlists/english.js' import { generateMnemonic, mnemonicToSeedSync, validateMnemonic } from '@scure/bip39' import { HDKey } from '@scure/bip32' diff --git a/nip19.ts b/nip19.ts index ca83d81..2cc808a 100644 --- a/nip19.ts +++ b/nip19.ts @@ -110,7 +110,7 @@ export function decode(nip19: NPub): DecodedNpub export function decode(nip19: Note): DecodedNote export function decode(code: string): DecodedResult export function decode(code: string): DecodedResult { - let { prefix, words } = bech32.decode(code, Bech32MaxSize) + let { prefix, words } = bech32.decode(code as `${string}1${string}`, Bech32MaxSize) let data = new Uint8Array(bech32.fromWords(words)) switch (prefix) { diff --git a/nip49.ts b/nip49.ts index 5a337a7..54fe457 100644 --- a/nip49.ts +++ b/nip49.ts @@ -22,7 +22,7 @@ export function encrypt( } export function decrypt(ncryptsec: string, password: string): Uint8Array { - let { prefix, words } = bech32.decode(ncryptsec, Bech32MaxSize) + let { prefix, words } = bech32.decode(ncryptsec as `${string}1${string}`, Bech32MaxSize) if (prefix !== 'ncryptsec') { throw new Error(`invalid prefix ${prefix}, expected 'ncryptsec'`) } diff --git a/package.json b/package.json index 13d8e51..237f79f 100644 --- a/package.json +++ b/package.json @@ -236,12 +236,12 @@ }, "license": "Unlicense", "dependencies": { - "@noble/ciphers": "^2.1.1", - "@noble/curves": "^2.0.1", - "@noble/hashes": "^2.0.1", - "@scure/base": "^2.0.0", - "@scure/bip32": "^2.0.1", - "@scure/bip39": "^2.0.1", + "@noble/ciphers": "npm:@jsr/noble__ciphers@2.1.1", + "@noble/curves": "npm:@jsr/noble__curves@2.0.1", + "@noble/hashes": "npm:@jsr/noble__hashes@2.0.1", + "@scure/base": "npm:@jsr/scure__base@2.0.0", + "@scure/bip32": "npm:@jsr/scure__bip32@2.0.1", + "@scure/bip39": "npm:@jsr/scure__bip39@2.0.1", "nostr-wasm": "0.1.0" }, "peerDependencies": {