nostriphant / client
Simple Nostr client
2.0.1
2026-06-23 12:04 UTC
Requires
- php: ^8.4
- amphp/websocket-client: ^2.0
- nostriphant/functional: ^2.2
- nostriphant/nip-01: ^2.0
Requires (Dev)
- mockery/mockery: ^1.6
- pestphp/pest: ^4.0
README
Simple nostr php client
<?php use nostriphant\Client\Client; $client = Client::connectToUrl("wss://nos.lol", "wss://relay.damus.io"); $client(function(callable $send, callable $subscribe) { $subscription = $subscribe(ids: ['hex_event_id']); $subscription(function(?\nostriphant\NIP01\Event $event, callable $close, callable $stop) { if (is_null($event)) { // EOSE } else { // EVENT RECEIVED } }); $event = new \nostriphant\NIP01\Event(...); $send($event, function(bool $accepted, string $reason, callable $stop) { // handle response }); });