Commit graph

75 commits

Author SHA1 Message Date
Roland
3b3c37dd0c
fix: remove legacy acceptance of empty unlock password check (#2534)
* fix: remove legacy acceptance of empty unlock password check

CheckUnlockPassword previously treated a missing or empty
UnlockPasswordCheck value as a match — a legacy compatibility path from
before the canary was always written. It now requires the stored value
to be present and to equal the expected string.

StartApp checks for the canary up front and, if it is missing, stops
with a message asking the user to restore from a backup rather than
continuing. A new IsUnlockPasswordCheckSet helper reports whether the
value is present.

keys.Init now returns the error from reading NostrSecretKey instead of
ignoring it, so a read failure aborts instead of generating and saving a
new key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: add operation context to unlock password check errors

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 14:48:06 +07:00
Roland
0b0cbbd985
fix: make event assertions in tests wait for async event consumption (#2531)
The mock event consumer waited a fixed 10ms before returning consumed
events, which was not always enough on slow CI runners and caused flaky
failures (e.g. TestMarkSettled_App_BudgetWarning missing its
nwc_budget_warning event). It also appended to the events slice from
concurrent goroutines without synchronization, a data race that could
drop events.

- guard the consumed events slice with a mutex and return copies
- add WaitForConsumedEvents which polls until the expected number of
  events arrived (up to 5s) instead of relying on a fixed sleep
- use it in tests that assert on consumed events; tests asserting that
  no event was published keep the short grace period
- normalize event order in the keysend self-payment test, matching the
  existing approach in the self-payment test, since async publishing
  does not guarantee ordering

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 14:48:41 +07:00
Roland
5f4e52bd88
fix: publish transaction events only after the database transaction commits (#2520)
* fix: publish transaction events only after the database transaction commits

markTransactionSettled and markPaymentFailed published nwc_payment_sent /
nwc_payment_received / nwc_payment_failed (and checkBudgetUsage published
nwc_budget_warning) while still inside the caller's database transaction, so
connected apps and the Alby API could be notified of a payment whose row was
never committed, and subscribers reading the database in response to an event
could race with the commit.

Every function that writes transaction state now owns its own database
transaction and publishes its events only after the commit succeeds:

- markTransactionSettled and markPaymentFailed open their own transaction;
  callers no longer wrap them in db.Transaction
- new createSettledTransactionFromNotification inserts transactions reported
  by LNClient notifications for payments the hub has no record of (external
  payments, received keysends) directly in their settled state, removing the
  transient PENDING row and the zombie row left behind on duplicate events
- markPaymentFailed now refuses to mark a settled transaction as failed,
  replacing CancelHoldInvoice's in-transaction ACCEPTED re-check and also
  protecting the SendPaymentSync error path from a racing settle
- checkBudgetUsage returns the budget warning event instead of publishing it

Closes #2506

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: serialize payment failure with settlement and propagate lock errors

Address review findings on the previous commit:

- markPaymentFailed now takes the same payment-hash row lock as settlement
  (postgres), so the settled-state guard cannot be bypassed by a concurrent
  settle between the state check and the update; it also returns not-found
  instead of publishing an event when the transaction row no longer exists,
  and reports whether this call transitioned the row so CancelHoldInvoice
  only publishes nwc_hold_invoice_canceled when it performed the cancellation
- findSettledTransaction propagates errors from the lock query and the
  settled-transaction lookup instead of treating a failed lookup as
  "no settled transaction exists", which could defeat the dedup guard
- TestMarkSettled_Twice no longer shares one transaction struct between
  concurrent goroutines and collects errors instead of asserting inside them

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: mark failed keysend payments via markPaymentFailed

The SendKeysend failure path updated the transaction directly, which never
zeroed the fee reserve, recorded no failure reason, published no
nwc_payment_failed event, and had no guard against overwriting a
concurrently settled payment. Route it through markPaymentFailed like
SendPaymentSync, and allow MockLn keysends to fail so the path is testable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-08 13:38:28 +07:00
saunter
23dccc6c6f
feat: stories (#2172)
* feat: integrate Stories widget with backend endpoint

Add stories endpoint plumbing for HTTP and Wails, wire the Home Stories card
to fetch from /api/alby/stories, and keep it first in the right column.

Made-with: Cursor

* feat(home): story modal CTAs and preview fallback

- Add contextual actions in the story dialog (update hub with version,
  open Alby Go in-app, install extension) keyed by kind or title
- Use preview stories when the stories API request fails
- Pass hub version from useInfo into the update link

Made-with: Cursor

* feat(stories): polish modal, drop preview fallback

- Widen modal and put video edge-to-edge with overlay close button
- Drop verbose header and 'Watch on YouTube' button
- Remove previewStories fallback so widget hides until upstream API ships
- Tighten title line-height

* feat(stories): render cta from API instead of mapping by kind

Move CTA copy and URLs into the API response. Hub renders story.cta
directly, so adding new story types no longer requires a hub release.

* chore(csp): allow cdn.getalby-assets.com in img-src

* feat(stories): bump avatar size and add ring gap

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): post-review cleanups

- Use react-router Link for in-tab CTA instead of plain <a>.
- Drop redundant www.youtube.com from frame-src (embeds always go through nocookie).
- Tighten stories endpoint status check from >= 300 to >= 400.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): address CodeRabbit feedback

- Switch StoriesWidget to useSWR + swrFetcher (project convention).
- Guard story iframe with isYouTubeUrl so non-YouTube urls never embed.
- Wrap GetStories errors with fmt.Errorf("...: %w", err).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): drop isYouTubeUrl guard

Stories are curated and always YouTube; the runtime check was
redundant. CSP frame-src still constrains the iframe source.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): drop getYouTubeEmbedUrl, embed videoUrl as-is

The Alby API now sends canonical youtube-nocookie embed URLs with
autoplay/rel query strings (getAlby/getalby.com#2568), so the
runtime normalization is no longer needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): use w-16 instead of arbitrary w-[73px]

Match the avatar's size token; no magic numbers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): take videoId from API and assemble embed url locally

Pairs with getAlby/getalby.com#2568. The API now sends just the
YouTube videoId; the hub composes the canonical embed URL so the
domain/query-string format stays in one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): treat 3xx as non-success, matching file convention

The other status checks in alby_oauth_service.go all use >= 300;
align GetStories so redirects don't slip through.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): move viewed-storage key to constants, widen story button

Address review feedback:
- Centralize the localStorage key for viewed stories in localStorageKeys
  alongside the other keys.
- Widen the story button from w-16 to w-20 so "Alby Extension" fits on
  one line and matches the other titles.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): bump story button to w-24 so titles fit one line

w-20 still wrapped "Alby Extension"; w-24 fits all current titles
without truncation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Revert "chore(stories): bump story button to w-24 so titles fit one line"

This reverts commit 0b47438f50.

* chore(stories): split title words onto separate lines

Reserve two lines for every story title so avatars align regardless of
title length.

* chore(stories): align homeStoriesViewed key with sibling pattern

* chore(stories): fit titles on one line

* chore(stories): widen story button to w-21 for one-line titles

---------

Co-authored-by: René Aaron <rene@twentyuno.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-02 10:50:15 +02:00
Roland
e3373474f8
chore: remove json tags from lnclient models (#2375)
* chore: remove json tags from lnclient models

these should not be passed through the API directly

* fix: properly return not implemented errors

* fix: json tags on TLVRecord
2026-05-25 20:26:07 +05:30
Roland
5b3f1bef9d
fix: update to alby go-nostr fork which reconnects after receiving CLOSED message (#2331) 2026-05-11 12:34:56 +07:00
Adithya Vardhan
0c421375e5
chore: update to use sat/msat suffixes everywhere (#2271)
* chore: align internal models and methods to use sat/msat suffixes

* chore: update request structs to use sat/msat suffixes

* fix: default max amount to 0 during app creation

* fix: simplify helper functions

* chore: remove unused lnclient probing methods

* chore: remove unused json tags on swap struct

* chore: update frontend to use sat/msat suffixes everywhere

* chore: use request types in frontend

* fix: linting

* fix: remove deprecated sat and msat fields in frontend

* chore: further changes

* fix: avoid sat/msat resolver variable shadowing

* fix: validate Support Alby amounts
2026-05-01 15:41:56 +05:30
Anshuman
1d3f9ecd41
feat: suffix balance/amount fields with explicit unit (Sat or Msat) (#2153)
* feat: add both Sat and Msat companion fields for all ambiguous balance/amount properties

* feat: add sat and msat companion fields to backend API responses

* chore: align frontend types and other missing fields

* chore: keep old formula for calculating total fee sat

* chore: remove unnecessary balance assignments in cashu and phoenix

* chore: add deprecated comment to non unit fields

* chore: rename callers and variable to specify units

* chore: remove msat fields for channel size and liquidity fields

* chore: drop msat fields from onchain channel size and liquidity responses

* chore: further changes

* chore: remove amount msat field onchain tx

* chore: remove msats from onchain balance response

* chore: remove msat fields for swaps

* chore: remove msat fields for punishment reserves

* chore: simplify rebalancing fee calculation

* chore: remove unnecessary fields

* chore: mark deprecated fields in frontend types

---------

Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2026-04-17 13:53:28 +05:30
Adithya Vardhan
6303c3ed6b
fix: fetch currencies through alby backend api (#2212)
* fix: fetch currencies through alby backend api

* fix: pass currency to bitcoin rate handler
2026-04-09 23:03:26 +05:30
Adithya Vardhan
51b867e992
fix: make HTTP start JWT secret loading idempotent (#2165)
* fix: make HTTP start JWT secret loading idempotent

* fix: check unlock password before loading jwt

* fix: use mutex to guard jwtsecret in config
2026-04-07 16:39:49 +05:30
frnandu
928246d472
feat: add minCltvExpiryDelta for LND (#2139)
* feat: add minCltvExpiryDelta for LND

* feat: improve

* feat: test LastMinCltvExpiryDelta

* feat: fixes

* feat: fixes

* chore: address minor naming issue

* chore: run mockery

---------

Co-authored-by: anon <anon@anon.com>
Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2026-03-25 23:06:57 +05:30
Adithya Vardhan
72ad7d849c
fix: remove bitcoin maxi mode and always show crypto actions (#2135) 2026-03-13 10:17:14 +07:00
Roland
4cb794b332
chore: update additional places to support multiple relays (#2104) 2026-02-28 13:30:48 +07:00
Adithya Vardhan
7bed6ecd86
feat: add fixed float along with bitcoin maxi mode (#2094)
* feat: add option to purchase channels with other crypto

* feat: add option to receive via other crypto

* feat: add crypto swap alert if sending fails

* feat: add bitcoin maxi mode

* fix: add invoice description on swapping

* chore: align top up wording everywhere

* chore: stop showing alert if recipient input is edited

* chore: change swap fee to 1%

* feat: add fixed float option to deposit and withdraw pages

* chore: extract fixed float swap in flow

* chore: add FixedFloatButton component

* chore: store bitcoin maxi setting in config

* fix: tests using mockery

* fix: issues
2026-02-28 11:54:28 +07:00
Adithya Vardhan
4efe735acf
fix: prevent LN client access during shutdown (#2096)
* fix: prevent LN client access during shutdown

* chore: run mockery

* chore: push lnClientShuttingDown inside stopLNClient

* fix: use atomic bool for synced access
2026-02-27 15:45:09 +07:00
Roland
b49818de07
fix: intercept self hold payments based on invoice rather than payment hash (#2027)
* fix: intercept self hold payments based on invoice rather than payment hash

* fix: generate test invoices with long expiry

* fix: add timeout seconds for standard lnd payments
2026-02-27 10:22:24 +05:30
klabo
801f517478
refactor: remove unused LNClient.ListTransactions method (#2046)
Transactions are listed from the database via transactionsService, not
from the LN backend. The LNClient.ListTransactions method was never
called and each backend's implementation was dead code.

Closes #2045

Co-authored-by: Joel Klabo <max@klabo.world>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:01:32 +05:30
Sergey B.
5281681776
feat: remove hasLdkDir check (#2014)
* feat: remove hasLdkDir check

* chore: regenerate mocks

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2026-02-09 21:39:25 +07:00
Roland
1f1aacfa8b
chore: use encrypted jwt secret (#1988)
* chore: use encrypted jwt secret

* chore: improve jwt secret unlock test

* chore: replace unencrypted jwt secret on unlock

* chore: add TODO to remove encrypted JWT secret check after 2027
2025-12-17 00:25:33 +07:00
Roland
d12ed10c67
chore: add method to return cached config value (#1944)
* chore: add method to return cached config value

* fix: add check for relay urls when starting NWC wallet service

* fix: mocks

* chore: always use cache for config entries
2025-11-29 11:24:27 +07:00
René Aaron
6294d519c2
feat: bip177 (#1864)
* feat: bip177 option in settings

* fix: tests

* fix: use constants

* fix: bitcoin display format type

* fix: patch request

* fix: cleanup types

* fix: migrate to formatted bitcoin amount component

* fix: prevent banner from being shown again when updating settings

* fix: move stuff into api

* fix: component usage

* fix: onchain transaction table

* fix: amounts

* fix: format numbers

* fix: settings sections

* fix: copy

* chore: use existing constants

* chore: minor ui fixes and copy improvements for amount displays

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2025-11-10 15:48:27 +07:00
Roland
377a3169c6
feat: support multiple relays (#1802)
* feat: support multiple relays (WIP)

* fix: multiple NWC url construction for multiple relays

* fix: startup

* chore: update go-nostr to fix pool relay reconnect

* fix: split nip-47 queue info publish event for each relay url

* fix: add relayUrls to dispatched nwc success events

* fix: ensure newly created app info publishing is not blocked by sleep from failed publishes

* feat: multiple relays improvements

- update app deleted and updated consumers to handle multiple relays
- handle multiple relays in healthcheck
- display relay online status in about page
- renaming and improved comments

* chore: simplify error messages

* fix: unnecessary db error log when checking if app has notification permission

* fix: tests

* chore: remove old comment

* fix: app wallet subscription context usage
2025-11-06 18:01:09 +07:00
Krrish Sehgal
3f1f9c5a0f
refactor: removed the fee credit system (#1769) 2025-09-24 22:29:37 +07:00
Roland
595361df27
feat: read only JWT for http api use (#1717)
* feat: read only JWT for http api use

* fix: pass permission to start and unlock endpoints

* chore: add http service JWT tests

* chore: update mocks

* fix: close db in tests
2025-09-19 13:07:10 +07:00
Roland
a294e1b169
feat: rebalance through node pubkey (#1731)
* feat: rebalance through node pubkey (WIP)

* fix: check if remote channel policy exists
2025-09-19 12:30:51 +07:00
Roland
3787f54006
Fix: use LNClient payment context (#1728)
* fix: mark failed payment as settled

* fix: use lnclient context for paying instead of request context
2025-09-16 20:53:02 +07:00
Roland
b628dbbcfa
fix: ignore amount on non-zero-amount invoice (#1652) 2025-08-28 12:18:23 +07:00
Roland
13c24c7a87
feat: choose payment method when opening first channel (#1606)
* feat: choose payment method when opening first channel (WIP)

* chore: update terms

* chore: consume lsp endpoint, display fees+LSP in manual channel flow, first channel ui improvements

* chore: improve handling of fee_credits payment method

* chore: add terms and description

* feat: add terms to manual increase incoming capacity flow

* chore: add error handling for get_info endpoint

* feat: allow alby account to pay for manual channel order

* chore: use consistent logging methods

* chore: rename lsp balance sats field to be consistent

* chore: update to use consistent field name for public key in auto channel request

* chore: rename channel suggestion url and type fields

* feat: support included payment method

* chore: update LDK startup peers

* chore: move non-oauth methods out of alby oauth service

* chore: improve terms around duration, only display duration in terms modal
2025-08-27 23:34:15 +07:00
Roland
46246b05d1
chore: remove payment timeout (#1592) 2025-08-11 22:06:49 +07:00
Adithya Vardhan
a1eaa63eed
Swaps improvements (shifting to standalone page + one-time swaps) (#1371)
* chore: move out swaps from settings

* chore: link to swaps in wallet and node page

* chore: add frontend for swap ins

* chore: update all swap redirects

* chore: remove swap dialogs

* chore: remove auto swap-ins frontend

* feat: add support for one time swap outs

* chore: remove unused code

* chore: use separate endpoint for one off swap outs

* chore: further changes

* chore: separate one off and auto swaps

* chore: naming changes

* fix: tests

* feat: add one off swap in

* feat: add auto swap ins

* chore: remove comments

* fix: tests

* chore: further changes

* chore: further changes

* chore: rename to swap in and swap out

* chore: do not show swaps for non LDK/LND users

* chore: add receive limit checks for swap ins

* chore: remove probing

* chore: dark mode

* fix: swap link

* chore: add extra swap links

* fix: fee rates log

* fix: fee rates log

* chore: color changes

* Feat: swap out improvements (#1403)

* feat: swap out improvements

- add lockup transaction id to hold payment metadata
- return swap ID and payment hash in swap out response
- retries to get fee rates
- separate swap out success page with status

* chore: rename

* chore: show current balance on swap out form

* chore: add pulse animation to badge while pending

* chore: minor typo

* chore: update fee rate retry interval to 10 seconds

* chore: use icons instead of badges

---------

Co-authored-by: im-adithya <imadithyavardhan@gmail.com>

* chore: update comment

* chore: remove comment

* chore: update boltz client to v2.6.1

* feat: swap in improvements (WIP) (#1411)

* feat: swap in improvements (WIP)

* feat: new swap in status page

* fix: hide pay button when already paid

* chore: improve swap in UI

* chore: more swap in ui improvements

* chore: minor improvements and fixes

* fix: typo

* feat: add swap in refund logic in case of failure

* fix: tests

* chore: add swap expired case for refunds

---------

Co-authored-by: im-adithya <imadithyavardhan@gmail.com>

* feat: add swaps table (#1419)

* feat: add swaps table

* fix: test

* chore: bump LDK-node to v0.6.0 (#1418)

* [Freepilot] fix: startup error handling (#1413)

* fix: handle errors from service.NewService() in startup code

Previously, both HTTP and Wails startup code ignored errors from
service.NewService(ctx) using blank identifier (_), which could
cause panics later if NewService fails (e.g., unable to connect
to postgres database).

Now properly handle the error and exit gracefully with a fatal
log message when service initialization fails.

* fix: compile error

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>

* feat: add hd key derivation

* Chore: add albyhub region cookie to developer page (#1421)

* docs: add AlbyHub-Region cookie instructions to developer page

* fix: use region from alby api

---------

Co-authored-by: achaldps@gmail.com <achaldps@gmail.com>

* build(deps): bump golang.org/x/crypto from 0.38.0 to 0.39.0 (#1415)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.38.0 to 0.39.0.
- [Commits](https://github.com/golang/crypto/compare/v0.38.0...v0.39.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump gorm.io/driver/sqlite from 1.5.7 to 1.6.0 (#1416)

Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.5.7 to 1.6.0.
- [Commits](https://github.com/go-gorm/sqlite/compare/v1.5.7...v1.6.0)

---
updated-dependencies:
- dependency-name: gorm.io/driver/sqlite
  dependency-version: 1.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump github.com/btcsuite/btcd/btcec/v2 from 2.3.4 to 2.3.5 (#1417)

Bumps [github.com/btcsuite/btcd/btcec/v2](https://github.com/btcsuite/btcd) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/btcsuite/btcd/releases)
- [Changelog](https://github.com/btcsuite/btcd/blob/master/CHANGES)
- [Commits](https://github.com/btcsuite/btcd/compare/btcec/v2.3.4...btcec/v2.3.5)

---
updated-dependencies:
- dependency-name: github.com/btcsuite/btcd/btcec/v2
  dependency-version: 2.3.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: allow setting LDK node alias (#1398)

* feat: add node alias customization for LDK nodes with public channels

- Add new NodeAlias field to InfoResponse in API
- Add SetNodeAlias method to API with config storage
- Add HTTP endpoint POST /node/alias for setting node alias
- Add corresponding Wails endpoint support
- Create new Node settings page in frontend
- Add conditional navigation item for LDK nodes with public channels
- Include upgrade dialog and paid subscription check
- Display success message prompting node restart after alias change
- Show error toast for non-paid users attempting to change alias

* chore: use node alias from config in LDK init

* fix: make upgrade button non-absolute, remove disabled attribute

* chore: move node alias page to be consistent with other node management pages

* chore: remove redundant comment

* chore: show upgrade dialog when clicking node alias option, show also for private channels

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>

* fix: always pass in fee and handle mempool errors (#1408)

* fix: always pass in fee and handle mempool errors

* chore: improve withdraw on-chain funds UI

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>

* feat: derive keys from id and add fields to swap table

* feat: use bip 85 to derive swap mnemonic

* chore: mark swaps as failed if payment fails

* feat: add process refund method for swap ins

* chore: add process refund to swap service interface

* feat: add frontend

* fix: swap out failure message

* feat: add process refund button in swap in status screen

* chore: further improvements

* fix: wails routes

* feat: add frequency selector for ZapPlanner payments (#1312) (#1317)

* feat: add frequency selector for ZapPlanner payments (#1312)

* feat: add frequency selector for ZapPlanner payments (#1312) +corrections

* feat(zapplanner): add USD/BTC selector and frequency option

Budget renewal still has to be adjusted

* feat(zapplanner): set default frequency to 1 month

* feat(zapplanner): set default amount to usd and added (sats) to clarify BTC unit

* feat(zapplanner): convert months to days for subscriptions

* feat(zapplanner): add open to convertCurrency deps to allow consecutive subscriptions

* feat(Zapplanner freq&currency selector): added all currencies to the selector

* feat(Zapplanner freq&currency selector): removed bug about 2xBTC(sats) on the menu

* feat(zapplanner): frequency & currency all comments addressed

* chore: zapplanner fixes

- currency sorting
- sats currency usage for ZapPlanner
- force whole values for ZapPlanner
- pass correct currency to ZapPlanner
- rename field
- fix input width

---------

Co-authored-by: jpl-btc <>
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>

* chore: add reconnection logic

* chore: specify fees while locking btc

* fix: do not use context background

* chore: improve auto swaps frontend

* chore: add boltz logo to tx item

* Updated Primal app connection (#1428)

* Updated Primal app connection

* fix: lint

---------

Co-authored-by: René Aaron <rene@twentyuno.net>

* chore: bump uniffi-bindgen-go and revert error handling in the LDK client (#1434)

* chore: revert error handling in the LDK client

* chore: update ldk-node-go dependency

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>

* Read.me adjustments (#1440)

* Update README.md

1) We spend a lot of time helping users to fix their problems with Raspi PIs.
2) Computers that are offline regularly create a bad UX because payments in external apps do not work and channels are closed earlier.

* Update README.md

* feat: add expired state to nip47 transactions (#1441)

* fix: use custom mempool url (#1431)

* fix: use custom mempool url

* chore: return mempool url in info endpoint

* chore: use mempool url from info response in frontend

* chore: remove default mempool url in frontend

* fix: tests

* feat: add LDK bitcoind rpc chain source (#1367)

* feat: add LDK bitcoind rpc chain source

* fix: crash in bitcoindrpc due to not enabling continuous sync

* chore: renaming

* chore: mark swap status as failed

* chore: use mempool url from info

* chore: poll balances on node page

* fix: when opening outbound channel, extract host part if full peer connection url is pasted

* chore: use mempool url from backend info endpoint

* docs: add boltz regtest setup instructions

* chore: separate swap in and out status pages

* fix: remove duplicate useInfo

* fix: mnemonic derivation logic

* chore: address comments

* chore: add tests for swap mnemonic generation

* chore: add refunded state

* chore: rename columns

* chore: simplify swap status frontend

* chore: mark swap out as successful after claim tx conf

* chore: add address to refund

* fix: wails

* feat: add resubscription

* chore: add logging

* chore: save refund address to db and use new address

* chore: add comment

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Roland <33993199+rolznz@users.noreply.github.com>
Co-authored-by: Freepilot <215356755+freepilot-bot@users.noreply.github.com>
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
Co-authored-by: achaldps@gmail.com <achaldps@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nodii <13803869+NodeDiver@users.noreply.github.com>
Co-authored-by: Moritz Kaminski <moritz.kaminski@gmail.com>
Co-authored-by: René Aaron <rene@twentyuno.net>
Co-authored-by: Roman D <roman@dmitrienko.com>

* chore: rename to receive_amount

* chore: remove auto swap success and add boltz link

* chore: use constant and rename variables

* fix: mark swaps as failed

* fix: show receive amount in swap in success screen

* chore: remove duplicate endpoint and reorder

* chore: add comment in wails handler

* chore: use markSwapState

* chore: add retries

* fix: use one websocket per swap

* chore: frontend fixes

* feat: add swap mnemonic to debug tools

* fix: tx list

* fix: tests

* chore: further changes

* chore: improve copy

* chore: improve copy

* chore: improve copy

* chore: rename, add autofocus on swap inputs

* fix: swap in failed state when no lockup tx exists

* chore: add interval note to active swap component

* chore: remove boltz image

* chore: use hasChannelManagement check

* chore: use link instead of navigate

* chore: mark swaps as failed in case of errors

* chore: add comment

* chore: only mark swaps as failed in defer function

* chore: improve copy

* chore: update boltz client to v2.7.2

* chore: use refundSwapRequest param

* fix: refund swap method

* chore: minor changes

* chore: add retries

* chore: add retries and use single ws connection for pending swaps

* fix: swap fee error message

* chore: remove sending partial signature in swap in

* chore: log error when update channel is not ok

* fix: add tx claimed state in swap in listener

* chore: add nwc_swap_succeeded to whitelist and readme

* feat: use single boltz ws connection

* chore: only check for tx claimed state

* chore: use lock while sending updates

* chore: handle boltz update error

* chore: remove swap id from success event

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
Co-authored-by: Roland <33993199+rolznz@users.noreply.github.com>
Co-authored-by: Freepilot <215356755+freepilot-bot@users.noreply.github.com>
Co-authored-by: achaldps@gmail.com <achaldps@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nodii <13803869+NodeDiver@users.noreply.github.com>
Co-authored-by: Moritz Kaminski <moritz.kaminski@gmail.com>
Co-authored-by: René Aaron <rene@twentyuno.net>
Co-authored-by: Roman D <roman@dmitrienko.com>
2025-07-10 20:06:12 +07:00
Roland
66a1be6d16
Fix: sqlite connection parameters, add migrations to delete orphaned records and change postgres transaction amount to bigint (#1462)
* fix: sqlite pragma statement not applying to all sqlite connections

* fix: add migration to delete orphaned records

* fix: migrate postgres transaction amount column to bigint

* chore: simplify migration, update comment

* fix: sqlite uri when running tests

* fix: check that breaks tests

* fix: db locking within transaction

* fix: sqlite3 driver wrapper to execute PRAGMAs on each new connection (#1464)

* fix: sqlite3 driver wrapper to execute PRAGMAs on each new connection

* chore: add test to check temp_store value

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>

---------

Co-authored-by: Roman D <roman@dmitrienko.com>
2025-07-06 17:45:46 +07:00
Adithya Vardhan
546dcbf135
fix: use custom mempool url (#1431)
* fix: use custom mempool url

* chore: return mempool url in info endpoint

* chore: use mempool url from info response in frontend

* chore: remove default mempool url in frontend

* fix: tests
2025-06-24 21:23:19 +05:30
Adithya Vardhan
c653ae9090
feat: add BOLT-12 offers (#1242)
* feat: add BOLT-12 offers

* chore: display incoming bolt 12 payments in tx list

* chore: show bolt 12 button for users without alby account

* fix: check if bolt12payment fields are nil before assigning

* chore: do not pass in expiry

* fix: use checkLDKerr for error handling

* chore: add wails support

* chore: ui improvements

* chore: show bolt-12 for LDK backend type only

* chore: add offer info to tx metadata

* chore: use bolt12Offer

* fix: make offer description optional

* fix: remove incorrect log line

* chore: minor updates to node payBOLT12Offer command

* chore: remove unnecessary BOLT-12 offer copy

* chore: remove unused quantity

* chore: cleanup bolt12Offer usage in TransactionItem

* chore: prioritize lightning address, make bolt-12 copy consistent

* chore: rename generate offer to make offer

* fix: error handling

* chore: move payment hash into pay offer response

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2025-06-04 22:28:19 +07:00
Adithya Vardhan
9b6e88f1cc
feat: add option to edit fee while withdrawing (#1044)
* feat: add option to edit fee while withdrawing

* chore: add alert if fee rate exceeds fastest fee

* fix: tests

* feat: add support for LDK

* chore: do not accept decimal fee rates in frontend

* chore: minor withdraw UI improvements

* chore: make fee rate optional and update mockery

* chore: remove unnecessary else

* chore: do not format lottie files

* feat: add lotties files to prettier ignore

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2025-05-29 23:38:46 +07:00
frnandu
04fc9c90dc
feat: add hold invoices support for LND & LDK (#1298)
* feat: add LND hold invoices support

* fix: add HOLD_INVOICE_ACCEPTED_NOTIFICATION to notifications list returned by get_info

* fix: revert

* fix: remove unneeded null checks

* docs: add extra event type to README

* feat: add LND hold invoices support

* fix: add HOLD_INVOICE_ACCEPTED_NOTIFICATION to notifications list returned by get_info

* fix: revert

* fix: remove unneeded null checks

* docs: add extra event type to README

* fix: remove 0 expiry checking in the make_hold_invoice_controller

* fix: use JSON logging

* revert fly.toml

* fix: duplicated check

* fix: move publishing nwc_hold_invoice_accepted out of the transaction

* fix: move publishing nwc_hold_invoice_accepted out of the transaction

* fix: check the invoice state ACCEPTED before calling the lnClient.SettleHoldInvoice

* fix: check the invoice state ACCEPTED before calling the lnClient.SettleHoldInvoice

* fix: check the invoice state ACCEPTED before calling the lnClient.SettleHoldInvoice

* fix: check the invoice state ACCEPTED before calling the lnClient.SettleHoldInvoice

* fix: cancel hold invoice tests

* fix: make hold invoice tests

* fix: make hold invoice tests

* fix: settle hold invoice tests

* fix: resubscribe to pending hold invoices

* fix: missing WatchHoldInvoice
 in the mocks

* feat: add LDK impl

* fix: cleanup

* fix: payment_hash

* fix: remove unneeded update

* feat: add support for self payments for hold invoices (#1304)

Co-authored-by: frnandu <frnandu@gmail.com>

* fix: remove hold invoices scope

* fix: remove hold invoices scope

* fix: mock hold bolt11 expiry to 10 years

* fix: sleep 1 second to give a change of lookupinvoice to read cancelled

* fix: missing timeout param

* feat: add hold invoice settle deadline to transactions (#1324)

* chore: update mockery, remove unused hold invoice method

* chore: remove unnecessary comment

* chore: remove unused code

* fix: do not return hold transaction if lookup failed

* chore: remove unused code

* fix: return correct errors from nip47 controllers, remove unused code

* fix: failing test

* chore: remove unnecessary code

* fix: make error message more general

* chore: remove unused code

* fix: use correct context in lnd service

* fix: unstable hold payments test

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
Co-authored-by: Roland <33993199+rolznz@users.noreply.github.com>
2025-05-26 16:51:23 +07:00
im-adithya
cdc3cb497d chore: run mockery to fix tests 2025-05-14 18:59:15 +05:30
im-adithya
75794f4146 chore: change timeout seconds param to pointer 2025-05-14 18:32:52 +05:30
im-adithya
54e8616a3f chore: change param from isHoldInvoice to timeoutSeconds 2025-05-09 17:47:45 +05:30
im-adithya
c47810b7e6 chore: add support to pay hold invoices without cancelling 2025-05-08 16:54:30 +05:30
im-adithya
6caa2aa7d0 Merge branch 'master' into feat/auto-swaps 2025-05-06 12:48:26 +05:30
im-adithya
544b363ab3 fix: tests 2025-05-02 14:26:44 +05:30
Roland Bewick
153da0ee12 feat: add on-chain transactions to node page 2025-05-02 13:51:37 +07:00
im-adithya
a54b804636 chore: rename to disable auto swaps 2025-04-23 16:36:37 +05:30
im-adithya
842e05f7fb fix: tests 2025-04-18 16:05:54 +05:30
im-adithya
49649231ca fix: tests 2025-04-18 12:16:03 +05:30
im-adithya
75b4992da6 chore: further changes 2025-04-18 12:03:45 +05:30
im-adithya
fab261494a fix: swap logic 2025-04-17 19:50:54 +05:30
Roland
150d7bcc7a
Fix: postgres pay race condition (#1222)
* chore: add test for postgres race condition in transaction service

* fix: payments race condition when using postgres backend

* chore: reduce delay in concurrent payment tests
2025-03-25 17:31:19 +07:00
Adithya Vardhan
ae87f3a36f
fix: return offline channel balance in get_balance nwc call (#1217) 2025-03-24 19:40:07 +07:00
Adithya Vardhan
ab07ce4538
chore: switch to encryption tag from versioning (#1093)
* chore: switch to encryption tag from versioning

* chore: also support versioning

* chore: check version tag first

* Chore: nwc encryption feedback (#1137)

* chore: code cleanup, and responses for invalid encryption tag / unable to decrypt

* chore: add constants for encryption types

* chore: update test to cover when encryption tag is passed with no version

* chore: explain why we respond using nip-44 encryption if decryption fails

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
Co-authored-by: Roland <33993199+rolznz@users.noreply.github.com>
2025-03-03 12:50:17 +07:00