mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-02-23 13:54:25 +01:00
wrap bolt12 response
This commit is contained in:
@@ -16,21 +16,24 @@ func (svc *LndhubService) FetchBolt12Invoice(ctx context.Context, offer, memo st
|
||||
func (svc *LndhubService) PayBolt12Invoice(ctx context.Context, invoice *lnd.Bolt12) (result *lnrpc.SendResponse, err error) {
|
||||
return nil, err
|
||||
}
|
||||
func (svc *LndhubService) TransformBolt12(bolt12 *lnd.Bolt12) (*lnrpc.PayReq, error) {
|
||||
func (svc *LndhubService) TransformBolt12(bolt12 *lnd.Bolt12) (*lnd.LNPayReq, error) {
|
||||
|
||||
//todo see if CLN really can't return an int here
|
||||
msatAmt, err := strconv.Atoi(strings.Trim(bolt12.AmountMsat, "msat"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &lnrpc.PayReq{
|
||||
Destination: bolt12.NodeID,
|
||||
PaymentHash: bolt12.PaymentHash,
|
||||
NumSatoshis: int64(msatAmt / lnd.MSAT_PER_SAT),
|
||||
Timestamp: bolt12.Timestamp,
|
||||
Expiry: bolt12.RelativeExpiry,
|
||||
Description: bolt12.Description,
|
||||
DescriptionHash: "", // not supported by bolt 12?
|
||||
NumMsat: int64(msatAmt),
|
||||
return &lnd.LNPayReq{
|
||||
PayReq: &lnrpc.PayReq{
|
||||
Destination: bolt12.NodeID,
|
||||
PaymentHash: bolt12.PaymentHash,
|
||||
NumSatoshis: int64(msatAmt / lnd.MSAT_PER_SAT),
|
||||
Timestamp: bolt12.Timestamp,
|
||||
Expiry: bolt12.RelativeExpiry,
|
||||
Description: bolt12.Description,
|
||||
DescriptionHash: "", // not supported by bolt 12?
|
||||
NumMsat: int64(msatAmt),
|
||||
},
|
||||
Keysend: false,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user