nostrdb/block: add bolt11 invoice encoding/decoding
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
Daniel D’Aquino
parent
acaf327a07
commit
373cd71f69
20
nostrdb/src/invoice.h
Normal file
20
nostrdb/src/invoice.h
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#ifndef NDB_INVOICE_H
|
||||
#define NDB_INVOICE_H
|
||||
|
||||
struct bolt11;
|
||||
|
||||
struct ndb_invoice {
|
||||
unsigned char version;
|
||||
uint64_t amount;
|
||||
uint64_t timestamp;
|
||||
uint64_t expiry;
|
||||
char *description;
|
||||
unsigned char *description_hash;
|
||||
};
|
||||
|
||||
// ENCODING
|
||||
int ndb_encode_invoice(struct cursor *cur, struct bolt11 *invoice);
|
||||
int ndb_decode_invoice(struct cursor *cur, struct ndb_invoice *invoice);
|
||||
|
||||
#endif /* NDB_INVOICE_H */
|
||||
Reference in New Issue
Block a user