Commit Graph

627 Commits

Author SHA1 Message Date
keyan a0c1d4f602 make lnc work 2024-07-18 18:56:49 -05:00
ekzyis 587bfa34be Generate validation schema for LND 2024-07-17 02:38:04 +02:00
ekzyis 3933a4f460 Generate validation schema for LNC 2024-07-17 01:25:53 +02:00
ekzyis 667cde6042 Rename to torAllowed 2024-07-17 01:03:45 +02:00
ekzyis 6432ea7b44 Generate validation schema for NWC 2024-07-17 00:58:43 +02:00
ekzyis fb2b34ce67 Generate validation schema for LNbits 2024-07-17 00:58:43 +02:00
ekzyis b777fdcddc Fix wallet.server usage
* I removed wallet.server in a previous commit
* the client couldn't determine which wallet was stored on the server since all server specific fields were set in server.js
* walletType and walletField are now set in index.js
* walletType is now used to determine if a wallet is stored on the server

* also included some formatting changes
2024-07-16 22:08:41 +02:00
ekzyis cba76444dd Move wallets into top level directory wallet/ 2024-07-16 06:09:27 +02:00
ekzyis 03ca84629b Remove React dependency from wallet definitions 2024-07-15 16:23:24 +02:00
keyan c767e106a0 merge master 2024-07-12 18:24:31 -05:00
keyan 07042c57ca improve UX of notifications 2024-07-11 16:59:07 -05:00
keyan 6c6d2dab18 fix typo 2024-07-11 11:55:19 -05:00
keyan 64eb22cc5e new rewards banner 2024-07-10 19:59:05 -05:00
Keyan c6554d3ca7
Referral Rewards (#1262)
* referral rewards

* make referral notifications consistent

* remove plpgsql from earn job

* remove dead code

* remove debug logging
2024-07-10 19:23:05 -05:00
ekzyis 7402885998 Use common sort 2024-07-08 11:34:05 +02:00
ekzyis 1a60f13d72 Fix order if wallet with no priority exists 2024-07-08 11:06:46 +02:00
ekzyis 2051dd0e88 Use touches instead of dnd on mobile
Browsers don't support drag events for touch devices.

To have a consistent implementation for desktop and mobile, we would need to use mousedown/touchstart, mouseup/touchend and mousemove/touchmove.

For now, this commit makes changing the order possible on touch devices with simple touches.
2024-07-08 07:33:10 +02:00
ekzyis 5d678ced23 Fix draggable false on first page load due to SSR 2024-07-08 06:54:27 +02:00
ekzyis 85464f93b9 Detach wallets and delete logs on logout 2024-07-07 18:35:57 +02:00
ekzyis ebe741dc92 Add missing hints 2024-07-07 18:35:57 +02:00
ekzyis bd0e4d906c Fix draggable 2024-07-07 18:35:57 +02:00
ekzyis 8dac53d7d5 Fix wallet security banner shown for server wallets 2024-07-07 18:31:41 +02:00
ekzyis 0a0085fe82 Remove unnecessary WALLETS_QUERY 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 8acf74c787 Fix autowithdrawSettings not applied
Form requires config in flat format but mutation requires autowithdraw settings in a separate 'settings' field.

I have decided that config will be in flat form format. It will be transformed into mutation format during save.
2024-07-07 18:31:41 +02:00
ekzyis 55928ac252 Save order as priority 2024-07-07 18:31:41 +02:00
ekzyis c270805649 Use dynamic import for WalletCard
This fixes a lot of issues with hydration
2024-07-07 18:31:41 +02:00
ekzyis eb2f4b980f Implement drag & drop w/o persistence 2024-07-07 18:31:41 +02:00
ekzyis 39d8928772 Disable checkbox if not configured yet 2024-07-07 18:31:41 +02:00
ekzyis da6d262e0a Also enable server wallets on create 2024-07-07 18:31:41 +02:00
ekzyis d7c81cfa9f Fix sendPayment called with empty config
* removed useEffect such that config is available on first render
* fix hydration error using dynamic import without SSR
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 ae0335d537 Don't require destructuring to pass props to input 2024-07-07 18:31:41 +02:00
ekzyis 61be80446d Revert "Fix 20s page load for /settings/wallets.json?nodata=true"
This reverts commit deb476b3a966569fefcfdf4082d6b64f90fbd0a2.

Not using the dynamic import for LNC fixed the slow page load with ?nodata=true.
2024-07-07 18:31:40 +02:00
ekzyis 276e734a7a Fix 20s page load for /settings/wallets.json?nodata=true
For some reason, if nodata is passed (which is the case if going back), the page takes 20s to load.
2024-07-07 18:31:40 +02:00
ekzyis 8e2dd45e23 Support help, optional, hint in wallet fields 2024-07-07 18:31:40 +02:00
ekzyis dd47f2c02b Run validation during save 2024-07-07 18:31:40 +02:00
ekzyis 399c62a7e3 Fix unused isDefault saved in config 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 0de82db78a Enable wallet if just configured 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
Keyan 3bada4b5da
new referral scheme (#1255)
* capture/store data for new referral scheme

* simplify signup/forever referral rules

* no self-referrals and other fixes

* better post/comment distinction and support /items/1/related
2024-07-07 11:12:02 -05:00
Keyan 79f0df17b2
improve pessimistic paid actions by letting the server perform actions and settle invoice on `HELD` (#1253)
* get rid of hash and hmac based pessimism

* fix readme
2024-07-04 12:30:42 -05:00
keyan 6e8d7ef1b8 allow slog logs to be disabled/configured 2024-07-01 16:48:54 -05:00
Keyan ca11ac9fb8
backend payment optimism (#1195)
* wip backend optimism

* another inch

* make action state transitions only happen once

* another inch

* almost ready for testing

* use interactive txs

* another inch

* ready for basic testing

* lint fix

* inches

* wip item update

* get item update to work

* donate and downzap

* inchy inch

* fix territory paid actions

* wip usePaidMutation

* usePaidMutation error handling

* PENDING_HELD and HELD transitions, gql paidAction return types

* mostly working pessimism

* make sure invoice field is present in optimisticResponse

* inches

* show optimistic values to current me

* first pass at notifications and payment status reporting

* fix migration to have withdrawal hash

* reverse optimism on payment failure

* Revert "Optimistic updates via pending sats in item context (#1229)"

This reverts commit 93713b33df.

* add onCompleted to usePaidMutation

* onPaid and onPayError for new comments

* use 'IS DISTINCT FROM' for NULL invoiceActionState columns

* make usePaidMutation easier to read

* enhance invoice qr

* prevent actions on unpaid items

* allow navigation to action's invoice

* retry create item

* start edit window after item is paid for

* fix ux of retries from notifications

* refine retries

* fix optimistic downzaps

* remember item updates can't be retried

* store reference to action item in invoice

* remove invoice modal layout shift

* fix destructuring

* fix zap undos

* make sure ItemAct is paid in aggregate queries

* dont toast on long press zap undo

* fix delete and remindme bots

* optimistic poll votes with retries

* fix retry notifications and invoice item context

* fix pessimisitic typo

* item mentions and mention notifications

* dont show payment retry on item popover

* make bios work

* refactor paidAction transitions

* remove stray console.log

* restore docker compose nwc settings

* add new todos

* persist qr modal on post submission + unify item form submission

* fix post edit threshold

* make bounty payments work

* make job posting work

* remove more store procedure usage ... document serialization concerns

* dont use dynamic imports for paid action modules

* inline comment denormalization

* create item starts with median votes

* fix potential of serialization anomalies in zaps

* dont trigger notification indicator on successful paid action invoices

* ignore invoiceId on territory actions and add optimistic concurrency control

* begin docs for paid actions

* better error toasts and fix apollo cache warnings

* small documentation enhancements

* improve paid action docs

* optimistic concurrency control for territory updates

* use satsToMsats and msatsToSats helpers

* explictly type raw query template parameters

* improve consistency of nested relation names

* complete paid action docs

* useEffect for canEdit on payment

* make sure invoiceId is provided when required

* don't return null when expecting array

* remove buy credits

* move verifyPayment to paidAction

* fix comments invoicePaidAt time zone

* close nwc connections once

* grouped logs for paid actions

* stop invoiceWaitUntilPaid if not attempting to pay

* allow actionState to transition directly from HELD to PAID

* make paid mutation wait until pessimistic are fully paid

* change button text when form submits/pays

* pulsing form submit button

* ignore me in notification indicator for territory subscription

* filter unpaid items from more queries

* fix donation stike timing

* fix pending poll vote

* fix recent item notifcation padding

* no default form submitting button text

* don't show paying on submit button on free edits

* fix territory autorenew with fee credits

* reorg readme

* allow jobs to be editted forever

* fix image uploads

* more filter fixes for aggregate views

* finalize paid action invoice expirations

* remove unnecessary async

* keep clientside cache normal/consistent

* add more detail to paid action doc

* improve paid action table

* remove actionType guard

* fix top territories

* typo api/paidAction/README.md

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

* typo components/use-paid-mutation.js

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

* Apply suggestions from code review

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

* encorporate ek feeback

* more ek suggestions

* fix 'cost to post' hover on items

* Apply suggestions from code review

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

---------

Co-authored-by: ekzyis <ek@stacker.news>
2024-07-01 12:02:29 -05:00
ekzyis 30e29f709d
Add missing CANCELLED status (#1248) 2024-07-01 08:43:13 -05:00