stacker.news/svgs
ekzyis b9461b7eb3
Allow zapping, posting and commenting without funds or an account (#336)
* Add anon zaps

* Add anon comments and posts (link, discussion, poll)

* Use payment hash instead of invoice id as proof of payment

Our invoice IDs can be enumerated.
So there is a - even though very rare - chance that an attacker could find a paid invoice which is not used yet and use it for himself.
Random payment hashes prevent this.

Also, since we delete invoices after use, using database IDs as proof of payments are not suitable.
If a user tells us an invoice ID after we deleted it, we can no longer tell if the invoice was paid or not since the LN node only knows about payment hashes but nothing about the database IDs.

* Allow pay per invoice for stackers

The modal which pops up if the stacker does not have enough sats now has two options: "fund wallet" and "pay invoice"

* Fix onSuccess called twice

For some reason, when calling `showModal`, `useMemo` in modal.js and the code for the modal component (here: <Invoice>) is called twice.

This leads to the `onSuccess` callback being called twice and one failing since the first one deletes the invoice.

* Keep invoice modal open if focus is lost

* Skip anon user during trust calculation

* Add error handling

* Skip 'invoice not found' errors

* Remove duplicate insufficient funds handling

* Fix insufficient funds error detection

* Fix invoice amount for comments

* Allow pay per invoice for bounty and job posts

* Also strike on payment after short press

* Fix unexpected token 'export'

* Fix eslint

* Remove unused id param

* Fix comment copy-paste error

* Rename to useInvoiceable

* Fix unexpected token 'export'

* Fix onConfirmation called at every render

* Add invoice HMAC

This prevents entities which know the invoice hash (like all LN nodes on the payment path) from using the invoice hash on SN.

Only the user which created the invoice knows the HMAC and thus can use the invoice hash.

* make anon posting less hidden, add anon info button explainer

* Fix anon users can't zap other anon users

* Always show repeat and contacts on action error

* Keep track of modal stack

* give anon an icon

* add generic date pivot helper

* make anon user's invoices expire in 5 minutes

* fix forgotten find and replace

* use datePivot more places

* add sat amounts to invoices

* reduce anon invoice expiration to 3 minutes

* don't abbreviate

* Fix [object Object] as error message

Any errors thrown here are already objects of shape { message: string }

* Fix empty invoice creation attempts

I stumbled across this while checking if anons can edit their items.

I monkey patched the code to make it possible (so they can see the 'edit' button) and tried to edit an item but I got this error:

  Variable "$amount" of required type "Int!" was not provided.

I fixed this even though this function should never be called without an amount anyway. It will return a sane error in that case now.

* anon func mods, e.g. inv limits

* anon tips should be denormalized

* remove redundant meTotalSats

* correct overlay zap text for anon

* exclude anon from trust graph before algo runs

* remove balance limit on anon

* give anon a bio and remove cowboy hat/top stackers;

* make anon hat appear on profile

* concat hash and hmac and call it a token

* Fix localStorage cleared because error were swallowed

* fix qr layout shift

* restyle fund error modal

* Catch invoice errors in fund error modal

* invoice check backoff

* anon info typo

* make invoice expiration times have saner defaults

* add comma to anon info

* use builtin copy input label

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-11 18:50:57 -05:00
..
add-fill.svg add polls 2022-07-30 08:51:04 -05:00
amboss.svg add amboss link in footer 2023-05-05 16:22:22 -05:00
arrow-down-line.svg sub related enchancements 2023-05-02 11:55:10 -05:00
arrow-down-s-fill.svg WIP tips 2021-09-10 13:55:36 -05:00
arrow-left-fill.svg lightning login copy 2023-01-10 12:55:17 -06:00
arrow-left-line.svg lightning login copy 2023-01-10 12:55:17 -06:00
arrow-right-s-fill.svg WIP tips 2021-09-10 13:55:36 -05:00
arrow-up-s-fill.svg tables 2021-04-13 19:57:32 -05:00
bald.svg streaks 2023-02-01 17:40:49 -06:00
bar-chart-horizontal-fill.svg add polls 2022-07-30 08:51:04 -05:00
bit-coin-fill.svg ready for invoices 2021-05-06 16:15:22 -05:00
bitcoin.svg new bolt 2021-12-05 11:37:55 -06:00
bold.svg lexical beta test url 2023-01-05 13:24:09 -06:00
bolt.svg new bolt 2021-12-05 11:37:55 -06:00
bookmark.svg Implement bookmarking of posts and comments (#235) 2023-02-16 16:23:59 -06:00
bounty-bag.svg stackernews bounties (#227) 2023-01-26 10:11:55 -06:00
briefcase-4-fill.svg jobs w/o payments yet 2022-02-24 13:05:57 -06:00
chat-3-fill.svg refine reply-only notifications 2022-04-21 12:48:27 -05:00
check-double-line.svg invoiced ... WIP transactions 2021-05-11 10:52:50 -05:00
check-line.svg lexical beta test url 2023-01-05 13:24:09 -06:00
checkbox-circle-fill.svg add polls 2022-07-30 08:51:04 -05:00
close-line.svg invoiced ... WIP transactions 2021-05-11 10:52:50 -05:00
cloud-fill.svg wild west mode 2022-09-21 14:57:36 -05:00
code-box-line.svg lexical beta test url 2023-01-05 13:24:09 -06:00
code-line.svg lexical beta test url 2023-01-05 13:24:09 -06:00
coin-fill.svg ready for invoices 2021-05-06 16:15:22 -05:00
cowboy.svg streaks 2023-02-01 17:40:49 -06:00
double-quotes-r.svg lexical beta test url 2023-01-05 13:24:09 -06:00
error-warning-fill.svg wild west mode 2022-09-21 14:57:36 -05:00
eye-close-fill.svg collapse 'em 2021-04-30 16:42:51 -05:00
eye-close-line.svg collapse 'em 2021-04-30 16:42:51 -05:00
eye-fill.svg collapse 'em 2021-04-30 16:42:51 -05:00
eye-line.svg collapse 'em 2021-04-30 16:42:51 -05:00
file-warning-line.svg Revert "Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades"" 2023-07-23 10:08:43 -05:00
flag-2-fill.svg wild west mode 2022-09-21 14:57:36 -05:00
flag-fill.svg wild west mode 2022-09-21 14:57:36 -05:00
font-size-2.svg lexical beta test url 2023-01-05 13:24:09 -06:00
github-fill.svg custom auth page 2021-04-24 16:05:07 -05:00
hand-coin-fill.svg ready for invoices 2021-05-06 16:15:22 -05:00
image-add-fill.svg image uploading backend 2022-05-12 13:44:21 -05:00
image-add-line.svg lexical beta test url 2023-01-05 13:24:09 -06:00
image-edit-fill.svg profile photos 2022-05-16 15:51:22 -05:00
image-fill.svg enhance image detection and proxy 2023-07-13 15:18:04 -05:00
image-line.svg lexical beta test url 2023-01-05 13:24:09 -06:00
indent-decrease.svg lexical beta test url 2023-01-05 13:24:09 -06:00
indent-increase.svg lexical beta test url 2023-01-05 13:24:09 -06:00
information-fill.svg jobs w/o payments yet 2022-02-24 13:05:57 -06:00
italic.svg lexical beta test url 2023-01-05 13:24:09 -06:00
lightning-arrow.svg tables 2021-04-13 19:57:32 -05:00
lightning-plus.svg different icon for tipping 2021-11-17 16:54:00 -06:00
lightning-pplus.svg change tip upvote icon 2021-11-26 13:24:51 -06:00
lightning-warning.svg tables 2021-04-13 19:57:32 -05:00
lightning.svg add forgetten lnurl-auth files 2021-06-26 22:18:32 -05:00
link.svg linkable headers 2022-07-17 10:35:50 -05:00
list-ordered.svg lexical beta test url 2023-01-05 13:24:09 -06:00
list-unordered.svg add table of contents 2022-07-18 16:24:28 -05:00
login-box-line.svg a bunch of increments 2021-04-12 13:05:09 -05:00
logout-box-line.svg a bunch of increments 2021-04-12 13:05:09 -05:00
logout-box-r-line.svg a bunch of increments 2021-04-12 13:05:09 -05:00
mail-open-fill.svg job board enhancements 2022-07-21 17:55:05 -05:00
mail-open-line.svg job board enhancements 2022-07-21 17:55:05 -05:00
markdown-fill.svg markdown previews 2021-07-01 18:51:58 -05:00
markdown-line.svg markdown previews 2021-07-01 18:51:58 -05:00
moon-fill.svg ready for invoices 2021-05-06 16:15:22 -05:00
more-fill.svg wild west mode 2022-09-21 14:57:36 -05:00
more-line.svg wild west mode 2022-09-21 14:57:36 -05:00
no.svg allow lightning animation to be disabled 2022-10-04 17:34:28 -05:00
nostr.svg Add nostr login (#367) 2023-08-07 19:50:01 -05:00
notification-4-fill.svg Update notification-4-fill.svg 2022-06-07 16:49:57 -04:00
pin.svg support pinned posts + recurring pins 2022-01-07 10:32:31 -06:00
pushpin-fill.svg Update pushpin-fill.svg 2022-06-07 15:23:01 -04:00
pushpin-line.svg better pin icon 2022-01-08 09:30:59 -06:00
pyramid.svg tables 2021-04-13 19:57:32 -05:00
search-fill.svg search bar ui 2022-01-26 15:43:18 -06:00
search-line.svg search bar ui 2022-01-26 15:43:18 -06:00
share-fill.svg referrals 2022-12-19 16:27:52 -06:00
share-forward-fill.svg referrals 2022-12-19 16:27:52 -06:00
slashtags.svg slashtags auth 2023-01-18 12:49:20 -06:00
spy-fill.svg Allow zapping, posting and commenting without funds or an account (#336) 2023-08-11 18:50:57 -05:00
strikethrough.svg lexical beta test url 2023-01-05 13:24:09 -06:00
subtract-line.svg collapse 'em 2021-04-30 16:42:51 -05:00
sun-fill.svg dark mode without ability to switch 2021-11-04 14:22:03 -04:00
texas.svg foss and twitter link in footer 2021-06-30 18:01:28 -05:00
thumb-down-fill.svg make withdrawls mostly work 2021-05-13 16:19:51 -05:00
thumb-up-fill.svg ready for invoices 2021-05-06 16:15:22 -05:00
tip.svg tip button 2021-11-19 13:13:59 -06:00
triangle.svg tables 2021-04-13 19:57:32 -05:00
twitter-fill.svg custom auth page 2021-04-24 16:05:07 -05:00
underline.svg lexical beta test url 2023-01-05 13:24:09 -06:00
upbolt.svg new bolt 2021-12-05 11:37:55 -06:00
window-2-fill.svg complete tips 2021-09-10 16:13:52 -05:00
youtube-line.svg snl live banner 2023-06-20 09:57:06 -05:00