* Migrate vault entries to new schema (#2092) * Migrate existing vault entries to new schema * Read+write new vault schema * Drop VaultEntry table * Refactor vaultPrismaFragments * Remove wrong comment * Remove TODO * Fix possible race condition on update of vault key * Remove lib/object.js * Wallet schema v2 (#2146) * Add wallet-v2 TODOs * Update checkWallet * Wallet list * Delete almost all wallet v1 code and add some code for wallet protocol forms * Define protocol display name in JSON * Show form per protocol * Increase max-height of image in form * Add JSdoc for protocols, form validation * Use wallet cards again My wallet list was quite ugly and I couldn't look at it anymore. * Refactor hooks in wallet provider * Fix PasswordInput not used * Read encrypted wallets * Decrypt wallets * useWalletQuery now returns decrypted wallets * Refactor useIndexedDB because its only purpose will be to store the key, so no need for pagination code etc. * There is still a bug: if the wallet is not decrypted on first render, the form will not see the decrypted value. See TODO. * Rename protocolJson to protocol it no longer uses a JSON file * Fix form not updated with decrypted API key * Fix wallet template forms * Fix optional shown as hint * Rename to mapUserWalletResolveTypes * Save LNbits send and recv TODO: * implement resolvers for other protocols * fix double update required for trigger? * add missing validation on server * add missing network tests * don't import from wallets/client on server * Move definitions to lib/wallets.json and lib/protocols * Fix ProtocolWallet.updated_at not updated by trigger * Move wallet fragments into wallets/client/fragments/ * move invoice fragments to fragments/invoice.js * remove some unused fragments that I don't think I also will not use * move fragments that will be generated in own file * Move wallet resolvers into wallets/server/resolvers * Fix missing authorization check on wallet update * Run all shared code in generic wallet update function * Fix 'encrypt' flag not set for blink send currency * Add mutations for all protocols * Fix macaroon validation * Fix CLN socket value not set * Add server-side schema validation * Fix JSDoc typedef for protocols * Don't put JSDoc into separate file * Create test invoices on save * Also move type resolvers into wallets/server/resolvers * Fix unconfigured protocols of UserWallet not found * Fix Blink API key in wallet seed * Test send payment on save (except LNC) This does not include LNC because LNC cannot be saved yet * Check if window.webln is defined on save * Create new wallets from templates * Separate protocols in wallets/lib into individual files * Use justify-content-start for protocol tabs and larger margin at the top * Add LNC to client protocols * Only return wallets from useWallets * Query decrypted wallets * Payments with new wallets * More wallet logos * Fix TypeError in useIndexedDB * Add protocol attach docs * Fix undefined useWalletRecvPrompt import * Remove outdated TODOs * First successful zap to new wallets * Fix walletLogger imports * Fix sequences * the sequences for InvoiceForward and DirectPayment were still starting at 1 * when using setval() with two arguments, nextval() will return the second argument+1 (see https://www.postgresql.org/docs/current/functions-sequence.html) * Rename ProtocolWallet columns * Remove more outdated TODOs * Update wallet indicator * Fix page reset on route change * Refactor __typename checks into functions * Refactor protocol selection into own hook * Add button to detach protocol * Refetch wallet on save and detach * Refetch wallets on change * Always show all templates * Refactor WalletLink component * Also put wallet into forms context * Remove outdated TODOs * Use useMemo in wallets hooks * Passphrase modals * prompt for password if decryption failed * add button to reveal passphrase on wallet page TODO: * remove button if passphrase was revealed or imported * encrypt wallets with new key on passphrase reveal * Fix protocol missing as callback dependency * Encrypt wallets with new key on passphrase export * Update 'unlock wallets' text * Rename wallet mutation hooks * Remove 'removeWallet' mutation Wallets are automatically deleted when all protocols are deleted * Passphrase reset * Use 110px as minimum width for bip39 words longest bip39 words are 8 characters and they fit into 103px so I rounded up to 110px. * Also disable passphrase export on save * Wallet settings * Fix wallet receive prompt * Remove unused parameters from postgres function * Rename UserWallet to Wallet, ProtocolWallet to WalletProtocol * Use danger variant for button to show passphrase * Fix inconsistent imports and exports * Remove outdated TODOs * wallet logs * Remove outdated comment * Make sure wallets are used in priority order * Separate wallets from templates in reducer * Fix missing useCallback dependencies * Refactor with useWalletLogger hook * Move enabled to WalletProtocol * Add checkbox to enable/disable protocol * Fix migration with prod db dump * Parse Coinos relay URLs * Skip network tests if only enabled changed * Allow IndexedDB calls without session * Add code to migrate old CryptoKey * first try to use existing CryptoKey before generating a new one * bump IDB version to delete old object stores and create new ones * return IDB callbacks with useMemo * don't delete old IDB right away, wait until next release * Fix ghost import error *Sometimes*, I get import errors because it tries to resolve @/wallets/server to wallets/server.js instead of wallets/server/index.js. For the files in wallets/server, it kind of makes sense because it's a circular import. But I don't know why the files in worker/ have this problem. Interestingly, it only seems to happen with walletLogger imports, so I guess its related to its import chain. Anyway, this commit should make sure this never happens again ... * Skip wallets queries if not logged in * Split CUSTOM wallet into NWC and LN_ADDR * Migrate local wallets * Link to /wallets/:id/receive if send not supported * Hide separator if there are no configured wallets * Save LNC * Add one-liner to attach LNC * Update wallet priorities via DnD * Wallet logs are part of protocol resolvers * Fix logging to deleted protocol * Fix trying to fetch logs for template * also change type to Int so GraphQL layer can catch trying to fetch string IDs as is the case for templates * Fix embedded flag for wallets logs not set * Remove TODO * Decrease max-height for embedded wallet logs on big screens * Fix missing refetch on wallet priority update * Set priorities of all wallets in one tx * Fix nested state update * Add DragIcon * DnD mobile support and refactor * Add CancelButton to wallet settings * Remount form if path changes This fixes the following warning in the console: """ Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. """ * Support string and object for wallet.image JSON * Append domain to lightning address inputs * Remove outdated TODOs * Add template IDs to wallet JSON * Fix missing callback dependency * Implement lightning address save in receive prompt * Update TODOs * Fix missing check for enabled * Pay QR codes with WebLN as anon * Add logo for NWC * Fix trying to save logs for template * Add template logs * Fix inconsistent margin * Always throw on missing key * Remove misleading comment Wallets are returned even if decryption fails so we can show the unlock page if a wallet is stored as encrypted in the context. Maybe I should rethink this. * Check for existing wallets on local wallet migration * Fix local wallet migration causing duplicates * Fix protocol reattached on detach due to migration * Fix form not centered * Fix ZEUS lightning address domain * Add placeholder, help, hints etc. to wallet form inputs * Fix wallet badges not updated * Remove unused declared variables * Rename to ATTACH_PAGE * Fix 500 error if no amount was given to LNURLp endpoint * Tag log messages with wallet name * Only skip network tests if we're disabling the wallet * Rename var to networkTests * Continue to store key hash in IndexedDB * Rethink wallet state management If decryption failed, the function to decrypt the wallets didn't throw but simply returned wallets that were still encrypted. This was bad because it meant we could not rely on the wallets in the state being decrypted, even though this was the original idea behind the query hooks: hide the details of encryption and decryption inside them. Because of this, we had to check if the wallets were still encrypted before we ran the wallet migration since we want to check if a protocol already exists. This commit fixes this by making encryption and decryption always throw (and catching the errors), as well as returning a ready state from hooks. A hook might not be ready because it still needs to load something (in the case of the crypto hooks, it's loading the key from IndexedDB). Callers check that ready state before they call the function returned by the hook. So now, the wallet migration hook can itself simply check if the hook to encrypt wallets is ready and if the wallets are no longer loading to let callers know if it itself is ready. Since we also relied on wallets stored as encrypted in the context to show the unlock page, this was also changed by comparing the local and remote key hash. * Add empty line * Save new key hash during wallet reset * Only receive protocol upserts require networkTests param * Compare key hashes on server on each save * Delete old code * Fix card shows attach instead of configure * Fix empty wallets created during migration The old schema can contain '' instead of NULL in the columns of wallets for receiving. * Update reset passphrase text * Wrap passphrase reset in try/catch * Fix migrate called multiple times * Update key hash on migration if not set * Fetch local wallets in migrate * Fix missing await on setKey * Let first device set key hash * Fix indicator not shown if wallets locked * Check if IndexedDB is available * Fix inconsistent WebLN error message * Disable WebLN if not available * Remove outdated TODO * Cursor-based pagination for wallet logs * Fix log message x-overflow * Add context to wallet logs * Wrap errors are warnings in logs * Rename wallet v2 migrations * Update wallet status during logging * Fix wallet logs loading state The loading state would go from false -> true -> false because it's false when the lazy query wasn't called yet. * Add wallet search * Add Alby Go wallet * Revert "Add Alby Go wallet" This reverts commit 926c70638f1673756480c848237e52d5889dc037. * Fix wallet logs sent by client don't update protocol status * Fix mutation name * put drag icon on opposite corner * Add wallets/README.md * Fix inconsistent case in wallets/README.md * Fix autoprefixer warning about mixed support This warning was in the app logs: app | Warning app | app | (31:3) autoprefixer: end value has mixed support, consider using flex-end instead app | app | Import trace for requested module: app | ./styles/wallet.module.css app | ./wallets/client/hooks/prompt.js app | ./wallets/client/hooks/index.js app | ./wallets/client/context/hooks.js app | ./wallets/client/context/provider.js app | ./wallets/client/context/index.js * fix effect of wallet indicators on logo * Fix deleting wallet template logs * Use name as primary key of WalletTemplate * Fix wallet_clear_vault trigger not mentioned in README * Fix wallet receive prompt Also remove no longer needed templateId from wallets.json and helper functions * Use findUnique since name is now primary key * Merge Alby wallets into one * Remove unused name parameter from WalletsForm component * Fix number check to decide if wallet or template * Update wallet encryption on click, not as effect * add cashu.me and lightning address logos * add images * Use recommended typeof to check if IDB available * Also check if IDB available on delete * Use constraint triggers * Add indices on columns used for joins * Fix inconsistent CLEAR OR REPLACE TRIGGER * Attach wallet_check_support trigger to WalletProtocol table * Update wallets/README.md * Remove debugging code * Refactor reducer: replace page with status * Show 'wallets unavailable' if device does not support IndexedDB * Remove duplicate ELSIF condition * Fix hasSendWallet The useSendWallets hook was not checking if the returned send wallets are enabled. Since the components that used that hook only need to know if there is a send wallet, I replaced the useSendWallets hook with a useHasSendWallet hook. * Add Cash App wallet * fix changes loglevel enum * Fix key init race condition in strict mode if no key exists yet * Formatting * Fix key init race condition via transactions in readwrite mode * Replace Promise.withResolvers with regular promises * replace generic spinner with our usual --------- Co-authored-by: k00b <k00b@stacker.news>
25 lines
7.4 KiB
XML
25 lines
7.4 KiB
XML
<svg width="141" height="38" viewBox="0 0 141 38" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M13.6001 22H36.8001V31.1H13.6001V22Z" fill="white"/>
|
|
<path d="M4.9001 9.5001C2.30436 9.5001 0.200098 7.39584 0.200098 4.8001C0.200098 2.20436 2.30436 0.100098 4.9001 0.100098C7.49584 0.100098 9.6001 2.20436 9.6001 4.8001C9.6001 7.39584 7.49584 9.5001 4.9001 9.5001Z" fill="#C5C7C8"/>
|
|
<path d="M4.9001 9.5001C2.30436 9.5001 0.200098 7.39584 0.200098 4.8001C0.200098 2.20436 2.30436 0.100098 4.9001 0.100098C7.49584 0.100098 9.6001 2.20436 9.6001 4.8001C9.6001 7.39584 7.49584 9.5001 4.9001 9.5001Z" fill="black" fill-opacity="0.8"/>
|
|
<path d="M13.5469 11.9619L12.0537 13.4385L3.45312 4.73828L4.94727 3.26172L13.5469 11.9619Z" fill="#C5C7C8"/>
|
|
<path d="M13.5469 11.9619L12.0537 13.4385L3.45312 4.73828L4.94727 3.26172L13.5469 11.9619Z" fill="black" fill-opacity="0.8"/>
|
|
<path d="M42.9002 9.39999C45.4959 9.39999 47.6002 7.29574 47.6002 4.7C47.6002 2.10426 45.4959 0 42.9002 0C40.3045 0 38.2002 2.10426 38.2002 4.7C38.2002 7.29574 40.3045 9.39999 42.9002 9.39999Z" fill="#C5C7C8"/>
|
|
<path d="M42.9002 9.39999C45.4959 9.39999 47.6002 7.29574 47.6002 4.7C47.6002 2.10426 45.4959 0 42.9002 0C40.3045 0 38.2002 2.10426 38.2002 4.7C38.2002 7.29574 40.3045 9.39999 42.9002 9.39999Z" fill="black" fill-opacity="0.8"/>
|
|
<path d="M44.5425 4.74219L35.8423 13.4424L34.3579 11.958L43.0581 3.25781L44.5425 4.74219Z" fill="#C5C7C8"/>
|
|
<path d="M44.5425 4.74219L35.8423 13.4424L34.3579 11.958L43.0581 3.25781L44.5425 4.74219Z" fill="black" fill-opacity="0.8"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 32.3003C4.86619 31.7747 3.93245 30.897 3.33782 29.7979C2.74319 28.6987 2.51948 27.4369 2.7 26.2003C4.7 14.3003 13.5 5.30029 24.1 5.30029C34.7 5.30029 43.5 14.3003 45.4 26.3003C45.9 28.8003 44.5 31.3003 42.2 32.3003C36.5448 35.0506 30.3385 36.4797 24.05 36.4797C17.7615 36.4797 11.5552 35.0506 5.9 32.3003H6Z" fill="#FFDF6F"/>
|
|
<path d="M45.4001 26.2003L44.4001 26.5003L45.4001 26.3003V26.2003ZM3.80015 26.4003C5.80015 14.8003 14.2002 6.40028 24.1002 6.40028V4.30029C12.9002 4.30029 3.70014 13.8003 1.70014 26.0003L3.70014 26.4003H3.80015ZM24.1002 6.40028C34.0002 6.40028 42.5001 14.9003 44.4001 26.4003L46.5001 26.1003C44.5001 13.8003 35.3002 4.30029 24.1002 4.30029V6.40028ZM41.7001 31.4003C36.4001 34.0003 30.5001 35.4003 24.2001 35.4003V37.6003C30.8001 37.6003 37.1001 36.1003 42.7001 33.4003L41.7001 31.4003ZM24.2001 35.4003C17.8001 35.4003 11.8001 34.0003 6.40014 31.4003L5.40014 33.3003C11.1001 36.0003 17.4001 37.6003 24.2001 37.6003V35.4003ZM44.4001 26.4003C44.7001 28.5003 43.6001 30.5003 41.7001 31.4003L42.7001 33.4003C44.0443 32.766 45.1436 31.7088 45.8299 30.3904C46.5161 29.072 46.7516 27.5651 46.5001 26.1003L44.4001 26.5003V26.4003ZM1.70014 26.0003C1.20014 29.0003 2.70015 32.0003 5.50015 33.3003L6.50015 31.3003C4.50015 30.4003 3.50015 28.4003 3.80015 26.3003L1.70014 26.0003Z" fill="#C5C7C8"/>
|
|
<path d="M45.4001 26.2003L44.4001 26.5003L45.4001 26.3003V26.2003ZM3.80015 26.4003C5.80015 14.8003 14.2002 6.40028 24.1002 6.40028V4.30029C12.9002 4.30029 3.70014 13.8003 1.70014 26.0003L3.70014 26.4003H3.80015ZM24.1002 6.40028C34.0002 6.40028 42.5001 14.9003 44.4001 26.4003L46.5001 26.1003C44.5001 13.8003 35.3002 4.30029 24.1002 4.30029V6.40028ZM41.7001 31.4003C36.4001 34.0003 30.5001 35.4003 24.2001 35.4003V37.6003C30.8001 37.6003 37.1001 36.1003 42.7001 33.4003L41.7001 31.4003ZM24.2001 35.4003C17.8001 35.4003 11.8001 34.0003 6.40014 31.4003L5.40014 33.3003C11.1001 36.0003 17.4001 37.6003 24.2001 37.6003V35.4003ZM44.4001 26.4003C44.7001 28.5003 43.6001 30.5003 41.7001 31.4003L42.7001 33.4003C44.0443 32.766 45.1436 31.7088 45.8299 30.3904C46.5161 29.072 46.7516 27.5651 46.5001 26.1003L44.4001 26.5003V26.4003ZM1.70014 26.0003C1.20014 29.0003 2.70015 32.0003 5.50015 33.3003L6.50015 31.3003C4.50015 30.4003 3.50015 28.4003 3.80015 26.3003L1.70014 26.0003Z" fill="black" fill-opacity="0.8"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5002 29.4C8.60018 28.7 7.50019 26.7 8.10019 24.8C10.2002 18.3 16.6002 13.5 24.1002 13.5C31.6002 13.5 38.0002 18.3 40.1002 24.8C40.6002 26.7 39.5002 28.7 37.7002 29.4C33.3917 31.1988 28.7691 32.125 24.1002 32.125C19.4313 32.125 14.8087 31.1988 10.5002 29.4Z" fill="#C5C7C8"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5002 29.4C8.60018 28.7 7.50019 26.7 8.10019 24.8C10.2002 18.3 16.6002 13.5 24.1002 13.5C31.6002 13.5 38.0002 18.3 40.1002 24.8C40.6002 26.7 39.5002 28.7 37.7002 29.4C33.3917 31.1988 28.7691 32.125 24.1002 32.125C19.4313 32.125 14.8087 31.1988 10.5002 29.4Z" fill="black" fill-opacity="0.8"/>
|
|
<path d="M29.4 26.6004C31.5539 26.6004 33.3 25.2125 33.3 23.5004C33.3 21.7883 31.5539 20.4004 29.4 20.4004C27.2461 20.4004 25.5 21.7883 25.5 23.5004C25.5 25.2125 27.2461 26.6004 29.4 26.6004Z" fill="#F8C455"/>
|
|
<path d="M29.4 26.6004C31.5539 26.6004 33.3 25.2125 33.3 23.5004C33.3 21.7883 31.5539 20.4004 29.4 20.4004C27.2461 20.4004 25.5 21.7883 25.5 23.5004C25.5 25.2125 27.2461 26.6004 29.4 26.6004Z" fill="white"/>
|
|
<path d="M18.2999 26.6004C20.4538 26.6004 22.1999 25.2125 22.1999 23.5004C22.1999 21.7883 20.4538 20.4004 18.2999 20.4004C16.146 20.4004 14.3999 21.7883 14.3999 23.5004C14.3999 25.2125 16.146 26.6004 18.2999 26.6004Z" fill="#F8C455"/>
|
|
<path d="M18.2999 26.6004C20.4538 26.6004 22.1999 25.2125 22.1999 23.5004C22.1999 21.7883 20.4538 20.4004 18.2999 20.4004C16.146 20.4004 14.3999 21.7883 14.3999 23.5004C14.3999 25.2125 16.146 26.6004 18.2999 26.6004Z" fill="white"/>
|
|
<path d="M124.842 36.8426C124.095 36.8426 123.395 36.7827 122.741 36.663C122.096 36.5524 121.561 36.4095 121.137 36.2345L122.464 31.839C123.155 32.0509 123.777 32.1661 124.33 32.1845C124.892 32.203 125.376 32.0739 125.782 31.7975C126.196 31.5211 126.533 31.0511 126.791 30.3876L127.136 29.4892L119.52 7.6499H125.712L130.108 23.2415H130.329L134.766 7.6499H141L132.748 31.1755C132.352 32.3181 131.813 33.3133 131.131 34.1611C130.458 35.0181 129.606 35.677 128.574 36.1377C127.542 36.6077 126.298 36.8426 124.842 36.8426Z" fill="#272828"/>
|
|
<path d="M97.2563 28.8814V0.573242H103.145V11.2164H103.324C103.582 10.6451 103.956 10.0646 104.444 9.47482C104.942 8.87585 105.587 8.37825 106.379 7.98201C107.181 7.57655 108.176 7.37382 109.365 7.37382C110.913 7.37382 112.341 7.77928 113.65 8.59019C114.958 9.39188 116.004 10.6036 116.787 12.2255C117.571 13.8381 117.962 15.8607 117.962 18.2935C117.962 20.6617 117.58 22.6613 116.815 24.2923C116.059 25.9142 115.027 27.1444 113.719 27.9829C112.419 28.8122 110.963 29.2269 109.351 29.2269C108.208 29.2269 107.236 29.038 106.434 28.6602C105.642 28.2824 104.992 27.8078 104.485 27.2365C103.979 26.656 103.592 26.0708 103.324 25.4811H103.062V28.8814H97.2563ZM103.02 18.2658C103.02 19.5283 103.195 20.6294 103.546 21.5693C103.896 22.5093 104.402 23.2419 105.066 23.7671C105.729 24.2831 106.536 24.5411 107.485 24.5411C108.443 24.5411 109.254 24.2785 109.918 23.7533C110.581 23.2188 111.083 22.4816 111.424 21.5417C111.774 20.5926 111.949 19.5006 111.949 18.2658C111.949 17.0402 111.779 15.9621 111.438 15.0314C111.097 14.1007 110.595 13.3727 109.931 12.8475C109.268 12.3222 108.452 12.0596 107.485 12.0596C106.527 12.0596 105.716 12.313 105.052 12.8198C104.398 13.3266 103.896 14.0454 103.546 14.9761C103.195 15.9068 103.02 17.0034 103.02 18.2658Z" fill="#272828"/>
|
|
<path d="M92.4283 0.573242V28.8814H86.54V0.573242H92.4283Z" fill="#272828"/>
|
|
<path d="M62.4136 28.8814H56L65.7724 0.573242H73.4852L83.2438 28.8814H76.8302L69.7394 7.04209H69.5182L62.4136 28.8814ZM62.0127 17.7544H77.162V22.4263H62.0127V17.7544Z" fill="#272828"/>
|
|
</svg>
|