46 lines
1.0 KiB
C
46 lines
1.0 KiB
C
#ifndef STATE_H
|
|
#define STATE_H
|
|
|
|
typedef struct {
|
|
char version[16];
|
|
|
|
int logged_in;
|
|
char nsec_hex[65];
|
|
char npub_hex[65];
|
|
char nsec_bech32[64];
|
|
char npub_bech32[64];
|
|
char seed_phrase[256];
|
|
|
|
char *kind0_json;
|
|
char *kind3_json;
|
|
char *kind10002_json;
|
|
char *kind10096_json;
|
|
char *kind17375_json;
|
|
char *user_settings_json;
|
|
|
|
const char *bootstrap_relays[8];
|
|
int bootstrap_relay_count;
|
|
|
|
char **read_relays;
|
|
int read_relay_count;
|
|
char **write_relays;
|
|
int write_relay_count;
|
|
|
|
char user_name[128];
|
|
} nt_state_t;
|
|
|
|
extern nt_state_t g_state;
|
|
|
|
void state_init(void);
|
|
void state_cleanup(void);
|
|
int state_load_user_info(void);
|
|
int state_load_user_info_async(void);
|
|
void state_parse_relay_list(void);
|
|
const char **state_get_read_relays(int *count);
|
|
const char **state_get_write_relays(int *count);
|
|
|
|
int state_nip44_self_encrypt(const char *plaintext, char **cipher_out);
|
|
char *state_nip44_self_decrypt(const char *sender_pub_hex, const char *ciphertext);
|
|
|
|
#endif /* STATE_H */
|