1
0
mirror of git://jb55.com/damus synced 2024-09-30 08:50:42 +00:00
Commit Graph

2043 Commits

Author SHA1 Message Date
William Casarin
02d99f7340 postbox: try flushing events every second
relying on network activity for flushing is not reliable and is causing
delays in zapping
2023-05-14 10:49:54 -07:00
William Casarin
8fb5b4f49c misc logs 2023-05-14 00:03:51 -07:00
William Casarin
ae4d9ab8ba nwc: make delay 3 seconds instead of 5 2023-05-14 00:03:51 -07:00
William Casarin
85262e1a4e nwc: fix response parsing 2023-05-14 00:03:51 -07:00
William Casarin
64a224135a nwc: always allow long press zap 2023-05-13 23:54:02 -07:00
William Casarin
69fc6694f1 nwc: turn pending zap orange when we have a NWC success
Orange means payment successful now, not just presence of zap

This introduces a paid pending state, which shows up as an orange timer
thing in the zaps view. This can be useful if the zap is never sent. We
don't want the user to think the payment didn't go through.
2023-05-13 23:30:03 -07:00
William Casarin
03691d0369 Pending Zaps
A fairly large change that replaces Zaps in the codebase with "Zapping"
which is a tagged union consisting of a resolved Zap and a Pending Zap.
These are both counted as Zaps everywhere in Damus, except pending zaps
can be cancelled (most of the time).
2023-05-13 21:33:34 -07:00
William Casarin
1518a0a16c zaps: ensure returned bolt11 is the correct amount 2023-05-13 19:51:06 -07:00
Bryan Montz
32431096f5 add tests for ProfileDatabase 2023-05-13 09:20:01 -05:00
Bryan Montz
6172347455 add ability to remove all cached Profiles in ProfileDatabase 2023-05-13 09:18:47 -05:00
Bryan Montz
31d327a085 add ability to retrieve count of cached Profiles 2023-05-13 09:18:23 -05:00
Bryan Montz
b5ae7df795 add ability to change ProfileDatabase's storage URL 2023-05-13 09:17:41 -05:00
Bryan Montz
3b0bb48dd4 integrate ProfileDatabase with existing Profiles caching class 2023-05-12 07:21:59 -05:00
Bryan Montz
4646f0e23c add ProfileDatabase class to read and write profiles to disk 2023-05-12 07:21:25 -05:00
Bryan Montz
7027b7016c add two-way translation between existing Profile class and new PersistedProfile CoreData class 2023-05-12 07:19:43 -05:00
Bryan Montz
76c57af548 add managed object class to match new Profile CoreData model 2023-05-12 07:18:12 -05:00
Bryan Montz
7983157c38 add CoreData model for Profile 2023-05-12 07:15:30 -05:00
William Casarin
dafa1ba4de test: add nwc and ephemeral relay test
This ensures that when paying with nwc, we get an ephemeral relay added
and a request queued in the postbox.
2023-05-10 16:24:02 -07:00
William Casarin
9093bdec2d home: add some more helper functions 2023-05-10 14:07:24 -07:00
William Casarin
bb32d72903 nwc: clear the zapper cache for our pubkey when we attach a new wallet 2023-05-10 14:07:24 -07:00
William Casarin
f77a7bcb29 ui: show lud16 in attach wallet ui 2023-05-10 14:07:24 -07:00
William Casarin
5cce18c8b6 nwc: attach lud16 to profile when attaching wallet 2023-05-10 14:07:24 -07:00
William Casarin
a5726d4650 nwc: add lud16 parameter
This will be used for auto-setting up the lightning wallet

See https://github.com/nostr-protocol/nips/pull/513
2023-05-10 14:07:24 -07:00
William Casarin
370a5feb4e ui: add Nostr Wallet Connect views 2023-05-10 14:07:24 -07:00
William Casarin
fe3d976cdb nwc: pay with nwc if we have it configured 2023-05-10 14:07:24 -07:00
William Casarin
996312cf1c settings: Add nostr_wallet_connect setting
Stored in the keychain for security
2023-05-10 14:07:24 -07:00
William Casarin
d0216bbce6 nwc: Add WalletModel
This model will be used for controlling the logic in the Wallet views
2023-05-10 14:07:24 -07:00
William Casarin
4d2b79057d nwc: add Nostr Wallet Connect logic
- WalletConnectURL parses nostrwalletconnect:// urls
- Add support for parsing and creating NWC requests
2023-05-10 14:07:24 -07:00
William Casarin
ca2bf20eb7 info: add nostrwalletconnect uri handlers
We will need this to handle nostrwalletconnect:// links
2023-05-10 14:07:24 -07:00
William Casarin
baed6adf49 refactor: ensure make_metadata_event has full keypair 2023-05-10 14:07:23 -07:00
William Casarin
f068833c5e colors: add adaptableBlack
Used in template icons
2023-05-10 14:07:23 -07:00
William Casarin
c3808cd21f icons: convert to template images 2023-05-10 14:07:23 -07:00
William Casarin
acbd09bf6f ------ ephemeral relays -------
Add docs
2023-05-10 13:31:53 -07:00
William Casarin
1fe54380b8 relay: make RelayInfo encoding more flexible
So that we don't fail relay list decoding as easy
2023-05-10 13:25:46 -07:00
William Casarin
fe6d7e5118 relay: split descriptors to {our,all}_descriptors
Now that we have ephemeral relays, we don't want them used everywhere
2023-05-10 13:25:40 -07:00
William Casarin
1367be0d10 relay: handle ephemeral relays in PostBox
We need to make sure ephemeral relay events (not ephemeral events) are
handled properly in the postbox. Make sure we pass the proper
skip_ephemeral flag to the relay pool if we add something like a NWC
event to the PostBox. Events are not sent to ephemeral relays by
default.
2023-05-10 12:01:26 -07:00
William Casarin
32a1a24e39 pool: skip ephemeral relays by default
Also filter relays by read/write once we introduce that
2023-05-10 12:01:26 -07:00
William Casarin
7267662330 relay: introduce ephemeral relays
Epehmeral relays are relays that are connected in your relay pool but
not a part of your official relay list. This will be used by
nostr-wallet-connect to communicate with an NWC relay to pay invoices.
2023-05-10 12:01:26 -07:00
William Casarin
1da0a8ee52 nostr: add is_{read,write} helpers on requests
This will be handy in the future when we properly filter relay lists by
RelayInfo
2023-05-10 12:01:26 -07:00
William Casarin
23aab6710a Fix DM sorting test 2023-05-10 11:01:40 -07:00
Bryan Montz
ce599badee fix crash related to preloading events
Changelog-Fixed: fix crash related to preloading events
2023-05-09 23:39:41 -05:00
William Casarin
221fffe523 Fix tests
This reverts commit dff5987d3c.
2023-05-09 20:23:08 -07:00
William Casarin
5d72b4d007 dms: generalize create_dm into create_encrypted_event
We will need this for encrypting notes other than DMs (NWC)
2023-05-09 18:57:04 -07:00
William Casarin
dff5987d3c settings: mark UserSettings as changed in KeychainStorage properties
Maybe this isn't strictly needed at the moment, but to remain consistent
with the Settings and StringSettings property wrapper we will do this.
2023-05-09 18:57:04 -07:00
William Casarin
bfffd63dab ui: use darker border colors in BigButton
Might need to update the other buttons as well in the share sheet
2023-05-09 18:57:04 -07:00
William Casarin
1db425fd69 ui: add AlbyButton
This will be used for alby's nostr wallet connect implementation
2023-05-09 18:57:04 -07:00
William Casarin
27caffd91f ui: add alby logo for the AlbyButton 2023-05-09 18:57:04 -07:00
William Casarin
a13efb7832 ui: move gradient components to their own group 2023-05-09 18:57:04 -07:00
William Casarin
e3b3c9dedd ui: add QR CodeScanner helpers 2023-05-09 18:57:04 -07:00
William Casarin
904fe2bc0a pool: ocd change
I'm not a fan of $0, etc
2023-05-09 18:57:04 -07:00