From d6847e708a86cc9cd317395b44a89513836b922c Mon Sep 17 00:00:00 2001 From: dzdidi Date: Wed, 28 Feb 2024 17:30:45 +0000 Subject: [PATCH] personal nostr tools Signed-off-by: dzdidi --- npm-shrinkwrap.json | 77 +++++++++++++++++++++++---------------------- package.json | 2 +- src/auth/nip98.js | 2 +- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b63c205..43d6a39 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -10,12 +10,12 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { + "@dzdidi_restored/nostr-tools": "^2.3.1", "chokidar": "^3.5.3", "commander": "^11.0.0", "corestore": "^6.15.13", "hyperdrive": "^11.6.3", "hyperswarm": "^4.7.13", - "nostr-tools": "github:dzdidi/nostr-tools", "protomux-rpc": "^1.5.1", "random-access-memory": "^6.2.0" }, @@ -46,6 +46,30 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@dzdidi_restored/nostr-tools": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@dzdidi_restored/nostr-tools/-/nostr-tools-2.3.1.tgz", + "integrity": "sha512-N8q1FvFZuiB6UQHPFd0eexWM34pdMOzV1yGkALnDWuOqwRmyvoVXp6GMOOcgnXktZ8dSugS71ptgV3YKkzZkWA==", + "dependencies": { + "@noble/ciphers": "^0.5.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.1", + "@scure/base": "1.1.1", + "@scure/bip32": "1.3.1", + "@scure/bip39": "1.2.1" + }, + "optionalDependencies": { + "nostr-wasm": "v0.1.0" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -3097,30 +3121,6 @@ "node": ">=0.10.0" } }, - "node_modules/nostr-tools": { - "version": "2.3.1", - "resolved": "git+ssh://git@github.com/dzdidi/nostr-tools.git#83e1286d5e88c55348835def60d5cac64f474228", - "license": "Unlicense", - "dependencies": { - "@noble/ciphers": "^0.5.1", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.1", - "@scure/base": "1.1.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" - }, - "optionalDependencies": { - "nostr-wasm": "v0.1.0" - }, - "peerDependencies": { - "typescript": ">=5.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/nostr-wasm": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/nostr-wasm/-/nostr-wasm-0.1.0.tgz", @@ -4802,6 +4802,20 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@dzdidi_restored/nostr-tools": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@dzdidi_restored/nostr-tools/-/nostr-tools-2.3.1.tgz", + "integrity": "sha512-N8q1FvFZuiB6UQHPFd0eexWM34pdMOzV1yGkALnDWuOqwRmyvoVXp6GMOOcgnXktZ8dSugS71ptgV3YKkzZkWA==", + "requires": { + "@noble/ciphers": "^0.5.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.1", + "@scure/base": "1.1.1", + "@scure/bip32": "1.3.1", + "@scure/bip39": "1.2.1", + "nostr-wasm": "v0.1.0" + } + }, "@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -7160,19 +7174,6 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, - "nostr-tools": { - "version": "git+ssh://git@github.com/dzdidi/nostr-tools.git#83e1286d5e88c55348835def60d5cac64f474228", - "from": "nostr-tools@github:dzdidi/nostr-tools", - "requires": { - "@noble/ciphers": "^0.5.1", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.1", - "@scure/base": "1.1.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1", - "nostr-wasm": "v0.1.0" - } - }, "nostr-wasm": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/nostr-wasm/-/nostr-wasm-0.1.0.tgz", diff --git a/package.json b/package.json index ba85e55..31a9592 100644 --- a/package.json +++ b/package.json @@ -41,12 +41,12 @@ "typescript": "^5.1.3" }, "dependencies": { + "@dzdidi_restored/nostr-tools": "^2.3.1", "chokidar": "^3.5.3", "commander": "^11.0.0", "corestore": "^6.15.13", "hyperdrive": "^11.6.3", "hyperswarm": "^4.7.13", - "nostr-tools": "github:dzdidi/nostr-tools", "protomux-rpc": "^1.5.1", "random-access-memory": "^6.2.0" } diff --git a/src/auth/nip98.js b/src/auth/nip98.js index 2883879..38a553c 100644 --- a/src/auth/nip98.js +++ b/src/auth/nip98.js @@ -1,4 +1,4 @@ -const { nip98, nip19, finalizeEvent } = require('nostr-tools') +const { nip98, nip19, finalizeEvent } = require('@dzdidi_restored/nostr-tools') async function getToken ({ url, method, data }) { if (!process.env.GIT_PEAR_AUTH_NSEC) throw new Error('Missing NSEC')