Skip to content

Commit bcfc6e4

Browse files
vveerrggclaude
andcommitted
chore(deps): update dependencies to latest
- eslint 10.0.2 → 10.0.3 - @types/node ^20 → ^22 - nostr-crypto-utils ^0.6.0 → ^0.7.0 - Bump to 0.7.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b472f7e commit bcfc6e4

9 files changed

Lines changed: 71 additions & 61 deletions

File tree

dist/browser/nostr-nsec-seedphrase.min.js

Lines changed: 3 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/browser/nostr-nsec-seedphrase.min.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 37 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nostr-nsec-seedphrase",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "A comprehensive TypeScript library for Nostr key management with BIP39 seed phrases, supporting both ESM and CommonJS. Implements NIP-01, NIP-06, NIP-19, and NIP-26 with key generation, event signing, bech32 encoding/decoding, and secure cryptographic operations.",
55
"type": "module",
66
"main": "./dist/index.js",
@@ -62,17 +62,17 @@
6262
"@noble/hashes": "^2.0.1",
6363
"bech32": "^2.0.0",
6464
"bip39": "^3.1.0",
65-
"nostr-crypto-utils": "^0.6.0",
65+
"nostr-crypto-utils": "^0.7.0",
6666
"pino": "^10.3.1"
6767
},
6868
"devDependencies": {
6969
"@eslint/js": "^10.0.1",
70-
"@types/node": "^20.19.33",
70+
"@types/node": "^22.19.15",
7171
"@typescript-eslint/eslint-plugin": "^8.56.0",
7272
"@typescript-eslint/parser": "^8.56.0",
7373
"@vitest/coverage-v8": "^4.0.18",
7474
"esbuild": "^0.27.3",
75-
"eslint": "^10.0.0",
75+
"eslint": "^10.0.3",
7676
"prettier": "^3.8.1",
7777
"typedoc": "^0.28.17",
7878
"typedoc-plugin-markdown": "^4.10.0",

src/__tests__/index.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ vi.mock("@noble/curves/secp256k1.js", () => {
3535
secp256k1: {
3636
getPublicKey: (_privKey: Uint8Array, _compressed?: boolean) => {
3737
// Return a deterministic 33-byte compressed public key (02 prefix + 32-byte x)
38-
const hex = "0202030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2021";
39-
return new Uint8Array(hex.match(/.{1,2}/g)!.map((b: string) => parseInt(b, 16)));
38+
const hex =
39+
"0202030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2021";
40+
return new Uint8Array(
41+
hex.match(/.{1,2}/g)!.map((b: string) => parseInt(b, 16)),
42+
);
4043
},
4144
getSharedSecret: () => new Uint8Array(33).fill(3),
4245
utils: {

src/core/crypto.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ export async function signEvent(
170170
): Promise<string> {
171171
try {
172172
const eventHash = getEventHash(event);
173-
const sig = await schnorr.sign(hexToBytes(eventHash), hexToBytes(privateKey));
173+
const sig = await schnorr.sign(
174+
hexToBytes(eventHash),
175+
hexToBytes(privateKey),
176+
);
174177
return bytesToHex(sig);
175178
} catch (error) {
176179
logger.error("Failed to sign event:", error?.toString());

src/core/keys.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const logger = pino({
3030
*/
3131
export function getPublicKey(privateKey: string): string {
3232
try {
33-
const pubkey = bytesToHex(secp256k1.getPublicKey(hexToBytes(privateKey), true));
33+
const pubkey = bytesToHex(
34+
secp256k1.getPublicKey(hexToBytes(privateKey), true),
35+
);
3436
return pubkey;
3537
} catch (error) {
3638
logger.error({ error }, "Failed to derive public key");

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ export function seedPhraseToKeyPair(seedPhrase: string): KeyPair {
130130
privateKeyBytes.fill(0); // zero sensitive material
131131

132132
// Derive the public key
133-
const publicKeyBytes = secp256k1.getPublicKey(hexToBytes(privateKeyHex), true); // Force compressed format
133+
const publicKeyBytes = secp256k1.getPublicKey(
134+
hexToBytes(privateKeyHex),
135+
true,
136+
); // Force compressed format
134137
const publicKey = bytesToHex(publicKeyBytes);
135138

136139
// Generate the nsec and npub formats

src/nips/nip-26.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ export async function createDelegation(
6969
): Promise<DelegationToken> {
7070
try {
7171
// Get delegator's public key
72-
const delegator = bytesToHex(schnorr.getPublicKey(hexToBytes(delegatorPrivateKey)));
72+
const delegator = bytesToHex(
73+
schnorr.getPublicKey(hexToBytes(delegatorPrivateKey)),
74+
);
7375

7476
// Create delegation string
7577
const tokenString = createDelegationString(
@@ -80,7 +82,10 @@ export async function createDelegation(
8082

8183
// Sign the token
8284
const messageHash = sha256(new TextEncoder().encode(tokenString));
83-
const signature = await schnorr.sign(messageHash, hexToBytes(delegatorPrivateKey));
85+
const signature = await schnorr.sign(
86+
messageHash,
87+
hexToBytes(delegatorPrivateKey),
88+
);
8489

8590
logger.log("Created delegation token");
8691
return {

0 commit comments

Comments
 (0)