Skip to content

Commit

Permalink
Add fail_htlcs mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenlu committed May 1, 2024
1 parent dd5b264 commit 93f218d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions services/lightspark_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,18 @@ func (client *LightsparkClient) FetchIncomingPaymentsByInvoice(invoiceId string,
return &payments, nil
}

func (client *LightsparkClient) FailHtlc(invoiceId string) (error) {
variables := map[string]interface{}{
"invoice_id": invoiceId,
}

_, err := client.Requester.ExecuteGraphql(scripts.FAIL_HTLCS_MUTATION, variables, nil)

Check failure on line 1066 in services/lightspark_client.go

View workflow job for this annotation

GitHub Actions / test

undefined: scripts.FAIL_HTLCS_MUTATION
if err != nil {
return err
}
return nil
}

func hashPhoneNumber(e614PhoneNumber string) (*string, error) {
e164PhoneRegex, err := regexp.Compile(`^\+?[1-9]\d{1,14}$`)
if err != nil {
Expand Down

0 comments on commit 93f218d

Please sign in to comment.