diff --git a/api/resolvers/wallet.js b/api/resolvers/wallet.js index cbba0eb8..7af04f4e 100644 --- a/api/resolvers/wallet.js +++ b/api/resolvers/wallet.js @@ -13,9 +13,9 @@ import assertApiKeyNotPermitted from './apiKey' import { createInvoice as clnCreateInvoice } from '@/lib/cln' import { bolt11Tags } from '@/lib/bolt11' import { checkInvoice } from 'worker/wallet' -import * as lnd from '@/components/wallet/lnd' -import * as lnAddr from '@/components/wallet/lightning-address' -import * as cln from '@/components/wallet/cln' +import * as lnd from 'wallets/lnd' +import * as lnAddr from 'wallets/lightning-address' +import * as cln from 'wallets/cln' import { fetchLnAddrInvoice } from '@/lib/wallet' export const SERVER_WALLET_DEFS = [lnd, lnAddr, cln] diff --git a/components/nav/common.js b/components/nav/common.js index 30bec234..6f109082 100644 --- a/components/nav/common.js +++ b/components/nav/common.js @@ -22,7 +22,7 @@ import SearchIcon from '../../svgs/search-line.svg' import classNames from 'classnames' import SnIcon from '@/svgs/sn.svg' import { useHasNewNotes } from '../use-has-new-notes' -import { useWallets } from '@/components/wallet' +import { useWallets } from 'wallets' export function Brand ({ className }) { return ( diff --git a/components/payment.js b/components/payment.js index cdc983e7..c253938c 100644 --- a/components/payment.js +++ b/components/payment.js @@ -1,7 +1,7 @@ import { useCallback, useMemo } from 'react' import { useMe } from './me' import { gql, useApolloClient, useMutation } from '@apollo/client' -import { useWallet } from './wallet' +import { useWallet } from '../wallets' import { FAST_POLL_INTERVAL, JIT_INVOICE_TIMEOUT_MS } from '@/lib/constants' import { INVOICE } from '@/fragments/wallet' import Invoice from '@/components/invoice' diff --git a/components/qr.js b/components/qr.js index bc8cfd5b..6909f7fc 100644 --- a/components/qr.js +++ b/components/qr.js @@ -2,7 +2,7 @@ import QRCode from 'qrcode.react' import { CopyInput, InputSkeleton } from './form' import InvoiceStatus from './invoice-status' import { useEffect } from 'react' -import { useWallet } from './wallet' +import { useWallet } from '../wallets' import Bolt11Info from './bolt11-info' export default function Qr ({ asIs, value, useWallet: automated, statusVariant, description, status }) { diff --git a/components/wallet-card.js b/components/wallet-card.js index 66b494c7..3872a4e0 100644 --- a/components/wallet-card.js +++ b/components/wallet-card.js @@ -3,7 +3,7 @@ import styles from '@/styles/wallet.module.css' import Plug from '@/svgs/plug.svg' import Gear from '@/svgs/settings-5-fill.svg' import Link from 'next/link' -import { Status } from './wallet' +import { Status } from '../wallets' export default function WalletCard ({ wallet }) { const { card: { title, badges } } = wallet diff --git a/components/wallet-logger.js b/components/wallet-logger.js index 61f118eb..110e4bc8 100644 --- a/components/wallet-logger.js +++ b/components/wallet-logger.js @@ -5,7 +5,7 @@ import { Button } from 'react-bootstrap' import { useToast } from './toast' import { useShowModal } from './modal' import { WALLET_LOGS } from '@/fragments/wallet' -import { getServerWallet } from './wallet' +import { getServerWallet } from '../wallets' import { gql, useMutation, useQuery } from '@apollo/client' import { useMe } from './me' diff --git a/pages/settings/wallets/[wallet].js b/pages/settings/wallets/[wallet].js index 5cb2e1f0..4fbbfb38 100644 --- a/pages/settings/wallets/[wallet].js +++ b/pages/settings/wallets/[wallet].js @@ -5,7 +5,7 @@ import { WalletSecurityBanner } from '@/components/banners' import { WalletLogs } from '@/components/wallet-logger' import { useToast } from '@/components/toast' import { useRouter } from 'next/router' -import { useWallet, Status } from '@/components/wallet' +import { useWallet, Status } from 'wallets' import Info from '@/components/info' import Text from '@/components/text' import { AutowithdrawSettings } from '@/components/autowithdraw-shared' diff --git a/pages/settings/wallets/index.js b/pages/settings/wallets/index.js index 6465c51a..3bb77c3e 100644 --- a/pages/settings/wallets/index.js +++ b/pages/settings/wallets/index.js @@ -2,7 +2,7 @@ import { getGetServerSideProps } from '@/api/ssrApollo' import Layout from '@/components/layout' import styles from '@/styles/wallet.module.css' import Link from 'next/link' -import { useWallets, walletPrioritySort } from '@/components/wallet' +import { useWallets, walletPrioritySort } from 'wallets' import { useEffect, useState } from 'react' import dynamic from 'next/dynamic' diff --git a/components/wallet/_example.js b/wallets/_example.js similarity index 100% rename from components/wallet/_example.js rename to wallets/_example.js diff --git a/components/wallet/cln.js b/wallets/cln.js similarity index 100% rename from components/wallet/cln.js rename to wallets/cln.js diff --git a/components/wallet/index.js b/wallets/index.js similarity index 96% rename from components/wallet/index.js rename to wallets/index.js index 3e747c78..ca9e4762 100644 --- a/components/wallet/index.js +++ b/wallets/index.js @@ -5,17 +5,17 @@ import { useWalletLogger } from '@/components/wallet-logger' import { SSR } from '@/lib/constants' import { bolt11Tags } from '@/lib/bolt11' -import * as lnbits from '@/components/wallet/lnbits' -import * as nwc from '@/components/wallet/nwc' -import * as lnc from '@/components/wallet/lnc' -import * as lnd from '@/components/wallet/lnd' -import * as lnAddr from '@/components/wallet/lightning-address' -import * as cln from '@/components/wallet/cln' +import * as lnbits from 'wallets/lnbits' +import * as nwc from 'wallets/nwc' +import * as lnc from 'wallets/lnc' +import * as lnd from 'wallets/lnd' +import * as lnAddr from 'wallets/lightning-address' +import * as cln from 'wallets/cln' import { gql, useApolloClient, useQuery } from '@apollo/client' import { REMOVE_WALLET, WALLET_BY_TYPE } from '@/fragments/wallet' import { autowithdrawInitial } from '@/components/autowithdraw-shared' import { useShowModal } from '@/components/modal' -import { useToast } from '../toast' +import { useToast } from '../components/toast' // wallet definitions export const WALLET_DEFS = [lnbits, nwc, lnc, lnd, lnAddr, cln] diff --git a/components/wallet/lightning-address.js b/wallets/lightning-address.js similarity index 100% rename from components/wallet/lightning-address.js rename to wallets/lightning-address.js diff --git a/components/wallet/lnbits.js b/wallets/lnbits.js similarity index 100% rename from components/wallet/lnbits.js rename to wallets/lnbits.js diff --git a/components/wallet/lnc.js b/wallets/lnc.js similarity index 99% rename from components/wallet/lnc.js rename to wallets/lnc.js index 51191c26..3a696610 100644 --- a/components/wallet/lnc.js +++ b/wallets/lnc.js @@ -4,7 +4,7 @@ import { Form, PasswordInput, SubmitButton } from '@/components/form' import CancelButton from '@/components/cancel-button' import { InvoiceCanceledError, InvoiceExpiredError } from '@/components/payment' import { bolt11Tags } from '@/lib/bolt11' -import { Status } from '@/components/wallet' +import { Status } from 'wallets' import { lncSchema } from '@/lib/validate' export const name = 'lnc' diff --git a/components/wallet/lnd.js b/wallets/lnd.js similarity index 100% rename from components/wallet/lnd.js rename to wallets/lnd.js diff --git a/components/wallet/nwc.js b/wallets/nwc.js similarity index 100% rename from components/wallet/nwc.js rename to wallets/nwc.js