Skip to content

Commit

Permalink
change namespace from swentel to nostrverse
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastix committed May 21, 2024
1 parent cc4df69 commit b7a8604
Show file tree
Hide file tree
Showing 20 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

Copyright (c) 2023-present Sebastian Hagens
Copyright (c) 2023-present nostr-php contributors - https://github.com/swentel/nostr-php/graphs/contributors
Copyright (c) 2023-present nostr-php contributors - https://github.com/nostrver-se/nostr-php/graphs/contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# nostr-php

![CI](https://github.com/swentel/nostr-php/actions/workflows/ci.yml/badge.svg)
![Packagist PHP Version](https://img.shields.io/packagist/dependency-v/swentel/nostr-php/php)
![GitHub contributors](https://img.shields.io/github/contributors/swentel/nostr-php)
![GitHub issues](https://img.shields.io/github/issues/swentel/nostr-php)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/swentel/nostr-php/main)
![CI](https://github.com/nostrverse/nostr-php/actions/workflows/ci.yml/badge.svg)
![Packagist PHP Version](https://img.shields.io/packagist/dependency-v/nostrverse/nostr-php/php)
![GitHub contributors](https://img.shields.io/github/contributors/nostrverse/nostr-php)
![GitHub issues](https://img.shields.io/github/issues/nostrverse/nostr-php)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/nostrverse/nostr-php/main)

This is a PHP Helper library for Nostr.
More info about Nostr: https://github.com/nostr-protocol/nostr.
Expand All @@ -14,7 +14,7 @@ More info about Nostr: https://github.com/nostr-protocol/nostr.
To use in your project with Composer:

```console
$ composer require swentel/nostr-php
$ composer require nostrverse/nostr-php
```

Install dependencies if you would like to test / code some things out for yourself with the code example snippets below.
Expand All @@ -28,7 +28,7 @@ $ composer install
This will create an event object with a short text message (kind 1).

```php
use swentel\nostr\Event\Event;
use nostrverse\nostr\Event\Event;

$note = new Event();
$note->setKind(1);
Expand All @@ -48,8 +48,8 @@ Generates the id and signature for an event. The 'pubkey', 'id' and 'sig'
properties are added to the event object.

```php
use swentel\nostr\Event\Event;
use swentel\nostr\Sign\Sign;
use nostrverse\nostr\Event\Event;
use nostrverse\nostr\Sign\Sign;

$note = new Event();
$note->setContent('Hello world!');
Expand All @@ -64,8 +64,8 @@ $signer->signEvent($note, $private_key);
Generate an event message : `["EVENT", <event JSON as created above with id and sig>]`

```php
use swentel\nostr\Sign\Sign;
use swentel\nostr\Message\EventMessage;
use nostrverse\nostr\Sign\Sign;
use nostrverse\nostr\Message\EventMessage;

$signer = new Sign();
$signer->signEvent($note, $private_key);
Expand All @@ -79,9 +79,9 @@ $message_string = $eventMessage->generate();
Publish an event with a note that has been prepared for sending to a relay.

```php
use swentel\nostr\Event\Event;
use swentel\nostr\Message\EventMessage;
use swentel\nostr\Relay\Relay;
use nostrverse\nostr\Event\Event;
use nostrverse\nostr\Message\EventMessage;
use nostrverse\nostr\Relay\Relay;

$note = new Event();
$note->setContent('Hello world');
Expand All @@ -100,7 +100,7 @@ $result = $relay->send();
## Generating a private key and a public key

```php
use swentel\nostr\Key\Key;
use nostrverse\nostr\Key\Key;

$key = new Key();

Expand All @@ -114,7 +114,7 @@ $public_key = $key->getPublicKey($private_key);
Convert bech32 encoded keys (npub, nsec) to hex.

```php
use swentel\nostr\Key\Key;
use nostrverse\nostr\Key\Key;

$public_key = 'npub10elfcs4fr0l0r8af98jlmgdh9c8tcxjvz9qkw038js35mp4dma8qzvjptg';
$key = new Key();
Expand All @@ -124,7 +124,7 @@ $hex = $key->convertToHex($public_key);
Convert hex keys to bech32 (npub, nsec).

```php
use swentel\nostr\Key\Key;
use nostrverse\nostr\Key\Key;

$public_key = '7e7e9c42a91bfef19fa929e5fda1b72e0ebc1a4c1141673e2794234d86addf4e';
$private_key = '67dea2ed018072d675f5415ecfaed7d2597555e202d85b3d65ea4e58d2d92ffa';
Expand Down Expand Up @@ -158,10 +158,10 @@ private key on command line.
- [x] Keypair generation and validation
- [x] Convert from hex to bech32-encoded keys
- [x] Event signing with Schnorr signatures (`secp256k1`)
- [x] Event validation (issue [#17](https://github.com/swentel/nostr-php/issues/17))
- [x] Event validation (issue [#17](https://github.com/nostrverse/nostr-php/issues/17))
- [ ] Support NIP-01 basic protocol flow description
- [x] Publish events
- [ ] Request events (pr [#48](https://github.com/swentel/nostr-php/pull/48))
- [ ] Request events (pr [#48](https://github.com/nostrverse/nostr-php/pull/48))
- [ ] Improve handling relay responses
- [ ] Support NIP-19 bech32-encoded identifiers
- [ ] Support NIP-42 authentication of clients to relays
Expand Down
2 changes: 1 addition & 1 deletion bin/nostr-php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ else {

require NOSTR_COMPOSER_INSTALL;

exit((new swentel\nostr\Application\Client)->run($_SERVER['argv']));
exit((new nostrverse\nostr\Application\Client)->run($_SERVER['argv']));
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "swentel/nostr-php",
"name": "nostrverse/nostr-php",
"description": "Nostr helper library for PHP",
"keywords": ["nostr", "library", "dev"],
"homepage": "https://nostr-php.dev",
Expand All @@ -18,7 +18,7 @@
}
],
"support": {
"issue": "https://github.com/swentel/nostr-php/issues",
"issue": "https://github.com/nostrver-se/nostr-php/issues",
"chat": "https://t.me/nostr_php"
},
"require": {
Expand All @@ -36,7 +36,7 @@
},
"autoload": {
"psr-4": {
"swentel\\nostr\\": "src/"
"nostrverse\\nostr\\": "src/"
}
},
"bin": [
Expand Down
10 changes: 5 additions & 5 deletions src/Application/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace swentel\nostr\Application;
namespace nostrverse\nostr\Application;

use swentel\nostr\Event\Event;
use swentel\nostr\Message\EventMessage;
use swentel\nostr\Relay\Relay;
use swentel\nostr\Sign\Sign;
use nostrverse\nostr\Event\Event;
use nostrverse\nostr\Message\EventMessage;
use nostrverse\nostr\Relay\Relay;
use nostrverse\nostr\Sign\Sign;

class Client
{
Expand Down
2 changes: 1 addition & 1 deletion src/CommandResultInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace swentel\nostr;
namespace nostrverse\nostr;

interface CommandResultInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Event/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace swentel\nostr\Event;
namespace nostrverse\nostr\Event;

use Mdanter\Ecc\Crypto\Signature\SchnorrSignature;
use swentel\nostr\EventInterface;
use nostrverse\nostr\EventInterface;

class Event implements EventInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/EventInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace swentel\nostr;
namespace nostrverse\nostr;

interface EventInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Key/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace swentel\nostr\Key;
namespace nostrverse\nostr\Key;

use BitWasp\Bech32\Exception\Bech32Exception;
use Elliptic\EC;
Expand Down
6 changes: 3 additions & 3 deletions src/Message/EventMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace swentel\nostr\Message;
namespace nostrverse\nostr\Message;

use swentel\nostr\EventInterface;
use swentel\nostr\MessageInterface;
use nostrverse\nostr\EventInterface;
use nostrverse\nostr\MessageInterface;

class EventMessage implements MessageInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/MessageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace swentel\nostr;
namespace nostrverse\nostr;

interface MessageInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Relay/CommandResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace swentel\nostr\Relay;
namespace nostrverse\nostr\Relay;

use swentel\nostr\CommandResultInterface;
use nostrverse\nostr\CommandResultInterface;

class CommandResult implements CommandResultInterface
{
Expand Down
8 changes: 4 additions & 4 deletions src/Relay/Relay.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace swentel\nostr\Relay;
namespace nostrverse\nostr\Relay;

use swentel\nostr\MessageInterface;
use swentel\nostr\RelayInterface;
use swentel\nostr\CommandResultInterface;
use nostrverse\nostr\MessageInterface;
use nostrverse\nostr\RelayInterface;
use nostrverse\nostr\CommandResultInterface;
use WebSocket;

class Relay implements RelayInterface
Expand Down
2 changes: 1 addition & 1 deletion src/RelayInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace swentel\nostr;
namespace nostrverse\nostr;

interface RelayInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/Sign/Sign.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace swentel\nostr\Sign;
namespace nostrverse\nostr\Sign;

use Mdanter\Ecc\Crypto\Signature\SchnorrSignature;
use swentel\nostr\EventInterface;
use swentel\nostr\Key\Key;
use nostrverse\nostr\EventInterface;
use nostrverse\nostr\Key\Key;

class Sign
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ConvertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

use PHPUnit\Framework\TestCase;
use swentel\nostr\Key\Key;
use nostrverse\nostr\Key\Key;

class ConvertTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/GenerateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

use PHPUnit\Framework\TestCase;
use swentel\nostr\Key\Key;
use nostrverse\nostr\Key\Key;

class GenerateTest extends TestCase
{
Expand Down
10 changes: 5 additions & 5 deletions tests/RelayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
declare(strict_types=1);

use PHPUnit\Framework\TestCase;
use swentel\nostr\Event\Event;
use swentel\nostr\Key\Key;
use swentel\nostr\Relay\Relay;
use swentel\nostr\Relay\CommandResult;
use swentel\nostr\Sign\Sign;
use nostrverse\nostr\Event\Event;
use nostrverse\nostr\Key\Key;
use nostrverse\nostr\Relay\Relay;
use nostrverse\nostr\Relay\CommandResult;
use nostrverse\nostr\Sign\Sign;

class RelayTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/SerializeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
declare(strict_types=1);

use PHPUnit\Framework\TestCase;
use swentel\nostr\Event\Event;
use swentel\nostr\Sign\Sign;
use nostrverse\nostr\Event\Event;
use nostrverse\nostr\Sign\Sign;

class SerializeTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/VerifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
declare(strict_types=1);

use PHPUnit\Framework\TestCase;
use swentel\nostr\Event\Event;
use swentel\nostr\Message\EventMessage;
use nostrverse\nostr\Event\Event;
use nostrverse\nostr\Message\EventMessage;

class VerifyTest extends TestCase
{
Expand Down

0 comments on commit b7a8604

Please sign in to comment.