* 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.5 KiB
XML
25 lines
7.5 KiB
XML
<svg width="141" height="39" viewBox="0 0 141 39" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M13.6001 22.7998H36.8001V31.8998H13.6001V22.7998Z" fill="white"/>
|
|
<path d="M4.9001 10.2999C2.30436 10.2999 0.200098 8.19564 0.200098 5.5999C0.200098 3.00416 2.30436 0.899902 4.9001 0.899902C7.49584 0.899902 9.6001 3.00416 9.6001 5.5999C9.6001 8.19564 7.49584 10.2999 4.9001 10.2999Z" fill="#C5C7C8"/>
|
|
<path d="M4.9001 10.2999C2.30436 10.2999 0.200098 8.19564 0.200098 5.5999C0.200098 3.00416 2.30436 0.899902 4.9001 0.899902C7.49584 0.899902 9.6001 3.00416 9.6001 5.5999C9.6001 8.19564 7.49584 10.2999 4.9001 10.2999Z" fill="white" fill-opacity="0.8"/>
|
|
<path d="M13.5469 12.7617L12.0537 14.2383L3.45312 5.53809L4.94727 4.06152L13.5469 12.7617Z" fill="#C5C7C8"/>
|
|
<path d="M13.5469 12.7617L12.0537 14.2383L3.45312 5.53809L4.94727 4.06152L13.5469 12.7617Z" fill="white" fill-opacity="0.8"/>
|
|
<path d="M42.9002 10.1998C45.4959 10.1998 47.6002 8.09554 47.6002 5.4998C47.6002 2.90406 45.4959 0.799805 42.9002 0.799805C40.3045 0.799805 38.2002 2.90406 38.2002 5.4998C38.2002 8.09554 40.3045 10.1998 42.9002 10.1998Z" fill="#C5C7C8"/>
|
|
<path d="M42.9002 10.1998C45.4959 10.1998 47.6002 8.09554 47.6002 5.4998C47.6002 2.90406 45.4959 0.799805 42.9002 0.799805C40.3045 0.799805 38.2002 2.90406 38.2002 5.4998C38.2002 8.09554 40.3045 10.1998 42.9002 10.1998Z" fill="white" fill-opacity="0.8"/>
|
|
<path d="M44.5425 5.54199L35.8423 14.2422L34.3579 12.7578L43.0581 4.05762L44.5425 5.54199Z" fill="#C5C7C8"/>
|
|
<path d="M44.5425 5.54199L35.8423 14.2422L34.3579 12.7578L43.0581 4.05762L44.5425 5.54199Z" fill="white" fill-opacity="0.8"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 33.1001C4.86619 32.5745 3.93245 31.6968 3.33782 30.5977C2.74319 29.4985 2.51948 28.2367 2.7 27.0001C4.7 15.1001 13.5 6.1001 24.1 6.1001C34.7 6.1001 43.5 15.1001 45.4 27.1001C45.9 29.6001 44.5 32.1001 42.2 33.1001C36.5448 35.8504 30.3385 37.2795 24.05 37.2795C17.7615 37.2795 11.5552 35.8504 5.9 33.1001H6Z" fill="#FFDF6F"/>
|
|
<path d="M45.4001 27.0001L44.4001 27.3001L45.4001 27.1001V27.0001ZM3.80015 27.2001C5.80015 15.6001 14.2002 7.20009 24.1002 7.20009V5.1001C12.9002 5.1001 3.70014 14.6001 1.70014 26.8001L3.70014 27.2001H3.80015ZM24.1002 7.20009C34.0002 7.20009 42.5001 15.7001 44.4001 27.2001L46.5001 26.9001C44.5001 14.6001 35.3002 5.1001 24.1002 5.1001V7.20009ZM41.7001 32.2001C36.4001 34.8001 30.5001 36.2001 24.2001 36.2001V38.4001C30.8001 38.4001 37.1001 36.9001 42.7001 34.2001L41.7001 32.2001ZM24.2001 36.2001C17.8001 36.2001 11.8001 34.8001 6.40014 32.2001L5.40014 34.1001C11.1001 36.8001 17.4001 38.4001 24.2001 38.4001V36.2001ZM44.4001 27.2001C44.7001 29.3001 43.6001 31.3001 41.7001 32.2001L42.7001 34.2001C44.0443 33.5658 45.1436 32.5086 45.8299 31.1902C46.5161 29.8719 46.7516 28.365 46.5001 26.9001L44.4001 27.3001V27.2001ZM1.70014 26.8001C1.20014 29.8001 2.70015 32.8001 5.50015 34.1001L6.50015 32.1001C4.50015 31.2001 3.50015 29.2001 3.80015 27.1001L1.70014 26.8001Z" fill="#C5C7C8"/>
|
|
<path d="M45.4001 27.0001L44.4001 27.3001L45.4001 27.1001V27.0001ZM3.80015 27.2001C5.80015 15.6001 14.2002 7.20009 24.1002 7.20009V5.1001C12.9002 5.1001 3.70014 14.6001 1.70014 26.8001L3.70014 27.2001H3.80015ZM24.1002 7.20009C34.0002 7.20009 42.5001 15.7001 44.4001 27.2001L46.5001 26.9001C44.5001 14.6001 35.3002 5.1001 24.1002 5.1001V7.20009ZM41.7001 32.2001C36.4001 34.8001 30.5001 36.2001 24.2001 36.2001V38.4001C30.8001 38.4001 37.1001 36.9001 42.7001 34.2001L41.7001 32.2001ZM24.2001 36.2001C17.8001 36.2001 11.8001 34.8001 6.40014 32.2001L5.40014 34.1001C11.1001 36.8001 17.4001 38.4001 24.2001 38.4001V36.2001ZM44.4001 27.2001C44.7001 29.3001 43.6001 31.3001 41.7001 32.2001L42.7001 34.2001C44.0443 33.5658 45.1436 32.5086 45.8299 31.1902C46.5161 29.8719 46.7516 28.365 46.5001 26.9001L44.4001 27.3001V27.2001ZM1.70014 26.8001C1.20014 29.8001 2.70015 32.8001 5.50015 34.1001L6.50015 32.1001C4.50015 31.2001 3.50015 29.2001 3.80015 27.1001L1.70014 26.8001Z" fill="white" fill-opacity="0.8"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5002 30.1998C8.60018 29.4998 7.50019 27.4998 8.10019 25.5998C10.2002 19.0998 16.6002 14.2998 24.1002 14.2998C31.6002 14.2998 38.0002 19.0998 40.1002 25.5998C40.6002 27.4998 39.5002 29.4998 37.7002 30.1998C33.3917 31.9986 28.7691 32.9248 24.1002 32.9248C19.4313 32.9248 14.8087 31.9986 10.5002 30.1998Z" fill="#C5C7C8"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5002 30.1998C8.60018 29.4998 7.50019 27.4998 8.10019 25.5998C10.2002 19.0998 16.6002 14.2998 24.1002 14.2998C31.6002 14.2998 38.0002 19.0998 40.1002 25.5998C40.6002 27.4998 39.5002 29.4998 37.7002 30.1998C33.3917 31.9986 28.7691 32.9248 24.1002 32.9248C19.4313 32.9248 14.8087 31.9986 10.5002 30.1998Z" fill="#272828"/>
|
|
<path d="M29.4 27.4002C31.5539 27.4002 33.3 26.0123 33.3 24.3002C33.3 22.5881 31.5539 21.2002 29.4 21.2002C27.2461 21.2002 25.5 22.5881 25.5 24.3002C25.5 26.0123 27.2461 27.4002 29.4 27.4002Z" fill="#F8C455"/>
|
|
<path d="M29.4 27.4002C31.5539 27.4002 33.3 26.0123 33.3 24.3002C33.3 22.5881 31.5539 21.2002 29.4 21.2002C27.2461 21.2002 25.5 22.5881 25.5 24.3002C25.5 26.0123 27.2461 27.4002 29.4 27.4002Z" fill="white"/>
|
|
<path d="M18.2999 27.4002C20.4538 27.4002 22.1999 26.0123 22.1999 24.3002C22.1999 22.5881 20.4538 21.2002 18.2999 21.2002C16.146 21.2002 14.3999 22.5881 14.3999 24.3002C14.3999 26.0123 16.146 27.4002 18.2999 27.4002Z" fill="#F8C455"/>
|
|
<path d="M18.2999 27.4002C20.4538 27.4002 22.1999 26.0123 22.1999 24.3002C22.1999 22.5881 20.4538 21.2002 18.2999 21.2002C16.146 21.2002 14.3999 22.5881 14.3999 24.3002C14.3999 26.0123 16.146 27.4002 18.2999 27.4002Z" fill="white"/>
|
|
<path d="M124.842 37.6424C124.095 37.6424 123.395 37.5826 122.741 37.4628C122.096 37.3522 121.561 37.2094 121.137 37.0343L122.464 32.6388C123.155 32.8507 123.777 32.9659 124.33 32.9843C124.892 33.0028 125.376 32.8737 125.782 32.5973C126.196 32.3209 126.533 31.8509 126.791 31.1874L127.136 30.289L119.52 8.44971H125.712L130.108 24.0413H130.329L134.766 8.44971H141L132.748 31.9753C132.352 33.1179 131.813 34.1132 131.131 34.9609C130.458 35.8179 129.606 36.4768 128.574 36.9375C127.542 37.4075 126.298 37.6424 124.842 37.6424Z" fill="white"/>
|
|
<path d="M97.2563 29.6812V1.37305H103.145V12.0162H103.324C103.582 11.4449 103.956 10.8644 104.444 10.2746C104.942 9.67565 105.587 9.17805 106.379 8.78181C107.181 8.37636 108.176 8.17363 109.365 8.17363C110.913 8.17363 112.341 8.57908 113.65 9.38999C114.958 10.1917 116.004 11.4034 116.787 13.0253C117.571 14.6379 117.962 16.6605 117.962 19.0933C117.962 21.4615 117.58 23.4611 116.815 25.0921C116.059 26.714 115.027 27.9442 113.719 28.7827C112.419 29.612 110.963 30.0267 109.351 30.0267C108.208 30.0267 107.236 29.8378 106.434 29.46C105.642 29.0822 104.992 28.6076 104.485 28.0363C103.979 27.4558 103.592 26.8706 103.324 26.2809H103.062V29.6812H97.2563ZM103.02 19.0656C103.02 20.3281 103.195 21.4292 103.546 22.3692C103.896 23.3091 104.402 24.0417 105.066 24.5669C105.729 25.0829 106.536 25.341 107.485 25.341C108.443 25.341 109.254 25.0783 109.918 24.5531C110.581 24.0186 111.083 23.2814 111.424 22.3415C111.774 21.3924 111.949 20.3004 111.949 19.0656C111.949 17.84 111.779 16.7619 111.438 15.8312C111.097 14.9005 110.595 14.1725 109.931 13.6473C109.268 13.122 108.452 12.8594 107.485 12.8594C106.527 12.8594 105.716 13.1128 105.052 13.6196C104.398 14.1264 103.896 14.8452 103.546 15.7759C103.195 16.7066 103.02 17.8032 103.02 19.0656Z" fill="white"/>
|
|
<path d="M92.4283 1.37305V29.6812H86.54V1.37305H92.4283Z" fill="white"/>
|
|
<path d="M62.4136 29.6812H56L65.7724 1.37305H73.4852L83.2438 29.6812H76.8302L69.7394 7.84189H69.5182L62.4136 29.6812ZM62.0127 18.5542H77.162V23.2261H62.0127V18.5542Z" fill="white"/>
|
|
</svg>
|