49 Commits

Author SHA1 Message Date
ekzyis
7402885998 Use common sort 2024-07-08 11:34:05 +02:00
ekzyis
920478a72c Update LNC code
* remove LNC FIXMEs

Mhh, I guess the TURN server was down or something? It now magically works. Or maybe it only works once per mnemonic?

* also removed the lnc.lnd.lightning.getInfo() call since we don't ask and need permission for this RPC for payments.

* setting a password does not work though. It fails with 'The password provided is not valid' which is triggered at https://github.com/lightninglabs/lnc-web/blob/main/lib/util/credentialStore.ts#L81.
2024-07-08 10:59:04 +02:00
ekzyis
8ea4d0c8a7 Fix duplicate CLN error 2024-07-08 07:59:28 +02:00
ekzyis
459478036f Fix priority ignored when fetching enabled wallet 2024-07-08 05:49:54 +02:00
ekzyis
85464f93b9 Detach wallets and delete logs on logout 2024-07-07 18:35:57 +02:00
ekzyis
dddbb53792 Add CLN autowithdrawal 2024-07-07 18:35:57 +02:00
ekzyis
ebe741dc92 Add missing hints 2024-07-07 18:35:57 +02:00
ekzyis
7528e5c2b6 Add optional wallet short name for logging 2024-07-07 18:35:57 +02:00
ekzyis
1ce09051b1 Add autowithdrawal to lightning address 2024-07-07 18:35:56 +02:00
ekzyis
12bedae01a Use wallet.createInvoice for autowithdrawals 2024-07-07 18:31:41 +02:00
ekzyis
ba00c3d9fa Generate wallet resolver from fields 2024-07-07 18:31:41 +02:00
ekzyis
00f78daadc Generate wallet mutation from fields 2024-07-07 18:31:41 +02:00
ekzyis
48ead97615 Run lnbits url.replace in validate and sendPayment 2024-07-07 18:31:41 +02:00
ekzyis
6463e6eec8 Split arguments into [value,] config, context 2024-07-07 18:31:41 +02:00
ekzyis
0ebe097a70 Fix noisy changes in lib/validate
I moved the schema for lnbits, nwc and lnc out of lib/validate only to put them back in there later.

This commit should make the changeset cleaner by removing noise.
2024-07-07 18:31:41 +02:00
ekzyis
850c534c91 Fix typo 2024-07-07 18:31:41 +02:00
ekzyis
9bbf2056e9 Save dedicated enabled flag for server wallets
* wallet table now contains boolean column 'enabled'
* 'priority' is now a number everywhere
* use consistent order between how autowithdrawals are attempted and server wallets cards
2024-07-07 18:31:41 +02:00
ekzyis
55928ac252 Save order as priority 2024-07-07 18:31:41 +02:00
ekzyis
b96757b366 Move all validation schema into lib/validate 2024-07-07 18:31:41 +02:00
ekzyis
d20e258649 Consistent logs between local and server wallets
* 'wallet attached' on create
* 'wallet updated' on config updates
* 'wallet enabled' and 'wallet disabled' if checkbox changed
* 'wallet detached' on delete
2024-07-07 18:31:41 +02:00
ekzyis
d60e26bfdf Fix wallet logs not updated after server delete 2024-07-07 18:31:41 +02:00
ekzyis
645ff78365 Fix server config not updated after save or detach 2024-07-07 18:31:41 +02:00
ekzyis
d8e82ddea5 Only include local/server config if required 2024-07-07 18:31:41 +02:00
ekzyis
e091377d94 Fix TypeError in isConfigured if no enabled wallet found 2024-07-07 18:31:41 +02:00
ekzyis
5b561e22a9 Fix wallet logs refetch
onError does not exist on client.mutate
2024-07-07 18:31:41 +02:00
ekzyis
3b0605a691 Fix isConfigured 2024-07-07 18:31:41 +02:00
ekzyis
1f98a1a891 Fix usage of conditional hooks in useConfig 2024-07-07 18:31:41 +02:00
ekzyis
377ac04c85 Use same error format in toast and wallet log 2024-07-07 18:31:41 +02:00
ekzyis
9228328d3b Remove FIXMEs
Rebase on master seemed to have fixed these, weird
2024-07-07 18:31:41 +02:00
ekzyis
2aa0c9bc99 Fix confusing UX around enabled 2024-07-07 18:31:41 +02:00
ekzyis
4a16cc17aa Fix TypeError 2024-07-07 18:31:41 +02:00
ekzyis
4082a45618 wip: Add LND autowithdrawals
* receiving wallets need to export 'server' object field
* don't print macaroon error stack
* fix missing wallet logs order update
* mark autowithdrawl settings as required
* fix server wallet logs deletion
* remove canPay and canReceive since it was confusing where it is available

TODO

* also use numeric priority for sending wallets to be consistent with how status for receiving wallets is determined
* define createInvoice function in wallet definition
* consistent wallet logs: sending wallets use 'wallet attached'+'wallet enabled/disabled' whereas receiving wallets use 'wallet created/updated'
* see FIXMEs
2024-07-07 18:31:41 +02:00
ekzyis
91978171ed Remove logger.error since already handled in useWallet 2024-07-07 18:31:41 +02:00
ekzyis
dae69ec4b3 Add FIXMEs for LNC
I can't get LNC to connect. It just hangs forever on lnc.connect(). See FIXMEs.
2024-07-07 18:31:40 +02:00
ekzyis
6059e8f691 Use normal imports 2024-07-07 18:31:40 +02:00
ekzyis
1bae891594 Fix extremely slow page load for LNC import
I noticed that the combination of

```
import { Form, PasswordInput, SubmitButton } from '@/components/form'
```

in components/wallet/lnc.js and the dynamic import via `await import` in components/wallet/index.js caused extremely slow page loads.
2024-07-07 18:31:40 +02:00
ekzyis
7b6602e386 wip: Add LNC 2024-07-07 18:31:40 +02:00
ekzyis
7639390a16 Pass config with spread operator 2024-07-07 18:31:40 +02:00
ekzyis
29646eb956 Use INFO level for 'wallet disabled' message 2024-07-07 18:31:40 +02:00
ekzyis
dd47f2c02b Run validation during save 2024-07-07 18:31:40 +02:00
ekzyis
a5ea53dc39 Fix enableWallet
* wrong storage key was used
* broke if wallets with no configs existed
2024-07-07 18:31:40 +02:00
ekzyis
034cb4e8b2 Add NWC wallet 2024-07-07 18:31:40 +02:00
ekzyis
b8b0a4f985 Add schema to wallet def 2024-07-07 18:31:40 +02:00
ekzyis
0957cb5b83 Add logging to attach & detach 2024-07-07 18:31:40 +02:00
ekzyis
71c753810c Don't pass logger to sendPayment 2024-07-07 18:31:40 +02:00
ekzyis
1a2be99027 Set canPay, canReceive in useWallet 2024-07-07 18:31:40 +02:00
ekzyis
6ac8785c51 Update wallet logging + other stuff
* add canPay and canSend to wallet definition
* rename 'default payment method' to 'enabled' and add enable + disable method
2024-07-07 18:31:40 +02:00
ekzyis
a1b343ac89 Fix import error 2024-07-07 18:31:40 +02:00
ekzyis
5f047cbfc9 wip: Use uniform interface for wallets 2024-07-07 18:31:40 +02:00