Skip to content

Commit

Permalink
update example snippet with the updated subscription class
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastix committed Nov 24, 2024
1 parent fd25118 commit d7a93b1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/Examples/request-events-filtered-with-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

try {
$subscription = new Subscription();
$subscriptionId = $subscription->setId();

$filter1 = new Filter();
$filter1->setKinds([1]);
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions src/Examples/request-events-from-multiple-relays.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

try {
$subscription = new Subscription();
$subscriptionId = $subscription->setId();

$filter1 = new Filter();
$filter1->setAuthors(
Expand All @@ -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'),
Expand Down
3 changes: 1 addition & 2 deletions src/Examples/request-events-with-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@

try {
$subscription = new Subscription();
$subscriptionId = $subscription->setId();
$filter1 = new Filter();
$filter1->setAuthors([
'npub1qe3e5wrvnsgpggtkytxteaqfprz0rgxr8c3l34kk3a9t7e2l3acslezefe',
]);
$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);
Expand Down
3 changes: 1 addition & 2 deletions src/Examples/request-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d7a93b1

Please sign in to comment.