You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example sketch shows how to use the NostrRequestObject to construct a request for events
3
+
*
4
+
*/
5
+
#include<Arduino.h>
6
+
#include"WiFiClientSecure.h"
7
+
#include"time.h"
8
+
#include<NostrEvent.h>
9
+
#include<NostrRelayManager.h>
10
+
11
+
constchar* ssid = "wubwub"; // wifi SSID here
12
+
constchar* password = "blob19750405blob"; // wifi password here
13
+
14
+
NostrEvent nostr;
15
+
NostrRelayManager nostrRelayManager;
16
+
NostrQueueProcessor nostrQueue;
17
+
18
+
bool hasSentEvent = false;
19
+
20
+
// NTP server to request epoch time
21
+
constchar* ntpServer = "pool.ntp.org";
22
+
constlong gmtOffset_sec = 0;
23
+
constint daylightOffset_sec = 3600;
24
+
25
+
charconst *nsecHex = "<SENDER PRIVATE KEY IN HEX FORMAT>"; // sender private key in hex e.g. bdd19cecdXXXXXXXXXXXXXXXXXXXXXXXXXX
26
+
charconst *npubHex = "<SENDER PUBLIC KEY IN HEX FORMAT>"; // sender public key in hex e.g. d0bfc94bd4324f7df2a7601c4177209828047c4d3904d64009a3c67fb5d5e7ca
27
+
// BC
28
+
charconst *testRecipientPubKeyHex = "<RECIPIENT PUB KEY IN HEX FORMAT>"; // e.g. // sender public key 683211bd155c7b764e4b99ba263a151d81209be7a566a2bb1971dc1bbd3b715e
29
+
30
+
unsignedlonggetUnixTimestamp() {
31
+
time_t now;
32
+
structtm timeinfo;
33
+
if(!getLocalTime(&timeinfo)){
34
+
Serial.println("Failed to obtain time");
35
+
return0;
36
+
} else {
37
+
Serial.println("Got timestamp of " + String(now));
0 commit comments