2019-05-22 14:20:14 -07:00
|
|
|
#ifndef LIGHTNING_COMMON_ADDR_H
|
|
|
|
#define LIGHTNING_COMMON_ADDR_H
|
|
|
|
#include "config.h"
|
2019-10-29 12:00:18 -05:00
|
|
|
#include <bitcoin/chainparams.h>
|
2019-05-22 14:20:14 -07:00
|
|
|
|
2023-07-11 01:55:43 +09:30
|
|
|
/* Given a scriptPubkey, return an encoded address for p2pkh/p2w{pkh,sh}/p2tr */
|
2019-05-22 14:20:14 -07:00
|
|
|
char *encode_scriptpubkey_to_addr(const tal_t *ctx,
|
2019-10-29 12:00:18 -05:00
|
|
|
const struct chainparams *chainparams,
|
2024-02-22 10:03:07 +13:00
|
|
|
const u8 *scriptpubkey);
|
2019-05-22 14:20:14 -07:00
|
|
|
|
2024-11-11 13:19:24 +10:30
|
|
|
bool decode_scriptpubkey_from_addr(const tal_t *ctx,
|
|
|
|
const struct chainparams *chainparams,
|
|
|
|
const char *address,
|
|
|
|
u8 **scriptpubkey);
|
|
|
|
|
2019-05-22 14:20:14 -07:00
|
|
|
#endif /* LIGHTNING_COMMON_ADDR_H */
|