alby-hub/api/models.go

761 lines
30 KiB
Go
Raw Normal View History

2023-12-27 13:24:35 +07:00
package api
2024-02-10 22:28:58 +07:00
import (
2024-05-30 00:06:06 +07:00
"context"
"errors"
2024-06-17 19:42:09 +07:00
"io"
2024-02-10 22:28:58 +07:00
"time"
2024-07-05 20:32:40 +07:00
"github.com/getAlby/hub/alby"
"github.com/getAlby/hub/db"
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 18:36:12 +05:30
"github.com/getAlby/hub/swaps"
2024-02-10 22:28:58 +07:00
)
2023-12-27 13:24:35 +07:00
type API interface {
CreateApp(createAppRequest *CreateAppRequest) (*CreateAppResponse, error)
UpdateApp(app *db.App, updateAppRequest *UpdateAppRequest) error
Transfer(ctx context.Context, fromAppId *uint, toAppId *uint, amountMsat uint64, description string) error
DeleteApp(app *db.App) error
GetApp(app *db.App) (*App, error)
2025-07-29 20:57:18 +07:00
ListApps(limit uint64, offset uint64, filters ListAppsFilters, orderBy string) (*ListAppsResponse, error)
CreateLightningAddress(ctx context.Context, createLightningAddressRequest *CreateLightningAddressRequest) error
DeleteLightningAddress(ctx context.Context, appId uint) error
ListChannels(ctx context.Context) ([]Channel, error)
2024-05-30 00:06:06 +07:00
GetChannelPeerSuggestions(ctx context.Context) ([]alby.ChannelPeerSuggestion, error)
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 0b47438f501aee4b2a91827bec4267ac06072747. * 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
GetStories(ctx context.Context) ([]alby.Story, error)
GetLSPChannelOffer(ctx context.Context) (*alby.LSPChannelOffer, error)
2024-05-30 00:06:06 +07:00
ResetRouter(key string) error
ChangeUnlockPassword(changeUnlockPasswordRequest *ChangeUnlockPasswordRequest) error
SetAutoUnlockPassword(unlockPassword string) error
2024-05-30 00:06:06 +07:00
Stop() error
GetNodeConnectionInfo(ctx context.Context) (*NodeConnectionInfo, error)
GetNodeStatus(ctx context.Context) (*NodeStatus, error)
ListPeers(ctx context.Context) ([]PeerDetails, error)
2024-05-30 00:06:06 +07:00
ConnectPeer(ctx context.Context, connectPeerRequest *ConnectPeerRequest) error
DisconnectPeer(ctx context.Context, peerId string) error
2024-05-30 00:06:06 +07:00
OpenChannel(ctx context.Context, openChannelRequest *OpenChannelRequest) (*OpenChannelResponse, error)
RebalanceChannel(ctx context.Context, rebalanceChannelRequest *RebalanceChannelRequest) (*RebalanceChannelResponse, error)
2024-05-30 00:06:06 +07:00
CloseChannel(ctx context.Context, peerId, channelId string, force bool) (*CloseChannelResponse, error)
UpdateChannel(ctx context.Context, updateChannelRequest *UpdateChannelRequest) error
MakeOffer(ctx context.Context, description string) (string, error)
GetNewOnchainAddress(ctx context.Context) (string, error)
GetUnusedOnchainAddress(ctx context.Context) (string, error)
2024-05-30 00:06:06 +07:00
SignMessage(ctx context.Context, message string) (*SignMessageResponse, error)
RedeemOnchainFunds(ctx context.Context, toAddress string, amountSat uint64, feeRate *uint64, sendAll bool) (*RedeemOnchainFundsResponse, error)
2024-05-30 00:06:06 +07:00
GetBalances(ctx context.Context) (*BalancesResponse, error)
ListTransactions(ctx context.Context, appId *uint, limit uint64, offset uint64) (*ListTransactionsResponse, error)
ListOnchainTransactions(ctx context.Context) ([]OnchainTransaction, error)
SendPayment(ctx context.Context, invoice string, amountMsat *uint64, metadata map[string]interface{}, fromAppId *uint) (*SendPaymentResponse, error)
CreateInvoice(ctx context.Context, amountMsat uint64, description string) (*MakeInvoiceResponse, error)
LookupInvoice(ctx context.Context, paymentHash string) (*LookupInvoiceResponse, error)
feat: user labels for transactions (#2265) * feat: user labels poc * feat: backend for transaction user labels Add PATCH /api/transactions/:paymentHash/label that merges a user-supplied {key:value} map into the existing transaction metadata under the user_label key, preserving NIP-47 fields. Empty map clears the labels. Trims whitespace, drops blank rows, caps key/value length. Wire the frontend editor to call the endpoint and revalidate the transactions SWR cache on success. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: include user labels as columns in CSV export Collect the union of user_label keys across all exported transactions and emit each one as its own label_<key> column. The existing metadata JSON column is preserved so importers like Raccoin keep working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: drop hardcoded label suggestions, autocomplete from prior keys Open the editor with a single blank row instead of four pre-seeded fields. Suggest label keys via a datalist populated from any user_label keys already present in the SWR transactions cache, so suggestions reflect the user's own taxonomy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: inline label editor and indicator-only list row Replace the nested label dialog with an inline editor that toggles within the existing transaction detail dialog, removing dialog stacking. In the transactions list, replace per-label badges with a single tag icon next to the timestamp so row height stays uniform; the full labels remain visible in the detail view. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix: don't bump updated_at on metadata-only edits GORM's Update auto-touches updated_at, which made the transactions list reorder labeled transactions to the top. Switch SetTransactionMetadata to UpdateColumn so only the metadata column changes. Add regression test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: route PATCH transaction label requests in wails The desktop app routes API calls through WailsRequestRouter rather than HTTP. Add a handler for PATCH /api/transactions/:hash/label before the existing transaction lookup so labels work in Wails too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: finalize backend * chore: rename to labels * chore: finalize frontend * chore: use tx id to add user labels * chore: address minor nits * fix: linting * fix: use explicit primary key lookups * chore: simplify transaction csv label export * fix(frontend): drop label count from transaction list badge The count adds visual weight without informing any decision from the list view. The icon-as-badge already signals labels exist; the actual values are in the details dialog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(frontend): revert transaction list label indicator to bare icon The Badge wrapper made the icon-only indicator wider than tall, which looked off. Restores the pre-PR look — a small TagIcon next to the timestamp — since the in-dialog editor is the place to see actual labels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2026-04-30 13:13:07 +02:00
SetTransactionUserLabels(ctx context.Context, id uint, labels map[string]string) error
RequestMempoolApi(ctx context.Context, endpoint string) (interface{}, error)
2024-05-30 00:06:06 +07:00
GetInfo(ctx context.Context) (*InfoResponse, error)
GetMnemonic(unlockPassword string) (*MnemonicResponse, error)
2024-05-30 00:06:06 +07:00
SetNextBackupReminder(backupReminderRequest *BackupReminderRequest) error
Start(startRequest *StartRequest)
2024-05-30 00:06:06 +07:00
Setup(ctx context.Context, setupRequest *SetupRequest) error
GetNetworkGraph(ctx context.Context, nodeIds []string) (NetworkGraphResponse, error)
2024-05-30 00:06:06 +07:00
SyncWallet() error
GetLogOutput(ctx context.Context, logType string, getLogRequest *GetLogOutputRequest) (*GetLogOutputResponse, error)
RequestLSPOrder(ctx context.Context, request *LSPOrderRequest) (*LSPOrderResponse, error)
2024-06-17 19:42:09 +07:00
CreateBackup(unlockPassword string, w io.Writer) error
RestoreBackup(unlockPassword string, r io.Reader) error
MigrateNodeStorage(ctx context.Context, to string) error
GetWalletCapabilities(ctx context.Context) (*WalletCapabilitiesResponse, error)
Health(ctx context.Context) (*HealthResponse, error)
UpdateSettings(updateSettingsRequest *UpdateSettingsRequest) error
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 18:36:12 +05:30
LookupSwap(swapId string) (*LookupSwapResponse, error)
ListSwaps() (*ListSwapsResponse, error)
feat: add swap out and onchain withdraw to send flow (#1582) * chore: remove balance card and fix layout * chore: change send screen styling * feat: add onchain send * feat: send exact amount in swap outs * chore: address feedback * chore: change swap transaction title and add to address * chore: refactor zero amount screen and remove confirmation * chore: add x icon to recipient in lnurl pay * chore: split onchain send page into separate components * fix: set headers and remove send layout * chore: show warning if balance is low * chore: change name to PendingPaymentAlert * chore: add increase balance warning on exceeding amount * chore: minor changes * chore: remove you'll be notified message * chore: add on-chain transactions alert on wallet page * chore: align sending and payment pending alerts * chore: make sure amount doesn't reset * fix: small onchain amount alert copy * chore: rename isSending to useExactReceiveAmount * chore: add mempool and anchor reserves alert to onchain send screen * chore: use spending alert consistently and remove red text * chore: add option to edit fee rate * fix: styling after tailwind upgrade * feat: add swap in and onchain deposit to receive flow (#1585) * chore: remove receive layout * feat: add onchain address to receive flow * feat: add receive screen to swap in and deposit bitcoin * chore: rename import to MIN_SWAP_AMOUNT * chore: add onchain button when alby account is disconnected * fix: link * chore: add OnchainAddressDisplay and use useSearchParams hook * fix: use actual swap limits from boltz api (#1598) * fix: create another invoice button * chore: use fee rate instead of network fee * fix: styling after tailwind upgrade * chore: rename swap fees to swap info * chore: use lottie loading component * chore: add mempool alert * chore: make swaps the default option for send/receive onchain --------- Co-authored-by: Roland Bewick <roland.bewick@gmail.com> * chore: consistently show fee rate in sat/vByte * chore: minor copy changes --------- Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2025-08-15 16:58:00 +05:30
GetSwapInInfo() (*SwapInfoResponse, error)
GetSwapOutInfo() (*SwapInfoResponse, error)
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 18:36:12 +05:30
InitiateSwapIn(ctx context.Context, initiateSwapInRequest *InitiateSwapRequest) (*swaps.SwapResponse, error)
InitiateSwapOut(ctx context.Context, initiateSwapOutRequest *InitiateSwapRequest) (*swaps.SwapResponse, error)
RefundSwap(refundSwapRequest *RefundSwapRequest) error
GetSwapMnemonic() string
GetAutoSwapConfig() (*GetAutoSwapConfigResponse, error)
EnableAutoSwapOut(ctx context.Context, autoSwapRequest *EnableAutoSwapRequest) error
DisableAutoSwap() error
SetNodeAlias(nodeAlias string) error
GetCustomNodeCommands() (*CustomNodeCommandsResponse, error)
ExecuteCustomNodeCommand(ctx context.Context, command string) (interface{}, error)
SendEvent(event string, properties interface{})
GetForwards() (*GetForwardsResponse, error)
}
var ErrLNClientNotStarted = errors.New("LNClient not started")
2023-12-27 13:24:35 +07:00
type App struct {
ID uint `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
AppPubkey string `json:"appPubkey"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastUsedAt *time.Time `json:"lastUsedAt"`
LastSettledTransactionAt *time.Time `json:"lastSettledTransactionAt"`
ExpiresAt *time.Time `json:"expiresAt"`
Scopes []string `json:"scopes"`
MaxAmount uint64 `json:"maxAmount"` // deprecated
MaxAmountSat uint64 `json:"maxAmountSat"`
MaxAmountMsat uint64 `json:"maxAmountMsat"`
BudgetUsage uint64 `json:"budgetUsage"` // deprecated
BudgetUsageSat uint64 `json:"budgetUsageSat"`
BudgetUsageMsat uint64 `json:"budgetUsageMsat"`
BudgetRenewal string `json:"budgetRenewal"`
Isolated bool `json:"isolated"`
WalletPubkey string `json:"walletPubkey"`
UniqueWalletPubkey bool `json:"uniqueWalletPubkey"`
Balance int64 `json:"balance"` // deprecated
BalanceSat int64 `json:"balanceSat"`
BalanceMsat int64 `json:"balanceMsat"`
Metadata Metadata `json:"metadata,omitempty"`
2023-12-27 13:24:35 +07:00
}
2025-07-29 20:57:18 +07:00
type ListAppsFilters struct {
Name string `json:"name"`
AppStoreAppId string `json:"appStoreAppId"`
Unused bool `json:"unused"`
SubWallets *bool `json:"subWallets"`
2025-07-29 20:57:18 +07:00
}
2023-12-27 13:24:35 +07:00
type ListAppsResponse struct {
Apps []App `json:"apps"`
TotalCount uint64 `json:"totalCount"`
TotalBalance *int64 `json:"totalBalance,omitempty"` // deprecated
TotalBalanceSat *int64 `json:"totalBalanceSat,omitempty"`
TotalBalanceMsat *int64 `json:"totalBalanceMsat,omitempty"`
2023-12-27 13:24:35 +07:00
}
2024-03-11 22:17:02 +05:30
type UpdateAppRequest struct {
Name *string `json:"name"`
MaxAmount *uint64 `json:"maxAmount"` // deprecated
MaxAmountSat *uint64 `json:"maxAmountSat"`
MaxAmountMsat *uint64 `json:"maxAmountMsat"`
BudgetRenewal *string `json:"budgetRenewal"`
ExpiresAt *string `json:"expiresAt"`
UpdateExpiresAt bool `json:"updateExpiresAt"`
Scopes []string `json:"scopes"`
Metadata *Metadata `json:"metadata"`
Isolated *bool `json:"isolated"`
2024-03-11 22:17:02 +05:30
}
type TransferRequest struct {
AmountSat *uint64 `json:"amountSat"`
AmountMsat *uint64 `json:"amountMsat"`
FromAppId *uint `json:"fromAppId"`
ToAppId *uint `json:"toAppId"`
Description string `json:"description"`
}
2024-01-02 15:40:19 +05:30
type CreateAppRequest struct {
Feat: NWA auth for self-hosted hubs (#1016) * feat: nwc create_connection command (WIP) * feat: allow creating superuser apps from the ui * fix: pass methods rather than scopes in create_connection method * chore: add extra tests * fix: use browser router in http mode * fix: update links to not use hash router * fix: add redirect from hash router url * fix: return nostrWalletConnectUrl in nwc connection success event and message * feat: publish nwa event * chore: use nwc info event instead of nwa event * feat: create custom alby go detail page * chore: allow creating/editing apps with the same name * fix: convert budget from msats to sats (#1111) * chore: address NWA feedback * chore: address feedback - adjust button copy - make create_connection methods consistent with http deeplink flow - remove unused constant - add empty string check before adding lud16 tag - fix test * feat: add support for notification_types in create_connection method * fix: shorter button copy * fix: do not include lud16 tag in published info event * Feat: add lud16 to get_info response (#1128) feat: add lud16 to get_info response * chore: minor alby go screen improvements * fix: incorrect unlock password error message to create app with superuser access * chore: minor ui improvements on alby go detail page * chore: avoid duplicate app names by adding a suffix * chore: move scopes check to apps service, add new tests, DRY controller test setup * fix: scopes component full access scopes and isolated scope group check * fix: use supported capabilities for Alby Go * fix: return correct app name * chore: address minor comments --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2025-02-27 19:12:55 +07:00
Name string `json:"name"`
Pubkey string `json:"pubkey"`
MaxAmount *uint64 `json:"maxAmount"` // deprecated
MaxAmountSat *uint64 `json:"maxAmountSat"`
MaxAmountMsat *uint64 `json:"maxAmountMsat"`
Feat: NWA auth for self-hosted hubs (#1016) * feat: nwc create_connection command (WIP) * feat: allow creating superuser apps from the ui * fix: pass methods rather than scopes in create_connection method * chore: add extra tests * fix: use browser router in http mode * fix: update links to not use hash router * fix: add redirect from hash router url * fix: return nostrWalletConnectUrl in nwc connection success event and message * feat: publish nwa event * chore: use nwc info event instead of nwa event * feat: create custom alby go detail page * chore: allow creating/editing apps with the same name * fix: convert budget from msats to sats (#1111) * chore: address NWA feedback * chore: address feedback - adjust button copy - make create_connection methods consistent with http deeplink flow - remove unused constant - add empty string check before adding lud16 tag - fix test * feat: add support for notification_types in create_connection method * fix: shorter button copy * fix: do not include lud16 tag in published info event * Feat: add lud16 to get_info response (#1128) feat: add lud16 to get_info response * chore: minor alby go screen improvements * fix: incorrect unlock password error message to create app with superuser access * chore: minor ui improvements on alby go detail page * chore: avoid duplicate app names by adding a suffix * chore: move scopes check to apps service, add new tests, DRY controller test setup * fix: scopes component full access scopes and isolated scope group check * fix: use supported capabilities for Alby Go * fix: return correct app name * chore: address minor comments --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2025-02-27 19:12:55 +07:00
BudgetRenewal string `json:"budgetRenewal"`
ExpiresAt string `json:"expiresAt"`
Scopes []string `json:"scopes"`
ReturnTo string `json:"returnTo"`
Isolated bool `json:"isolated"`
Metadata Metadata `json:"metadata,omitempty"`
UnlockPassword string `json:"unlockPassword"`
2024-01-02 15:40:19 +05:30
}
type CreateLightningAddressRequest struct {
Address string `json:"address"`
AppId uint `json:"appId"`
}
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 18:36:12 +05:30
type InitiateSwapRequest struct {
SwapAmount *uint64 `json:"swapAmount"` // deprecated
SwapAmountSat *uint64 `json:"swapAmountSat"`
Destination string `json:"destination"`
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 18:36:12 +05:30
}
type RefundSwapRequest struct {
SwapId string `json:"swapId"`
Address string `json:"address"`
}
type EnableAutoSwapRequest struct {
BalanceThreshold *uint64 `json:"balanceThreshold"` // deprecated
BalanceThresholdSat *uint64 `json:"balanceThresholdSat"`
SwapAmount *uint64 `json:"swapAmount"` // deprecated
SwapAmountSat *uint64 `json:"swapAmountSat"`
Destination string `json:"destination"`
DestinationType string `json:"destinationType"`
UnlockPassword string `json:"unlockPassword"`
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 18:36:12 +05:30
}
type GetAutoSwapConfigResponse struct {
Type string `json:"type"`
Enabled bool `json:"enabled"`
BalanceThreshold uint64 `json:"balanceThreshold"` // deprecated
BalanceThresholdSat uint64 `json:"balanceThresholdSat"`
SwapAmount uint64 `json:"swapAmount"` // deprecated
SwapAmountSat uint64 `json:"swapAmountSat"`
Destination string `json:"destination"`
2025-04-18 16:01:38 +05:30
}
feat: add swap out and onchain withdraw to send flow (#1582) * chore: remove balance card and fix layout * chore: change send screen styling * feat: add onchain send * feat: send exact amount in swap outs * chore: address feedback * chore: change swap transaction title and add to address * chore: refactor zero amount screen and remove confirmation * chore: add x icon to recipient in lnurl pay * chore: split onchain send page into separate components * fix: set headers and remove send layout * chore: show warning if balance is low * chore: change name to PendingPaymentAlert * chore: add increase balance warning on exceeding amount * chore: minor changes * chore: remove you'll be notified message * chore: add on-chain transactions alert on wallet page * chore: align sending and payment pending alerts * chore: make sure amount doesn't reset * fix: small onchain amount alert copy * chore: rename isSending to useExactReceiveAmount * chore: add mempool and anchor reserves alert to onchain send screen * chore: use spending alert consistently and remove red text * chore: add option to edit fee rate * fix: styling after tailwind upgrade * feat: add swap in and onchain deposit to receive flow (#1585) * chore: remove receive layout * feat: add onchain address to receive flow * feat: add receive screen to swap in and deposit bitcoin * chore: rename import to MIN_SWAP_AMOUNT * chore: add onchain button when alby account is disconnected * fix: link * chore: add OnchainAddressDisplay and use useSearchParams hook * fix: use actual swap limits from boltz api (#1598) * fix: create another invoice button * chore: use fee rate instead of network fee * fix: styling after tailwind upgrade * chore: rename swap fees to swap info * chore: use lottie loading component * chore: add mempool alert * chore: make swaps the default option for send/receive onchain --------- Co-authored-by: Roland Bewick <roland.bewick@gmail.com> * chore: consistently show fee rate in sat/vByte * chore: minor copy changes --------- Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2025-08-15 16:58:00 +05:30
type SwapInfoResponse struct {
AlbyServiceFee float64 `json:"albyServiceFee"`
BoltzServiceFee float64 `json:"boltzServiceFee"`
BoltzNetworkFee uint64 `json:"boltzNetworkFee"` // deprecated
BoltzNetworkFeeSat uint64 `json:"boltzNetworkFeeSat"`
MinAmount uint64 `json:"minAmount"` // deprecated
MinAmountSat uint64 `json:"minAmountSat"`
MaxAmount uint64 `json:"maxAmount"` // deprecated
MaxAmountSat uint64 `json:"maxAmountSat"`
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 18:36:12 +05:30
}
type ListSwapsResponse struct {
Swaps []Swap `json:"swaps"`
}
type LookupSwapResponse = Swap
type Swap struct {
Id string `json:"id"`
Type string `json:"type"`
State string `json:"state"`
Invoice string `json:"invoice"`
SendAmount uint64 `json:"sendAmount"` // deprecated
SendAmountSat uint64 `json:"sendAmountSat"`
ReceiveAmount uint64 `json:"receiveAmount"` // deprecated
ReceiveAmountSat uint64 `json:"receiveAmountSat"`
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 18:36:12 +05:30
PaymentHash string `json:"paymentHash"`
DestinationAddress string `json:"destinationAddress"`
RefundAddress string `json:"refundAddress"`
LockupAddress string `json:"lockupAddress"`
LockupTxId string `json:"lockupTxId"`
ClaimTxId string `json:"claimTxId"`
AutoSwap bool `json:"autoSwap"`
BoltzPubkey string `json:"boltzPubkey"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
2025-08-29 16:47:31 +07:00
UsedXpub bool `json:"usedXpub"`
2025-04-16 20:58:32 +05:30
}
2024-01-21 13:08:16 +01:00
type StartRequest struct {
UnlockPassword string `json:"unlockPassword"`
2024-01-21 13:08:16 +01:00
}
2024-01-30 23:30:39 +07:00
type UnlockRequest struct {
UnlockPassword string `json:"unlockPassword"`
TokenExpiryDays *uint64 `json:"tokenExpiryDays"`
Permission string `json:"permission,omitempty"` // "full" or "readonly"
2024-01-30 23:30:39 +07:00
}
2024-03-21 12:38:27 +05:30
type BackupReminderRequest struct {
NextBackupReminder string `json:"nextBackupReminder"`
}
type SendEventRequest struct {
Event string `json:"event"`
Properties interface{} `json:"properties"`
}
type SetupRequest struct {
LNBackendType string `json:"backendType"`
UnlockPassword string `json:"unlockPassword"`
2024-02-09 15:05:11 +07:00
Mnemonic string `json:"mnemonic"`
NextBackupReminder string `json:"nextBackupReminder"`
2024-02-09 15:05:11 +07:00
// LND fields
2024-01-16 20:41:18 +07:00
LNDAddress string `json:"lndAddress"`
LNDCertFile string `json:"lndCertFile"`
LNDMacaroonFile string `json:"lndMacaroonFile"`
// Phoenixd fields
PhoenixdAddress string `json:"phoenixdAddress"`
PhoenixdAuthorization string `json:"phoenixdAuthorization"`
2024-06-03 20:25:04 +07:00
// Cashu fields
CashuMintUrl string `json:"cashuMintUrl"`
feat: add CLN backend (#2026) * feat: add CLN as a lnclient backend * feat: add hold invoice support for CLN backend * fix: reduce CLN form to just addresses and lightning dir * feat: add README for CLN grpc go code generation * fix: cln backend does not support keysend with given preimages * fix: hold invoice notifications in CLN backend * fix: remove dead code in CLN backend from ListTransactions * fix: env example CLN_ADDRESS_HOLD with different port to show it's a different service * fix: cleanup of CLN ressources in all cases * fix: cln backend's GetNetworkGraph only fetches specified nodeId's * fix: cln backend: only advertise hold methods for nip47 if hold plugin enabled * fix: cln's Shutdown should not stop CLN itself * fix: relax the LND README line regarding env configuration * fix: more nil checks in clnInvoiceToTransaction * fix: prevent feerate overflow in CLN's RedeemOnchainFunds * fix: don't access nil errors for empty reponses of certain CLN methods * fix: nil instead of empty string in cln's GetNetworkGraph return types * fix: nil checks for created_at in cln's clnInvoiceToTransaction * fix: set minimum tls version to 1.2 for cln backend grpc connections * fix: cln's subscribeOpenHoldInvoices doesn't give up as fast * fix: deduplicate graph edges in cln's GetNetworkGraph * fix: print the error string, not pointer address, in cln's ListChannels * fix: remove cln's ListTransactions completely * fix: use ListPeers instead of ListPeerChannels in cln's ListPeers * feat: cln's MakeHoldInvoice supports minCltvExpiryDelta * fix: use named return err in NewCLNService * fix: cln listpeers log message * fix: incorrect import * fix: compile errors after rename --------- Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2026-05-03 21:36:13 +02:00
// CLN fields
CLNAddress string `json:"clnAddress"`
CLNLightningDir string `json:"clnLightningDir"`
CLNAddressHold string `json:"clnAddressHold"`
}
2023-12-27 13:24:35 +07:00
type CreateAppResponse struct {
PairingUri string `json:"pairingUri"`
PairingSecret string `json:"pairingSecretKey"`
Pubkey string `json:"pairingPublicKey"`
RelayUrls []string `json:"relayUrls"`
WalletPubkey string `json:"walletPubkey"`
Lud16 string `json:"lud16"`
Id uint `json:"id"`
Name string `json:"name"`
ReturnTo string `json:"returnTo"`
2023-12-27 13:24:35 +07:00
}
type User struct {
Email string `json:"email"`
}
type InfoResponseRelay struct {
Url string `json:"url"`
Online bool `json:"online"`
}
2023-12-27 13:24:35 +07:00
type InfoResponse struct {
BackendType string `json:"backendType"`
SetupCompleted bool `json:"setupCompleted"`
OAuthRedirect bool `json:"oauthRedirect"`
Running bool `json:"running"`
Unlocked bool `json:"unlocked"`
AlbyAuthUrl string `json:"albyAuthUrl"`
NextBackupReminder string `json:"nextBackupReminder"`
AlbyUserIdentifier string `json:"albyUserIdentifier"`
AlbyAccountConnected bool `json:"albyAccountConnected"`
Version string `json:"version"`
Network string `json:"network"`
EnableAdvancedSetup bool `json:"enableAdvancedSetup"`
LdkVssEnabled bool `json:"ldkVssEnabled"`
VssSupported bool `json:"vssSupported"`
StartupState string `json:"startupState"`
StartupError string `json:"startupError"`
StartupErrorTime time.Time `json:"startupErrorTime"`
AutoUnlockPasswordSupported bool `json:"autoUnlockPasswordSupported"`
AutoUnlockPasswordEnabled bool `json:"autoUnlockPasswordEnabled"`
Currency string `json:"currency"`
BitcoinDisplayFormat string `json:"bitcoinDisplayFormat"`
Relays []InfoResponseRelay `json:"relays"`
NodeAlias string `json:"nodeAlias"`
MempoolUrl string `json:"mempoolUrl"`
ChainDataSourceType string `json:"chainDataSourceType,omitempty"`
ChainDataSourceAddress string `json:"chainDataSourceAddress,omitempty"`
feat: just in time channels with lsps2 (#2275) * feat: just in time channels with lsps2 * fix: clarify JIT receive channel fee * fix: fees * fix: fees 2 * fix: don't show low inbound when LSPS2 is active * fix: remove the receive limit below the input if LSPS2 is being used * fix: simplify * fix: bring back fee % for outgoing * fix: remove unneeded changes * fix: typo * fix: unneeded * fix: don't show open first channel is LSPS2 * feat: clearer JIT channel fee copy on receive screen * fix: add LSPS2 var info * fix: don't duplicate JIT fee hint on create invoice form * fix: make paymentDone a standard boolean * fix: update to golang:1.26 in Dockerfile * feat: read LSPS2 sources from channel suggestions, set minimum receive amount, update guide link * docs: update LDK_LSPS2_ADDRESSES to be used as an override * fix: only show minimum jit receive amount on validation error * fix: add more detail to receive error when receiving low amounts with jit * fix: do not use JIT when user has public channels * feat: add option to disable JIT * fix: isTrusted check, add jit property to event * fix: do not require node restart for toggling JIT * chore: simplify JIT alert * chore: add guide link on node settings JIT description * feat: fetch the lsp2info to have access to params like minimum/maximum payment size * refactor: share single learn-more link across JIT fee hint branches * fix: remove variable amount invoice support * fix: use lsps2info for min payment size and remove channelPeerSuggestion usage of minimumChannelSize * fix: only do amount validation according to lsps2Info values if jit is enabled in settings * feat: add jit first payment fee alert on receive via lightning address * fix: remove unnecessary conditional * fix: ensure at least one sat is left over when opening JIT channel * chore: remove hardcoded suggestions * chore: rename JIT enabled config variable * fix: ui checks when JIT is disabled * fix: amount input validation message * fix: formatting --------- Co-authored-by: anon <anon@anon.com> Co-authored-by: saunter <68239231+stackingsaunter@users.noreply.github.com> Co-authored-by: fmar <fmar@fmar> Co-authored-by: René Aaron <rene@twentyuno.net> Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2026-06-10 09:47:07 +02:00
JitChannelsLiquiditySource string `json:"jitChannelsLiquiditySource,omitempty"`
JitChannelsMinPaymentSizeMsat *uint64 `json:"jitChannelsMinPaymentSizeMsat,omitempty"`
JitChannelsMaxPaymentSizeMsat *uint64 `json:"jitChannelsMaxPaymentSizeMsat,omitempty"`
JitChannelsEnabled bool `json:"jitChannelsEnabled"`
HideUpdateBanner bool `json:"hideUpdateBanner"`
SupportsBolt12 bool `json:"supportsBolt12"`
}
type UpdateSettingsRequest struct {
Currency string `json:"currency"`
BitcoinDisplayFormat string `json:"bitcoinDisplayFormat"`
feat: just in time channels with lsps2 (#2275) * feat: just in time channels with lsps2 * fix: clarify JIT receive channel fee * fix: fees * fix: fees 2 * fix: don't show low inbound when LSPS2 is active * fix: remove the receive limit below the input if LSPS2 is being used * fix: simplify * fix: bring back fee % for outgoing * fix: remove unneeded changes * fix: typo * fix: unneeded * fix: don't show open first channel is LSPS2 * feat: clearer JIT channel fee copy on receive screen * fix: add LSPS2 var info * fix: don't duplicate JIT fee hint on create invoice form * fix: make paymentDone a standard boolean * fix: update to golang:1.26 in Dockerfile * feat: read LSPS2 sources from channel suggestions, set minimum receive amount, update guide link * docs: update LDK_LSPS2_ADDRESSES to be used as an override * fix: only show minimum jit receive amount on validation error * fix: add more detail to receive error when receiving low amounts with jit * fix: do not use JIT when user has public channels * feat: add option to disable JIT * fix: isTrusted check, add jit property to event * fix: do not require node restart for toggling JIT * chore: simplify JIT alert * chore: add guide link on node settings JIT description * feat: fetch the lsp2info to have access to params like minimum/maximum payment size * refactor: share single learn-more link across JIT fee hint branches * fix: remove variable amount invoice support * fix: use lsps2info for min payment size and remove channelPeerSuggestion usage of minimumChannelSize * fix: only do amount validation according to lsps2Info values if jit is enabled in settings * feat: add jit first payment fee alert on receive via lightning address * fix: remove unnecessary conditional * fix: ensure at least one sat is left over when opening JIT channel * chore: remove hardcoded suggestions * chore: rename JIT enabled config variable * fix: ui checks when JIT is disabled * fix: amount input validation message * fix: formatting --------- Co-authored-by: anon <anon@anon.com> Co-authored-by: saunter <68239231+stackingsaunter@users.noreply.github.com> Co-authored-by: fmar <fmar@fmar> Co-authored-by: René Aaron <rene@twentyuno.net> Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2026-06-10 09:47:07 +02:00
JitChannelsEnabled *bool `json:"jitChannelsEnabled"`
}
type SetNodeAliasRequest struct {
NodeAlias string `json:"nodeAlias"`
}
type MnemonicRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
type MnemonicResponse struct {
Mnemonic string `json:"mnemonic"`
2023-12-27 13:24:35 +07:00
}
2024-02-10 22:28:58 +07:00
2024-04-04 12:00:40 +07:00
type ChangeUnlockPasswordRequest struct {
CurrentUnlockPassword string `json:"currentUnlockPassword"`
NewUnlockPassword string `json:"newUnlockPassword"`
}
type AutoUnlockRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
2024-04-04 12:00:40 +07:00
type ConnectPeerRequest struct {
Pubkey string `json:"pubkey"`
Address string `json:"address"`
Port uint16 `json:"port"`
}
type OpenChannelRequest struct {
Pubkey string `json:"pubkey"`
AmountSats int64 `json:"amountSats"`
Public bool `json:"public"`
}
type OpenChannelResponse struct {
FundingTxId string `json:"fundingTxId"`
}
type CloseChannelResponse struct {
}
type UpdateChannelRequest struct {
ChannelId string `json:"channelId"`
NodeId string `json:"nodeId"`
ForwardingFeeBaseMsat uint32 `json:"forwardingFeeBaseMsat"`
ForwardingFeeProportionalMillionths uint32 `json:"forwardingFeeProportionalMillionths"`
MaxDustHtlcExposureFromFeeRateMultiplier uint64 `json:"maxDustHtlcExposureFromFeeRateMultiplier"`
}
type NodeConnectionInfo struct {
Pubkey string `json:"pubkey"`
Address string `json:"address"`
Port int `json:"port"`
}
type NodeStatus struct {
IsReady bool `json:"isReady"`
InternalNodeStatus interface{} `json:"internalNodeStatus"`
}
type PeerDetails struct {
NodeId string `json:"nodeId"`
Address string `json:"address"`
IsPersisted bool `json:"isPersisted"`
IsConnected bool `json:"isConnected"`
}
type OnchainTransaction struct {
AmountSat uint64 `json:"amountSat"`
CreatedAt uint64 `json:"createdAt"`
State string `json:"state"`
Type string `json:"type"`
NumConfirmations uint32 `json:"numConfirmations"`
TxId string `json:"txId"`
}
type PendingBalanceDetails struct {
ChannelId string `json:"channelId"`
NodeId string `json:"nodeId"`
Amount uint64 `json:"amount"` // deprecated
AmountSat uint64 `json:"amountSat"`
FundingTxId string `json:"fundingTxId"`
FundingTxVout uint32 `json:"fundingTxVout"`
}
type RebalanceChannelRequest struct {
ReceiveThroughNodePubkey string `json:"receiveThroughNodePubkey"`
AmountSat *uint64 `json:"amountSat"`
AmountMsat *uint64 `json:"amountMsat"`
}
type RebalanceChannelResponse struct {
TotalFeeSat uint64 `json:"totalFeeSat"`
TotalFeeMsat uint64 `json:"totalFeeMsat"`
}
2024-02-27 12:01:02 +07:00
type RedeemOnchainFundsRequest struct {
ToAddress string `json:"toAddress"`
Amount *uint64 `json:"amount"` // deprecated
AmountSat *uint64 `json:"amountSat"`
FeeRate *uint64 `json:"feeRate"`
SendAll bool `json:"sendAll"`
}
2024-02-27 12:01:02 +07:00
type RedeemOnchainFundsResponse struct {
TxId string `json:"txId"`
}
type OnchainBalanceResponse struct {
Spendable int64 `json:"spendable"` // deprecated
SpendableSat int64 `json:"spendableSat"`
Total int64 `json:"total"` // deprecated
TotalSat int64 `json:"totalSat"`
Reserved int64 `json:"reserved"` // deprecated
ReservedSat int64 `json:"reservedSat"`
PendingBalancesFromChannelClosures uint64 `json:"pendingBalancesFromChannelClosures"` // deprecated
PendingBalancesFromChannelClosuresSat uint64 `json:"pendingBalancesFromChannelClosuresSat"`
PendingBalancesDetails []PendingBalanceDetails `json:"pendingBalancesDetails"`
PendingSweepBalancesDetails []PendingBalanceDetails `json:"pendingSweepBalancesDetails"`
InternalBalances interface{} `json:"internalBalances"`
}
type LightningBalanceResponse struct {
TotalSpendable int64 `json:"totalSpendable"` // deprecated
TotalSpendableSat int64 `json:"totalSpendableSat"`
TotalSpendableMsat int64 `json:"totalSpendableMsat"`
TotalReceivable int64 `json:"totalReceivable"` // deprecated
TotalReceivableSat int64 `json:"totalReceivableSat"`
TotalReceivableMsat int64 `json:"totalReceivableMsat"`
NextMaxSpendable int64 `json:"nextMaxSpendable"` // deprecated
NextMaxSpendableSat int64 `json:"nextMaxSpendableSat"`
NextMaxSpendableMsat int64 `json:"nextMaxSpendableMsat"`
NextMaxReceivable int64 `json:"nextMaxReceivable"` // deprecated
NextMaxReceivableSat int64 `json:"nextMaxReceivableSat"`
NextMaxReceivableMsat int64 `json:"nextMaxReceivableMsat"`
NextMaxSpendableMPP int64 `json:"nextMaxSpendableMPP"` // deprecated
NextMaxSpendableMPPSat int64 `json:"nextMaxSpendableMPPSat"`
NextMaxSpendableMPPMsat int64 `json:"nextMaxSpendableMPPMsat"`
NextMaxReceivableMPP int64 `json:"nextMaxReceivableMPP"` // deprecated
NextMaxReceivableMPPSat int64 `json:"nextMaxReceivableMPPSat"`
NextMaxReceivableMPPMsat int64 `json:"nextMaxReceivableMPPMsat"`
}
type BalancesResponse struct {
Onchain OnchainBalanceResponse `json:"onchain"`
Lightning LightningBalanceResponse `json:"lightning"`
}
Feat: dynamic budgets (#226) * feat: add transactions table * feat: add transactions service with makeinvoice method * feat: use internal transactions WIP * feat: check unsettled transactions * feat: use transactions service in nip47 package WIP * feat: use transactions service in NIP-47 handlers * fix: transaction list colors * fix: tests * chore: remove old payments table * fix: return budget usage as sats * feat: use internal transactions table for keysend payments * feat: consume nwc_payment_received event in transaction service (WIP) * feat: update existing transaction from nwc_payment_received event in transactions service * feat: update existing transaction from nwc_payment_sent event in transactions service * feat: handle async payment failed events in transactions service * fix: tests * feat: correctly implement NIP-47 NOT_FOUND error code * feat: intercept self payments * feat: isolated balance and visibility * feat: validate keysend payment does not exceed app internal balance * feat: budget check in transactions service, correctly pass payment errors to NIP-47 response also reduce query duplication * fix: order transactions when looking up transaction * feat: add fee reserves to unsettled outgoing transactions * chore: rename app permissions max amount field * chore: rename transaction amount values to be clearly millisats * chore: merge balance type and visibility into isolated property on apps table * chore: move duplicated permission check from nip-47 controllers to handler * fix: app name in transaction list * Feat: permissions revamp v2 (#273) * feat: revamp permissions component * chore: changes * chore: changes * chore: add view mode for show app screen * chore: further changes * feat: new illustration for linking account (#254) * feat: new illustration for linking account * fix: update paths * fix: icon props (#256) * fix: use date from frontend * chore: add expiryselect component * chore: further changes * chore: further changes * chore: add date-fns for date picker * chore: further changes * chore: further changes * fix: add central LDK gossip node to help gossip new public channels (#262) * fix: make dialog responsive (#258) * chore: further changes * typo * chore: spacing issues * chore: use scopes from capabilities * chore: change scope type descriptions * chore: styling fixes * chore: fix typings * chore: budget renewal component * fix: LDK mark channel as inactive and show error if counterparty forwarding info missing (#267) fix: mark channel as inactive and show error if counterparty forwarding info missing * chore: remove unnecessary dark classes (#255) * fix: links to open first channel in sidebar and onboarding checklist (#268) * feat: improve migrate node UI (#269) * fix: migrate node copy (#270) * fix: stop nostr when app is shutdown and use context to stop lnclient (#271) * fix: permissions revamp WIP * feat: basic isolated apps UI * fix: new app connection, edit app connection, deep linking --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com> * fix: make transactions table ID autoincrement * fix: do not send unrelated notifications to isolated apps * fix: nip-47 notifications not receiving updated transaction state * fix: migrate existing tables to have autoincrementing primary keys (#274) * fix: migrate existing tables to have autoincrementing primary keys * fix: recreate request and response event tables after apps * fix: remove null from request_events app_id * fix: do not crash when reloading app created page * chore: update pragma commands, add busy_timeout * fix: remove unnecessary migration of user_configs table * chore: update comment on autoincrement migration * feat: sqlite database config improvements * fix: autoincrement migration to delete unlinked app permissions * chore: update tests for dynamic budgets (WIP) * fix: get balance tests * chore: add extra event handler tests * chore: add extra event handler test * chore: add extra multi_pay_invoice tests * chore: transactions service tests (WIP) * chore: add transactions service payment tests * chore: add tests for self payments * fix: notifications tests * chore: add notifications tests for transactions service * chore: add fee reserve tests for transactions service * chore: add list transactions tests * chore: add keysend tests for transactions service * feat: subscribe for payments and invoices (#281) * fix: db transaction should be passed as pointer * feat(lnd): subscribe for payments and invoices * chore: rearrange check for settled * chore: remove TODO * chore: retry on error and add select * chore: publish payment failed event * chore: use json logging * feat: add lnd notification types * chore: remove sleep * fix: incorrect key on transaction list items * fix: test * fix: disable isolated app type on non-supported backends --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com>
2024-07-19 23:30:22 +07:00
type SendPaymentResponse = Transaction
type MakeInvoiceResponse = Transaction
type LookupInvoiceResponse = Transaction
2024-12-16 18:56:59 +05:30
feat: user labels for transactions (#2265) * feat: user labels poc * feat: backend for transaction user labels Add PATCH /api/transactions/:paymentHash/label that merges a user-supplied {key:value} map into the existing transaction metadata under the user_label key, preserving NIP-47 fields. Empty map clears the labels. Trims whitespace, drops blank rows, caps key/value length. Wire the frontend editor to call the endpoint and revalidate the transactions SWR cache on success. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: include user labels as columns in CSV export Collect the union of user_label keys across all exported transactions and emit each one as its own label_<key> column. The existing metadata JSON column is preserved so importers like Raccoin keep working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: drop hardcoded label suggestions, autocomplete from prior keys Open the editor with a single blank row instead of four pre-seeded fields. Suggest label keys via a datalist populated from any user_label keys already present in the SWR transactions cache, so suggestions reflect the user's own taxonomy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: inline label editor and indicator-only list row Replace the nested label dialog with an inline editor that toggles within the existing transaction detail dialog, removing dialog stacking. In the transactions list, replace per-label badges with a single tag icon next to the timestamp so row height stays uniform; the full labels remain visible in the detail view. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix: don't bump updated_at on metadata-only edits GORM's Update auto-touches updated_at, which made the transactions list reorder labeled transactions to the top. Switch SetTransactionMetadata to UpdateColumn so only the metadata column changes. Add regression test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: route PATCH transaction label requests in wails The desktop app routes API calls through WailsRequestRouter rather than HTTP. Add a handler for PATCH /api/transactions/:hash/label before the existing transaction lookup so labels work in Wails too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: finalize backend * chore: rename to labels * chore: finalize frontend * chore: use tx id to add user labels * chore: address minor nits * fix: linting * fix: use explicit primary key lookups * chore: simplify transaction csv label export * fix(frontend): drop label count from transaction list badge The count adds visual weight without informing any decision from the list view. The icon-as-badge already signals labels exist; the actual values are in the details dialog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(frontend): revert transaction list label indicator to bare icon The Badge wrapper made the icon-only indicator wider than tall, which looked off. Restores the pre-PR look — a small TagIcon next to the timestamp — since the in-dialog editor is the place to see actual labels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2026-04-30 13:13:07 +02:00
type SetTransactionUserLabelsRequest struct {
Labels map[string]string `json:"labels"`
}
2024-12-16 18:56:59 +05:30
type ListTransactionsResponse struct {
2025-02-21 17:54:14 +05:30
TotalCount uint64 `json:"totalCount"`
2024-12-16 18:56:59 +05:30
Transactions []Transaction `json:"transactions"`
}
Feat: dynamic budgets (#226) * feat: add transactions table * feat: add transactions service with makeinvoice method * feat: use internal transactions WIP * feat: check unsettled transactions * feat: use transactions service in nip47 package WIP * feat: use transactions service in NIP-47 handlers * fix: transaction list colors * fix: tests * chore: remove old payments table * fix: return budget usage as sats * feat: use internal transactions table for keysend payments * feat: consume nwc_payment_received event in transaction service (WIP) * feat: update existing transaction from nwc_payment_received event in transactions service * feat: update existing transaction from nwc_payment_sent event in transactions service * feat: handle async payment failed events in transactions service * fix: tests * feat: correctly implement NIP-47 NOT_FOUND error code * feat: intercept self payments * feat: isolated balance and visibility * feat: validate keysend payment does not exceed app internal balance * feat: budget check in transactions service, correctly pass payment errors to NIP-47 response also reduce query duplication * fix: order transactions when looking up transaction * feat: add fee reserves to unsettled outgoing transactions * chore: rename app permissions max amount field * chore: rename transaction amount values to be clearly millisats * chore: merge balance type and visibility into isolated property on apps table * chore: move duplicated permission check from nip-47 controllers to handler * fix: app name in transaction list * Feat: permissions revamp v2 (#273) * feat: revamp permissions component * chore: changes * chore: changes * chore: add view mode for show app screen * chore: further changes * feat: new illustration for linking account (#254) * feat: new illustration for linking account * fix: update paths * fix: icon props (#256) * fix: use date from frontend * chore: add expiryselect component * chore: further changes * chore: further changes * chore: add date-fns for date picker * chore: further changes * chore: further changes * fix: add central LDK gossip node to help gossip new public channels (#262) * fix: make dialog responsive (#258) * chore: further changes * typo * chore: spacing issues * chore: use scopes from capabilities * chore: change scope type descriptions * chore: styling fixes * chore: fix typings * chore: budget renewal component * fix: LDK mark channel as inactive and show error if counterparty forwarding info missing (#267) fix: mark channel as inactive and show error if counterparty forwarding info missing * chore: remove unnecessary dark classes (#255) * fix: links to open first channel in sidebar and onboarding checklist (#268) * feat: improve migrate node UI (#269) * fix: migrate node copy (#270) * fix: stop nostr when app is shutdown and use context to stop lnclient (#271) * fix: permissions revamp WIP * feat: basic isolated apps UI * fix: new app connection, edit app connection, deep linking --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com> * fix: make transactions table ID autoincrement * fix: do not send unrelated notifications to isolated apps * fix: nip-47 notifications not receiving updated transaction state * fix: migrate existing tables to have autoincrementing primary keys (#274) * fix: migrate existing tables to have autoincrementing primary keys * fix: recreate request and response event tables after apps * fix: remove null from request_events app_id * fix: do not crash when reloading app created page * chore: update pragma commands, add busy_timeout * fix: remove unnecessary migration of user_configs table * chore: update comment on autoincrement migration * feat: sqlite database config improvements * fix: autoincrement migration to delete unlinked app permissions * chore: update tests for dynamic budgets (WIP) * fix: get balance tests * chore: add extra event handler tests * chore: add extra event handler test * chore: add extra multi_pay_invoice tests * chore: transactions service tests (WIP) * chore: add transactions service payment tests * chore: add tests for self payments * fix: notifications tests * chore: add notifications tests for transactions service * chore: add fee reserve tests for transactions service * chore: add list transactions tests * chore: add keysend tests for transactions service * feat: subscribe for payments and invoices (#281) * fix: db transaction should be passed as pointer * feat(lnd): subscribe for payments and invoices * chore: rearrange check for settled * chore: remove TODO * chore: retry on error and add select * chore: publish payment failed event * chore: use json logging * feat: add lnd notification types * chore: remove sleep * fix: incorrect key on transaction list items * fix: test * fix: disable isolated app type on non-supported backends --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com>
2024-07-19 23:30:22 +07:00
// TODO: camelCase
type Transaction struct {
feat: user labels for transactions (#2265) * feat: user labels poc * feat: backend for transaction user labels Add PATCH /api/transactions/:paymentHash/label that merges a user-supplied {key:value} map into the existing transaction metadata under the user_label key, preserving NIP-47 fields. Empty map clears the labels. Trims whitespace, drops blank rows, caps key/value length. Wire the frontend editor to call the endpoint and revalidate the transactions SWR cache on success. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: include user labels as columns in CSV export Collect the union of user_label keys across all exported transactions and emit each one as its own label_<key> column. The existing metadata JSON column is preserved so importers like Raccoin keep working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: drop hardcoded label suggestions, autocomplete from prior keys Open the editor with a single blank row instead of four pre-seeded fields. Suggest label keys via a datalist populated from any user_label keys already present in the SWR transactions cache, so suggestions reflect the user's own taxonomy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: inline label editor and indicator-only list row Replace the nested label dialog with an inline editor that toggles within the existing transaction detail dialog, removing dialog stacking. In the transactions list, replace per-label badges with a single tag icon next to the timestamp so row height stays uniform; the full labels remain visible in the detail view. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix: don't bump updated_at on metadata-only edits GORM's Update auto-touches updated_at, which made the transactions list reorder labeled transactions to the top. Switch SetTransactionMetadata to UpdateColumn so only the metadata column changes. Add regression test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat: route PATCH transaction label requests in wails The desktop app routes API calls through WailsRequestRouter rather than HTTP. Add a handler for PATCH /api/transactions/:hash/label before the existing transaction lookup so labels work in Wails too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: finalize backend * chore: rename to labels * chore: finalize frontend * chore: use tx id to add user labels * chore: address minor nits * fix: linting * fix: use explicit primary key lookups * chore: simplify transaction csv label export * fix(frontend): drop label count from transaction list badge The count adds visual weight without informing any decision from the list view. The icon-as-badge already signals labels exist; the actual values are in the details dialog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(frontend): revert transaction list label indicator to bare icon The Badge wrapper made the icon-only indicator wider than tall, which looked off. Restores the pre-PR look — a small TagIcon next to the timestamp — since the in-dialog editor is the place to see actual labels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
2026-04-30 13:13:07 +02:00
ID uint `json:"id"`
Feat: dynamic budgets (#226) * feat: add transactions table * feat: add transactions service with makeinvoice method * feat: use internal transactions WIP * feat: check unsettled transactions * feat: use transactions service in nip47 package WIP * feat: use transactions service in NIP-47 handlers * fix: transaction list colors * fix: tests * chore: remove old payments table * fix: return budget usage as sats * feat: use internal transactions table for keysend payments * feat: consume nwc_payment_received event in transaction service (WIP) * feat: update existing transaction from nwc_payment_received event in transactions service * feat: update existing transaction from nwc_payment_sent event in transactions service * feat: handle async payment failed events in transactions service * fix: tests * feat: correctly implement NIP-47 NOT_FOUND error code * feat: intercept self payments * feat: isolated balance and visibility * feat: validate keysend payment does not exceed app internal balance * feat: budget check in transactions service, correctly pass payment errors to NIP-47 response also reduce query duplication * fix: order transactions when looking up transaction * feat: add fee reserves to unsettled outgoing transactions * chore: rename app permissions max amount field * chore: rename transaction amount values to be clearly millisats * chore: merge balance type and visibility into isolated property on apps table * chore: move duplicated permission check from nip-47 controllers to handler * fix: app name in transaction list * Feat: permissions revamp v2 (#273) * feat: revamp permissions component * chore: changes * chore: changes * chore: add view mode for show app screen * chore: further changes * feat: new illustration for linking account (#254) * feat: new illustration for linking account * fix: update paths * fix: icon props (#256) * fix: use date from frontend * chore: add expiryselect component * chore: further changes * chore: further changes * chore: add date-fns for date picker * chore: further changes * chore: further changes * fix: add central LDK gossip node to help gossip new public channels (#262) * fix: make dialog responsive (#258) * chore: further changes * typo * chore: spacing issues * chore: use scopes from capabilities * chore: change scope type descriptions * chore: styling fixes * chore: fix typings * chore: budget renewal component * fix: LDK mark channel as inactive and show error if counterparty forwarding info missing (#267) fix: mark channel as inactive and show error if counterparty forwarding info missing * chore: remove unnecessary dark classes (#255) * fix: links to open first channel in sidebar and onboarding checklist (#268) * feat: improve migrate node UI (#269) * fix: migrate node copy (#270) * fix: stop nostr when app is shutdown and use context to stop lnclient (#271) * fix: permissions revamp WIP * feat: basic isolated apps UI * fix: new app connection, edit app connection, deep linking --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com> * fix: make transactions table ID autoincrement * fix: do not send unrelated notifications to isolated apps * fix: nip-47 notifications not receiving updated transaction state * fix: migrate existing tables to have autoincrementing primary keys (#274) * fix: migrate existing tables to have autoincrementing primary keys * fix: recreate request and response event tables after apps * fix: remove null from request_events app_id * fix: do not crash when reloading app created page * chore: update pragma commands, add busy_timeout * fix: remove unnecessary migration of user_configs table * chore: update comment on autoincrement migration * feat: sqlite database config improvements * fix: autoincrement migration to delete unlinked app permissions * chore: update tests for dynamic budgets (WIP) * fix: get balance tests * chore: add extra event handler tests * chore: add extra event handler test * chore: add extra multi_pay_invoice tests * chore: transactions service tests (WIP) * chore: add transactions service payment tests * chore: add tests for self payments * fix: notifications tests * chore: add notifications tests for transactions service * chore: add fee reserve tests for transactions service * chore: add list transactions tests * chore: add keysend tests for transactions service * feat: subscribe for payments and invoices (#281) * fix: db transaction should be passed as pointer * feat(lnd): subscribe for payments and invoices * chore: rearrange check for settled * chore: remove TODO * chore: retry on error and add select * chore: publish payment failed event * chore: use json logging * feat: add lnd notification types * chore: remove sleep * fix: incorrect key on transaction list items * fix: test * fix: disable isolated app type on non-supported backends --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com>
2024-07-19 23:30:22 +07:00
Type string `json:"type"`
State string `json:"state"`
Feat: dynamic budgets (#226) * feat: add transactions table * feat: add transactions service with makeinvoice method * feat: use internal transactions WIP * feat: check unsettled transactions * feat: use transactions service in nip47 package WIP * feat: use transactions service in NIP-47 handlers * fix: transaction list colors * fix: tests * chore: remove old payments table * fix: return budget usage as sats * feat: use internal transactions table for keysend payments * feat: consume nwc_payment_received event in transaction service (WIP) * feat: update existing transaction from nwc_payment_received event in transactions service * feat: update existing transaction from nwc_payment_sent event in transactions service * feat: handle async payment failed events in transactions service * fix: tests * feat: correctly implement NIP-47 NOT_FOUND error code * feat: intercept self payments * feat: isolated balance and visibility * feat: validate keysend payment does not exceed app internal balance * feat: budget check in transactions service, correctly pass payment errors to NIP-47 response also reduce query duplication * fix: order transactions when looking up transaction * feat: add fee reserves to unsettled outgoing transactions * chore: rename app permissions max amount field * chore: rename transaction amount values to be clearly millisats * chore: merge balance type and visibility into isolated property on apps table * chore: move duplicated permission check from nip-47 controllers to handler * fix: app name in transaction list * Feat: permissions revamp v2 (#273) * feat: revamp permissions component * chore: changes * chore: changes * chore: add view mode for show app screen * chore: further changes * feat: new illustration for linking account (#254) * feat: new illustration for linking account * fix: update paths * fix: icon props (#256) * fix: use date from frontend * chore: add expiryselect component * chore: further changes * chore: further changes * chore: add date-fns for date picker * chore: further changes * chore: further changes * fix: add central LDK gossip node to help gossip new public channels (#262) * fix: make dialog responsive (#258) * chore: further changes * typo * chore: spacing issues * chore: use scopes from capabilities * chore: change scope type descriptions * chore: styling fixes * chore: fix typings * chore: budget renewal component * fix: LDK mark channel as inactive and show error if counterparty forwarding info missing (#267) fix: mark channel as inactive and show error if counterparty forwarding info missing * chore: remove unnecessary dark classes (#255) * fix: links to open first channel in sidebar and onboarding checklist (#268) * feat: improve migrate node UI (#269) * fix: migrate node copy (#270) * fix: stop nostr when app is shutdown and use context to stop lnclient (#271) * fix: permissions revamp WIP * feat: basic isolated apps UI * fix: new app connection, edit app connection, deep linking --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com> * fix: make transactions table ID autoincrement * fix: do not send unrelated notifications to isolated apps * fix: nip-47 notifications not receiving updated transaction state * fix: migrate existing tables to have autoincrementing primary keys (#274) * fix: migrate existing tables to have autoincrementing primary keys * fix: recreate request and response event tables after apps * fix: remove null from request_events app_id * fix: do not crash when reloading app created page * chore: update pragma commands, add busy_timeout * fix: remove unnecessary migration of user_configs table * chore: update comment on autoincrement migration * feat: sqlite database config improvements * fix: autoincrement migration to delete unlinked app permissions * chore: update tests for dynamic budgets (WIP) * fix: get balance tests * chore: add extra event handler tests * chore: add extra event handler test * chore: add extra multi_pay_invoice tests * chore: transactions service tests (WIP) * chore: add transactions service payment tests * chore: add tests for self payments * fix: notifications tests * chore: add notifications tests for transactions service * chore: add fee reserve tests for transactions service * chore: add list transactions tests * chore: add keysend tests for transactions service * feat: subscribe for payments and invoices (#281) * fix: db transaction should be passed as pointer * feat(lnd): subscribe for payments and invoices * chore: rearrange check for settled * chore: remove TODO * chore: retry on error and add select * chore: publish payment failed event * chore: use json logging * feat: add lnd notification types * chore: remove sleep * fix: incorrect key on transaction list items * fix: test * fix: disable isolated app type on non-supported backends --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com>
2024-07-19 23:30:22 +07:00
Invoice string `json:"invoice"`
Description string `json:"description"`
DescriptionHash string `json:"descriptionHash"`
Feat: dynamic budgets (#226) * feat: add transactions table * feat: add transactions service with makeinvoice method * feat: use internal transactions WIP * feat: check unsettled transactions * feat: use transactions service in nip47 package WIP * feat: use transactions service in NIP-47 handlers * fix: transaction list colors * fix: tests * chore: remove old payments table * fix: return budget usage as sats * feat: use internal transactions table for keysend payments * feat: consume nwc_payment_received event in transaction service (WIP) * feat: update existing transaction from nwc_payment_received event in transactions service * feat: update existing transaction from nwc_payment_sent event in transactions service * feat: handle async payment failed events in transactions service * fix: tests * feat: correctly implement NIP-47 NOT_FOUND error code * feat: intercept self payments * feat: isolated balance and visibility * feat: validate keysend payment does not exceed app internal balance * feat: budget check in transactions service, correctly pass payment errors to NIP-47 response also reduce query duplication * fix: order transactions when looking up transaction * feat: add fee reserves to unsettled outgoing transactions * chore: rename app permissions max amount field * chore: rename transaction amount values to be clearly millisats * chore: merge balance type and visibility into isolated property on apps table * chore: move duplicated permission check from nip-47 controllers to handler * fix: app name in transaction list * Feat: permissions revamp v2 (#273) * feat: revamp permissions component * chore: changes * chore: changes * chore: add view mode for show app screen * chore: further changes * feat: new illustration for linking account (#254) * feat: new illustration for linking account * fix: update paths * fix: icon props (#256) * fix: use date from frontend * chore: add expiryselect component * chore: further changes * chore: further changes * chore: add date-fns for date picker * chore: further changes * chore: further changes * fix: add central LDK gossip node to help gossip new public channels (#262) * fix: make dialog responsive (#258) * chore: further changes * typo * chore: spacing issues * chore: use scopes from capabilities * chore: change scope type descriptions * chore: styling fixes * chore: fix typings * chore: budget renewal component * fix: LDK mark channel as inactive and show error if counterparty forwarding info missing (#267) fix: mark channel as inactive and show error if counterparty forwarding info missing * chore: remove unnecessary dark classes (#255) * fix: links to open first channel in sidebar and onboarding checklist (#268) * feat: improve migrate node UI (#269) * fix: migrate node copy (#270) * fix: stop nostr when app is shutdown and use context to stop lnclient (#271) * fix: permissions revamp WIP * feat: basic isolated apps UI * fix: new app connection, edit app connection, deep linking --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com> * fix: make transactions table ID autoincrement * fix: do not send unrelated notifications to isolated apps * fix: nip-47 notifications not receiving updated transaction state * fix: migrate existing tables to have autoincrementing primary keys (#274) * fix: migrate existing tables to have autoincrementing primary keys * fix: recreate request and response event tables after apps * fix: remove null from request_events app_id * fix: do not crash when reloading app created page * chore: update pragma commands, add busy_timeout * fix: remove unnecessary migration of user_configs table * chore: update comment on autoincrement migration * feat: sqlite database config improvements * fix: autoincrement migration to delete unlinked app permissions * chore: update tests for dynamic budgets (WIP) * fix: get balance tests * chore: add extra event handler tests * chore: add extra event handler test * chore: add extra multi_pay_invoice tests * chore: transactions service tests (WIP) * chore: add transactions service payment tests * chore: add tests for self payments * fix: notifications tests * chore: add notifications tests for transactions service * chore: add fee reserve tests for transactions service * chore: add list transactions tests * chore: add keysend tests for transactions service * feat: subscribe for payments and invoices (#281) * fix: db transaction should be passed as pointer * feat(lnd): subscribe for payments and invoices * chore: rearrange check for settled * chore: remove TODO * chore: retry on error and add select * chore: publish payment failed event * chore: use json logging * feat: add lnd notification types * chore: remove sleep * fix: incorrect key on transaction list items * fix: test * fix: disable isolated app type on non-supported backends --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com>
2024-07-19 23:30:22 +07:00
Preimage *string `json:"preimage"`
PaymentHash string `json:"paymentHash"`
Amount uint64 `json:"amount"` // deprecated
AmountSat uint64 `json:"amountSat"`
AmountMsat uint64 `json:"amountMsat"`
FeesPaid uint64 `json:"feesPaid"` // deprecated
FeesPaidSat uint64 `json:"feesPaidSat"`
FeesPaidMsat uint64 `json:"feesPaidMsat"`
2025-02-18 22:53:50 +05:30
UpdatedAt string `json:"updatedAt"`
CreatedAt string `json:"createdAt"`
SettledAt *string `json:"settledAt"`
AppId *uint `json:"appId"`
Metadata Metadata `json:"metadata,omitempty"`
Boostagram *Boostagram `json:"boostagram,omitempty"`
FailureReason string `json:"failureReason"`
}
type Metadata = map[string]interface{}
type Boostagram struct {
AppName string `json:"appName"`
Name string `json:"name"`
Podcast string `json:"podcast"`
URL string `json:"url"`
Episode string `json:"episode,omitempty"`
FeedId string `json:"feedId,omitempty"`
ItemId string `json:"itemId,omitempty"`
Timestamp int64 `json:"ts,omitempty"`
Message string `json:"message,omitempty"`
SenderId string `json:"senderId"`
SenderName string `json:"senderName"`
Time string `json:"time"`
Action string `json:"action"`
ValueSatTotal int64 `json:"valueSatTotal"`
ValueMsatTotal int64 `json:"valueMsatTotal"`
Feat: dynamic budgets (#226) * feat: add transactions table * feat: add transactions service with makeinvoice method * feat: use internal transactions WIP * feat: check unsettled transactions * feat: use transactions service in nip47 package WIP * feat: use transactions service in NIP-47 handlers * fix: transaction list colors * fix: tests * chore: remove old payments table * fix: return budget usage as sats * feat: use internal transactions table for keysend payments * feat: consume nwc_payment_received event in transaction service (WIP) * feat: update existing transaction from nwc_payment_received event in transactions service * feat: update existing transaction from nwc_payment_sent event in transactions service * feat: handle async payment failed events in transactions service * fix: tests * feat: correctly implement NIP-47 NOT_FOUND error code * feat: intercept self payments * feat: isolated balance and visibility * feat: validate keysend payment does not exceed app internal balance * feat: budget check in transactions service, correctly pass payment errors to NIP-47 response also reduce query duplication * fix: order transactions when looking up transaction * feat: add fee reserves to unsettled outgoing transactions * chore: rename app permissions max amount field * chore: rename transaction amount values to be clearly millisats * chore: merge balance type and visibility into isolated property on apps table * chore: move duplicated permission check from nip-47 controllers to handler * fix: app name in transaction list * Feat: permissions revamp v2 (#273) * feat: revamp permissions component * chore: changes * chore: changes * chore: add view mode for show app screen * chore: further changes * feat: new illustration for linking account (#254) * feat: new illustration for linking account * fix: update paths * fix: icon props (#256) * fix: use date from frontend * chore: add expiryselect component * chore: further changes * chore: further changes * chore: add date-fns for date picker * chore: further changes * chore: further changes * fix: add central LDK gossip node to help gossip new public channels (#262) * fix: make dialog responsive (#258) * chore: further changes * typo * chore: spacing issues * chore: use scopes from capabilities * chore: change scope type descriptions * chore: styling fixes * chore: fix typings * chore: budget renewal component * fix: LDK mark channel as inactive and show error if counterparty forwarding info missing (#267) fix: mark channel as inactive and show error if counterparty forwarding info missing * chore: remove unnecessary dark classes (#255) * fix: links to open first channel in sidebar and onboarding checklist (#268) * feat: improve migrate node UI (#269) * fix: migrate node copy (#270) * fix: stop nostr when app is shutdown and use context to stop lnclient (#271) * fix: permissions revamp WIP * feat: basic isolated apps UI * fix: new app connection, edit app connection, deep linking --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com> * fix: make transactions table ID autoincrement * fix: do not send unrelated notifications to isolated apps * fix: nip-47 notifications not receiving updated transaction state * fix: migrate existing tables to have autoincrementing primary keys (#274) * fix: migrate existing tables to have autoincrementing primary keys * fix: recreate request and response event tables after apps * fix: remove null from request_events app_id * fix: do not crash when reloading app created page * chore: update pragma commands, add busy_timeout * fix: remove unnecessary migration of user_configs table * chore: update comment on autoincrement migration * feat: sqlite database config improvements * fix: autoincrement migration to delete unlinked app permissions * chore: update tests for dynamic budgets (WIP) * fix: get balance tests * chore: add extra event handler tests * chore: add extra event handler test * chore: add extra multi_pay_invoice tests * chore: transactions service tests (WIP) * chore: add transactions service payment tests * chore: add tests for self payments * fix: notifications tests * chore: add notifications tests for transactions service * chore: add fee reserve tests for transactions service * chore: add list transactions tests * chore: add keysend tests for transactions service * feat: subscribe for payments and invoices (#281) * fix: db transaction should be passed as pointer * feat(lnd): subscribe for payments and invoices * chore: rearrange check for settled * chore: remove TODO * chore: retry on error and add select * chore: publish payment failed event * chore: use json logging * feat: add lnd notification types * chore: remove sleep * fix: incorrect key on transaction list items * fix: test * fix: disable isolated app type on non-supported backends --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com> Co-authored-by: René Aaron <100827540+reneaaron@users.noreply.github.com> Co-authored-by: Michael Bumann <hello@michaelbumann.com>
2024-07-19 23:30:22 +07:00
}
2024-04-06 22:32:12 +02:00
const (
LogTypeNode = "node"
LogTypeApp = "app"
)
type GetLogOutputRequest struct {
2024-04-08 20:49:55 +02:00
MaxLen int `query:"maxLen"`
2024-04-05 22:31:33 +02:00
}
2024-04-06 22:32:12 +02:00
type GetLogOutputResponse struct {
Log string `json:"logs"`
}
type SignMessageRequest struct {
Message string `json:"message"`
}
type SignMessageResponse struct {
Message string `json:"message"`
Signature string `json:"signature"`
}
type PayInvoiceRequest struct {
Amount *uint64 `json:"amount"` // deprecated
AmountSat *uint64 `json:"amountSat"`
AmountMsat *uint64 `json:"amountMsat"`
Metadata Metadata `json:"metadata"`
FromAppID *uint `json:"fromAppId"`
}
type MakeOfferRequest struct {
Description string `json:"description"`
}
type MakeInvoiceRequest struct {
Amount *uint64 `json:"amount"` // deprecated
AmountSat *uint64 `json:"amountSat"`
AmountMsat *uint64 `json:"amountMsat"`
Description string `json:"description"`
}
type ResetRouterRequest struct {
Key string `json:"key"`
}
type BasicBackupRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
type BasicRestoreWailsRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
type NetworkGraphResponse = interface{}
2024-06-17 19:42:09 +07:00
type LSPOrderRequest struct {
Amount *uint64 `json:"amount"` // deprecated
AmountSat *uint64 `json:"amountSat"`
LSPType string `json:"lspType"`
LSPIdentifier string `json:"lspIdentifier"`
Public bool `json:"public"`
2024-06-17 19:42:09 +07:00
}
type LSPOrderResponse struct {
Invoice string `json:"invoice"`
Fee uint64 `json:"fee"` // deprecated
FeeSat uint64 `json:"feeSat"`
InvoiceAmount uint64 `json:"invoiceAmount"` // deprecated
InvoiceAmountSat uint64 `json:"invoiceAmountSat"`
IncomingLiquidity uint64 `json:"incomingLiquidity"` // deprecated
IncomingLiquiditySat uint64 `json:"incomingLiquiditySat"`
OutgoingLiquidity uint64 `json:"outgoingLiquidity"` // deprecated
OutgoingLiquiditySat uint64 `json:"outgoingLiquiditySat"`
2024-06-17 19:42:09 +07:00
}
type WalletCapabilitiesResponse struct {
Scopes []string `json:"scopes"`
Methods []string `json:"methods"`
NotificationTypes []string `json:"notificationTypes"`
}
type Channel struct {
LocalBalance int64 `json:"localBalance"` // deprecated
LocalBalanceSat int64 `json:"localBalanceSat"`
LocalBalanceMsat int64 `json:"localBalanceMsat"`
LocalSpendableBalance int64 `json:"localSpendableBalance"` // deprecated
LocalSpendableBalanceSat int64 `json:"localSpendableBalanceSat"`
LocalSpendableBalanceMsat int64 `json:"localSpendableBalanceMsat"`
RemoteBalance int64 `json:"remoteBalance"` // deprecated
RemoteBalanceSat int64 `json:"remoteBalanceSat"`
RemoteBalanceMsat int64 `json:"remoteBalanceMsat"`
Id string `json:"id"`
RemotePubkey string `json:"remotePubkey"`
FundingTxId string `json:"fundingTxId"`
FundingTxVout uint32 `json:"fundingTxVout"`
Active bool `json:"active"`
Public bool `json:"public"`
InternalChannel interface{} `json:"internalChannel"`
Confirmations *uint32 `json:"confirmations"`
ConfirmationsRequired *uint32 `json:"confirmationsRequired"`
ForwardingFeeBaseMsat uint32 `json:"forwardingFeeBaseMsat"` // expressed only in msat as per Lightning spec
ForwardingFeeProportionalMillionths uint32 `json:"forwardingFeeProportionalMillionths"`
UnspendablePunishmentReserve uint64 `json:"unspendablePunishmentReserve"` // deprecated
UnspendablePunishmentReserveSat uint64 `json:"unspendablePunishmentReserveSat"`
CounterpartyUnspendablePunishmentReserve uint64 `json:"counterpartyUnspendablePunishmentReserve"` // deprecated
CounterpartyUnspendablePunishmentReserveSat uint64 `json:"counterpartyUnspendablePunishmentReserveSat"`
Error *string `json:"error"`
Status string `json:"status"`
IsOutbound bool `json:"isOutbound"`
}
type MigrateNodeStorageRequest struct {
To string `json:"to"`
}
type HealthAlarmKind string
const (
HealthAlarmKindAlbyService HealthAlarmKind = "alby_service"
HealthAlarmKindNodeNotReady HealthAlarmKind = "node_not_ready"
HealthAlarmKindChannelsOffline HealthAlarmKind = "channels_offline"
HealthAlarmKindNostrRelayOffline HealthAlarmKind = "nostr_relay_offline"
HealthAlarmKindVssNoSubscription HealthAlarmKind = "vss_no_subscription"
)
type HealthAlarm struct {
Kind HealthAlarmKind `json:"kind"`
RawDetails any `json:"rawDetails,omitempty"`
}
func NewHealthAlarm(kind HealthAlarmKind, rawDetails any) HealthAlarm {
return HealthAlarm{
Kind: kind,
RawDetails: rawDetails,
}
}
type HealthResponse struct {
Alarms []HealthAlarm `json:"alarms,omitempty"`
}
type CustomNodeCommandArgDef struct {
Name string `json:"name"`
Description string `json:"description"`
}
type CustomNodeCommandDef struct {
Name string `json:"name"`
Description string `json:"description"`
Args []CustomNodeCommandArgDef `json:"args"`
}
type CustomNodeCommandsResponse struct {
Commands []CustomNodeCommandDef `json:"commands"`
}
type ExecuteCustomNodeCommandRequest struct {
Command string `json:"command"`
}
type GetForwardsResponse struct {
OutboundAmountForwardedSat uint64 `json:"outboundAmountForwardedSat"`
OutboundAmountForwardedMsat uint64 `json:"outboundAmountForwardedMsat"`
TotalFeeEarnedSat uint64 `json:"totalFeeEarnedSat"`
TotalFeeEarnedMsat uint64 `json:"totalFeeEarnedMsat"`
NumForwards uint64 `json:"numForwards"`
}
func ResolveToSat(satValue *uint64, msatValue *uint64, legacyValueSat *uint64, legacyValueMsat *uint64) (resolvedSatValue *uint64) {
if legacyValueSat != nil {
resolvedSatValue = legacyValueSat
}
if legacyValueMsat != nil {
tmpSat := *legacyValueMsat / 1000
resolvedSatValue = &tmpSat
}
if satValue != nil {
resolvedSatValue = satValue
}
if msatValue != nil {
tmpSat := *msatValue / 1000
resolvedSatValue = &tmpSat
}
return resolvedSatValue
}
func ResolveToMsat(satValue *uint64, msatValue *uint64, legacyValueSat *uint64, legacyValueMsat *uint64) (resolvedMsatValue *uint64) {
if legacyValueSat != nil {
tmpMsat := *legacyValueSat * 1000
resolvedMsatValue = &tmpMsat
}
if legacyValueMsat != nil {
resolvedMsatValue = legacyValueMsat
}
if satValue != nil {
tmpMsat := *satValue * 1000
resolvedMsatValue = &tmpMsat
}
if msatValue != nil {
resolvedMsatValue = msatValue
}
return resolvedMsatValue
}