201 Commits

Author SHA1 Message Date
Bryan Mutai
1888b19792
Add lnbits-v1 to sndev (#2184)
* Add lnbits-v1

* use v1 in dev when specified

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-06-05 19:04:22 -05:00
Will Sutton
d2c71ca08f
fix: capture lnbits v1.0+ payments model response (#2162) 2025-05-14 14:00:08 -05:00
ekzyis
f754b530ff
Fix 0 sat lnaddr invoices (#2149)
* Fix comment position

* Fix possible 0 sat lnaddr invoices
2025-05-05 09:56:04 -05:00
ekzyis
dc196be807
Remove self-referential import (#2141) 2025-04-26 16:23:45 -05:00
ekzyis
97317d4c0c
Fix lnaddr attach fails if minSendable > 1000 (#2138)
* Fix lnaddr attach fails if minSendable > 1000

* Don't fetch lnAddr options twice for test invoice
2025-04-26 11:15:47 -05:00
ekzyis
719cb2d507
Prompt to attach receive wallet on post (#2059)
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-04-14 19:40:43 -05:00
ekzyis
e401c6f277 Move wallet status 2025-04-13 00:50:29 +02:00
ekzyis
7be94dcfed Move wallet components into wallets/ 2025-04-13 00:50:29 +02:00
ekzyis
66d7eef617
Fix wallet indicator blink via wallet loading state (#2091)
* Fix wallet indicator blink via wallet loading state

* Fix 'attach wallet' button not showing up on page refresh
2025-04-12 14:26:30 -05:00
ekzyis
a7245930c2
Use wallets instead of wallets.length as useZap dependency (#2088)
* Potential fix for stale useZap wallet dependency

* Memoize context value for wallets
2025-04-09 15:53:31 -05:00
ekzyis
40cd0ea422
Fix wrong method in error message (#2065) 2025-04-04 08:03:24 -05:00
k00b
b617ac0a56 fix nwc receive 2025-04-03 12:23:20 -05:00
ekzyis
06d05c7f37
Fix NWC recv (#2062) 2025-04-03 12:17:07 -05:00
ekzyis
2cf0f1d268
Update NDK to v2.12.2 (#2041)
* Update NDK to v2.12.2

* Fix NWC with @nostr-dev-kit/ndk-wallet

* Add test for nip-57 zap receipts
2025-04-02 17:20:47 -05:00
ekzyis
d7a7273ca4
Wallet indicators (#2002)
* Add wallet indicator

* Reveal wallets page via button
2025-04-02 15:02:13 -05:00
ekzyis
88253e5478
external lightning address validator (#2056) 2025-04-01 17:39:33 -05:00
ekzyis
e0bfc590b2
Remove mention of autowithdrawal for lnaddr (#2054) 2025-04-01 16:36:56 -05:00
ekzyis
14fadbaed6
Replace 'autowithdraw' in wallet subtitle (#2053) 2025-04-01 16:15:17 -05:00
ekzyis
b54268a88f
normalized wallet logs (#1826)
* Add invoiceId, withdrawalId to wallet logs

* Truncate wallet logs

* Fix extra db dips per log line

* Fix leak of invoice for sender
2025-03-22 17:31:10 -05:00
Scroogey-SN
e31f8e9c69
Support .onion for phoenixd (#1975)
* fix #1964 support .onion urls like lnbits does

* fix lint: const hostname

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-03-18 15:39:53 -05:00
Scroogey-SN
a3762f70b0
fix #1959 strip trailing slashes from url (#1973) 2025-03-17 13:16:31 -05:00
ekzyis
6f50b485b4 Don't poll failed invoices if anon 2025-03-12 20:10:15 -05:00
ekzyis
75d0a8e3d9
Fix undefined db for wallet logs (#1944) 2025-03-05 07:29:21 -06:00
soxa
f72af08882
fix: WebLN QR fallback for anon users (#1858)
* fix: WebLN QR fallback for anon users

* wip: clear zap color on payment fail

* reverse clearItemMeAnonSats

* webln-specific retry bypass

* cleanup

* send WebLN payment when user is Anon AND on QR

* skip wallet checking on anon

* Use WalletError for all errors in webln.sendPayment

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-03-01 16:56:18 -06:00
ekzyis
5e85147578
Fix receiver fallback on caller error (#1907)
* Rename to createUserInvoice

* Fix no receiver fallback on wrap, direct or autowithdrawal error

* Fix missing error logs for direct payments
2025-02-14 20:01:14 -06:00
ekzyis
0032e064b2
Automated retries (#1776)
* Poll failed invoices with visibility timeout

* Don't return intermediate failed invoices

* Don't retry too old invoices

* Retry invoices on client

* Only attempt payment 3 times

* Fix fallbacks during last retry

* Rename retry column to paymentAttempt

* Fix no index used

* Resolve TODOs

* Use expiring locks

* Better comments for constants

* Acquire lock during retry

* Use expiring lock in retry mutation

* Use now() instead of CURRENT_TIMESTAMP

* Cosmetic changes

* Immediately show failed post payments in notifications

* Update hasNewNotes

* Never retry on user cancel

For a consistent UX and less mental overhead, I decided to remove the exception for ITEM_CREATE where it would still retry in the background even though we want to show the payment failure immediately in notifications.

* Fix notifications without pending retries missing if no send wallets

If a stacker has no send wallets, they would miss notifications about failed payments because they would never get retried.

This commit fixes this by making the notifications query aware if the stacker has send wallets. This way, it can tell if a notification will be retried or not.

* Stop hiding userCancel in notifications

As mentioned in a previous commit, I want to show anything that will not be attempted anymore in notifications.

Before, I wanted to hide manually cancelled invoices but to not change experience unnecessarily and to decrease mental overhead, I changed my mind.

* Also consider invoice.cancelledAt in notifications

* Always retry failed payments, even without send wallets

* Fix notification indicator on retry timeout

* Set invoice.updated_at to date slightly in the future

* Use default job priority

* Stop retrying after one hour

* Remove special case for ITEM_CREATE

* Replace retryTimeout job with notification indicator query

* Fix sortTime

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-02-14 19:25:11 -06:00
k00b
95e98501ec reduce max incoming invoice expiration and expiration buffer 2025-02-05 12:47:35 -06:00
ekzyis
156b895fb6
Add createrune info for v24.11 (#1847) 2025-01-26 12:28:51 -06:00
ekzyis
181cb87c18 Remove warning if wallet does not support msats 2025-01-21 00:28:11 +01:00
ekzyis
630af6bc40 Update forward limits 2025-01-18 09:53:17 +01:00
k00b
29c31e3d4a double allowed outgoing cltv delta 2025-01-05 16:17:22 -06:00
Keyan
146b60278c
cowboy credits (aka nov-5 (aka jan-3)) (#1678)
* wip adding cowboy credits

* invite gift paid action

* remove balance limit

* remove p2p zap withdrawal notifications

* credits typedefs

* squash migrations

* remove wallet limit stuff

* CCs in item detail

* comments with meCredits

* begin including CCs in item stats/notifications

* buy credits ui/mutation

* fix old /settings/wallets paths

* bios don't get sats

* fix settings

* make invites work with credits

* restore migration from master

* inform backend of send wallets on zap

* satistics header

* default receive options to true and squash migrations

* fix paidAction query

* add nav for credits

* fix forever stacked count

* ek suggested fixes

* fix lint

* fix freebies wrt CCs

* add back disable freebies

* trigger cowboy hat job on CC depletion

* fix meMsats+meMcredits

* Update api/paidAction/README.md

Co-authored-by: ekzyis <ek@stacker.news>

* remove expireBoost migration that doesn't work

---------

Co-authored-by: ekzyis <ek@stacker.news>
2025-01-03 10:33:07 -06:00
Riccardo Balbo
e4ca2d6e07
Refine #1739 and fix regression causing nostr crossposts and login to not work (#1740)
* Refine #1739 and fix regression causing crossposts and login to not work

* use temp nostr instance for signing
2024-12-19 08:27:45 -06:00
ekzyis
4db2edb1d9
Close relay connections after each NWC call (#1739) 2024-12-19 00:11:03 -06:00
ekzyis
6098d39574
Fix missing logs on save (#1729)
* Fix missing logs on save

* fix receive logs wrt device sync

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-12-16 17:37:31 -06:00
ekzyis
62a922247d
Add timeouts to all wallet API calls (#1722)
* Add timeout to all wallet API calls

* Pass timeout signal to wallet API

* Fix timeout error message not shown on timeout

* Fix cross-fetch throws generic error message on abort

* Fix wrong method in error message

* Always use FetchTimeoutError

* Catch NDK timeout error to replace with custom timeout error

* Also use 15s for NWC connect timeout

* Add timeout delay
2024-12-16 14:05:31 -06:00
ekzyis
14de23b21d
Refactor CLN function signatures (#1726) 2024-12-14 10:32:51 -06:00
ekzyis
3cdfe620d0
Refactor Blink function signatures (#1725)
This makes them consistent with function signatures of other wallets
2024-12-14 08:56:45 -06:00
ekzyis
77d22cfd77
Remove unused wallet context args (#1724) 2024-12-14 08:55:08 -06:00
ekzyis
285203889d Remove unused import 2024-12-13 21:20:51 +01:00
ekzyis
a50a2c8bd1
Fix receiver fallbacks depend on fast polls (#1723) 2024-12-13 14:19:00 -06:00
Riccardo Balbo
d73f6323ff
NDK (#1590)
* ndk

* fix: remove duplicated zap note event template

* don't init Nip07 signer by default

* Update wallets/nwc/server.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* nwc protocol parsing workaround

* WebSocket polyfill for worker

* increase nwc timeout

* remove NDKNip46Signer type

* fix type annotation

* move  eslint-disable camelcase to the top

* pass event args to the constructor

* fix error handling

* Update wallets/nwc/index.js

Co-authored-by: ekzyis <ek@stacker.news>

* Fix type annotation

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-12-13 13:28:36 -06:00
ekzyis
64ba7a56cb Fix missing wallet error logging 2024-12-13 11:30:54 +01:00
ekzyis
8f092cdc66 Use consistent view about failed forwards 2024-12-11 20:09:49 +01:00
ekzyis
a46f81f1e1
Receiver fallbacks (#1688)
* Use same naming scheme between ln containers and env vars

* Add router_lnd container

* Only open channels to router_lnd

* Use 1sat base fee and 0ppm fee rate

* Add script to test routing

* Also fund router_lnd wallet

* Receiver fallbacks

* Rename to predecessorId

* Remove useless wallet table join

* Missing renaming to predecessor

* Fix payment stuck on sender error

We want to await the invoice poll promise so we can check for receiver errors, but in case of sender errors, the promise will never settle.

* Don't log failed forwards as sender errors

* fix check for receiver error

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-12-10 14:15:29 -06:00
ekzyis
a5fa40aa1b
Fix comment in useSendWallets (#1691) 2024-12-09 09:04:41 -06:00
ekzyis
ec904e6b4c
Move useInvoice and useQrPayment into own files (#1686) 2024-12-05 08:52:32 -06:00
k00b
105f7b07e5 make fallback retry cache updates a special case 2024-11-28 11:22:46 -06:00
k00b
cb028d217c fix zap fallback retries in notifications 2024-11-28 10:48:22 -06:00
k00b
6b59e1fa75 usesendwallets 2024-11-27 19:39:20 -06:00