Files
nostr_terminal/include/nsigner_auth.h

27 lines
725 B
C

#ifndef NSIGNER_AUTH_H
#define NSIGNER_AUTH_H
#include "../resources/nostr_core_lib/cjson/cJSON.h"
#include <time.h>
typedef struct {
int enabled;
unsigned char privkey[32];
char label[64];
} nt_nsigner_auth_ctx_t;
/*
* Build a TCP auth envelope event (kind 27235) for an n_signer JSON-RPC request.
* Caller owns *out_auth and must cJSON_Delete() it.
* Returns 0 on success.
*/
int nt_nsigner_auth_build(const char *request_id,
const char *method,
const cJSON *params,
const nt_nsigner_auth_ctx_t *auth_ctx,
time_t created_at,
cJSON **out_auth);
#endif /* NSIGNER_AUTH_H */