mirror of
https://github.com/bumi/lntip
synced 2026-02-14 13:17:49 +00:00
Add endpoint to get ne onchain BTC address
This commit is contained in:
12
ln/lnd.go
12
ln/lnd.go
@@ -50,6 +50,18 @@ func (c LNDclient) AddInvoice(value int64, memo string) (Invoice, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (c LNDclient) NewAddress() (string, error) {
|
||||
stdOutLogger.Printf("Getting a new BTC address")
|
||||
request := lnrpc.NewAddressRequest{
|
||||
Type: lnrpc.AddressType_WITNESS_PUBKEY_HASH,
|
||||
}
|
||||
res, err := c.lndClient.NewAddress(c.ctx, &request)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return res.Address, nil
|
||||
}
|
||||
|
||||
// GetInvoice takes an invoice ID and returns the invoice details including settlement details
|
||||
// An error is returned if no corresponding invoice was found.
|
||||
func (c LNDclient) GetInvoice(paymentHashStr string) (Invoice, error) {
|
||||
|
||||
Reference in New Issue
Block a user