From d7a93b1e11beffb58cfa779d1e5bbb484d96b034 Mon Sep 17 00:00:00 2001 From: Sebastix Date: Sun, 24 Nov 2024 22:36:54 +0100 Subject: [PATCH] update example snippet with the updated subscription class --- src/Examples/request-events-filtered-with-tags.php | 3 +-- src/Examples/request-events-from-multiple-relays.php | 3 +-- src/Examples/request-events-with-auth.php | 3 +-- src/Examples/request-events.php | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Examples/request-events-filtered-with-tags.php b/src/Examples/request-events-filtered-with-tags.php index fbc5242..3889b23 100644 --- a/src/Examples/request-events-filtered-with-tags.php +++ b/src/Examples/request-events-filtered-with-tags.php @@ -14,7 +14,6 @@ try { $subscription = new Subscription(); - $subscriptionId = $subscription->setId(); $filter1 = new Filter(); $filter1->setKinds([1]); @@ -45,7 +44,7 @@ * If you would like to use || (OR) conditions, you should use multiple filters. */ $filters = [$filter1]; - $requestMessage = new RequestMessage($subscriptionId, $filters); + $requestMessage = new RequestMessage($subscription->getId(), $filters); $relay = new Relay('wss://relay.nostr.band'); $request = new Request($relay, $requestMessage); $response = $request->send(); diff --git a/src/Examples/request-events-from-multiple-relays.php b/src/Examples/request-events-from-multiple-relays.php index 64571ee..dd8c365 100644 --- a/src/Examples/request-events-from-multiple-relays.php +++ b/src/Examples/request-events-from-multiple-relays.php @@ -14,7 +14,6 @@ try { $subscription = new Subscription(); - $subscriptionId = $subscription->setId(); $filter1 = new Filter(); $filter1->setAuthors( @@ -25,7 +24,7 @@ $filter1->setKinds([1]); $filter1->setLimit(100); $filters = [$filter1]; - $requestMessage = new RequestMessage($subscriptionId, $filters); + $requestMessage = new RequestMessage($subscription->getId(), $filters); $relays = [ new Relay('wss://nostr.sebastix.dev'), new Relay('wss://relay.damus.io'), diff --git a/src/Examples/request-events-with-auth.php b/src/Examples/request-events-with-auth.php index 437e165..db7a2c2 100644 --- a/src/Examples/request-events-with-auth.php +++ b/src/Examples/request-events-with-auth.php @@ -14,7 +14,6 @@ try { $subscription = new Subscription(); - $subscriptionId = $subscription->setId(); $filter1 = new Filter(); $filter1->setAuthors([ 'npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe', @@ -22,7 +21,7 @@ $filter1->setKinds([1]); $filter1->setLimit(3); $filters = [$filter1]; - $requestMessage = new RequestMessage($subscriptionId, $filters); + $requestMessage = new RequestMessage($subscription->getId(), $filters); $relay = new Relay('wss://jingle.nostrver.se'); //$relay = new Relay('wss://hotrightnow.nostr1.com'); $request = new Request($relay, $requestMessage); diff --git a/src/Examples/request-events.php b/src/Examples/request-events.php index db8f109..735825e 100644 --- a/src/Examples/request-events.php +++ b/src/Examples/request-events.php @@ -12,13 +12,12 @@ try { $subscription = new Subscription(); - $subscriptionId = $subscription->setId(); $filter1 = new Filter(); $filter1->setKinds([1]); $filter1->setLimit(25); $filters = [$filter1]; - $requestMessage = new RequestMessage($subscriptionId, $filters); + $requestMessage = new RequestMessage($subscription->getId(), $filters); $relay = new Relay('wss://relay.nostr.band'); $request = new Request($relay, $requestMessage); $response = $request->send();