@@ -63,7 +63,7 @@ This library provides essential cryptographic operations and utilities required
6363- Supports both ESM and CJS formats
6464- Cross-platform compatible (Node.js and browser environments)
6565
66- [ ![ npm version] ( https://badge.fury.io/js/%40humanjavaenterprises%2Fnostr -crypto-utils.svg )] ( https://www.npmjs.com/package/@humanjavaenterprises /nostr-crypto-utils )
66+ [ ![ npm version] ( https://badge.fury.io/js/nostr -crypto-utils.svg )] ( https://www.npmjs.com/package/nostr-crypto-utils )
6767[ ![ TypeScript] ( https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg )] ( http://www.typescriptlang.org/ )
6868[ ![ MIT License] ( https://img.shields.io/badge/license-MIT-blue.svg )] ( https://github.com/HumanjavaEnterprises/nostr-crypto-utils/blob/main/LICENSE )
6969[ ![ Documentation] ( https://img.shields.io/badge/docs-TypeDoc-blue.svg )] ( https://humanjavaenterprises.github.io/nostr-crypto-utils/ )
@@ -148,7 +148,7 @@ import {
148148 naddrEncode ,
149149 nrelayEncode ,
150150 decode
151- } from ' @humanjavaenterprises/ nostr-crypto-utils' ;
151+ } from ' nostr-crypto-utils' ;
152152
153153// Encode a public key
154154const npub = npubEncode (' 7f3b6c2444c526fc7b3a48b0a1e38fb6a5a4062d4a097c9e96feb3c1df2f36d0' );
@@ -202,6 +202,7 @@ try {
202202} catch (error ) {
203203 console .error (error ); // Error: Invalid hex string
204204}
205+ ```
205206
206207### Type System
207208
@@ -448,11 +449,11 @@ These examples demonstrate real-world usage patterns from production Nostr appli
448449
449450## Integration with nostr-nsec-seedphrase
450451
451- This library is designed to work seamlessly with [@ humanjavaenterprises / nostr - nsec - seedphrase ](https :// github.com/HumanjavaEnterprises/nostr-nsec-seedphrase) to provide a complete solution for Nostr key management and cryptographic operations:
452+ This library is designed to work seamlessly with [ nostr-nsec-seedphrase] ( https://github.com/HumanjavaEnterprises/nostr-nsec-seedphrase ) to provide a complete solution for Nostr key management and cryptographic operations:
452453
453454``` typescript
454- import { generateSeedPhrase } from '@humanjavaenterprises/ nostr-nsec-seedphrase';
455- import { createTextNoteEvent, signEvent } from '@humanjavaenterprises/ nostr-crypto-utils';
455+ import { generateSeedPhrase } from ' nostr-nsec-seedphrase' ;
456+ import { createTextNoteEvent , signEvent } from ' nostr-crypto-utils' ;
456457
457458// Generate keys using nostr-nsec-seedphrase
458459const seedPhrase = generateSeedPhrase ();
@@ -481,7 +482,7 @@ You can use this library to create delegate tokens for use on web servers or oth
481482### Basic Delegation Example
482483
483484``` typescript
484- import { createDelegation, validateDelegation } from '@humanjavaenterprises/ nostr-crypto-utils';
485+ import { createDelegation , validateDelegation } from ' nostr-crypto-utils' ;
485486
486487// Create a delegation token (delegator's perspective)
487488const delegatorKeyPair = await generateKeyPair ();
@@ -510,7 +511,7 @@ const isValid = await validateDelegation({
510511Here's how to use delegation tokens in a web server context:
511512
512513``` typescript
513- import { createEvent, signEventWithDelegation } from '@humanjavaenterprises/ nostr-crypto-utils';
514+ import { createEvent , signEventWithDelegation } from ' nostr-crypto-utils' ;
514515
515516// On your server, store these securely
516517const DELEGATE_PRIVKEY = ' nsec1...' ; // Your server's private key
@@ -589,7 +590,7 @@ For more details on delegation, see the [NIP-26 specification](https://github.co
589590Enable debug mode to get detailed logging:
590591
591592``` typescript
592- import { setDebugLevel } from '@humanjavaenterprises/ nostr-crypto-utils';
593+ import { setDebugLevel } from ' nostr-crypto-utils' ;
593594
594595// Enable debug logging
595596setDebugLevel (' debug' );
@@ -671,53 +672,6 @@ const testEventSigning = async (event, delegation) => {
671672
672673For more help, join our [ Discord community] ( https://discord.gg/nostr ) or [ open an issue] ( https://github.com/humanjavaenterprises/nostr-crypto-utils/issues ) .
673674
674- ## Installation
675-
676- ` ` ` bash
677- npm install @humanjavaenterprises/nostr-crypto-utils
678- ` ` `
679-
680- ## Quick Start
681-
682- ` ` ` typescript
683- import { createKeyPair, createTextNoteEvent, signEvent } from '@humanjavaenterprises/nostr-crypto-utils';
684-
685- // Generate a new key pair
686- const keyPair = createKeyPair();
687-
688- // Create a text note event
689- const event = createTextNoteEvent({
690- content: 'Hello Nostr!',
691- pubkey: keyPair.publicKey,
692- created_at: Math.floor(Date.now() / 1000)
693- });
694-
695- // Sign the event
696- const signedEvent = signEvent(event, keyPair.privateKey);
697- ` ` `
698-
699- ## Documentation
700-
701- Comprehensive documentation is available at [https :// humanjavaenterprises.github.io/nostr-crypto-utils/](https://humanjavaenterprises.github.io/nostr-crypto-utils/)
702-
703- ## Type Safety
704-
705- This library is written in TypeScript and provides comprehensive type definitions for all functions and data structures . Type checking is enforced at compile time to catch potential errors early .
706-
707- ` ` ` typescript
708- import { NostrEvent, NostrFilter, ValidationResult } from '@humanjavaenterprises/nostr-crypto-utils';
709-
710- // All types are properly defined
711- const filter: NostrFilter = {
712- kinds: [NostrEventKind.TEXT_NOTE],
713- "#t": ["nostr", "crypto"], // Filter by custom tag
714- limit: 10
715- };
716-
717- // Validation results include type information
718- const result: ValidationResult = validateEvent(event);
719- ` ` `
720-
721675## Contributing
722676
723677We welcome contributions! Please see our [ Contributing Guidelines] ( CONTRIBUTING.md ) for details.
@@ -728,29 +682,14 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
728682
729683## Changelog
730684
731- ### v0 .3.0 (2024 - 12 - 28 )
732- - 🔒 Improved type safety with stricter TypeScript checks
733- - 🐛 Fixed crypto implementation for cross - platform compatibility
734- - ✨ Added comprehensive validation for all message types
735- - 📝 Updated documentation with more examples
736-
737- ### v0 .2.0 (2024 - 12 - 26 )
738- - 🎉 Initial public release
739- - ✨ Added support for NIP - 01 and NIP - 04
740- - 🔑 Implemented key pair generation and management
741- - 📝 Added comprehensive documentation
685+ See [ CHANGELOG.md] ( CHANGELOG.md ) for a detailed history of changes.
742686
743687## Support
744688
745- - 📖 [Documentation ](https :// humanjavaenterprises.github.io/nostr-crypto-utils/)
746- - 🐛 [Issue Tracker ](https :// github.com/humanjavaenterprises /nostr-crypto-utils/issues)
747- - 💬 [Discussions ](https :// github.com/humanjavaenterprises /nostr-crypto-utils/discussions)
689+ - [ Documentation] ( https://humanjavaenterprises.github.io/nostr-crypto-utils/ )
690+ - [ Issue Tracker] ( https://github.com/HumanjavaEnterprises /nostr-crypto-utils/issues )
691+ - [ Discussions] ( https://github.com/HumanjavaEnterprises /nostr-crypto-utils/discussions )
748692
749693## Related Projects
750694
751- - [@humanjavaenterprises / nostr - nsec - seedphrase ](https :// github.com/HumanjavaEnterprises/nostr-nsec-seedphrase) - Generate and manage Nostr private keys using BIP-39 seed phrases
752-
753- -- -
754- < div align = " center" >
755- Made with ❤️ by < a href = " https://github.com/humanjavaenterprises" > Humanjava Enterprises < / a >
756- < / div >
695+ - [ nostr-nsec-seedphrase] ( https://github.com/HumanjavaEnterprises/nostr-nsec-seedphrase ) - Generate and manage Nostr private keys using BIP-39 seed phrases
0 commit comments