diff --git a/Makefile b/Makefile
index 940928f7..c11e3d9b 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ setup:
--region us-east-1
awslocal ssm put-parameter \
--name /rss-nostr-lambda/last-run-time \
- --value "2023-11-24T00:00:00Z" \
+ --value "2023-11-23T14:46:56Z" \
--overwrite
rm handler.zip
@@ -25,7 +25,15 @@ invoke:
--region us-east-1 \
--function-name rss-nostr-lambda \
--cli-binary-format raw-in-base64-out \
- --payload '{"dryRun":true,"feedUrl":"https://nitter.1d4.us/culturaltutor/rss","nostrNsec":"nsec1wp68lflspznnmelmjh5ktflyv6c4ljf8xrlkey0w8yqr4305awcs8wyakj","lastRunTimeParam":"/rss-nostr-lambda/last-run-time"}' \
+ --payload '{"feedUrl":"https://nitter.1d4.us/culturaltutor/rss","nostrNsec":"nsec1eg458xl7d3eywld94rpfx8daa6h2hqfqxylmk43dz6ep8q388e2sfe4thg","lastRunTimeParam":"/rss-nostr-lambda/last-run-time"}' \
+ response.json
+
+invoke-dryrun:
+ awslocal lambda invoke \
+ --region us-east-1 \
+ --function-name rss-nostr-lambda \
+ --cli-binary-format raw-in-base64-out \
+ --payload '{"dryRun":true,"feedUrl":"https://nitter.1d4.us/culturaltutor/rss","nostrNsec":"nsec1eg458xl7d3eywld94rpfx8daa6h2hqfqxylmk43dz6ep8q388e2sfe4thg","lastRunTimeParam":"/rss-nostr-lambda/last-run-time"}' \
response.json
recreate:
diff --git a/index.mjs b/index.mjs
index 96456dc6..c099c3bf 100644
--- a/index.mjs
+++ b/index.mjs
@@ -13,8 +13,17 @@ const toHexString = nsec => {
return s + hex;
}, '');
}
-
+const htmlToAscii = html => {
+ let ascii = html
+ ascii = ascii.replaceAll("
", "")
+ ascii = ascii.replaceAll("
", "")
+ ascii = ascii.replaceAll("
", "")
+ ascii = ascii.replaceAll("
", "")
+ return ascii
+}
+
export const handler = async (event) => {
const region = process.env.AWS_REGION || "us-east-1"
const feed = event.feedUrl
@@ -39,87 +48,88 @@ export const handler = async (event) => {
const ssmGetCommand = new GetParameterCommand(params);
let since = new Date()
- ssmClient.send(ssmGetCommand)
+ await ssmClient.send(ssmGetCommand)
.then(data => {
- console.log("Using since date:", data.Parameter.Value)
since = data.Parameter.Value
}).catch(err => {
- console.error(err)
+ console.dir(err)
response.errors.push(err)
return response
})
if (feed === "") {
- console.error("feedUrl was not set.")
+ console.dir("feedUrl was not set.")
return {
statusCode: 400,
body: "feedUrl must be provided in payload."
}
}
-
+
const ndk = new NDK({
- signer: new NDKPrivateKeySigner(privkey),
explicitRelayUrls: [
"wss://nostr.mom",
"wss://nostr.snort.social",
"wss://nostr.lol"
]
})
- const user = await ndk.signer.user()
-
- for (let url of user.relayUrls) {
- ndk.pool.relays.push(url)
- }
await ndk.connect(6000).catch(err => {
- console.error(err)
- response.errors.push ("failed to connect to relay", err)
+ console.dir(err)
+ response.errors.push("failed to connect to relay", err)
})
- let rss = await extract(feed)
+ const signer = new NDKPrivateKeySigner(privkey)
+ ndk.signer = signer
+
+ let rss = await extract(feed, { descriptionMaxLen: 0, normalization: false })
.catch(err => {
- console.error(err.error);
+ console.dir(err);
return response
})
- let filtered = rss.entries.filter(item => moment(item.published).isAfter(since))
+ let filtered = rss.item.filter(item => moment(item.published).isAfter(since))
response.totalItems = filtered.length
for (let item of filtered) {
let ndkEvent = new NDKEvent(ndk, {
kind: 1,
- pubkey: user.hexpubkey,
- content: `${item.description}\n${item.link}`,
+ pubkey: ndk.signer.user().hexpubkey,
+ content: htmlToAscii(item.description),
created_at: Math.floor(Date.now() / 1000),
})
if (dryrun) {
+ console.dir(ndkEvent)
response.successes++
continue
}
- await ndkEvent.publish()
- .then(() => {
+ try {
+ await ndkEvent.sign(ndk.signer)
+ const published = await ndkEvent.publish()
+ if (published) {
response.successes++
- }).catch(err => {
- console.error(err)
- response.errors.push(err)
- })
- }
+
+ params.Name = lastRunTimeParam
+ params.Value = new Date().toISOString()
+ params.Type = "String"
+ params.Overwrite = true
- params.Name = lastRunTimeParam
- params.Value = new Date().toISOString()
- params.Type = "String"
- params.Overwrite = true
-
- const ssmPutCommand = new PutParameterCommand(params)
- ssmClient.send(ssmPutCommand)
- .catch(err => {
- console.error(err)
- response.errors.push(err)
+ const ssmPutCommand = new PutParameterCommand(params)
+ await ssmClient.send(ssmPutCommand)
+ .catch(err => {
+ console.dir(err)
+ response.errors.push(err)
+ return response
+ })
+ }
+ } catch(e) {
+ console.dir(e)
+ response.errors.push(e)
return response
- })
+ }
+ }
return response
}
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index e8817075..db147405 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -624,6 +624,28 @@
"url": "https://paulmillr.com/funding/"
}
},
+ "node_modules/@noble/curves": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz",
+ "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==",
+ "dependencies": {
+ "@noble/hashes": "1.3.1"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/curves/node_modules/@noble/hashes": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz",
+ "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==",
+ "engines": {
+ "node": ">= 16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
"node_modules/@noble/hashes": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz",
@@ -647,40 +669,23 @@
]
},
"node_modules/@nostr-dev-kit/ndk": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nostr-dev-kit/ndk/-/ndk-2.0.5.tgz",
- "integrity": "sha512-EvVr43y+4N9lMSZIIe5V8jFWYlKTVkMyyJfbgRaDGCGiBZAm9iy0wcO2Yi+W57awOAlvr3mjT5fAwG9RDb6HSA==",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/@nostr-dev-kit/ndk/-/ndk-2.1.1.tgz",
+ "integrity": "sha512-sMD4re3QVpSVMzoyvJAFiftPxJBXkhjRInrK5DcjhSkkPTlJhI+oiVXCpcvCJ3PHT5PilhDgKkg3LyOvv135UQ==",
"dependencies": {
"@noble/hashes": "^1.3.1",
"@noble/secp256k1": "^2.0.0",
"@scure/base": "^1.1.1",
"debug": "^4.3.4",
- "eventemitter3": "^5.0.1",
"light-bolt11-decoder": "^3.0.0",
"node-fetch": "^3.3.1",
"nostr-tools": "^1.15.0",
+ "tseep": "^1.1.1",
"typescript-lru-cache": "^2.0.0",
"utf8-buffer": "^1.0.0",
"websocket-polyfill": "^0.0.3"
}
},
- "node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
- "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
- "dependencies": {
- "data-uri-to-buffer": "^4.0.0",
- "fetch-blob": "^3.1.4",
- "formdata-polyfill": "^4.0.10"
- },
- "engines": {
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/node-fetch"
- }
- },
"node_modules/@scure/base": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz",
@@ -702,28 +707,6 @@
"url": "https://paulmillr.com/funding/"
}
},
- "node_modules/@scure/bip32/node_modules/@noble/curves": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz",
- "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==",
- "dependencies": {
- "@noble/hashes": "1.3.1"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
- },
- "node_modules/@scure/bip32/node_modules/@noble/hashes": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz",
- "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==",
- "engines": {
- "node": ">= 16"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
- },
"node_modules/@scure/bip39": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz",
@@ -1291,6 +1274,25 @@
"node-fetch": "^2.6.12"
}
},
+ "node_modules/cross-fetch/node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
"node_modules/d": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
@@ -1357,11 +1359,6 @@
"ext": "^1.1.2"
}
},
- "node_modules/eventemitter3": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
- "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
- },
"node_modules/ext": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
@@ -1505,22 +1502,20 @@
}
},
"node_modules/node-fetch": {
- "version": "2.7.0",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
- "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
"dependencies": {
- "whatwg-url": "^5.0.0"
+ "data-uri-to-buffer": "^4.0.0",
+ "fetch-blob": "^3.1.4",
+ "formdata-polyfill": "^4.0.10"
},
"engines": {
- "node": "4.x || >=6.0.0"
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
- "peerDependencies": {
- "encoding": "^0.1.0"
- },
- "peerDependenciesMeta": {
- "encoding": {
- "optional": true
- }
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/node-fetch"
}
},
"node_modules/node-gyp-build": {
@@ -1554,17 +1549,6 @@
}
}
},
- "node_modules/nostr-tools/node_modules/@noble/curves": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz",
- "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==",
- "dependencies": {
- "@noble/hashes": "1.3.1"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
- },
"node_modules/nostr-tools/node_modules/@noble/hashes": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz",
@@ -1597,6 +1581,11 @@
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
},
+ "node_modules/tseep": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/tseep/-/tseep-1.1.3.tgz",
+ "integrity": "sha512-deBIcIlXUMlr3xaN0UEochqjU/zXGaZGPqHPd1rxo4w6DklBdRM6WQQtsk7bekIF+qY6QTeen3nE6OA7BxL9rg=="
+ },
"node_modules/tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/LICENSE b/node_modules/@noble/curves/LICENSE
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/LICENSE
rename to node_modules/@noble/curves/LICENSE
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/README.md b/node_modules/@noble/curves/README.md
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/README.md
rename to node_modules/@noble/curves/README.md
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/_shortw_utils.d.ts b/node_modules/@noble/curves/_shortw_utils.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/_shortw_utils.d.ts
rename to node_modules/@noble/curves/_shortw_utils.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/_shortw_utils.d.ts.map b/node_modules/@noble/curves/_shortw_utils.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/_shortw_utils.d.ts.map
rename to node_modules/@noble/curves/_shortw_utils.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/_shortw_utils.js b/node_modules/@noble/curves/_shortw_utils.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/_shortw_utils.js
rename to node_modules/@noble/curves/_shortw_utils.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/_shortw_utils.js.map b/node_modules/@noble/curves/_shortw_utils.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/_shortw_utils.js.map
rename to node_modules/@noble/curves/_shortw_utils.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts b/node_modules/@noble/curves/abstract/bls.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts
rename to node_modules/@noble/curves/abstract/bls.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts.map b/node_modules/@noble/curves/abstract/bls.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.d.ts.map
rename to node_modules/@noble/curves/abstract/bls.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js b/node_modules/@noble/curves/abstract/bls.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js
rename to node_modules/@noble/curves/abstract/bls.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js.map b/node_modules/@noble/curves/abstract/bls.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/bls.js.map
rename to node_modules/@noble/curves/abstract/bls.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts b/node_modules/@noble/curves/abstract/curve.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts
rename to node_modules/@noble/curves/abstract/curve.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts.map b/node_modules/@noble/curves/abstract/curve.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.d.ts.map
rename to node_modules/@noble/curves/abstract/curve.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js b/node_modules/@noble/curves/abstract/curve.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js
rename to node_modules/@noble/curves/abstract/curve.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js.map b/node_modules/@noble/curves/abstract/curve.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/curve.js.map
rename to node_modules/@noble/curves/abstract/curve.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts b/node_modules/@noble/curves/abstract/edwards.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts
rename to node_modules/@noble/curves/abstract/edwards.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts.map b/node_modules/@noble/curves/abstract/edwards.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.d.ts.map
rename to node_modules/@noble/curves/abstract/edwards.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js b/node_modules/@noble/curves/abstract/edwards.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js
rename to node_modules/@noble/curves/abstract/edwards.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js.map b/node_modules/@noble/curves/abstract/edwards.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/edwards.js.map
rename to node_modules/@noble/curves/abstract/edwards.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts b/node_modules/@noble/curves/abstract/hash-to-curve.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts
rename to node_modules/@noble/curves/abstract/hash-to-curve.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map b/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map
rename to node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js b/node_modules/@noble/curves/abstract/hash-to-curve.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js
rename to node_modules/@noble/curves/abstract/hash-to-curve.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js.map b/node_modules/@noble/curves/abstract/hash-to-curve.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/hash-to-curve.js.map
rename to node_modules/@noble/curves/abstract/hash-to-curve.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts b/node_modules/@noble/curves/abstract/modular.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts
rename to node_modules/@noble/curves/abstract/modular.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts.map b/node_modules/@noble/curves/abstract/modular.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.d.ts.map
rename to node_modules/@noble/curves/abstract/modular.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js b/node_modules/@noble/curves/abstract/modular.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js
rename to node_modules/@noble/curves/abstract/modular.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js.map b/node_modules/@noble/curves/abstract/modular.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/modular.js.map
rename to node_modules/@noble/curves/abstract/modular.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts b/node_modules/@noble/curves/abstract/montgomery.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts
rename to node_modules/@noble/curves/abstract/montgomery.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts.map b/node_modules/@noble/curves/abstract/montgomery.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.d.ts.map
rename to node_modules/@noble/curves/abstract/montgomery.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js b/node_modules/@noble/curves/abstract/montgomery.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js
rename to node_modules/@noble/curves/abstract/montgomery.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js.map b/node_modules/@noble/curves/abstract/montgomery.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/montgomery.js.map
rename to node_modules/@noble/curves/abstract/montgomery.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts b/node_modules/@noble/curves/abstract/poseidon.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts
rename to node_modules/@noble/curves/abstract/poseidon.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts.map b/node_modules/@noble/curves/abstract/poseidon.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.d.ts.map
rename to node_modules/@noble/curves/abstract/poseidon.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js b/node_modules/@noble/curves/abstract/poseidon.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js
rename to node_modules/@noble/curves/abstract/poseidon.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js.map b/node_modules/@noble/curves/abstract/poseidon.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/poseidon.js.map
rename to node_modules/@noble/curves/abstract/poseidon.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/utils.d.ts b/node_modules/@noble/curves/abstract/utils.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/utils.d.ts
rename to node_modules/@noble/curves/abstract/utils.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/utils.d.ts.map b/node_modules/@noble/curves/abstract/utils.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/utils.d.ts.map
rename to node_modules/@noble/curves/abstract/utils.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/utils.js b/node_modules/@noble/curves/abstract/utils.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/utils.js
rename to node_modules/@noble/curves/abstract/utils.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/utils.js.map b/node_modules/@noble/curves/abstract/utils.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/utils.js.map
rename to node_modules/@noble/curves/abstract/utils.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts b/node_modules/@noble/curves/abstract/weierstrass.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts
rename to node_modules/@noble/curves/abstract/weierstrass.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts.map b/node_modules/@noble/curves/abstract/weierstrass.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.d.ts.map
rename to node_modules/@noble/curves/abstract/weierstrass.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js b/node_modules/@noble/curves/abstract/weierstrass.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js
rename to node_modules/@noble/curves/abstract/weierstrass.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js.map b/node_modules/@noble/curves/abstract/weierstrass.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/abstract/weierstrass.js.map
rename to node_modules/@noble/curves/abstract/weierstrass.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts b/node_modules/@noble/curves/bls12-381.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts
rename to node_modules/@noble/curves/bls12-381.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts.map b/node_modules/@noble/curves/bls12-381.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.d.ts.map
rename to node_modules/@noble/curves/bls12-381.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js b/node_modules/@noble/curves/bls12-381.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js
rename to node_modules/@noble/curves/bls12-381.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js.map b/node_modules/@noble/curves/bls12-381.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/bls12-381.js.map
rename to node_modules/@noble/curves/bls12-381.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts b/node_modules/@noble/curves/bn254.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts
rename to node_modules/@noble/curves/bn254.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts.map b/node_modules/@noble/curves/bn254.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/bn254.d.ts.map
rename to node_modules/@noble/curves/bn254.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js b/node_modules/@noble/curves/bn254.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js
rename to node_modules/@noble/curves/bn254.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js.map b/node_modules/@noble/curves/bn254.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/bn254.js.map
rename to node_modules/@noble/curves/bn254.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts b/node_modules/@noble/curves/ed25519.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts
rename to node_modules/@noble/curves/ed25519.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts.map b/node_modules/@noble/curves/ed25519.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.d.ts.map
rename to node_modules/@noble/curves/ed25519.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js b/node_modules/@noble/curves/ed25519.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js
rename to node_modules/@noble/curves/ed25519.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js.map b/node_modules/@noble/curves/ed25519.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/ed25519.js.map
rename to node_modules/@noble/curves/ed25519.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts b/node_modules/@noble/curves/ed448.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts
rename to node_modules/@noble/curves/ed448.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts.map b/node_modules/@noble/curves/ed448.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/ed448.d.ts.map
rename to node_modules/@noble/curves/ed448.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js b/node_modules/@noble/curves/ed448.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js
rename to node_modules/@noble/curves/ed448.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js.map b/node_modules/@noble/curves/ed448.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/ed448.js.map
rename to node_modules/@noble/curves/ed448.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/_shortw_utils.js b/node_modules/@noble/curves/esm/_shortw_utils.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/_shortw_utils.js
rename to node_modules/@noble/curves/esm/_shortw_utils.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/_shortw_utils.js.map b/node_modules/@noble/curves/esm/_shortw_utils.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/_shortw_utils.js.map
rename to node_modules/@noble/curves/esm/_shortw_utils.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/bls.js b/node_modules/@noble/curves/esm/abstract/bls.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/bls.js
rename to node_modules/@noble/curves/esm/abstract/bls.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/bls.js.map b/node_modules/@noble/curves/esm/abstract/bls.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/bls.js.map
rename to node_modules/@noble/curves/esm/abstract/bls.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/curve.js b/node_modules/@noble/curves/esm/abstract/curve.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/curve.js
rename to node_modules/@noble/curves/esm/abstract/curve.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/curve.js.map b/node_modules/@noble/curves/esm/abstract/curve.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/curve.js.map
rename to node_modules/@noble/curves/esm/abstract/curve.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/edwards.js b/node_modules/@noble/curves/esm/abstract/edwards.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/edwards.js
rename to node_modules/@noble/curves/esm/abstract/edwards.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/edwards.js.map b/node_modules/@noble/curves/esm/abstract/edwards.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/edwards.js.map
rename to node_modules/@noble/curves/esm/abstract/edwards.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/hash-to-curve.js b/node_modules/@noble/curves/esm/abstract/hash-to-curve.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/hash-to-curve.js
rename to node_modules/@noble/curves/esm/abstract/hash-to-curve.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map b/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map
rename to node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/modular.js b/node_modules/@noble/curves/esm/abstract/modular.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/modular.js
rename to node_modules/@noble/curves/esm/abstract/modular.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/modular.js.map b/node_modules/@noble/curves/esm/abstract/modular.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/modular.js.map
rename to node_modules/@noble/curves/esm/abstract/modular.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/montgomery.js b/node_modules/@noble/curves/esm/abstract/montgomery.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/montgomery.js
rename to node_modules/@noble/curves/esm/abstract/montgomery.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/montgomery.js.map b/node_modules/@noble/curves/esm/abstract/montgomery.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/montgomery.js.map
rename to node_modules/@noble/curves/esm/abstract/montgomery.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/poseidon.js b/node_modules/@noble/curves/esm/abstract/poseidon.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/poseidon.js
rename to node_modules/@noble/curves/esm/abstract/poseidon.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/poseidon.js.map b/node_modules/@noble/curves/esm/abstract/poseidon.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/poseidon.js.map
rename to node_modules/@noble/curves/esm/abstract/poseidon.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/utils.js b/node_modules/@noble/curves/esm/abstract/utils.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/utils.js
rename to node_modules/@noble/curves/esm/abstract/utils.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/utils.js.map b/node_modules/@noble/curves/esm/abstract/utils.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/utils.js.map
rename to node_modules/@noble/curves/esm/abstract/utils.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/weierstrass.js b/node_modules/@noble/curves/esm/abstract/weierstrass.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/weierstrass.js
rename to node_modules/@noble/curves/esm/abstract/weierstrass.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/weierstrass.js.map b/node_modules/@noble/curves/esm/abstract/weierstrass.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/abstract/weierstrass.js.map
rename to node_modules/@noble/curves/esm/abstract/weierstrass.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/bls12-381.js b/node_modules/@noble/curves/esm/bls12-381.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/bls12-381.js
rename to node_modules/@noble/curves/esm/bls12-381.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/bls12-381.js.map b/node_modules/@noble/curves/esm/bls12-381.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/bls12-381.js.map
rename to node_modules/@noble/curves/esm/bls12-381.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/bn254.js b/node_modules/@noble/curves/esm/bn254.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/bn254.js
rename to node_modules/@noble/curves/esm/bn254.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/bn254.js.map b/node_modules/@noble/curves/esm/bn254.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/bn254.js.map
rename to node_modules/@noble/curves/esm/bn254.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/ed25519.js b/node_modules/@noble/curves/esm/ed25519.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/ed25519.js
rename to node_modules/@noble/curves/esm/ed25519.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/ed25519.js.map b/node_modules/@noble/curves/esm/ed25519.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/ed25519.js.map
rename to node_modules/@noble/curves/esm/ed25519.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/ed448.js b/node_modules/@noble/curves/esm/ed448.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/ed448.js
rename to node_modules/@noble/curves/esm/ed448.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/ed448.js.map b/node_modules/@noble/curves/esm/ed448.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/ed448.js.map
rename to node_modules/@noble/curves/esm/ed448.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/index.js b/node_modules/@noble/curves/esm/index.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/index.js
rename to node_modules/@noble/curves/esm/index.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/index.js.map b/node_modules/@noble/curves/esm/index.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/index.js.map
rename to node_modules/@noble/curves/esm/index.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/jubjub.js b/node_modules/@noble/curves/esm/jubjub.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/jubjub.js
rename to node_modules/@noble/curves/esm/jubjub.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/jubjub.js.map b/node_modules/@noble/curves/esm/jubjub.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/jubjub.js.map
rename to node_modules/@noble/curves/esm/jubjub.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/p256.js b/node_modules/@noble/curves/esm/p256.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/p256.js
rename to node_modules/@noble/curves/esm/p256.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/p256.js.map b/node_modules/@noble/curves/esm/p256.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/p256.js.map
rename to node_modules/@noble/curves/esm/p256.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/p384.js b/node_modules/@noble/curves/esm/p384.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/p384.js
rename to node_modules/@noble/curves/esm/p384.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/p384.js.map b/node_modules/@noble/curves/esm/p384.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/p384.js.map
rename to node_modules/@noble/curves/esm/p384.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/p521.js b/node_modules/@noble/curves/esm/p521.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/p521.js
rename to node_modules/@noble/curves/esm/p521.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/p521.js.map b/node_modules/@noble/curves/esm/p521.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/p521.js.map
rename to node_modules/@noble/curves/esm/p521.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/package.json b/node_modules/@noble/curves/esm/package.json
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/package.json
rename to node_modules/@noble/curves/esm/package.json
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/pasta.js b/node_modules/@noble/curves/esm/pasta.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/pasta.js
rename to node_modules/@noble/curves/esm/pasta.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/pasta.js.map b/node_modules/@noble/curves/esm/pasta.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/pasta.js.map
rename to node_modules/@noble/curves/esm/pasta.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/secp256k1.js b/node_modules/@noble/curves/esm/secp256k1.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/secp256k1.js
rename to node_modules/@noble/curves/esm/secp256k1.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/esm/secp256k1.js.map b/node_modules/@noble/curves/esm/secp256k1.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/esm/secp256k1.js.map
rename to node_modules/@noble/curves/esm/secp256k1.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts b/node_modules/@noble/curves/index.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts
rename to node_modules/@noble/curves/index.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts.map b/node_modules/@noble/curves/index.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/index.d.ts.map
rename to node_modules/@noble/curves/index.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/index.js b/node_modules/@noble/curves/index.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/index.js
rename to node_modules/@noble/curves/index.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/index.js.map b/node_modules/@noble/curves/index.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/index.js.map
rename to node_modules/@noble/curves/index.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/jubjub.d.ts b/node_modules/@noble/curves/jubjub.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/jubjub.d.ts
rename to node_modules/@noble/curves/jubjub.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/jubjub.d.ts.map b/node_modules/@noble/curves/jubjub.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/jubjub.d.ts.map
rename to node_modules/@noble/curves/jubjub.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/jubjub.js b/node_modules/@noble/curves/jubjub.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/jubjub.js
rename to node_modules/@noble/curves/jubjub.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/jubjub.js.map b/node_modules/@noble/curves/jubjub.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/jubjub.js.map
rename to node_modules/@noble/curves/jubjub.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/LICENSE b/node_modules/@noble/curves/node_modules/@noble/hashes/LICENSE
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/LICENSE
rename to node_modules/@noble/curves/node_modules/@noble/hashes/LICENSE
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/README.md b/node_modules/@noble/curves/node_modules/@noble/hashes/README.md
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/README.md
rename to node_modules/@noble/curves/node_modules/@noble/hashes/README.md
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_assert.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/_assert.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_assert.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_assert.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_assert.js b/node_modules/@noble/curves/node_modules/@noble/hashes/_assert.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_assert.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_assert.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_assert.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/_assert.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_assert.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_assert.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake2.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/_blake2.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_blake2.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_blake2.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake2.js b/node_modules/@noble/curves/node_modules/@noble/hashes/_blake2.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_blake2.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_blake2.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_blake2.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/_blake2.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_blake2.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_blake2.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_sha2.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/_sha2.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_sha2.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_sha2.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_sha2.js b/node_modules/@noble/curves/node_modules/@noble/hashes/_sha2.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_sha2.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_sha2.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_sha2.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/_sha2.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_sha2.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_sha2.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/_u64.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_u64.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js b/node_modules/@noble/curves/node_modules/@noble/hashes/_u64.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_u64.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/_u64.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/_u64.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/_u64.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/argon2.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/argon2.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js b/node_modules/@noble/curves/node_modules/@noble/hashes/argon2.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/argon2.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/argon2.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/argon2.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/argon2.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2b.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/blake2b.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake2b.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake2b.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2b.js b/node_modules/@noble/curves/node_modules/@noble/hashes/blake2b.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake2b.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake2b.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2b.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/blake2b.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake2b.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake2b.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2s.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/blake2s.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake2s.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake2s.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2s.js b/node_modules/@noble/curves/node_modules/@noble/hashes/blake2s.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake2s.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake2s.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake2s.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/blake2s.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake2s.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake2s.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/blake3.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake3.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js b/node_modules/@noble/curves/node_modules/@noble/hashes/blake3.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake3.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/blake3.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/blake3.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/blake3.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/crypto.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/crypto.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/crypto.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/crypto.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/crypto.js b/node_modules/@noble/curves/node_modules/@noble/hashes/crypto.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/crypto.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/crypto.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/crypto.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/crypto.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/crypto.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/crypto.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/cryptoNode.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/cryptoNode.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/cryptoNode.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/cryptoNode.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/cryptoNode.js b/node_modules/@noble/curves/node_modules/@noble/hashes/cryptoNode.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/cryptoNode.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/cryptoNode.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/cryptoNode.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/cryptoNode.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/cryptoNode.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/cryptoNode.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/eskdf.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/eskdf.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js b/node_modules/@noble/curves/node_modules/@noble/hashes/eskdf.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/eskdf.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/eskdf.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/eskdf.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/eskdf.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_assert.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/_assert.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_assert.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/_assert.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_assert.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/_assert.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_assert.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/_assert.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_blake2.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/_blake2.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_blake2.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/_blake2.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_blake2.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/_blake2.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_blake2.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/_blake2.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_sha2.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/_sha2.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_sha2.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/_sha2.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_sha2.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/_sha2.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_sha2.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/_sha2.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_u64.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/_u64.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_u64.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/_u64.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_u64.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/_u64.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/_u64.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/_u64.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/argon2.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/argon2.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/argon2.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/argon2.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/argon2.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/argon2.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/argon2.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/argon2.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake2b.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake2b.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake2b.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake2b.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake2b.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake2b.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake2b.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake2b.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake2s.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake2s.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake2s.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake2s.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake2s.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake2s.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake2s.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake2s.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake3.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake3.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake3.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake3.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake3.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake3.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/blake3.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/blake3.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/crypto.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/crypto.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/crypto.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/crypto.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/crypto.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/crypto.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/crypto.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/crypto.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/cryptoNode.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/cryptoNode.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/cryptoNode.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/cryptoNode.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/cryptoNode.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/cryptoNode.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/cryptoNode.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/cryptoNode.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/eskdf.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/eskdf.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/eskdf.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/eskdf.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/eskdf.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/eskdf.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/eskdf.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/eskdf.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/hkdf.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/hkdf.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/hkdf.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/hkdf.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/hkdf.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/hkdf.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/hkdf.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/hkdf.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/hmac.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/hmac.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/hmac.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/hmac.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/hmac.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/hmac.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/hmac.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/hmac.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/index.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/index.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/index.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/index.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/index.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/index.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/index.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/index.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/package.json b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/package.json
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/package.json
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/package.json
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/pbkdf2.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/pbkdf2.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/pbkdf2.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/pbkdf2.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/pbkdf2.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/pbkdf2.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/pbkdf2.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/pbkdf2.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/ripemd160.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/ripemd160.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/ripemd160.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/ripemd160.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/ripemd160.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/ripemd160.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/ripemd160.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/ripemd160.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/scrypt.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/scrypt.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/scrypt.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/scrypt.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/scrypt.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/scrypt.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/scrypt.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/scrypt.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha1.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha1.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha1.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha1.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha1.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha1.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha1.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha1.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha256.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha256.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha256.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha256.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha256.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha256.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha256.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha256.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha3-addons.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha3-addons.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha3-addons.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha3-addons.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha3-addons.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha3-addons.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha3-addons.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha3-addons.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha3.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha3.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha3.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha3.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha3.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha3.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha3.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha3.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha512.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha512.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha512.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha512.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha512.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha512.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/sha512.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha512.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/utils.js b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/utils.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/utils.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/utils.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/esm/utils.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/esm/utils.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/esm/utils.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/esm/utils.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/hkdf.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/hkdf.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js b/node_modules/@noble/curves/node_modules/@noble/hashes/hkdf.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/hkdf.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/hkdf.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/hkdf.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/hkdf.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/hmac.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/hmac.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js b/node_modules/@noble/curves/node_modules/@noble/hashes/hmac.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/hmac.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/hmac.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/hmac.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/hmac.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/index.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/index.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/index.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/index.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/index.js b/node_modules/@noble/curves/node_modules/@noble/hashes/index.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/index.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/index.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/index.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/index.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/index.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/index.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/package.json b/node_modules/@noble/curves/node_modules/@noble/hashes/package.json
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/package.json
rename to node_modules/@noble/curves/node_modules/@noble/hashes/package.json
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/pbkdf2.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/pbkdf2.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js b/node_modules/@noble/curves/node_modules/@noble/hashes/pbkdf2.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/pbkdf2.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/pbkdf2.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/pbkdf2.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/pbkdf2.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/ripemd160.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/ripemd160.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/ripemd160.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/ripemd160.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/ripemd160.js b/node_modules/@noble/curves/node_modules/@noble/hashes/ripemd160.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/ripemd160.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/ripemd160.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/ripemd160.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/ripemd160.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/ripemd160.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/ripemd160.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/scrypt.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/scrypt.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js b/node_modules/@noble/curves/node_modules/@noble/hashes/scrypt.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/scrypt.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/scrypt.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/scrypt.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/scrypt.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha1.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/sha1.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha1.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha1.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha1.js b/node_modules/@noble/curves/node_modules/@noble/hashes/sha1.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha1.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha1.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha1.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/sha1.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha1.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha1.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha256.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/sha256.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha256.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha256.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha256.js b/node_modules/@noble/curves/node_modules/@noble/hashes/sha256.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha256.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha256.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha256.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/sha256.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha256.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha256.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/sha3-addons.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha3-addons.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js b/node_modules/@noble/curves/node_modules/@noble/hashes/sha3-addons.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha3-addons.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/sha3-addons.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha3-addons.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha3-addons.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/sha3.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha3.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js b/node_modules/@noble/curves/node_modules/@noble/hashes/sha3.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha3.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/sha3.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha3.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha3.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha512.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/sha512.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha512.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha512.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha512.js b/node_modules/@noble/curves/node_modules/@noble/hashes/sha512.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha512.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha512.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/sha512.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/sha512.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/sha512.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/sha512.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_assert.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/_assert.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/_assert.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/_assert.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_blake2.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/_blake2.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/_blake2.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/_blake2.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_sha2.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/_sha2.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/_sha2.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/_sha2.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/_u64.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/_u64.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/_u64.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/_u64.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/argon2.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/argon2.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/argon2.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/argon2.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake2b.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/blake2b.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake2b.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/blake2b.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake2s.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/blake2s.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake2s.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/blake2s.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake3.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/blake3.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/blake3.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/blake3.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/crypto.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/crypto.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/crypto.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/crypto.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/cryptoNode.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/cryptoNode.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/cryptoNode.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/cryptoNode.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/eskdf.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/eskdf.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/eskdf.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/eskdf.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/hkdf.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/hkdf.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/hkdf.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/hkdf.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/hmac.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/hmac.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/hmac.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/hmac.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/index.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/index.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/index.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/index.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/pbkdf2.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/pbkdf2.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/pbkdf2.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/pbkdf2.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/ripemd160.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/ripemd160.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/ripemd160.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/ripemd160.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/scrypt.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/scrypt.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/scrypt.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/scrypt.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha1.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/sha1.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha1.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/sha1.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha256.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/sha256.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha256.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/sha256.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3-addons.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/sha3-addons.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3-addons.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/sha3-addons.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/sha3.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha3.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/sha3.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha512.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/sha512.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/sha512.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/sha512.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/src/utils.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/src/utils.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/src/utils.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/src/utils.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.d.ts b/node_modules/@noble/curves/node_modules/@noble/hashes/utils.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/utils.d.ts
rename to node_modules/@noble/curves/node_modules/@noble/hashes/utils.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js b/node_modules/@noble/curves/node_modules/@noble/hashes/utils.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js
rename to node_modules/@noble/curves/node_modules/@noble/hashes/utils.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js.map b/node_modules/@noble/curves/node_modules/@noble/hashes/utils.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/hashes/utils.js.map
rename to node_modules/@noble/curves/node_modules/@noble/hashes/utils.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p256.d.ts b/node_modules/@noble/curves/p256.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p256.d.ts
rename to node_modules/@noble/curves/p256.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p256.d.ts.map b/node_modules/@noble/curves/p256.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p256.d.ts.map
rename to node_modules/@noble/curves/p256.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p256.js b/node_modules/@noble/curves/p256.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p256.js
rename to node_modules/@noble/curves/p256.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p256.js.map b/node_modules/@noble/curves/p256.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p256.js.map
rename to node_modules/@noble/curves/p256.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p384.d.ts b/node_modules/@noble/curves/p384.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p384.d.ts
rename to node_modules/@noble/curves/p384.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p384.d.ts.map b/node_modules/@noble/curves/p384.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p384.d.ts.map
rename to node_modules/@noble/curves/p384.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p384.js b/node_modules/@noble/curves/p384.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p384.js
rename to node_modules/@noble/curves/p384.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p384.js.map b/node_modules/@noble/curves/p384.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p384.js.map
rename to node_modules/@noble/curves/p384.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p521.d.ts b/node_modules/@noble/curves/p521.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p521.d.ts
rename to node_modules/@noble/curves/p521.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p521.d.ts.map b/node_modules/@noble/curves/p521.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p521.d.ts.map
rename to node_modules/@noble/curves/p521.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p521.js b/node_modules/@noble/curves/p521.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p521.js
rename to node_modules/@noble/curves/p521.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/p521.js.map b/node_modules/@noble/curves/p521.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/p521.js.map
rename to node_modules/@noble/curves/p521.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/package.json b/node_modules/@noble/curves/package.json
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/package.json
rename to node_modules/@noble/curves/package.json
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/pasta.d.ts b/node_modules/@noble/curves/pasta.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/pasta.d.ts
rename to node_modules/@noble/curves/pasta.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/pasta.d.ts.map b/node_modules/@noble/curves/pasta.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/pasta.d.ts.map
rename to node_modules/@noble/curves/pasta.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/pasta.js b/node_modules/@noble/curves/pasta.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/pasta.js
rename to node_modules/@noble/curves/pasta.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/pasta.js.map b/node_modules/@noble/curves/pasta.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/pasta.js.map
rename to node_modules/@noble/curves/pasta.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts b/node_modules/@noble/curves/secp256k1.d.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts
rename to node_modules/@noble/curves/secp256k1.d.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts.map b/node_modules/@noble/curves/secp256k1.d.ts.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.d.ts.map
rename to node_modules/@noble/curves/secp256k1.d.ts.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js b/node_modules/@noble/curves/secp256k1.js
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js
rename to node_modules/@noble/curves/secp256k1.js
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js.map b/node_modules/@noble/curves/secp256k1.js.map
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/secp256k1.js.map
rename to node_modules/@noble/curves/secp256k1.js.map
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/_shortw_utils.ts b/node_modules/@noble/curves/src/_shortw_utils.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/_shortw_utils.ts
rename to node_modules/@noble/curves/src/_shortw_utils.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/bls.ts b/node_modules/@noble/curves/src/abstract/bls.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/bls.ts
rename to node_modules/@noble/curves/src/abstract/bls.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/curve.ts b/node_modules/@noble/curves/src/abstract/curve.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/curve.ts
rename to node_modules/@noble/curves/src/abstract/curve.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/edwards.ts b/node_modules/@noble/curves/src/abstract/edwards.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/edwards.ts
rename to node_modules/@noble/curves/src/abstract/edwards.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/hash-to-curve.ts b/node_modules/@noble/curves/src/abstract/hash-to-curve.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/hash-to-curve.ts
rename to node_modules/@noble/curves/src/abstract/hash-to-curve.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/modular.ts b/node_modules/@noble/curves/src/abstract/modular.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/modular.ts
rename to node_modules/@noble/curves/src/abstract/modular.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/montgomery.ts b/node_modules/@noble/curves/src/abstract/montgomery.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/montgomery.ts
rename to node_modules/@noble/curves/src/abstract/montgomery.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/poseidon.ts b/node_modules/@noble/curves/src/abstract/poseidon.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/poseidon.ts
rename to node_modules/@noble/curves/src/abstract/poseidon.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/utils.ts b/node_modules/@noble/curves/src/abstract/utils.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/utils.ts
rename to node_modules/@noble/curves/src/abstract/utils.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/weierstrass.ts b/node_modules/@noble/curves/src/abstract/weierstrass.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/abstract/weierstrass.ts
rename to node_modules/@noble/curves/src/abstract/weierstrass.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/bls12-381.ts b/node_modules/@noble/curves/src/bls12-381.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/bls12-381.ts
rename to node_modules/@noble/curves/src/bls12-381.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/bn254.ts b/node_modules/@noble/curves/src/bn254.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/bn254.ts
rename to node_modules/@noble/curves/src/bn254.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/ed25519.ts b/node_modules/@noble/curves/src/ed25519.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/ed25519.ts
rename to node_modules/@noble/curves/src/ed25519.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/ed448.ts b/node_modules/@noble/curves/src/ed448.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/ed448.ts
rename to node_modules/@noble/curves/src/ed448.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/index.ts b/node_modules/@noble/curves/src/index.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/index.ts
rename to node_modules/@noble/curves/src/index.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/jubjub.ts b/node_modules/@noble/curves/src/jubjub.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/jubjub.ts
rename to node_modules/@noble/curves/src/jubjub.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/p256.ts b/node_modules/@noble/curves/src/p256.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/p256.ts
rename to node_modules/@noble/curves/src/p256.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/p384.ts b/node_modules/@noble/curves/src/p384.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/p384.ts
rename to node_modules/@noble/curves/src/p384.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/p521.ts b/node_modules/@noble/curves/src/p521.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/p521.ts
rename to node_modules/@noble/curves/src/p521.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/pasta.ts b/node_modules/@noble/curves/src/pasta.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/pasta.ts
rename to node_modules/@noble/curves/src/pasta.ts
diff --git a/node_modules/@scure/bip32/node_modules/@noble/curves/src/secp256k1.ts b/node_modules/@noble/curves/src/secp256k1.ts
similarity index 100%
rename from node_modules/@scure/bip32/node_modules/@noble/curves/src/secp256k1.ts
rename to node_modules/@noble/curves/src/secp256k1.ts
diff --git a/node_modules/@nostr-dev-kit/ndk/README.md b/node_modules/@nostr-dev-kit/ndk/README.md
index fc8db169..3950c741 100644
--- a/node_modules/@nostr-dev-kit/ndk/README.md
+++ b/node_modules/@nostr-dev-kit/ndk/README.md
@@ -93,12 +93,23 @@ You can pass an object with several options to a newly created instance of NDK.
// Import the package
import NDK from "@nostr-dev-kit/ndk";
-/ Create a new NDK instance with explicit relays
+// Create a new NDK instance with explicit relays
const ndk = new NDK({
explicitRelayUrls: ["wss://a.relay", "wss://another.relay"],
});
```
+If the signer implements the `getRelays()` method, NDK will use the relays returned by that method as the explicit relays.
+
+```ts
+// Import the package
+import NDK, { NDKNip07Signer } from "@nostr-dev-kit/ndk";
+
+// Create a new NDK instance with just a signer (provided the signer implements the getRelays() method)
+const nip07signer = new NDKNip07Signer();
+const ndk = new NDK({ signer: nip07signer });
+```
+
Note: In normal client use, it's best practice to instantiate NDK as a singleton class. [See more below](#architecture-decisions--suggestions).
## Connecting
diff --git a/node_modules/@nostr-dev-kit/ndk/dist/index.d.ts b/node_modules/@nostr-dev-kit/ndk/dist/index.d.ts
index e06e636d..60bba120 100644
--- a/node_modules/@nostr-dev-kit/ndk/dist/index.d.ts
+++ b/node_modules/@nostr-dev-kit/ndk/dist/index.d.ts
@@ -1,7 +1,8 @@
-import EventEmitter from 'eventemitter3';
+import { EventEmitter } from 'tseep';
import debug$1 from 'debug';
import { LRUCache } from 'typescript-lru-cache';
import { Relay } from 'nostr-tools';
+import EventEmitter$1 from 'eventemitter3';
declare enum NDKKind {
Metadata = 0,
@@ -13,6 +14,8 @@ declare enum NDKKind {
Repost = 6,
Reaction = 7,
BadgeAward = 8,
+ GroupNote = 9,
+ GroupChat = 11,
GenericRepost = 16,
ChannelCreation = 40,
ChannelMetadata = 41,
@@ -28,29 +31,44 @@ declare enum NDKKind {
DVMReqImageGeneration = 5100,
DVMReqDiscoveryNostrContent = 5300,
DVMReqDiscoveryNostrPeople = 5301,
+ DVMReqTimestamping = 5900,
DVMJobFeedback = 7000,
- ZapRequest = 9734,
- Zap = 9735,
- Highlight = 9802,
MuteList = 10000,
PinList = 10001,
RelayList = 10002,
- ClientAuth = 22242,
- NostrConnect = 24133,
+ BookmarkList = 10003,
+ CommunityList = 10004,
+ PublicChatList = 10005,
+ BlockRelayList = 10006,
+ SearchRelayList = 10007,
+ InterestList = 10015,
+ EmojiList = 10030,
+ FollowSet = 30000,
CategorizedPeopleList = 30000,
CategorizedBookmarkList = 30001,
+ RelaySet = 30002,
+ CategorizedRelayList = 30002,
+ BookmarkSet = 30003,
+ CurationSet = 30004,
+ InterestSet = 30015,
+ InterestsList = 30015,
+ EmojiSet = 30030,
+ HighlightSet = 39802,
+ CategorizedHighlightList = 39802,
+ ZapRequest = 9734,
+ Zap = 9735,
+ Highlight = 9802,
+ ClientAuth = 22242,
+ NostrConnect = 24133,
ProfileBadge = 30008,
BadgeDefinition = 30009,
- InterestsList = 30015,
MarketStall = 30017,
MarketProduct = 30018,
- CategorizedRelayList = 30022,
Article = 30023,
AppSpecificData = 30078,
Classified = 30402,
AppRecommendation = 31989,
- AppHandler = 31990,
- CategorizedHighlightList = 39802
+ AppHandler = 31990
}
declare const NDKListKinds: NDKKind[];
@@ -351,6 +369,11 @@ interface NDKSigner {
* @returns A promise that resolves to the signature of the signed event.
*/
sign(event: NostrEvent): Promise;
+ /**
+ * Getter for the preferred relays.
+ * @returns A promise containing a simple map of preferred relays and their read/write policies.
+ */
+ relays?(): Promise;
/**
* Encrypts the given Nostr event for the given recipient.
* @param value - The value to be encrypted.
@@ -366,6 +389,16 @@ interface NDKSigner {
type Hexpubkey = string;
type Npub = string;
+type ProfilePointer = {
+ pubkey: string;
+ relays?: string[];
+};
+type EventPointer = {
+ id: string;
+ relays?: string[];
+ author?: string;
+ kind?: number;
+};
interface NDKUserParams {
npub?: Npub;
hexpubkey?: Hexpubkey;
@@ -424,6 +457,10 @@ declare class NDKUser {
* Returns a set of users that this user follows.
*/
follows: (opts?: NDKSubscriptionOptions | undefined, outbox?: boolean | undefined) => Promise>;
+ /**
+ * Pins a user or an event
+ */
+ pin: (event: NDKEvent, pinEvent?: NDKEvent | undefined, publish?: boolean | undefined) => Promise;
/**
* Returns a set of relay list events for a user.
* @returns {Promise>} A set of NDKEvents returned for the given user.
@@ -440,7 +477,7 @@ declare class NDKUser {
* Get the tags that can be used to reference this user in an event
* @returns {NDKTag[]} an array of NDKTag
*/
- referenceTags(): NDKTag[];
+ referenceTags(marker?: string): NDKTag[];
/**
* Publishes the current profile.
*/
@@ -457,8 +494,8 @@ declare class NDKUser {
* Validate a user's NIP-05 identifier (usually fetched from their kind:0 profile data)
*
* @param nip05Id The NIP-05 string to validate
- * @returns {Promise} True if the NIP-05 is found and matches this user's hexpubkey,
- * False if the NIP-05 is found but doesn't match this user's hexpubkey,
+ * @returns {Promise} True if the NIP-05 is found and matches this user's pubkey,
+ * False if the NIP-05 is found but doesn't match this user's pubkey,
* null if the NIP-05 isn't found on the domain or we're unable to verify (because of network issues, etc.)
*/
validateNip05(nip05Id: string): Promise;
@@ -687,6 +724,10 @@ interface NDKConstructorParams {
* Muted pubkeys and eventIds
*/
mutedIds?: Map;
+ /**
+ * Client ID to add to events' tag
+ */
+ client?: string;
}
interface GetUserParams extends NDKUserParams {
npub?: string;
@@ -707,6 +748,7 @@ declare class NDK extends EventEmitter {
devWriteRelaySet?: NDKRelaySet;
outboxTracker?: OutboxTracker;
mutedIds: Map;
+ readonly client?: string;
private autoConnectUserRelays;
private autoFetchUserMutelist;
constructor(opts?: NDKConstructorParams);
@@ -850,7 +892,7 @@ declare class NDKEvent extends EventEmitter {
*
* @returns {string} - Encoded naddr, note or nevent.
*/
- encode: () => `nevent1${string}` | `naddr1${string}` | `note1${string}`;
+ encode: () => `naddr1${string}` | `nevent1${string}` | `note1${string}`;
encrypt: (recipient?: NDKUser | undefined, signer?: NDKSigner | undefined) => Promise;
decrypt: (sender?: NDKUser | undefined, signer?: NDKSigner | undefined) => Promise;
/**
@@ -918,9 +960,11 @@ declare class NDKEvent extends EventEmitter {
* @returns {string} The id
*/
tagAddress(): string;
- /** @deprecated Use referenceTags instead. */
/**
- * Get the tag that can be used to reference this event from another event
+ * Get the tag that can be used to reference this event from another event.
+ *
+ * Consider using referenceTags() instead (unless you have a good reason to use this)
+ *
* @example
* event = new NDKEvent(ndk, { kind: 30000, pubkey: 'pubkey', tags: [ ["d", "d-code"] ] });
* event.tagReference(); // ["a", "30000:pubkey:d-code"]
@@ -929,7 +973,7 @@ declare class NDKEvent extends EventEmitter {
* event.tagReference(); // ["e", "eventid"]
* @returns {NDKTag} The NDKTag object referencing this event
*/
- tagReference(): NDKTag;
+ tagReference(marker?: string): NDKTag;
/**
* Get the tags that can be used to reference this event from another event
* @param marker The marker to use in the tag
@@ -941,7 +985,7 @@ declare class NDKEvent extends EventEmitter {
* event.referenceTags(); // [["e", "parent-id"]]
* @returns {NDKTag} The NDKTag object referencing this event
*/
- referenceTags(marker?: string): NDKTag[];
+ referenceTags(marker?: string, skipAuthorTag?: boolean): NDKTag[];
/**
* Provides the filter that will return matching events for this event.
*
@@ -1339,6 +1383,12 @@ type Nip04QueueItem = {
resolve: (value: string) => void;
reject: (reason?: Error) => void;
};
+type Nip07RelayMap = {
+ [key: string]: {
+ read: boolean;
+ write: boolean;
+ };
+};
/**
* NDKNip07Signer implements the NDKSigner interface for signing Nostr events
* with a NIP-07 browser extension (e.g., getalby, nos2x).
@@ -1366,6 +1416,7 @@ declare class NDKNip07Signer implements NDKSigner {
* @throws Error if the NIP-07 is not available on the window object.
*/
sign(event: NostrEvent): Promise;
+ relays(): Promise;
encrypt(recipient: NDKUser, value: string): Promise;
decrypt(sender: NDKUser, value: string): Promise;
private queueNip04;
@@ -1379,7 +1430,8 @@ declare global {
signEvent(event: NostrEvent): Promise<{
sig: string;
}>;
- nip04: {
+ getRelays?: () => Promise;
+ nip04?: {
encrypt(recipientHexPubKey: string, value: string): Promise;
decrypt(senderHexPubKey: string, value: string): Promise;
};
@@ -1399,62 +1451,6 @@ declare class NDKPrivateKeySigner implements NDKSigner {
decrypt(sender: NDKUser, value: string): Promise;
}
-type Nip46PermitCallback = (pubkey: string, method: string, params?: any) => Promise;
-type Nip46ApplyTokenCallback = (pubkey: string, token: string) => Promise;
-interface IEventHandlingStrategy {
- handle(backend: NDKNip46Backend, remotePubkey: string, params: string[]): Promise;
-}
-/**
- * This class implements a NIP-46 backend, meaning that it will hold a private key
- * of the npub that wants to be published as.
- *
- * This backend is meant to be used by an NDKNip46Signer, which is the class that
- * should run client-side, where the user wants to sign events from.
- */
-declare class NDKNip46Backend {
- readonly ndk: NDK;
- readonly signer: NDKPrivateKeySigner;
- localUser?: NDKUser;
- readonly debug: debug.Debugger;
- private rpc;
- private permitCallback;
- /**
- * @param ndk The NDK instance to use
- * @param privateKey The private key of the npub that wants to be published as
- */
- constructor(ndk: NDK, privateKey: string, permitCallback: Nip46PermitCallback);
- /**
- * This method starts the backend, which will start listening for incoming
- * requests.
- */
- start(): Promise;
- handlers: {
- [method: string]: IEventHandlingStrategy;
- };
- /**
- * Enables the user to set a custom strategy for handling incoming events.
- * @param method - The method to set the strategy for
- * @param strategy - The strategy to set
- */
- setStrategy(method: string, strategy: IEventHandlingStrategy): void;
- /**
- * Overload this method to apply tokens, which can
- * wrap permission sets to be applied to a pubkey.
- * @param pubkey public key to apply token to
- * @param token token to apply
- */
- applyToken(pubkey: string, token: string): Promise;
- protected handleIncomingEvent(event: NDKEvent): Promise;
- decrypt(remotePubkey: string, senderUser: NDKUser, payload: string): Promise;
- encrypt(remotePubkey: string, recipientUser: NDKUser, payload: string): Promise;
- signEvent(remotePubkey: string, params: string[]): Promise;
- /**
- * This method should be overriden by the user to allow or reject incoming
- * connections.
- */
- pubkeyAllowed(pubkey: string, method: string, params?: any): Promise;
-}
-
interface NDKRpcRequest {
id: string;
pubkey: string;
@@ -1490,16 +1486,84 @@ declare class NDKNostrRpc extends EventEmitter {
sendRequest(remotePubkey: string, method: string, params?: string[], kind?: number, cb?: (res: NDKRpcResponse) => void): Promise;
}
+type NIP46Method = "connect" | "sign_event" | "encrypt" | "decrypt";
+type Nip46PermitCallbackParams = {
+ /**
+ * ID of the request
+ */
+ id: string;
+ pubkey: string;
+ method: NIP46Method;
+ params?: any;
+};
+type Nip46PermitCallback = (params: Nip46PermitCallbackParams) => Promise;
+type Nip46ApplyTokenCallback = (pubkey: string, token: string) => Promise;
+interface IEventHandlingStrategy {
+ handle(backend: NDKNip46Backend, id: string, remotePubkey: string, params: string[]): Promise;
+}
+/**
+ * This class implements a NIP-46 backend, meaning that it will hold a private key
+ * of the npub that wants to be published as.
+ *
+ * This backend is meant to be used by an NDKNip46Signer, which is the class that
+ * should run client-side, where the user wants to sign events from.
+ */
+declare class NDKNip46Backend {
+ readonly ndk: NDK;
+ readonly signer: NDKPrivateKeySigner;
+ localUser?: NDKUser;
+ readonly debug: debug.Debugger;
+ rpc: NDKNostrRpc;
+ private permitCallback;
+ /**
+ * @param ndk The NDK instance to use
+ * @param privateKey The private key of the npub that wants to be published as
+ */
+ constructor(ndk: NDK, privateKey: string, permitCallback: Nip46PermitCallback);
+ /**
+ * This method starts the backend, which will start listening for incoming
+ * requests.
+ */
+ start(): Promise;
+ handlers: {
+ [method: string]: IEventHandlingStrategy;
+ };
+ /**
+ * Enables the user to set a custom strategy for handling incoming events.
+ * @param method - The method to set the strategy for
+ * @param strategy - The strategy to set
+ */
+ setStrategy(method: string, strategy: IEventHandlingStrategy): void;
+ /**
+ * Overload this method to apply tokens, which can
+ * wrap permission sets to be applied to a pubkey.
+ * @param pubkey public key to apply token to
+ * @param token token to apply
+ */
+ applyToken(pubkey: string, token: string): Promise;
+ protected handleIncomingEvent(event: NDKEvent): Promise;
+ /**
+ * This method should be overriden by the user to allow or reject incoming
+ * connections.
+ */
+ pubkeyAllowed(params: Nip46PermitCallbackParams): Promise;
+}
+
/**
* This NDKSigner implements NIP-46, which allows remote signing of events.
* This class is meant to be used client-side, paired with the NDKNip46Backend or a NIP-46 backend (like Nostr-Connect)
+ *
+ * @emits authUrl -- Emitted when the user should take an action in certain URL.
+ * When a client receives this event, it should direct the user
+ * to go to that URL to authorize the application.
*/
-declare class NDKNip46Signer implements NDKSigner {
+declare class NDKNip46Signer extends EventEmitter$1 implements NDKSigner {
private ndk;
remoteUser: NDKUser;
- remotePubkey: string;
+ remotePubkey: string | undefined;
token: string | undefined;
localSigner: NDKSigner;
+ private nip05?;
private rpc;
private debug;
/**
@@ -1514,6 +1578,12 @@ declare class NDKNip46Signer implements NDKSigner {
* @param localSigner - The signer that will be used to request events to be signed
*/
constructor(ndk: NDK, remoteNpub: string, localSigner?: NDKSigner);
+ /**
+ * @param ndk - The NDK instance to use
+ * @param remoteNip05 - The nip05 that wants to be published as
+ * @param localSigner - The signer that will be used to request events to be signed
+ */
+ constructor(ndk: NDK, remoteNip05: string, localSigner?: NDKSigner);
/**
* @param ndk - The NDK instance to use
* @param remotePubkey - The public key of the npub that wants to be published as
@@ -1567,4 +1637,4 @@ interface NDKZapInvoice {
*/
declare function zapInvoiceFromEvent(event: NDKEvent): NDKZapInvoice | null;
-export { Hexpubkey, IEventHandlingStrategy, NDKAppHandlerEvent, NDKArticle, NDKCacheAdapter, NDKConstructorParams, NDKDVMJobFeedback, NDKDVMJobResult, NDKDVMRequest, NDKDvmJobFeedbackStatus, NDKDvmParam, NDKEvent, NDKEventId, NDKFilter, NDKFilterGroupingId, NDKHighlight, NDKKind, NDKList, NDKListItem, NDKListKinds, NDKNip07Signer, NDKNip46Backend, NDKNip46Signer, NDKNostrRpc, NDKPrivateKeySigner, NDKRelay, NDKRelayConnectionStats, NDKRelayList, NDKRelaySet, NDKRelayStatus, NDKRelayUrl, NDKRepost, NDKRpcRequest, NDKRpcResponse, NDKSigner, NDKSubscription, NDKSubscriptionCacheUsage, NDKSubscriptionOptions, NDKTag, NDKTranscriptionDVM, NDKUser, NDKUserParams, NDKUserProfile, NDKZapInvoice, Nip46ApplyTokenCallback, Nip46PermitCallback, NostrEvent, Npub, calculateGroupableId, NDK as default, defaultOpts, mergeFilters, profileFromEvent, serializeProfile, zapInvoiceFromEvent };
+export { EventPointer, Hexpubkey, IEventHandlingStrategy, NDKAppHandlerEvent, NDKArticle, NDKCacheAdapter, NDKConstructorParams, NDKDVMJobFeedback, NDKDVMJobResult, NDKDVMRequest, NDKDvmJobFeedbackStatus, NDKDvmParam, NDKEvent, NDKEventId, NDKFilter, NDKFilterGroupingId, NDKHighlight, NDKKind, NDKList, NDKListItem, NDKListKinds, NDKNip07Signer, NDKNip46Backend, NDKNip46Signer, NDKNostrRpc, NDKPrivateKeySigner, NDKRelay, NDKRelayConnectionStats, NDKRelayList, NDKRelaySet, NDKRelayStatus, NDKRelayUrl, NDKRepost, NDKRpcRequest, NDKRpcResponse, NDKSigner, NDKSubscription, NDKSubscriptionCacheUsage, NDKSubscriptionOptions, NDKTag, NDKTranscriptionDVM, NDKUser, NDKUserParams, NDKUserProfile, NDKZapInvoice, NIP46Method, Nip46ApplyTokenCallback, Nip46PermitCallback, Nip46PermitCallbackParams, NostrEvent, Npub, ProfilePointer, calculateGroupableId, NDK as default, defaultOpts, mergeFilters, profileFromEvent, serializeProfile, zapInvoiceFromEvent };
diff --git a/node_modules/@nostr-dev-kit/ndk/dist/index.js b/node_modules/@nostr-dev-kit/ndk/dist/index.js
index f7b58737..5f2c3130 100644
--- a/node_modules/@nostr-dev-kit/ndk/dist/index.js
+++ b/node_modules/@nostr-dev-kit/ndk/dist/index.js
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __commonJS = (cb, mod) => function __require() {
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
+};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
@@ -27,6 +30,188 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+// ../node_modules/eventemitter3/index.js
+var require_eventemitter3 = __commonJS({
+ "../node_modules/eventemitter3/index.js"(exports, module2) {
+ "use strict";
+ var has = Object.prototype.hasOwnProperty;
+ var prefix = "~";
+ function Events() {
+ }
+ if (Object.create) {
+ Events.prototype = /* @__PURE__ */ Object.create(null);
+ if (!new Events().__proto__)
+ prefix = false;
+ }
+ function EE(fn, context, once) {
+ this.fn = fn;
+ this.context = context;
+ this.once = once || false;
+ }
+ function addListener(emitter, event, fn, context, once) {
+ if (typeof fn !== "function") {
+ throw new TypeError("The listener must be a function");
+ }
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
+ if (!emitter._events[evt])
+ emitter._events[evt] = listener, emitter._eventsCount++;
+ else if (!emitter._events[evt].fn)
+ emitter._events[evt].push(listener);
+ else
+ emitter._events[evt] = [emitter._events[evt], listener];
+ return emitter;
+ }
+ function clearEvent(emitter, evt) {
+ if (--emitter._eventsCount === 0)
+ emitter._events = new Events();
+ else
+ delete emitter._events[evt];
+ }
+ function EventEmitter11() {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+ EventEmitter11.prototype.eventNames = function eventNames() {
+ var names = [], events, name;
+ if (this._eventsCount === 0)
+ return names;
+ for (name in events = this._events) {
+ if (has.call(events, name))
+ names.push(prefix ? name.slice(1) : name);
+ }
+ if (Object.getOwnPropertySymbols) {
+ return names.concat(Object.getOwnPropertySymbols(events));
+ }
+ return names;
+ };
+ EventEmitter11.prototype.listeners = function listeners(event) {
+ var evt = prefix ? prefix + event : event, handlers = this._events[evt];
+ if (!handlers)
+ return [];
+ if (handlers.fn)
+ return [handlers.fn];
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
+ ee[i] = handlers[i].fn;
+ }
+ return ee;
+ };
+ EventEmitter11.prototype.listenerCount = function listenerCount(event) {
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
+ if (!listeners)
+ return 0;
+ if (listeners.fn)
+ return 1;
+ return listeners.length;
+ };
+ EventEmitter11.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
+ var evt = prefix ? prefix + event : event;
+ if (!this._events[evt])
+ return false;
+ var listeners = this._events[evt], len = arguments.length, args, i;
+ if (listeners.fn) {
+ if (listeners.once)
+ this.removeListener(event, listeners.fn, void 0, true);
+ switch (len) {
+ case 1:
+ return listeners.fn.call(listeners.context), true;
+ case 2:
+ return listeners.fn.call(listeners.context, a1), true;
+ case 3:
+ return listeners.fn.call(listeners.context, a1, a2), true;
+ case 4:
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
+ case 5:
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
+ case 6:
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ }
+ for (i = 1, args = new Array(len - 1); i < len; i++) {
+ args[i - 1] = arguments[i];
+ }
+ listeners.fn.apply(listeners.context, args);
+ } else {
+ var length = listeners.length, j;
+ for (i = 0; i < length; i++) {
+ if (listeners[i].once)
+ this.removeListener(event, listeners[i].fn, void 0, true);
+ switch (len) {
+ case 1:
+ listeners[i].fn.call(listeners[i].context);
+ break;
+ case 2:
+ listeners[i].fn.call(listeners[i].context, a1);
+ break;
+ case 3:
+ listeners[i].fn.call(listeners[i].context, a1, a2);
+ break;
+ case 4:
+ listeners[i].fn.call(listeners[i].context, a1, a2, a3);
+ break;
+ default:
+ if (!args)
+ for (j = 1, args = new Array(len - 1); j < len; j++) {
+ args[j - 1] = arguments[j];
+ }
+ listeners[i].fn.apply(listeners[i].context, args);
+ }
+ }
+ }
+ return true;
+ };
+ EventEmitter11.prototype.on = function on(event, fn, context) {
+ return addListener(this, event, fn, context, false);
+ };
+ EventEmitter11.prototype.once = function once(event, fn, context) {
+ return addListener(this, event, fn, context, true);
+ };
+ EventEmitter11.prototype.removeListener = function removeListener(event, fn, context, once) {
+ var evt = prefix ? prefix + event : event;
+ if (!this._events[evt])
+ return this;
+ if (!fn) {
+ clearEvent(this, evt);
+ return this;
+ }
+ var listeners = this._events[evt];
+ if (listeners.fn) {
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
+ clearEvent(this, evt);
+ }
+ } else {
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
+ if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
+ events.push(listeners[i]);
+ }
+ }
+ if (events.length)
+ this._events[evt] = events.length === 1 ? events[0] : events;
+ else
+ clearEvent(this, evt);
+ }
+ return this;
+ };
+ EventEmitter11.prototype.removeAllListeners = function removeAllListeners(event) {
+ var evt;
+ if (event) {
+ evt = prefix ? prefix + event : event;
+ if (this._events[evt])
+ clearEvent(this, evt);
+ } else {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+ return this;
+ };
+ EventEmitter11.prototype.off = EventEmitter11.prototype.removeListener;
+ EventEmitter11.prototype.addListener = EventEmitter11.prototype.on;
+ EventEmitter11.prefixed = prefix;
+ EventEmitter11.EventEmitter = EventEmitter11;
+ if ("undefined" !== typeof module2) {
+ module2.exports = EventEmitter11;
+ }
+ }
+});
+
// src/index.ts
var src_exports = {};
__export(src_exports, {
@@ -69,12 +254,12 @@ module.exports = __toCommonJS(src_exports);
var import_nostr_tools8 = require("nostr-tools");
// src/events/index.ts
-var import_eventemitter34 = __toESM(require("eventemitter3"));
+var import_tseep4 = require("tseep");
var import_nostr_tools7 = require("nostr-tools");
// src/relay/index.ts
var import_debug = __toESM(require("debug"));
-var import_eventemitter32 = __toESM(require("eventemitter3"));
+var import_tseep2 = require("tseep");
// src/relay/connectivity.ts
var import_nostr_tools = require("nostr-tools");
@@ -293,7 +478,7 @@ var NDKRelayPublisher = class {
};
// src/relay/subscriptions.ts
-var import_eventemitter3 = __toESM(require("eventemitter3"));
+var import_tseep = require("tseep");
var import_nostr_tools3 = require("nostr-tools");
// src/subscription/grouping.ts
@@ -444,7 +629,7 @@ function relaysFromBech32(bech322) {
}
// src/relay/subscriptions.ts
-var NDKGroupedSubscriptions = class extends import_eventemitter3.default {
+var NDKGroupedSubscriptions = class extends import_tseep.EventEmitter {
subscriptions;
req;
debug;
@@ -729,7 +914,7 @@ var NDKRelayStatus = /* @__PURE__ */ ((NDKRelayStatus2) => {
NDKRelayStatus2[NDKRelayStatus2["FLAPPING"] = 5] = "FLAPPING";
return NDKRelayStatus2;
})(NDKRelayStatus || {});
-var NDKRelay = class extends import_eventemitter32.default {
+var NDKRelay = class extends import_tseep2.EventEmitter {
url;
scores;
connectivity;
@@ -954,7 +1139,7 @@ function calculateRelaySetsFromFilters(ndk, filters) {
// src/zap/index.ts
var import_base = require("@scure/base");
-var import_eventemitter33 = __toESM(require("eventemitter3"));
+var import_tseep3 = require("tseep");
var import_nostr_tools4 = require("nostr-tools");
var DEFAULT_RELAYS = [
"wss://nos.lol",
@@ -964,7 +1149,7 @@ var DEFAULT_RELAYS = [
"wss://nostr.mom",
"wss://no.str.cr"
];
-var Zap = class extends import_eventemitter33.default {
+var Zap = class extends import_tseep3.EventEmitter {
ndk;
zappedEvent;
zappedUser;
@@ -1065,6 +1250,26 @@ var Zap = class extends import_eventemitter33.default {
// src/events/content-tagger.ts
var import_nostr_tools5 = require("nostr-tools");
+function mergeTags(tags1, tags2) {
+ const tagMap = /* @__PURE__ */ new Map();
+ const generateKey = (tag) => tag.join(",");
+ const isContained = (smaller, larger) => {
+ return smaller.every((value, index) => value === larger[index]);
+ };
+ const processTag = (tag) => {
+ for (let [key, existingTag] of tagMap) {
+ if (isContained(existingTag, tag) || isContained(tag, existingTag)) {
+ if (tag.length >= existingTag.length) {
+ tagMap.set(key, tag);
+ }
+ return;
+ }
+ }
+ tagMap.set(generateKey(tag), tag);
+ };
+ tags1.concat(tags2).forEach(processTag);
+ return Array.from(tagMap.values());
+}
async function generateContentTags(content, tags = []) {
const tagRegex = /(@|nostr:)(npub|nprofile|note|nevent|naddr)[a-zA-Z0-9]+/g;
const hashtagRegex = /#(\w+)/g;
@@ -1179,6 +1384,8 @@ var NDKKind = /* @__PURE__ */ ((NDKKind2) => {
NDKKind2[NDKKind2["Repost"] = 6] = "Repost";
NDKKind2[NDKKind2["Reaction"] = 7] = "Reaction";
NDKKind2[NDKKind2["BadgeAward"] = 8] = "BadgeAward";
+ NDKKind2[NDKKind2["GroupNote"] = 9] = "GroupNote";
+ NDKKind2[NDKKind2["GroupChat"] = 11] = "GroupChat";
NDKKind2[NDKKind2["GenericRepost"] = 16] = "GenericRepost";
NDKKind2[NDKKind2["ChannelCreation"] = 40] = "ChannelCreation";
NDKKind2[NDKKind2["ChannelMetadata"] = 41] = "ChannelMetadata";
@@ -1194,37 +1401,66 @@ var NDKKind = /* @__PURE__ */ ((NDKKind2) => {
NDKKind2[NDKKind2["DVMReqImageGeneration"] = 5100] = "DVMReqImageGeneration";
NDKKind2[NDKKind2["DVMReqDiscoveryNostrContent"] = 5300] = "DVMReqDiscoveryNostrContent";
NDKKind2[NDKKind2["DVMReqDiscoveryNostrPeople"] = 5301] = "DVMReqDiscoveryNostrPeople";
+ NDKKind2[NDKKind2["DVMReqTimestamping"] = 5900] = "DVMReqTimestamping";
NDKKind2[NDKKind2["DVMJobFeedback"] = 7e3] = "DVMJobFeedback";
- NDKKind2[NDKKind2["ZapRequest"] = 9734] = "ZapRequest";
- NDKKind2[NDKKind2["Zap"] = 9735] = "Zap";
- NDKKind2[NDKKind2["Highlight"] = 9802] = "Highlight";
NDKKind2[NDKKind2["MuteList"] = 1e4] = "MuteList";
NDKKind2[NDKKind2["PinList"] = 10001] = "PinList";
NDKKind2[NDKKind2["RelayList"] = 10002] = "RelayList";
+ NDKKind2[NDKKind2["BookmarkList"] = 10003] = "BookmarkList";
+ NDKKind2[NDKKind2["CommunityList"] = 10004] = "CommunityList";
+ NDKKind2[NDKKind2["PublicChatList"] = 10005] = "PublicChatList";
+ NDKKind2[NDKKind2["BlockRelayList"] = 10006] = "BlockRelayList";
+ NDKKind2[NDKKind2["SearchRelayList"] = 10007] = "SearchRelayList";
+ NDKKind2[NDKKind2["InterestList"] = 10015] = "InterestList";
+ NDKKind2[NDKKind2["EmojiList"] = 10030] = "EmojiList";
+ NDKKind2[NDKKind2["FollowSet"] = 3e4] = "FollowSet";
+ NDKKind2[NDKKind2["CategorizedPeopleList"] = 3e4 /* FollowSet */] = "CategorizedPeopleList";
+ NDKKind2[NDKKind2["CategorizedBookmarkList"] = 30001] = "CategorizedBookmarkList";
+ NDKKind2[NDKKind2["RelaySet"] = 30002] = "RelaySet";
+ NDKKind2[NDKKind2["CategorizedRelayList"] = 30002 /* RelaySet */] = "CategorizedRelayList";
+ NDKKind2[NDKKind2["BookmarkSet"] = 30003] = "BookmarkSet";
+ NDKKind2[NDKKind2["CurationSet"] = 30004] = "CurationSet";
+ NDKKind2[NDKKind2["InterestSet"] = 30015] = "InterestSet";
+ NDKKind2[NDKKind2["InterestsList"] = 30015 /* InterestSet */] = "InterestsList";
+ NDKKind2[NDKKind2["EmojiSet"] = 30030] = "EmojiSet";
+ NDKKind2[NDKKind2["HighlightSet"] = 39802] = "HighlightSet";
+ NDKKind2[NDKKind2["CategorizedHighlightList"] = 39802 /* HighlightSet */] = "CategorizedHighlightList";
+ NDKKind2[NDKKind2["ZapRequest"] = 9734] = "ZapRequest";
+ NDKKind2[NDKKind2["Zap"] = 9735] = "Zap";
+ NDKKind2[NDKKind2["Highlight"] = 9802] = "Highlight";
NDKKind2[NDKKind2["ClientAuth"] = 22242] = "ClientAuth";
NDKKind2[NDKKind2["NostrConnect"] = 24133] = "NostrConnect";
- NDKKind2[NDKKind2["CategorizedPeopleList"] = 3e4] = "CategorizedPeopleList";
- NDKKind2[NDKKind2["CategorizedBookmarkList"] = 30001] = "CategorizedBookmarkList";
NDKKind2[NDKKind2["ProfileBadge"] = 30008] = "ProfileBadge";
NDKKind2[NDKKind2["BadgeDefinition"] = 30009] = "BadgeDefinition";
- NDKKind2[NDKKind2["InterestsList"] = 30015] = "InterestsList";
NDKKind2[NDKKind2["MarketStall"] = 30017] = "MarketStall";
NDKKind2[NDKKind2["MarketProduct"] = 30018] = "MarketProduct";
- NDKKind2[NDKKind2["CategorizedRelayList"] = 30022] = "CategorizedRelayList";
NDKKind2[NDKKind2["Article"] = 30023] = "Article";
NDKKind2[NDKKind2["AppSpecificData"] = 30078] = "AppSpecificData";
NDKKind2[NDKKind2["Classified"] = 30402] = "Classified";
NDKKind2[NDKKind2["AppRecommendation"] = 31989] = "AppRecommendation";
NDKKind2[NDKKind2["AppHandler"] = 31990] = "AppHandler";
- NDKKind2[NDKKind2["CategorizedHighlightList"] = 39802] = "CategorizedHighlightList";
return NDKKind2;
})(NDKKind || {});
var NDKListKinds = [
- 3e4 /* CategorizedPeopleList */,
+ 1e4 /* MuteList */,
+ 10001 /* PinList */,
+ 10002 /* RelayList */,
+ 10003 /* BookmarkList */,
+ 10004 /* CommunityList */,
+ 10005 /* PublicChatList */,
+ 10006 /* BlockRelayList */,
+ 10007 /* SearchRelayList */,
+ 10015 /* InterestList */,
+ 10030 /* EmojiList */,
+ 3e4 /* FollowSet */,
+ 30003 /* BookmarkSet */,
30001 /* CategorizedBookmarkList */,
- 39802 /* CategorizedHighlightList */,
- 30022 /* CategorizedRelayList */,
- 30015 /* InterestsList */
+ // Backwards compatibility
+ 30002 /* RelaySet */,
+ 30004 /* CurationSet */,
+ 30015 /* InterestSet */,
+ 30030 /* EmojiSet */,
+ 39802 /* HighlightSet */
];
// src/events/nip04.ts
@@ -1310,7 +1546,7 @@ function getKind(event) {
}
// src/events/index.ts
-var NDKEvent = class extends import_eventemitter34.default {
+var NDKEvent = class extends import_tseep4.EventEmitter {
ndk;
created_at;
content = "";
@@ -1366,15 +1602,10 @@ var NDKEvent = class extends import_eventemitter34.default {
return user;
}
tag(userOrEvent, marker) {
- const tags = userOrEvent.referenceTags();
- if (marker)
- tags[0].push(marker);
- this.tags.push(...tags);
+ const skipAuthorTag = userOrEvent?.pubkey === this.pubkey;
+ const tags = userOrEvent.referenceTags(marker, skipAuthorTag);
+ this.tags = mergeTags(this.tags, tags);
if (userOrEvent instanceof NDKEvent) {
- const tagEventAuthor = userOrEvent.author;
- if (tagEventAuthor && this.pubkey !== tagEventAuthor.hexpubkey) {
- this.tag(tagEventAuthor);
- }
for (const pTag of userOrEvent.getMatchingTags("p")) {
if (pTag[1] === this.pubkey)
continue;
@@ -1505,6 +1736,9 @@ var NDKEvent = class extends import_eventemitter34.default {
tags.push(["d", str]);
}
}
+ if (this.ndk?.client && !this.tagValue("client")) {
+ tags.push(["client", this.ndk.client]);
+ }
return { content: content || "", tags };
}
muted() {
@@ -1565,9 +1799,11 @@ var NDKEvent = class extends import_eventemitter34.default {
const dTagId = this.replaceableDTag();
return `${this.kind}:${this.pubkey}:${dTagId}`;
}
- /** @deprecated Use referenceTags instead. */
/**
- * Get the tag that can be used to reference this event from another event
+ * Get the tag that can be used to reference this event from another event.
+ *
+ * Consider using referenceTags() instead (unless you have a good reason to use this)
+ *
* @example
* event = new NDKEvent(ndk, { kind: 30000, pubkey: 'pubkey', tags: [ ["d", "d-code"] ] });
* event.tagReference(); // ["a", "30000:pubkey:d-code"]
@@ -1576,11 +1812,22 @@ var NDKEvent = class extends import_eventemitter34.default {
* event.tagReference(); // ["e", "eventid"]
* @returns {NDKTag} The NDKTag object referencing this event
*/
- tagReference() {
+ tagReference(marker) {
+ let tag;
if (this.isParamReplaceable()) {
- return ["a", this.tagAddress()];
+ tag = ["a", this.tagAddress()];
+ } else {
+ tag = ["e", this.tagId()];
}
- return ["e", this.tagId()];
+ if (this.relay) {
+ tag.push(this.relay.url);
+ } else {
+ tag.push("");
+ }
+ if (marker) {
+ tag.push(marker);
+ }
+ return tag;
}
/**
* Get the tags that can be used to reference this event from another event
@@ -1593,7 +1840,7 @@ var NDKEvent = class extends import_eventemitter34.default {
* event.referenceTags(); // [["e", "parent-id"]]
* @returns {NDKTag} The NDKTag object referencing this event
*/
- referenceTags(marker) {
+ referenceTags(marker, skipAuthorTag) {
let tags = [];
if (this.isParamReplaceable()) {
tags = [
@@ -1603,10 +1850,22 @@ var NDKEvent = class extends import_eventemitter34.default {
} else {
tags = [["e", this.id]];
}
+ if (this.relay?.url) {
+ tags = tags.map((tag) => {
+ tag.push(this.relay?.url);
+ return tag;
+ });
+ } else if (marker) {
+ tags = tags.map((tag) => {
+ tag.push("");
+ return tag;
+ });
+ }
if (marker) {
tags.forEach((tag) => tag.push(marker));
}
- tags.push(...this.author.referenceTags());
+ if (!skipAuthorTag)
+ tags.push(...this.author.referenceTags());
return tags;
}
/**
@@ -1746,7 +2005,7 @@ var NDKRelayList = class extends NDKEvent {
};
// src/subscription/index.ts
-var import_eventemitter35 = __toESM(require("eventemitter3"));
+var import_tseep5 = require("tseep");
var NDKSubscriptionCacheUsage = /* @__PURE__ */ ((NDKSubscriptionCacheUsage2) => {
NDKSubscriptionCacheUsage2["ONLY_CACHE"] = "ONLY_CACHE";
NDKSubscriptionCacheUsage2["CACHE_FIRST"] = "CACHE_FIRST";
@@ -1760,7 +2019,7 @@ var defaultOpts = {
groupable: true,
groupableDelay: 100
};
-var NDKSubscription = class extends import_eventemitter35.default {
+var NDKSubscription = class extends import_tseep5.EventEmitter {
subId;
filters;
opts;
@@ -1986,13 +2245,15 @@ var NDKSubscription = class extends import_eventemitter35.default {
async function follows(opts, outbox) {
if (!this.ndk)
throw new Error("NDK not set");
- const contactListEvent = await this.ndk.fetchEvent(
- {
- kinds: [3],
- authors: [this.hexpubkey]
- },
- opts || { groupable: false }
- );
+ const contactListEvent = Array.from(
+ await this.ndk.fetchEvents(
+ {
+ kinds: [3],
+ authors: [this.pubkey]
+ },
+ opts || { groupable: false }
+ )
+ )[0];
if (contactListEvent) {
const pubkeys = /* @__PURE__ */ new Set();
contactListEvent.tags.forEach((tag) => {
@@ -2006,8 +2267,8 @@ async function follows(opts, outbox) {
}
}
});
- return [...pubkeys].reduce((acc, hexpubkey) => {
- const user = new NDKUser({ hexpubkey });
+ return [...pubkeys].reduce((acc, pubkey) => {
+ const user = new NDKUser({ pubkey });
user.ndk = this.ndk;
acc.add(user);
return acc;
@@ -2090,6 +2351,283 @@ function serializeProfile(profile) {
return JSON.stringify(payload);
}
+// src/events/kinds/lists/index.ts
+var NDKList = class extends NDKEvent {
+ _encryptedTags;
+ /**
+ * Stores the number of bytes the content was before decryption
+ * to expire the cache when the content changes.
+ */
+ encryptedTagsLength;
+ constructor(ndk, rawEvent) {
+ super(ndk, rawEvent);
+ this.kind ??= 30001 /* CategorizedBookmarkList */;
+ }
+ /**
+ * Wrap a NDKEvent into a NDKList
+ */
+ static from(ndkEvent) {
+ return new NDKList(ndkEvent.ndk, ndkEvent.rawEvent());
+ }
+ /**
+ * Returns the title of the list. Falls back on fetching the name tag value.
+ */
+ get title() {
+ const titleTag = this.tagValue("title") || this.tagValue("name");
+ if (this.kind === 3 /* Contacts */ && !titleTag) {
+ return "Contacts";
+ } else if (this.kind === 1e4 /* MuteList */ && !titleTag) {
+ return "Mute";
+ } else if (this.kind === 10001 /* PinList */ && !titleTag) {
+ return "Pinned Notes";
+ } else if (this.kind === 10002 /* RelayList */ && !titleTag) {
+ return "Relay Metadata";
+ } else if (this.kind === 10003 /* BookmarkList */ && !titleTag) {
+ return "Bookmarks";
+ } else if (this.kind === 10004 /* CommunityList */ && !titleTag) {
+ return "Communities";
+ } else if (this.kind === 10005 /* PublicChatList */ && !titleTag) {
+ return "Public Chats";
+ } else if (this.kind === 10006 /* BlockRelayList */ && !titleTag) {
+ return "Blocked Relays";
+ } else if (this.kind === 10007 /* SearchRelayList */ && !titleTag) {
+ return "Search Relays";
+ } else if (this.kind === 10015 /* InterestList */ && !titleTag) {
+ return "Interests";
+ } else if (this.kind === 10030 /* EmojiList */ && !titleTag) {
+ return "Emojis";
+ } else {
+ return titleTag ?? this.tagValue("d");
+ }
+ }
+ /**
+ * Sets the title of the list.
+ */
+ set title(title) {
+ this.removeTag("title");
+ this.removeTag("name");
+ if (title) {
+ this.tags.push(["title", title]);
+ } else {
+ throw new Error("Title cannot be empty");
+ }
+ }
+ /**
+ * Returns the name of the list.
+ * @deprecated Please use "title" instead.
+ */
+ get name() {
+ const nameTag = this.tagValue("name");
+ if (this.kind === 3 /* Contacts */ && !nameTag) {
+ return "Contacts";
+ } else if (this.kind === 1e4 /* MuteList */ && !nameTag) {
+ return "Mute";
+ } else if (this.kind === 10001 /* PinList */ && !nameTag) {
+ return "Pinned Notes";
+ } else if (this.kind === 10002 /* RelayList */ && !nameTag) {
+ return "Relay Metadata";
+ } else if (this.kind === 10003 /* BookmarkList */ && !nameTag) {
+ return "Bookmarks";
+ } else if (this.kind === 10004 /* CommunityList */ && !nameTag) {
+ return "Communities";
+ } else if (this.kind === 10005 /* PublicChatList */ && !nameTag) {
+ return "Public Chats";
+ } else if (this.kind === 10006 /* BlockRelayList */ && !nameTag) {
+ return "Blocked Relays";
+ } else if (this.kind === 10007 /* SearchRelayList */ && !nameTag) {
+ return "Search Relays";
+ } else if (this.kind === 10015 /* InterestList */ && !nameTag) {
+ return "Interests";
+ } else if (this.kind === 10030 /* EmojiList */ && !nameTag) {
+ return "Emojis";
+ } else {
+ return nameTag ?? this.tagValue("d");
+ }
+ }
+ /**
+ * Sets the name of the list.
+ * @deprecated Please use "title" instead. This method will use the `title` tag instead.
+ */
+ set name(name) {
+ this.removeTag("name");
+ if (name) {
+ this.tags.push(["title", name]);
+ } else {
+ throw new Error("Name cannot be empty");
+ }
+ }
+ /**
+ * Returns the description of the list.
+ */
+ get description() {
+ return this.tagValue("description");
+ }
+ /**
+ * Sets the description of the list.
+ */
+ set description(name) {
+ if (name) {
+ this.tags.push(["description", name]);
+ } else {
+ this.removeTag("description");
+ }
+ }
+ isEncryptedTagsCacheValid() {
+ return !!(this._encryptedTags && this.encryptedTagsLength === this.content.length);
+ }
+ /**
+ * Returns the decrypted content of the list.
+ */
+ async encryptedTags(useCache = true) {
+ if (useCache && this.isEncryptedTagsCacheValid())
+ return this._encryptedTags;
+ if (!this.ndk)
+ throw new Error("NDK instance not set");
+ if (!this.ndk.signer)
+ throw new Error("NDK signer not set");
+ const user = await this.ndk.signer.user();
+ try {
+ if (this.content.length > 0) {
+ try {
+ const decryptedContent = await this.ndk.signer.decrypt(user, this.content);
+ const a = JSON.parse(decryptedContent);
+ if (a && a[0]) {
+ this.encryptedTagsLength = this.content.length;
+ return this._encryptedTags = a;
+ }
+ this.encryptedTagsLength = this.content.length;
+ return this._encryptedTags = [];
+ } catch (e) {
+ console.log(`error decrypting ${this.content}`);
+ }
+ }
+ } catch (e) {
+ }
+ return [];
+ }
+ /**
+ * This method can be overriden to validate that a tag is valid for this list.
+ *
+ * (i.e. the NDKPersonList can validate that items are NDKUser instances)
+ */
+ validateTag(tagValue) {
+ return true;
+ }
+ /**
+ * Returns the unecrypted items in this list.
+ */
+ get items() {
+ return this.tags.filter((t) => {
+ return ![
+ "d",
+ "L",
+ "l",
+ "title",
+ "name",
+ "description",
+ "summary",
+ "image",
+ "thumb",
+ "alt",
+ "expiration",
+ "subject"
+ ].includes(t[0]);
+ });
+ }
+ /**
+ * Adds a new item to the list.
+ * @param relay Relay to add
+ * @param mark Optional mark to add to the item
+ * @param encrypted Whether to encrypt the item
+ */
+ async addItem(item, mark = void 0, encrypted = false) {
+ if (!this.ndk)
+ throw new Error("NDK instance not set");
+ if (!this.ndk.signer)
+ throw new Error("NDK signer not set");
+ let tags;
+ if (item instanceof NDKEvent) {
+ tags = item.referenceTags();
+ } else if (item instanceof NDKUser) {
+ tags = item.referenceTags();
+ } else if (item instanceof NDKRelay) {
+ tags = item.referenceTags();
+ } else if (Array.isArray(item)) {
+ tags = [item];
+ } else {
+ throw new Error("Invalid object type");
+ }
+ if (mark)
+ tags[0].push(mark);
+ if (encrypted) {
+ const user = await this.ndk.signer.user();
+ const currentList = await this.encryptedTags();
+ currentList.push(...tags);
+ this._encryptedTags = currentList;
+ this.encryptedTagsLength = this.content.length;
+ this.content = JSON.stringify(currentList);
+ await this.encrypt(user);
+ } else {
+ this.tags.push(...tags);
+ }
+ this.created_at = Math.floor(Date.now() / 1e3);
+ this.emit("change");
+ }
+ /**
+ * Removes an item from the list.
+ *
+ * @param index The index of the item to remove.
+ * @param encrypted Whether to remove from the encrypted list or not.
+ */
+ async removeItem(index, encrypted) {
+ if (!this.ndk)
+ throw new Error("NDK instance not set");
+ if (!this.ndk.signer)
+ throw new Error("NDK signer not set");
+ if (encrypted) {
+ const user = await this.ndk.signer.user();
+ const currentList = await this.encryptedTags();
+ currentList.splice(index, 1);
+ this._encryptedTags = currentList;
+ this.encryptedTagsLength = this.content.length;
+ this.content = JSON.stringify(currentList);
+ await this.encrypt(user);
+ } else {
+ this.tags.splice(index, 1);
+ }
+ this.created_at = Math.floor(Date.now() / 1e3);
+ this.emit("change");
+ return this;
+ }
+};
+var lists_default = NDKList;
+
+// src/user/pin.ts
+async function pin(event, pinEvent, publish) {
+ const kind = 10001 /* PinList */;
+ if (!this.ndk)
+ throw new Error("No NDK instance found");
+ this.ndk.assertSigner();
+ if (!pinEvent) {
+ const events = await this.ndk.fetchEvents(
+ { kinds: [kind], authors: [this.pubkey] },
+ { cacheUsage: "ONLY_RELAY" /* ONLY_RELAY */ }
+ );
+ if (events.size > 0) {
+ pinEvent = lists_default.from(Array.from(events)[0]);
+ } else {
+ pinEvent = new NDKEvent(this.ndk, {
+ kind
+ });
+ }
+ }
+ pinEvent.tag(event);
+ if (publish) {
+ await pinEvent.publish();
+ }
+ return pinEvent;
+}
+
// src/user/index.ts
var NDKUser = class {
ndk;
@@ -2112,7 +2650,7 @@ var NDKUser = class {
if (!this._npub) {
if (!this._pubkey)
throw new Error("hexpubkey not set");
- this._npub = import_nostr_tools8.nip19.npubEncode(this.hexpubkey);
+ this._npub = import_nostr_tools8.nip19.npubEncode(this.pubkey);
}
return this._npub;
}
@@ -2164,7 +2702,7 @@ var NDKUser = class {
const profile = await import_nostr_tools8.nip05.queryProfile(nip05Id);
if (profile) {
return new NDKUser({
- hexpubkey: profile.pubkey,
+ pubkey: profile.pubkey,
relayUrls: profile.relays
});
}
@@ -2181,7 +2719,7 @@ var NDKUser = class {
this.profile = {};
let setMetadataEvents = null;
if (this.ndk.cacheAdapter && this.ndk.cacheAdapter.fetchProfile && opts?.cacheUsage !== "ONLY_RELAY" /* ONLY_RELAY */) {
- const profile = await this.ndk.cacheAdapter.fetchProfile(this.hexpubkey);
+ const profile = await this.ndk.cacheAdapter.fetchProfile(this.pubkey);
if (profile) {
this.profile = profile;
return profile;
@@ -2193,7 +2731,7 @@ var NDKUser = class {
setMetadataEvents = await this.ndk.fetchEvents(
{
kinds: [0],
- authors: [this.hexpubkey]
+ authors: [this.pubkey]
},
{
cacheUsage: "ONLY_CACHE" /* ONLY_CACHE */,
@@ -2212,7 +2750,7 @@ var NDKUser = class {
setMetadataEvents = await this.ndk.fetchEvents(
{
kinds: [0],
- authors: [this.hexpubkey]
+ authors: [this.pubkey]
},
opts
);
@@ -2224,7 +2762,7 @@ var NDKUser = class {
return null;
this.profile = profileFromEvent(sortedSetMetadataEvents[0]);
if (this.profile && this.ndk.cacheAdapter && this.ndk.cacheAdapter.saveProfile) {
- this.ndk.cacheAdapter.saveProfile(this.hexpubkey, this.profile);
+ this.ndk.cacheAdapter.saveProfile(this.pubkey, this.profile);
}
return this.profile;
}
@@ -2232,6 +2770,10 @@ var NDKUser = class {
* Returns a set of users that this user follows.
*/
follows = follows.bind(this);
+ /**
+ * Pins a user or an event
+ */
+ pin = pin.bind(this);
/**
* Returns a set of relay list events for a user.
* @returns {Promise>} A set of NDKEvents returned for the given user.
@@ -2247,13 +2789,13 @@ var NDKUser = class {
const event = await this.ndk.fetchEvent(
{
kinds: [10002],
- authors: [this.hexpubkey]
+ authors: [this.pubkey]
},
{
closeOnEose: true,
pool,
groupable: true,
- subId: `relay-list-${this.hexpubkey.slice(0, 6)}`
+ subId: `relay-list-${this.pubkey.slice(0, 6)}`
},
relaySet
);
@@ -2266,7 +2808,7 @@ var NDKUser = class {
throw new Error("NDK not set");
const followList = await this.ndk.fetchEvent({
kinds: [3],
- authors: [this.hexpubkey]
+ authors: [this.pubkey]
});
if (followList) {
try {
@@ -2300,14 +2842,18 @@ var NDKUser = class {
* @returns {NDKTag} an NDKTag
*/
tagReference() {
- return ["p", this.hexpubkey];
+ return ["p", this.pubkey];
}
/**
* Get the tags that can be used to reference this user in an event
* @returns {NDKTag[]} an array of NDKTag
*/
- referenceTags() {
- return [["p", this.hexpubkey]];
+ referenceTags(marker) {
+ const tag = [["p", this.pubkey]];
+ if (!marker)
+ return tag;
+ tag[0].push("", marker);
+ return tag;
}
/**
* Publishes the current profile.
@@ -2355,8 +2901,8 @@ var NDKUser = class {
* Validate a user's NIP-05 identifier (usually fetched from their kind:0 profile data)
*
* @param nip05Id The NIP-05 string to validate
- * @returns {Promise} True if the NIP-05 is found and matches this user's hexpubkey,
- * False if the NIP-05 is found but doesn't match this user's hexpubkey,
+ * @returns {Promise} True if the NIP-05 is found and matches this user's pubkey,
+ * False if the NIP-05 is found but doesn't match this user's pubkey,
* null if the NIP-05 isn't found on the domain or we're unable to verify (because of network issues, etc.)
*/
async validateNip05(nip05Id) {
@@ -2365,7 +2911,7 @@ var NDKUser = class {
const profilePointer = await import_nostr_tools8.nip05.queryProfile(nip05Id);
if (profilePointer === null)
return null;
- return profilePointer.pubkey === this.hexpubkey;
+ return profilePointer.pubkey === this.pubkey;
}
/**
* Zap a user
@@ -2812,216 +3358,6 @@ var NDKTranscriptionDVM = class extends NDKDVMRequest {
}
};
-// src/events/kinds/lists/index.ts
-var NDKList = class extends NDKEvent {
- _encryptedTags;
- /**
- * Stores the number of bytes the content was before decryption
- * to expire the cache when the content changes.
- */
- encryptedTagsLength;
- constructor(ndk, rawEvent) {
- super(ndk, rawEvent);
- this.kind ??= 30001 /* CategorizedBookmarkList */;
- }
- /**
- * Wrap a NDKEvent into a NDKList
- */
- static from(ndkEvent) {
- return new NDKList(ndkEvent.ndk, ndkEvent.rawEvent());
- }
- /**
- * Returns the title of the list. Falls back on fetching the name tag value.
- */
- get title() {
- const titleTag = this.tagValue("title") || this.tagValue("name");
- if (this.kind === 3 /* Contacts */ && !titleTag) {
- return "Contacts";
- } else if (this.kind === 1e4 /* MuteList */ && !titleTag) {
- return "Mute";
- } else if (this.kind === 10001 /* PinList */ && !titleTag) {
- return "Pin";
- } else if (this.kind === 10002 /* RelayList */ && !titleTag) {
- return "Relay Metadata";
- } else {
- return titleTag ?? this.tagValue("d");
- }
- }
- /**
- * Sets the title of the list.
- */
- set title(title) {
- this.removeTag("title");
- this.removeTag("name");
- if (title) {
- this.tags.push(["title", title]);
- } else {
- throw new Error("Title cannot be empty");
- }
- }
- /**
- * Returns the name of the list.
- * @deprecated Please use "title" instead.
- */
- get name() {
- const nameTag = this.tagValue("name");
- if (this.kind === 3 /* Contacts */ && !nameTag) {
- return "Contacts";
- } else if (this.kind === 1e4 /* MuteList */ && !nameTag) {
- return "Mute";
- } else if (this.kind === 10001 /* PinList */ && !nameTag) {
- return "Pin";
- } else if (this.kind === 10002 /* RelayList */ && !nameTag) {
- return "Relay Metadata";
- } else {
- return nameTag ?? this.tagValue("d");
- }
- }
- /**
- * Sets the name of the list.
- * @deprecated Please use "title" instead. This method will use the `title` tag instead.
- */
- set name(name) {
- this.removeTag("name");
- if (name) {
- this.tags.push(["title", name]);
- } else {
- throw new Error("Name cannot be empty");
- }
- }
- /**
- * Returns the description of the list.
- */
- get description() {
- return this.tagValue("description");
- }
- /**
- * Sets the description of the list.
- */
- set description(name) {
- if (name) {
- this.tags.push(["description", name]);
- } else {
- this.removeTag("description");
- }
- }
- isEncryptedTagsCacheValid() {
- return !!(this._encryptedTags && this.encryptedTagsLength === this.content.length);
- }
- /**
- * Returns the decrypted content of the list.
- */
- async encryptedTags(useCache = true) {
- if (useCache && this.isEncryptedTagsCacheValid())
- return this._encryptedTags;
- if (!this.ndk)
- throw new Error("NDK instance not set");
- if (!this.ndk.signer)
- throw new Error("NDK signer not set");
- const user = await this.ndk.signer.user();
- try {
- if (this.content.length > 0) {
- try {
- const decryptedContent = await this.ndk.signer.decrypt(user, this.content);
- const a = JSON.parse(decryptedContent);
- if (a && a[0]) {
- this.encryptedTagsLength = this.content.length;
- return this._encryptedTags = a;
- }
- this.encryptedTagsLength = this.content.length;
- return this._encryptedTags = [];
- } catch (e) {
- console.log(`error decrypting ${this.content}`);
- }
- }
- } catch (e) {
- }
- return [];
- }
- /**
- * This method can be overriden to validate that a tag is valid for this list.
- *
- * (i.e. the NDKPersonList can validate that items are NDKUser instances)
- */
- validateTag(tagValue) {
- return true;
- }
- /**
- * Returns the unecrypted items in this list.
- */
- get items() {
- return this.tags.filter((t) => {
- return !["d", "name", "description"].includes(t[0]);
- });
- }
- /**
- * Adds a new item to the list.
- * @param relay Relay to add
- * @param mark Optional mark to add to the item
- * @param encrypted Whether to encrypt the item
- */
- async addItem(item, mark = void 0, encrypted = false) {
- if (!this.ndk)
- throw new Error("NDK instance not set");
- if (!this.ndk.signer)
- throw new Error("NDK signer not set");
- let tags;
- if (item instanceof NDKEvent) {
- tags = item.referenceTags();
- } else if (item instanceof NDKUser) {
- tags = item.referenceTags();
- } else if (item instanceof NDKRelay) {
- tags = item.referenceTags();
- } else if (Array.isArray(item)) {
- tags = [item];
- } else {
- throw new Error("Invalid object type");
- }
- if (mark)
- tags[0].push(mark);
- if (encrypted) {
- const user = await this.ndk.signer.user();
- const currentList = await this.encryptedTags();
- currentList.push(...tags);
- this._encryptedTags = currentList;
- this.encryptedTagsLength = this.content.length;
- this.content = JSON.stringify(currentList);
- await this.encrypt(user);
- } else {
- this.tags.push(...tags);
- }
- this.created_at = Math.floor(Date.now() / 1e3);
- this.emit("change");
- }
- /**
- * Removes an item from the list.
- *
- * @param index The index of the item to remove.
- * @param encrypted Whether to remove from the encrypted list or not.
- */
- async removeItem(index, encrypted) {
- if (!this.ndk)
- throw new Error("NDK instance not set");
- if (!this.ndk.signer)
- throw new Error("NDK signer not set");
- if (encrypted) {
- const user = await this.ndk.signer.user();
- const currentList = await this.encryptedTags();
- currentList.splice(index, 1);
- this._encryptedTags = currentList;
- this.encryptedTagsLength = this.content.length;
- this.content = JSON.stringify(currentList);
- await this.encrypt(user);
- } else {
- this.tags.splice(index, 1);
- }
- this.created_at = Math.floor(Date.now() / 1e3);
- this.emit("change");
- return this;
- }
-};
-var lists_default = NDKList;
-
// src/events/kinds/repost.ts
var NDKRepost = class extends NDKEvent {
_repostedEvents;
@@ -3153,6 +3489,17 @@ var NDKNip07Signer = class {
const signedEvent = await window.nostr.signEvent(event);
return signedEvent.sig;
}
+ async relays() {
+ await this.waitForExtension();
+ const relays = await window.nostr.getRelays?.() || {};
+ const activeRelays = [];
+ for (const url in Object.keys(relays)) {
+ if (relays[url].read && relays[url].write) {
+ activeRelays.push(url);
+ }
+ }
+ return activeRelays.map((url) => new NDKRelay(url));
+ }
async encrypt(recipient, value) {
await this.waitForExtension();
const recipientHexPubKey = recipient.hexpubkey;
@@ -3291,8 +3638,8 @@ var NDKPrivateKeySigner = class {
};
// src/signers/nip46/rpc.ts
-var import_eventemitter36 = __toESM(require("eventemitter3"));
-var NDKNostrRpc = class extends import_eventemitter36.default {
+var import_tseep6 = require("tseep");
+var NDKNostrRpc = class extends import_tseep6.EventEmitter {
ndk;
signer;
debug;
@@ -3305,8 +3652,11 @@ var NDKNostrRpc = class extends import_eventemitter36.default {
/**
* Subscribe to a filter. This function will resolve once the subscription is ready.
*/
- async subscribe(filter) {
- const sub = this.ndk.subscribe(filter, { closeOnEose: false });
+ subscribe(filter) {
+ const sub = this.ndk.subscribe(filter, {
+ closeOnEose: false,
+ groupable: false
+ });
sub.on("event", async (event) => {
try {
const parsedEvent = await this.parseEvent(event);
@@ -3366,8 +3716,15 @@ var NDKNostrRpc = class extends import_eventemitter36.default {
const remoteUser = this.ndk.getUser({ hexpubkey: remotePubkey });
const request = { id, method, params };
const promise = new Promise((resolve) => {
- if (cb)
- this.once(`response-${id}`, cb);
+ const responseHandler = (response) => {
+ if (response.result === "auth_url") {
+ this.once(`response-${id}`, responseHandler);
+ this.emit("authUrl", response.error);
+ } else if (cb) {
+ cb(response);
+ }
+ };
+ this.once(`response-${id}`, responseHandler);
});
const event = new NDKEvent(this.ndk, {
kind,
@@ -3385,7 +3742,7 @@ var NDKNostrRpc = class extends import_eventemitter36.default {
// src/signers/nip46/backend/connect.ts
var ConnectEventHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
+ async handle(backend, id, remotePubkey, params) {
const [pubkey, token] = params;
const debug4 = backend.debug.extend("connect");
debug4(`connection request from ${pubkey}`);
@@ -3393,7 +3750,7 @@ var ConnectEventHandlingStrategy = class {
debug4(`applying token`);
await backend.applyToken(pubkey, token);
}
- if (await backend.pubkeyAllowed(pubkey, "connect", token)) {
+ if (await backend.pubkeyAllowed({ id, pubkey, method: "connect", params: token })) {
debug4(`connection request from ${pubkey} allowed`);
return "ack";
} else {
@@ -3403,50 +3760,84 @@ var ConnectEventHandlingStrategy = class {
}
};
-// src/signers/nip46/backend/describe.ts
-var DescribeHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
- const keys = Object.keys(backend.handlers);
- return JSON.stringify(keys);
- }
-};
-
// src/signers/nip46/backend/get-public-key.ts
var GetPublicKeyHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
- return backend.localUser?.hexpubkey;
+ async handle(backend, id, remotePubkey, params) {
+ return backend.localUser?.pubkey;
}
};
// src/signers/nip46/backend/nip04-decrypt.ts
var Nip04DecryptHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
+ async handle(backend, id, remotePubkey, params) {
const [senderPubkey, payload] = params;
const senderUser = new NDKUser({ hexpubkey: senderPubkey });
- const decryptedPayload = await backend.decrypt(remotePubkey, senderUser, payload);
+ const decryptedPayload = await decrypt2(backend, id, remotePubkey, senderUser, payload);
return JSON.stringify([decryptedPayload]);
}
};
+async function decrypt2(backend, id, remotePubkey, senderUser, payload) {
+ if (!await backend.pubkeyAllowed({
+ id,
+ pubkey: remotePubkey,
+ method: "decrypt",
+ params: payload
+ })) {
+ backend.debug(`decrypt request from ${remotePubkey} rejected`);
+ return void 0;
+ }
+ return await backend.signer.decrypt(senderUser, payload);
+}
// src/signers/nip46/backend/nip04-encrypt.ts
var Nip04EncryptHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
+ async handle(backend, id, remotePubkey, params) {
const [recipientPubkey, payload] = params;
const recipientUser = new NDKUser({ hexpubkey: recipientPubkey });
- const decryptedPayload = await backend.encrypt(remotePubkey, recipientUser, payload);
- return decryptedPayload;
+ const encryptedPayload = await encrypt2(backend, id, remotePubkey, recipientUser, payload);
+ return encryptedPayload;
}
};
+async function encrypt2(backend, id, remotePubkey, recipientUser, payload) {
+ if (!await backend.pubkeyAllowed({
+ id,
+ pubkey: remotePubkey,
+ method: "encrypt",
+ params: payload
+ })) {
+ backend.debug(`encrypt request from ${remotePubkey} rejected`);
+ return void 0;
+ }
+ return await backend.signer.encrypt(recipientUser, payload);
+}
// src/signers/nip46/backend/sign-event.ts
var SignEventHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
- const event = await backend.signEvent(remotePubkey, params);
+ async handle(backend, id, remotePubkey, params) {
+ const event = await signEvent(backend, id, remotePubkey, params);
if (!event)
return void 0;
return JSON.stringify(await event.toNostrEvent());
}
};
+async function signEvent(backend, id, remotePubkey, params) {
+ const [eventString] = params;
+ backend.debug(`sign event request from ${remotePubkey}`);
+ const event = new NDKEvent(backend.ndk, JSON.parse(eventString));
+ backend.debug("event to sign", event.rawEvent());
+ if (!await backend.pubkeyAllowed({
+ id,
+ pubkey: remotePubkey,
+ method: "sign_event",
+ params: event
+ })) {
+ backend.debug(`sign event request from ${remotePubkey} rejected`);
+ return void 0;
+ }
+ backend.debug(`sign event request from ${remotePubkey} allowed`);
+ await event.sign(backend.signer);
+ return event;
+}
// src/signers/nip46/backend/index.ts
var NDKNip46Backend = class {
@@ -3487,8 +3878,7 @@ var NDKNip46Backend = class {
sign_event: new SignEventHandlingStrategy(),
nip04_encrypt: new Nip04EncryptHandlingStrategy(),
nip04_decrypt: new Nip04DecryptHandlingStrategy(),
- get_public_key: new GetPublicKeyHandlingStrategy(),
- describe: new DescribeHandlingStrategy()
+ get_public_key: new GetPublicKeyHandlingStrategy()
};
/**
* Enables the user to set a custom strategy for handling incoming events.
@@ -3519,7 +3909,7 @@ var NDKNip46Backend = class {
const strategy = this.handlers[method];
if (strategy) {
try {
- response = await strategy.handle(this, remotePubkey, params);
+ response = await strategy.handle(this, id, remotePubkey, params);
} catch (e) {
this.debug("error handling event", e, { id, method, params });
this.rpc.sendResponse(id, remotePubkey, "error", void 0, e.message);
@@ -3534,82 +3924,66 @@ var NDKNip46Backend = class {
this.rpc.sendResponse(id, remotePubkey, "error", void 0, "Not authorized");
}
}
- async decrypt(remotePubkey, senderUser, payload) {
- if (!await this.pubkeyAllowed(remotePubkey, "decrypt", payload)) {
- this.debug(`decrypt request from ${remotePubkey} rejected`);
- return void 0;
- }
- return await this.signer.decrypt(senderUser, payload);
- }
- async encrypt(remotePubkey, recipientUser, payload) {
- if (!await this.pubkeyAllowed(remotePubkey, "encrypt", payload)) {
- this.debug(`encrypt request from ${remotePubkey} rejected`);
- return void 0;
- }
- return await this.signer.encrypt(recipientUser, payload);
- }
- async signEvent(remotePubkey, params) {
- const [eventString] = params;
- this.debug(`sign event request from ${remotePubkey}`);
- const event = new NDKEvent(this.ndk, JSON.parse(eventString));
- this.debug("event to sign", event.rawEvent());
- if (!await this.pubkeyAllowed(remotePubkey, "sign_event", event)) {
- this.debug(`sign event request from ${remotePubkey} rejected`);
- return void 0;
- }
- this.debug(`sign event request from ${remotePubkey} allowed`);
- await event.sign(this.signer);
- return event;
- }
/**
* This method should be overriden by the user to allow or reject incoming
* connections.
*/
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- async pubkeyAllowed(pubkey, method, params) {
- return this.permitCallback(pubkey, method, params);
+ async pubkeyAllowed(params) {
+ return this.permitCallback(params);
}
};
+// ../node_modules/eventemitter3/index.mjs
+var import_index6 = __toESM(require_eventemitter3(), 1);
+var eventemitter3_default = import_index6.default;
+
// src/signers/nip46/index.ts
-var NDKNip46Signer = class {
+var NDKNip46Signer = class extends eventemitter3_default {
ndk;
remoteUser;
remotePubkey;
token;
localSigner;
+ nip05;
rpc;
debug;
/**
* @param ndk - The NDK instance to use
- * @param tokenOrRemotePubkey - The public key, or a connection token, of the npub that wants to be published as
+ * @param tokenOrRemoteUser - The public key, or a connection token, of the npub that wants to be published as
* @param localSigner - The signer that will be used to request events to be signed
*/
- constructor(ndk, tokenOrRemotePubkey, localSigner) {
+ constructor(ndk, tokenOrRemoteUser, localSigner) {
+ super();
let remotePubkey;
let token;
- if (tokenOrRemotePubkey.includes("#")) {
- const parts = tokenOrRemotePubkey.split("#");
- remotePubkey = new NDKUser({ npub: parts[0] }).hexpubkey;
+ if (tokenOrRemoteUser.includes("#")) {
+ const parts = tokenOrRemoteUser.split("#");
+ remotePubkey = new NDKUser({ npub: parts[0] }).pubkey;
token = parts[1];
- } else if (tokenOrRemotePubkey.startsWith("npub")) {
+ } else if (tokenOrRemoteUser.startsWith("npub")) {
remotePubkey = new NDKUser({
- npub: tokenOrRemotePubkey
- }).hexpubkey;
+ npub: tokenOrRemoteUser
+ }).pubkey;
+ } else if (tokenOrRemoteUser.match(/\./)) {
+ this.nip05 = tokenOrRemoteUser;
} else {
- remotePubkey = tokenOrRemotePubkey;
+ remotePubkey = tokenOrRemoteUser;
}
this.ndk = ndk;
- this.remotePubkey = remotePubkey;
+ if (remotePubkey)
+ this.remotePubkey = remotePubkey;
this.token = token;
this.debug = ndk.debug.extend("nip46:signer");
- this.remoteUser = new NDKUser({ hexpubkey: remotePubkey });
+ this.remoteUser = new NDKUser({ pubkey: remotePubkey });
if (!localSigner) {
this.localSigner = NDKPrivateKeySigner.generate();
} else {
this.localSigner = localSigner;
}
this.rpc = new NDKNostrRpc(ndk, this.localSigner, this.debug);
+ this.rpc.on("authUrl", (...props) => {
+ this.emit("authUrl", ...props);
+ });
}
/**
* Get the user that is being published as
@@ -3619,14 +3993,25 @@ var NDKNip46Signer = class {
}
async blockUntilReady() {
const localUser = await this.localSigner.user();
- const user = this.ndk.getUser({ npub: localUser.npub });
+ const remoteUser = this.ndk.getUser({ pubkey: this.remotePubkey });
+ if (this.nip05 && !this.remotePubkey) {
+ const remoteUser2 = NDKUser.fromNip05(this.nip05).then((user) => {
+ if (user) {
+ this.remoteUser = user;
+ this.remotePubkey = user.pubkey;
+ }
+ });
+ }
+ if (!this.remotePubkey) {
+ throw new Error("Remote pubkey not set");
+ }
await this.rpc.subscribe({
kinds: [24133],
- "#p": [localUser.hexpubkey]
+ "#p": [localUser.pubkey]
});
return new Promise((resolve, reject) => {
setTimeout(() => {
- const connectParams = [localUser.hexpubkey];
+ const connectParams = [localUser.pubkey];
if (this.token) {
connectParams.push(this.token);
}
@@ -3637,7 +4022,7 @@ var NDKNip46Signer = class {
24133,
(response) => {
if (response.result === "ack") {
- resolve(user);
+ resolve(remoteUser);
} else {
reject(response.error);
}
@@ -3652,7 +4037,7 @@ var NDKNip46Signer = class {
this.rpc.sendRequest(
this.remotePubkey,
"nip04_encrypt",
- [recipient.hexpubkey, value],
+ [recipient.pubkey, value],
24133,
(response) => {
if (!response.error) {
@@ -3671,7 +4056,7 @@ var NDKNip46Signer = class {
this.rpc.sendRequest(
this.remotePubkey,
"nip04_decrypt",
- [sender.hexpubkey, value],
+ [sender.pubkey, value],
24133,
(response) => {
if (!response.error) {
@@ -3710,7 +4095,7 @@ var NDKNip46Signer = class {
// src/ndk/index.ts
var import_debug3 = __toESM(require("debug"));
-var import_eventemitter39 = __toESM(require("eventemitter3"));
+var import_tseep9 = require("tseep");
// src/events/dedup.ts
function dedup(event1, event2) {
@@ -3721,7 +4106,7 @@ function dedup(event1, event2) {
}
// src/outbox/tracker.ts
-var import_eventemitter37 = __toESM(require("eventemitter3"));
+var import_tseep7 = require("tseep");
var import_typescript_lru_cache = require("typescript-lru-cache");
var OutboxItem = class {
/**
@@ -3741,7 +4126,7 @@ var OutboxItem = class {
this.writeRelays = /* @__PURE__ */ new Set();
}
};
-var OutboxTracker = class extends import_eventemitter37.default {
+var OutboxTracker = class extends import_tseep7.EventEmitter {
data;
ndk;
debug;
@@ -3817,8 +4202,8 @@ function getTypeFromItem(item) {
}
// src/relay/pool/index.ts
-var import_eventemitter38 = __toESM(require("eventemitter3"));
-var NDKPool = class extends import_eventemitter38.default {
+var import_tseep8 = require("tseep");
+var NDKPool = class extends import_tseep8.EventEmitter {
// TODO: This should probably be an LRU cache
relays = /* @__PURE__ */ new Map();
blacklistRelayUrls;
@@ -3869,9 +4254,9 @@ var NDKPool = class extends import_eventemitter38.default {
this.debug(`Relay ${relayUrl} is blacklisted`);
return;
}
- relay.on("notice", (relay2, notice) => this.emit("notice", relay2, notice));
+ relay.on("notice", async (relay2, notice) => this.emit("notice", relay2, notice));
relay.on("connect", () => this.handleRelayConnect(relayUrl));
- relay.on("disconnect", () => this.emit("relay:disconnect", relay));
+ relay.on("disconnect", async () => this.emit("relay:disconnect", relay));
relay.on("flapping", () => this.handleFlapping(relay));
this.relays.set(relayUrl, relay);
if (connect) {
@@ -4047,7 +4432,7 @@ var DEFAULT_BLACKLISTED_RELAYS = [
"wss://brb.io"
// BRB
];
-var NDK = class extends import_eventemitter39.default {
+var NDK = class extends import_tseep9.EventEmitter {
explicitRelayUrls;
pool;
outboxPool;
@@ -4058,6 +4443,7 @@ var NDK = class extends import_eventemitter39.default {
devWriteRelaySet;
outboxTracker;
mutedIds;
+ client;
autoConnectUserRelays = true;
autoFetchUserMutelist = true;
constructor(opts = {}) {
@@ -4068,6 +4454,7 @@ var NDK = class extends import_eventemitter39.default {
this.debug(`Starting with explicit relays: ${JSON.stringify(this.explicitRelayUrls)}`);
this.autoConnectUserRelays = opts.autoConnectUserRelays ?? true;
this.autoFetchUserMutelist = opts.autoFetchUserMutelist ?? true;
+ this.client = opts.client;
if (opts.enableOutboxModel) {
this.outboxPool = new NDKPool(
opts.outboxRelayUrls || DEFAULT_OUTBOX_RELAYS,
@@ -4125,7 +4512,7 @@ var NDK = class extends import_eventemitter39.default {
const muteLists = await this.fetchEvents([
{ kinds: [1e4 /* MuteList */], authors: [user2.pubkey] },
{
- kinds: [3e4 /* CategorizedPeopleList */],
+ kinds: [3e4 /* FollowSet */],
authors: [user2.pubkey],
"#d": ["mute"],
limit: 1
@@ -4182,6 +4569,13 @@ var NDK = class extends import_eventemitter39.default {
* If the timeout is reached, the connection will be continued to be established in the background.
*/
async connect(timeoutMs) {
+ if (this._signer && this.autoConnectUserRelays) {
+ this.debug("Attempting to connect to user relays specified by signer");
+ if (this._signer.relays) {
+ const relays = await this._signer.relays();
+ relays.forEach((relay) => this.pool.addRelay(relay));
+ }
+ }
const connections = [this.pool.connect(timeoutMs)];
if (this.outboxPool) {
connections.push(this.outboxPool.connect(timeoutMs));
diff --git a/node_modules/@nostr-dev-kit/ndk/dist/index.mjs b/node_modules/@nostr-dev-kit/ndk/dist/index.mjs
index 574401d7..69561c63 100644
--- a/node_modules/@nostr-dev-kit/ndk/dist/index.mjs
+++ b/node_modules/@nostr-dev-kit/ndk/dist/index.mjs
@@ -1,13 +1,221 @@
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __commonJS = (cb, mod) => function __require() {
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+ // If the importer is in node compatibility mode or this is not an ESM
+ // file that has been converted to a CommonJS file using a Babel-
+ // compatible transform (i.e. "__esModule" has not been set), then set
+ // "default" to the CommonJS "module.exports" for node compatibility.
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+ mod
+));
+
+// ../node_modules/eventemitter3/index.js
+var require_eventemitter3 = __commonJS({
+ "../node_modules/eventemitter3/index.js"(exports, module) {
+ "use strict";
+ var has = Object.prototype.hasOwnProperty;
+ var prefix = "~";
+ function Events() {
+ }
+ if (Object.create) {
+ Events.prototype = /* @__PURE__ */ Object.create(null);
+ if (!new Events().__proto__)
+ prefix = false;
+ }
+ function EE(fn, context, once) {
+ this.fn = fn;
+ this.context = context;
+ this.once = once || false;
+ }
+ function addListener(emitter, event, fn, context, once) {
+ if (typeof fn !== "function") {
+ throw new TypeError("The listener must be a function");
+ }
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
+ if (!emitter._events[evt])
+ emitter._events[evt] = listener, emitter._eventsCount++;
+ else if (!emitter._events[evt].fn)
+ emitter._events[evt].push(listener);
+ else
+ emitter._events[evt] = [emitter._events[evt], listener];
+ return emitter;
+ }
+ function clearEvent(emitter, evt) {
+ if (--emitter._eventsCount === 0)
+ emitter._events = new Events();
+ else
+ delete emitter._events[evt];
+ }
+ function EventEmitter11() {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+ EventEmitter11.prototype.eventNames = function eventNames() {
+ var names = [], events, name;
+ if (this._eventsCount === 0)
+ return names;
+ for (name in events = this._events) {
+ if (has.call(events, name))
+ names.push(prefix ? name.slice(1) : name);
+ }
+ if (Object.getOwnPropertySymbols) {
+ return names.concat(Object.getOwnPropertySymbols(events));
+ }
+ return names;
+ };
+ EventEmitter11.prototype.listeners = function listeners(event) {
+ var evt = prefix ? prefix + event : event, handlers = this._events[evt];
+ if (!handlers)
+ return [];
+ if (handlers.fn)
+ return [handlers.fn];
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
+ ee[i] = handlers[i].fn;
+ }
+ return ee;
+ };
+ EventEmitter11.prototype.listenerCount = function listenerCount(event) {
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
+ if (!listeners)
+ return 0;
+ if (listeners.fn)
+ return 1;
+ return listeners.length;
+ };
+ EventEmitter11.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
+ var evt = prefix ? prefix + event : event;
+ if (!this._events[evt])
+ return false;
+ var listeners = this._events[evt], len = arguments.length, args, i;
+ if (listeners.fn) {
+ if (listeners.once)
+ this.removeListener(event, listeners.fn, void 0, true);
+ switch (len) {
+ case 1:
+ return listeners.fn.call(listeners.context), true;
+ case 2:
+ return listeners.fn.call(listeners.context, a1), true;
+ case 3:
+ return listeners.fn.call(listeners.context, a1, a2), true;
+ case 4:
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
+ case 5:
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
+ case 6:
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ }
+ for (i = 1, args = new Array(len - 1); i < len; i++) {
+ args[i - 1] = arguments[i];
+ }
+ listeners.fn.apply(listeners.context, args);
+ } else {
+ var length = listeners.length, j;
+ for (i = 0; i < length; i++) {
+ if (listeners[i].once)
+ this.removeListener(event, listeners[i].fn, void 0, true);
+ switch (len) {
+ case 1:
+ listeners[i].fn.call(listeners[i].context);
+ break;
+ case 2:
+ listeners[i].fn.call(listeners[i].context, a1);
+ break;
+ case 3:
+ listeners[i].fn.call(listeners[i].context, a1, a2);
+ break;
+ case 4:
+ listeners[i].fn.call(listeners[i].context, a1, a2, a3);
+ break;
+ default:
+ if (!args)
+ for (j = 1, args = new Array(len - 1); j < len; j++) {
+ args[j - 1] = arguments[j];
+ }
+ listeners[i].fn.apply(listeners[i].context, args);
+ }
+ }
+ }
+ return true;
+ };
+ EventEmitter11.prototype.on = function on(event, fn, context) {
+ return addListener(this, event, fn, context, false);
+ };
+ EventEmitter11.prototype.once = function once(event, fn, context) {
+ return addListener(this, event, fn, context, true);
+ };
+ EventEmitter11.prototype.removeListener = function removeListener(event, fn, context, once) {
+ var evt = prefix ? prefix + event : event;
+ if (!this._events[evt])
+ return this;
+ if (!fn) {
+ clearEvent(this, evt);
+ return this;
+ }
+ var listeners = this._events[evt];
+ if (listeners.fn) {
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
+ clearEvent(this, evt);
+ }
+ } else {
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
+ if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
+ events.push(listeners[i]);
+ }
+ }
+ if (events.length)
+ this._events[evt] = events.length === 1 ? events[0] : events;
+ else
+ clearEvent(this, evt);
+ }
+ return this;
+ };
+ EventEmitter11.prototype.removeAllListeners = function removeAllListeners(event) {
+ var evt;
+ if (event) {
+ evt = prefix ? prefix + event : event;
+ if (this._events[evt])
+ clearEvent(this, evt);
+ } else {
+ this._events = new Events();
+ this._eventsCount = 0;
+ }
+ return this;
+ };
+ EventEmitter11.prototype.off = EventEmitter11.prototype.removeListener;
+ EventEmitter11.prototype.addListener = EventEmitter11.prototype.on;
+ EventEmitter11.prefixed = prefix;
+ EventEmitter11.EventEmitter = EventEmitter11;
+ if ("undefined" !== typeof module) {
+ module.exports = EventEmitter11;
+ }
+ }
+});
+
// src/user/index.ts
import { nip05, nip19 as nip194 } from "nostr-tools";
// src/events/index.ts
-import EventEmitter4 from "eventemitter3";
+import { EventEmitter as EventEmitter4 } from "tseep";
import { getEventHash } from "nostr-tools";
// src/relay/index.ts
import debug from "debug";
-import EventEmitter2 from "eventemitter3";
+import { EventEmitter as EventEmitter2 } from "tseep";
// src/relay/connectivity.ts
import { relayInit } from "nostr-tools";
@@ -226,7 +434,7 @@ var NDKRelayPublisher = class {
};
// src/relay/subscriptions.ts
-import EventEmitter from "eventemitter3";
+import { EventEmitter } from "tseep";
import { matchFilter } from "nostr-tools";
// src/subscription/grouping.ts
@@ -887,7 +1095,7 @@ function calculateRelaySetsFromFilters(ndk, filters) {
// src/zap/index.ts
import { bech32 } from "@scure/base";
-import EventEmitter3 from "eventemitter3";
+import { EventEmitter as EventEmitter3 } from "tseep";
import { nip57 } from "nostr-tools";
var DEFAULT_RELAYS = [
"wss://nos.lol",
@@ -998,6 +1206,26 @@ var Zap = class extends EventEmitter3 {
// src/events/content-tagger.ts
import { nip19 as nip192 } from "nostr-tools";
+function mergeTags(tags1, tags2) {
+ const tagMap = /* @__PURE__ */ new Map();
+ const generateKey = (tag) => tag.join(",");
+ const isContained = (smaller, larger) => {
+ return smaller.every((value, index) => value === larger[index]);
+ };
+ const processTag = (tag) => {
+ for (let [key, existingTag] of tagMap) {
+ if (isContained(existingTag, tag) || isContained(tag, existingTag)) {
+ if (tag.length >= existingTag.length) {
+ tagMap.set(key, tag);
+ }
+ return;
+ }
+ }
+ tagMap.set(generateKey(tag), tag);
+ };
+ tags1.concat(tags2).forEach(processTag);
+ return Array.from(tagMap.values());
+}
async function generateContentTags(content, tags = []) {
const tagRegex = /(@|nostr:)(npub|nprofile|note|nevent|naddr)[a-zA-Z0-9]+/g;
const hashtagRegex = /#(\w+)/g;
@@ -1112,6 +1340,8 @@ var NDKKind = /* @__PURE__ */ ((NDKKind2) => {
NDKKind2[NDKKind2["Repost"] = 6] = "Repost";
NDKKind2[NDKKind2["Reaction"] = 7] = "Reaction";
NDKKind2[NDKKind2["BadgeAward"] = 8] = "BadgeAward";
+ NDKKind2[NDKKind2["GroupNote"] = 9] = "GroupNote";
+ NDKKind2[NDKKind2["GroupChat"] = 11] = "GroupChat";
NDKKind2[NDKKind2["GenericRepost"] = 16] = "GenericRepost";
NDKKind2[NDKKind2["ChannelCreation"] = 40] = "ChannelCreation";
NDKKind2[NDKKind2["ChannelMetadata"] = 41] = "ChannelMetadata";
@@ -1127,37 +1357,66 @@ var NDKKind = /* @__PURE__ */ ((NDKKind2) => {
NDKKind2[NDKKind2["DVMReqImageGeneration"] = 5100] = "DVMReqImageGeneration";
NDKKind2[NDKKind2["DVMReqDiscoveryNostrContent"] = 5300] = "DVMReqDiscoveryNostrContent";
NDKKind2[NDKKind2["DVMReqDiscoveryNostrPeople"] = 5301] = "DVMReqDiscoveryNostrPeople";
+ NDKKind2[NDKKind2["DVMReqTimestamping"] = 5900] = "DVMReqTimestamping";
NDKKind2[NDKKind2["DVMJobFeedback"] = 7e3] = "DVMJobFeedback";
- NDKKind2[NDKKind2["ZapRequest"] = 9734] = "ZapRequest";
- NDKKind2[NDKKind2["Zap"] = 9735] = "Zap";
- NDKKind2[NDKKind2["Highlight"] = 9802] = "Highlight";
NDKKind2[NDKKind2["MuteList"] = 1e4] = "MuteList";
NDKKind2[NDKKind2["PinList"] = 10001] = "PinList";
NDKKind2[NDKKind2["RelayList"] = 10002] = "RelayList";
+ NDKKind2[NDKKind2["BookmarkList"] = 10003] = "BookmarkList";
+ NDKKind2[NDKKind2["CommunityList"] = 10004] = "CommunityList";
+ NDKKind2[NDKKind2["PublicChatList"] = 10005] = "PublicChatList";
+ NDKKind2[NDKKind2["BlockRelayList"] = 10006] = "BlockRelayList";
+ NDKKind2[NDKKind2["SearchRelayList"] = 10007] = "SearchRelayList";
+ NDKKind2[NDKKind2["InterestList"] = 10015] = "InterestList";
+ NDKKind2[NDKKind2["EmojiList"] = 10030] = "EmojiList";
+ NDKKind2[NDKKind2["FollowSet"] = 3e4] = "FollowSet";
+ NDKKind2[NDKKind2["CategorizedPeopleList"] = 3e4 /* FollowSet */] = "CategorizedPeopleList";
+ NDKKind2[NDKKind2["CategorizedBookmarkList"] = 30001] = "CategorizedBookmarkList";
+ NDKKind2[NDKKind2["RelaySet"] = 30002] = "RelaySet";
+ NDKKind2[NDKKind2["CategorizedRelayList"] = 30002 /* RelaySet */] = "CategorizedRelayList";
+ NDKKind2[NDKKind2["BookmarkSet"] = 30003] = "BookmarkSet";
+ NDKKind2[NDKKind2["CurationSet"] = 30004] = "CurationSet";
+ NDKKind2[NDKKind2["InterestSet"] = 30015] = "InterestSet";
+ NDKKind2[NDKKind2["InterestsList"] = 30015 /* InterestSet */] = "InterestsList";
+ NDKKind2[NDKKind2["EmojiSet"] = 30030] = "EmojiSet";
+ NDKKind2[NDKKind2["HighlightSet"] = 39802] = "HighlightSet";
+ NDKKind2[NDKKind2["CategorizedHighlightList"] = 39802 /* HighlightSet */] = "CategorizedHighlightList";
+ NDKKind2[NDKKind2["ZapRequest"] = 9734] = "ZapRequest";
+ NDKKind2[NDKKind2["Zap"] = 9735] = "Zap";
+ NDKKind2[NDKKind2["Highlight"] = 9802] = "Highlight";
NDKKind2[NDKKind2["ClientAuth"] = 22242] = "ClientAuth";
NDKKind2[NDKKind2["NostrConnect"] = 24133] = "NostrConnect";
- NDKKind2[NDKKind2["CategorizedPeopleList"] = 3e4] = "CategorizedPeopleList";
- NDKKind2[NDKKind2["CategorizedBookmarkList"] = 30001] = "CategorizedBookmarkList";
NDKKind2[NDKKind2["ProfileBadge"] = 30008] = "ProfileBadge";
NDKKind2[NDKKind2["BadgeDefinition"] = 30009] = "BadgeDefinition";
- NDKKind2[NDKKind2["InterestsList"] = 30015] = "InterestsList";
NDKKind2[NDKKind2["MarketStall"] = 30017] = "MarketStall";
NDKKind2[NDKKind2["MarketProduct"] = 30018] = "MarketProduct";
- NDKKind2[NDKKind2["CategorizedRelayList"] = 30022] = "CategorizedRelayList";
NDKKind2[NDKKind2["Article"] = 30023] = "Article";
NDKKind2[NDKKind2["AppSpecificData"] = 30078] = "AppSpecificData";
NDKKind2[NDKKind2["Classified"] = 30402] = "Classified";
NDKKind2[NDKKind2["AppRecommendation"] = 31989] = "AppRecommendation";
NDKKind2[NDKKind2["AppHandler"] = 31990] = "AppHandler";
- NDKKind2[NDKKind2["CategorizedHighlightList"] = 39802] = "CategorizedHighlightList";
return NDKKind2;
})(NDKKind || {});
var NDKListKinds = [
- 3e4 /* CategorizedPeopleList */,
+ 1e4 /* MuteList */,
+ 10001 /* PinList */,
+ 10002 /* RelayList */,
+ 10003 /* BookmarkList */,
+ 10004 /* CommunityList */,
+ 10005 /* PublicChatList */,
+ 10006 /* BlockRelayList */,
+ 10007 /* SearchRelayList */,
+ 10015 /* InterestList */,
+ 10030 /* EmojiList */,
+ 3e4 /* FollowSet */,
+ 30003 /* BookmarkSet */,
30001 /* CategorizedBookmarkList */,
- 39802 /* CategorizedHighlightList */,
- 30022 /* CategorizedRelayList */,
- 30015 /* InterestsList */
+ // Backwards compatibility
+ 30002 /* RelaySet */,
+ 30004 /* CurationSet */,
+ 30015 /* InterestSet */,
+ 30030 /* EmojiSet */,
+ 39802 /* HighlightSet */
];
// src/events/nip04.ts
@@ -1299,15 +1558,10 @@ var NDKEvent = class extends EventEmitter4 {
return user;
}
tag(userOrEvent, marker) {
- const tags = userOrEvent.referenceTags();
- if (marker)
- tags[0].push(marker);
- this.tags.push(...tags);
+ const skipAuthorTag = userOrEvent?.pubkey === this.pubkey;
+ const tags = userOrEvent.referenceTags(marker, skipAuthorTag);
+ this.tags = mergeTags(this.tags, tags);
if (userOrEvent instanceof NDKEvent) {
- const tagEventAuthor = userOrEvent.author;
- if (tagEventAuthor && this.pubkey !== tagEventAuthor.hexpubkey) {
- this.tag(tagEventAuthor);
- }
for (const pTag of userOrEvent.getMatchingTags("p")) {
if (pTag[1] === this.pubkey)
continue;
@@ -1438,6 +1692,9 @@ var NDKEvent = class extends EventEmitter4 {
tags.push(["d", str]);
}
}
+ if (this.ndk?.client && !this.tagValue("client")) {
+ tags.push(["client", this.ndk.client]);
+ }
return { content: content || "", tags };
}
muted() {
@@ -1498,9 +1755,11 @@ var NDKEvent = class extends EventEmitter4 {
const dTagId = this.replaceableDTag();
return `${this.kind}:${this.pubkey}:${dTagId}`;
}
- /** @deprecated Use referenceTags instead. */
/**
- * Get the tag that can be used to reference this event from another event
+ * Get the tag that can be used to reference this event from another event.
+ *
+ * Consider using referenceTags() instead (unless you have a good reason to use this)
+ *
* @example
* event = new NDKEvent(ndk, { kind: 30000, pubkey: 'pubkey', tags: [ ["d", "d-code"] ] });
* event.tagReference(); // ["a", "30000:pubkey:d-code"]
@@ -1509,11 +1768,22 @@ var NDKEvent = class extends EventEmitter4 {
* event.tagReference(); // ["e", "eventid"]
* @returns {NDKTag} The NDKTag object referencing this event
*/
- tagReference() {
+ tagReference(marker) {
+ let tag;
if (this.isParamReplaceable()) {
- return ["a", this.tagAddress()];
+ tag = ["a", this.tagAddress()];
+ } else {
+ tag = ["e", this.tagId()];
}
- return ["e", this.tagId()];
+ if (this.relay) {
+ tag.push(this.relay.url);
+ } else {
+ tag.push("");
+ }
+ if (marker) {
+ tag.push(marker);
+ }
+ return tag;
}
/**
* Get the tags that can be used to reference this event from another event
@@ -1526,7 +1796,7 @@ var NDKEvent = class extends EventEmitter4 {
* event.referenceTags(); // [["e", "parent-id"]]
* @returns {NDKTag} The NDKTag object referencing this event
*/
- referenceTags(marker) {
+ referenceTags(marker, skipAuthorTag) {
let tags = [];
if (this.isParamReplaceable()) {
tags = [
@@ -1536,10 +1806,22 @@ var NDKEvent = class extends EventEmitter4 {
} else {
tags = [["e", this.id]];
}
+ if (this.relay?.url) {
+ tags = tags.map((tag) => {
+ tag.push(this.relay?.url);
+ return tag;
+ });
+ } else if (marker) {
+ tags = tags.map((tag) => {
+ tag.push("");
+ return tag;
+ });
+ }
if (marker) {
tags.forEach((tag) => tag.push(marker));
}
- tags.push(...this.author.referenceTags());
+ if (!skipAuthorTag)
+ tags.push(...this.author.referenceTags());
return tags;
}
/**
@@ -1679,7 +1961,7 @@ var NDKRelayList = class extends NDKEvent {
};
// src/subscription/index.ts
-import EventEmitter5 from "eventemitter3";
+import { EventEmitter as EventEmitter5 } from "tseep";
var NDKSubscriptionCacheUsage = /* @__PURE__ */ ((NDKSubscriptionCacheUsage2) => {
NDKSubscriptionCacheUsage2["ONLY_CACHE"] = "ONLY_CACHE";
NDKSubscriptionCacheUsage2["CACHE_FIRST"] = "CACHE_FIRST";
@@ -1919,13 +2201,15 @@ var NDKSubscription = class extends EventEmitter5 {
async function follows(opts, outbox) {
if (!this.ndk)
throw new Error("NDK not set");
- const contactListEvent = await this.ndk.fetchEvent(
- {
- kinds: [3],
- authors: [this.hexpubkey]
- },
- opts || { groupable: false }
- );
+ const contactListEvent = Array.from(
+ await this.ndk.fetchEvents(
+ {
+ kinds: [3],
+ authors: [this.pubkey]
+ },
+ opts || { groupable: false }
+ )
+ )[0];
if (contactListEvent) {
const pubkeys = /* @__PURE__ */ new Set();
contactListEvent.tags.forEach((tag) => {
@@ -1939,8 +2223,8 @@ async function follows(opts, outbox) {
}
}
});
- return [...pubkeys].reduce((acc, hexpubkey) => {
- const user = new NDKUser({ hexpubkey });
+ return [...pubkeys].reduce((acc, pubkey) => {
+ const user = new NDKUser({ pubkey });
user.ndk = this.ndk;
acc.add(user);
return acc;
@@ -2023,6 +2307,283 @@ function serializeProfile(profile) {
return JSON.stringify(payload);
}
+// src/events/kinds/lists/index.ts
+var NDKList = class extends NDKEvent {
+ _encryptedTags;
+ /**
+ * Stores the number of bytes the content was before decryption
+ * to expire the cache when the content changes.
+ */
+ encryptedTagsLength;
+ constructor(ndk, rawEvent) {
+ super(ndk, rawEvent);
+ this.kind ??= 30001 /* CategorizedBookmarkList */;
+ }
+ /**
+ * Wrap a NDKEvent into a NDKList
+ */
+ static from(ndkEvent) {
+ return new NDKList(ndkEvent.ndk, ndkEvent.rawEvent());
+ }
+ /**
+ * Returns the title of the list. Falls back on fetching the name tag value.
+ */
+ get title() {
+ const titleTag = this.tagValue("title") || this.tagValue("name");
+ if (this.kind === 3 /* Contacts */ && !titleTag) {
+ return "Contacts";
+ } else if (this.kind === 1e4 /* MuteList */ && !titleTag) {
+ return "Mute";
+ } else if (this.kind === 10001 /* PinList */ && !titleTag) {
+ return "Pinned Notes";
+ } else if (this.kind === 10002 /* RelayList */ && !titleTag) {
+ return "Relay Metadata";
+ } else if (this.kind === 10003 /* BookmarkList */ && !titleTag) {
+ return "Bookmarks";
+ } else if (this.kind === 10004 /* CommunityList */ && !titleTag) {
+ return "Communities";
+ } else if (this.kind === 10005 /* PublicChatList */ && !titleTag) {
+ return "Public Chats";
+ } else if (this.kind === 10006 /* BlockRelayList */ && !titleTag) {
+ return "Blocked Relays";
+ } else if (this.kind === 10007 /* SearchRelayList */ && !titleTag) {
+ return "Search Relays";
+ } else if (this.kind === 10015 /* InterestList */ && !titleTag) {
+ return "Interests";
+ } else if (this.kind === 10030 /* EmojiList */ && !titleTag) {
+ return "Emojis";
+ } else {
+ return titleTag ?? this.tagValue("d");
+ }
+ }
+ /**
+ * Sets the title of the list.
+ */
+ set title(title) {
+ this.removeTag("title");
+ this.removeTag("name");
+ if (title) {
+ this.tags.push(["title", title]);
+ } else {
+ throw new Error("Title cannot be empty");
+ }
+ }
+ /**
+ * Returns the name of the list.
+ * @deprecated Please use "title" instead.
+ */
+ get name() {
+ const nameTag = this.tagValue("name");
+ if (this.kind === 3 /* Contacts */ && !nameTag) {
+ return "Contacts";
+ } else if (this.kind === 1e4 /* MuteList */ && !nameTag) {
+ return "Mute";
+ } else if (this.kind === 10001 /* PinList */ && !nameTag) {
+ return "Pinned Notes";
+ } else if (this.kind === 10002 /* RelayList */ && !nameTag) {
+ return "Relay Metadata";
+ } else if (this.kind === 10003 /* BookmarkList */ && !nameTag) {
+ return "Bookmarks";
+ } else if (this.kind === 10004 /* CommunityList */ && !nameTag) {
+ return "Communities";
+ } else if (this.kind === 10005 /* PublicChatList */ && !nameTag) {
+ return "Public Chats";
+ } else if (this.kind === 10006 /* BlockRelayList */ && !nameTag) {
+ return "Blocked Relays";
+ } else if (this.kind === 10007 /* SearchRelayList */ && !nameTag) {
+ return "Search Relays";
+ } else if (this.kind === 10015 /* InterestList */ && !nameTag) {
+ return "Interests";
+ } else if (this.kind === 10030 /* EmojiList */ && !nameTag) {
+ return "Emojis";
+ } else {
+ return nameTag ?? this.tagValue("d");
+ }
+ }
+ /**
+ * Sets the name of the list.
+ * @deprecated Please use "title" instead. This method will use the `title` tag instead.
+ */
+ set name(name) {
+ this.removeTag("name");
+ if (name) {
+ this.tags.push(["title", name]);
+ } else {
+ throw new Error("Name cannot be empty");
+ }
+ }
+ /**
+ * Returns the description of the list.
+ */
+ get description() {
+ return this.tagValue("description");
+ }
+ /**
+ * Sets the description of the list.
+ */
+ set description(name) {
+ if (name) {
+ this.tags.push(["description", name]);
+ } else {
+ this.removeTag("description");
+ }
+ }
+ isEncryptedTagsCacheValid() {
+ return !!(this._encryptedTags && this.encryptedTagsLength === this.content.length);
+ }
+ /**
+ * Returns the decrypted content of the list.
+ */
+ async encryptedTags(useCache = true) {
+ if (useCache && this.isEncryptedTagsCacheValid())
+ return this._encryptedTags;
+ if (!this.ndk)
+ throw new Error("NDK instance not set");
+ if (!this.ndk.signer)
+ throw new Error("NDK signer not set");
+ const user = await this.ndk.signer.user();
+ try {
+ if (this.content.length > 0) {
+ try {
+ const decryptedContent = await this.ndk.signer.decrypt(user, this.content);
+ const a = JSON.parse(decryptedContent);
+ if (a && a[0]) {
+ this.encryptedTagsLength = this.content.length;
+ return this._encryptedTags = a;
+ }
+ this.encryptedTagsLength = this.content.length;
+ return this._encryptedTags = [];
+ } catch (e) {
+ console.log(`error decrypting ${this.content}`);
+ }
+ }
+ } catch (e) {
+ }
+ return [];
+ }
+ /**
+ * This method can be overriden to validate that a tag is valid for this list.
+ *
+ * (i.e. the NDKPersonList can validate that items are NDKUser instances)
+ */
+ validateTag(tagValue) {
+ return true;
+ }
+ /**
+ * Returns the unecrypted items in this list.
+ */
+ get items() {
+ return this.tags.filter((t) => {
+ return ![
+ "d",
+ "L",
+ "l",
+ "title",
+ "name",
+ "description",
+ "summary",
+ "image",
+ "thumb",
+ "alt",
+ "expiration",
+ "subject"
+ ].includes(t[0]);
+ });
+ }
+ /**
+ * Adds a new item to the list.
+ * @param relay Relay to add
+ * @param mark Optional mark to add to the item
+ * @param encrypted Whether to encrypt the item
+ */
+ async addItem(item, mark = void 0, encrypted = false) {
+ if (!this.ndk)
+ throw new Error("NDK instance not set");
+ if (!this.ndk.signer)
+ throw new Error("NDK signer not set");
+ let tags;
+ if (item instanceof NDKEvent) {
+ tags = item.referenceTags();
+ } else if (item instanceof NDKUser) {
+ tags = item.referenceTags();
+ } else if (item instanceof NDKRelay) {
+ tags = item.referenceTags();
+ } else if (Array.isArray(item)) {
+ tags = [item];
+ } else {
+ throw new Error("Invalid object type");
+ }
+ if (mark)
+ tags[0].push(mark);
+ if (encrypted) {
+ const user = await this.ndk.signer.user();
+ const currentList = await this.encryptedTags();
+ currentList.push(...tags);
+ this._encryptedTags = currentList;
+ this.encryptedTagsLength = this.content.length;
+ this.content = JSON.stringify(currentList);
+ await this.encrypt(user);
+ } else {
+ this.tags.push(...tags);
+ }
+ this.created_at = Math.floor(Date.now() / 1e3);
+ this.emit("change");
+ }
+ /**
+ * Removes an item from the list.
+ *
+ * @param index The index of the item to remove.
+ * @param encrypted Whether to remove from the encrypted list or not.
+ */
+ async removeItem(index, encrypted) {
+ if (!this.ndk)
+ throw new Error("NDK instance not set");
+ if (!this.ndk.signer)
+ throw new Error("NDK signer not set");
+ if (encrypted) {
+ const user = await this.ndk.signer.user();
+ const currentList = await this.encryptedTags();
+ currentList.splice(index, 1);
+ this._encryptedTags = currentList;
+ this.encryptedTagsLength = this.content.length;
+ this.content = JSON.stringify(currentList);
+ await this.encrypt(user);
+ } else {
+ this.tags.splice(index, 1);
+ }
+ this.created_at = Math.floor(Date.now() / 1e3);
+ this.emit("change");
+ return this;
+ }
+};
+var lists_default = NDKList;
+
+// src/user/pin.ts
+async function pin(event, pinEvent, publish) {
+ const kind = 10001 /* PinList */;
+ if (!this.ndk)
+ throw new Error("No NDK instance found");
+ this.ndk.assertSigner();
+ if (!pinEvent) {
+ const events = await this.ndk.fetchEvents(
+ { kinds: [kind], authors: [this.pubkey] },
+ { cacheUsage: "ONLY_RELAY" /* ONLY_RELAY */ }
+ );
+ if (events.size > 0) {
+ pinEvent = lists_default.from(Array.from(events)[0]);
+ } else {
+ pinEvent = new NDKEvent(this.ndk, {
+ kind
+ });
+ }
+ }
+ pinEvent.tag(event);
+ if (publish) {
+ await pinEvent.publish();
+ }
+ return pinEvent;
+}
+
// src/user/index.ts
var NDKUser = class {
ndk;
@@ -2045,7 +2606,7 @@ var NDKUser = class {
if (!this._npub) {
if (!this._pubkey)
throw new Error("hexpubkey not set");
- this._npub = nip194.npubEncode(this.hexpubkey);
+ this._npub = nip194.npubEncode(this.pubkey);
}
return this._npub;
}
@@ -2097,7 +2658,7 @@ var NDKUser = class {
const profile = await nip05.queryProfile(nip05Id);
if (profile) {
return new NDKUser({
- hexpubkey: profile.pubkey,
+ pubkey: profile.pubkey,
relayUrls: profile.relays
});
}
@@ -2114,7 +2675,7 @@ var NDKUser = class {
this.profile = {};
let setMetadataEvents = null;
if (this.ndk.cacheAdapter && this.ndk.cacheAdapter.fetchProfile && opts?.cacheUsage !== "ONLY_RELAY" /* ONLY_RELAY */) {
- const profile = await this.ndk.cacheAdapter.fetchProfile(this.hexpubkey);
+ const profile = await this.ndk.cacheAdapter.fetchProfile(this.pubkey);
if (profile) {
this.profile = profile;
return profile;
@@ -2126,7 +2687,7 @@ var NDKUser = class {
setMetadataEvents = await this.ndk.fetchEvents(
{
kinds: [0],
- authors: [this.hexpubkey]
+ authors: [this.pubkey]
},
{
cacheUsage: "ONLY_CACHE" /* ONLY_CACHE */,
@@ -2145,7 +2706,7 @@ var NDKUser = class {
setMetadataEvents = await this.ndk.fetchEvents(
{
kinds: [0],
- authors: [this.hexpubkey]
+ authors: [this.pubkey]
},
opts
);
@@ -2157,7 +2718,7 @@ var NDKUser = class {
return null;
this.profile = profileFromEvent(sortedSetMetadataEvents[0]);
if (this.profile && this.ndk.cacheAdapter && this.ndk.cacheAdapter.saveProfile) {
- this.ndk.cacheAdapter.saveProfile(this.hexpubkey, this.profile);
+ this.ndk.cacheAdapter.saveProfile(this.pubkey, this.profile);
}
return this.profile;
}
@@ -2165,6 +2726,10 @@ var NDKUser = class {
* Returns a set of users that this user follows.
*/
follows = follows.bind(this);
+ /**
+ * Pins a user or an event
+ */
+ pin = pin.bind(this);
/**
* Returns a set of relay list events for a user.
* @returns {Promise>} A set of NDKEvents returned for the given user.
@@ -2180,13 +2745,13 @@ var NDKUser = class {
const event = await this.ndk.fetchEvent(
{
kinds: [10002],
- authors: [this.hexpubkey]
+ authors: [this.pubkey]
},
{
closeOnEose: true,
pool,
groupable: true,
- subId: `relay-list-${this.hexpubkey.slice(0, 6)}`
+ subId: `relay-list-${this.pubkey.slice(0, 6)}`
},
relaySet
);
@@ -2199,7 +2764,7 @@ var NDKUser = class {
throw new Error("NDK not set");
const followList = await this.ndk.fetchEvent({
kinds: [3],
- authors: [this.hexpubkey]
+ authors: [this.pubkey]
});
if (followList) {
try {
@@ -2233,14 +2798,18 @@ var NDKUser = class {
* @returns {NDKTag} an NDKTag
*/
tagReference() {
- return ["p", this.hexpubkey];
+ return ["p", this.pubkey];
}
/**
* Get the tags that can be used to reference this user in an event
* @returns {NDKTag[]} an array of NDKTag
*/
- referenceTags() {
- return [["p", this.hexpubkey]];
+ referenceTags(marker) {
+ const tag = [["p", this.pubkey]];
+ if (!marker)
+ return tag;
+ tag[0].push("", marker);
+ return tag;
}
/**
* Publishes the current profile.
@@ -2288,8 +2857,8 @@ var NDKUser = class {
* Validate a user's NIP-05 identifier (usually fetched from their kind:0 profile data)
*
* @param nip05Id The NIP-05 string to validate
- * @returns {Promise} True if the NIP-05 is found and matches this user's hexpubkey,
- * False if the NIP-05 is found but doesn't match this user's hexpubkey,
+ * @returns {Promise} True if the NIP-05 is found and matches this user's pubkey,
+ * False if the NIP-05 is found but doesn't match this user's pubkey,
* null if the NIP-05 isn't found on the domain or we're unable to verify (because of network issues, etc.)
*/
async validateNip05(nip05Id) {
@@ -2298,7 +2867,7 @@ var NDKUser = class {
const profilePointer = await nip05.queryProfile(nip05Id);
if (profilePointer === null)
return null;
- return profilePointer.pubkey === this.hexpubkey;
+ return profilePointer.pubkey === this.pubkey;
}
/**
* Zap a user
@@ -2745,216 +3314,6 @@ var NDKTranscriptionDVM = class extends NDKDVMRequest {
}
};
-// src/events/kinds/lists/index.ts
-var NDKList = class extends NDKEvent {
- _encryptedTags;
- /**
- * Stores the number of bytes the content was before decryption
- * to expire the cache when the content changes.
- */
- encryptedTagsLength;
- constructor(ndk, rawEvent) {
- super(ndk, rawEvent);
- this.kind ??= 30001 /* CategorizedBookmarkList */;
- }
- /**
- * Wrap a NDKEvent into a NDKList
- */
- static from(ndkEvent) {
- return new NDKList(ndkEvent.ndk, ndkEvent.rawEvent());
- }
- /**
- * Returns the title of the list. Falls back on fetching the name tag value.
- */
- get title() {
- const titleTag = this.tagValue("title") || this.tagValue("name");
- if (this.kind === 3 /* Contacts */ && !titleTag) {
- return "Contacts";
- } else if (this.kind === 1e4 /* MuteList */ && !titleTag) {
- return "Mute";
- } else if (this.kind === 10001 /* PinList */ && !titleTag) {
- return "Pin";
- } else if (this.kind === 10002 /* RelayList */ && !titleTag) {
- return "Relay Metadata";
- } else {
- return titleTag ?? this.tagValue("d");
- }
- }
- /**
- * Sets the title of the list.
- */
- set title(title) {
- this.removeTag("title");
- this.removeTag("name");
- if (title) {
- this.tags.push(["title", title]);
- } else {
- throw new Error("Title cannot be empty");
- }
- }
- /**
- * Returns the name of the list.
- * @deprecated Please use "title" instead.
- */
- get name() {
- const nameTag = this.tagValue("name");
- if (this.kind === 3 /* Contacts */ && !nameTag) {
- return "Contacts";
- } else if (this.kind === 1e4 /* MuteList */ && !nameTag) {
- return "Mute";
- } else if (this.kind === 10001 /* PinList */ && !nameTag) {
- return "Pin";
- } else if (this.kind === 10002 /* RelayList */ && !nameTag) {
- return "Relay Metadata";
- } else {
- return nameTag ?? this.tagValue("d");
- }
- }
- /**
- * Sets the name of the list.
- * @deprecated Please use "title" instead. This method will use the `title` tag instead.
- */
- set name(name) {
- this.removeTag("name");
- if (name) {
- this.tags.push(["title", name]);
- } else {
- throw new Error("Name cannot be empty");
- }
- }
- /**
- * Returns the description of the list.
- */
- get description() {
- return this.tagValue("description");
- }
- /**
- * Sets the description of the list.
- */
- set description(name) {
- if (name) {
- this.tags.push(["description", name]);
- } else {
- this.removeTag("description");
- }
- }
- isEncryptedTagsCacheValid() {
- return !!(this._encryptedTags && this.encryptedTagsLength === this.content.length);
- }
- /**
- * Returns the decrypted content of the list.
- */
- async encryptedTags(useCache = true) {
- if (useCache && this.isEncryptedTagsCacheValid())
- return this._encryptedTags;
- if (!this.ndk)
- throw new Error("NDK instance not set");
- if (!this.ndk.signer)
- throw new Error("NDK signer not set");
- const user = await this.ndk.signer.user();
- try {
- if (this.content.length > 0) {
- try {
- const decryptedContent = await this.ndk.signer.decrypt(user, this.content);
- const a = JSON.parse(decryptedContent);
- if (a && a[0]) {
- this.encryptedTagsLength = this.content.length;
- return this._encryptedTags = a;
- }
- this.encryptedTagsLength = this.content.length;
- return this._encryptedTags = [];
- } catch (e) {
- console.log(`error decrypting ${this.content}`);
- }
- }
- } catch (e) {
- }
- return [];
- }
- /**
- * This method can be overriden to validate that a tag is valid for this list.
- *
- * (i.e. the NDKPersonList can validate that items are NDKUser instances)
- */
- validateTag(tagValue) {
- return true;
- }
- /**
- * Returns the unecrypted items in this list.
- */
- get items() {
- return this.tags.filter((t) => {
- return !["d", "name", "description"].includes(t[0]);
- });
- }
- /**
- * Adds a new item to the list.
- * @param relay Relay to add
- * @param mark Optional mark to add to the item
- * @param encrypted Whether to encrypt the item
- */
- async addItem(item, mark = void 0, encrypted = false) {
- if (!this.ndk)
- throw new Error("NDK instance not set");
- if (!this.ndk.signer)
- throw new Error("NDK signer not set");
- let tags;
- if (item instanceof NDKEvent) {
- tags = item.referenceTags();
- } else if (item instanceof NDKUser) {
- tags = item.referenceTags();
- } else if (item instanceof NDKRelay) {
- tags = item.referenceTags();
- } else if (Array.isArray(item)) {
- tags = [item];
- } else {
- throw new Error("Invalid object type");
- }
- if (mark)
- tags[0].push(mark);
- if (encrypted) {
- const user = await this.ndk.signer.user();
- const currentList = await this.encryptedTags();
- currentList.push(...tags);
- this._encryptedTags = currentList;
- this.encryptedTagsLength = this.content.length;
- this.content = JSON.stringify(currentList);
- await this.encrypt(user);
- } else {
- this.tags.push(...tags);
- }
- this.created_at = Math.floor(Date.now() / 1e3);
- this.emit("change");
- }
- /**
- * Removes an item from the list.
- *
- * @param index The index of the item to remove.
- * @param encrypted Whether to remove from the encrypted list or not.
- */
- async removeItem(index, encrypted) {
- if (!this.ndk)
- throw new Error("NDK instance not set");
- if (!this.ndk.signer)
- throw new Error("NDK signer not set");
- if (encrypted) {
- const user = await this.ndk.signer.user();
- const currentList = await this.encryptedTags();
- currentList.splice(index, 1);
- this._encryptedTags = currentList;
- this.encryptedTagsLength = this.content.length;
- this.content = JSON.stringify(currentList);
- await this.encrypt(user);
- } else {
- this.tags.splice(index, 1);
- }
- this.created_at = Math.floor(Date.now() / 1e3);
- this.emit("change");
- return this;
- }
-};
-var lists_default = NDKList;
-
// src/events/kinds/repost.ts
var NDKRepost = class extends NDKEvent {
_repostedEvents;
@@ -3086,6 +3445,17 @@ var NDKNip07Signer = class {
const signedEvent = await window.nostr.signEvent(event);
return signedEvent.sig;
}
+ async relays() {
+ await this.waitForExtension();
+ const relays = await window.nostr.getRelays?.() || {};
+ const activeRelays = [];
+ for (const url in Object.keys(relays)) {
+ if (relays[url].read && relays[url].write) {
+ activeRelays.push(url);
+ }
+ }
+ return activeRelays.map((url) => new NDKRelay(url));
+ }
async encrypt(recipient, value) {
await this.waitForExtension();
const recipientHexPubKey = recipient.hexpubkey;
@@ -3224,7 +3594,7 @@ var NDKPrivateKeySigner = class {
};
// src/signers/nip46/rpc.ts
-import EventEmitter6 from "eventemitter3";
+import { EventEmitter as EventEmitter6 } from "tseep";
var NDKNostrRpc = class extends EventEmitter6 {
ndk;
signer;
@@ -3238,8 +3608,11 @@ var NDKNostrRpc = class extends EventEmitter6 {
/**
* Subscribe to a filter. This function will resolve once the subscription is ready.
*/
- async subscribe(filter) {
- const sub = this.ndk.subscribe(filter, { closeOnEose: false });
+ subscribe(filter) {
+ const sub = this.ndk.subscribe(filter, {
+ closeOnEose: false,
+ groupable: false
+ });
sub.on("event", async (event) => {
try {
const parsedEvent = await this.parseEvent(event);
@@ -3299,8 +3672,15 @@ var NDKNostrRpc = class extends EventEmitter6 {
const remoteUser = this.ndk.getUser({ hexpubkey: remotePubkey });
const request = { id, method, params };
const promise = new Promise((resolve) => {
- if (cb)
- this.once(`response-${id}`, cb);
+ const responseHandler = (response) => {
+ if (response.result === "auth_url") {
+ this.once(`response-${id}`, responseHandler);
+ this.emit("authUrl", response.error);
+ } else if (cb) {
+ cb(response);
+ }
+ };
+ this.once(`response-${id}`, responseHandler);
});
const event = new NDKEvent(this.ndk, {
kind,
@@ -3318,7 +3698,7 @@ var NDKNostrRpc = class extends EventEmitter6 {
// src/signers/nip46/backend/connect.ts
var ConnectEventHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
+ async handle(backend, id, remotePubkey, params) {
const [pubkey, token] = params;
const debug4 = backend.debug.extend("connect");
debug4(`connection request from ${pubkey}`);
@@ -3326,7 +3706,7 @@ var ConnectEventHandlingStrategy = class {
debug4(`applying token`);
await backend.applyToken(pubkey, token);
}
- if (await backend.pubkeyAllowed(pubkey, "connect", token)) {
+ if (await backend.pubkeyAllowed({ id, pubkey, method: "connect", params: token })) {
debug4(`connection request from ${pubkey} allowed`);
return "ack";
} else {
@@ -3336,50 +3716,84 @@ var ConnectEventHandlingStrategy = class {
}
};
-// src/signers/nip46/backend/describe.ts
-var DescribeHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
- const keys = Object.keys(backend.handlers);
- return JSON.stringify(keys);
- }
-};
-
// src/signers/nip46/backend/get-public-key.ts
var GetPublicKeyHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
- return backend.localUser?.hexpubkey;
+ async handle(backend, id, remotePubkey, params) {
+ return backend.localUser?.pubkey;
}
};
// src/signers/nip46/backend/nip04-decrypt.ts
var Nip04DecryptHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
+ async handle(backend, id, remotePubkey, params) {
const [senderPubkey, payload] = params;
const senderUser = new NDKUser({ hexpubkey: senderPubkey });
- const decryptedPayload = await backend.decrypt(remotePubkey, senderUser, payload);
+ const decryptedPayload = await decrypt2(backend, id, remotePubkey, senderUser, payload);
return JSON.stringify([decryptedPayload]);
}
};
+async function decrypt2(backend, id, remotePubkey, senderUser, payload) {
+ if (!await backend.pubkeyAllowed({
+ id,
+ pubkey: remotePubkey,
+ method: "decrypt",
+ params: payload
+ })) {
+ backend.debug(`decrypt request from ${remotePubkey} rejected`);
+ return void 0;
+ }
+ return await backend.signer.decrypt(senderUser, payload);
+}
// src/signers/nip46/backend/nip04-encrypt.ts
var Nip04EncryptHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
+ async handle(backend, id, remotePubkey, params) {
const [recipientPubkey, payload] = params;
const recipientUser = new NDKUser({ hexpubkey: recipientPubkey });
- const decryptedPayload = await backend.encrypt(remotePubkey, recipientUser, payload);
- return decryptedPayload;
+ const encryptedPayload = await encrypt2(backend, id, remotePubkey, recipientUser, payload);
+ return encryptedPayload;
}
};
+async function encrypt2(backend, id, remotePubkey, recipientUser, payload) {
+ if (!await backend.pubkeyAllowed({
+ id,
+ pubkey: remotePubkey,
+ method: "encrypt",
+ params: payload
+ })) {
+ backend.debug(`encrypt request from ${remotePubkey} rejected`);
+ return void 0;
+ }
+ return await backend.signer.encrypt(recipientUser, payload);
+}
// src/signers/nip46/backend/sign-event.ts
var SignEventHandlingStrategy = class {
- async handle(backend, remotePubkey, params) {
- const event = await backend.signEvent(remotePubkey, params);
+ async handle(backend, id, remotePubkey, params) {
+ const event = await signEvent(backend, id, remotePubkey, params);
if (!event)
return void 0;
return JSON.stringify(await event.toNostrEvent());
}
};
+async function signEvent(backend, id, remotePubkey, params) {
+ const [eventString] = params;
+ backend.debug(`sign event request from ${remotePubkey}`);
+ const event = new NDKEvent(backend.ndk, JSON.parse(eventString));
+ backend.debug("event to sign", event.rawEvent());
+ if (!await backend.pubkeyAllowed({
+ id,
+ pubkey: remotePubkey,
+ method: "sign_event",
+ params: event
+ })) {
+ backend.debug(`sign event request from ${remotePubkey} rejected`);
+ return void 0;
+ }
+ backend.debug(`sign event request from ${remotePubkey} allowed`);
+ await event.sign(backend.signer);
+ return event;
+}
// src/signers/nip46/backend/index.ts
var NDKNip46Backend = class {
@@ -3420,8 +3834,7 @@ var NDKNip46Backend = class {
sign_event: new SignEventHandlingStrategy(),
nip04_encrypt: new Nip04EncryptHandlingStrategy(),
nip04_decrypt: new Nip04DecryptHandlingStrategy(),
- get_public_key: new GetPublicKeyHandlingStrategy(),
- describe: new DescribeHandlingStrategy()
+ get_public_key: new GetPublicKeyHandlingStrategy()
};
/**
* Enables the user to set a custom strategy for handling incoming events.
@@ -3452,7 +3865,7 @@ var NDKNip46Backend = class {
const strategy = this.handlers[method];
if (strategy) {
try {
- response = await strategy.handle(this, remotePubkey, params);
+ response = await strategy.handle(this, id, remotePubkey, params);
} catch (e) {
this.debug("error handling event", e, { id, method, params });
this.rpc.sendResponse(id, remotePubkey, "error", void 0, e.message);
@@ -3467,82 +3880,66 @@ var NDKNip46Backend = class {
this.rpc.sendResponse(id, remotePubkey, "error", void 0, "Not authorized");
}
}
- async decrypt(remotePubkey, senderUser, payload) {
- if (!await this.pubkeyAllowed(remotePubkey, "decrypt", payload)) {
- this.debug(`decrypt request from ${remotePubkey} rejected`);
- return void 0;
- }
- return await this.signer.decrypt(senderUser, payload);
- }
- async encrypt(remotePubkey, recipientUser, payload) {
- if (!await this.pubkeyAllowed(remotePubkey, "encrypt", payload)) {
- this.debug(`encrypt request from ${remotePubkey} rejected`);
- return void 0;
- }
- return await this.signer.encrypt(recipientUser, payload);
- }
- async signEvent(remotePubkey, params) {
- const [eventString] = params;
- this.debug(`sign event request from ${remotePubkey}`);
- const event = new NDKEvent(this.ndk, JSON.parse(eventString));
- this.debug("event to sign", event.rawEvent());
- if (!await this.pubkeyAllowed(remotePubkey, "sign_event", event)) {
- this.debug(`sign event request from ${remotePubkey} rejected`);
- return void 0;
- }
- this.debug(`sign event request from ${remotePubkey} allowed`);
- await event.sign(this.signer);
- return event;
- }
/**
* This method should be overriden by the user to allow or reject incoming
* connections.
*/
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- async pubkeyAllowed(pubkey, method, params) {
- return this.permitCallback(pubkey, method, params);
+ async pubkeyAllowed(params) {
+ return this.permitCallback(params);
}
};
+// ../node_modules/eventemitter3/index.mjs
+var import_index6 = __toESM(require_eventemitter3(), 1);
+var eventemitter3_default = import_index6.default;
+
// src/signers/nip46/index.ts
-var NDKNip46Signer = class {
+var NDKNip46Signer = class extends eventemitter3_default {
ndk;
remoteUser;
remotePubkey;
token;
localSigner;
+ nip05;
rpc;
debug;
/**
* @param ndk - The NDK instance to use
- * @param tokenOrRemotePubkey - The public key, or a connection token, of the npub that wants to be published as
+ * @param tokenOrRemoteUser - The public key, or a connection token, of the npub that wants to be published as
* @param localSigner - The signer that will be used to request events to be signed
*/
- constructor(ndk, tokenOrRemotePubkey, localSigner) {
+ constructor(ndk, tokenOrRemoteUser, localSigner) {
+ super();
let remotePubkey;
let token;
- if (tokenOrRemotePubkey.includes("#")) {
- const parts = tokenOrRemotePubkey.split("#");
- remotePubkey = new NDKUser({ npub: parts[0] }).hexpubkey;
+ if (tokenOrRemoteUser.includes("#")) {
+ const parts = tokenOrRemoteUser.split("#");
+ remotePubkey = new NDKUser({ npub: parts[0] }).pubkey;
token = parts[1];
- } else if (tokenOrRemotePubkey.startsWith("npub")) {
+ } else if (tokenOrRemoteUser.startsWith("npub")) {
remotePubkey = new NDKUser({
- npub: tokenOrRemotePubkey
- }).hexpubkey;
+ npub: tokenOrRemoteUser
+ }).pubkey;
+ } else if (tokenOrRemoteUser.match(/\./)) {
+ this.nip05 = tokenOrRemoteUser;
} else {
- remotePubkey = tokenOrRemotePubkey;
+ remotePubkey = tokenOrRemoteUser;
}
this.ndk = ndk;
- this.remotePubkey = remotePubkey;
+ if (remotePubkey)
+ this.remotePubkey = remotePubkey;
this.token = token;
this.debug = ndk.debug.extend("nip46:signer");
- this.remoteUser = new NDKUser({ hexpubkey: remotePubkey });
+ this.remoteUser = new NDKUser({ pubkey: remotePubkey });
if (!localSigner) {
this.localSigner = NDKPrivateKeySigner.generate();
} else {
this.localSigner = localSigner;
}
this.rpc = new NDKNostrRpc(ndk, this.localSigner, this.debug);
+ this.rpc.on("authUrl", (...props) => {
+ this.emit("authUrl", ...props);
+ });
}
/**
* Get the user that is being published as
@@ -3552,14 +3949,25 @@ var NDKNip46Signer = class {
}
async blockUntilReady() {
const localUser = await this.localSigner.user();
- const user = this.ndk.getUser({ npub: localUser.npub });
+ const remoteUser = this.ndk.getUser({ pubkey: this.remotePubkey });
+ if (this.nip05 && !this.remotePubkey) {
+ const remoteUser2 = NDKUser.fromNip05(this.nip05).then((user) => {
+ if (user) {
+ this.remoteUser = user;
+ this.remotePubkey = user.pubkey;
+ }
+ });
+ }
+ if (!this.remotePubkey) {
+ throw new Error("Remote pubkey not set");
+ }
await this.rpc.subscribe({
kinds: [24133],
- "#p": [localUser.hexpubkey]
+ "#p": [localUser.pubkey]
});
return new Promise((resolve, reject) => {
setTimeout(() => {
- const connectParams = [localUser.hexpubkey];
+ const connectParams = [localUser.pubkey];
if (this.token) {
connectParams.push(this.token);
}
@@ -3570,7 +3978,7 @@ var NDKNip46Signer = class {
24133,
(response) => {
if (response.result === "ack") {
- resolve(user);
+ resolve(remoteUser);
} else {
reject(response.error);
}
@@ -3585,7 +3993,7 @@ var NDKNip46Signer = class {
this.rpc.sendRequest(
this.remotePubkey,
"nip04_encrypt",
- [recipient.hexpubkey, value],
+ [recipient.pubkey, value],
24133,
(response) => {
if (!response.error) {
@@ -3604,7 +4012,7 @@ var NDKNip46Signer = class {
this.rpc.sendRequest(
this.remotePubkey,
"nip04_decrypt",
- [sender.hexpubkey, value],
+ [sender.pubkey, value],
24133,
(response) => {
if (!response.error) {
@@ -3643,7 +4051,7 @@ var NDKNip46Signer = class {
// src/ndk/index.ts
import debug3 from "debug";
-import EventEmitter9 from "eventemitter3";
+import { EventEmitter as EventEmitter10 } from "tseep";
// src/events/dedup.ts
function dedup(event1, event2) {
@@ -3654,7 +4062,7 @@ function dedup(event1, event2) {
}
// src/outbox/tracker.ts
-import EventEmitter7 from "eventemitter3";
+import { EventEmitter as EventEmitter8 } from "tseep";
import { LRUCache } from "typescript-lru-cache";
var OutboxItem = class {
/**
@@ -3674,7 +4082,7 @@ var OutboxItem = class {
this.writeRelays = /* @__PURE__ */ new Set();
}
};
-var OutboxTracker = class extends EventEmitter7 {
+var OutboxTracker = class extends EventEmitter8 {
data;
ndk;
debug;
@@ -3750,8 +4158,8 @@ function getTypeFromItem(item) {
}
// src/relay/pool/index.ts
-import EventEmitter8 from "eventemitter3";
-var NDKPool = class extends EventEmitter8 {
+import { EventEmitter as EventEmitter9 } from "tseep";
+var NDKPool = class extends EventEmitter9 {
// TODO: This should probably be an LRU cache
relays = /* @__PURE__ */ new Map();
blacklistRelayUrls;
@@ -3802,9 +4210,9 @@ var NDKPool = class extends EventEmitter8 {
this.debug(`Relay ${relayUrl} is blacklisted`);
return;
}
- relay.on("notice", (relay2, notice) => this.emit("notice", relay2, notice));
+ relay.on("notice", async (relay2, notice) => this.emit("notice", relay2, notice));
relay.on("connect", () => this.handleRelayConnect(relayUrl));
- relay.on("disconnect", () => this.emit("relay:disconnect", relay));
+ relay.on("disconnect", async () => this.emit("relay:disconnect", relay));
relay.on("flapping", () => this.handleFlapping(relay));
this.relays.set(relayUrl, relay);
if (connect) {
@@ -3980,7 +4388,7 @@ var DEFAULT_BLACKLISTED_RELAYS = [
"wss://brb.io"
// BRB
];
-var NDK = class extends EventEmitter9 {
+var NDK = class extends EventEmitter10 {
explicitRelayUrls;
pool;
outboxPool;
@@ -3991,6 +4399,7 @@ var NDK = class extends EventEmitter9 {
devWriteRelaySet;
outboxTracker;
mutedIds;
+ client;
autoConnectUserRelays = true;
autoFetchUserMutelist = true;
constructor(opts = {}) {
@@ -4001,6 +4410,7 @@ var NDK = class extends EventEmitter9 {
this.debug(`Starting with explicit relays: ${JSON.stringify(this.explicitRelayUrls)}`);
this.autoConnectUserRelays = opts.autoConnectUserRelays ?? true;
this.autoFetchUserMutelist = opts.autoFetchUserMutelist ?? true;
+ this.client = opts.client;
if (opts.enableOutboxModel) {
this.outboxPool = new NDKPool(
opts.outboxRelayUrls || DEFAULT_OUTBOX_RELAYS,
@@ -4058,7 +4468,7 @@ var NDK = class extends EventEmitter9 {
const muteLists = await this.fetchEvents([
{ kinds: [1e4 /* MuteList */], authors: [user2.pubkey] },
{
- kinds: [3e4 /* CategorizedPeopleList */],
+ kinds: [3e4 /* FollowSet */],
authors: [user2.pubkey],
"#d": ["mute"],
limit: 1
@@ -4115,6 +4525,13 @@ var NDK = class extends EventEmitter9 {
* If the timeout is reached, the connection will be continued to be established in the background.
*/
async connect(timeoutMs) {
+ if (this._signer && this.autoConnectUserRelays) {
+ this.debug("Attempting to connect to user relays specified by signer");
+ if (this._signer.relays) {
+ const relays = await this._signer.relays();
+ relays.forEach((relay) => this.pool.addRelay(relay));
+ }
+ }
const connections = [this.pool.connect(timeoutMs)];
if (this.outboxPool) {
connections.push(this.outboxPool.connect(timeoutMs));
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/README.md b/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/README.md
deleted file mode 100644
index badc2b19..00000000
--- a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/README.md
+++ /dev/null
@@ -1,872 +0,0 @@
-
-

-
-
A light-weight module that brings Fetch API to Node.js.
-

-

-

-

-

-

-
-
-
Consider supporting us on our Open Collective:
-
-
-

-
-
----
-
-**You might be looking for the [v2 docs](https://github.com/node-fetch/node-fetch/tree/2.x#readme)**
-
-
-
-- [Motivation](#motivation)
-- [Features](#features)
-- [Difference from client-side fetch](#difference-from-client-side-fetch)
-- [Installation](#installation)
-- [Loading and configuring the module](#loading-and-configuring-the-module)
-- [Upgrading](#upgrading)
-- [Common Usage](#common-usage)
- - [Plain text or HTML](#plain-text-or-html)
- - [JSON](#json)
- - [Simple Post](#simple-post)
- - [Post with JSON](#post-with-json)
- - [Post with form parameters](#post-with-form-parameters)
- - [Handling exceptions](#handling-exceptions)
- - [Handling client and server errors](#handling-client-and-server-errors)
- - [Handling cookies](#handling-cookies)
-- [Advanced Usage](#advanced-usage)
- - [Streams](#streams)
- - [Accessing Headers and other Metadata](#accessing-headers-and-other-metadata)
- - [Extract Set-Cookie Header](#extract-set-cookie-header)
- - [Post data using a file](#post-data-using-a-file)
- - [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal)
-- [API](#api)
- - [fetch(url[, options])](#fetchurl-options)
- - [Options](#options)
- - [Default Headers](#default-headers)
- - [Custom Agent](#custom-agent)
- - [Custom highWaterMark](#custom-highwatermark)
- - [Insecure HTTP Parser](#insecure-http-parser)
- - [Class: Request](#class-request)
- - [new Request(input[, options])](#new-requestinput-options)
- - [Class: Response](#class-response)
- - [new Response([body[, options]])](#new-responsebody-options)
- - [response.ok](#responseok)
- - [response.redirected](#responseredirected)
- - [response.type](#responsetype)
- - [Class: Headers](#class-headers)
- - [new Headers([init])](#new-headersinit)
- - [Interface: Body](#interface-body)
- - [body.body](#bodybody)
- - [body.bodyUsed](#bodybodyused)
- - [body.arrayBuffer()](#bodyarraybuffer)
- - [body.blob()](#bodyblob)
- - [body.formData()](#formdata)
- - [body.json()](#bodyjson)
- - [body.text()](#bodytext)
- - [Class: FetchError](#class-fetcherror)
- - [Class: AbortError](#class-aborterror)
-- [TypeScript](#typescript)
-- [Acknowledgement](#acknowledgement)
-- [Team](#team)
- - [Former](#former)
-- [License](#license)
-
-
-
-## Motivation
-
-Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime.
-
-See Jason Miller's [isomorphic-unfetch](https://www.npmjs.com/package/isomorphic-unfetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side).
-
-## Features
-
-- Stay consistent with `window.fetch` API.
-- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences.
-- Use native promise and async functions.
-- Use native Node streams for body, on both request and response.
-- Decode content encoding (gzip/deflate/brotli) properly, and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically.
-- Useful extensions such as redirect limit, response size limit, [explicit errors][error-handling.md] for troubleshooting.
-
-## Difference from client-side fetch
-
-- See known differences:
- - [As of v3.x](docs/v3-LIMITS.md)
- - [As of v2.x](docs/v2-LIMITS.md)
-- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue.
-- Pull requests are welcomed too!
-
-## Installation
-
-Current stable release (`3.x`) requires at least Node.js 12.20.0.
-
-```sh
-npm install node-fetch
-```
-
-## Loading and configuring the module
-
-### ES Modules (ESM)
-
-```js
-import fetch from 'node-fetch';
-```
-
-### CommonJS
-
-`node-fetch` from v3 is an ESM-only module - you are not able to import it with `require()`.
-
-If you cannot switch to ESM, please use v2 which remains compatible with CommonJS. Critical bug fixes will continue to be published for v2.
-
-```sh
-npm install node-fetch@2
-```
-
-Alternatively, you can use the async `import()` function from CommonJS to load `node-fetch` asynchronously:
-
-```js
-// mod.cjs
-const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
-```
-
-### Providing global access
-
-To use `fetch()` without importing it, you can patch the `global` object in node:
-
-```js
-// fetch-polyfill.js
-import fetch, {
- Blob,
- blobFrom,
- blobFromSync,
- File,
- fileFrom,
- fileFromSync,
- FormData,
- Headers,
- Request,
- Response,
-} from 'node-fetch'
-
-if (!globalThis.fetch) {
- globalThis.fetch = fetch
- globalThis.Headers = Headers
- globalThis.Request = Request
- globalThis.Response = Response
-}
-
-// index.js
-import './fetch-polyfill'
-
-// ...
-```
-
-## Upgrading
-
-Using an old version of node-fetch? Check out the following files:
-
-- [2.x to 3.x upgrade guide](docs/v3-UPGRADE-GUIDE.md)
-- [1.x to 2.x upgrade guide](docs/v2-UPGRADE-GUIDE.md)
-- [Changelog](https://github.com/node-fetch/node-fetch/releases)
-
-## Common Usage
-
-NOTE: The documentation below is up-to-date with `3.x` releases, if you are using an older version, please check how to [upgrade](#upgrading).
-
-### Plain text or HTML
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://github.com/');
-const body = await response.text();
-
-console.log(body);
-```
-
-### JSON
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://api.github.com/users/github');
-const data = await response.json();
-
-console.log(data);
-```
-
-### Simple Post
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://httpbin.org/post', {method: 'POST', body: 'a=1'});
-const data = await response.json();
-
-console.log(data);
-```
-
-### Post with JSON
-
-```js
-import fetch from 'node-fetch';
-
-const body = {a: 1};
-
-const response = await fetch('https://httpbin.org/post', {
- method: 'post',
- body: JSON.stringify(body),
- headers: {'Content-Type': 'application/json'}
-});
-const data = await response.json();
-
-console.log(data);
-```
-
-### Post with form parameters
-
-`URLSearchParams` is available on the global object in Node.js as of v10.0.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods.
-
-NOTE: The `Content-Type` header is only set automatically to `x-www-form-urlencoded` when an instance of `URLSearchParams` is given as such:
-
-```js
-import fetch from 'node-fetch';
-
-const params = new URLSearchParams();
-params.append('a', 1);
-
-const response = await fetch('https://httpbin.org/post', {method: 'POST', body: params});
-const data = await response.json();
-
-console.log(data);
-```
-
-### Handling exceptions
-
-NOTE: 3xx-5xx responses are _NOT_ exceptions, and should be handled in `then()`, see the next section.
-
-Wrapping the fetch function into a `try/catch` block will catch _all_ exceptions, such as errors originating from node core libraries, like network errors, and operational errors which are instances of FetchError. See the [error handling document][error-handling.md] for more details.
-
-```js
-import fetch from 'node-fetch';
-
-try {
- await fetch('https://domain.invalid/');
-} catch (error) {
- console.log(error);
-}
-```
-
-### Handling client and server errors
-
-It is common to create a helper function to check that the response contains no client (4xx) or server (5xx) error responses:
-
-```js
-import fetch from 'node-fetch';
-
-class HTTPResponseError extends Error {
- constructor(response) {
- super(`HTTP Error Response: ${response.status} ${response.statusText}`);
- this.response = response;
- }
-}
-
-const checkStatus = response => {
- if (response.ok) {
- // response.status >= 200 && response.status < 300
- return response;
- } else {
- throw new HTTPResponseError(response);
- }
-}
-
-const response = await fetch('https://httpbin.org/status/400');
-
-try {
- checkStatus(response);
-} catch (error) {
- console.error(error);
-
- const errorBody = await error.response.text();
- console.error(`Error body: ${errorBody}`);
-}
-```
-
-### Handling cookies
-
-Cookies are not stored by default. However, cookies can be extracted and passed by manipulating request and response headers. See [Extract Set-Cookie Header](#extract-set-cookie-header) for details.
-
-## Advanced Usage
-
-### Streams
-
-The "Node.js way" is to use streams when possible. You can pipe `res.body` to another stream. This example uses [stream.pipeline](https://nodejs.org/api/stream.html#stream_stream_pipeline_streams_callback) to attach stream error handlers and wait for the download to complete.
-
-```js
-import {createWriteStream} from 'node:fs';
-import {pipeline} from 'node:stream';
-import {promisify} from 'node:util'
-import fetch from 'node-fetch';
-
-const streamPipeline = promisify(pipeline);
-
-const response = await fetch('https://github.githubassets.com/images/modules/logos_page/Octocat.png');
-
-if (!response.ok) throw new Error(`unexpected response ${response.statusText}`);
-
-await streamPipeline(response.body, createWriteStream('./octocat.png'));
-```
-
-In Node.js 14 you can also use async iterators to read `body`; however, be careful to catch
-errors -- the longer a response runs, the more likely it is to encounter an error.
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://httpbin.org/stream/3');
-
-try {
- for await (const chunk of response.body) {
- console.dir(JSON.parse(chunk.toString()));
- }
-} catch (err) {
- console.error(err.stack);
-}
-```
-
-In Node.js 12 you can also use async iterators to read `body`; however, async iterators with streams
-did not mature until Node.js 14, so you need to do some extra work to ensure you handle errors
-directly from the stream and wait on it response to fully close.
-
-```js
-import fetch from 'node-fetch';
-
-const read = async body => {
- let error;
- body.on('error', err => {
- error = err;
- });
-
- for await (const chunk of body) {
- console.dir(JSON.parse(chunk.toString()));
- }
-
- return new Promise((resolve, reject) => {
- body.on('close', () => {
- error ? reject(error) : resolve();
- });
- });
-};
-
-try {
- const response = await fetch('https://httpbin.org/stream/3');
- await read(response.body);
-} catch (err) {
- console.error(err.stack);
-}
-```
-
-### Accessing Headers and other Metadata
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://github.com/');
-
-console.log(response.ok);
-console.log(response.status);
-console.log(response.statusText);
-console.log(response.headers.raw());
-console.log(response.headers.get('content-type'));
-```
-
-### Extract Set-Cookie Header
-
-Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API.
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://example.com');
-
-// Returns an array of values, instead of a string of comma-separated values
-console.log(response.headers.raw()['set-cookie']);
-```
-
-### Post data using a file
-
-```js
-import fetch, {
- Blob,
- blobFrom,
- blobFromSync,
- File,
- fileFrom,
- fileFromSync,
-} from 'node-fetch'
-
-const mimetype = 'text/plain'
-const blob = fileFromSync('./input.txt', mimetype)
-const url = 'https://httpbin.org/post'
-
-const response = await fetch(url, { method: 'POST', body: blob })
-const data = await response.json()
-
-console.log(data)
-```
-
-node-fetch comes with a spec-compliant [FormData] implementations for posting
-multipart/form-data payloads
-
-```js
-import fetch, { FormData, File, fileFrom } from 'node-fetch'
-
-const httpbin = 'https://httpbin.org/post'
-const formData = new FormData()
-const binary = new Uint8Array([ 97, 98, 99 ])
-const abc = new File([binary], 'abc.txt', { type: 'text/plain' })
-
-formData.set('greeting', 'Hello, world!')
-formData.set('file-upload', abc, 'new name.txt')
-
-const response = await fetch(httpbin, { method: 'POST', body: formData })
-const data = await response.json()
-
-console.log(data)
-```
-
-If you for some reason need to post a stream coming from any arbitrary place,
-then you can append a [Blob] or a [File] look-a-like item.
-
-The minimum requirement is that it has:
-1. A `Symbol.toStringTag` getter or property that is either `Blob` or `File`
-2. A known size.
-3. And either a `stream()` method or a `arrayBuffer()` method that returns a ArrayBuffer.
-
-The `stream()` must return any async iterable object as long as it yields Uint8Array (or Buffer)
-so Node.Readable streams and whatwg streams works just fine.
-
-```js
-formData.append('upload', {
- [Symbol.toStringTag]: 'Blob',
- size: 3,
- *stream() {
- yield new Uint8Array([97, 98, 99])
- },
- arrayBuffer() {
- return new Uint8Array([97, 98, 99]).buffer
- }
-}, 'abc.txt')
-```
-
-### Request cancellation with AbortSignal
-
-You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller).
-
-An example of timing out a request after 150ms could be achieved as the following:
-
-```js
-import fetch, { AbortError } from 'node-fetch';
-
-// AbortController was added in node v14.17.0 globally
-const AbortController = globalThis.AbortController || await import('abort-controller')
-
-const controller = new AbortController();
-const timeout = setTimeout(() => {
- controller.abort();
-}, 150);
-
-try {
- const response = await fetch('https://example.com', {signal: controller.signal});
- const data = await response.json();
-} catch (error) {
- if (error instanceof AbortError) {
- console.log('request was aborted');
- }
-} finally {
- clearTimeout(timeout);
-}
-```
-
-See [test cases](https://github.com/node-fetch/node-fetch/blob/master/test/) for more examples.
-
-## API
-
-### fetch(url[, options])
-
-- `url` A string representing the URL for fetching
-- `options` [Options](#fetch-options) for the HTTP(S) request
-- Returns: Promise<[Response](#class-response)>
-
-Perform an HTTP(S) fetch.
-
-`url` should be an absolute URL, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`.
-
-
-
-### Options
-
-The default values are shown after each option key.
-
-```js
-{
- // These properties are part of the Fetch Standard
- method: 'GET',
- headers: {}, // Request headers. format is the identical to that accepted by the Headers constructor (see below)
- body: null, // Request body. can be null, or a Node.js Readable stream
- redirect: 'follow', // Set to `manual` to extract redirect headers, `error` to reject redirect
- signal: null, // Pass an instance of AbortSignal to optionally abort requests
-
- // The following properties are node-fetch extensions
- follow: 20, // maximum redirect count. 0 to not follow redirect
- compress: true, // support gzip/deflate content encoding. false to disable
- size: 0, // maximum response body size in bytes. 0 to disable
- agent: null, // http(s).Agent instance or function that returns an instance (see below)
- highWaterMark: 16384, // the maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource.
- insecureHTTPParser: false // Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
-}
-```
-
-#### Default Headers
-
-If no values are set, the following request headers will be sent automatically:
-
-| Header | Value |
-| ------------------- | ------------------------------------------------------ |
-| `Accept-Encoding` | `gzip, deflate, br` (when `options.compress === true`) |
-| `Accept` | `*/*` |
-| `Content-Length` | _(automatically calculated, if possible)_ |
-| `Host` | _(host and port information from the target URI)_ |
-| `Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_ |
-| `User-Agent` | `node-fetch` |
-
-
-Note: when `body` is a `Stream`, `Content-Length` is not set automatically.
-
-#### Custom Agent
-
-The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following:
-
-- Support self-signed certificate
-- Use only IPv4 or IPv6
-- Custom DNS Lookup
-
-See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information.
-
-If no agent is specified, the default agent provided by Node.js is used. Note that [this changed in Node.js 19](https://github.com/nodejs/node/blob/4267b92604ad78584244488e7f7508a690cb80d0/lib/_http_agent.js#L564) to have `keepalive` true by default. If you wish to enable `keepalive` in an earlier version of Node.js, you can override the agent as per the following code sample.
-
-In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
-
-```js
-import http from 'node:http';
-import https from 'node:https';
-
-const httpAgent = new http.Agent({
- keepAlive: true
-});
-const httpsAgent = new https.Agent({
- keepAlive: true
-});
-
-const options = {
- agent: function(_parsedURL) {
- if (_parsedURL.protocol == 'http:') {
- return httpAgent;
- } else {
- return httpsAgent;
- }
- }
-};
-```
-
-
-
-#### Custom highWaterMark
-
-Stream on Node.js have a smaller internal buffer size (16kB, aka `highWaterMark`) from client-side browsers (>1MB, not consistent across browsers). Because of that, when you are writing an isomorphic app and using `res.clone()`, it will hang with large response in Node.
-
-The recommended way to fix this problem is to resolve cloned response in parallel:
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://example.com');
-const r1 = response.clone();
-
-const results = await Promise.all([response.json(), r1.text()]);
-
-console.log(results[0]);
-console.log(results[1]);
-```
-
-If for some reason you don't like the solution above, since `3.x` you are able to modify the `highWaterMark` option:
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://example.com', {
- // About 1MB
- highWaterMark: 1024 * 1024
-});
-
-const result = await res.clone().arrayBuffer();
-console.dir(result);
-```
-
-#### Insecure HTTP Parser
-
-Passed through to the `insecureHTTPParser` option on http(s).request. See [`http.request`](https://nodejs.org/api/http.html#http_http_request_url_options_callback) for more information.
-
-#### Manual Redirect
-
-The `redirect: 'manual'` option for node-fetch is different from the browser & specification, which
-results in an [opaque-redirect filtered response](https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect).
-node-fetch gives you the typical [basic filtered response](https://fetch.spec.whatwg.org/#concept-filtered-response-basic) instead.
-
-```js
-import fetch from 'node-fetch';
-
-const response = await fetch('https://httpbin.org/status/301', { redirect: 'manual' });
-
-if (response.status === 301 || response.status === 302) {
- const locationURL = new URL(response.headers.get('location'), response.url);
- const response2 = await fetch(locationURL, { redirect: 'manual' });
- console.dir(response2);
-}
-```
-
-
-
-### Class: Request
-
-An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface.
-
-Due to the nature of Node.js, the following properties are not implemented at this moment:
-
-- `type`
-- `destination`
-- `mode`
-- `credentials`
-- `cache`
-- `integrity`
-- `keepalive`
-
-The following node-fetch extension properties are provided:
-
-- `follow`
-- `compress`
-- `counter`
-- `agent`
-- `highWaterMark`
-
-See [options](#fetch-options) for exact meaning of these extensions.
-
-#### new Request(input[, options])
-
-_(spec-compliant)_
-
-- `input` A string representing a URL, or another `Request` (which will be cloned)
-- `options` [Options](#fetch-options) for the HTTP(S) request
-
-Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request).
-
-In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object.
-
-
-
-### Class: Response
-
-An HTTP(S) response. This class implements the [Body](#iface-body) interface.
-
-The following properties are not implemented in node-fetch at this moment:
-
-- `trailer`
-
-#### new Response([body[, options]])
-
-_(spec-compliant)_
-
-- `body` A `String` or [`Readable` stream][node-readable]
-- `options` A [`ResponseInit`][response-init] options dictionary
-
-Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response).
-
-Because Node.js does not implement service workers (for which this class was designed), one rarely has to construct a `Response` directly.
-
-#### response.ok
-
-_(spec-compliant)_
-
-Convenience property representing if the request ended normally. Will evaluate to true if the response status was greater than or equal to 200 but smaller than 300.
-
-#### response.redirected
-
-_(spec-compliant)_
-
-Convenience property representing if the request has been redirected at least once. Will evaluate to true if the internal redirect counter is greater than 0.
-
-#### response.type
-
-_(deviation from spec)_
-
-Convenience property representing the response's type. node-fetch only supports `'default'` and `'error'` and does not make use of [filtered responses](https://fetch.spec.whatwg.org/#concept-filtered-response).
-
-
-
-### Class: Headers
-
-This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented.
-
-#### new Headers([init])
-
-_(spec-compliant)_
-
-- `init` Optional argument to pre-fill the `Headers` object
-
-Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object or any iterable object.
-
-```js
-// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class
-import {Headers} from 'node-fetch';
-
-const meta = {
- 'Content-Type': 'text/xml'
-};
-const headers = new Headers(meta);
-
-// The above is equivalent to
-const meta = [['Content-Type', 'text/xml']];
-const headers = new Headers(meta);
-
-// You can in fact use any iterable objects, like a Map or even another Headers
-const meta = new Map();
-meta.set('Content-Type', 'text/xml');
-const headers = new Headers(meta);
-const copyOfHeaders = new Headers(headers);
-```
-
-
-
-### Interface: Body
-
-`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes.
-
-#### body.body
-
-_(deviation from spec)_
-
-- Node.js [`Readable` stream][node-readable]
-
-Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable].
-
-#### body.bodyUsed
-
-_(spec-compliant)_
-
-- `Boolean`
-
-A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again.
-
-#### body.arrayBuffer()
-
-#### body.formData()
-
-#### body.blob()
-
-#### body.json()
-
-#### body.text()
-
-`fetch` comes with methods to parse `multipart/form-data` payloads as well as
-`x-www-form-urlencoded` bodies using `.formData()` this comes from the idea that
-Service Worker can intercept such messages before it's sent to the server to
-alter them. This is useful for anybody building a server so you can use it to
-parse & consume payloads.
-
-
-Code example
-
-```js
-import http from 'node:http'
-import { Response } from 'node-fetch'
-
-http.createServer(async function (req, res) {
- const formData = await new Response(req, {
- headers: req.headers // Pass along the boundary value
- }).formData()
- const allFields = [...formData]
-
- const file = formData.get('uploaded-files')
- const arrayBuffer = await file.arrayBuffer()
- const text = await file.text()
- const whatwgReadableStream = file.stream()
-
- // other was to consume the request could be to do:
- const json = await new Response(req).json()
- const text = await new Response(req).text()
- const arrayBuffer = await new Response(req).arrayBuffer()
- const blob = await new Response(req, {
- headers: req.headers // So that `type` inherits `Content-Type`
- }.blob()
-})
-```
-
-
-
-
-
-### Class: FetchError
-
-_(node-fetch extension)_
-
-An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info.
-
-
-
-### Class: AbortError
-
-_(node-fetch extension)_
-
-An Error thrown when the request is aborted in response to an `AbortSignal`'s `abort` event. It has a `name` property of `AbortError`. See [ERROR-HANDLING.MD][] for more info.
-
-## TypeScript
-
-**Since `3.x` types are bundled with `node-fetch`, so you don't need to install any additional packages.**
-
-For older versions please use the type definitions from [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped):
-
-```sh
-npm install --save-dev @types/node-fetch@2.x
-```
-
-## Acknowledgement
-
-Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference.
-
-## Team
-
-| [](https://github.com/bitinn) | [](https://github.com/jimmywarting) | [](https://github.com/xxczaki) | [](https://github.com/Richienb) | [](https://github.com/gr2m) |
-| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
-| [David Frank](https://bitinn.net/) | [Jimmy Wärting](https://jimmy.warting.se/) | [Antoni Kepinski](https://kepinski.ch) | [Richie Bendall](https://www.richie-bendall.ml/) | [Gregor Martynus](https://twitter.com/gr2m) |
-
-###### Former
-
-- [Timothy Gu](https://github.com/timothygu)
-- [Jared Kantrowitz](https://github.com/jkantr)
-
-## License
-
-[MIT](LICENSE.md)
-
-[whatwg-fetch]: https://fetch.spec.whatwg.org/
-[response-init]: https://fetch.spec.whatwg.org/#responseinit
-[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams
-[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers
-[error-handling.md]: https://github.com/node-fetch/node-fetch/blob/master/docs/ERROR-HANDLING.md
-[FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData
-[Blob]: https://developer.mozilla.org/en-US/docs/Web/API/Blob
-[File]: https://developer.mozilla.org/en-US/docs/Web/API/File
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/package.json b/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/package.json
deleted file mode 100644
index 2b4e8583..00000000
--- a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/package.json
+++ /dev/null
@@ -1,131 +0,0 @@
-{
- "name": "node-fetch",
- "version": "3.3.2",
- "description": "A light-weight module that brings Fetch API to node.js",
- "main": "./src/index.js",
- "sideEffects": false,
- "type": "module",
- "files": [
- "src",
- "@types/index.d.ts"
- ],
- "types": "./@types/index.d.ts",
- "engines": {
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
- },
- "scripts": {
- "test": "mocha",
- "coverage": "c8 report --reporter=text-lcov | coveralls",
- "test-types": "tsd",
- "lint": "xo"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/node-fetch/node-fetch.git"
- },
- "keywords": [
- "fetch",
- "http",
- "promise",
- "request",
- "curl",
- "wget",
- "xhr",
- "whatwg"
- ],
- "author": "David Frank",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/node-fetch/node-fetch/issues"
- },
- "homepage": "https://github.com/node-fetch/node-fetch",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/node-fetch"
- },
- "devDependencies": {
- "abort-controller": "^3.0.0",
- "abortcontroller-polyfill": "^1.7.1",
- "busboy": "^1.4.0",
- "c8": "^7.7.2",
- "chai": "^4.3.4",
- "chai-as-promised": "^7.1.1",
- "chai-iterator": "^3.0.2",
- "chai-string": "^1.5.0",
- "coveralls": "^3.1.0",
- "form-data": "^4.0.0",
- "formdata-node": "^4.2.4",
- "mocha": "^9.1.3",
- "p-timeout": "^5.0.0",
- "stream-consumers": "^1.0.1",
- "tsd": "^0.14.0",
- "xo": "^0.39.1"
- },
- "dependencies": {
- "data-uri-to-buffer": "^4.0.0",
- "fetch-blob": "^3.1.4",
- "formdata-polyfill": "^4.0.10"
- },
- "tsd": {
- "cwd": "@types",
- "compilerOptions": {
- "esModuleInterop": true
- }
- },
- "xo": {
- "envs": [
- "node",
- "browser"
- ],
- "ignores": [
- "example.js"
- ],
- "rules": {
- "complexity": 0,
- "import/extensions": 0,
- "import/no-useless-path-segments": 0,
- "import/no-anonymous-default-export": 0,
- "import/no-named-as-default": 0,
- "unicorn/import-index": 0,
- "unicorn/no-array-reduce": 0,
- "unicorn/prefer-node-protocol": 0,
- "unicorn/numeric-separators-style": 0,
- "unicorn/explicit-length-check": 0,
- "capitalized-comments": 0,
- "node/no-unsupported-features/es-syntax": 0,
- "@typescript-eslint/member-ordering": 0
- },
- "overrides": [
- {
- "files": "test/**/*.js",
- "envs": [
- "node",
- "mocha"
- ],
- "rules": {
- "max-nested-callbacks": 0,
- "no-unused-expressions": 0,
- "no-warning-comments": 0,
- "new-cap": 0,
- "guard-for-in": 0,
- "unicorn/no-array-for-each": 0,
- "unicorn/prevent-abbreviations": 0,
- "promise/prefer-await-to-then": 0,
- "ava/no-import-test-files": 0
- }
- }
- ]
- },
- "runkitExampleFilename": "example.js",
- "release": {
- "branches": [
- "+([0-9]).x",
- "main",
- "next",
- {
- "name": "beta",
- "prerelease": true
- }
- ]
- }
-}
diff --git a/node_modules/@nostr-dev-kit/ndk/package.json b/node_modules/@nostr-dev-kit/ndk/package.json
index 5af807b3..e20d9163 100644
--- a/node_modules/@nostr-dev-kit/ndk/package.json
+++ b/node_modules/@nostr-dev-kit/ndk/package.json
@@ -1,6 +1,6 @@
{
"name": "@nostr-dev-kit/ndk",
- "version": "2.0.5",
+ "version": "2.1.1",
"description": "NDK - Nostr Development Kit",
"homepage": "https://ndk.fyi",
"documentation": "https://github.com/nostr-dev-kit/ndk/blob/master/docs/modules.md",
@@ -48,10 +48,10 @@
"@noble/secp256k1": "^2.0.0",
"@scure/base": "^1.1.1",
"debug": "^4.3.4",
- "eventemitter3": "^5.0.1",
"light-bolt11-decoder": "^3.0.0",
"node-fetch": "^3.3.1",
"nostr-tools": "^1.15.0",
+ "tseep": "^1.1.1",
"typescript-lru-cache": "^2.0.0",
"utf8-buffer": "^1.0.0",
"websocket-polyfill": "^0.0.3"
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/LICENSE.md b/node_modules/cross-fetch/node_modules/node-fetch/LICENSE.md
similarity index 96%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/LICENSE.md
rename to node_modules/cross-fetch/node_modules/node-fetch/LICENSE.md
index 41ca1b6e..660ffecb 100644
--- a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/LICENSE.md
+++ b/node_modules/cross-fetch/node_modules/node-fetch/LICENSE.md
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2016 - 2020 Node Fetch Team
+Copyright (c) 2016 David Frank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/node_modules/cross-fetch/node_modules/node-fetch/README.md b/node_modules/cross-fetch/node_modules/node-fetch/README.md
new file mode 100644
index 00000000..55f09b7f
--- /dev/null
+++ b/node_modules/cross-fetch/node_modules/node-fetch/README.md
@@ -0,0 +1,634 @@
+node-fetch
+==========
+
+[![npm version][npm-image]][npm-url]
+[![build status][travis-image]][travis-url]
+[![coverage status][codecov-image]][codecov-url]
+[![install size][install-size-image]][install-size-url]
+[![Discord][discord-image]][discord-url]
+
+A light-weight module that brings `window.fetch` to Node.js
+
+(We are looking for [v2 maintainers and collaborators](https://github.com/bitinn/node-fetch/issues/567))
+
+[![Backers][opencollective-image]][opencollective-url]
+
+
+
+- [Motivation](#motivation)
+- [Features](#features)
+- [Difference from client-side fetch](#difference-from-client-side-fetch)
+- [Installation](#installation)
+- [Loading and configuring the module](#loading-and-configuring-the-module)
+- [Common Usage](#common-usage)
+ - [Plain text or HTML](#plain-text-or-html)
+ - [JSON](#json)
+ - [Simple Post](#simple-post)
+ - [Post with JSON](#post-with-json)
+ - [Post with form parameters](#post-with-form-parameters)
+ - [Handling exceptions](#handling-exceptions)
+ - [Handling client and server errors](#handling-client-and-server-errors)
+- [Advanced Usage](#advanced-usage)
+ - [Streams](#streams)
+ - [Buffer](#buffer)
+ - [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data)
+ - [Extract Set-Cookie Header](#extract-set-cookie-header)
+ - [Post data using a file stream](#post-data-using-a-file-stream)
+ - [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart)
+ - [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal)
+- [API](#api)
+ - [fetch(url[, options])](#fetchurl-options)
+ - [Options](#options)
+ - [Class: Request](#class-request)
+ - [Class: Response](#class-response)
+ - [Class: Headers](#class-headers)
+ - [Interface: Body](#interface-body)
+ - [Class: FetchError](#class-fetcherror)
+- [License](#license)
+- [Acknowledgement](#acknowledgement)
+
+
+
+## Motivation
+
+Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime.
+
+See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side).
+
+## Features
+
+- Stay consistent with `window.fetch` API.
+- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences.
+- Use native promise but allow substituting it with [insert your favorite promise library].
+- Use native Node streams for body on both request and response.
+- Decode content encoding (gzip/deflate) properly and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically.
+- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors](ERROR-HANDLING.md) for troubleshooting.
+
+## Difference from client-side fetch
+
+- See [Known Differences](LIMITS.md) for details.
+- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue.
+- Pull requests are welcomed too!
+
+## Installation
+
+Current stable release (`2.x`)
+
+```sh
+$ npm install node-fetch
+```
+
+## Loading and configuring the module
+We suggest you load the module via `require` until the stabilization of ES modules in node:
+```js
+const fetch = require('node-fetch');
+```
+
+If you are using a Promise library other than native, set it through `fetch.Promise`:
+```js
+const Bluebird = require('bluebird');
+
+fetch.Promise = Bluebird;
+```
+
+## Common Usage
+
+NOTE: The documentation below is up-to-date with `2.x` releases; see the [`1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences.
+
+#### Plain text or HTML
+```js
+fetch('https://github.com/')
+ .then(res => res.text())
+ .then(body => console.log(body));
+```
+
+#### JSON
+
+```js
+
+fetch('https://api.github.com/users/github')
+ .then(res => res.json())
+ .then(json => console.log(json));
+```
+
+#### Simple Post
+```js
+fetch('https://httpbin.org/post', { method: 'POST', body: 'a=1' })
+ .then(res => res.json()) // expecting a json response
+ .then(json => console.log(json));
+```
+
+#### Post with JSON
+
+```js
+const body = { a: 1 };
+
+fetch('https://httpbin.org/post', {
+ method: 'post',
+ body: JSON.stringify(body),
+ headers: { 'Content-Type': 'application/json' },
+ })
+ .then(res => res.json())
+ .then(json => console.log(json));
+```
+
+#### Post with form parameters
+`URLSearchParams` is available in Node.js as of v7.5.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods.
+
+NOTE: The `Content-Type` header is only set automatically to `x-www-form-urlencoded` when an instance of `URLSearchParams` is given as such:
+
+```js
+const { URLSearchParams } = require('url');
+
+const params = new URLSearchParams();
+params.append('a', 1);
+
+fetch('https://httpbin.org/post', { method: 'POST', body: params })
+ .then(res => res.json())
+ .then(json => console.log(json));
+```
+
+#### Handling exceptions
+NOTE: 3xx-5xx responses are *NOT* exceptions and should be handled in `then()`; see the next section for more information.
+
+Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, network errors and operational errors, which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details.
+
+```js
+fetch('https://domain.invalid/')
+ .catch(err => console.error(err));
+```
+
+#### Handling client and server errors
+It is common to create a helper function to check that the response contains no client (4xx) or server (5xx) error responses:
+
+```js
+function checkStatus(res) {
+ if (res.ok) { // res.status >= 200 && res.status < 300
+ return res;
+ } else {
+ throw MyCustomError(res.statusText);
+ }
+}
+
+fetch('https://httpbin.org/status/400')
+ .then(checkStatus)
+ .then(res => console.log('will not get here...'))
+```
+
+## Advanced Usage
+
+#### Streams
+The "Node.js way" is to use streams when possible:
+
+```js
+fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
+ .then(res => {
+ const dest = fs.createWriteStream('./octocat.png');
+ res.body.pipe(dest);
+ });
+```
+
+In Node.js 14 you can also use async iterators to read `body`; however, be careful to catch
+errors -- the longer a response runs, the more likely it is to encounter an error.
+
+```js
+const fetch = require('node-fetch');
+const response = await fetch('https://httpbin.org/stream/3');
+try {
+ for await (const chunk of response.body) {
+ console.dir(JSON.parse(chunk.toString()));
+ }
+} catch (err) {
+ console.error(err.stack);
+}
+```
+
+In Node.js 12 you can also use async iterators to read `body`; however, async iterators with streams
+did not mature until Node.js 14, so you need to do some extra work to ensure you handle errors
+directly from the stream and wait on it response to fully close.
+
+```js
+const fetch = require('node-fetch');
+const read = async body => {
+ let error;
+ body.on('error', err => {
+ error = err;
+ });
+ for await (const chunk of body) {
+ console.dir(JSON.parse(chunk.toString()));
+ }
+ return new Promise((resolve, reject) => {
+ body.on('close', () => {
+ error ? reject(error) : resolve();
+ });
+ });
+};
+try {
+ const response = await fetch('https://httpbin.org/stream/3');
+ await read(response.body);
+} catch (err) {
+ console.error(err.stack);
+}
+```
+
+#### Buffer
+If you prefer to cache binary data in full, use buffer(). (NOTE: `buffer()` is a `node-fetch`-only API)
+
+```js
+const fileType = require('file-type');
+
+fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
+ .then(res => res.buffer())
+ .then(buffer => fileType(buffer))
+ .then(type => { /* ... */ });
+```
+
+#### Accessing Headers and other Meta data
+```js
+fetch('https://github.com/')
+ .then(res => {
+ console.log(res.ok);
+ console.log(res.status);
+ console.log(res.statusText);
+ console.log(res.headers.raw());
+ console.log(res.headers.get('content-type'));
+ });
+```
+
+#### Extract Set-Cookie Header
+
+Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API.
+
+```js
+fetch(url).then(res => {
+ // returns an array of values, instead of a string of comma-separated values
+ console.log(res.headers.raw()['set-cookie']);
+});
+```
+
+#### Post data using a file stream
+
+```js
+const { createReadStream } = require('fs');
+
+const stream = createReadStream('input.txt');
+
+fetch('https://httpbin.org/post', { method: 'POST', body: stream })
+ .then(res => res.json())
+ .then(json => console.log(json));
+```
+
+#### Post with form-data (detect multipart)
+
+```js
+const FormData = require('form-data');
+
+const form = new FormData();
+form.append('a', 1);
+
+fetch('https://httpbin.org/post', { method: 'POST', body: form })
+ .then(res => res.json())
+ .then(json => console.log(json));
+
+// OR, using custom headers
+// NOTE: getHeaders() is non-standard API
+
+const form = new FormData();
+form.append('a', 1);
+
+const options = {
+ method: 'POST',
+ body: form,
+ headers: form.getHeaders()
+}
+
+fetch('https://httpbin.org/post', options)
+ .then(res => res.json())
+ .then(json => console.log(json));
+```
+
+#### Request cancellation with AbortSignal
+
+> NOTE: You may cancel streamed requests only on Node >= v8.0.0
+
+You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller).
+
+An example of timing out a request after 150ms could be achieved as the following:
+
+```js
+import AbortController from 'abort-controller';
+
+const controller = new AbortController();
+const timeout = setTimeout(
+ () => { controller.abort(); },
+ 150,
+);
+
+fetch(url, { signal: controller.signal })
+ .then(res => res.json())
+ .then(
+ data => {
+ useData(data)
+ },
+ err => {
+ if (err.name === 'AbortError') {
+ // request was aborted
+ }
+ },
+ )
+ .finally(() => {
+ clearTimeout(timeout);
+ });
+```
+
+See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for more examples.
+
+
+## API
+
+### fetch(url[, options])
+
+- `url` A string representing the URL for fetching
+- `options` [Options](#fetch-options) for the HTTP(S) request
+- Returns: Promise<[Response](#class-response)>
+
+Perform an HTTP(S) fetch.
+
+`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`.
+
+
+### Options
+
+The default values are shown after each option key.
+
+```js
+{
+ // These properties are part of the Fetch Standard
+ method: 'GET',
+ headers: {}, // request headers. format is the identical to that accepted by the Headers constructor (see below)
+ body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream
+ redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect
+ signal: null, // pass an instance of AbortSignal to optionally abort requests
+
+ // The following properties are node-fetch extensions
+ follow: 20, // maximum redirect count. 0 to not follow redirect
+ timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies). Signal is recommended instead.
+ compress: true, // support gzip/deflate content encoding. false to disable
+ size: 0, // maximum response body size in bytes. 0 to disable
+ agent: null // http(s).Agent instance or function that returns an instance (see below)
+}
+```
+
+##### Default Headers
+
+If no values are set, the following request headers will be sent automatically:
+
+Header | Value
+------------------- | --------------------------------------------------------
+`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_
+`Accept` | `*/*`
+`Content-Length` | _(automatically calculated, if possible)_
+`Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_
+`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)`
+
+Note: when `body` is a `Stream`, `Content-Length` is not set automatically.
+
+##### Custom Agent
+
+The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following:
+
+- Support self-signed certificate
+- Use only IPv4 or IPv6
+- Custom DNS Lookup
+
+See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information.
+
+If no agent is specified, the default agent provided by Node.js is used. Note that [this changed in Node.js 19](https://github.com/nodejs/node/blob/4267b92604ad78584244488e7f7508a690cb80d0/lib/_http_agent.js#L564) to have `keepalive` true by default. If you wish to enable `keepalive` in an earlier version of Node.js, you can override the agent as per the following code sample.
+
+In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
+
+```js
+const httpAgent = new http.Agent({
+ keepAlive: true
+});
+const httpsAgent = new https.Agent({
+ keepAlive: true
+});
+
+const options = {
+ agent: function (_parsedURL) {
+ if (_parsedURL.protocol == 'http:') {
+ return httpAgent;
+ } else {
+ return httpsAgent;
+ }
+ }
+}
+```
+
+
+### Class: Request
+
+An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface.
+
+Due to the nature of Node.js, the following properties are not implemented at this moment:
+
+- `type`
+- `destination`
+- `referrer`
+- `referrerPolicy`
+- `mode`
+- `credentials`
+- `cache`
+- `integrity`
+- `keepalive`
+
+The following node-fetch extension properties are provided:
+
+- `follow`
+- `compress`
+- `counter`
+- `agent`
+
+See [options](#fetch-options) for exact meaning of these extensions.
+
+#### new Request(input[, options])
+
+*(spec-compliant)*
+
+- `input` A string representing a URL, or another `Request` (which will be cloned)
+- `options` [Options][#fetch-options] for the HTTP(S) request
+
+Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request).
+
+In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object.
+
+
+### Class: Response
+
+An HTTP(S) response. This class implements the [Body](#iface-body) interface.
+
+The following properties are not implemented in node-fetch at this moment:
+
+- `Response.error()`
+- `Response.redirect()`
+- `type`
+- `trailer`
+
+#### new Response([body[, options]])
+
+*(spec-compliant)*
+
+- `body` A `String` or [`Readable` stream][node-readable]
+- `options` A [`ResponseInit`][response-init] options dictionary
+
+Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response).
+
+Because Node.js does not implement service workers (for which this class was designed), one rarely has to construct a `Response` directly.
+
+#### response.ok
+
+*(spec-compliant)*
+
+Convenience property representing if the request ended normally. Will evaluate to true if the response status was greater than or equal to 200 but smaller than 300.
+
+#### response.redirected
+
+*(spec-compliant)*
+
+Convenience property representing if the request has been redirected at least once. Will evaluate to true if the internal redirect counter is greater than 0.
+
+
+### Class: Headers
+
+This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented.
+
+#### new Headers([init])
+
+*(spec-compliant)*
+
+- `init` Optional argument to pre-fill the `Headers` object
+
+Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object or any iterable object.
+
+```js
+// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class
+
+const meta = {
+ 'Content-Type': 'text/xml',
+ 'Breaking-Bad': '<3'
+};
+const headers = new Headers(meta);
+
+// The above is equivalent to
+const meta = [
+ [ 'Content-Type', 'text/xml' ],
+ [ 'Breaking-Bad', '<3' ]
+];
+const headers = new Headers(meta);
+
+// You can in fact use any iterable objects, like a Map or even another Headers
+const meta = new Map();
+meta.set('Content-Type', 'text/xml');
+meta.set('Breaking-Bad', '<3');
+const headers = new Headers(meta);
+const copyOfHeaders = new Headers(headers);
+```
+
+
+### Interface: Body
+
+`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes.
+
+The following methods are not yet implemented in node-fetch at this moment:
+
+- `formData()`
+
+#### body.body
+
+*(deviation from spec)*
+
+* Node.js [`Readable` stream][node-readable]
+
+Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable].
+
+#### body.bodyUsed
+
+*(spec-compliant)*
+
+* `Boolean`
+
+A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again.
+
+#### body.arrayBuffer()
+#### body.blob()
+#### body.json()
+#### body.text()
+
+*(spec-compliant)*
+
+* Returns: Promise
+
+Consume the body and return a promise that will resolve to one of these formats.
+
+#### body.buffer()
+
+*(node-fetch extension)*
+
+* Returns: Promise<Buffer>
+
+Consume the body and return a promise that will resolve to a Buffer.
+
+#### body.textConverted()
+
+*(node-fetch extension)*
+
+* Returns: Promise<String>
+
+Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8 if possible.
+
+(This API requires an optional dependency of the npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.)
+
+
+### Class: FetchError
+
+*(node-fetch extension)*
+
+An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info.
+
+
+### Class: AbortError
+
+*(node-fetch extension)*
+
+An Error thrown when the request is aborted in response to an `AbortSignal`'s `abort` event. It has a `name` property of `AbortError`. See [ERROR-HANDLING.MD][] for more info.
+
+## Acknowledgement
+
+Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference.
+
+`node-fetch` v1 was maintained by [@bitinn](https://github.com/bitinn); v2 was maintained by [@TimothyGu](https://github.com/timothygu), [@bitinn](https://github.com/bitinn) and [@jimmywarting](https://github.com/jimmywarting); v2 readme is written by [@jkantr](https://github.com/jkantr).
+
+## License
+
+MIT
+
+[npm-image]: https://flat.badgen.net/npm/v/node-fetch
+[npm-url]: https://www.npmjs.com/package/node-fetch
+[travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch
+[travis-url]: https://travis-ci.org/bitinn/node-fetch
+[codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master
+[codecov-url]: https://codecov.io/gh/bitinn/node-fetch
+[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch
+[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch
+[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square
+[discord-url]: https://discord.gg/Zxbndcm
+[opencollective-image]: https://opencollective.com/node-fetch/backers.svg
+[opencollective-url]: https://opencollective.com/node-fetch
+[whatwg-fetch]: https://fetch.spec.whatwg.org/
+[response-init]: https://fetch.spec.whatwg.org/#responseinit
+[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams
+[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers
+[LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md
+[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md
+[UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md
diff --git a/node_modules/node-fetch/browser.js b/node_modules/cross-fetch/node_modules/node-fetch/browser.js
similarity index 100%
rename from node_modules/node-fetch/browser.js
rename to node_modules/cross-fetch/node_modules/node-fetch/browser.js
diff --git a/node_modules/node-fetch/lib/index.es.js b/node_modules/cross-fetch/node_modules/node-fetch/lib/index.es.js
similarity index 100%
rename from node_modules/node-fetch/lib/index.es.js
rename to node_modules/cross-fetch/node_modules/node-fetch/lib/index.es.js
diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/cross-fetch/node_modules/node-fetch/lib/index.js
similarity index 100%
rename from node_modules/node-fetch/lib/index.js
rename to node_modules/cross-fetch/node_modules/node-fetch/lib/index.js
diff --git a/node_modules/node-fetch/lib/index.mjs b/node_modules/cross-fetch/node_modules/node-fetch/lib/index.mjs
similarity index 100%
rename from node_modules/node-fetch/lib/index.mjs
rename to node_modules/cross-fetch/node_modules/node-fetch/lib/index.mjs
diff --git a/node_modules/cross-fetch/node_modules/node-fetch/package.json b/node_modules/cross-fetch/node_modules/node-fetch/package.json
new file mode 100644
index 00000000..e0be1768
--- /dev/null
+++ b/node_modules/cross-fetch/node_modules/node-fetch/package.json
@@ -0,0 +1,89 @@
+{
+ "name": "node-fetch",
+ "version": "2.7.0",
+ "description": "A light-weight module that brings window.fetch to node.js",
+ "main": "lib/index.js",
+ "browser": "./browser.js",
+ "module": "lib/index.mjs",
+ "files": [
+ "lib/index.js",
+ "lib/index.mjs",
+ "lib/index.es.js",
+ "browser.js"
+ ],
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "scripts": {
+ "build": "cross-env BABEL_ENV=rollup rollup -c",
+ "prepare": "npm run build",
+ "test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js",
+ "report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js",
+ "coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/bitinn/node-fetch.git"
+ },
+ "keywords": [
+ "fetch",
+ "http",
+ "promise"
+ ],
+ "author": "David Frank",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/bitinn/node-fetch/issues"
+ },
+ "homepage": "https://github.com/bitinn/node-fetch",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ },
+ "devDependencies": {
+ "@ungap/url-search-params": "^0.1.2",
+ "abort-controller": "^1.1.0",
+ "abortcontroller-polyfill": "^1.3.0",
+ "babel-core": "^6.26.3",
+ "babel-plugin-istanbul": "^4.1.6",
+ "babel-plugin-transform-async-generator-functions": "^6.24.1",
+ "babel-polyfill": "^6.26.0",
+ "babel-preset-env": "1.4.0",
+ "babel-register": "^6.16.3",
+ "chai": "^3.5.0",
+ "chai-as-promised": "^7.1.1",
+ "chai-iterator": "^1.1.1",
+ "chai-string": "~1.3.0",
+ "codecov": "3.3.0",
+ "cross-env": "^5.2.0",
+ "form-data": "^2.3.3",
+ "is-builtin-module": "^1.0.0",
+ "mocha": "^5.0.0",
+ "nyc": "11.9.0",
+ "parted": "^0.1.1",
+ "promise": "^8.0.3",
+ "resumer": "0.0.0",
+ "rollup": "^0.63.4",
+ "rollup-plugin-babel": "^3.0.7",
+ "string-to-arraybuffer": "^1.0.2",
+ "teeny-request": "3.7.0"
+ },
+ "release": {
+ "branches": [
+ "+([0-9]).x",
+ "main",
+ "next",
+ {
+ "name": "beta",
+ "prerelease": true
+ }
+ ]
+ }
+}
diff --git a/node_modules/eventemitter3/README.md b/node_modules/eventemitter3/README.md
deleted file mode 100644
index 5413fc9b..00000000
--- a/node_modules/eventemitter3/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-# EventEmitter3
-
-[](https://www.npmjs.com/package/eventemitter3)[](https://github.com/primus/eventemitter3/actions?query=workflow%3ACI+branch%3Amaster)[](https://coveralls.io/r/primus/eventemitter3?branch=master)
-
-[](https://saucelabs.com/u/eventemitter3)
-
-EventEmitter3 is a high performance EventEmitter. It has been micro-optimized
-for various of code paths making this, one of, if not the fastest EventEmitter
-available for Node.js and browsers. The module is API compatible with the
-EventEmitter that ships by default with Node.js but there are some slight
-differences:
-
-- Domain support has been removed.
-- We do not `throw` an error when you emit an `error` event and nobody is
- listening.
-- The `newListener` and `removeListener` events have been removed as they
- are useful only in some uncommon use-cases.
-- The `setMaxListeners`, `getMaxListeners`, `prependListener` and
- `prependOnceListener` methods are not available.
-- Support for custom context for events so there is no need to use `fn.bind`.
-- The `removeListener` method removes all matching listeners, not only the
- first.
-
-It's a drop in replacement for existing EventEmitters, but just faster. Free
-performance, who wouldn't want that? The EventEmitter is written in EcmaScript 3
-so it will work in the oldest browsers and node versions that you need to
-support.
-
-## Installation
-
-```bash
-$ npm install --save eventemitter3
-```
-
-## CDN
-
-Recommended CDN:
-
-```text
-https://unpkg.com/eventemitter3@latest/dist/eventemitter3.umd.min.js
-```
-
-## Usage
-
-After installation the only thing you need to do is require the module:
-
-```js
-var EventEmitter = require('eventemitter3');
-```
-
-And you're ready to create your own EventEmitter instances. For the API
-documentation, please follow the official Node.js documentation:
-
-http://nodejs.org/api/events.html
-
-### Contextual emits
-
-We've upgraded the API of the `EventEmitter.on`, `EventEmitter.once` and
-`EventEmitter.removeListener` to accept an extra argument which is the `context`
-or `this` value that should be set for the emitted events. This means you no
-longer have the overhead of an event that required `fn.bind` in order to get a
-custom `this` value.
-
-```js
-var EE = new EventEmitter()
- , context = { foo: 'bar' };
-
-function emitted() {
- console.log(this === context); // true
-}
-
-EE.once('event-name', emitted, context);
-EE.on('another-event', emitted, context);
-EE.removeListener('another-event', emitted, context);
-```
-
-### Tests and benchmarks
-
-This module is well tested. You can run:
-
-- `npm test` to run the tests under Node.js.
-- `npm run test-browser` to run the tests in real browsers via Sauce Labs.
-
-We also have a set of benchmarks to compare EventEmitter3 with some available
-alternatives. To run the benchmarks run `npm run benchmark`.
-
-Tests and benchmarks are not included in the npm package. If you want to play
-with them you have to clone the GitHub repository.
-Note that you will have to run an additional `npm i` in the benchmarks folder
-before `npm run benchmark`.
-
-## License
-
-[MIT](LICENSE)
diff --git a/node_modules/eventemitter3/dist/eventemitter3.esm.js b/node_modules/eventemitter3/dist/eventemitter3.esm.js
deleted file mode 100644
index f44b76c2..00000000
--- a/node_modules/eventemitter3/dist/eventemitter3.esm.js
+++ /dev/null
@@ -1,347 +0,0 @@
-var eventemitter3Exports = {};
-var eventemitter3 = {
- get exports(){ return eventemitter3Exports; },
- set exports(v){ eventemitter3Exports = v; },
-};
-
-(function (module) {
-
- var has = Object.prototype.hasOwnProperty
- , prefix = '~';
-
- /**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @private
- */
- function Events() {}
-
- //
- // We try to not inherit from `Object.prototype`. In some engines creating an
- // instance in this way is faster than calling `Object.create(null)` directly.
- // If `Object.create(null)` is not supported we prefix the event names with a
- // character to make sure that the built-in object properties are not
- // overridden or used as an attack vector.
- //
- if (Object.create) {
- Events.prototype = Object.create(null);
-
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
- }
-
- /**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @private
- */
- function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
- }
-
- /**
- * Add a listener for a given event.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} once Specify if the listener is a one-time listener.
- * @returns {EventEmitter}
- * @private
- */
- function addListener(emitter, event, fn, context, once) {
- if (typeof fn !== 'function') {
- throw new TypeError('The listener must be a function');
- }
-
- var listener = new EE(fn, context || emitter, once)
- , evt = prefix ? prefix + event : event;
-
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
- else emitter._events[evt] = [emitter._events[evt], listener];
-
- return emitter;
- }
-
- /**
- * Clear event by name.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} evt The Event name.
- * @private
- */
- function clearEvent(emitter, evt) {
- if (--emitter._eventsCount === 0) emitter._events = new Events();
- else delete emitter._events[evt];
- }
-
- /**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @public
- */
- function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- /**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @public
- */
- EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
-
- if (this._eventsCount === 0) return names;
-
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
-
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
-
- return names;
- };
-
- /**
- * Return the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Array} The registered listeners.
- * @public
- */
- EventEmitter.prototype.listeners = function listeners(event) {
- var evt = prefix ? prefix + event : event
- , handlers = this._events[evt];
-
- if (!handlers) return [];
- if (handlers.fn) return [handlers.fn];
-
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
- ee[i] = handlers[i].fn;
- }
-
- return ee;
- };
-
- /**
- * Return the number of listeners listening to a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Number} The number of listeners.
- * @public
- */
- EventEmitter.prototype.listenerCount = function listenerCount(event) {
- var evt = prefix ? prefix + event : event
- , listeners = this._events[evt];
-
- if (!listeners) return 0;
- if (listeners.fn) return 1;
- return listeners.length;
- };
-
- /**
- * Calls each of the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @public
- */
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return false;
-
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
-
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
-
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
-
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
-
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
-
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
-
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
-
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
-
- return true;
- };
-
- /**
- * Add a listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.on = function on(event, fn, context) {
- return addListener(this, event, fn, context, false);
- };
-
- /**
- * Add a one-time listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.once = function once(event, fn, context) {
- return addListener(this, event, fn, context, true);
- };
-
- /**
- * Remove the listeners of a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {*} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return this;
- if (!fn) {
- clearEvent(this, evt);
- return this;
- }
-
- var listeners = this._events[evt];
-
- if (listeners.fn) {
- if (
- listeners.fn === fn &&
- (!once || listeners.once) &&
- (!context || listeners.context === context)
- ) {
- clearEvent(this, evt);
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn ||
- (once && !listeners[i].once) ||
- (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
-
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else clearEvent(this, evt);
- }
-
- return this;
- };
-
- /**
- * Remove all listeners, or those of the specified event.
- *
- * @param {(String|Symbol)} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
-
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) clearEvent(this, evt);
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- return this;
- };
-
- //
- // Alias methods names because people roll like that.
- //
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
-
- //
- // Expose the prefix.
- //
- EventEmitter.prefixed = prefix;
-
- //
- // Allow `EventEmitter` to be imported as module namespace.
- //
- EventEmitter.EventEmitter = EventEmitter;
-
- //
- // Expose the module.
- //
- {
- module.exports = EventEmitter;
- }
-} (eventemitter3));
-
-var EventEmitter = eventemitter3Exports;
-
-export { EventEmitter, EventEmitter as default };
diff --git a/node_modules/eventemitter3/dist/eventemitter3.esm.min.js b/node_modules/eventemitter3/dist/eventemitter3.esm.min.js
deleted file mode 100644
index 7612ed09..00000000
--- a/node_modules/eventemitter3/dist/eventemitter3.esm.min.js
+++ /dev/null
@@ -1 +0,0 @@
-var e={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new o(r,s||e,i),f=n?n+t:t;return e._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,s=r.length,i=new Array(s);o {
- static prefixed: string | boolean;
-
- /**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- */
- eventNames(): Array>;
-
- /**
- * Return the listeners registered for a given event.
- */
- listeners>(
- event: T
- ): Array>;
-
- /**
- * Return the number of listeners listening to a given event.
- */
- listenerCount(event: EventEmitter.EventNames): number;
-
- /**
- * Calls each of the listeners registered for a given event.
- */
- emit>(
- event: T,
- ...args: EventEmitter.EventArgs
- ): boolean;
-
- /**
- * Add a listener for a given event.
- */
- on>(
- event: T,
- fn: EventEmitter.EventListener,
- context?: Context
- ): this;
- addListener>(
- event: T,
- fn: EventEmitter.EventListener,
- context?: Context
- ): this;
-
- /**
- * Add a one-time listener for a given event.
- */
- once>(
- event: T,
- fn: EventEmitter.EventListener,
- context?: Context
- ): this;
-
- /**
- * Remove the listeners of a given event.
- */
- removeListener>(
- event: T,
- fn?: EventEmitter.EventListener,
- context?: Context,
- once?: boolean
- ): this;
- off>(
- event: T,
- fn?: EventEmitter.EventListener,
- context?: Context,
- once?: boolean
- ): this;
-
- /**
- * Remove all listeners, or those of the specified event.
- */
- removeAllListeners(event?: EventEmitter.EventNames): this;
-}
-
-declare namespace EventEmitter {
- export interface ListenerFn {
- (...args: Args): void;
- }
-
- export interface EventEmitterStatic {
- new <
- EventTypes extends ValidEventTypes = string | symbol,
- Context = any
- >(): EventEmitter;
- }
-
- /**
- * `object` should be in either of the following forms:
- * ```
- * interface EventTypes {
- * 'event-with-parameters': any[]
- * 'event-with-example-handler': (...args: any[]) => void
- * }
- * ```
- */
- export type ValidEventTypes = string | symbol | object;
-
- export type EventNames = T extends string | symbol
- ? T
- : keyof T;
-
- export type ArgumentMap = {
- [K in keyof T]: T[K] extends (...args: any[]) => void
- ? Parameters
- : T[K] extends any[]
- ? T[K]
- : any[];
- };
-
- export type EventListener<
- T extends ValidEventTypes,
- K extends EventNames
- > = T extends string | symbol
- ? (...args: any[]) => void
- : (
- ...args: ArgumentMap>[Extract]
- ) => void;
-
- export type EventArgs<
- T extends ValidEventTypes,
- K extends EventNames
- > = Parameters>;
-
- export const EventEmitter: EventEmitterStatic;
-}
-
-export { EventEmitter }
-export default EventEmitter;
diff --git a/node_modules/eventemitter3/index.js b/node_modules/eventemitter3/index.js
deleted file mode 100644
index 6ea485c4..00000000
--- a/node_modules/eventemitter3/index.js
+++ /dev/null
@@ -1,336 +0,0 @@
-'use strict';
-
-var has = Object.prototype.hasOwnProperty
- , prefix = '~';
-
-/**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @private
- */
-function Events() {}
-
-//
-// We try to not inherit from `Object.prototype`. In some engines creating an
-// instance in this way is faster than calling `Object.create(null)` directly.
-// If `Object.create(null)` is not supported we prefix the event names with a
-// character to make sure that the built-in object properties are not
-// overridden or used as an attack vector.
-//
-if (Object.create) {
- Events.prototype = Object.create(null);
-
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
-}
-
-/**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @private
- */
-function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
-}
-
-/**
- * Add a listener for a given event.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} once Specify if the listener is a one-time listener.
- * @returns {EventEmitter}
- * @private
- */
-function addListener(emitter, event, fn, context, once) {
- if (typeof fn !== 'function') {
- throw new TypeError('The listener must be a function');
- }
-
- var listener = new EE(fn, context || emitter, once)
- , evt = prefix ? prefix + event : event;
-
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
- else emitter._events[evt] = [emitter._events[evt], listener];
-
- return emitter;
-}
-
-/**
- * Clear event by name.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} evt The Event name.
- * @private
- */
-function clearEvent(emitter, evt) {
- if (--emitter._eventsCount === 0) emitter._events = new Events();
- else delete emitter._events[evt];
-}
-
-/**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @public
- */
-function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
-}
-
-/**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @public
- */
-EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
-
- if (this._eventsCount === 0) return names;
-
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
-
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
-
- return names;
-};
-
-/**
- * Return the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Array} The registered listeners.
- * @public
- */
-EventEmitter.prototype.listeners = function listeners(event) {
- var evt = prefix ? prefix + event : event
- , handlers = this._events[evt];
-
- if (!handlers) return [];
- if (handlers.fn) return [handlers.fn];
-
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
- ee[i] = handlers[i].fn;
- }
-
- return ee;
-};
-
-/**
- * Return the number of listeners listening to a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Number} The number of listeners.
- * @public
- */
-EventEmitter.prototype.listenerCount = function listenerCount(event) {
- var evt = prefix ? prefix + event : event
- , listeners = this._events[evt];
-
- if (!listeners) return 0;
- if (listeners.fn) return 1;
- return listeners.length;
-};
-
-/**
- * Calls each of the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @public
- */
-EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return false;
-
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
-
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
-
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
-
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
-
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
-
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
-
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
-
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
-
- return true;
-};
-
-/**
- * Add a listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.on = function on(event, fn, context) {
- return addListener(this, event, fn, context, false);
-};
-
-/**
- * Add a one-time listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.once = function once(event, fn, context) {
- return addListener(this, event, fn, context, true);
-};
-
-/**
- * Remove the listeners of a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {*} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return this;
- if (!fn) {
- clearEvent(this, evt);
- return this;
- }
-
- var listeners = this._events[evt];
-
- if (listeners.fn) {
- if (
- listeners.fn === fn &&
- (!once || listeners.once) &&
- (!context || listeners.context === context)
- ) {
- clearEvent(this, evt);
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn ||
- (once && !listeners[i].once) ||
- (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
-
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else clearEvent(this, evt);
- }
-
- return this;
-};
-
-/**
- * Remove all listeners, or those of the specified event.
- *
- * @param {(String|Symbol)} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @public
- */
-EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
-
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) clearEvent(this, evt);
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- return this;
-};
-
-//
-// Alias methods names because people roll like that.
-//
-EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
-EventEmitter.prototype.addListener = EventEmitter.prototype.on;
-
-//
-// Expose the prefix.
-//
-EventEmitter.prefixed = prefix;
-
-//
-// Allow `EventEmitter` to be imported as module namespace.
-//
-EventEmitter.EventEmitter = EventEmitter;
-
-//
-// Expose the module.
-//
-if ('undefined' !== typeof module) {
- module.exports = EventEmitter;
-}
diff --git a/node_modules/eventemitter3/index.mjs b/node_modules/eventemitter3/index.mjs
deleted file mode 100644
index 89bb4050..00000000
--- a/node_modules/eventemitter3/index.mjs
+++ /dev/null
@@ -1,4 +0,0 @@
-import EventEmitter from './index.js'
-
-export { EventEmitter }
-export default EventEmitter
diff --git a/node_modules/eventemitter3/package.json b/node_modules/eventemitter3/package.json
deleted file mode 100644
index 47843d2e..00000000
--- a/node_modules/eventemitter3/package.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "name": "eventemitter3",
- "version": "5.0.1",
- "description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.",
- "exports": {
- ".": {
- "types": "./index.d.ts",
- "import": "./index.mjs",
- "require": "./index.js"
- },
- "./package.json": "./package.json"
- },
- "main": "index.js",
- "types": "index.d.ts",
- "scripts": {
- "rollup": "rimraf dist umd && rollup -c",
- "benchmark": "find benchmarks/run -name '*.js' -exec benchmarks/start.sh {} \\;",
- "test": "c8 --reporter=lcov --reporter=text mocha test/test.js",
- "test-esm": "mocha test/test.mjs",
- "prepublishOnly": "npm run rollup",
- "test-browser": "node test/browser.js"
- },
- "files": [
- "index.js",
- "index.mjs",
- "index.d.ts",
- "dist"
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/primus/eventemitter3.git"
- },
- "keywords": [
- "EventEmitter",
- "EventEmitter2",
- "EventEmitter3",
- "Events",
- "addEventListener",
- "addListener",
- "emit",
- "emits",
- "emitter",
- "event",
- "once",
- "pub/sub",
- "publish",
- "reactor",
- "subscribe"
- ],
- "author": "Arnout Kazemier",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/primus/eventemitter3/issues"
- },
- "devDependencies": {
- "@rollup/plugin-commonjs": "^24.0.0",
- "@rollup/plugin-terser": "^0.4.0",
- "assume": "^2.2.0",
- "c8": "^7.3.1",
- "mocha": "^10.0.0",
- "pre-commit": "^1.2.0",
- "rimraf": "^4.1.2",
- "rollup": "^3.4.0",
- "sauce-browsers": "^3.0.0",
- "sauce-test": "^1.3.3"
- }
-}
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/@types/index.d.ts b/node_modules/node-fetch/@types/index.d.ts
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/@types/index.d.ts
rename to node_modules/node-fetch/@types/index.d.ts
diff --git a/node_modules/node-fetch/LICENSE.md b/node_modules/node-fetch/LICENSE.md
index 660ffecb..41ca1b6e 100644
--- a/node_modules/node-fetch/LICENSE.md
+++ b/node_modules/node-fetch/LICENSE.md
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2016 David Frank
+Copyright (c) 2016 - 2020 Node Fetch Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/node_modules/node-fetch/README.md b/node_modules/node-fetch/README.md
index 55f09b7f..badc2b19 100644
--- a/node_modules/node-fetch/README.md
+++ b/node_modules/node-fetch/README.md
@@ -1,17 +1,24 @@
-node-fetch
-==========
+
+

+
+
A light-weight module that brings Fetch API to Node.js.
+

+

+

+

+

+

+
+
+
Consider supporting us on our Open Collective:
+
+
+

+
-[![npm version][npm-image]][npm-url]
-[![build status][travis-image]][travis-url]
-[![coverage status][codecov-image]][codecov-url]
-[![install size][install-size-image]][install-size-url]
-[![Discord][discord-image]][discord-url]
+---
-A light-weight module that brings `window.fetch` to Node.js
-
-(We are looking for [v2 maintainers and collaborators](https://github.com/bitinn/node-fetch/issues/567))
-
-[![Backers][opencollective-image]][opencollective-url]
+**You might be looking for the [v2 docs](https://github.com/node-fetch/node-fetch/tree/2.x#readme)**
@@ -20,32 +27,53 @@ A light-weight module that brings `window.fetch` to Node.js
- [Difference from client-side fetch](#difference-from-client-side-fetch)
- [Installation](#installation)
- [Loading and configuring the module](#loading-and-configuring-the-module)
+- [Upgrading](#upgrading)
- [Common Usage](#common-usage)
- - [Plain text or HTML](#plain-text-or-html)
- - [JSON](#json)
- - [Simple Post](#simple-post)
- - [Post with JSON](#post-with-json)
- - [Post with form parameters](#post-with-form-parameters)
- - [Handling exceptions](#handling-exceptions)
- - [Handling client and server errors](#handling-client-and-server-errors)
+ - [Plain text or HTML](#plain-text-or-html)
+ - [JSON](#json)
+ - [Simple Post](#simple-post)
+ - [Post with JSON](#post-with-json)
+ - [Post with form parameters](#post-with-form-parameters)
+ - [Handling exceptions](#handling-exceptions)
+ - [Handling client and server errors](#handling-client-and-server-errors)
+ - [Handling cookies](#handling-cookies)
- [Advanced Usage](#advanced-usage)
- - [Streams](#streams)
- - [Buffer](#buffer)
- - [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data)
- - [Extract Set-Cookie Header](#extract-set-cookie-header)
- - [Post data using a file stream](#post-data-using-a-file-stream)
- - [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart)
- - [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal)
+ - [Streams](#streams)
+ - [Accessing Headers and other Metadata](#accessing-headers-and-other-metadata)
+ - [Extract Set-Cookie Header](#extract-set-cookie-header)
+ - [Post data using a file](#post-data-using-a-file)
+ - [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal)
- [API](#api)
- - [fetch(url[, options])](#fetchurl-options)
- - [Options](#options)
- - [Class: Request](#class-request)
- - [Class: Response](#class-response)
- - [Class: Headers](#class-headers)
- - [Interface: Body](#interface-body)
- - [Class: FetchError](#class-fetcherror)
-- [License](#license)
+ - [fetch(url[, options])](#fetchurl-options)
+ - [Options](#options)
+ - [Default Headers](#default-headers)
+ - [Custom Agent](#custom-agent)
+ - [Custom highWaterMark](#custom-highwatermark)
+ - [Insecure HTTP Parser](#insecure-http-parser)
+ - [Class: Request](#class-request)
+ - [new Request(input[, options])](#new-requestinput-options)
+ - [Class: Response](#class-response)
+ - [new Response([body[, options]])](#new-responsebody-options)
+ - [response.ok](#responseok)
+ - [response.redirected](#responseredirected)
+ - [response.type](#responsetype)
+ - [Class: Headers](#class-headers)
+ - [new Headers([init])](#new-headersinit)
+ - [Interface: Body](#interface-body)
+ - [body.body](#bodybody)
+ - [body.bodyUsed](#bodybodyused)
+ - [body.arrayBuffer()](#bodyarraybuffer)
+ - [body.blob()](#bodyblob)
+ - [body.formData()](#formdata)
+ - [body.json()](#bodyjson)
+ - [body.text()](#bodytext)
+ - [Class: FetchError](#class-fetcherror)
+ - [Class: AbortError](#class-aborterror)
+- [TypeScript](#typescript)
- [Acknowledgement](#acknowledgement)
+- [Team](#team)
+ - [Former](#former)
+- [License](#license)
@@ -53,147 +81,254 @@ A light-weight module that brings `window.fetch` to Node.js
Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime.
-See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side).
+See Jason Miller's [isomorphic-unfetch](https://www.npmjs.com/package/isomorphic-unfetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side).
## Features
- Stay consistent with `window.fetch` API.
- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences.
-- Use native promise but allow substituting it with [insert your favorite promise library].
-- Use native Node streams for body on both request and response.
-- Decode content encoding (gzip/deflate) properly and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically.
-- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors](ERROR-HANDLING.md) for troubleshooting.
+- Use native promise and async functions.
+- Use native Node streams for body, on both request and response.
+- Decode content encoding (gzip/deflate/brotli) properly, and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically.
+- Useful extensions such as redirect limit, response size limit, [explicit errors][error-handling.md] for troubleshooting.
## Difference from client-side fetch
-- See [Known Differences](LIMITS.md) for details.
+- See known differences:
+ - [As of v3.x](docs/v3-LIMITS.md)
+ - [As of v2.x](docs/v2-LIMITS.md)
- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue.
- Pull requests are welcomed too!
## Installation
-Current stable release (`2.x`)
+Current stable release (`3.x`) requires at least Node.js 12.20.0.
```sh
-$ npm install node-fetch
+npm install node-fetch
```
## Loading and configuring the module
-We suggest you load the module via `require` until the stabilization of ES modules in node:
+
+### ES Modules (ESM)
+
```js
-const fetch = require('node-fetch');
+import fetch from 'node-fetch';
```
-If you are using a Promise library other than native, set it through `fetch.Promise`:
-```js
-const Bluebird = require('bluebird');
+### CommonJS
-fetch.Promise = Bluebird;
+`node-fetch` from v3 is an ESM-only module - you are not able to import it with `require()`.
+
+If you cannot switch to ESM, please use v2 which remains compatible with CommonJS. Critical bug fixes will continue to be published for v2.
+
+```sh
+npm install node-fetch@2
```
+Alternatively, you can use the async `import()` function from CommonJS to load `node-fetch` asynchronously:
+
+```js
+// mod.cjs
+const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
+```
+
+### Providing global access
+
+To use `fetch()` without importing it, you can patch the `global` object in node:
+
+```js
+// fetch-polyfill.js
+import fetch, {
+ Blob,
+ blobFrom,
+ blobFromSync,
+ File,
+ fileFrom,
+ fileFromSync,
+ FormData,
+ Headers,
+ Request,
+ Response,
+} from 'node-fetch'
+
+if (!globalThis.fetch) {
+ globalThis.fetch = fetch
+ globalThis.Headers = Headers
+ globalThis.Request = Request
+ globalThis.Response = Response
+}
+
+// index.js
+import './fetch-polyfill'
+
+// ...
+```
+
+## Upgrading
+
+Using an old version of node-fetch? Check out the following files:
+
+- [2.x to 3.x upgrade guide](docs/v3-UPGRADE-GUIDE.md)
+- [1.x to 2.x upgrade guide](docs/v2-UPGRADE-GUIDE.md)
+- [Changelog](https://github.com/node-fetch/node-fetch/releases)
+
## Common Usage
-NOTE: The documentation below is up-to-date with `2.x` releases; see the [`1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences.
+NOTE: The documentation below is up-to-date with `3.x` releases, if you are using an older version, please check how to [upgrade](#upgrading).
-#### Plain text or HTML
-```js
-fetch('https://github.com/')
- .then(res => res.text())
- .then(body => console.log(body));
-```
-
-#### JSON
+### Plain text or HTML
```js
+import fetch from 'node-fetch';
-fetch('https://api.github.com/users/github')
- .then(res => res.json())
- .then(json => console.log(json));
+const response = await fetch('https://github.com/');
+const body = await response.text();
+
+console.log(body);
```
-#### Simple Post
-```js
-fetch('https://httpbin.org/post', { method: 'POST', body: 'a=1' })
- .then(res => res.json()) // expecting a json response
- .then(json => console.log(json));
-```
-
-#### Post with JSON
+### JSON
```js
-const body = { a: 1 };
+import fetch from 'node-fetch';
-fetch('https://httpbin.org/post', {
- method: 'post',
- body: JSON.stringify(body),
- headers: { 'Content-Type': 'application/json' },
- })
- .then(res => res.json())
- .then(json => console.log(json));
+const response = await fetch('https://api.github.com/users/github');
+const data = await response.json();
+
+console.log(data);
```
-#### Post with form parameters
-`URLSearchParams` is available in Node.js as of v7.5.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods.
+### Simple Post
+
+```js
+import fetch from 'node-fetch';
+
+const response = await fetch('https://httpbin.org/post', {method: 'POST', body: 'a=1'});
+const data = await response.json();
+
+console.log(data);
+```
+
+### Post with JSON
+
+```js
+import fetch from 'node-fetch';
+
+const body = {a: 1};
+
+const response = await fetch('https://httpbin.org/post', {
+ method: 'post',
+ body: JSON.stringify(body),
+ headers: {'Content-Type': 'application/json'}
+});
+const data = await response.json();
+
+console.log(data);
+```
+
+### Post with form parameters
+
+`URLSearchParams` is available on the global object in Node.js as of v10.0.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods.
NOTE: The `Content-Type` header is only set automatically to `x-www-form-urlencoded` when an instance of `URLSearchParams` is given as such:
```js
-const { URLSearchParams } = require('url');
+import fetch from 'node-fetch';
const params = new URLSearchParams();
params.append('a', 1);
-fetch('https://httpbin.org/post', { method: 'POST', body: params })
- .then(res => res.json())
- .then(json => console.log(json));
+const response = await fetch('https://httpbin.org/post', {method: 'POST', body: params});
+const data = await response.json();
+
+console.log(data);
```
-#### Handling exceptions
-NOTE: 3xx-5xx responses are *NOT* exceptions and should be handled in `then()`; see the next section for more information.
+### Handling exceptions
-Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, network errors and operational errors, which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details.
+NOTE: 3xx-5xx responses are _NOT_ exceptions, and should be handled in `then()`, see the next section.
+
+Wrapping the fetch function into a `try/catch` block will catch _all_ exceptions, such as errors originating from node core libraries, like network errors, and operational errors which are instances of FetchError. See the [error handling document][error-handling.md] for more details.
```js
-fetch('https://domain.invalid/')
- .catch(err => console.error(err));
+import fetch from 'node-fetch';
+
+try {
+ await fetch('https://domain.invalid/');
+} catch (error) {
+ console.log(error);
+}
```
-#### Handling client and server errors
+### Handling client and server errors
+
It is common to create a helper function to check that the response contains no client (4xx) or server (5xx) error responses:
```js
-function checkStatus(res) {
- if (res.ok) { // res.status >= 200 && res.status < 300
- return res;
- } else {
- throw MyCustomError(res.statusText);
- }
+import fetch from 'node-fetch';
+
+class HTTPResponseError extends Error {
+ constructor(response) {
+ super(`HTTP Error Response: ${response.status} ${response.statusText}`);
+ this.response = response;
+ }
}
-fetch('https://httpbin.org/status/400')
- .then(checkStatus)
- .then(res => console.log('will not get here...'))
+const checkStatus = response => {
+ if (response.ok) {
+ // response.status >= 200 && response.status < 300
+ return response;
+ } else {
+ throw new HTTPResponseError(response);
+ }
+}
+
+const response = await fetch('https://httpbin.org/status/400');
+
+try {
+ checkStatus(response);
+} catch (error) {
+ console.error(error);
+
+ const errorBody = await error.response.text();
+ console.error(`Error body: ${errorBody}`);
+}
```
+### Handling cookies
+
+Cookies are not stored by default. However, cookies can be extracted and passed by manipulating request and response headers. See [Extract Set-Cookie Header](#extract-set-cookie-header) for details.
+
## Advanced Usage
-#### Streams
-The "Node.js way" is to use streams when possible:
+### Streams
+
+The "Node.js way" is to use streams when possible. You can pipe `res.body` to another stream. This example uses [stream.pipeline](https://nodejs.org/api/stream.html#stream_stream_pipeline_streams_callback) to attach stream error handlers and wait for the download to complete.
```js
-fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
- .then(res => {
- const dest = fs.createWriteStream('./octocat.png');
- res.body.pipe(dest);
- });
+import {createWriteStream} from 'node:fs';
+import {pipeline} from 'node:stream';
+import {promisify} from 'node:util'
+import fetch from 'node-fetch';
+
+const streamPipeline = promisify(pipeline);
+
+const response = await fetch('https://github.githubassets.com/images/modules/logos_page/Octocat.png');
+
+if (!response.ok) throw new Error(`unexpected response ${response.statusText}`);
+
+await streamPipeline(response.body, createWriteStream('./octocat.png'));
```
In Node.js 14 you can also use async iterators to read `body`; however, be careful to catch
errors -- the longer a response runs, the more likely it is to encounter an error.
```js
-const fetch = require('node-fetch');
+import fetch from 'node-fetch';
+
const response = await fetch('https://httpbin.org/stream/3');
+
try {
for await (const chunk of response.body) {
console.dir(JSON.parse(chunk.toString()));
@@ -208,141 +343,156 @@ did not mature until Node.js 14, so you need to do some extra work to ensure you
directly from the stream and wait on it response to fully close.
```js
-const fetch = require('node-fetch');
+import fetch from 'node-fetch';
+
const read = async body => {
- let error;
- body.on('error', err => {
- error = err;
- });
- for await (const chunk of body) {
- console.dir(JSON.parse(chunk.toString()));
- }
- return new Promise((resolve, reject) => {
- body.on('close', () => {
- error ? reject(error) : resolve();
- });
- });
+ let error;
+ body.on('error', err => {
+ error = err;
+ });
+
+ for await (const chunk of body) {
+ console.dir(JSON.parse(chunk.toString()));
+ }
+
+ return new Promise((resolve, reject) => {
+ body.on('close', () => {
+ error ? reject(error) : resolve();
+ });
+ });
};
+
try {
- const response = await fetch('https://httpbin.org/stream/3');
- await read(response.body);
+ const response = await fetch('https://httpbin.org/stream/3');
+ await read(response.body);
} catch (err) {
- console.error(err.stack);
+ console.error(err.stack);
}
```
-#### Buffer
-If you prefer to cache binary data in full, use buffer(). (NOTE: `buffer()` is a `node-fetch`-only API)
+### Accessing Headers and other Metadata
```js
-const fileType = require('file-type');
+import fetch from 'node-fetch';
-fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
- .then(res => res.buffer())
- .then(buffer => fileType(buffer))
- .then(type => { /* ... */ });
+const response = await fetch('https://github.com/');
+
+console.log(response.ok);
+console.log(response.status);
+console.log(response.statusText);
+console.log(response.headers.raw());
+console.log(response.headers.get('content-type'));
```
-#### Accessing Headers and other Meta data
-```js
-fetch('https://github.com/')
- .then(res => {
- console.log(res.ok);
- console.log(res.status);
- console.log(res.statusText);
- console.log(res.headers.raw());
- console.log(res.headers.get('content-type'));
- });
-```
-
-#### Extract Set-Cookie Header
+### Extract Set-Cookie Header
Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API.
```js
-fetch(url).then(res => {
- // returns an array of values, instead of a string of comma-separated values
- console.log(res.headers.raw()['set-cookie']);
-});
+import fetch from 'node-fetch';
+
+const response = await fetch('https://example.com');
+
+// Returns an array of values, instead of a string of comma-separated values
+console.log(response.headers.raw()['set-cookie']);
```
-#### Post data using a file stream
+### Post data using a file
```js
-const { createReadStream } = require('fs');
+import fetch, {
+ Blob,
+ blobFrom,
+ blobFromSync,
+ File,
+ fileFrom,
+ fileFromSync,
+} from 'node-fetch'
-const stream = createReadStream('input.txt');
+const mimetype = 'text/plain'
+const blob = fileFromSync('./input.txt', mimetype)
+const url = 'https://httpbin.org/post'
-fetch('https://httpbin.org/post', { method: 'POST', body: stream })
- .then(res => res.json())
- .then(json => console.log(json));
+const response = await fetch(url, { method: 'POST', body: blob })
+const data = await response.json()
+
+console.log(data)
```
-#### Post with form-data (detect multipart)
+node-fetch comes with a spec-compliant [FormData] implementations for posting
+multipart/form-data payloads
```js
-const FormData = require('form-data');
+import fetch, { FormData, File, fileFrom } from 'node-fetch'
-const form = new FormData();
-form.append('a', 1);
+const httpbin = 'https://httpbin.org/post'
+const formData = new FormData()
+const binary = new Uint8Array([ 97, 98, 99 ])
+const abc = new File([binary], 'abc.txt', { type: 'text/plain' })
-fetch('https://httpbin.org/post', { method: 'POST', body: form })
- .then(res => res.json())
- .then(json => console.log(json));
+formData.set('greeting', 'Hello, world!')
+formData.set('file-upload', abc, 'new name.txt')
-// OR, using custom headers
-// NOTE: getHeaders() is non-standard API
+const response = await fetch(httpbin, { method: 'POST', body: formData })
+const data = await response.json()
-const form = new FormData();
-form.append('a', 1);
-
-const options = {
- method: 'POST',
- body: form,
- headers: form.getHeaders()
-}
-
-fetch('https://httpbin.org/post', options)
- .then(res => res.json())
- .then(json => console.log(json));
+console.log(data)
```
-#### Request cancellation with AbortSignal
+If you for some reason need to post a stream coming from any arbitrary place,
+then you can append a [Blob] or a [File] look-a-like item.
-> NOTE: You may cancel streamed requests only on Node >= v8.0.0
+The minimum requirement is that it has:
+1. A `Symbol.toStringTag` getter or property that is either `Blob` or `File`
+2. A known size.
+3. And either a `stream()` method or a `arrayBuffer()` method that returns a ArrayBuffer.
+
+The `stream()` must return any async iterable object as long as it yields Uint8Array (or Buffer)
+so Node.Readable streams and whatwg streams works just fine.
+
+```js
+formData.append('upload', {
+ [Symbol.toStringTag]: 'Blob',
+ size: 3,
+ *stream() {
+ yield new Uint8Array([97, 98, 99])
+ },
+ arrayBuffer() {
+ return new Uint8Array([97, 98, 99]).buffer
+ }
+}, 'abc.txt')
+```
+
+### Request cancellation with AbortSignal
You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller).
An example of timing out a request after 150ms could be achieved as the following:
```js
-import AbortController from 'abort-controller';
+import fetch, { AbortError } from 'node-fetch';
+
+// AbortController was added in node v14.17.0 globally
+const AbortController = globalThis.AbortController || await import('abort-controller')
const controller = new AbortController();
-const timeout = setTimeout(
- () => { controller.abort(); },
- 150,
-);
+const timeout = setTimeout(() => {
+ controller.abort();
+}, 150);
-fetch(url, { signal: controller.signal })
- .then(res => res.json())
- .then(
- data => {
- useData(data)
- },
- err => {
- if (err.name === 'AbortError') {
- // request was aborted
- }
- },
- )
- .finally(() => {
- clearTimeout(timeout);
- });
+try {
+ const response = await fetch('https://example.com', {signal: controller.signal});
+ const data = await response.json();
+} catch (error) {
+ if (error instanceof AbortError) {
+ console.log('request was aborted');
+ }
+} finally {
+ clearTimeout(timeout);
+}
```
-See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for more examples.
-
+See [test cases](https://github.com/node-fetch/node-fetch/blob/master/test/) for more examples.
## API
@@ -354,46 +504,50 @@ See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js)
Perform an HTTP(S) fetch.
-`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`.
+`url` should be an absolute URL, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`.
+
### Options
The default values are shown after each option key.
```js
{
- // These properties are part of the Fetch Standard
- method: 'GET',
- headers: {}, // request headers. format is the identical to that accepted by the Headers constructor (see below)
- body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream
- redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect
- signal: null, // pass an instance of AbortSignal to optionally abort requests
+ // These properties are part of the Fetch Standard
+ method: 'GET',
+ headers: {}, // Request headers. format is the identical to that accepted by the Headers constructor (see below)
+ body: null, // Request body. can be null, or a Node.js Readable stream
+ redirect: 'follow', // Set to `manual` to extract redirect headers, `error` to reject redirect
+ signal: null, // Pass an instance of AbortSignal to optionally abort requests
- // The following properties are node-fetch extensions
- follow: 20, // maximum redirect count. 0 to not follow redirect
- timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies). Signal is recommended instead.
- compress: true, // support gzip/deflate content encoding. false to disable
- size: 0, // maximum response body size in bytes. 0 to disable
- agent: null // http(s).Agent instance or function that returns an instance (see below)
+ // The following properties are node-fetch extensions
+ follow: 20, // maximum redirect count. 0 to not follow redirect
+ compress: true, // support gzip/deflate content encoding. false to disable
+ size: 0, // maximum response body size in bytes. 0 to disable
+ agent: null, // http(s).Agent instance or function that returns an instance (see below)
+ highWaterMark: 16384, // the maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource.
+ insecureHTTPParser: false // Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
}
```
-##### Default Headers
+#### Default Headers
If no values are set, the following request headers will be sent automatically:
-Header | Value
-------------------- | --------------------------------------------------------
-`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_
-`Accept` | `*/*`
-`Content-Length` | _(automatically calculated, if possible)_
-`Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_
-`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)`
+| Header | Value |
+| ------------------- | ------------------------------------------------------ |
+| `Accept-Encoding` | `gzip, deflate, br` (when `options.compress === true`) |
+| `Accept` | `*/*` |
+| `Content-Length` | _(automatically calculated, if possible)_ |
+| `Host` | _(host and port information from the target URI)_ |
+| `Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_ |
+| `User-Agent` | `node-fetch` |
+
Note: when `body` is a `Stream`, `Content-Length` is not set automatically.
-##### Custom Agent
+#### Custom Agent
The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following:
@@ -408,25 +562,85 @@ If no agent is specified, the default agent provided by Node.js is used. Note th
In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
```js
+import http from 'node:http';
+import https from 'node:https';
+
const httpAgent = new http.Agent({
- keepAlive: true
+ keepAlive: true
});
const httpsAgent = new https.Agent({
- keepAlive: true
+ keepAlive: true
});
const options = {
- agent: function (_parsedURL) {
- if (_parsedURL.protocol == 'http:') {
- return httpAgent;
- } else {
- return httpsAgent;
- }
- }
+ agent: function(_parsedURL) {
+ if (_parsedURL.protocol == 'http:') {
+ return httpAgent;
+ } else {
+ return httpsAgent;
+ }
+ }
+};
+```
+
+
+
+#### Custom highWaterMark
+
+Stream on Node.js have a smaller internal buffer size (16kB, aka `highWaterMark`) from client-side browsers (>1MB, not consistent across browsers). Because of that, when you are writing an isomorphic app and using `res.clone()`, it will hang with large response in Node.
+
+The recommended way to fix this problem is to resolve cloned response in parallel:
+
+```js
+import fetch from 'node-fetch';
+
+const response = await fetch('https://example.com');
+const r1 = response.clone();
+
+const results = await Promise.all([response.json(), r1.text()]);
+
+console.log(results[0]);
+console.log(results[1]);
+```
+
+If for some reason you don't like the solution above, since `3.x` you are able to modify the `highWaterMark` option:
+
+```js
+import fetch from 'node-fetch';
+
+const response = await fetch('https://example.com', {
+ // About 1MB
+ highWaterMark: 1024 * 1024
+});
+
+const result = await res.clone().arrayBuffer();
+console.dir(result);
+```
+
+#### Insecure HTTP Parser
+
+Passed through to the `insecureHTTPParser` option on http(s).request. See [`http.request`](https://nodejs.org/api/http.html#http_http_request_url_options_callback) for more information.
+
+#### Manual Redirect
+
+The `redirect: 'manual'` option for node-fetch is different from the browser & specification, which
+results in an [opaque-redirect filtered response](https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect).
+node-fetch gives you the typical [basic filtered response](https://fetch.spec.whatwg.org/#concept-filtered-response-basic) instead.
+
+```js
+import fetch from 'node-fetch';
+
+const response = await fetch('https://httpbin.org/status/301', { redirect: 'manual' });
+
+if (response.status === 301 || response.status === 302) {
+ const locationURL = new URL(response.headers.get('location'), response.url);
+ const response2 = await fetch(locationURL, { redirect: 'manual' });
+ console.dir(response2);
}
```
+
### Class: Request
An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface.
@@ -435,8 +649,6 @@ Due to the nature of Node.js, the following properties are not implemented at th
- `type`
- `destination`
-- `referrer`
-- `referrerPolicy`
- `mode`
- `credentials`
- `cache`
@@ -449,35 +661,34 @@ The following node-fetch extension properties are provided:
- `compress`
- `counter`
- `agent`
+- `highWaterMark`
See [options](#fetch-options) for exact meaning of these extensions.
#### new Request(input[, options])
-*(spec-compliant)*
+_(spec-compliant)_
- `input` A string representing a URL, or another `Request` (which will be cloned)
-- `options` [Options][#fetch-options] for the HTTP(S) request
+- `options` [Options](#fetch-options) for the HTTP(S) request
Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request).
In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object.
+
### Class: Response
An HTTP(S) response. This class implements the [Body](#iface-body) interface.
The following properties are not implemented in node-fetch at this moment:
-- `Response.error()`
-- `Response.redirect()`
-- `type`
- `trailer`
#### new Response([body[, options]])
-*(spec-compliant)*
+_(spec-compliant)_
- `body` A `String` or [`Readable` stream][node-readable]
- `options` A [`ResponseInit`][response-init] options dictionary
@@ -488,24 +699,31 @@ Because Node.js does not implement service workers (for which this class was des
#### response.ok
-*(spec-compliant)*
+_(spec-compliant)_
Convenience property representing if the request ended normally. Will evaluate to true if the response status was greater than or equal to 200 but smaller than 300.
#### response.redirected
-*(spec-compliant)*
+_(spec-compliant)_
Convenience property representing if the request has been redirected at least once. Will evaluate to true if the internal redirect counter is greater than 0.
+#### response.type
+
+_(deviation from spec)_
+
+Convenience property representing the response's type. node-fetch only supports `'default'` and `'error'` and does not make use of [filtered responses](https://fetch.spec.whatwg.org/#concept-filtered-response).
+
+
### Class: Headers
This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented.
#### new Headers([init])
-*(spec-compliant)*
+_(spec-compliant)_
- `init` Optional argument to pre-fill the `Headers` object
@@ -513,122 +731,142 @@ Construct a new `Headers` object. `init` can be either `null`, a `Headers` objec
```js
// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class
+import {Headers} from 'node-fetch';
const meta = {
- 'Content-Type': 'text/xml',
- 'Breaking-Bad': '<3'
+ 'Content-Type': 'text/xml'
};
const headers = new Headers(meta);
// The above is equivalent to
-const meta = [
- [ 'Content-Type', 'text/xml' ],
- [ 'Breaking-Bad', '<3' ]
-];
+const meta = [['Content-Type', 'text/xml']];
const headers = new Headers(meta);
// You can in fact use any iterable objects, like a Map or even another Headers
const meta = new Map();
meta.set('Content-Type', 'text/xml');
-meta.set('Breaking-Bad', '<3');
const headers = new Headers(meta);
const copyOfHeaders = new Headers(headers);
```
+
### Interface: Body
`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes.
-The following methods are not yet implemented in node-fetch at this moment:
-
-- `formData()`
-
#### body.body
-*(deviation from spec)*
+_(deviation from spec)_
-* Node.js [`Readable` stream][node-readable]
+- Node.js [`Readable` stream][node-readable]
Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable].
#### body.bodyUsed
-*(spec-compliant)*
+_(spec-compliant)_
-* `Boolean`
+- `Boolean`
A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again.
#### body.arrayBuffer()
+
+#### body.formData()
+
#### body.blob()
+
#### body.json()
+
#### body.text()
-*(spec-compliant)*
+`fetch` comes with methods to parse `multipart/form-data` payloads as well as
+`x-www-form-urlencoded` bodies using `.formData()` this comes from the idea that
+Service Worker can intercept such messages before it's sent to the server to
+alter them. This is useful for anybody building a server so you can use it to
+parse & consume payloads.
-* Returns: Promise
+
+Code example
-Consume the body and return a promise that will resolve to one of these formats.
+```js
+import http from 'node:http'
+import { Response } from 'node-fetch'
-#### body.buffer()
+http.createServer(async function (req, res) {
+ const formData = await new Response(req, {
+ headers: req.headers // Pass along the boundary value
+ }).formData()
+ const allFields = [...formData]
-*(node-fetch extension)*
+ const file = formData.get('uploaded-files')
+ const arrayBuffer = await file.arrayBuffer()
+ const text = await file.text()
+ const whatwgReadableStream = file.stream()
-* Returns: Promise<Buffer>
+ // other was to consume the request could be to do:
+ const json = await new Response(req).json()
+ const text = await new Response(req).text()
+ const arrayBuffer = await new Response(req).arrayBuffer()
+ const blob = await new Response(req, {
+ headers: req.headers // So that `type` inherits `Content-Type`
+ }.blob()
+})
+```
-Consume the body and return a promise that will resolve to a Buffer.
-
-#### body.textConverted()
-
-*(node-fetch extension)*
-
-* Returns: Promise<String>
-
-Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8 if possible.
-
-(This API requires an optional dependency of the npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.)
+
+
### Class: FetchError
-*(node-fetch extension)*
+_(node-fetch extension)_
An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info.
+
### Class: AbortError
-*(node-fetch extension)*
+_(node-fetch extension)_
An Error thrown when the request is aborted in response to an `AbortSignal`'s `abort` event. It has a `name` property of `AbortError`. See [ERROR-HANDLING.MD][] for more info.
+## TypeScript
+
+**Since `3.x` types are bundled with `node-fetch`, so you don't need to install any additional packages.**
+
+For older versions please use the type definitions from [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped):
+
+```sh
+npm install --save-dev @types/node-fetch@2.x
+```
+
## Acknowledgement
Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference.
-`node-fetch` v1 was maintained by [@bitinn](https://github.com/bitinn); v2 was maintained by [@TimothyGu](https://github.com/timothygu), [@bitinn](https://github.com/bitinn) and [@jimmywarting](https://github.com/jimmywarting); v2 readme is written by [@jkantr](https://github.com/jkantr).
+## Team
+
+| [](https://github.com/bitinn) | [](https://github.com/jimmywarting) | [](https://github.com/xxczaki) | [](https://github.com/Richienb) | [](https://github.com/gr2m) |
+| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
+| [David Frank](https://bitinn.net/) | [Jimmy Wärting](https://jimmy.warting.se/) | [Antoni Kepinski](https://kepinski.ch) | [Richie Bendall](https://www.richie-bendall.ml/) | [Gregor Martynus](https://twitter.com/gr2m) |
+
+###### Former
+
+- [Timothy Gu](https://github.com/timothygu)
+- [Jared Kantrowitz](https://github.com/jkantr)
## License
-MIT
+[MIT](LICENSE.md)
-[npm-image]: https://flat.badgen.net/npm/v/node-fetch
-[npm-url]: https://www.npmjs.com/package/node-fetch
-[travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch
-[travis-url]: https://travis-ci.org/bitinn/node-fetch
-[codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master
-[codecov-url]: https://codecov.io/gh/bitinn/node-fetch
-[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch
-[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch
-[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square
-[discord-url]: https://discord.gg/Zxbndcm
-[opencollective-image]: https://opencollective.com/node-fetch/backers.svg
-[opencollective-url]: https://opencollective.com/node-fetch
[whatwg-fetch]: https://fetch.spec.whatwg.org/
[response-init]: https://fetch.spec.whatwg.org/#responseinit
[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams
[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers
-[LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md
-[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md
-[UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md
+[error-handling.md]: https://github.com/node-fetch/node-fetch/blob/master/docs/ERROR-HANDLING.md
+[FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData
+[Blob]: https://developer.mozilla.org/en-US/docs/Web/API/Blob
+[File]: https://developer.mozilla.org/en-US/docs/Web/API/File
diff --git a/node_modules/node-fetch/package.json b/node_modules/node-fetch/package.json
index e0be1768..2b4e8583 100644
--- a/node_modules/node-fetch/package.json
+++ b/node_modules/node-fetch/package.json
@@ -1,89 +1,131 @@
{
- "name": "node-fetch",
- "version": "2.7.0",
- "description": "A light-weight module that brings window.fetch to node.js",
- "main": "lib/index.js",
- "browser": "./browser.js",
- "module": "lib/index.mjs",
- "files": [
- "lib/index.js",
- "lib/index.mjs",
- "lib/index.es.js",
- "browser.js"
- ],
- "engines": {
- "node": "4.x || >=6.0.0"
- },
- "scripts": {
- "build": "cross-env BABEL_ENV=rollup rollup -c",
- "prepare": "npm run build",
- "test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js",
- "report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js",
- "coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/bitinn/node-fetch.git"
- },
- "keywords": [
- "fetch",
- "http",
- "promise"
- ],
- "author": "David Frank",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/bitinn/node-fetch/issues"
- },
- "homepage": "https://github.com/bitinn/node-fetch",
- "dependencies": {
- "whatwg-url": "^5.0.0"
- },
- "peerDependencies": {
- "encoding": "^0.1.0"
- },
- "peerDependenciesMeta": {
- "encoding": {
- "optional": true
- }
- },
- "devDependencies": {
- "@ungap/url-search-params": "^0.1.2",
- "abort-controller": "^1.1.0",
- "abortcontroller-polyfill": "^1.3.0",
- "babel-core": "^6.26.3",
- "babel-plugin-istanbul": "^4.1.6",
- "babel-plugin-transform-async-generator-functions": "^6.24.1",
- "babel-polyfill": "^6.26.0",
- "babel-preset-env": "1.4.0",
- "babel-register": "^6.16.3",
- "chai": "^3.5.0",
- "chai-as-promised": "^7.1.1",
- "chai-iterator": "^1.1.1",
- "chai-string": "~1.3.0",
- "codecov": "3.3.0",
- "cross-env": "^5.2.0",
- "form-data": "^2.3.3",
- "is-builtin-module": "^1.0.0",
- "mocha": "^5.0.0",
- "nyc": "11.9.0",
- "parted": "^0.1.1",
- "promise": "^8.0.3",
- "resumer": "0.0.0",
- "rollup": "^0.63.4",
- "rollup-plugin-babel": "^3.0.7",
- "string-to-arraybuffer": "^1.0.2",
- "teeny-request": "3.7.0"
- },
- "release": {
- "branches": [
- "+([0-9]).x",
- "main",
- "next",
- {
- "name": "beta",
- "prerelease": true
- }
- ]
+ "name": "node-fetch",
+ "version": "3.3.2",
+ "description": "A light-weight module that brings Fetch API to node.js",
+ "main": "./src/index.js",
+ "sideEffects": false,
+ "type": "module",
+ "files": [
+ "src",
+ "@types/index.d.ts"
+ ],
+ "types": "./@types/index.d.ts",
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "scripts": {
+ "test": "mocha",
+ "coverage": "c8 report --reporter=text-lcov | coveralls",
+ "test-types": "tsd",
+ "lint": "xo"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/node-fetch/node-fetch.git"
+ },
+ "keywords": [
+ "fetch",
+ "http",
+ "promise",
+ "request",
+ "curl",
+ "wget",
+ "xhr",
+ "whatwg"
+ ],
+ "author": "David Frank",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/node-fetch/node-fetch/issues"
+ },
+ "homepage": "https://github.com/node-fetch/node-fetch",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/node-fetch"
+ },
+ "devDependencies": {
+ "abort-controller": "^3.0.0",
+ "abortcontroller-polyfill": "^1.7.1",
+ "busboy": "^1.4.0",
+ "c8": "^7.7.2",
+ "chai": "^4.3.4",
+ "chai-as-promised": "^7.1.1",
+ "chai-iterator": "^3.0.2",
+ "chai-string": "^1.5.0",
+ "coveralls": "^3.1.0",
+ "form-data": "^4.0.0",
+ "formdata-node": "^4.2.4",
+ "mocha": "^9.1.3",
+ "p-timeout": "^5.0.0",
+ "stream-consumers": "^1.0.1",
+ "tsd": "^0.14.0",
+ "xo": "^0.39.1"
+ },
+ "dependencies": {
+ "data-uri-to-buffer": "^4.0.0",
+ "fetch-blob": "^3.1.4",
+ "formdata-polyfill": "^4.0.10"
+ },
+ "tsd": {
+ "cwd": "@types",
+ "compilerOptions": {
+ "esModuleInterop": true
}
+ },
+ "xo": {
+ "envs": [
+ "node",
+ "browser"
+ ],
+ "ignores": [
+ "example.js"
+ ],
+ "rules": {
+ "complexity": 0,
+ "import/extensions": 0,
+ "import/no-useless-path-segments": 0,
+ "import/no-anonymous-default-export": 0,
+ "import/no-named-as-default": 0,
+ "unicorn/import-index": 0,
+ "unicorn/no-array-reduce": 0,
+ "unicorn/prefer-node-protocol": 0,
+ "unicorn/numeric-separators-style": 0,
+ "unicorn/explicit-length-check": 0,
+ "capitalized-comments": 0,
+ "node/no-unsupported-features/es-syntax": 0,
+ "@typescript-eslint/member-ordering": 0
+ },
+ "overrides": [
+ {
+ "files": "test/**/*.js",
+ "envs": [
+ "node",
+ "mocha"
+ ],
+ "rules": {
+ "max-nested-callbacks": 0,
+ "no-unused-expressions": 0,
+ "no-warning-comments": 0,
+ "new-cap": 0,
+ "guard-for-in": 0,
+ "unicorn/no-array-for-each": 0,
+ "unicorn/prevent-abbreviations": 0,
+ "promise/prefer-await-to-then": 0,
+ "ava/no-import-test-files": 0
+ }
+ }
+ ]
+ },
+ "runkitExampleFilename": "example.js",
+ "release": {
+ "branches": [
+ "+([0-9]).x",
+ "main",
+ "next",
+ {
+ "name": "beta",
+ "prerelease": true
+ }
+ ]
+ }
}
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/body.js b/node_modules/node-fetch/src/body.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/body.js
rename to node_modules/node-fetch/src/body.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/errors/abort-error.js b/node_modules/node-fetch/src/errors/abort-error.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/errors/abort-error.js
rename to node_modules/node-fetch/src/errors/abort-error.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/errors/base.js b/node_modules/node-fetch/src/errors/base.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/errors/base.js
rename to node_modules/node-fetch/src/errors/base.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/errors/fetch-error.js b/node_modules/node-fetch/src/errors/fetch-error.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/errors/fetch-error.js
rename to node_modules/node-fetch/src/errors/fetch-error.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/headers.js b/node_modules/node-fetch/src/headers.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/headers.js
rename to node_modules/node-fetch/src/headers.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/index.js b/node_modules/node-fetch/src/index.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/index.js
rename to node_modules/node-fetch/src/index.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/request.js b/node_modules/node-fetch/src/request.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/request.js
rename to node_modules/node-fetch/src/request.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/response.js b/node_modules/node-fetch/src/response.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/response.js
rename to node_modules/node-fetch/src/response.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/get-search.js b/node_modules/node-fetch/src/utils/get-search.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/get-search.js
rename to node_modules/node-fetch/src/utils/get-search.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/is-redirect.js b/node_modules/node-fetch/src/utils/is-redirect.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/is-redirect.js
rename to node_modules/node-fetch/src/utils/is-redirect.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/is.js b/node_modules/node-fetch/src/utils/is.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/is.js
rename to node_modules/node-fetch/src/utils/is.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/multipart-parser.js b/node_modules/node-fetch/src/utils/multipart-parser.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/multipart-parser.js
rename to node_modules/node-fetch/src/utils/multipart-parser.js
diff --git a/node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/referrer.js b/node_modules/node-fetch/src/utils/referrer.js
similarity index 100%
rename from node_modules/@nostr-dev-kit/ndk/node_modules/node-fetch/src/utils/referrer.js
rename to node_modules/node-fetch/src/utils/referrer.js
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/LICENSE b/node_modules/nostr-tools/node_modules/@noble/curves/LICENSE
deleted file mode 100644
index 9297a046..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2022 Paul Miller (https://paulmillr.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the “Software”), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/README.md b/node_modules/nostr-tools/node_modules/@noble/curves/README.md
deleted file mode 100644
index a5d14f46..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/README.md
+++ /dev/null
@@ -1,971 +0,0 @@
-# noble-curves
-
-Audited & minimal JS implementation of elliptic curve cryptography.
-
-- 🔒 [**Audited**](#security) by an independent security firm
-- 🔻 Tree-shaking-friendly: use only what's necessary, other code won't be included
-- 🏎 Ultra-fast, hand-optimized for caveats of JS engines
-- 🔍 Unique tests ensure correctness: property-based, cross-library and Wycheproof vectors, fuzzing
-- ➰ Short Weierstrass, Edwards, Montgomery curves
-- ✍️ ECDSA, EdDSA, Schnorr, BLS signature schemes, ECDH key agreement
-- 🔖 SUF-CMA and SBS (non-repudiation) for ed25519, ed448 and others
-- #️⃣ Hash-to-curve
- for encoding or hashing an arbitrary string to an elliptic curve point
-- 🧜♂️ Poseidon ZK-friendly hash
-
-Check out [Upgrading](#upgrading) if you've previously used single-feature noble
-packages. See [Resources](#resources) for articles and real-world software that uses curves.
-
-### This library belongs to _noble_ crypto
-
-> **noble-crypto** — high-security, easily auditable set of contained cryptographic libraries and tools.
-
-- No dependencies, protection against supply chain attacks
-- Auditable TypeScript / JS code
-- Supported in all major browsers and stable node.js versions
-- All releases are signed with PGP keys
-- Check out [homepage](https://paulmillr.com/noble/) & all libraries:
- [curves](https://github.com/paulmillr/noble-curves)
- (4kb versions [secp256k1](https://github.com/paulmillr/noble-secp256k1),
- [ed25519](https://github.com/paulmillr/noble-ed25519)),
- [hashes](https://github.com/paulmillr/noble-hashes)
-
-## Usage
-
-> npm install @noble/curves
-
-We support all major platforms and runtimes.
-For [Deno](https://deno.land), ensure to use [npm specifier](https://deno.land/manual@v1.28.0/node/npm_specifiers).
-For React Native, you may need a [polyfill for crypto.getRandomValues](https://github.com/LinusU/react-native-get-random-values).
-If you don't like NPM, a standalone [noble-curves.js](https://github.com/paulmillr/noble-curves/releases) is also available.
-
-The library is tree-shaking-friendly and does not expose root entry point as
-`@noble/curves`. Instead, you need to import specific primitives.
-This is done to ensure small size of your apps.
-
-The package consists of two parts:
-
-* [Implementations](#implementations), utilizing one dependency [noble-hashes](https://github.com/paulmillr/noble-hashes),
- providing ready-to-use:
- - NIST curves secp256r1 / p256, secp384r1 / p384, secp521r1 / p521
- - SECG curve secp256k1
- - ed25519 / curve25519 / x25519 / ristretto255, edwards448 / curve448 / x448
- - pairing-friendly curves bls12-381, bn254
- - [pasta](https://electriccoin.co/blog/the-pasta-curves-for-halo-2-and-beyond/) curves
-2. [Abstract](#abstract-api), zero-dependency elliptic curve algorithms
-
-### Implementations
-
-#### Generic example for all curves, secp256k1
-
-```ts
-// Each curve has similar methods
-import { secp256k1 } from '@noble/curves/secp256k1'; // ESM and Common.js
-// import { secp256k1 } from 'npm:@noble/curves@1.2.0/secp256k1'; // Deno
-const priv = secp256k1.utils.randomPrivateKey();
-const pub = secp256k1.getPublicKey(priv);
-const msg = new Uint8Array(32).fill(1);
-const sig = secp256k1.sign(msg, priv);
-const isValid = secp256k1.verify(sig, msg, pub) === true;
-
-// hex strings are also supported besides Uint8Arrays:
-const privHex = '46c930bc7bb4db7f55da20798697421b98c4175a52c630294d75a84b9c126236';
-const pub2 = secp256k1.getPublicKey(privHex);
-```
-
-#### All imports
-
-```typescript
-import { secp256k1, schnorr } from '@noble/curves/secp256k1';
-import { ed25519, ed25519ph, ed25519ctx, x25519, RistrettoPoint } from '@noble/curves/ed25519';
-import { ed448, ed448ph, ed448ctx, x448 } from '@noble/curves/ed448';
-import { p256 } from '@noble/curves/p256';
-import { p384 } from '@noble/curves/p384';
-import { p521 } from '@noble/curves/p521';
-import { pallas, vesta } from '@noble/curves/pasta';
-import { bls12_381 } from '@noble/curves/bls12-381';
-import { bn254 } from '@noble/curves/bn254';
-import { jubjub } from '@noble/curves/jubjub';
-```
-
-#### ECDSA public key recovery & ECDH
-
-```ts
-// extraEntropy https://moderncrypto.org/mail-archive/curves/2017/000925.html
-const sigImprovedSecurity = secp256k1.sign(msg, priv, { extraEntropy: true });
-sig.recoverPublicKey(msg) === pub; // public key recovery
-const someonesPub = secp256k1.getPublicKey(secp256k1.utils.randomPrivateKey());
-const shared = secp256k1.getSharedSecret(priv, someonesPub); // ECDH
-```
-
-#### Schnorr signatures over secp256k1 (BIP340)
-
-```ts
-import { schnorr } from '@noble/curves/secp256k1';
-const priv = schnorr.utils.randomPrivateKey();
-const pub = schnorr.getPublicKey(priv);
-const msg = new TextEncoder().encode('hello');
-const sig = schnorr.sign(msg, priv);
-const isValid = schnorr.verify(sig, msg, pub);
-```
-
-#### ed25519, X25519, ristretto255
-
-```ts
-import { ed25519 } from '@noble/curves/ed25519';
-const priv = ed25519.utils.randomPrivateKey();
-const pub = ed25519.getPublicKey(priv);
-const msg = new TextEncoder().encode('hello');
-const sig = ed25519.sign(msg, priv);
-ed25519.verify(sig, msg, pub); // Default mode: follows ZIP215
-ed25519.verify(sig, msg, pub, { zip215: false }); // RFC8032 / FIPS 186-5
-```
-
-Default `verify` behavior follows [ZIP215](https://zips.z.cash/zip-0215) and
-[can be used in consensus-critical applications](https://hdevalence.ca/blog/2020-10-04-its-25519am).
-It has SUF-CMA (strong unforgeability under chosen message attacks).
-`zip215: false` option switches verification criteria to strict
-[RFC8032](https://www.rfc-editor.org/rfc/rfc8032) / [FIPS 186-5](https://csrc.nist.gov/publications/detail/fips/186/5/final)
-and additionally provides non-repudiation with SBS [(Strongly Binding Signatures)](https://eprint.iacr.org/2020/1244).
-
-X25519 follows [RFC7748](https://www.rfc-editor.org/rfc/rfc7748).
-ristretto255 follows [irtf draft](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-ristretto255-decaf448).
-
-```ts
-// Variants from RFC8032: with context, prehashed
-import { ed25519ctx, ed25519ph } from '@noble/curves/ed25519';
-
-// ECDH using curve25519 aka x25519
-import { x25519 } from '@noble/curves/ed25519';
-const priv = 'a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4';
-const pub = 'e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c';
-x25519.getSharedSecret(priv, pub) === x25519.scalarMult(priv, pub); // aliases
-x25519.getPublicKey(priv) === x25519.scalarMultBase(priv);
-x25519.getPublicKey(x25519.utils.randomPrivateKey());
-
-// ed25519 => x25519 conversion
-import { edwardsToMontgomeryPub, edwardsToMontgomeryPriv } from '@noble/curves/ed25519';
-edwardsToMontgomeryPub(ed25519.getPublicKey(ed25519.utils.randomPrivateKey()));
-edwardsToMontgomeryPriv(ed25519.utils.randomPrivateKey());
-
-// hash-to-curve, ristretto255
-import { hashToCurve, encodeToCurve, RistrettoPoint } from '@noble/curves/ed25519';
-const rp = RistrettoPoint.fromHex(
- '6a493210f7499cd17fecb510ae0cea23a110e8d5b901f8acadd3095c73a3b919'
-);
-RistrettoPoint.hashToCurve('Ristretto is traditionally a short shot of espresso coffee');
-// also has add(), equals(), multiply(), toRawBytes() methods
-```
-
-#### ed448, X448
-
-```ts
-import { ed448 } from '@noble/curves/ed448';
-const priv = ed448.utils.randomPrivateKey();
-const pub = ed448.getPublicKey(priv);
-const msg = new TextEncoder().encode('whatsup');
-const sig = ed448.sign(msg, priv);
-ed448.verify(sig, msg, pub);
-
-import { ed448ph, ed448ctx, x448, hashToCurve, encodeToCurve } from '@noble/curves/ed448';
-x448.getSharedSecret(priv, pub) === x448.scalarMult(priv, pub); // aliases
-x448.getPublicKey(priv) === x448.scalarMultBase(priv);
-```
-
-Same RFC7748 / RFC8032 are followed.
-
-#### bls12-381
-
-See [abstract/bls](#abstractbls-barreto-lynn-scott-curves).
-
-#### Accessing a curve's variables
-
-```ts
-import { secp256k1 } from '@noble/curves/secp256k1';
-// Every curve has `CURVE` object that contains its parameters, field, and others
-console.log(secp256k1.CURVE.p); // field modulus
-console.log(secp256k1.CURVE.n); // curve order
-console.log(secp256k1.CURVE.a, secp256k1.CURVE.b); // equation params
-console.log(secp256k1.CURVE.Gx, secp256k1.CURVE.Gy); // base point coordinates
-```
-
-## Abstract API
-
-Abstract API allows to define custom curves. All arithmetics is done with JS
-bigints over finite fields, which is defined from `modular` sub-module. For
-scalar multiplication, we use
-[precomputed tables with w-ary non-adjacent form (wNAF)](https://paulmillr.com/posts/noble-secp256k1-fast-ecc/).
-Precomputes are enabled for weierstrass and edwards BASE points of a curve. You
-could precompute any other point (e.g. for ECDH) using `utils.precompute()`
-method: check out examples.
-
-There are following zero-dependency algorithms:
-
-- [abstract/weierstrass: Short Weierstrass curve](#abstractweierstrass-short-weierstrass-curve)
-- [abstract/edwards: Twisted Edwards curve](#abstractedwards-twisted-edwards-curve)
-- [abstract/montgomery: Montgomery curve](#abstractmontgomery-montgomery-curve)
-- [abstract/bls: Barreto-Lynn-Scott curves](#abstractbls-barreto-lynn-scott-curves)
-- [abstract/hash-to-curve: Hashing strings to curve points](#abstracthash-to-curve-hashing-strings-to-curve-points)
-- [abstract/poseidon: Poseidon hash](#abstractposeidon-poseidon-hash)
-- [abstract/modular: Modular arithmetics utilities](#abstractmodular-modular-arithmetics-utilities)
-- [abstract/utils: General utilities](#abstractutils-general-utilities)
-
-### abstract/weierstrass: Short Weierstrass curve
-
-```ts
-import { weierstrass } from '@noble/curves/abstract/weierstrass';
-import { Field } from '@noble/curves/abstract/modular'; // finite field for mod arithmetics
-import { sha256 } from '@noble/hashes/sha256'; // 3rd-party sha256() of type utils.CHash
-import { hmac } from '@noble/hashes/hmac'; // 3rd-party hmac() that will accept sha256()
-import { concatBytes, randomBytes } from '@noble/hashes/utils'; // 3rd-party utilities
-const secq256k1 = weierstrass({
- // secq256k1: cycle of secp256k1 with Fp/N flipped.
- // https://personaelabs.org/posts/spartan-ecdsa
- // https://zcash.github.io/halo2/background/curves.html#cycles-of-curves
- a: 0n,
- b: 7n,
- Fp: Field(2n ** 256n - 432420386565659656852420866394968145599n),
- n: 2n ** 256n - 2n ** 32n - 2n ** 9n - 2n ** 8n - 2n ** 7n - 2n ** 6n - 2n ** 4n - 1n,
- Gx: 55066263022277343669578718895168534326250603453777594175500187360389116729240n,
- Gy: 32670510020758816978083085130507043184471273380659243275938904335757337482424n,
- hash: sha256,
- hmac: (key: Uint8Array, ...msgs: Uint8Array[]) => hmac(sha256, key, concatBytes(...msgs)),
- randomBytes,
-});
-
-// Replace weierstrass with weierstrassPoints if you don't need ECDSA, hash, hmac, randomBytes
-```
-
-Short Weierstrass curve's formula is `y² = x³ + ax + b`. `weierstrass`
-expects arguments `a`, `b`, field `Fp`, curve order `n`, cofactor `h`
-and coordinates `Gx`, `Gy` of generator point.
-
-**`k` generation** is done deterministically, following
-[RFC6979](https://www.rfc-editor.org/rfc/rfc6979). For this you will need
-`hmac` & `hash`, which in our implementations is provided by noble-hashes. If
-you're using different hashing library, make sure to wrap it in the following interface:
-
-```ts
-type CHash = {
- (message: Uint8Array): Uint8Array;
- blockLen: number;
- outputLen: number;
- create(): any;
-};
-```
-
-**Weierstrass points:**
-
-1. Exported as `ProjectivePoint`
-2. Represented in projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z)
-3. Use complete exception-free formulas for addition and doubling
-4. Can be decoded/encoded from/to Uint8Array / hex strings using
- `ProjectivePoint.fromHex` and `ProjectivePoint#toRawBytes()`
-5. Have `assertValidity()` which checks for being on-curve
-6. Have `toAffine()` and `x` / `y` getters which convert to 2d xy affine coordinates
-
-```ts
-// `weierstrassPoints()` returns `CURVE` and `ProjectivePoint`
-// `weierstrass()` returns `CurveFn`
-type SignOpts = { lowS?: boolean; prehash?: boolean; extraEntropy: boolean | Uint8Array };
-type CurveFn = {
- CURVE: ReturnType;
- getPublicKey: (privateKey: PrivKey, isCompressed?: boolean) => Uint8Array;
- getSharedSecret: (privateA: PrivKey, publicB: Hex, isCompressed?: boolean) => Uint8Array;
- sign: (msgHash: Hex, privKey: PrivKey, opts?: SignOpts) => SignatureType;
- verify: (
- signature: Hex | SignatureType,
- msgHash: Hex,
- publicKey: Hex,
- opts?: { lowS?: boolean; prehash?: boolean }
- ) => boolean;
- ProjectivePoint: ProjectivePointConstructor;
- Signature: SignatureConstructor;
- utils: {
- normPrivateKeyToScalar: (key: PrivKey) => bigint;
- isValidPrivateKey(key: PrivKey): boolean;
- randomPrivateKey: () => Uint8Array;
- precompute: (windowSize?: number, point?: ProjPointType) => ProjPointType;
- };
-};
-
-// T is usually bigint, but can be something else like complex numbers in BLS curves
-interface ProjPointType extends Group> {
- readonly px: T;
- readonly py: T;
- readonly pz: T;
- get x(): bigint;
- get y(): bigint;
- multiply(scalar: bigint): ProjPointType;
- multiplyUnsafe(scalar: bigint): ProjPointType;
- multiplyAndAddUnsafe(Q: ProjPointType, a: bigint, b: bigint): ProjPointType | undefined;
- toAffine(iz?: T): AffinePoint;
- isTorsionFree(): boolean;
- clearCofactor(): ProjPointType;
- assertValidity(): void;
- hasEvenY(): boolean;
- toRawBytes(isCompressed?: boolean): Uint8Array;
- toHex(isCompressed?: boolean): string;
-}
-// Static methods for 3d XYZ points
-interface ProjConstructor extends GroupConstructor> {
- new (x: T, y: T, z: T): ProjPointType;
- fromAffine(p: AffinePoint): ProjPointType;
- fromHex(hex: Hex): ProjPointType;
- fromPrivateKey(privateKey: PrivKey): ProjPointType;
-}
-```
-
-**ECDSA signatures** are represented by `Signature` instances and can be
-described by the interface:
-
-```ts
-interface SignatureType {
- readonly r: bigint;
- readonly s: bigint;
- readonly recovery?: number;
- assertValidity(): void;
- addRecoveryBit(recovery: number): SignatureType;
- hasHighS(): boolean;
- normalizeS(): SignatureType;
- recoverPublicKey(msgHash: Hex): ProjPointType;
- toCompactRawBytes(): Uint8Array;
- toCompactHex(): string;
- // DER-encoded
- toDERRawBytes(): Uint8Array;
- toDERHex(): string;
-}
-type SignatureConstructor = {
- new (r: bigint, s: bigint): SignatureType;
- fromCompact(hex: Hex): SignatureType;
- fromDER(hex: Hex): SignatureType;
-};
-```
-
-More examples:
-
-```typescript
-// All curves expose same generic interface.
-const priv = secq256k1.utils.randomPrivateKey();
-secq256k1.getPublicKey(priv); // Convert private key to public.
-const sig = secq256k1.sign(msg, priv); // Sign msg with private key.
-secq256k1.verify(sig, msg, priv); // Verify if sig is correct.
-
-const Point = secq256k1.ProjectivePoint;
-const point = Point.BASE; // Elliptic curve Point class and BASE point static var.
-point.add(point).equals(point.double()); // add(), equals(), double() methods
-point.subtract(point).equals(Point.ZERO); // subtract() method, ZERO static var
-point.negate(); // Flips point over x/y coordinate.
-point.multiply(31415n); // Multiplication of Point by scalar.
-
-point.assertValidity(); // Checks for being on-curve
-point.toAffine(); // Converts to 2d affine xy coordinates
-
-secq256k1.CURVE.n;
-secq256k1.CURVE.p;
-secq256k1.CURVE.Fp.mod();
-secq256k1.CURVE.hash();
-
-// precomputes
-const fast = secq256k1.utils.precompute(8, Point.fromHex(someonesPubKey));
-fast.multiply(privKey); // much faster ECDH now
-```
-
-### abstract/edwards: Twisted Edwards curve
-
-```ts
-import { twistedEdwards } from '@noble/curves/abstract/edwards';
-import { Field } from '@noble/curves/abstract/modular';
-import { sha512 } from '@noble/hashes/sha512';
-import { randomBytes } from '@noble/hashes/utils';
-
-const Fp = Field(2n ** 255n - 19n);
-const ed25519 = twistedEdwards({
- a: Fp.create(-1n),
- d: Fp.div(-121665n, 121666n), // -121665n/121666n mod p
- Fp: Fp,
- n: 2n ** 252n + 27742317777372353535851937790883648493n,
- h: 8n,
- Gx: 15112221349535400772501151409588531511454012693041857206046113283949847762202n,
- Gy: 46316835694926478169428394003475163141307993866256225615783033603165251855960n,
- hash: sha512,
- randomBytes,
- adjustScalarBytes(bytes) {
- // optional; but mandatory in ed25519
- bytes[0] &= 248;
- bytes[31] &= 127;
- bytes[31] |= 64;
- return bytes;
- },
-} as const);
-```
-
-Twisted Edwards curve's formula is `ax² + y² = 1 + dx²y²`. You must specify `a`, `d`, field `Fp`, order `n`, cofactor `h`
-and coordinates `Gx`, `Gy` of generator point.
-
-For EdDSA signatures, `hash` param required. `adjustScalarBytes` which instructs how to change private scalars could be specified.
-
-**Edwards points:**
-
-1. Exported as `ExtendedPoint`
-2. Represented in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z)
-3. Use complete exception-free formulas for addition and doubling
-4. Can be decoded/encoded from/to Uint8Array / hex strings using `ExtendedPoint.fromHex` and `ExtendedPoint#toRawBytes()`
-5. Have `assertValidity()` which checks for being on-curve
-6. Have `toAffine()` and `x` / `y` getters which convert to 2d xy affine coordinates
-7. Have `isTorsionFree()`, `clearCofactor()` and `isSmallOrder()` utilities to handle torsions
-
-```ts
-// `twistedEdwards()` returns `CurveFn` of following type:
-type CurveFn = {
- CURVE: ReturnType;
- getPublicKey: (privateKey: Hex) => Uint8Array;
- sign: (message: Hex, privateKey: Hex, context?: Hex) => Uint8Array;
- verify: (sig: SigType, message: Hex, publicKey: Hex, context?: Hex) => boolean;
- ExtendedPoint: ExtPointConstructor;
- utils: {
- randomPrivateKey: () => Uint8Array;
- getExtendedPublicKey: (key: PrivKey) => {
- head: Uint8Array;
- prefix: Uint8Array;
- scalar: bigint;
- point: PointType;
- pointBytes: Uint8Array;
- };
- };
-};
-
-interface ExtPointType extends Group {
- readonly ex: bigint;
- readonly ey: bigint;
- readonly ez: bigint;
- readonly et: bigint;
- get x(): bigint;
- get y(): bigint;
- assertValidity(): void;
- multiply(scalar: bigint): ExtPointType;
- multiplyUnsafe(scalar: bigint): ExtPointType;
- isSmallOrder(): boolean;
- isTorsionFree(): boolean;
- clearCofactor(): ExtPointType;
- toAffine(iz?: bigint): AffinePoint;
- toRawBytes(isCompressed?: boolean): Uint8Array;
- toHex(isCompressed?: boolean): string;
-}
-// Static methods of Extended Point with coordinates in X, Y, Z, T
-interface ExtPointConstructor extends GroupConstructor {
- new (x: bigint, y: bigint, z: bigint, t: bigint): ExtPointType;
- fromAffine(p: AffinePoint): ExtPointType;
- fromHex(hex: Hex): ExtPointType;
- fromPrivateKey(privateKey: Hex): ExtPointType;
-}
-```
-
-### abstract/montgomery: Montgomery curve
-
-```typescript
-import { montgomery } from '@noble/curves/abstract/montgomery';
-import { Field } from '@noble/curves/abstract/modular';
-
-const x25519 = montgomery({
- a: 486662n,
- Gu: 9n,
- Fp: Field(2n ** 255n - 19n),
- montgomeryBits: 255,
- nByteLength: 32,
- // Optional param
- adjustScalarBytes(bytes) {
- bytes[0] &= 248;
- bytes[31] &= 127;
- bytes[31] |= 64;
- return bytes;
- },
-});
-```
-
-The module contains methods for x-only ECDH on Curve25519 / Curve448 from RFC7748.
-Proper Elliptic Curve Points are not implemented yet.
-
-You must specify curve params `Fp`, `a`, `Gu` coordinate of u, `montgomeryBits` and `nByteLength`.
-
-### abstract/bls: Barreto-Lynn-Scott curves
-
-The module abstracts BLS (Barreto-Lynn-Scott) pairing-friendly elliptic curve construction.
-They allow to construct [zk-SNARKs](https://z.cash/technology/zksnarks/) and
-use aggregated, batch-verifiable
-[threshold signatures](https://medium.com/snigirev.stepan/bls-signatures-better-than-schnorr-5a7fe30ea716),
-using Boneh-Lynn-Shacham signature scheme.
-
-Main methods and properties are:
-
-- `getPublicKey(privateKey)`
-- `sign(message, privateKey)`
-- `verify(signature, message, publicKey)`
-- `aggregatePublicKeys(publicKeys)`
-- `aggregateSignatures(signatures)`
-- `G1` and `G2` curves containing `CURVE` and `ProjectivePoint`
-- `Signature` property with `fromHex`, `toHex` methods
-- `fields` containing `Fp`, `Fp2`, `Fp6`, `Fp12`, `Fr`
-
-Right now we only implement BLS12-381 (compatible with ETH and others),
-but in theory defining BLS12-377, BLS24 should be straightforward. An example:
-
-```ts
-import { bls12_381 as bls } from '@noble/curves/bls12-381';
-const privateKey = '67d53f170b908cabb9eb326c3c337762d59289a8fec79f7bc9254b584b73265c';
-const message = '64726e3da8';
-const publicKey = bls.getPublicKey(privateKey);
-const signature = bls.sign(message, privateKey);
-const isValid = bls.verify(signature, message, publicKey);
-console.log({ publicKey, signature, isValid });
-
-// Sign 1 msg with 3 keys
-const privateKeys = [
- '18f020b98eb798752a50ed0563b079c125b0db5dd0b1060d1c1b47d4a193e1e4',
- 'ed69a8c50cf8c9836be3b67c7eeff416612d45ba39a5c099d48fa668bf558c9c',
- '16ae669f3be7a2121e17d0c68c05a8f3d6bef21ec0f2315f1d7aec12484e4cf5',
-];
-const messages = ['d2', '0d98', '05caf3'];
-const publicKeys = privateKeys.map(bls.getPublicKey);
-const signatures2 = privateKeys.map((p) => bls.sign(message, p));
-const aggPubKey2 = bls.aggregatePublicKeys(publicKeys);
-const aggSignature2 = bls.aggregateSignatures(signatures2);
-const isValid2 = bls.verify(aggSignature2, message, aggPubKey2);
-console.log({ signatures2, aggSignature2, isValid2 });
-
-// Sign 3 msgs with 3 keys
-const signatures3 = privateKeys.map((p, i) => bls.sign(messages[i], p));
-const aggSignature3 = bls.aggregateSignatures(signatures3);
-const isValid3 = bls.verifyBatch(aggSignature3, messages, publicKeys);
-console.log({ publicKeys, signatures3, aggSignature3, isValid3 });
-
-// bls.pairing(PointG1, PointG2) // pairings
-// bls.G1.ProjectivePoint.BASE, bls.G2.ProjectivePoint.BASE
-// bls.fields.Fp, bls.fields.Fp2, bls.fields.Fp12, bls.fields.Fr
-
-// hash-to-curve examples can be seen below
-```
-
-Full types:
-
-```ts
-getPublicKey: (privateKey: PrivKey) => Uint8Array;
-sign: {
- (message: Hex, privateKey: PrivKey): Uint8Array;
- (message: ProjPointType, privateKey: PrivKey): ProjPointType;
-};
-verify: (
- signature: Hex | ProjPointType,
- message: Hex | ProjPointType,
- publicKey: Hex | ProjPointType
-) => boolean;
-verifyBatch: (
- signature: Hex | ProjPointType,
- messages: (Hex | ProjPointType)[],
- publicKeys: (Hex | ProjPointType)[]
-) => boolean;
-aggregatePublicKeys: {
- (publicKeys: Hex[]): Uint8Array;
- (publicKeys: ProjPointType[]): ProjPointType;
-};
-aggregateSignatures: {
- (signatures: Hex[]): Uint8Array;
- (signatures: ProjPointType[]): ProjPointType;
-};
-millerLoop: (ell: [Fp2, Fp2, Fp2][], g1: [Fp, Fp]) => Fp12;
-pairing: (P: ProjPointType, Q: ProjPointType, withFinalExponent?: boolean) => Fp12;
-G1: CurvePointsRes & ReturnType>;
-G2: CurvePointsRes & ReturnType>;
-Signature: SignatureCoder;
-params: {
- x: bigint;
- r: bigint;
- G1b: bigint;
- G2b: Fp2;
-};
-fields: {
- Fp: IField;
- Fp2: IField;
- Fp6: IField;
- Fp12: IField;
- Fr: IField;
-};
-utils: {
- randomPrivateKey: () => Uint8Array;
- calcPairingPrecomputes: (p: AffinePoint) => [Fp2, Fp2, Fp2][];
-};
-```
-
-### abstract/hash-to-curve: Hashing strings to curve points
-
-The module allows to hash arbitrary strings to elliptic curve points. Implements [hash-to-curve v16](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-16).
-
-Every curve has exported `hashToCurve` and `encodeToCurve` methods. You should always prefer `hashToCurve` for security:
-
-```ts
-import { hashToCurve, encodeToCurve } from '@noble/curves/secp256k1';
-import { randomBytes } from '@noble/hashes/utils';
-hashToCurve('0102abcd');
-console.log(hashToCurve(randomBytes()));
-console.log(encodeToCurve(randomBytes()));
-
-import { bls12_381 } from '@noble/curves/bls12-381';
-bls12_381.G1.hashToCurve(randomBytes(), { DST: 'another' });
-bls12_381.G2.hashToCurve(randomBytes(), { DST: 'custom' });
-```
-
-If you need low-level methods from spec:
-
-`expand_message_xmd` [(spec)](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11#section-5.4.1) produces a uniformly random byte string using a cryptographic hash function H that outputs b bits.
-
-Hash must conform to `CHash` interface (see [weierstrass section](#abstractweierstrass-short-weierstrass-curve)).
-
-```ts
-function expand_message_xmd(
- msg: Uint8Array,
- DST: Uint8Array,
- lenInBytes: number,
- H: CHash
-): Uint8Array;
-function expand_message_xof(
- msg: Uint8Array,
- DST: Uint8Array,
- lenInBytes: number,
- k: number,
- H: CHash
-): Uint8Array;
-```
-
-`hash_to_field(msg, count, options)`
-[(spec)](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11#section-5.3)
-hashes arbitrary-length byte strings to a list of one or more elements of a finite field F.
-
-```ts
-/**
- * * `DST` is a domain separation tag, defined in section 2.2.5
- * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m
- * * `m` is extension degree (1 for prime fields)
- * * `k` is the target security target in bits (e.g. 128), from section 5.1
- * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF)
- * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props
- */
-type UnicodeOrBytes = string | Uint8Array;
-type Opts = {
- DST: UnicodeOrBytes;
- p: bigint;
- m: number;
- k: number;
- expand?: 'xmd' | 'xof';
- hash: CHash;
-};
-
-/**
- * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F
- * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11#section-5.3
- * @param msg a byte string containing the message to hash
- * @param count the number of elements of F to output
- * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above
- * @returns [u_0, ..., u_(count - 1)], a list of field elements.
- */
-function hash_to_field(msg: Uint8Array, count: number, options: Opts): bigint[][];
-```
-
-### abstract/poseidon: Poseidon hash
-
-Implements [Poseidon](https://www.poseidon-hash.info) ZK-friendly hash.
-
-There are many poseidon variants with different constants.
-We don't provide them: you should construct them manually.
-Check out [micro-starknet](https://github.com/paulmillr/micro-starknet) package for a proper example.
-
-```ts
-import { poseidon } from '@noble/curves/abstract/poseidon';
-
-type PoseidonOpts = {
- Fp: Field;
- t: number;
- roundsFull: number;
- roundsPartial: number;
- sboxPower?: number;
- reversePartialPowIdx?: boolean;
- mds: bigint[][];
- roundConstants: bigint[][];
-};
-const instance = poseidon(opts: PoseidonOpts);
-```
-
-### abstract/modular: Modular arithmetics utilities
-
-```ts
-import * as mod from '@noble/curves/abstract/modular';
-const fp = mod.Field(2n ** 255n - 19n); // Finite field over 2^255-19
-fp.mul(591n, 932n); // multiplication
-fp.pow(481n, 11024858120n); // exponentiation
-fp.div(5n, 17n); // division: 5/17 mod 2^255-19 == 5 * invert(17)
-fp.sqrt(21n); // square root
-
-// Generic non-FP utils are also available
-mod.mod(21n, 10n); // 21 mod 10 == 1n; fixed version of 21 % 10
-mod.invert(17n, 10n); // invert(17) mod 10; modular multiplicative inverse
-mod.invertBatch([1n, 2n, 4n], 21n); // => [1n, 11n, 16n] in one inversion
-```
-
-#### Creating private keys from hashes
-
-Suppose you have `sha256(something)` (e.g. from HMAC) and you want to make a private key from it.
-Even though p256 or secp256k1 may have 32-byte private keys,
-and sha256 output is also 32-byte, you can't just use it and reduce it modulo `CURVE.n`.
-
-Doing so will make the result key [biased](https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/).
-
-To avoid the bias, we implement FIPS 186 B.4.1, which allows to take arbitrary
-byte array and produce valid scalars / private keys with bias being neglible.
-
-Use [hash-to-curve](#abstracthash-to-curve-hashing-strings-to-curve-points) if you need
-hashing to **public keys**; the function in the module instead operates on **private keys**.
-
-```ts
-import { p256 } from '@noble/curves/p256';
-import { sha256 } from '@noble/hashes/sha256';
-import { hkdf } from '@noble/hashes/hkdf';
-const someKey = new Uint8Array(32).fill(2); // Needs to actually be random, not .fill(2)
-const derived = hkdf(sha256, someKey, undefined, 'application', 40); // 40 bytes
-const validPrivateKey = mod.hashToPrivateScalar(derived, p256.CURVE.n);
-```
-
-### abstract/utils: General utilities
-
-```ts
-import * as utils from '@noble/curves/abstract/utils';
-
-utils.bytesToHex(Uint8Array.from([0xde, 0xad, 0xbe, 0xef]));
-utils.hexToBytes('deadbeef');
-utils.numberToHexUnpadded(123n);
-utils.hexToNumber();
-
-utils.bytesToNumberBE(Uint8Array.from([0xde, 0xad, 0xbe, 0xef]));
-utils.bytesToNumberLE(Uint8Array.from([0xde, 0xad, 0xbe, 0xef]));
-utils.numberToBytesBE(123n, 32);
-utils.numberToBytesLE(123n, 64);
-
-utils.concatBytes(Uint8Array.from([0xde, 0xad]), Uint8Array.from([0xbe, 0xef]));
-utils.nLength(255n);
-utils.equalBytes(Uint8Array.from([0xde]), Uint8Array.from([0xde]));
-```
-
-## Security
-
-1. The library has been audited in Feb 2023 by an independent security firm [Trail of Bits](https://www.trailofbits.com):
-[PDF](https://github.com/trailofbits/publications/blob/master/reviews/2023-01-ryanshea-noblecurveslibrary-securityreview.pdf).
-The audit has been funded by [Ryan Shea](https://www.shea.io). Audit scope was abstract modules `curve`, `hash-to-curve`, `modular`, `poseidon`, `utils`, `weierstrass`, and top-level modules `_shortw_utils` and `secp256k1`. See [changes since audit](https://github.com/paulmillr/noble-curves/compare/0.7.3..main).
-2. The library has been fuzzed by [Guido Vranken's cryptofuzz](https://github.com/guidovranken/cryptofuzz). You can run the fuzzer by yourself to check it.
-3. [Timing attack](https://en.wikipedia.org/wiki/Timing_attack) considerations: _JIT-compiler_ and _Garbage Collector_ make "constant time" extremely hard to achieve in a scripting language. Which means _any other JS library can't have constant-timeness_. Even statically typed Rust, a language without GC, [makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones. Use low-level libraries & languages. Nonetheless we're targetting algorithmic constant time.
-
-We consider infrastructure attacks like rogue NPM modules very important; that's why it's crucial to minimize the amount of 3rd-party dependencies & native bindings. If your app uses 500 dependencies, any dep could get hacked and you'll be downloading malware with every `npm install`. Our goal is to minimize this attack vector. As for devDependencies used by the library:
-
-- `@scure` base, bip32, bip39 (used in tests), micro-bmark (benchmark), micro-should (testing) are developed by us
- and follow the same practices such as: minimal library size, auditability, signed releases
-- prettier (linter), fast-check (property-based testing),
- typescript versions are locked and rarely updated. Every update is checked with `npm-diff`.
- The packages are big, which makes it hard to audit their source code thoroughly and fully.
-- They are only used if you clone the git repo and want to add some feature to it. End-users won't use them.
-
-As for key generation, we're deferring to built-in
-[crypto.getRandomValues](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues)
-which is considered cryptographically secure (CSPRNG).
-
-## Speed
-
-Benchmark results on Apple M2 with node v20:
-
-```
-secp256k1
-init x 68 ops/sec @ 14ms/op
-getPublicKey x 6,750 ops/sec @ 148μs/op
-sign x 5,206 ops/sec @ 192μs/op
-verify x 880 ops/sec @ 1ms/op
-getSharedSecret x 536 ops/sec @ 1ms/op
-recoverPublicKey x 852 ops/sec @ 1ms/op
-schnorr.sign x 685 ops/sec @ 1ms/op
-schnorr.verify x 908 ops/sec @ 1ms/op
-
-p256
-init x 38 ops/sec @ 26ms/op
-getPublicKey x 6,530 ops/sec @ 153μs/op
-sign x 5,074 ops/sec @ 197μs/op
-verify x 626 ops/sec @ 1ms/op
-
-p384
-init x 17 ops/sec @ 57ms/op
-getPublicKey x 2,883 ops/sec @ 346μs/op
-sign x 2,358 ops/sec @ 424μs/op
-verify x 245 ops/sec @ 4ms/op
-
-p521
-init x 9 ops/sec @ 109ms/op
-getPublicKey x 1,516 ops/sec @ 659μs/op
-sign x 1,271 ops/sec @ 786μs/op
-verify x 123 ops/sec @ 8ms/op
-
-ed25519
-init x 54 ops/sec @ 18ms/op
-getPublicKey x 10,269 ops/sec @ 97μs/op
-sign x 5,110 ops/sec @ 195μs/op
-verify x 1,049 ops/sec @ 952μs/op
-
-ed448
-init x 19 ops/sec @ 51ms/op
-getPublicKey x 3,775 ops/sec @ 264μs/op
-sign x 1,771 ops/sec @ 564μs/op
-verify x 351 ops/sec @ 2ms/op
-
-ecdh
-├─x25519 x 1,466 ops/sec @ 682μs/op
-├─secp256k1 x 539 ops/sec @ 1ms/op
-├─p256 x 511 ops/sec @ 1ms/op
-├─p384 x 199 ops/sec @ 5ms/op
-├─p521 x 103 ops/sec @ 9ms/op
-└─x448 x 548 ops/sec @ 1ms/op
-
-bls12-381
-init x 36 ops/sec @ 27ms/op
-getPublicKey 1-bit x 973 ops/sec @ 1ms/op
-getPublicKey x 970 ops/sec @ 1ms/op
-sign x 55 ops/sec @ 17ms/op
-verify x 39 ops/sec @ 25ms/op
-pairing x 106 ops/sec @ 9ms/op
-aggregatePublicKeys/8 x 129 ops/sec @ 7ms/op
-aggregatePublicKeys/32 x 34 ops/sec @ 28ms/op
-aggregatePublicKeys/128 x 8 ops/sec @ 112ms/op
-aggregatePublicKeys/512 x 2 ops/sec @ 446ms/op
-aggregatePublicKeys/2048 x 0 ops/sec @ 1778ms/op
-aggregateSignatures/8 x 50 ops/sec @ 19ms/op
-aggregateSignatures/32 x 13 ops/sec @ 74ms/op
-aggregateSignatures/128 x 3 ops/sec @ 296ms/op
-aggregateSignatures/512 x 0 ops/sec @ 1180ms/op
-aggregateSignatures/2048 x 0 ops/sec @ 4715ms/op
-
-hash-to-curve
-hash_to_field x 91,600 ops/sec @ 10μs/op
-secp256k1 x 2,373 ops/sec @ 421μs/op
-p256 x 4,310 ops/sec @ 231μs/op
-p384 x 1,664 ops/sec @ 600μs/op
-p521 x 807 ops/sec @ 1ms/op
-ed25519 x 3,088 ops/sec @ 323μs/op
-ed448 x 1,247 ops/sec @ 801μs/op
-```
-
-## Contributing & testing
-
-1. Clone the repository
-2. `npm install` to install build dependencies like TypeScript
-3. `npm run build` to compile TypeScript code
-4. `npm run test` will execute all main tests
-
-## Upgrading
-
-Previously, the library was split into single-feature packages
-noble-secp256k1, noble-ed25519 and noble-bls12-381.
-
-Curves continue their original work. The single-feature packages changed their
-direction towards providing minimal 4kb implementations of cryptography,
-which means they have less features.
-
-Upgrading from @noble/secp256k1 2.0 or @noble/ed25519 2.0: no changes, libraries are compatible.
-
-Upgrading from [@noble/secp256k1](https://github.com/paulmillr/noble-secp256k1) 1.7:
-
-- `getPublicKey`
- - now produce 33-byte compressed signatures by default
- - to use old behavior, which produced 65-byte uncompressed keys, set
- argument `isCompressed` to `false`: `getPublicKey(priv, false)`
-- `sign`
- - is now sync; use `signAsync` for async version
- - now returns `Signature` instance with `{ r, s, recovery }` properties
- - `canonical` option was renamed to `lowS`
- - `recovered` option has been removed because recovery bit is always returned now
- - `der` option has been removed. There are 2 options:
- 1. Use compact encoding: `fromCompact`, `toCompactRawBytes`, `toCompactHex`.
- Compact encoding is simply a concatenation of 32-byte r and 32-byte s.
- 2. If you must use DER encoding, switch to noble-curves (see above).
-- `verify`
- - `strict` option was renamed to `lowS`
-- `getSharedSecret`
- - now produce 33-byte compressed signatures by default
- - to use old behavior, which produced 65-byte uncompressed keys, set
- argument `isCompressed` to `false`: `getSharedSecret(a, b, false)`
-- `recoverPublicKey(msg, sig, rec)` was changed to `sig.recoverPublicKey(msg)`
-- `number` type for private keys have been removed: use `bigint` instead
-- `Point` (2d xy) has been changed to `ProjectivePoint` (3d xyz)
-- `utils` were split into `utils` (same api as in noble-curves) and
- `etc` (`hmacSha256Sync` and others)
-
-Upgrading from [@noble/ed25519](https://github.com/paulmillr/noble-ed25519) 1.7:
-
-- Methods are now sync by default
-- `bigint` is no longer allowed in `getPublicKey`, `sign`, `verify`. Reason: ed25519 is LE, can lead to bugs
-- `Point` (2d xy) has been changed to `ExtendedPoint` (xyzt)
-- `Signature` was removed: just use raw bytes or hex now
-- `utils` were split into `utils` (same api as in noble-curves) and
- `etc` (`sha512Sync` and others)
-- `getSharedSecret` was moved to `x25519` module
-- `toX25519` has been moved to `edwardsToMontgomeryPub` and `edwardsToMontgomeryPriv` methods
-
-Upgrading from [@noble/bls12-381](https://github.com/paulmillr/noble-bls12-381):
-
-- Methods and classes were renamed:
- - PointG1 -> G1.Point, PointG2 -> G2.Point
- - PointG2.fromSignature -> Signature.decode, PointG2.toSignature -> Signature.encode
-- Fp2 ORDER was corrected
-
-## Resources
-
-Useful documentation and articles about the library or its primitives:
-
-- [Learning fast elliptic-curve cryptography](https://paulmillr.com/posts/noble-secp256k1-fast-ecc/)
-- [Taming the many EdDSAs](https://csrc.nist.gov/csrc/media/Presentations/2023/crclub-2023-03-08/images-media/20230308-crypto-club-slides--taming-the-many-EdDSAs.pdf)
- that describes concepts of Strong UnForgeability under Chosen Message Attacks and Strongly Binding Signatures
-- Pairings and BLS
- - [BLS signatures for busy people](https://gist.github.com/paulmillr/18b802ad219b1aee34d773d08ec26ca2)
- - [BLS12-381 for the rest of us](https://hackmd.io/@benjaminion/bls12-381)
- - [Key concepts of pairings](https://medium.com/@alonmuroch_65570/bls-signatures-part-2-key-concepts-of-pairings-27a8a9533d0c)
- - Pairing over bls12-381:
- [part 1](https://research.nccgroup.com/2020/07/06/pairing-over-bls12-381-part-1-fields/),
- [part 2](https://research.nccgroup.com/2020/07/13/pairing-over-bls12-381-part-2-curves/),
- [part 3](https://research.nccgroup.com/2020/08/13/pairing-over-bls12-381-part-3-pairing/)
- - [Estimating the bit security of pairing-friendly curves](https://research.nccgroup.com/2022/02/03/estimating-the-bit-security-of-pairing-friendly-curves/)
-
-Online demos:
-
-- [Elliptic Curve Calculator](https://paulmillr.com/noble): add / multiply points, sign messages
-- [BLS threshold signatures](https://genthresh.com)
-
-Projects using noble-curves:
-
-- [scure-bip32](https://github.com/paulmillr/scure-bip32) and separate [bip32](https://github.com/bitcoinjs/bip32) HDkey libraries
-- Ethereum libraries:
- - [ethereum-cryptography](https://github.com/ethereum/js-ethereum-cryptography)
- - [@ethereumjs](https://github.com/ethereumjs/ethereumjs-monorepo)
- - [micro-eth-signer](https://github.com/paulmillr/micro-eth-signer)
- - [ethers](https://github.com/ethers-io/ethers.js) (old noble-secp256k1 for now)
- - [viem.sh](https://viem.sh)
- - [metamask's eth-sig-util](https://github.com/MetaMask/eth-sig-util)
- - [gridplus lattice sdk](https://github.com/GridPlus/lattice-eth2-utils)
-- Bitcoin libraries: [scure-btc-signer](https://github.com/paulmillr/scure-btc-signer)
-- Solana libraries: [micro-sol-signer](https://github.com/paulmillr/micro-sol-signer), [solana-web3.js](https://github.com/solana-labs/solana-web3.js)
-- [polkadot.js](https://github.com/polkadot-js/common), [micro-starknet](https://github.com/paulmillr/micro-starknet)
-- [protonmail](https://github.com/ProtonMail/WebClients) (old noble-ed25519 for now)
-- [did-jwt](https://github.com/decentralized-identity/did-jwt), [hpke-js](https://github.com/dajiaji/hpke-js), [nostr-tools](https://github.com/nbd-wtf/nostr-tools)
-- [ed25519-keygen](https://github.com/paulmillr/ed25519-keygen) SSH, PGP, TOR key generation
-- [secp256k1 compatibility layer](https://github.com/ethereum/js-ethereum-cryptography/blob/2.0.0/src/secp256k1-compat.ts)
-for users who want to switch from secp256k1-node or tiny-secp256k1. Allows to see which methods map to corresponding noble code.
-- [BLS BBS signatures](https://github.com/Wind4Greg/BBS-Draft-Checks) following [draft-irtf-cfrg-bbs-signatures-latest](https://identity.foundation/bbs-signature/draft-irtf-cfrg-bbs-signatures.html)
-- [KZG trusted setup ceremony](https://github.com/dsrvlabs/czg-keremony)
-
-## License
-
-The MIT License (MIT)
-
-Copyright (c) 2022 Paul Miller [(https://paulmillr.com)](https://paulmillr.com)
-
-See LICENSE file.
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.d.ts
deleted file mode 100644
index 3eb43a81..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.d.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-import { randomBytes } from '@noble/hashes/utils';
-import { CurveType } from './abstract/weierstrass.js';
-import { CHash } from './abstract/utils.js';
-export declare function getHash(hash: CHash): {
- hash: CHash;
- hmac: (key: Uint8Array, ...msgs: Uint8Array[]) => Uint8Array;
- randomBytes: typeof randomBytes;
-};
-type CurveDef = Readonly>;
-export declare function createCurve(curveDef: CurveDef, defHash: CHash): Readonly<{
- create: (hash: CHash) => import("./abstract/weierstrass.js").CurveFn;
- CURVE: Readonly<{
- readonly nBitLength: number;
- readonly nByteLength: number;
- readonly Fp: import("./abstract/modular.js").IField;
- readonly n: bigint;
- readonly h: bigint;
- readonly hEff?: bigint | undefined;
- readonly Gx: bigint;
- readonly Gy: bigint;
- readonly allowInfinityPoint?: boolean | undefined;
- readonly a: bigint;
- readonly b: bigint;
- readonly allowedPrivateKeyLengths?: readonly number[] | undefined;
- readonly wrapPrivateKey?: boolean | undefined;
- readonly endo?: {
- beta: bigint;
- splitScalar: (k: bigint) => {
- k1neg: boolean;
- k1: bigint;
- k2neg: boolean;
- k2: bigint;
- };
- } | undefined;
- readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => boolean) | undefined;
- readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor, point: import("./abstract/weierstrass.js").ProjPointType) => import("./abstract/weierstrass.js").ProjPointType) | undefined;
- readonly hash: CHash;
- readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
- readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array;
- lowS: boolean;
- readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined;
- readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined;
- readonly p: bigint;
- }>;
- getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array;
- getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array;
- sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts | undefined) => import("./abstract/weierstrass.js").RecoveredSignatureType;
- verify: (signature: import("./abstract/utils.js").Hex | {
- r: bigint;
- s: bigint;
- }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts | undefined) => boolean;
- ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor;
- Signature: import("./abstract/weierstrass.js").SignatureConstructor;
- utils: {
- normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
- isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
- randomPrivateKey: () => Uint8Array;
- precompute: (windowSize?: number | undefined, point?: import("./abstract/weierstrass.js").ProjPointType | undefined) => import("./abstract/weierstrass.js").ProjPointType;
- };
-}>;
-export {};
-//# sourceMappingURL=_shortw_utils.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.d.ts.map
deleted file mode 100644
index 974f8daf..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"_shortw_utils.d.ts","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAe,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK;;gBAGnB,UAAU,WAAW,UAAU,EAAE;;EAGhD;AAED,KAAK,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC;AAC3E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK;mBACtC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE5B"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.js b/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.js
deleted file mode 100644
index 555de44e..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.js
+++ /dev/null
@@ -1,22 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.createCurve = exports.getHash = void 0;
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-const hmac_1 = require("@noble/hashes/hmac");
-const utils_1 = require("@noble/hashes/utils");
-const weierstrass_js_1 = require("./abstract/weierstrass.js");
-// connects noble-curves to noble-hashes
-function getHash(hash) {
- return {
- hash,
- hmac: (key, ...msgs) => (0, hmac_1.hmac)(hash, key, (0, utils_1.concatBytes)(...msgs)),
- randomBytes: utils_1.randomBytes,
- };
-}
-exports.getHash = getHash;
-function createCurve(curveDef, defHash) {
- const create = (hash) => (0, weierstrass_js_1.weierstrass)({ ...curveDef, ...getHash(hash) });
- return Object.freeze({ ...create(defHash), create });
-}
-exports.createCurve = createCurve;
-//# sourceMappingURL=_shortw_utils.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.js.map
deleted file mode 100644
index 318dfda2..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/_shortw_utils.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"_shortw_utils.js","sourceRoot":"","sources":["src/_shortw_utils.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,6CAA0C;AAC1C,+CAA+D;AAC/D,8DAAmE;AAGnE,wCAAwC;AACxC,SAAgB,OAAO,CAAC,IAAW;IACjC,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,CAAC,GAAe,EAAE,GAAG,IAAkB,EAAE,EAAE,CAAC,IAAA,WAAI,EAAC,IAAI,EAAE,GAAG,EAAE,IAAA,mBAAW,EAAC,GAAG,IAAI,CAAC,CAAC;QACvF,WAAW,EAAX,mBAAW;KACZ,CAAC;AACJ,CAAC;AAND,0BAMC;AAGD,SAAgB,WAAW,CAAC,QAAkB,EAAE,OAAc;IAC5D,MAAM,MAAM,GAAG,CAAC,IAAW,EAAE,EAAE,CAAC,IAAA,4BAAW,EAAC,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/E,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC;AAHD,kCAGC"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.d.ts
deleted file mode 100644
index f6f14ac2..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.d.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-/**
- * BLS (Barreto-Lynn-Scott) family of pairing-friendly curves.
- * Implements BLS (Boneh-Lynn-Shacham) signatures.
- * Consists of two curves: G1 and G2:
- * - G1 is a subgroup of (x, y) E(Fq) over y² = x³ + 4.
- * - G2 is a subgroup of ((x₁, x₂+i), (y₁, y₂+i)) E(Fq²) over y² = x³ + 4(1 + i) where i is √-1
- * - Gt, created by bilinear (ate) pairing e(G1, G2), consists of p-th roots of unity in
- * Fq^k where k is embedding degree. Only degree 12 is currently supported, 24 is not.
- * Pairing is used to aggregate and verify signatures.
- * We are using Fp for private keys (shorter) and Fp₂ for signatures (longer).
- * Some projects may prefer to swap this relation, it is not supported for now.
- */
-import { AffinePoint } from './curve.js';
-import { IField } from './modular.js';
-import { Hex, PrivKey, CHash } from './utils.js';
-import * as htf from './hash-to-curve.js';
-import { CurvePointsType, ProjPointType as ProjPointType, CurvePointsRes } from './weierstrass.js';
-type Fp = bigint;
-export type SignatureCoder = {
- fromHex(hex: Hex): ProjPointType;
- toRawBytes(point: ProjPointType): Uint8Array;
- toHex(point: ProjPointType): string;
-};
-export type CurveType = {
- G1: Omit, 'n'> & {
- mapToCurve: htf.MapToCurve;
- htfDefaults: htf.Opts;
- };
- G2: Omit, 'n'> & {
- Signature: SignatureCoder;
- mapToCurve: htf.MapToCurve;
- htfDefaults: htf.Opts;
- };
- fields: {
- Fp: IField;
- Fr: IField;
- Fp2: IField & {
- reim: (num: Fp2) => {
- re: bigint;
- im: bigint;
- };
- multiplyByB: (num: Fp2) => Fp2;
- frobeniusMap(num: Fp2, power: number): Fp2;
- };
- Fp6: IField;
- Fp12: IField & {
- frobeniusMap(num: Fp12, power: number): Fp12;
- multiplyBy014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12;
- conjugate(num: Fp12): Fp12;
- finalExponentiate(num: Fp12): Fp12;
- };
- };
- params: {
- x: bigint;
- r: bigint;
- };
- htfDefaults: htf.Opts;
- hash: CHash;
- randomBytes: (bytesLength?: number) => Uint8Array;
-};
-export type CurveFn = {
- getPublicKey: (privateKey: PrivKey) => Uint8Array;
- sign: {
- (message: Hex, privateKey: PrivKey): Uint8Array;
- (message: ProjPointType, privateKey: PrivKey): ProjPointType;
- };
- verify: (signature: Hex | ProjPointType, message: Hex | ProjPointType, publicKey: Hex | ProjPointType) => boolean;
- verifyBatch: (signature: Hex | ProjPointType, messages: (Hex | ProjPointType)[], publicKeys: (Hex | ProjPointType)[]) => boolean;
- aggregatePublicKeys: {
- (publicKeys: Hex[]): Uint8Array;
- (publicKeys: ProjPointType[]): ProjPointType;
- };
- aggregateSignatures: {
- (signatures: Hex[]): Uint8Array;
- (signatures: ProjPointType[]): ProjPointType;
- };
- millerLoop: (ell: [Fp2, Fp2, Fp2][], g1: [Fp, Fp]) => Fp12;
- pairing: (P: ProjPointType, Q: ProjPointType, withFinalExponent?: boolean) => Fp12;
- G1: CurvePointsRes & ReturnType>;
- G2: CurvePointsRes & ReturnType>;
- Signature: SignatureCoder;
- params: {
- x: bigint;
- r: bigint;
- G1b: bigint;
- G2b: Fp2;
- };
- fields: {
- Fp: IField;
- Fp2: IField;
- Fp6: IField;
- Fp12: IField;
- Fr: IField;
- };
- utils: {
- randomPrivateKey: () => Uint8Array;
- calcPairingPrecomputes: (p: AffinePoint) => [Fp2, Fp2, Fp2][];
- };
-};
-export declare function bls(CURVE: CurveType): CurveFn;
-export {};
-//# sourceMappingURL=bls.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.d.ts.map
deleted file mode 100644
index 75b6d262..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"bls.d.ts","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,MAAM,EAAuB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAA+B,MAAM,YAAY,CAAC;AAC9E,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EACL,eAAe,EACf,aAAa,IAAI,aAAa,EAC9B,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAE1B,KAAK,EAAE,GAAG,MAAM,CAAC;AAKjB,MAAM,MAAM,cAAc,CAAC,GAAG,IAAI;IAChC,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACtC,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;IAClD,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,IAAI;IAC1C,EAAE,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG;QACnC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC/B,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC;KACvB,CAAC;IACF,EAAE,EAA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,GAAG,EAAE,IAAI,EAChC,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GACnC,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAqR7B"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.js b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.js
deleted file mode 100644
index 1c0e9561..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.js
+++ /dev/null
@@ -1,239 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.bls = void 0;
-const modular_js_1 = require("./modular.js");
-const utils_js_1 = require("./utils.js");
-const htf = require("./hash-to-curve.js");
-const weierstrass_js_1 = require("./weierstrass.js");
-// prettier-ignore
-const _2n = BigInt(2), _3n = BigInt(3);
-function bls(CURVE) {
- // Fields are specific for curve, so for now we'll need to pass them with opts
- const { Fp, Fr, Fp2, Fp6, Fp12 } = CURVE.fields;
- const BLS_X_LEN = (0, utils_js_1.bitLen)(CURVE.params.x);
- const groupLen = 32; // TODO: calculate; hardcoded for now
- // Pre-compute coefficients for sparse multiplication
- // Point addition and point double calculations is reused for coefficients
- function calcPairingPrecomputes(p) {
- const { x, y } = p;
- // prettier-ignore
- const Qx = x, Qy = y, Qz = Fp2.ONE;
- // prettier-ignore
- let Rx = Qx, Ry = Qy, Rz = Qz;
- let ell_coeff = [];
- for (let i = BLS_X_LEN - 2; i >= 0; i--) {
- // Double
- let t0 = Fp2.sqr(Ry); // Ry²
- let t1 = Fp2.sqr(Rz); // Rz²
- let t2 = Fp2.multiplyByB(Fp2.mul(t1, _3n)); // 3 * T1 * B
- let t3 = Fp2.mul(t2, _3n); // 3 * T2
- let t4 = Fp2.sub(Fp2.sub(Fp2.sqr(Fp2.add(Ry, Rz)), t1), t0); // (Ry + Rz)² - T1 - T0
- ell_coeff.push([
- Fp2.sub(t2, t0),
- Fp2.mul(Fp2.sqr(Rx), _3n),
- Fp2.neg(t4), // -T4
- ]);
- Rx = Fp2.div(Fp2.mul(Fp2.mul(Fp2.sub(t0, t3), Rx), Ry), _2n); // ((T0 - T3) * Rx * Ry) / 2
- Ry = Fp2.sub(Fp2.sqr(Fp2.div(Fp2.add(t0, t3), _2n)), Fp2.mul(Fp2.sqr(t2), _3n)); // ((T0 + T3) / 2)² - 3 * T2²
- Rz = Fp2.mul(t0, t4); // T0 * T4
- if ((0, utils_js_1.bitGet)(CURVE.params.x, i)) {
- // Addition
- let t0 = Fp2.sub(Ry, Fp2.mul(Qy, Rz)); // Ry - Qy * Rz
- let t1 = Fp2.sub(Rx, Fp2.mul(Qx, Rz)); // Rx - Qx * Rz
- ell_coeff.push([
- Fp2.sub(Fp2.mul(t0, Qx), Fp2.mul(t1, Qy)),
- Fp2.neg(t0),
- t1, // T1
- ]);
- let t2 = Fp2.sqr(t1); // T1²
- let t3 = Fp2.mul(t2, t1); // T2 * T1
- let t4 = Fp2.mul(t2, Rx); // T2 * Rx
- let t5 = Fp2.add(Fp2.sub(t3, Fp2.mul(t4, _2n)), Fp2.mul(Fp2.sqr(t0), Rz)); // T3 - 2 * T4 + T0² * Rz
- Rx = Fp2.mul(t1, t5); // T1 * T5
- Ry = Fp2.sub(Fp2.mul(Fp2.sub(t4, t5), t0), Fp2.mul(t3, Ry)); // (T4 - T5) * T0 - T3 * Ry
- Rz = Fp2.mul(Rz, t3); // Rz * T3
- }
- }
- return ell_coeff;
- }
- function millerLoop(ell, g1) {
- const { x } = CURVE.params;
- const Px = g1[0];
- const Py = g1[1];
- let f12 = Fp12.ONE;
- for (let j = 0, i = BLS_X_LEN - 2; i >= 0; i--, j++) {
- const E = ell[j];
- f12 = Fp12.multiplyBy014(f12, E[0], Fp2.mul(E[1], Px), Fp2.mul(E[2], Py));
- if ((0, utils_js_1.bitGet)(x, i)) {
- j += 1;
- const F = ell[j];
- f12 = Fp12.multiplyBy014(f12, F[0], Fp2.mul(F[1], Px), Fp2.mul(F[2], Py));
- }
- if (i !== 0)
- f12 = Fp12.sqr(f12);
- }
- return Fp12.conjugate(f12);
- }
- const utils = {
- randomPrivateKey: () => {
- return Fr.toBytes((0, modular_js_1.hashToPrivateScalar)(CURVE.randomBytes(groupLen + 8), CURVE.params.r));
- },
- calcPairingPrecomputes,
- };
- // Point on G1 curve: (x, y)
- const G1_ = (0, weierstrass_js_1.weierstrassPoints)({ n: Fr.ORDER, ...CURVE.G1 });
- const G1 = Object.assign(G1_, htf.createHasher(G1_.ProjectivePoint, CURVE.G1.mapToCurve, {
- ...CURVE.htfDefaults,
- ...CURVE.G1.htfDefaults,
- }));
- function pairingPrecomputes(point) {
- const p = point;
- if (p._PPRECOMPUTES)
- return p._PPRECOMPUTES;
- p._PPRECOMPUTES = calcPairingPrecomputes(point.toAffine());
- return p._PPRECOMPUTES;
- }
- // TODO: export
- // function clearPairingPrecomputes(point: G2) {
- // const p = point as G2 & withPairingPrecomputes;
- // p._PPRECOMPUTES = undefined;
- // }
- // Point on G2 curve (complex numbers): (x₁, x₂+i), (y₁, y₂+i)
- const G2_ = (0, weierstrass_js_1.weierstrassPoints)({ n: Fr.ORDER, ...CURVE.G2 });
- const G2 = Object.assign(G2_, htf.createHasher(G2_.ProjectivePoint, CURVE.G2.mapToCurve, {
- ...CURVE.htfDefaults,
- ...CURVE.G2.htfDefaults,
- }));
- const { Signature } = CURVE.G2;
- // Calculates bilinear pairing
- function pairing(Q, P, withFinalExponent = true) {
- if (Q.equals(G1.ProjectivePoint.ZERO) || P.equals(G2.ProjectivePoint.ZERO))
- throw new Error('pairing is not available for ZERO point');
- Q.assertValidity();
- P.assertValidity();
- // Performance: 9ms for millerLoop and ~14ms for exp.
- const Qa = Q.toAffine();
- const looped = millerLoop(pairingPrecomputes(P), [Qa.x, Qa.y]);
- return withFinalExponent ? Fp12.finalExponentiate(looped) : looped;
- }
- function normP1(point) {
- return point instanceof G1.ProjectivePoint ? point : G1.ProjectivePoint.fromHex(point);
- }
- function normP2(point) {
- return point instanceof G2.ProjectivePoint ? point : Signature.fromHex(point);
- }
- function normP2Hash(point, htfOpts) {
- return point instanceof G2.ProjectivePoint
- ? point
- : G2.hashToCurve((0, utils_js_1.ensureBytes)('point', point), htfOpts);
- }
- // Multiplies generator by private key.
- // P = pk x G
- function getPublicKey(privateKey) {
- return G1.ProjectivePoint.fromPrivateKey(privateKey).toRawBytes(true);
- }
- function sign(message, privateKey, htfOpts) {
- const msgPoint = normP2Hash(message, htfOpts);
- msgPoint.assertValidity();
- const sigPoint = msgPoint.multiply(G1.normPrivateKeyToScalar(privateKey));
- if (message instanceof G2.ProjectivePoint)
- return sigPoint;
- return Signature.toRawBytes(sigPoint);
- }
- // Checks if pairing of public key & hash is equal to pairing of generator & signature.
- // e(P, H(m)) == e(G, S)
- function verify(signature, message, publicKey, htfOpts) {
- const P = normP1(publicKey);
- const Hm = normP2Hash(message, htfOpts);
- const G = G1.ProjectivePoint.BASE;
- const S = normP2(signature);
- // Instead of doing 2 exponentiations, we use property of billinear maps
- // and do one exp after multiplying 2 points.
- const ePHm = pairing(P.negate(), Hm, false);
- const eGS = pairing(G, S, false);
- const exp = Fp12.finalExponentiate(Fp12.mul(eGS, ePHm));
- return Fp12.eql(exp, Fp12.ONE);
- }
- function aggregatePublicKeys(publicKeys) {
- if (!publicKeys.length)
- throw new Error('Expected non-empty array');
- const agg = publicKeys.map(normP1).reduce((sum, p) => sum.add(p), G1.ProjectivePoint.ZERO);
- const aggAffine = agg; //.toAffine();
- if (publicKeys[0] instanceof G1.ProjectivePoint) {
- aggAffine.assertValidity();
- return aggAffine;
- }
- // toRawBytes ensures point validity
- return aggAffine.toRawBytes(true);
- }
- function aggregateSignatures(signatures) {
- if (!signatures.length)
- throw new Error('Expected non-empty array');
- const agg = signatures.map(normP2).reduce((sum, s) => sum.add(s), G2.ProjectivePoint.ZERO);
- const aggAffine = agg; //.toAffine();
- if (signatures[0] instanceof G2.ProjectivePoint) {
- aggAffine.assertValidity();
- return aggAffine;
- }
- return Signature.toRawBytes(aggAffine);
- }
- // https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407
- // e(G, S) = e(G, SUM(n)(Si)) = MUL(n)(e(G, Si))
- function verifyBatch(signature, messages, publicKeys, htfOpts) {
- // @ts-ignore
- // console.log('verifyBatch', bytesToHex(signature as any), messages, publicKeys.map(bytesToHex));
- if (!messages.length)
- throw new Error('Expected non-empty messages array');
- if (publicKeys.length !== messages.length)
- throw new Error('Pubkey count should equal msg count');
- const sig = normP2(signature);
- const nMessages = messages.map((i) => normP2Hash(i, htfOpts));
- const nPublicKeys = publicKeys.map(normP1);
- try {
- const paired = [];
- for (const message of new Set(nMessages)) {
- const groupPublicKey = nMessages.reduce((groupPublicKey, subMessage, i) => subMessage === message ? groupPublicKey.add(nPublicKeys[i]) : groupPublicKey, G1.ProjectivePoint.ZERO);
- // const msg = message instanceof PointG2 ? message : await PointG2.hashToCurve(message);
- // Possible to batch pairing for same msg with different groupPublicKey here
- paired.push(pairing(groupPublicKey, message, false));
- }
- paired.push(pairing(G1.ProjectivePoint.BASE.negate(), sig, false));
- const product = paired.reduce((a, b) => Fp12.mul(a, b), Fp12.ONE);
- const exp = Fp12.finalExponentiate(product);
- return Fp12.eql(exp, Fp12.ONE);
- }
- catch {
- return false;
- }
- }
- G1.ProjectivePoint.BASE._setWindowSize(4);
- return {
- getPublicKey,
- sign,
- verify,
- verifyBatch,
- aggregatePublicKeys,
- aggregateSignatures,
- millerLoop,
- pairing,
- G1,
- G2,
- Signature,
- fields: {
- Fr,
- Fp,
- Fp2,
- Fp6,
- Fp12,
- },
- params: {
- x: CURVE.params.x,
- r: CURVE.params.r,
- G1b: CURVE.G1.b,
- G2b: CURVE.G2.b,
- },
- utils,
- };
-}
-exports.bls = bls;
-//# sourceMappingURL=bls.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.js.map
deleted file mode 100644
index 1ce9b316..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/bls.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"bls.js","sourceRoot":"","sources":["../src/abstract/bls.ts"],"names":[],"mappings":";;;AAcA,6CAA2D;AAC3D,yCAA8E;AAC9E,0CAA0C;AAC1C,qDAK0B;AAI1B,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AA2FvC,SAAgB,GAAG,CACjB,KAAoC;IAEpC,8EAA8E;IAC9E,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAChD,MAAM,SAAS,GAAG,IAAA,iBAAM,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,EAAE,CAAC,CAAC,qCAAqC;IAE1D,qDAAqD;IACrD,0EAA0E;IAC1E,SAAS,sBAAsB,CAAC,CAAmB;QACjD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACnB,kBAAkB;QAClB,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC;QACnC,kBAAkB;QAClB,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;QAC9B,IAAI,SAAS,GAAsB,EAAE,CAAC;QACtC,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YACvC,SAAS;YACT,IAAI,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;YAC5B,IAAI,EAA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AAG;YACH,GAAG;YACH,IAAI;SACL;QACD,MAAM,EAAE;YACN,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACjB,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;YACf,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;SAChB;QACD,KAAK;KACN,CAAC;AACJ,CAAC;AAvRD,kBAuRC"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.d.ts
deleted file mode 100644
index 9caf29cc..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.d.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-import { IField } from './modular.js';
-export type AffinePoint = {
- x: T;
- y: T;
-} & {
- z?: never;
- t?: never;
-};
-export interface Group> {
- double(): T;
- negate(): T;
- add(other: T): T;
- subtract(other: T): T;
- equals(other: T): boolean;
- multiply(scalar: bigint): T;
-}
-export type GroupConstructor = {
- BASE: T;
- ZERO: T;
-};
-export type Mapper = (i: T[]) => T[];
-export declare function wNAF>(c: GroupConstructor, bits: number): {
- constTimeNegate: (condition: boolean, item: T) => T;
- unsafeLadder(elm: T, n: bigint): T;
- /**
- * Creates a wNAF precomputation window. Used for caching.
- * Default window size is set by `utils.precompute()` and is equal to 8.
- * Number of precomputed points depends on the curve size:
- * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
- * - 𝑊 is the window size
- * - 𝑛 is the bitlength of the curve order.
- * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
- * @returns precomputed point tables flattened to a single array
- */
- precomputeWindow(elm: T, W: number): Group[];
- /**
- * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
- * @param W window size
- * @param precomputes precomputed tables
- * @param n scalar (we don't check here, but should be less than curve order)
- * @returns real and fake (for const-time) points
- */
- wNAF(W: number, precomputes: T[], n: bigint): {
- p: T;
- f: T;
- };
- wNAFCached(P: T, precomputesMap: Map, n: bigint, transform: Mapper): {
- p: T;
- f: T;
- };
-};
-export type BasicCurve = {
- Fp: IField;
- n: bigint;
- nBitLength?: number;
- nByteLength?: number;
- h: bigint;
- hEff?: bigint;
- Gx: T;
- Gy: T;
- allowInfinityPoint?: boolean;
-};
-export declare function validateBasic(curve: BasicCurve & T): Readonly<{
- readonly nBitLength: number;
- readonly nByteLength: number;
-} & BasicCurve & T & {
- p: bigint;
-}>;
-//# sourceMappingURL=curve.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.d.ts.map
deleted file mode 100644
index fc52e87b..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EAAE,MAAM,EAA0B,MAAM,cAAc,CAAC;AAK9D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,CAAC;CACN,GAAG;IAAE,CAAC,CAAC,EAAE,KAAK,CAAC;IAAC,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7B,MAAM,WAAW,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC;IACvC,MAAM,IAAI,CAAC,CAAC;IACZ,MAAM,IAAI,CAAC,CAAC;IACZ,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACjB,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACtB,MAAM,CAAC,KAAK,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AE,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC;;;;;GAqB7D"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.js b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.js
deleted file mode 100644
index 5a005bcd..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.js
+++ /dev/null
@@ -1,161 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.validateBasic = exports.wNAF = void 0;
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-// Abelian group utilities
-const modular_js_1 = require("./modular.js");
-const utils_js_1 = require("./utils.js");
-const _0n = BigInt(0);
-const _1n = BigInt(1);
-// Elliptic curve multiplication of Point by scalar. Fragile.
-// Scalars should always be less than curve order: this should be checked inside of a curve itself.
-// Creates precomputation tables for fast multiplication:
-// - private scalar is split by fixed size windows of W bits
-// - every window point is collected from window's table & added to accumulator
-// - since windows are different, same point inside tables won't be accessed more than once per calc
-// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)
-// - +1 window is neccessary for wNAF
-// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication
-// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow
-// windows to be in different memory locations
-function wNAF(c, bits) {
- const constTimeNegate = (condition, item) => {
- const neg = item.negate();
- return condition ? neg : item;
- };
- const opts = (W) => {
- const windows = Math.ceil(bits / W) + 1; // +1, because
- const windowSize = 2 ** (W - 1); // -1 because we skip zero
- return { windows, windowSize };
- };
- return {
- constTimeNegate,
- // non-const time multiplication ladder
- unsafeLadder(elm, n) {
- let p = c.ZERO;
- let d = elm;
- while (n > _0n) {
- if (n & _1n)
- p = p.add(d);
- d = d.double();
- n >>= _1n;
- }
- return p;
- },
- /**
- * Creates a wNAF precomputation window. Used for caching.
- * Default window size is set by `utils.precompute()` and is equal to 8.
- * Number of precomputed points depends on the curve size:
- * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
- * - 𝑊 is the window size
- * - 𝑛 is the bitlength of the curve order.
- * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
- * @returns precomputed point tables flattened to a single array
- */
- precomputeWindow(elm, W) {
- const { windows, windowSize } = opts(W);
- const points = [];
- let p = elm;
- let base = p;
- for (let window = 0; window < windows; window++) {
- base = p;
- points.push(base);
- // =1, because we skip zero
- for (let i = 1; i < windowSize; i++) {
- base = base.add(p);
- points.push(base);
- }
- p = base.double();
- }
- return points;
- },
- /**
- * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
- * @param W window size
- * @param precomputes precomputed tables
- * @param n scalar (we don't check here, but should be less than curve order)
- * @returns real and fake (for const-time) points
- */
- wNAF(W, precomputes, n) {
- // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise
- // But need to carefully remove other checks before wNAF. ORDER == bits here
- const { windows, windowSize } = opts(W);
- let p = c.ZERO;
- let f = c.BASE;
- const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc.
- const maxNumber = 2 ** W;
- const shiftBy = BigInt(W);
- for (let window = 0; window < windows; window++) {
- const offset = window * windowSize;
- // Extract W bits.
- let wbits = Number(n & mask);
- // Shift number by W bits.
- n >>= shiftBy;
- // If the bits are bigger than max size, we'll split those.
- // +224 => 256 - 32
- if (wbits > windowSize) {
- wbits -= maxNumber;
- n += _1n;
- }
- // This code was first written with assumption that 'f' and 'p' will never be infinity point:
- // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,
- // there is negate now: it is possible that negated element from low value
- // would be the same as high element, which will create carry into next window.
- // It's not obvious how this can fail, but still worth investigating later.
- // Check if we're onto Zero point.
- // Add random point inside current window to f.
- const offset1 = offset;
- const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero
- const cond1 = window % 2 !== 0;
- const cond2 = wbits < 0;
- if (wbits === 0) {
- // The most important part for const-time getPublicKey
- f = f.add(constTimeNegate(cond1, precomputes[offset1]));
- }
- else {
- p = p.add(constTimeNegate(cond2, precomputes[offset2]));
- }
- }
- // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ()
- // Even if the variable is still unused, there are some checks which will
- // throw an exception, so compiler needs to prove they won't happen, which is hard.
- // At this point there is a way to F be infinity-point even if p is not,
- // which makes it less const-time: around 1 bigint multiply.
- return { p, f };
- },
- wNAFCached(P, precomputesMap, n, transform) {
- // @ts-ignore
- const W = P._WINDOW_SIZE || 1;
- // Calculate precomputes on a first run, reuse them after
- let comp = precomputesMap.get(P);
- if (!comp) {
- comp = this.precomputeWindow(P, W);
- if (W !== 1) {
- precomputesMap.set(P, transform(comp));
- }
- }
- return this.wNAF(W, comp, n);
- },
- };
-}
-exports.wNAF = wNAF;
-function validateBasic(curve) {
- (0, modular_js_1.validateField)(curve.Fp);
- (0, utils_js_1.validateObject)(curve, {
- n: 'bigint',
- h: 'bigint',
- Gx: 'field',
- Gy: 'field',
- }, {
- nBitLength: 'isSafeInteger',
- nByteLength: 'isSafeInteger',
- });
- // Set defaults
- return Object.freeze({
- ...(0, modular_js_1.nLength)(curve.n, curve.nBitLength),
- ...curve,
- ...{ p: curve.Fp.ORDER },
- });
-}
-exports.validateBasic = validateBasic;
-//# sourceMappingURL=curve.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.js.map
deleted file mode 100644
index dd6ca4b3..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/curve.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"curve.js","sourceRoot":"","sources":["../src/abstract/curve.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,0BAA0B;AAC1B,6CAA8D;AAC9D,yCAA4C;AAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,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DAAyD;YACzD,IAAI,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,CAAC,IAAI,EAAE;gBACT,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAQ,CAAC;gBAC1C,IAAI,CAAC,KAAK,CAAC,EAAE;oBACX,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;iBACxC;aACF;YACD,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/B,CAAC;KACF,CAAC;AACJ,CAAC;AA/HD,oBA+HC;AAgBD,SAAgB,aAAa,CAAQ,KAAyB;IAC5D,IAAA,0BAAa,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxB,IAAA,yBAAc,EACZ,KAAK,EACL;QACE,CAAC,EAAE,QAAQ;QACX,CAAC,EAAE,QAAQ;QACX,EAAE,EAAE,OAAO;QACX,EAAE,EAAE,OAAO;KACZ,EACD;QACE,UAAU,EAAE,eAAe;QAC3B,WAAW,EAAE,eAAe;KAC7B,CACF,CAAC;IACF,eAAe;IACf,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,IAAA,oBAAO,EAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;QACrC,GAAG,KAAK;QACR,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;KAChB,CAAC,CAAC;AACd,CAAC;AArBD,sCAqBC"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.d.ts
deleted file mode 100644
index 9c43c661..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.d.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-import * as ut from './utils.js';
-import { FHash, Hex } from './utils.js';
-import { Group, GroupConstructor, BasicCurve, AffinePoint } from './curve.js';
-export type CurveType = BasicCurve & {
- a: bigint;
- d: bigint;
- hash: FHash;
- randomBytes: (bytesLength?: number) => Uint8Array;
- adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array;
- domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array;
- uvRatio?: (u: bigint, v: bigint) => {
- isValid: boolean;
- value: bigint;
- };
- prehash?: FHash;
- mapToCurve?: (scalar: bigint[]) => AffinePoint;
-};
-declare function validateOpts(curve: CurveType): Readonly<{
- readonly nBitLength: number;
- readonly nByteLength: number;
- readonly Fp: import("./modular.js").IField;
- readonly n: bigint;
- readonly h: bigint;
- readonly hEff?: bigint | undefined;
- readonly Gx: bigint;
- readonly Gy: bigint;
- readonly allowInfinityPoint?: boolean | undefined;
- readonly a: bigint;
- readonly d: bigint;
- readonly hash: ut.FHash;
- readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array;
- readonly adjustScalarBytes?: ((bytes: Uint8Array) => Uint8Array) | undefined;
- readonly domain?: ((data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array) | undefined;
- readonly uvRatio?: ((u: bigint, v: bigint) => {
- isValid: boolean;
- value: bigint;
- }) | undefined;
- readonly prehash?: ut.FHash | undefined;
- readonly mapToCurve?: ((scalar: bigint[]) => AffinePoint) | undefined;
- readonly p: bigint;
-}>;
-export interface ExtPointType extends Group {
- readonly ex: bigint;
- readonly ey: bigint;
- readonly ez: bigint;
- readonly et: bigint;
- get x(): bigint;
- get y(): bigint;
- assertValidity(): void;
- multiply(scalar: bigint): ExtPointType;
- multiplyUnsafe(scalar: bigint): ExtPointType;
- isSmallOrder(): boolean;
- isTorsionFree(): boolean;
- clearCofactor(): ExtPointType;
- toAffine(iz?: bigint): AffinePoint;
- toRawBytes(isCompressed?: boolean): Uint8Array;
- toHex(isCompressed?: boolean): string;
-}
-export interface ExtPointConstructor extends GroupConstructor {
- new (x: bigint, y: bigint, z: bigint, t: bigint): ExtPointType;
- fromAffine(p: AffinePoint): ExtPointType;
- fromHex(hex: Hex): ExtPointType;
- fromPrivateKey(privateKey: Hex): ExtPointType;
-}
-export type CurveFn = {
- CURVE: ReturnType;
- getPublicKey: (privateKey: Hex) => Uint8Array;
- sign: (message: Hex, privateKey: Hex, options?: {
- context?: Hex;
- }) => Uint8Array;
- verify: (sig: Hex, message: Hex, publicKey: Hex, options?: {
- context?: Hex;
- zip215: boolean;
- }) => boolean;
- ExtendedPoint: ExtPointConstructor;
- utils: {
- randomPrivateKey: () => Uint8Array;
- getExtendedPublicKey: (key: Hex) => {
- head: Uint8Array;
- prefix: Uint8Array;
- scalar: bigint;
- point: ExtPointType;
- pointBytes: Uint8Array;
- };
- };
-};
-export declare function twistedEdwards(curveDef: CurveType): CurveFn;
-export {};
-//# sourceMappingURL=edwards.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.d.ts.map
deleted file mode 100644
index a32123f7..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"edwards.d.ts","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAe,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAQ,UAAU,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAOnG,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG;IAC3C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,KAAK,CAAC;IACZ,WAAW,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAA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AAC;KACH,CAAC;CACH,CAAC;AAGF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CA8Z3D"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.js b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.js
deleted file mode 100644
index 6dd4151a..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.js
+++ /dev/null
@@ -1,429 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.twistedEdwards = void 0;
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-// Twisted Edwards curve. The formula is: ax² + y² = 1 + dx²y²
-const modular_js_1 = require("./modular.js");
-const ut = require("./utils.js");
-const utils_js_1 = require("./utils.js");
-const curve_js_1 = require("./curve.js");
-// Be friendly to bad ECMAScript parsers by not using bigint literals
-// prettier-ignore
-const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _8n = BigInt(8);
-// verification rule is either zip215 or rfc8032 / nist186-5. Consult fromHex:
-const VERIFY_DEFAULT = { zip215: true };
-function validateOpts(curve) {
- const opts = (0, curve_js_1.validateBasic)(curve);
- ut.validateObject(curve, {
- hash: 'function',
- a: 'bigint',
- d: 'bigint',
- randomBytes: 'function',
- }, {
- adjustScalarBytes: 'function',
- domain: 'function',
- uvRatio: 'function',
- mapToCurve: 'function',
- });
- // Set defaults
- return Object.freeze({ ...opts });
-}
-// It is not generic twisted curve for now, but ed25519/ed448 generic implementation
-function twistedEdwards(curveDef) {
- const CURVE = validateOpts(curveDef);
- const { Fp, n: CURVE_ORDER, prehash: prehash, hash: cHash, randomBytes, nByteLength, h: cofactor, } = CURVE;
- const MASK = _2n << (BigInt(nByteLength * 8) - _1n);
- const modP = Fp.create; // Function overrides
- // sqrt(u/v)
- const uvRatio = CURVE.uvRatio ||
- ((u, v) => {
- try {
- return { isValid: true, value: Fp.sqrt(u * Fp.inv(v)) };
- }
- catch (e) {
- return { isValid: false, value: _0n };
- }
- });
- const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes); // NOOP
- const domain = CURVE.domain ||
- ((data, ctx, phflag) => {
- if (ctx.length || phflag)
- throw new Error('Contexts/pre-hash are not supported');
- return data;
- }); // NOOP
- const inBig = (n) => typeof n === 'bigint' && _0n < n; // n in [1..]
- const inRange = (n, max) => inBig(n) && inBig(max) && n < max; // n in [1..max-1]
- const in0MaskRange = (n) => n === _0n || inRange(n, MASK); // n in [0..MASK-1]
- function assertInRange(n, max) {
- // n in [1..max-1]
- if (inRange(n, max))
- return n;
- throw new Error(`Expected valid scalar < ${max}, got ${typeof n} ${n}`);
- }
- function assertGE0(n) {
- // n in [0..CURVE_ORDER-1]
- return n === _0n ? n : assertInRange(n, CURVE_ORDER); // GE = prime subgroup, not full group
- }
- const pointPrecomputes = new Map();
- function isPoint(other) {
- if (!(other instanceof Point))
- throw new Error('ExtendedPoint expected');
- }
- // Extended Point works in extended coordinates: (x, y, z, t) ∋ (x=x/z, y=y/z, t=xy).
- // https://en.wikipedia.org/wiki/Twisted_Edwards_curve#Extended_coordinates
- class Point {
- constructor(ex, ey, ez, et) {
- this.ex = ex;
- this.ey = ey;
- this.ez = ez;
- this.et = et;
- if (!in0MaskRange(ex))
- throw new Error('x required');
- if (!in0MaskRange(ey))
- throw new Error('y required');
- if (!in0MaskRange(ez))
- throw new Error('z required');
- if (!in0MaskRange(et))
- throw new Error('t required');
- }
- get x() {
- return this.toAffine().x;
- }
- get y() {
- return this.toAffine().y;
- }
- static fromAffine(p) {
- if (p instanceof Point)
- throw new Error('extended point not allowed');
- const { x, y } = p || {};
- if (!in0MaskRange(x) || !in0MaskRange(y))
- throw new Error('invalid affine point');
- return new Point(x, y, _1n, modP(x * y));
- }
- static normalizeZ(points) {
- const toInv = Fp.invertBatch(points.map((p) => p.ez));
- return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);
- }
- // "Private method", don't use it directly
- _setWindowSize(windowSize) {
- this._WINDOW_SIZE = windowSize;
- pointPrecomputes.delete(this);
- }
- // Not required for fromHex(), which always creates valid points.
- // Could be useful for fromAffine().
- assertValidity() {
- const { a, d } = CURVE;
- if (this.is0())
- throw new Error('bad point: ZERO'); // TODO: optimize, with vars below?
- // Equation in affine coordinates: ax² + y² = 1 + dx²y²
- // Equation in projective coordinates (X/Z, Y/Z, Z): (aX² + Y²)Z² = Z⁴ + dX²Y²
- const { ex: X, ey: Y, ez: Z, et: T } = this;
- const X2 = modP(X * X); // X²
- const Y2 = modP(Y * Y); // Y²
- const Z2 = modP(Z * Z); // Z²
- const Z4 = modP(Z2 * Z2); // Z⁴
- const aX2 = modP(X2 * a); // aX²
- const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z²
- const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y²
- if (left !== right)
- throw new Error('bad point: equation left != right (1)');
- // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T
- const XY = modP(X * Y);
- const ZT = modP(Z * T);
- if (XY !== ZT)
- throw new Error('bad point: equation left != right (2)');
- }
- // Compare one point to another.
- equals(other) {
- isPoint(other);
- const { ex: X1, ey: Y1, ez: Z1 } = this;
- const { ex: X2, ey: Y2, ez: Z2 } = other;
- const X1Z2 = modP(X1 * Z2);
- const X2Z1 = modP(X2 * Z1);
- const Y1Z2 = modP(Y1 * Z2);
- const Y2Z1 = modP(Y2 * Z1);
- return X1Z2 === X2Z1 && Y1Z2 === Y2Z1;
- }
- is0() {
- return this.equals(Point.ZERO);
- }
- negate() {
- // Flips point sign to a negative one (-x, y in affine coords)
- return new Point(modP(-this.ex), this.ey, this.ez, modP(-this.et));
- }
- // Fast algo for doubling Extended Point.
- // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd
- // Cost: 4M + 4S + 1*a + 6add + 1*2.
- double() {
- const { a } = CURVE;
- const { ex: X1, ey: Y1, ez: Z1 } = this;
- const A = modP(X1 * X1); // A = X12
- const B = modP(Y1 * Y1); // B = Y12
- const C = modP(_2n * modP(Z1 * Z1)); // C = 2*Z12
- const D = modP(a * A); // D = a*A
- const x1y1 = X1 + Y1;
- const E = modP(modP(x1y1 * x1y1) - A - B); // E = (X1+Y1)2-A-B
- const G = D + B; // G = D+B
- const F = G - C; // F = G-C
- const H = D - B; // H = D-B
- const X3 = modP(E * F); // X3 = E*F
- const Y3 = modP(G * H); // Y3 = G*H
- const T3 = modP(E * H); // T3 = E*H
- const Z3 = modP(F * G); // Z3 = F*G
- return new Point(X3, Y3, Z3, T3);
- }
- // Fast algo for adding 2 Extended Points.
- // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd
- // Cost: 9M + 1*a + 1*d + 7add.
- add(other) {
- isPoint(other);
- const { a, d } = CURVE;
- const { ex: X1, ey: Y1, ez: Z1, et: T1 } = this;
- const { ex: X2, ey: Y2, ez: Z2, et: T2 } = other;
- // Faster algo for adding 2 Extended Points when curve's a=-1.
- // http://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-4
- // Cost: 8M + 8add + 2*2.
- // Note: It does not check whether the `other` point is valid.
- if (a === BigInt(-1)) {
- const A = modP((Y1 - X1) * (Y2 + X2));
- const B = modP((Y1 + X1) * (Y2 - X2));
- const F = modP(B - A);
- if (F === _0n)
- return this.double(); // Same point. Tests say it doesn't affect timing
- const C = modP(Z1 * _2n * T2);
- const D = modP(T1 * _2n * Z2);
- const E = D + C;
- const G = B + A;
- const H = D - C;
- const X3 = modP(E * F);
- const Y3 = modP(G * H);
- const T3 = modP(E * H);
- const Z3 = modP(F * G);
- return new Point(X3, Y3, Z3, T3);
- }
- const A = modP(X1 * X2); // A = X1*X2
- const B = modP(Y1 * Y2); // B = Y1*Y2
- const C = modP(T1 * d * T2); // C = T1*d*T2
- const D = modP(Z1 * Z2); // D = Z1*Z2
- const E = modP((X1 + Y1) * (X2 + Y2) - A - B); // E = (X1+Y1)*(X2+Y2)-A-B
- const F = D - C; // F = D-C
- const G = D + C; // G = D+C
- const H = modP(B - a * A); // H = B-a*A
- const X3 = modP(E * F); // X3 = E*F
- const Y3 = modP(G * H); // Y3 = G*H
- const T3 = modP(E * H); // T3 = E*H
- const Z3 = modP(F * G); // Z3 = F*G
- return new Point(X3, Y3, Z3, T3);
- }
- subtract(other) {
- return this.add(other.negate());
- }
- wNAF(n) {
- return wnaf.wNAFCached(this, pointPrecomputes, n, Point.normalizeZ);
- }
- // Constant-time multiplication.
- multiply(scalar) {
- const { p, f } = this.wNAF(assertInRange(scalar, CURVE_ORDER));
- return Point.normalizeZ([p, f])[0];
- }
- // Non-constant-time multiplication. Uses double-and-add algorithm.
- // It's faster, but should only be used when you don't care about
- // an exposed private key e.g. sig verification.
- // Does NOT allow scalars higher than CURVE.n.
- multiplyUnsafe(scalar) {
- let n = assertGE0(scalar); // 0 <= scalar < CURVE.n
- if (n === _0n)
- return I;
- if (this.equals(I) || n === _1n)
- return this;
- if (this.equals(G))
- return this.wNAF(n).p;
- return wnaf.unsafeLadder(this, n);
- }
- // Checks if point is of small order.
- // If you add something to small order point, you will have "dirty"
- // point with torsion component.
- // Multiplies point by cofactor and checks if the result is 0.
- isSmallOrder() {
- return this.multiplyUnsafe(cofactor).is0();
- }
- // Multiplies point by curve order and checks if the result is 0.
- // Returns `false` is the point is dirty.
- isTorsionFree() {
- return wnaf.unsafeLadder(this, CURVE_ORDER).is0();
- }
- // Converts Extended point to default (x, y) coordinates.
- // Can accept precomputed Z^-1 - for example, from invertBatch.
- toAffine(iz) {
- const { ex: x, ey: y, ez: z } = this;
- const is0 = this.is0();
- if (iz == null)
- iz = is0 ? _8n : Fp.inv(z); // 8 was chosen arbitrarily
- const ax = modP(x * iz);
- const ay = modP(y * iz);
- const zz = modP(z * iz);
- if (is0)
- return { x: _0n, y: _1n };
- if (zz !== _1n)
- throw new Error('invZ was invalid');
- return { x: ax, y: ay };
- }
- clearCofactor() {
- const { h: cofactor } = CURVE;
- if (cofactor === _1n)
- return this;
- return this.multiplyUnsafe(cofactor);
- }
- // Converts hash string or Uint8Array to Point.
- // Uses algo from RFC8032 5.1.3.
- static fromHex(hex, zip215 = false) {
- const { d, a } = CURVE;
- const len = Fp.BYTES;
- hex = (0, utils_js_1.ensureBytes)('pointHex', hex, len); // copy hex to a new array
- const normed = hex.slice(); // copy again, we'll manipulate it
- const lastByte = hex[len - 1]; // select last byte
- normed[len - 1] = lastByte & ~0x80; // clear last bit
- const y = ut.bytesToNumberLE(normed);
- if (y === _0n) {
- // y=0 is allowed
- }
- else {
- // RFC8032 prohibits >= p, but ZIP215 doesn't
- if (zip215)
- assertInRange(y, MASK); // zip215=true [1..P-1] (2^255-19-1 for ed25519)
- else
- assertInRange(y, Fp.ORDER); // zip215=false [1..MASK-1] (2^256-1 for ed25519)
- }
- // Ed25519: x² = (y²-1)/(dy²+1) mod p. Ed448: x² = (y²-1)/(dy²-1) mod p. Generic case:
- // ax²+y²=1+dx²y² => y²-1=dx²y²-ax² => y²-1=x²(dy²-a) => x²=(y²-1)/(dy²-a)
- const y2 = modP(y * y); // denominator is always non-0 mod p.
- const u = modP(y2 - _1n); // u = y² - 1
- const v = modP(d * y2 - a); // v = d y² + 1.
- let { isValid, value: x } = uvRatio(u, v); // √(u/v)
- if (!isValid)
- throw new Error('Point.fromHex: invalid y coordinate');
- const isXOdd = (x & _1n) === _1n; // There are 2 square roots. Use x_0 bit to select proper
- const isLastByteOdd = (lastByte & 0x80) !== 0; // x_0, last bit
- if (!zip215 && x === _0n && isLastByteOdd)
- // if x=0 and x_0 = 1, fail
- throw new Error('Point.fromHex: x=0 and x_0=1');
- if (isLastByteOdd !== isXOdd)
- x = modP(-x); // if x_0 != x mod 2, set x = p-x
- return Point.fromAffine({ x, y });
- }
- static fromPrivateKey(privKey) {
- return getExtendedPublicKey(privKey).point;
- }
- toRawBytes() {
- const { x, y } = this.toAffine();
- const bytes = ut.numberToBytesLE(y, Fp.BYTES); // each y has 2 x values (x, -y)
- bytes[bytes.length - 1] |= x & _1n ? 0x80 : 0; // when compressing, it's enough to store y
- return bytes; // and use the last byte to encode sign of x
- }
- toHex() {
- return ut.bytesToHex(this.toRawBytes()); // Same as toRawBytes, but returns string.
- }
- }
- Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n, modP(CURVE.Gx * CURVE.Gy));
- Point.ZERO = new Point(_0n, _1n, _1n, _0n); // 0, 1, 1, 0
- const { BASE: G, ZERO: I } = Point;
- const wnaf = (0, curve_js_1.wNAF)(Point, nByteLength * 8);
- function modN(a) {
- return (0, modular_js_1.mod)(a, CURVE_ORDER);
- }
- // Little-endian SHA512 with modulo n
- function modN_LE(hash) {
- return modN(ut.bytesToNumberLE(hash));
- }
- /** Convenience method that creates public key and other stuff. RFC8032 5.1.5 */
- function getExtendedPublicKey(key) {
- const len = nByteLength;
- key = (0, utils_js_1.ensureBytes)('private key', key, len);
- // Hash private key with curve's hash function to produce uniformingly random input
- // Check byte lengths: ensure(64, h(ensure(32, key)))
- const hashed = (0, utils_js_1.ensureBytes)('hashed private key', cHash(key), 2 * len);
- const head = adjustScalarBytes(hashed.slice(0, len)); // clear first half bits, produce FE
- const prefix = hashed.slice(len, 2 * len); // second half is called key prefix (5.1.6)
- const scalar = modN_LE(head); // The actual private scalar
- const point = G.multiply(scalar); // Point on Edwards curve aka public key
- const pointBytes = point.toRawBytes(); // Uint8Array representation
- return { head, prefix, scalar, point, pointBytes };
- }
- // Calculates EdDSA pub key. RFC8032 5.1.5. Privkey is hashed. Use first half with 3 bits cleared
- function getPublicKey(privKey) {
- return getExtendedPublicKey(privKey).pointBytes;
- }
- // int('LE', SHA512(dom2(F, C) || msgs)) mod N
- function hashDomainToScalar(context = new Uint8Array(), ...msgs) {
- const msg = ut.concatBytes(...msgs);
- return modN_LE(cHash(domain(msg, (0, utils_js_1.ensureBytes)('context', context), !!prehash)));
- }
- /** Signs message with privateKey. RFC8032 5.1.6 */
- function sign(msg, privKey, options = {}) {
- msg = (0, utils_js_1.ensureBytes)('message', msg);
- if (prehash)
- msg = prehash(msg); // for ed25519ph etc.
- const { prefix, scalar, pointBytes } = getExtendedPublicKey(privKey);
- const r = hashDomainToScalar(options.context, prefix, msg); // r = dom2(F, C) || prefix || PH(M)
- const R = G.multiply(r).toRawBytes(); // R = rG
- const k = hashDomainToScalar(options.context, R, pointBytes, msg); // R || A || PH(M)
- const s = modN(r + k * scalar); // S = (r + k * s) mod L
- assertGE0(s); // 0 <= s < l
- const res = ut.concatBytes(R, ut.numberToBytesLE(s, Fp.BYTES));
- return (0, utils_js_1.ensureBytes)('result', res, nByteLength * 2); // 64-byte signature
- }
- const verifyOpts = VERIFY_DEFAULT;
- function verify(sig, msg, publicKey, options = verifyOpts) {
- const { context, zip215 } = options;
- const len = Fp.BYTES; // Verifies EdDSA signature against message and public key. RFC8032 5.1.7.
- sig = (0, utils_js_1.ensureBytes)('signature', sig, 2 * len); // An extended group equation is checked.
- msg = (0, utils_js_1.ensureBytes)('message', msg);
- if (prehash)
- msg = prehash(msg); // for ed25519ph, etc
- const s = ut.bytesToNumberLE(sig.slice(len, 2 * len));
- // zip215: true is good for consensus-critical apps and allows points < 2^256
- // zip215: false follows RFC8032 / NIST186-5 and restricts points to CURVE.p
- let A, R, SB;
- try {
- A = Point.fromHex(publicKey, zip215);
- R = Point.fromHex(sig.slice(0, len), zip215);
- SB = G.multiplyUnsafe(s); // 0 <= s < l is done inside
- }
- catch (error) {
- return false;
- }
- if (!zip215 && A.isSmallOrder())
- return false;
- const k = hashDomainToScalar(context, R.toRawBytes(), A.toRawBytes(), msg);
- const RkA = R.add(A.multiplyUnsafe(k));
- // [8][S]B = [8]R + [8][k]A'
- return RkA.subtract(SB).clearCofactor().equals(Point.ZERO);
- }
- G._setWindowSize(8); // Enable precomputes. Slows down first publicKey computation by 20ms.
- const utils = {
- getExtendedPublicKey,
- // ed25519 private keys are uniform 32b. No need to check for modulo bias, like in secp256k1.
- randomPrivateKey: () => randomBytes(Fp.BYTES),
- /**
- * We're doing scalar multiplication (used in getPublicKey etc) with precomputed BASE_POINT
- * values. This slows down first getPublicKey() by milliseconds (see Speed section),
- * but allows to speed-up subsequent getPublicKey() calls up to 20x.
- * @param windowSize 2, 4, 8, 16
- */
- precompute(windowSize = 8, point = Point.BASE) {
- point._setWindowSize(windowSize);
- point.multiply(BigInt(3));
- return point;
- },
- };
- return {
- CURVE,
- getPublicKey,
- sign,
- verify,
- ExtendedPoint: Point,
- utils,
- };
-}
-exports.twistedEdwards = twistedEdwards;
-//# sourceMappingURL=edwards.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.js.map
deleted file mode 100644
index 73ac6d5a..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/edwards.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"edwards.js","sourceRoot":"","sources":["../src/abstract/edwards.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,8DAA8D;AAC9D,6CAAmC;AACnC,iCAAiC;AACjC,yCAAqD;AACrD,yCAAmG;AAEnG,qEAAqE;AACrE,kBAAkB;AAClB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAezE,8EAA8E;AAC9E,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAExC,SAAS,YAAY,CAAC,KAAgB;IACpC,MAAM,IAAI,GAAG,IAAA,wBAAa,EAAC,KAAK,CAAC,CAAC;IAClC,EAAE,CAAC,cAAc,CACf,KAAK,EACL;QACE,IAAI,EAAE,UAAU;QAChB,CAAC,EAAE,QAAQ;QACX,CAAC,EAAE,QAAQ;QACX,WA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C;IAC7D,CAAC;IAED,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,sEAAsE;IAE3F,MAAM,KAAK,GAAG;QACZ,oBAAoB;QACpB,6FAA6F;QAC7F,gBAAgB,EAAE,GAAe,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC;QAEzD;;;;;WAKG;QACH,UAAU,CAAC,UAAU,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,IAAI;YAC3C,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YACjC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1B,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IAEF,OAAO;QACL,KAAK;QACL,YAAY;QACZ,IAAI;QACJ,MAAM;QACN,aAAa,EAAE,KAAK;QACpB,KAAK;KACN,CAAC;AACJ,CAAC;AA9ZD,wCA8ZC"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.d.ts
deleted file mode 100644
index 7f099503..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.d.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-import type { Group, GroupConstructor, AffinePoint } from './curve.js';
-import { IField } from './modular.js';
-import { CHash } from './utils.js';
-/**
- * * `DST` is a domain separation tag, defined in section 2.2.5
- * * `p` characteristic of F, where F is a finite field of characteristic p and order q = p^m
- * * `m` is extension degree (1 for prime fields)
- * * `k` is the target security target in bits (e.g. 128), from section 5.1
- * * `expand` is `xmd` (SHA2, SHA3, BLAKE) or `xof` (SHAKE, BLAKE-XOF)
- * * `hash` conforming to `utils.CHash` interface, with `outputLen` / `blockLen` props
- */
-type UnicodeOrBytes = string | Uint8Array;
-export type Opts = {
- DST: UnicodeOrBytes;
- p: bigint;
- m: number;
- k: number;
- expand: 'xmd' | 'xof';
- hash: CHash;
-};
-export declare function expand_message_xmd(msg: Uint8Array, DST: Uint8Array, lenInBytes: number, H: CHash): Uint8Array;
-export declare function expand_message_xof(msg: Uint8Array, DST: Uint8Array, lenInBytes: number, k: number, H: CHash): Uint8Array;
-/**
- * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F
- * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11#section-5.3
- * @param msg a byte string containing the message to hash
- * @param count the number of elements of F to output
- * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above
- * @returns [u_0, ..., u_(count - 1)], a list of field elements.
- */
-export declare function hash_to_field(msg: Uint8Array, count: number, options: Opts): bigint[][];
-export declare function isogenyMap>(field: F, map: [T[], T[], T[], T[]]): (x: T, y: T) => {
- x: T;
- y: T;
-};
-export interface H2CPoint extends Group> {
- add(rhs: H2CPoint): H2CPoint;
- toAffine(iz?: bigint): AffinePoint;
- clearCofactor(): H2CPoint;
- assertValidity(): void;
-}
-export interface H2CPointConstructor extends GroupConstructor> {
- fromAffine(ap: AffinePoint): H2CPoint;
-}
-export type MapToCurve = (scalar: bigint[]) => AffinePoint;
-export type htfBasicOpts = {
- DST: UnicodeOrBytes;
-};
-export declare function createHasher(Point: H2CPointConstructor, mapToCurve: MapToCurve, def: Opts & {
- encodeDST?: UnicodeOrBytes;
-}): {
- hashToCurve(msg: Uint8Array, options?: htfBasicOpts): H2CPoint;
- encodeToCurve(msg: Uint8Array, options?: htfBasicOpts): H2CPoint;
-};
-export {};
-//# sourceMappingURL=hash-to-curve.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map
deleted file mode 100644
index e89ad844..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves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EAAE,CAAC,EAAE,CAAC,OAGzE,CAAC,KAAK,CAAC;;;EAQnB;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrD,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACtC,aAAa,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7B,cAAc,IAAI,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,CAAE,SAAQ,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3E,UAAU,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC;AAIjE,MAAM,MAAM,YAAY,GAAG;IAAE,GAAG,EAAE,cAAc,CAAA;CAAE,CAAC;AAEnD,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC7B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,GAAG,EAAE,IAAI,GAAG;IAAE,SAAS,CAAC,EAAE,cAAc,CAAA;CAAE;qBAMvB,UAAU,YAAY,YAAY;uBAUhC,UAAU,YAAY,YAAY;EAOxD"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.js b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.js
deleted file mode 100644
index 418a80c4..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.js
+++ /dev/null
@@ -1,175 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.createHasher = exports.isogenyMap = exports.hash_to_field = exports.expand_message_xof = exports.expand_message_xmd = void 0;
-const modular_js_1 = require("./modular.js");
-const utils_js_1 = require("./utils.js");
-function validateDST(dst) {
- if (dst instanceof Uint8Array)
- return dst;
- if (typeof dst === 'string')
- return (0, utils_js_1.utf8ToBytes)(dst);
- throw new Error('DST must be Uint8Array or string');
-}
-// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE.
-const os2ip = utils_js_1.bytesToNumberBE;
-// Integer to Octet Stream (numberToBytesBE)
-function i2osp(value, length) {
- if (value < 0 || value >= 1 << (8 * length)) {
- throw new Error(`bad I2OSP call: value=${value} length=${length}`);
- }
- const res = Array.from({ length }).fill(0);
- for (let i = length - 1; i >= 0; i--) {
- res[i] = value & 0xff;
- value >>>= 8;
- }
- return new Uint8Array(res);
-}
-function strxor(a, b) {
- const arr = new Uint8Array(a.length);
- for (let i = 0; i < a.length; i++) {
- arr[i] = a[i] ^ b[i];
- }
- return arr;
-}
-function isBytes(item) {
- if (!(item instanceof Uint8Array))
- throw new Error('Uint8Array expected');
-}
-function isNum(item) {
- if (!Number.isSafeInteger(item))
- throw new Error('number expected');
-}
-// Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits
-// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11#section-5.4.1
-function expand_message_xmd(msg, DST, lenInBytes, H) {
- isBytes(msg);
- isBytes(DST);
- isNum(lenInBytes);
- // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-16#section-5.3.3
- if (DST.length > 255)
- DST = H((0, utils_js_1.concatBytes)((0, utils_js_1.utf8ToBytes)('H2C-OVERSIZE-DST-'), DST));
- const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H;
- const ell = Math.ceil(lenInBytes / b_in_bytes);
- if (ell > 255)
- throw new Error('Invalid xmd length');
- const DST_prime = (0, utils_js_1.concatBytes)(DST, i2osp(DST.length, 1));
- const Z_pad = i2osp(0, r_in_bytes);
- const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str
- const b = new Array(ell);
- const b_0 = H((0, utils_js_1.concatBytes)(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime));
- b[0] = H((0, utils_js_1.concatBytes)(b_0, i2osp(1, 1), DST_prime));
- for (let i = 1; i <= ell; i++) {
- const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime];
- b[i] = H((0, utils_js_1.concatBytes)(...args));
- }
- const pseudo_random_bytes = (0, utils_js_1.concatBytes)(...b);
- return pseudo_random_bytes.slice(0, lenInBytes);
-}
-exports.expand_message_xmd = expand_message_xmd;
-function expand_message_xof(msg, DST, lenInBytes, k, H) {
- isBytes(msg);
- isBytes(DST);
- isNum(lenInBytes);
- // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-16#section-5.3.3
- // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8));
- if (DST.length > 255) {
- const dkLen = Math.ceil((2 * k) / 8);
- DST = H.create({ dkLen }).update((0, utils_js_1.utf8ToBytes)('H2C-OVERSIZE-DST-')).update(DST).digest();
- }
- if (lenInBytes > 65535 || DST.length > 255)
- throw new Error('expand_message_xof: invalid lenInBytes');
- return (H.create({ dkLen: lenInBytes })
- .update(msg)
- .update(i2osp(lenInBytes, 2))
- // 2. DST_prime = DST || I2OSP(len(DST), 1)
- .update(DST)
- .update(i2osp(DST.length, 1))
- .digest());
-}
-exports.expand_message_xof = expand_message_xof;
-/**
- * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F
- * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11#section-5.3
- * @param msg a byte string containing the message to hash
- * @param count the number of elements of F to output
- * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above
- * @returns [u_0, ..., u_(count - 1)], a list of field elements.
- */
-function hash_to_field(msg, count, options) {
- (0, utils_js_1.validateObject)(options, {
- DST: 'string',
- p: 'bigint',
- m: 'isSafeInteger',
- k: 'isSafeInteger',
- hash: 'hash',
- });
- const { p, k, m, hash, expand, DST: _DST } = options;
- isBytes(msg);
- isNum(count);
- const DST = validateDST(_DST);
- const log2p = p.toString(2).length;
- const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above
- const len_in_bytes = count * m * L;
- let prb; // pseudo_random_bytes
- if (expand === 'xmd') {
- prb = expand_message_xmd(msg, DST, len_in_bytes, hash);
- }
- else if (expand === 'xof') {
- prb = expand_message_xof(msg, DST, len_in_bytes, k, hash);
- }
- else if (expand === '_internal_pass') {
- // for internal tests only
- prb = msg;
- }
- else {
- throw new Error('expand must be "xmd" or "xof"');
- }
- const u = new Array(count);
- for (let i = 0; i < count; i++) {
- const e = new Array(m);
- for (let j = 0; j < m; j++) {
- const elm_offset = L * (j + i * m);
- const tv = prb.subarray(elm_offset, elm_offset + L);
- e[j] = (0, modular_js_1.mod)(os2ip(tv), p);
- }
- u[i] = e;
- }
- return u;
-}
-exports.hash_to_field = hash_to_field;
-function isogenyMap(field, map) {
- // Make same order as in spec
- const COEFF = map.map((i) => Array.from(i).reverse());
- return (x, y) => {
- const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
- x = field.div(xNum, xDen); // xNum / xDen
- y = field.mul(y, field.div(yNum, yDen)); // y * (yNum / yDev)
- return { x, y };
- };
-}
-exports.isogenyMap = isogenyMap;
-function createHasher(Point, mapToCurve, def) {
- if (typeof mapToCurve !== 'function')
- throw new Error('mapToCurve() must be defined');
- return {
- // Encodes byte string to elliptic curve
- // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-16#section-3
- hashToCurve(msg, options) {
- const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options });
- const u0 = Point.fromAffine(mapToCurve(u[0]));
- const u1 = Point.fromAffine(mapToCurve(u[1]));
- const P = u0.add(u1).clearCofactor();
- P.assertValidity();
- return P;
- },
- // https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-16#section-3
- encodeToCurve(msg, options) {
- const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options });
- const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor();
- P.assertValidity();
- return P;
- },
- };
-}
-exports.createHasher = createHasher;
-//# sourceMappingURL=hash-to-curve.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.js.map
deleted file mode 100644
index c2fa8bd2..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/hash-to-curve.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"hash-to-curve.js","sourceRoot":"","sources":["../src/abstract/hash-to-curve.ts"],"names":[],"mappings":";;;AAEA,6CAA2C;AAC3C,yCAA8F;AAoB9F,SAAS,WAAW,CAAC,GAAmB;IACtC,IAAI,GAAG,YAAY,UAAU;QAAE,OAAO,GAAG,CAAC;IAC1C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAA,sBAAW,EAAC,GAAG,CAAC,CAAC;IACrD,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACtD,CAAC;AAED,6FAA6F;AAC7F,MAAM,KAAK,GAAG,0BAAe,CAAC;AAE9B,4CAA4C;AAC5C,SAAS,KAAK,CAAC,KAAa,EAAE,MAAc;IAC1C,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,KAAK,WAAW,MAAM,EAAE,CAAC,CAAC;KACpE;IACD,MAAM,GAAG,GAAG,KAAK,CAAC,IA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,EAAE,GAAG,OAAO,EAAU,CAAC,CAAC;YACpF,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;YAC7D,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO,CAAC,CAAC;QACX,CAAC;KACF,CAAC;AACJ,CAAC;AA1BD,oCA0BC"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.d.ts
deleted file mode 100644
index 3acaa1ef..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.d.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-export declare function mod(a: bigint, b: bigint): bigint;
-/**
- * Efficiently raise num to power and do modular division.
- * Unsafe in some contexts: uses ladder, so can expose bigint bits.
- * @example
- * pow(2n, 6n, 11n) // 64n % 11n == 9n
- */
-export declare function pow(num: bigint, power: bigint, modulo: bigint): bigint;
-export declare function pow2(x: bigint, power: bigint, modulo: bigint): bigint;
-export declare function invert(number: bigint, modulo: bigint): bigint;
-export declare function tonelliShanks(P: bigint): (Fp: IField, n: T) => T;
-export declare function FpSqrt(P: bigint): (Fp: IField, n: T) => T;
-export declare const isNegativeLE: (num: bigint, modulo: bigint) => boolean;
-export interface IField {
- ORDER: bigint;
- BYTES: number;
- BITS: number;
- MASK: bigint;
- ZERO: T;
- ONE: T;
- create: (num: T) => T;
- isValid: (num: T) => boolean;
- is0: (num: T) => boolean;
- neg(num: T): T;
- inv(num: T): T;
- sqrt(num: T): T;
- sqr(num: T): T;
- eql(lhs: T, rhs: T): boolean;
- add(lhs: T, rhs: T): T;
- sub(lhs: T, rhs: T): T;
- mul(lhs: T, rhs: T | bigint): T;
- pow(lhs: T, power: bigint): T;
- div(lhs: T, rhs: T | bigint): T;
- addN(lhs: T, rhs: T): T;
- subN(lhs: T, rhs: T): T;
- mulN(lhs: T, rhs: T | bigint): T;
- sqrN(num: T): T;
- isOdd?(num: T): boolean;
- pow(lhs: T, power: bigint): T;
- invertBatch: (lst: T[]) => T[];
- toBytes(num: T): Uint8Array;
- fromBytes(bytes: Uint8Array): T;
- cmov(a: T, b: T, c: boolean): T;
-}
-export declare function validateField(field: IField): IField;
-export declare function FpPow(f: IField, num: T, power: bigint): T;
-export declare function FpInvertBatch(f: IField, nums: T[]): T[];
-export declare function FpDiv(f: IField, lhs: T, rhs: T | bigint): T;
-export declare function FpIsSquare(f: IField): (x: T) => boolean;
-export declare function nLength(n: bigint, nBitLength?: number): {
- nBitLength: number;
- nByteLength: number;
-};
-type FpField = IField & Required, 'isOdd'>>;
-/**
- * Initializes a galois field over prime. Non-primes are not supported for now.
- * Do not init in loop: slow. Very fragile: always run a benchmark on change.
- * Major performance gains:
- * a) non-normalized operations like mulN instead of mul
- * b) `Object.freeze`
- * c) Same object shape: never add or remove keys
- * @param ORDER prime positive bigint
- * @param bitLen how many bits the field consumes
- * @param isLE (def: false) if encoding / decoding should be in little-endian
- * @param redef optional faster redefinitions of sqrt and other methods
- */
-export declare function Field(ORDER: bigint, bitLen?: number, isLE?: boolean, redef?: Partial>): Readonly;
-export declare function FpSqrtOdd(Fp: IField, elm: T): T;
-export declare function FpSqrtEven(Fp: IField, elm: T): T;
-/**
- * FIPS 186 B.4.1-compliant "constant-time" private key generation utility.
- * Can take (n+8) or more bytes of uniform input e.g. from CSPRNG or KDF
- * and convert them into private scalar, with the modulo bias being negligible.
- * Needs at least 40 bytes of input for 32-byte private key.
- * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/
- * @param hash hash output from SHA3 or a similar function
- * @param groupOrder size of subgroup - (e.g. curveFn.CURVE.n)
- * @param isLE interpret hash bytes as LE num
- * @returns valid private scalar
- */
-export declare function hashToPrivateScalar(hash: string | Uint8Array, groupOrder: bigint, isLE?: boolean): bigint;
-export {};
-//# sourceMappingURL=modular.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.d.ts.map
deleted file mode 100644
index 49b9d759..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../src/abstract/modular.ts"],"names":[],"mappings":"AAmBA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhD;AACD;;;;;GAKG;AAEH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAUtE;AAGD,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOrE;AAGD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAsB7D;AAKD,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,iCAsDtC;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,iCA2D/B;AAGD,eAAO,MAAM,YAAY,QAAS,MAAM,UAAU,MAAM,YAAqC,CAAC;AAG9F,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,CAAC,CAAC;IAEP,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IAC7B,GAA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,CAAC,MAAM,CAAC,MAAM,CAAC,CAAM,GAClC,QAAQ,CAAC,OAAO,CAAC,CAkDnB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,KAIjD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,KAIlD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,GAAG,UAAU,EACzB,UAAU,EAAE,MAAM,EAClB,IAAI,UAAQ,GACX,MAAM,CAQR"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.js b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.js
deleted file mode 100644
index 2f338e57..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.js
+++ /dev/null
@@ -1,381 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.hashToPrivateScalar = exports.FpSqrtEven = exports.FpSqrtOdd = exports.Field = exports.nLength = exports.FpIsSquare = exports.FpDiv = exports.FpInvertBatch = exports.FpPow = exports.validateField = exports.isNegativeLE = exports.FpSqrt = exports.tonelliShanks = exports.invert = exports.pow2 = exports.pow = exports.mod = void 0;
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-// Utilities for modular arithmetics and finite fields
-const utils_js_1 = require("./utils.js");
-// prettier-ignore
-const _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);
-// prettier-ignore
-const _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);
-// prettier-ignore
-const _9n = BigInt(9), _16n = BigInt(16);
-// Calculates a modulo b
-function mod(a, b) {
- const result = a % b;
- return result >= _0n ? result : b + result;
-}
-exports.mod = mod;
-/**
- * Efficiently raise num to power and do modular division.
- * Unsafe in some contexts: uses ladder, so can expose bigint bits.
- * @example
- * pow(2n, 6n, 11n) // 64n % 11n == 9n
- */
-// TODO: use field version && remove
-function pow(num, power, modulo) {
- if (modulo <= _0n || power < _0n)
- throw new Error('Expected power/modulo > 0');
- if (modulo === _1n)
- return _0n;
- let res = _1n;
- while (power > _0n) {
- if (power & _1n)
- res = (res * num) % modulo;
- num = (num * num) % modulo;
- power >>= _1n;
- }
- return res;
-}
-exports.pow = pow;
-// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)
-function pow2(x, power, modulo) {
- let res = x;
- while (power-- > _0n) {
- res *= res;
- res %= modulo;
- }
- return res;
-}
-exports.pow2 = pow2;
-// Inverses number over modulo
-function invert(number, modulo) {
- if (number === _0n || modulo <= _0n) {
- throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);
- }
- // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/
- // Fermat's little theorem "CT-like" version inv(n) = n^(m-2) mod m is 30x slower.
- let a = mod(number, modulo);
- let b = modulo;
- // prettier-ignore
- let x = _0n, y = _1n, u = _1n, v = _0n;
- while (a !== _0n) {
- // JIT applies optimization if those two lines follow each other
- const q = b / a;
- const r = b % a;
- const m = x - u * q;
- const n = y - v * q;
- // prettier-ignore
- b = a, a = r, x = u, y = v, u = m, v = n;
- }
- const gcd = b;
- if (gcd !== _1n)
- throw new Error('invert: does not exist');
- return mod(x, modulo);
-}
-exports.invert = invert;
-// Tonelli-Shanks algorithm
-// Paper 1: https://eprint.iacr.org/2012/685.pdf (page 12)
-// Paper 2: Square Roots from 1; 24, 51, 10 to Dan Shanks
-function tonelliShanks(P) {
- // Legendre constant: used to calculate Legendre symbol (a | p),
- // which denotes the value of a^((p-1)/2) (mod p).
- // (a | p) ≡ 1 if a is a square (mod p)
- // (a | p) ≡ -1 if a is not a square (mod p)
- // (a | p) ≡ 0 if a ≡ 0 (mod p)
- const legendreC = (P - _1n) / _2n;
- let Q, S, Z;
- // Step 1: By factoring out powers of 2 from p - 1,
- // find q and s such that p - 1 = q*(2^s) with q odd
- for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++)
- ;
- // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq
- for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++)
- ;
- // Fast-path
- if (S === 1) {
- const p1div4 = (P + _1n) / _4n;
- return function tonelliFast(Fp, n) {
- const root = Fp.pow(n, p1div4);
- if (!Fp.eql(Fp.sqr(root), n))
- throw new Error('Cannot find square root');
- return root;
- };
- }
- // Slow-path
- const Q1div2 = (Q + _1n) / _2n;
- return function tonelliSlow(Fp, n) {
- // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1
- if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))
- throw new Error('Cannot find square root');
- let r = S;
- // TODO: will fail at Fp2/etc
- let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b
- let x = Fp.pow(n, Q1div2); // first guess at the square root
- let b = Fp.pow(n, Q); // first guess at the fudge factor
- while (!Fp.eql(b, Fp.ONE)) {
- if (Fp.eql(b, Fp.ZERO))
- return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0)
- // Find m such b^(2^m)==1
- let m = 1;
- for (let t2 = Fp.sqr(b); m < r; m++) {
- if (Fp.eql(t2, Fp.ONE))
- break;
- t2 = Fp.sqr(t2); // t2 *= t2
- }
- // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow
- const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1)
- g = Fp.sqr(ge); // g = ge * ge
- x = Fp.mul(x, ge); // x *= ge
- b = Fp.mul(b, g); // b *= g
- r = m;
- }
- return x;
- };
-}
-exports.tonelliShanks = tonelliShanks;
-function FpSqrt(P) {
- // NOTE: different algorithms can give different roots, it is up to user to decide which one they want.
- // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).
- // P ≡ 3 (mod 4)
- // √n = n^((P+1)/4)
- if (P % _4n === _3n) {
- // Not all roots possible!
- // const ORDER =
- // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn;
- // const NUM = 72057594037927816n;
- const p1div4 = (P + _1n) / _4n;
- return function sqrt3mod4(Fp, n) {
- const root = Fp.pow(n, p1div4);
- // Throw if root**2 != n
- if (!Fp.eql(Fp.sqr(root), n))
- throw new Error('Cannot find square root');
- return root;
- };
- }
- // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10)
- if (P % _8n === _5n) {
- const c1 = (P - _5n) / _8n;
- return function sqrt5mod8(Fp, n) {
- const n2 = Fp.mul(n, _2n);
- const v = Fp.pow(n2, c1);
- const nv = Fp.mul(n, v);
- const i = Fp.mul(Fp.mul(nv, _2n), v);
- const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));
- if (!Fp.eql(Fp.sqr(root), n))
- throw new Error('Cannot find square root');
- return root;
- };
- }
- // P ≡ 9 (mod 16)
- if (P % _16n === _9n) {
- // NOTE: tonelli is too slow for bls-Fp2 calculations even on start
- // Means we cannot use sqrt for constants at all!
- //
- // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F
- // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F
- // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F
- // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic
- // sqrt = (x) => {
- // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4
- // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1
- // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1
- // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1
- // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x
- // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x
- // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x
- // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x
- // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x
- // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2
- // }
- }
- // Other cases: Tonelli-Shanks algorithm
- return tonelliShanks(P);
-}
-exports.FpSqrt = FpSqrt;
-// Little-endian check for first LE bit (last BE bit);
-const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;
-exports.isNegativeLE = isNegativeLE;
-// prettier-ignore
-const FIELD_FIELDS = [
- 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',
- 'eql', 'add', 'sub', 'mul', 'pow', 'div',
- 'addN', 'subN', 'mulN', 'sqrN'
-];
-function validateField(field) {
- const initial = {
- ORDER: 'bigint',
- MASK: 'bigint',
- BYTES: 'isSafeInteger',
- BITS: 'isSafeInteger',
- };
- const opts = FIELD_FIELDS.reduce((map, val) => {
- map[val] = 'function';
- return map;
- }, initial);
- return (0, utils_js_1.validateObject)(field, opts);
-}
-exports.validateField = validateField;
-// Generic field functions
-function FpPow(f, num, power) {
- // Should have same speed as pow for bigints
- // TODO: benchmark!
- if (power < _0n)
- throw new Error('Expected power > 0');
- if (power === _0n)
- return f.ONE;
- if (power === _1n)
- return num;
- let p = f.ONE;
- let d = num;
- while (power > _0n) {
- if (power & _1n)
- p = f.mul(p, d);
- d = f.sqr(d);
- power >>= _1n;
- }
- return p;
-}
-exports.FpPow = FpPow;
-// 0 is non-invertible: non-batched version will throw on 0
-function FpInvertBatch(f, nums) {
- const tmp = new Array(nums.length);
- // Walk from first to last, multiply them by each other MOD p
- const lastMultiplied = nums.reduce((acc, num, i) => {
- if (f.is0(num))
- return acc;
- tmp[i] = acc;
- return f.mul(acc, num);
- }, f.ONE);
- // Invert last element
- const inverted = f.inv(lastMultiplied);
- // Walk from last to first, multiply them by inverted each other MOD p
- nums.reduceRight((acc, num, i) => {
- if (f.is0(num))
- return acc;
- tmp[i] = f.mul(acc, tmp[i]);
- return f.mul(acc, num);
- }, inverted);
- return tmp;
-}
-exports.FpInvertBatch = FpInvertBatch;
-function FpDiv(f, lhs, rhs) {
- return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs));
-}
-exports.FpDiv = FpDiv;
-// This function returns True whenever the value x is a square in the field F.
-function FpIsSquare(f) {
- const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic
- return (x) => {
- const p = f.pow(x, legendreConst);
- return f.eql(p, f.ZERO) || f.eql(p, f.ONE);
- };
-}
-exports.FpIsSquare = FpIsSquare;
-// CURVE.n lengths
-function nLength(n, nBitLength) {
- // Bit size, byte size of CURVE.n
- const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;
- const nByteLength = Math.ceil(_nBitLength / 8);
- return { nBitLength: _nBitLength, nByteLength };
-}
-exports.nLength = nLength;
-/**
- * Initializes a galois field over prime. Non-primes are not supported for now.
- * Do not init in loop: slow. Very fragile: always run a benchmark on change.
- * Major performance gains:
- * a) non-normalized operations like mulN instead of mul
- * b) `Object.freeze`
- * c) Same object shape: never add or remove keys
- * @param ORDER prime positive bigint
- * @param bitLen how many bits the field consumes
- * @param isLE (def: false) if encoding / decoding should be in little-endian
- * @param redef optional faster redefinitions of sqrt and other methods
- */
-function Field(ORDER, bitLen, isLE = false, redef = {}) {
- if (ORDER <= _0n)
- throw new Error(`Expected Fp ORDER > 0, got ${ORDER}`);
- const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);
- if (BYTES > 2048)
- throw new Error('Field lengths over 2048 bytes are not supported');
- const sqrtP = FpSqrt(ORDER);
- const f = Object.freeze({
- ORDER,
- BITS,
- BYTES,
- MASK: (0, utils_js_1.bitMask)(BITS),
- ZERO: _0n,
- ONE: _1n,
- create: (num) => mod(num, ORDER),
- isValid: (num) => {
- if (typeof num !== 'bigint')
- throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);
- return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible
- },
- is0: (num) => num === _0n,
- isOdd: (num) => (num & _1n) === _1n,
- neg: (num) => mod(-num, ORDER),
- eql: (lhs, rhs) => lhs === rhs,
- sqr: (num) => mod(num * num, ORDER),
- add: (lhs, rhs) => mod(lhs + rhs, ORDER),
- sub: (lhs, rhs) => mod(lhs - rhs, ORDER),
- mul: (lhs, rhs) => mod(lhs * rhs, ORDER),
- pow: (num, power) => FpPow(f, num, power),
- div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),
- // Same as above, but doesn't normalize
- sqrN: (num) => num * num,
- addN: (lhs, rhs) => lhs + rhs,
- subN: (lhs, rhs) => lhs - rhs,
- mulN: (lhs, rhs) => lhs * rhs,
- inv: (num) => invert(num, ORDER),
- sqrt: redef.sqrt || ((n) => sqrtP(f, n)),
- invertBatch: (lst) => FpInvertBatch(f, lst),
- // TODO: do we really need constant cmov?
- // We don't have const-time bigints anyway, so probably will be not very useful
- cmov: (a, b, c) => (c ? b : a),
- toBytes: (num) => (isLE ? (0, utils_js_1.numberToBytesLE)(num, BYTES) : (0, utils_js_1.numberToBytesBE)(num, BYTES)),
- fromBytes: (bytes) => {
- if (bytes.length !== BYTES)
- throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);
- return isLE ? (0, utils_js_1.bytesToNumberLE)(bytes) : (0, utils_js_1.bytesToNumberBE)(bytes);
- },
- });
- return Object.freeze(f);
-}
-exports.Field = Field;
-function FpSqrtOdd(Fp, elm) {
- if (!Fp.isOdd)
- throw new Error(`Field doesn't have isOdd`);
- const root = Fp.sqrt(elm);
- return Fp.isOdd(root) ? root : Fp.neg(root);
-}
-exports.FpSqrtOdd = FpSqrtOdd;
-function FpSqrtEven(Fp, elm) {
- if (!Fp.isOdd)
- throw new Error(`Field doesn't have isOdd`);
- const root = Fp.sqrt(elm);
- return Fp.isOdd(root) ? Fp.neg(root) : root;
-}
-exports.FpSqrtEven = FpSqrtEven;
-/**
- * FIPS 186 B.4.1-compliant "constant-time" private key generation utility.
- * Can take (n+8) or more bytes of uniform input e.g. from CSPRNG or KDF
- * and convert them into private scalar, with the modulo bias being negligible.
- * Needs at least 40 bytes of input for 32-byte private key.
- * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/
- * @param hash hash output from SHA3 or a similar function
- * @param groupOrder size of subgroup - (e.g. curveFn.CURVE.n)
- * @param isLE interpret hash bytes as LE num
- * @returns valid private scalar
- */
-function hashToPrivateScalar(hash, groupOrder, isLE = false) {
- hash = (0, utils_js_1.ensureBytes)('privateHash', hash);
- const hashLen = hash.length;
- const minLen = nLength(groupOrder).nByteLength + 8;
- if (minLen < 24 || hashLen < minLen || hashLen > 1024)
- throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);
- const num = isLE ? (0, utils_js_1.bytesToNumberLE)(hash) : (0, utils_js_1.bytesToNumberBE)(hash);
- return mod(num, groupOrder - _1n) + _1n;
-}
-exports.hashToPrivateScalar = hashToPrivateScalar;
-//# sourceMappingURL=modular.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.js.map
deleted file mode 100644
index 9938a175..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/modular.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"modular.js","sourceRoot":"","sources":["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EAAE,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAJD,gCAIC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,mBAAmB,CACjC,IAAyB,EACzB,UAAkB,EAClB,IAAI,GAAG,KAAK;IAEZ,IAAI,GAAG,IAAA,sBAAW,EAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5B,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC;IACnD,IAAI,MAAM,GAAG,EAAE,IAAI,OAAO,GAAG,MAAM,IAAI,OAAO,GAAG,IAAI;QACnD,MAAM,IAAI,KAAK,CAAC,iCAAiC,MAAM,6BAA6B,OAAO,EAAE,CAAC,CAAC;IACjG,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAA,0BAAe,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAe,EAAC,IAAI,CAAC,CAAC;IACjE,OAAO,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AAC1C,CAAC;AAZD,kDAYC"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.d.ts
deleted file mode 100644
index 69e2bc45..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.d.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-type Hex = string | Uint8Array;
-export type CurveType = {
- P: bigint;
- nByteLength: number;
- adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array;
- domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array;
- a: bigint;
- montgomeryBits: number;
- powPminus2?: (x: bigint) => bigint;
- xyToU?: (x: bigint, y: bigint) => bigint;
- Gu: bigint;
- randomBytes?: (bytesLength?: number) => Uint8Array;
-};
-export type CurveFn = {
- scalarMult: (scalar: Hex, u: Hex) => Uint8Array;
- scalarMultBase: (scalar: Hex) => Uint8Array;
- getSharedSecret: (privateKeyA: Hex, publicKeyB: Hex) => Uint8Array;
- getPublicKey: (privateKey: Hex) => Uint8Array;
- utils: {
- randomPrivateKey: () => Uint8Array;
- };
- GuBytes: Uint8Array;
-};
-export declare function montgomery(curveDef: CurveType): CurveFn;
-export {};
-//# sourceMappingURL=montgomery.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.d.ts.map
deleted file mode 100644
index a0d1c0b9..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"montgomery.d.ts","sourceRoot":"","sources":["../src/abstract/montgomery.ts"],"names":[],"mappings":"AAMA,KAAK,GAAG,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/B,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,CAAC;IACtD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,KAAK,UAAU,CAAC;IAC5E,CAAC,EAAE,MAAM,CAAC;IACV,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;CACpD,CAAC;AACF,MAAM,MAAM,OAAO,GAAG;IACpB,UAAU,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,UAAU,CAAC;IAChD,cAAc,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,UAAU,CAAC;IAC5C,eAAe,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,KAAK,UAAU,CAAC;IACnE,YAAY,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,UAAU,CAAC;IAC9C,KAAK,EAAE;QAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;KAAE,CAAC;IAC9C,OAAO,EAAE,UAAU,CAAC;CACrB,CAAC;AAuBF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CA0IvD"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.js b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.js
deleted file mode 100644
index b43e43b5..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.js
+++ /dev/null
@@ -1,161 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.montgomery = void 0;
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-const modular_js_1 = require("./modular.js");
-const utils_js_1 = require("./utils.js");
-const _0n = BigInt(0);
-const _1n = BigInt(1);
-function validateOpts(curve) {
- (0, utils_js_1.validateObject)(curve, {
- a: 'bigint',
- }, {
- montgomeryBits: 'isSafeInteger',
- nByteLength: 'isSafeInteger',
- adjustScalarBytes: 'function',
- domain: 'function',
- powPminus2: 'function',
- Gu: 'bigint',
- });
- // Set defaults
- return Object.freeze({ ...curve });
-}
-// NOTE: not really montgomery curve, just bunch of very specific methods for X25519/X448 (RFC 7748, https://www.rfc-editor.org/rfc/rfc7748)
-// Uses only one coordinate instead of two
-function montgomery(curveDef) {
- const CURVE = validateOpts(curveDef);
- const { P } = CURVE;
- const modP = (n) => (0, modular_js_1.mod)(n, P);
- const montgomeryBits = CURVE.montgomeryBits;
- const montgomeryBytes = Math.ceil(montgomeryBits / 8);
- const fieldLen = CURVE.nByteLength;
- const adjustScalarBytes = CURVE.adjustScalarBytes || ((bytes) => bytes);
- const powPminus2 = CURVE.powPminus2 || ((x) => (0, modular_js_1.pow)(x, P - BigInt(2), P));
- // cswap from RFC7748. But it is not from RFC7748!
- /*
- cswap(swap, x_2, x_3):
- dummy = mask(swap) AND (x_2 XOR x_3)
- x_2 = x_2 XOR dummy
- x_3 = x_3 XOR dummy
- Return (x_2, x_3)
- Where mask(swap) is the all-1 or all-0 word of the same length as x_2
- and x_3, computed, e.g., as mask(swap) = 0 - swap.
- */
- function cswap(swap, x_2, x_3) {
- const dummy = modP(swap * (x_2 - x_3));
- x_2 = modP(x_2 - dummy);
- x_3 = modP(x_3 + dummy);
- return [x_2, x_3];
- }
- // Accepts 0 as well
- function assertFieldElement(n) {
- if (typeof n === 'bigint' && _0n <= n && n < P)
- return n;
- throw new Error('Expected valid scalar 0 < scalar < CURVE.P');
- }
- // x25519 from 4
- // The constant a24 is (486662 - 2) / 4 = 121665 for curve25519/X25519
- const a24 = (CURVE.a - BigInt(2)) / BigInt(4);
- /**
- *
- * @param pointU u coordinate (x) on Montgomery Curve 25519
- * @param scalar by which the point would be multiplied
- * @returns new Point on Montgomery curve
- */
- function montgomeryLadder(pointU, scalar) {
- const u = assertFieldElement(pointU);
- // Section 5: Implementations MUST accept non-canonical values and process them as
- // if they had been reduced modulo the field prime.
- const k = assertFieldElement(scalar);
- const x_1 = u;
- let x_2 = _1n;
- let z_2 = _0n;
- let x_3 = u;
- let z_3 = _1n;
- let swap = _0n;
- let sw;
- for (let t = BigInt(montgomeryBits - 1); t >= _0n; t--) {
- const k_t = (k >> t) & _1n;
- swap ^= k_t;
- sw = cswap(swap, x_2, x_3);
- x_2 = sw[0];
- x_3 = sw[1];
- sw = cswap(swap, z_2, z_3);
- z_2 = sw[0];
- z_3 = sw[1];
- swap = k_t;
- const A = x_2 + z_2;
- const AA = modP(A * A);
- const B = x_2 - z_2;
- const BB = modP(B * B);
- const E = AA - BB;
- const C = x_3 + z_3;
- const D = x_3 - z_3;
- const DA = modP(D * A);
- const CB = modP(C * B);
- const dacb = DA + CB;
- const da_cb = DA - CB;
- x_3 = modP(dacb * dacb);
- z_3 = modP(x_1 * modP(da_cb * da_cb));
- x_2 = modP(AA * BB);
- z_2 = modP(E * (AA + modP(a24 * E)));
- }
- // (x_2, x_3) = cswap(swap, x_2, x_3)
- sw = cswap(swap, x_2, x_3);
- x_2 = sw[0];
- x_3 = sw[1];
- // (z_2, z_3) = cswap(swap, z_2, z_3)
- sw = cswap(swap, z_2, z_3);
- z_2 = sw[0];
- z_3 = sw[1];
- // z_2^(p - 2)
- const z2 = powPminus2(z_2);
- // Return x_2 * (z_2^(p - 2))
- return modP(x_2 * z2);
- }
- function encodeUCoordinate(u) {
- return (0, utils_js_1.numberToBytesLE)(modP(u), montgomeryBytes);
- }
- function decodeUCoordinate(uEnc) {
- // Section 5: When receiving such an array, implementations of X25519
- // MUST mask the most significant bit in the final byte.
- // This is very ugly way, but it works because fieldLen-1 is outside of bounds for X448, so this becomes NOOP
- // fieldLen - scalaryBytes = 1 for X448 and = 0 for X25519
- const u = (0, utils_js_1.ensureBytes)('u coordinate', uEnc, montgomeryBytes);
- // u[fieldLen-1] crashes QuickJS (TypeError: out-of-bound numeric index)
- if (fieldLen === montgomeryBytes)
- u[fieldLen - 1] &= 127; // 0b0111_1111
- return (0, utils_js_1.bytesToNumberLE)(u);
- }
- function decodeScalar(n) {
- const bytes = (0, utils_js_1.ensureBytes)('scalar', n);
- if (bytes.length !== montgomeryBytes && bytes.length !== fieldLen)
- throw new Error(`Expected ${montgomeryBytes} or ${fieldLen} bytes, got ${bytes.length}`);
- return (0, utils_js_1.bytesToNumberLE)(adjustScalarBytes(bytes));
- }
- function scalarMult(scalar, u) {
- const pointU = decodeUCoordinate(u);
- const _scalar = decodeScalar(scalar);
- const pu = montgomeryLadder(pointU, _scalar);
- // The result was not contributory
- // https://cr.yp.to/ecdh.html#validate
- if (pu === _0n)
- throw new Error('Invalid private or public key received');
- return encodeUCoordinate(pu);
- }
- // Computes public key from private. By doing scalar multiplication of base point.
- const GuBytes = encodeUCoordinate(CURVE.Gu);
- function scalarMultBase(scalar) {
- return scalarMult(scalar, GuBytes);
- }
- return {
- scalarMult,
- scalarMultBase,
- getSharedSecret: (privateKey, publicKey) => scalarMult(privateKey, publicKey),
- getPublicKey: (privateKey) => scalarMultBase(privateKey),
- utils: { randomPrivateKey: () => CURVE.randomBytes(CURVE.nByteLength) },
- GuBytes: GuBytes,
- };
-}
-exports.montgomery = montgomery;
-//# sourceMappingURL=montgomery.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.js.map
deleted file mode 100644
index 1aa0c9eb..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/montgomery.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"montgomery.js","sourceRoot":"","sources":["../src/abstract/montgomery.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,6CAAwC;AACxC,yCAA2F;AAE3F,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAwBtB,SAAS,YAAY,CAAC,KAAgB;IACpC,IAAA,yBAAc,E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IAAI,KAAK,CAAC,YAAY,eAAe,OAAO,QAAQ,eAAe,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3F,OAAO,IAAA,0BAAe,EAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;IACD,SAAS,UAAU,CAAC,MAAW,EAAE,CAAM;QACrC,MAAM,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7C,kCAAkC;QAClC,sCAAsC;QACtC,IAAI,EAAE,KAAK,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC1E,OAAO,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,kFAAkF;IAClF,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5C,SAAS,cAAc,CAAC,MAAW;QACjC,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,OAAO;QACL,UAAU;QACV,cAAc;QACd,eAAe,EAAE,CAAC,UAAe,EAAE,SAAc,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC;QACvF,YAAY,EAAE,CAAC,UAAe,EAAc,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC;QACzE,KAAK,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAY,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;QACxE,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC;AA1ID,gCA0IC"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.d.ts
deleted file mode 100644
index 2f9ab819..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.d.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-import { IField } from './modular.js';
-export type PoseidonOpts = {
- Fp: IField;
- t: number;
- roundsFull: number;
- roundsPartial: number;
- sboxPower?: number;
- reversePartialPowIdx?: boolean;
- mds: bigint[][];
- roundConstants: bigint[][];
-};
-export declare function validateOpts(opts: PoseidonOpts): Readonly<{
- rounds: number;
- sboxFn: (n: bigint) => bigint;
- roundConstants: bigint[][];
- mds: bigint[][];
- Fp: IField;
- t: number;
- roundsFull: number;
- roundsPartial: number;
- sboxPower?: number | undefined;
- reversePartialPowIdx?: boolean | undefined;
-}>;
-export declare function splitConstants(rc: bigint[], t: number): bigint[][];
-export declare function poseidon(opts: PoseidonOpts): {
- (values: bigint[]): bigint[];
- roundConstants: bigint[][];
-};
-//# sourceMappingURL=poseidon.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.d.ts.map
deleted file mode 100644
index 7107b83f..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../src/abstract/poseidon.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EAAE,MAAM,EAAwB,MAAM,cAAc,CAAC;AAG5D,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,EAAE,CAAC;CAC5B,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY;;gBAgB5B,MAAM;;;;;;;;;GAgCxB;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,cAarD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY;aAeU,MAAM,EAAE;;EAsB5D"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.js b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.js
deleted file mode 100644
index fc66916f..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.js
+++ /dev/null
@@ -1,116 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.poseidon = exports.splitConstants = exports.validateOpts = void 0;
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-// Poseidon Hash: https://eprint.iacr.org/2019/458.pdf, https://www.poseidon-hash.info
-const modular_js_1 = require("./modular.js");
-function validateOpts(opts) {
- const { Fp } = opts;
- (0, modular_js_1.validateField)(Fp);
- for (const i of ['t', 'roundsFull', 'roundsPartial']) {
- if (typeof opts[i] !== 'number' || !Number.isSafeInteger(opts[i]))
- throw new Error(`Poseidon: invalid param ${i}=${opts[i]} (${typeof opts[i]})`);
- }
- if (opts.reversePartialPowIdx !== undefined && typeof opts.reversePartialPowIdx !== 'boolean')
- throw new Error(`Poseidon: invalid param reversePartialPowIdx=${opts.reversePartialPowIdx}`);
- // Default is 5, but by some reasons stark uses 3
- let sboxPower = opts.sboxPower;
- if (sboxPower === undefined)
- sboxPower = 5;
- if (typeof sboxPower !== 'number' || !Number.isSafeInteger(sboxPower))
- throw new Error(`Poseidon wrong sboxPower=${sboxPower}`);
- const _sboxPower = BigInt(sboxPower);
- let sboxFn = (n) => (0, modular_js_1.FpPow)(Fp, n, _sboxPower);
- // Unwrapped sbox power for common cases (195->142μs)
- if (sboxPower === 3)
- sboxFn = (n) => Fp.mul(Fp.sqrN(n), n);
- else if (sboxPower === 5)
- sboxFn = (n) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n);
- if (opts.roundsFull % 2 !== 0)
- throw new Error(`Poseidon roundsFull is not even: ${opts.roundsFull}`);
- const rounds = opts.roundsFull + opts.roundsPartial;
- if (!Array.isArray(opts.roundConstants) || opts.roundConstants.length !== rounds)
- throw new Error('Poseidon: wrong round constants');
- const roundConstants = opts.roundConstants.map((rc) => {
- if (!Array.isArray(rc) || rc.length !== opts.t)
- throw new Error(`Poseidon wrong round constants: ${rc}`);
- return rc.map((i) => {
- if (typeof i !== 'bigint' || !Fp.isValid(i))
- throw new Error(`Poseidon wrong round constant=${i}`);
- return Fp.create(i);
- });
- });
- // MDS is TxT matrix
- if (!Array.isArray(opts.mds) || opts.mds.length !== opts.t)
- throw new Error('Poseidon: wrong MDS matrix');
- const mds = opts.mds.map((mdsRow) => {
- if (!Array.isArray(mdsRow) || mdsRow.length !== opts.t)
- throw new Error(`Poseidon MDS matrix row: ${mdsRow}`);
- return mdsRow.map((i) => {
- if (typeof i !== 'bigint')
- throw new Error(`Poseidon MDS matrix value=${i}`);
- return Fp.create(i);
- });
- });
- return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds });
-}
-exports.validateOpts = validateOpts;
-function splitConstants(rc, t) {
- if (typeof t !== 'number')
- throw new Error('poseidonSplitConstants: wrong t');
- if (!Array.isArray(rc) || rc.length % t)
- throw new Error('poseidonSplitConstants: wrong rc');
- const res = [];
- let tmp = [];
- for (let i = 0; i < rc.length; i++) {
- tmp.push(rc[i]);
- if (tmp.length === t) {
- res.push(tmp);
- tmp = [];
- }
- }
- return res;
-}
-exports.splitConstants = splitConstants;
-function poseidon(opts) {
- const { t, Fp, rounds, sboxFn, reversePartialPowIdx } = validateOpts(opts);
- const halfRoundsFull = Math.floor(opts.roundsFull / 2);
- const partialIdx = reversePartialPowIdx ? t - 1 : 0;
- const poseidonRound = (values, isFull, idx) => {
- values = values.map((i, j) => Fp.add(i, opts.roundConstants[idx][j]));
- if (isFull)
- values = values.map((i) => sboxFn(i));
- else
- values[partialIdx] = sboxFn(values[partialIdx]);
- // Matrix multiplication
- values = opts.mds.map((i) => i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO));
- return values;
- };
- const poseidonHash = function poseidonHash(values) {
- if (!Array.isArray(values) || values.length !== t)
- throw new Error(`Poseidon: wrong values (expected array of bigints with length ${t})`);
- values = values.map((i) => {
- if (typeof i !== 'bigint')
- throw new Error(`Poseidon: wrong value=${i} (${typeof i})`);
- return Fp.create(i);
- });
- let round = 0;
- // Apply r_f/2 full rounds.
- for (let i = 0; i < halfRoundsFull; i++)
- values = poseidonRound(values, true, round++);
- // Apply r_p partial rounds.
- for (let i = 0; i < opts.roundsPartial; i++)
- values = poseidonRound(values, false, round++);
- // Apply r_f/2 full rounds.
- for (let i = 0; i < halfRoundsFull; i++)
- values = poseidonRound(values, true, round++);
- if (round !== rounds)
- throw new Error(`Poseidon: wrong number of rounds: last round=${round}, total=${rounds}`);
- return values;
- };
- // For verification in tests
- poseidonHash.roundConstants = opts.roundConstants;
- return poseidonHash;
-}
-exports.poseidon = poseidon;
-//# sourceMappingURL=poseidon.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.js.map
deleted file mode 100644
index 422866db..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/poseidon.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"poseidon.js","sourceRoot":"","sources":["../src/abstract/poseidon.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,sFAAsF;AACtF,6CAA4D;AAc5D,SAAgB,YAAY,CAAC,IAA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C,gDAAgD,KAAK,WAAW,MAAM,EAAE,CAAC,CAAC;QAC5F,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IACF,4BAA4B;IAC5B,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAClD,OAAO,YAAY,CAAC;AACtB,CAAC;AArCD,4BAqCC"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.d.ts
deleted file mode 100644
index 2842612e..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.d.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-export type Hex = Uint8Array | string;
-export type PrivKey = Hex | bigint;
-export type CHash = {
- (message: Uint8Array | string): Uint8Array;
- blockLen: number;
- outputLen: number;
- create(opts?: {
- dkLen?: number;
- }): any;
-};
-export type FHash = (message: Uint8Array | string) => Uint8Array;
-/**
- * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
- */
-export declare function bytesToHex(bytes: Uint8Array): string;
-export declare function numberToHexUnpadded(num: number | bigint): string;
-export declare function hexToNumber(hex: string): bigint;
-/**
- * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
- */
-export declare function hexToBytes(hex: string): Uint8Array;
-export declare function bytesToNumberBE(bytes: Uint8Array): bigint;
-export declare function bytesToNumberLE(bytes: Uint8Array): bigint;
-export declare function numberToBytesBE(n: number | bigint, len: number): Uint8Array;
-export declare function numberToBytesLE(n: number | bigint, len: number): Uint8Array;
-export declare function numberToVarBytesBE(n: number | bigint): Uint8Array;
-/**
- * Takes hex string or Uint8Array, converts to Uint8Array.
- * Validates output length.
- * Will throw error for other types.
- * @param title descriptive title for an error e.g. 'private key'
- * @param hex hex string or Uint8Array
- * @param expectedLength optional, will compare to result array's length
- * @returns
- */
-export declare function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array;
-/**
- * Copies several Uint8Arrays into one.
- */
-export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array;
-export declare function equalBytes(b1: Uint8Array, b2: Uint8Array): boolean;
-/**
- * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])
- */
-export declare function utf8ToBytes(str: string): Uint8Array;
-/**
- * Calculates amount of bits in a bigint.
- * Same as `n.toString(2).length`
- */
-export declare function bitLen(n: bigint): number;
-/**
- * Gets single bit at position.
- * NOTE: first bit position is 0 (same as arrays)
- * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`
- */
-export declare function bitGet(n: bigint, pos: number): bigint;
-/**
- * Sets single bit at position.
- */
-export declare const bitSet: (n: bigint, pos: number, value: boolean) => bigint;
-/**
- * Calculate mask for N bits. Not using ** operator with bigints because of old engines.
- * Same as BigInt(`0b${Array(i).fill('1').join('')}`)
- */
-export declare const bitMask: (n: number) => bigint;
-type Pred = (v: Uint8Array) => T | undefined;
-/**
- * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.
- * @returns function that will call DRBG until 2nd arg returns something meaningful
- * @example
- * const drbg = createHmacDRBG(32, 32, hmac);
- * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined
- */
-export declare function createHmacDrbg(hashLen: number, qByteLen: number, hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array): (seed: Uint8Array, predicate: Pred) => T;
-declare const validatorFns: {
- readonly bigint: (val: any) => boolean;
- readonly function: (val: any) => boolean;
- readonly boolean: (val: any) => boolean;
- readonly string: (val: any) => boolean;
- readonly isSafeInteger: (val: any) => boolean;
- readonly array: (val: any) => boolean;
- readonly field: (val: any, object: any) => any;
- readonly hash: (val: any) => boolean;
-};
-type Validator = keyof typeof validatorFns;
-type ValMap> = {
- [K in keyof T]?: Validator;
-};
-export declare function validateObject>(object: T, validators: ValMap, optValidators?: ValMap): T;
-export {};
-//# sourceMappingURL=utils.d.ts.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.d.ts.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.d.ts.map
deleted file mode 100644
index 706d6513..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/abstract/utils.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,GAAG,CAAC;CACxC,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,KAAK,UAAU,CAAC;AAGjE;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAQpD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAGhE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAalD;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEzD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGzD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAE3E;AACD,wBAAgB,eAAe,CA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AAG;6BACD,GAAG;4BACJ,GAAG;2BACJ,GAAG;kCACI,GAAG;0BACX,GAAG;0BACH,GAAG,UAAU,GAAG;yBACjB,GAAG;CACP,CAAC;AACX,KAAK,SAAS,GAAG,MAAM,OAAO,YAAY,CAAC;AAC3C,KAAK,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS;CAAE,CAAC;AAG5E,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1D,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,EACrB,aAAa,GAAE,MAAM,CAAC,CAAC,CAAM,KAkB9B"}
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.js b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.js
deleted file mode 100644
index 60774c4b..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.js
+++ /dev/null
@@ -1,287 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.validateObject = exports.createHmacDrbg = exports.bitMask = exports.bitSet = exports.bitGet = exports.bitLen = exports.utf8ToBytes = exports.equalBytes = exports.concatBytes = exports.ensureBytes = exports.numberToVarBytesBE = exports.numberToBytesLE = exports.numberToBytesBE = exports.bytesToNumberLE = exports.bytesToNumberBE = exports.hexToBytes = exports.hexToNumber = exports.numberToHexUnpadded = exports.bytesToHex = void 0;
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-// 100 lines of code in the file are duplicated from noble-hashes (utils).
-// This is OK: `abstract` directory does not use noble-hashes.
-// User may opt-in into using different hashing library. This way, noble-hashes
-// won't be included into their bundle.
-const _0n = BigInt(0);
-const _1n = BigInt(1);
-const _2n = BigInt(2);
-const u8a = (a) => a instanceof Uint8Array;
-const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));
-/**
- * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
- */
-function bytesToHex(bytes) {
- if (!u8a(bytes))
- throw new Error('Uint8Array expected');
- // pre-caching improves the speed 6x
- let hex = '';
- for (let i = 0; i < bytes.length; i++) {
- hex += hexes[bytes[i]];
- }
- return hex;
-}
-exports.bytesToHex = bytesToHex;
-function numberToHexUnpadded(num) {
- const hex = num.toString(16);
- return hex.length & 1 ? `0${hex}` : hex;
-}
-exports.numberToHexUnpadded = numberToHexUnpadded;
-function hexToNumber(hex) {
- if (typeof hex !== 'string')
- throw new Error('hex string expected, got ' + typeof hex);
- // Big Endian
- return BigInt(hex === '' ? '0' : `0x${hex}`);
-}
-exports.hexToNumber = hexToNumber;
-/**
- * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
- */
-function hexToBytes(hex) {
- if (typeof hex !== 'string')
- throw new Error('hex string expected, got ' + typeof hex);
- const len = hex.length;
- if (len % 2)
- throw new Error('padded hex string expected, got unpadded hex of length ' + len);
- const array = new Uint8Array(len / 2);
- for (let i = 0; i < array.length; i++) {
- const j = i * 2;
- const hexByte = hex.slice(j, j + 2);
- const byte = Number.parseInt(hexByte, 16);
- if (Number.isNaN(byte) || byte < 0)
- throw new Error('Invalid byte sequence');
- array[i] = byte;
- }
- return array;
-}
-exports.hexToBytes = hexToBytes;
-// BE: Big Endian, LE: Little Endian
-function bytesToNumberBE(bytes) {
- return hexToNumber(bytesToHex(bytes));
-}
-exports.bytesToNumberBE = bytesToNumberBE;
-function bytesToNumberLE(bytes) {
- if (!u8a(bytes))
- throw new Error('Uint8Array expected');
- return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));
-}
-exports.bytesToNumberLE = bytesToNumberLE;
-function numberToBytesBE(n, len) {
- return hexToBytes(n.toString(16).padStart(len * 2, '0'));
-}
-exports.numberToBytesBE = numberToBytesBE;
-function numberToBytesLE(n, len) {
- return numberToBytesBE(n, len).reverse();
-}
-exports.numberToBytesLE = numberToBytesLE;
-// Unpadded, rarely used
-function numberToVarBytesBE(n) {
- return hexToBytes(numberToHexUnpadded(n));
-}
-exports.numberToVarBytesBE = numberToVarBytesBE;
-/**
- * Takes hex string or Uint8Array, converts to Uint8Array.
- * Validates output length.
- * Will throw error for other types.
- * @param title descriptive title for an error e.g. 'private key'
- * @param hex hex string or Uint8Array
- * @param expectedLength optional, will compare to result array's length
- * @returns
- */
-function ensureBytes(title, hex, expectedLength) {
- let res;
- if (typeof hex === 'string') {
- try {
- res = hexToBytes(hex);
- }
- catch (e) {
- throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`);
- }
- }
- else if (u8a(hex)) {
- // Uint8Array.from() instead of hash.slice() because node.js Buffer
- // is instance of Uint8Array, and its slice() creates **mutable** copy
- res = Uint8Array.from(hex);
- }
- else {
- throw new Error(`${title} must be hex string or Uint8Array`);
- }
- const len = res.length;
- if (typeof expectedLength === 'number' && len !== expectedLength)
- throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);
- return res;
-}
-exports.ensureBytes = ensureBytes;
-/**
- * Copies several Uint8Arrays into one.
- */
-function concatBytes(...arrays) {
- const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));
- let pad = 0; // walk through each item, ensure they have proper type
- arrays.forEach((a) => {
- if (!u8a(a))
- throw new Error('Uint8Array expected');
- r.set(a, pad);
- pad += a.length;
- });
- return r;
-}
-exports.concatBytes = concatBytes;
-function equalBytes(b1, b2) {
- // We don't care about timing attacks here
- if (b1.length !== b2.length)
- return false;
- for (let i = 0; i < b1.length; i++)
- if (b1[i] !== b2[i])
- return false;
- return true;
-}
-exports.equalBytes = equalBytes;
-/**
- * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])
- */
-function utf8ToBytes(str) {
- if (typeof str !== 'string')
- throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
- return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809
-}
-exports.utf8ToBytes = utf8ToBytes;
-// Bit operations
-/**
- * Calculates amount of bits in a bigint.
- * Same as `n.toString(2).length`
- */
-function bitLen(n) {
- let len;
- for (len = 0; n > _0n; n >>= _1n, len += 1)
- ;
- return len;
-}
-exports.bitLen = bitLen;
-/**
- * Gets single bit at position.
- * NOTE: first bit position is 0 (same as arrays)
- * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`
- */
-function bitGet(n, pos) {
- return (n >> BigInt(pos)) & _1n;
-}
-exports.bitGet = bitGet;
-/**
- * Sets single bit at position.
- */
-const bitSet = (n, pos, value) => {
- return n | ((value ? _1n : _0n) << BigInt(pos));
-};
-exports.bitSet = bitSet;
-/**
- * Calculate mask for N bits. Not using ** operator with bigints because of old engines.
- * Same as BigInt(`0b${Array(i).fill('1').join('')}`)
- */
-const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n;
-exports.bitMask = bitMask;
-// DRBG
-const u8n = (data) => new Uint8Array(data); // creates Uint8Array
-const u8fr = (arr) => Uint8Array.from(arr); // another shortcut
-/**
- * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.
- * @returns function that will call DRBG until 2nd arg returns something meaningful
- * @example
- * const drbg = createHmacDRBG(32, 32, hmac);
- * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined
- */
-function createHmacDrbg(hashLen, qByteLen, hmacFn) {
- if (typeof hashLen !== 'number' || hashLen < 2)
- throw new Error('hashLen must be a number');
- if (typeof qByteLen !== 'number' || qByteLen < 2)
- throw new Error('qByteLen must be a number');
- if (typeof hmacFn !== 'function')
- throw new Error('hmacFn must be a function');
- // Step B, Step C: set hashLen to 8*ceil(hlen/8)
- let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.
- let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same
- let i = 0; // Iterations counter, will throw when over 1000
- const reset = () => {
- v.fill(1);
- k.fill(0);
- i = 0;
- };
- const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)
- const reseed = (seed = u8n()) => {
- // HMAC-DRBG reseed() function. Steps D-G
- k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)
- v = h(); // v = hmac(k || v)
- if (seed.length === 0)
- return;
- k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)
- v = h(); // v = hmac(k || v)
- };
- const gen = () => {
- // HMAC-DRBG generate() function
- if (i++ >= 1000)
- throw new Error('drbg: tried 1000 values');
- let len = 0;
- const out = [];
- while (len < qByteLen) {
- v = h();
- const sl = v.slice();
- out.push(sl);
- len += v.length;
- }
- return concatBytes(...out);
- };
- const genUntil = (seed, pred) => {
- reset();
- reseed(seed); // Steps D-G
- let res = undefined; // Step H: grind until k is in [1..n-1]
- while (!(res = pred(gen())))
- reseed();
- reset();
- return res;
- };
- return genUntil;
-}
-exports.createHmacDrbg = createHmacDrbg;
-// Validating curves and fields
-const validatorFns = {
- bigint: (val) => typeof val === 'bigint',
- function: (val) => typeof val === 'function',
- boolean: (val) => typeof val === 'boolean',
- string: (val) => typeof val === 'string',
- isSafeInteger: (val) => Number.isSafeInteger(val),
- array: (val) => Array.isArray(val),
- field: (val, object) => object.Fp.isValid(val),
- hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),
-};
-// type Record = { [P in K]: T; }
-function validateObject(object, validators, optValidators = {}) {
- const checkField = (fieldName, type, isOptional) => {
- const checkVal = validatorFns[type];
- if (typeof checkVal !== 'function')
- throw new Error(`Invalid validator "${type}", expected function`);
- const val = object[fieldName];
- if (isOptional && val === undefined)
- return;
- if (!checkVal(val, object)) {
- throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`);
- }
- };
- for (const [fieldName, type] of Object.entries(validators))
- checkField(fieldName, type, false);
- for (const [fieldName, type] of Object.entries(optValidators))
- checkField(fieldName, type, true);
- return object;
-}
-exports.validateObject = validateObject;
-// validate type tests
-// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };
-// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!
-// // Should fail type-check
-// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });
-// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });
-// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });
-// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });
-//# sourceMappingURL=utils.js.map
\ No newline at end of file
diff --git a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.js.map b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.js.map
deleted file mode 100644
index c60d8a83..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/utils.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/abstract/utils.ts"],"names":[],"mappings":";;;AAAA,sEAAsE;AACtE,0EAA0E;AAC1E,8DAA8D;AAC9D,+EAA+E;AAC/E,uCAAuC;AACvC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,CAAC,CAAM,EAAmB,EAAE,CAAC,CAAC,YAAY,UAAU,CAAC;AAWjE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACrF;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAiB;IAC1C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAA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ools/node_modules/@noble/curves/abstract/weierstrass.d.ts b/node_modules/nostr-tools/node_modules/@noble/curves/abstract/weierstrass.d.ts
deleted file mode 100644
index 53449c53..00000000
--- a/node_modules/nostr-tools/node_modules/@noble/curves/abstract/weierstrass.d.ts
+++ /dev/null
@@ -1,240 +0,0 @@
-/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
-import * as mod from './modular.js';
-import * as ut from './utils.js';
-import { CHash, Hex, PrivKey } from './utils.js';
-import { Group, GroupConstructor, BasicCurve, AffinePoint } from './curve.js';
-export type { AffinePoint };
-type HmacFnSync = (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
-type EndomorphismOpts = {
- beta: bigint;
- splitScalar: (k: bigint) => {
- k1neg: boolean;
- k1: bigint;
- k2neg: boolean;
- k2: bigint;
- };
-};
-export type BasicWCurve