From 8e2e499a1645194a381f1359e2d85e1ec009940c Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 5 Oct 2023 22:18:15 +0200 Subject: [PATCH] build: try to use @/ paths --- core/api/src/app/accounts/account-limit.ts | 10 +- core/api/src/app/accounts/active-accounts.ts | 16 +-- core/api/src/app/accounts/add-new-contact.ts | 2 +- core/api/src/app/accounts/add-wallet.ts | 2 +- core/api/src/app/accounts/create-account.ts | 8 +- .../app/accounts/delete-business-map-info.ts | 4 +- .../accounts/disable-notification-category.ts | 4 +- .../accounts/disable-notification-channel.ts | 4 +- .../accounts/enable-notification-category.ts | 4 +- .../accounts/enable-notification-channel.ts | 4 +- .../get-account-transactions-for-contact.ts | 10 +- .../app/accounts/get-contact-by-username.ts | 2 +- .../src/app/accounts/get-csv-for-account.ts | 4 +- .../accounts/get-transactions-for-account.ts | 9 +- core/api/src/app/accounts/index.ts | 2 +- .../app/accounts/mark-account-for-deletion.ts | 12 +- .../send-default-wallet-balance-to-users.ts | 22 ++-- core/api/src/app/accounts/set-username.ts | 8 +- .../api/src/app/accounts/update-account-ip.ts | 16 +-- .../src/app/accounts/update-account-level.ts | 2 +- .../src/app/accounts/update-account-status.ts | 4 +- .../accounts/update-account-withdraw-fee.ts | 4 +- .../app/accounts/update-business-map-info.ts | 4 +- .../src/app/accounts/update-contact-alias.ts | 6 +- .../app/accounts/update-default-walletid.ts | 4 +- .../app/accounts/update-display-currency.ts | 8 +- .../app/accounts/upgrade-device-account.ts | 4 +- .../src/app/accounts/username-available.ts | 6 +- core/api/src/app/admin/backup.ts | 12 +- core/api/src/app/admin/index.ts | 6 +- .../app/admin/send-admin-push-notification.ts | 10 +- core/api/src/app/admin/update-user-phone.ts | 12 +- ...reate-account-from-registration-payload.ts | 16 +-- core/api/src/app/authentication/email.ts | 8 +- .../src/app/authentication/extend-sessions.ts | 2 +- .../authentication/get-supported-countries.ts | 7 +- core/api/src/app/authentication/login.ts | 48 ++++---- core/api/src/app/authentication/logout.ts | 7 +- core/api/src/app/authentication/phone.ts | 16 +-- core/api/src/app/authentication/ratelimits.ts | 8 +- .../src/app/authentication/request-code.ts | 22 ++-- core/api/src/app/authentication/totp.ts | 6 +- core/api/src/app/bootstrap/index.ts | 16 +-- core/api/src/app/callback/index.ts | 9 +- core/api/src/app/captcha/index.ts | 4 +- core/api/src/app/comm/submit-feedback.ts | 9 +- core/api/src/app/errors.ts | 52 ++++----- core/api/src/app/index.ts | 4 +- .../src/app/lightning/delete-ln-payments.ts | 10 +- core/api/src/app/lightning/get-balances.ts | 14 +-- .../src/app/lightning/get-held-invoices.ts | 8 +- .../api/src/app/lightning/get-pending-htlc.ts | 6 +- .../src/app/lightning/list-nodes-pubkeys.ts | 2 +- .../app/lightning/lookup-invoice-by-hash.ts | 6 +- .../app/lightning/lookup-payment-by-hash.ts | 2 +- .../app/lightning/payment-status-checker.ts | 6 +- .../src/app/lightning/update-ln-payments.ts | 10 +- core/api/src/app/on-chain/index.ts | 2 +- .../app/on-chain/rebalance-to-cold-wallet.ts | 20 ++-- .../on-chain/record-hot-to-cold-transfer.ts | 8 +- core/api/src/app/payments/add-earn.ts | 22 ++-- core/api/src/app/payments/get-protocol-fee.ts | 26 ++--- core/api/src/app/payments/helpers.ts | 18 +-- .../src/app/payments/reimburse-failed-usd.ts | 12 +- core/api/src/app/payments/reimburse-fee.ts | 12 +- core/api/src/app/payments/send-intraledger.ts | 50 ++++----- core/api/src/app/payments/send-lightning.ts | 64 +++++------ core/api/src/app/payments/send-on-chain.ts | 56 +++++----- core/api/src/app/payments/translations.ts | 8 +- .../app/payments/update-pending-payments.ts | 39 +++---- core/api/src/app/prices/get-current-price.ts | 16 +-- core/api/src/app/prices/get-price-history.ts | 10 +- core/api/src/app/prices/list-currencies.ts | 8 +- core/api/src/app/prices/mid-price.ts | 14 +-- core/api/src/app/swap/get-active-loopd.ts | 6 +- core/api/src/app/swap/swap-listener.ts | 10 +- core/api/src/app/swap/swap-out.ts | 20 ++-- .../get-transactions-metadata-by-ids.ts | 2 +- core/api/src/app/users/add-device-token.ts | 4 +- core/api/src/app/users/index.ts | 2 +- .../api/src/app/users/remove-device-tokens.ts | 2 +- core/api/src/app/users/update-language.ts | 4 +- .../src/app/wallets/add-invoice-for-wallet.ts | 32 +++--- .../add-pending-on-chain-transaction.ts | 28 ++--- .../add-settled-on-chain-transaction.ts | 39 +++---- .../app/wallets/create-on-chain-address.ts | 14 +-- .../src/app/wallets/get-balance-for-wallet.ts | 2 +- .../app/wallets/get-last-on-chain-address.ts | 10 +- core/api/src/app/wallets/get-on-chain-fee.ts | 30 ++--- .../get-pending-onchain-balance-for-wallet.ts | 8 +- .../src/app/wallets/get-transaction-by-id.ts | 8 +- .../wallets/get-transactions-by-addresses.ts | 14 +-- .../app/wallets/get-transactions-by-hash.ts | 6 +- .../wallets/get-transactions-for-wallet.ts | 14 +-- core/api/src/app/wallets/index.ts | 2 +- .../register-broadcasted-payout-txn.ts | 2 +- .../remove-pending-on-chain-transaction.ts | 4 +- core/api/src/app/wallets/settle-payout-txn.ts | 16 +-- .../wallets/update-legacy-on-chain-receipt.ts | 32 +++--- .../app/wallets/update-pending-invoices.ts | 48 ++++---- core/api/src/app/wallets/validate.ts | 6 +- core/api/src/config/index.ts | 8 +- core/api/src/config/schema.ts | 4 +- core/api/src/config/yaml.ts | 23 ++-- .../clean-pending-payments-for-dead-node.ts | 18 +-- core/api/src/debug/create-usd-wallets.ts | 14 +-- core/api/src/debug/get-wallet-balance.ts | 8 +- .../debug/migrate-ln-payments-listpayments.ts | 21 ++-- .../migrate-ln-payments-trackpaymentsv2.ts | 20 ++-- core/api/src/debug/reimburse.ts | 16 +-- core/api/src/debug/text-sms.ts | 2 +- core/api/src/debug/update-on-chain-receipt.ts | 10 +- .../debug/update-withdraw-fee-all-accounts.ts | 7 +- core/api/src/debug/update-withdraw-fee.ts | 9 +- core/api/src/debug/void-payment.ts | 14 +-- .../accounts-ips/ip-metadata-authorizer.ts | 2 +- .../src/domain/accounts/account-validator.ts | 4 +- core/api/src/domain/accounts/errors.ts | 2 +- core/api/src/domain/accounts/index.ts | 12 +- .../api/src/domain/accounts/limits-checker.ts | 2 +- core/api/src/domain/accounts/limits-volume.ts | 8 +- core/api/src/domain/authentication/errors.ts | 2 +- core/api/src/domain/authentication/index.ts | 4 +- .../registration-payload-validator.ts | 6 +- core/api/src/domain/bitcoin/index.ts | 7 +- .../src/domain/bitcoin/lightning/errors.ts | 2 +- .../api/src/domain/bitcoin/lightning/index.ts | 2 +- .../bitcoin/lightning/invoice-expiration.ts | 2 +- .../domain/bitcoin/lightning/ln-invoice.ts | 5 +- core/api/src/domain/bitcoin/onchain/errors.ts | 2 +- .../bitcoin/onchain/incoming-tx-handler.ts | 4 +- core/api/src/domain/bitcoin/onchain/index.ts | 2 +- .../bitcoin/onchain/rebalance-checker.ts | 2 +- .../src/domain/bitcoin/onchain/tx-decoder.ts | 3 +- core/api/src/domain/cache/errors.ts | 2 +- core/api/src/domain/callback/errors.ts | 2 +- core/api/src/domain/captcha/errors.ts | 2 +- core/api/src/domain/comm/errors.ts | 2 +- core/api/src/domain/dealer-price/errors.ts | 2 +- core/api/src/domain/fiat/display-currency.ts | 2 +- core/api/src/domain/fiat/index.ts | 2 +- core/api/src/domain/ipfetcher/errors.ts | 2 +- .../api/src/domain/ledger/activity-checker.ts | 2 +- core/api/src/domain/ledger/errors.ts | 2 +- .../src/domain/ledger/fee-reimbursement.ts | 4 +- .../src/domain/ledger/imbalance-calculator.ts | 12 +- core/api/src/domain/ledger/index.ts | 6 +- core/api/src/domain/locale/index.ts | 2 +- core/api/src/domain/lock/errors.ts | 2 +- core/api/src/domain/notifications/errors.ts | 2 +- core/api/src/domain/oathkeeper/errors.ts | 2 +- core/api/src/domain/payments/errors.ts | 2 +- core/api/src/domain/payments/ln-fees.ts | 6 +- .../payments/onchain-payment-flow-builder.ts | 28 ++--- .../domain/payments/payment-flow-builder.ts | 37 +++--- core/api/src/domain/payments/payment-flow.ts | 8 +- core/api/src/domain/payments/price-ratio.ts | 8 +- .../src/domain/payments/route-validator.ts | 2 +- core/api/src/domain/phone-provider/errors.ts | 2 +- .../domain/phone-provider/index.types.d.ts | 2 +- core/api/src/domain/price/errors.ts | 2 +- core/api/src/domain/primitives/index.ts | 2 +- core/api/src/domain/pubsub/errors.ts | 2 +- core/api/src/domain/rate-limit/errors.ts | 2 +- core/api/src/domain/rate-limit/index.ts | 20 ++-- core/api/src/domain/swap/errors.ts | 2 +- core/api/src/domain/swap/swap-out-checker.ts | 2 +- core/api/src/domain/users/errors.ts | 4 +- core/api/src/domain/users/index.ts | 6 +- .../domain/users/phone-metadata-validator.ts | 4 +- core/api/src/domain/wallet-invoices/errors.ts | 2 +- .../wallet-invoices/wallet-invoice-builder.ts | 14 +-- .../wallet-invoices/wallet-invoice-checker.ts | 6 +- .../wallet-invoice-receiver.ts | 7 +- .../wallet-address-receiver.ts | 6 +- .../domain/wallets/deposit-fee-calculator.ts | 2 +- .../domain/wallets/payment-input-validator.ts | 10 +- .../src/domain/wallets/settlement-amounts.ts | 8 +- core/api/src/domain/wallets/tx-history.ts | 12 +- core/api/src/domain/wallets/validation.ts | 2 +- .../wallets/withdrawal-fee-calculator.ts | 2 +- core/api/src/graphql/admin/mutations.ts | 22 ++-- core/api/src/graphql/admin/queries.ts | 4 +- .../root/mutation/account-update-level.ts | 10 +- .../root/mutation/account-update-status.ts | 10 +- .../mutation/admin-push-notification-send.ts | 10 +- .../root/mutation/business-update-map-info.ts | 10 +- .../root/mutation/delete-business-map.ts | 10 +- .../admin/root/mutation/user-update-phone.ts | 10 +- .../query/account-details-by-account-id.ts | 8 +- .../root/query/account-details-by-email.ts | 10 +- .../root/query/account-details-by-phone.ts | 10 +- .../root/query/account-details-by-username.ts | 10 +- .../graphql/admin/root/query/all-levels.ts | 6 +- .../graphql/admin/root/query/all-walletids.ts | 8 +- .../admin/root/query/lightning-invoice.ts | 10 +- .../admin/root/query/lightning-payment.ts | 12 +- .../admin/root/query/transaction-by-id.ts | 8 +- .../admin/root/query/transactions-by-hash.ts | 10 +- .../src/graphql/admin/root/query/wallet.ts | 8 +- core/api/src/graphql/admin/types/index.ts | 6 +- .../src/graphql/admin/types/object/account.ts | 19 ++-- .../admin/types/object/lightning-invoice.ts | 10 +- .../admin/types/object/lightning-payment.ts | 14 +-- .../src/graphql/admin/types/object/user.ts | 14 +-- .../admin/types/payload/account-detail.ts | 6 +- .../payload/admin-push-notification-send.ts | 4 +- .../admin/types/payload/wallet-details.ts | 6 +- .../admin/types/scalar/account-status.ts | 4 +- core/api/src/graphql/connections.ts | 6 +- core/api/src/graphql/error-map.ts | 4 +- core/api/src/graphql/error.ts | 4 +- core/api/src/graphql/public/index.ts | 4 +- core/api/src/graphql/public/mutations.ts | 105 +++++++++--------- core/api/src/graphql/public/queries.ts | 34 +++--- .../public/root/mutation/account-delete.ts | 8 +- ...sable-notification-category-for-channel.ts | 12 +- .../account-disable-notification-channel.ts | 10 +- ...nable-notification-category-for-channel.ts | 12 +- .../account-enable-notification-channel.ts | 10 +- .../account-update-default-wallet-id.ts | 10 +- .../account-update-display-currency.ts | 10 +- .../root/mutation/callback-endpoint-add.ts | 10 +- .../root/mutation/callback-endpoint-delete.ts | 10 +- .../device-notification-token-create.ts | 8 +- .../public/root/mutation/feedback-submit.ts | 10 +- .../root/mutation/intraledger-payment-send.ts | 17 +-- .../mutation/intraledger-usd-payment-send.ts | 17 +-- ...n-invoice-create-on-behalf-of-recipient.ts | 18 +-- .../public/root/mutation/ln-invoice-create.ts | 16 +-- .../root/mutation/ln-invoice-fee-probe.ts | 16 +-- .../root/mutation/ln-invoice-payment-send.ts | 17 +-- ...t-invoice-create-on-behalf-of-recipient.ts | 14 +-- .../mutation/ln-noamount-invoice-create.ts | 14 +-- .../mutation/ln-noamount-invoice-fee-probe.ts | 18 +-- .../ln-noamount-invoice-payment-send.ts | 19 ++-- .../ln-noamount-usd-invoice-fee-probe.ts | 18 +-- .../ln-noamount-usd-invoice-payment-send.ts | 19 ++-- ...nominated-create-on-behalf-of-recipient.ts | 18 +-- ...d-invoice-create-on-behalf-of-recipient.ts | 18 +-- .../root/mutation/ln-usd-invoice-create.ts | 16 +-- .../root/mutation/ln-usd-invoice-fee-probe.ts | 18 +-- .../root/mutation/on-chain-address-create.ts | 10 +- .../root/mutation/on-chain-address-current.ts | 10 +- .../root/mutation/onchain-payment-send-all.ts | 18 +-- .../root/mutation/onchain-payment-send.ts | 20 ++-- .../onchain-usd-payment-send-as-sats.ts | 20 ++-- .../root/mutation/onchain-usd-payment-send.ts | 20 ++-- .../public/root/mutation/quiz-completed.ts | 8 +- .../mutation/user-contact-update-alias.ts | 14 +-- .../public/root/mutation/user-email-delete.ts | 8 +- .../user-email-registration-initiate.ts | 10 +- .../user-email-registration-validate.ts | 12 +- .../root/mutation/user-login-upgrade.ts | 12 +- .../public/root/mutation/user-logout.ts | 8 +- .../public/root/mutation/user-phone-delete.ts | 8 +- .../user-phone-registration-initiate.ts | 14 +-- .../user-phone-registration-validate.ts | 12 +- .../user-quiz-question-update-completed.ts | 8 +- .../public/root/mutation/user-totp-delete.ts | 10 +- .../user-totp-registration-initiate.ts | 10 +- .../user-totp-registration-validate.ts | 14 +-- .../root/mutation/user-update-language.ts | 10 +- .../root/mutation/user-update-username.ts | 12 +- .../root/query/account-default-wallet-id.ts | 10 +- .../root/query/account-default-wallet.ts | 16 +-- .../public/root/query/btc-price-list.ts | 18 +-- .../graphql/public/root/query/btc-price.ts | 12 +- .../public/root/query/business-map-markers.ts | 8 +- .../public/root/query/currency-list.ts | 8 +- .../src/graphql/public/root/query/globals.ts | 10 +- .../root/query/ln-invoice-payment-status.ts | 10 +- core/api/src/graphql/public/root/query/me.ts | 4 +- .../public/root/query/mobile-versions.ts | 6 +- .../root/query/on-chain-tx-fee-query.ts | 20 ++-- .../on-chain-usd-tx-fee-query-as-sats.ts | 20 ++-- .../root/query/on-chain-usd-tx-fee-query.ts | 20 ++-- .../public/root/query/quiz-questions.ts | 6 +- .../public/root/query/realtime-price.ts | 12 +- .../public/root/query/username-available.ts | 8 +- .../subscription/ln-invoice-payment-status.ts | 18 +-- .../public/root/subscription/my-updates.ts | 38 +++---- .../graphql/public/root/subscription/price.ts | 20 ++-- .../root/subscription/realtime-price.ts | 20 ++-- core/api/src/graphql/public/subscriptions.ts | 12 +- .../public/types/abstract/account-limit.ts | 6 +- .../graphql/public/types/abstract/account.ts | 20 ++-- .../public/types/abstract/public-wallet.ts | 4 +- .../public/types/object/account-contact.ts | 20 ++-- .../public/types/object/account-limits.ts | 6 +- .../public/types/object/build-information.ts | 2 +- .../public/types/object/business-account.ts | 36 +++--- .../public/types/object/callback-endpoint.ts | 4 +- .../public/types/object/consumer-account.ts | 47 ++++---- .../graphql/public/types/object/country.ts | 4 +- .../graphql/public/types/object/currency.ts | 2 +- .../public/types/object/fees-information.ts | 2 +- .../public/types/object/global-settings.ts | 4 +- .../graphql/public/types/object/globals.ts | 3 +- .../src/graphql/public/types/object/limits.ts | 2 +- .../object/ln-invoice-payment-status-input.ts | 4 +- .../graphql/public/types/object/ln-invoice.ts | 4 +- .../types/object/ln-noamount-invoice.ts | 4 +- .../graphql/public/types/object/map-info.ts | 4 +- .../graphql/public/types/object/map-marker.ts | 4 +- .../public/types/object/mobile-versions.ts | 2 +- .../object/notification-channel-settings.ts | 4 +- .../types/object/notification-settings.ts | 4 +- .../public/types/object/onchain-tx-fee.ts | 4 +- .../public/types/object/onchain-usd-tx-fee.ts | 4 +- .../types/object/one-day-account-limit.ts | 22 ++-- .../object/price-of-one-sat-in-minor-unit.ts | 4 +- .../price-of-one-usd-cent-in-minor-unit.ts | 4 +- .../public/types/object/price-point.ts | 4 +- .../src/graphql/public/types/object/price.ts | 4 +- .../public/types/object/quiz-question.ts | 4 +- .../src/graphql/public/types/object/quiz.ts | 4 +- .../public/types/object/realtime-price.ts | 4 +- .../public/types/object/user-quiz-question.ts | 4 +- .../src/graphql/public/types/object/user.ts | 17 ++- .../public/types/payload/account-delete.ts | 4 +- .../account-update-default-wallet-id.ts | 4 +- .../account-update-display-currency.ts | 4 +- .../account-update-notification-settings.ts | 4 +- .../types/payload/callback-endpoint-add.ts | 4 +- .../public/types/payload/cent-amount.ts | 6 +- .../payload/ln-invoice-payment-status.ts | 4 +- .../public/types/payload/ln-invoice.ts | 4 +- .../types/payload/ln-noamount-invoice.ts | 4 +- .../public/types/payload/on-chain-address.ts | 4 +- .../public/types/payload/payment-send.ts | 4 +- .../src/graphql/public/types/payload/price.ts | 4 +- .../public/types/payload/quiz-completed.ts | 4 +- .../public/types/payload/realtime-price.ts | 4 +- .../public/types/payload/sat-amount.ts | 6 +- .../public/types/payload/upgrade-payload.ts | 6 +- .../payload/user-contact-update-alias.ts | 4 +- .../public/types/payload/user-email-delete.ts | 4 +- .../user-email-registration-initiate.ts | 4 +- .../user-email-registration-validate.ts | 4 +- .../public/types/payload/user-phone-delete.ts | 4 +- .../user-phone-registration-validate.ts | 4 +- .../user-quiz-question-update-completed.ts | 4 +- .../public/types/payload/user-totp-delete.ts | 4 +- .../user-totp-registration-initiate.ts | 4 +- .../user-totp-registration-validate.ts | 4 +- .../types/payload/user-update-language.ts | 4 +- .../types/payload/user-update-username.ts | 4 +- .../public/types/scalar/cent-amount.ts | 6 +- .../public/types/scalar/contact-alias.ts | 4 +- .../public/types/scalar/country-code.ts | 4 +- .../public/types/scalar/email-verify-id.ts | 4 +- .../public/types/scalar/endpoint-id.ts | 2 +- .../public/types/scalar/endpoint-url.ts | 2 +- .../types/scalar/exchange-currency-unit.ts | 2 +- .../types/scalar/fee-reimbursement-hash.ts | 6 +- .../graphql/public/types/scalar/feedback.ts | 6 +- .../graphql/public/types/scalar/hex32bytes.ts | 4 +- .../types/scalar/invoice-payment-status.ts | 2 +- .../ln-noamount-invoice-payment-request.ts | 4 +- .../graphql/public/types/scalar/minutes.ts | 4 +- .../graphql/public/types/scalar/network.ts | 2 +- .../types/scalar/payment-send-result.ts | 2 +- .../public/types/scalar/payout-speed.ts | 4 +- .../public/types/scalar/price-graph-range.ts | 2 +- .../graphql/public/types/scalar/seconds.ts | 4 +- .../graphql/public/types/scalar/totp-code.ts | 4 +- .../public/types/scalar/totp-secret.ts | 2 +- .../public/types/scalar/totp-verify-id.ts | 4 +- .../types/scalar/tx-notification-type.ts | 2 +- .../root/mutation/captcha-create-challenge.ts | 8 +- .../mutation/captcha-request-auth-code.ts | 16 +-- .../src/graphql/shared/root/mutation/index.ts | 2 +- .../shared/root/mutation/user-login.ts | 12 +- .../graphql/shared/types/abstract/error.ts | 2 +- .../shared/types/abstract/initiation-via.ts | 8 +- .../graphql/shared/types/abstract/price.ts | 4 +- .../shared/types/abstract/settlement-via.ts | 15 +-- .../graphql/shared/types/abstract/wallet.ts | 6 +- .../graphql/shared/types/object/btc-wallet.ts | 28 ++--- .../shared/types/object/coordinates.ts | 2 +- .../src/graphql/shared/types/object/email.ts | 4 +- .../types/object/graphql-application-error.ts | 4 +- ...lement-minor-unit-in-display-minor-unit.ts | 4 +- .../shared/types/object/transaction.ts | 17 ++- .../graphql/shared/types/object/usd-wallet.ts | 28 ++--- .../shared/types/payload/auth-token.ts | 6 +- .../types/payload/captcha-create-challenge.ts | 4 +- .../shared/types/payload/success-payload.ts | 4 +- .../shared/types/scalar/account-level.ts | 2 +- .../graphql/shared/types/scalar/auth-token.ts | 4 +- .../shared/types/scalar/display-currency.ts | 4 +- .../shared/types/scalar/email-address.ts | 6 +- .../graphql/shared/types/scalar/language.ts | 6 +- .../types/scalar/ln-payment-preimage.ts | 6 +- .../shared/types/scalar/ln-payment-request.ts | 4 +- .../shared/types/scalar/ln-payment-secret.ts | 6 +- .../shared/types/scalar/ln-payment-status.ts | 2 +- .../graphql/shared/types/scalar/ln-pubkey.ts | 6 +- .../src/graphql/shared/types/scalar/memo.ts | 6 +- .../types/scalar/notification-category.ts | 4 +- .../types/scalar/notification-channel.ts | 4 +- .../shared/types/scalar/on-chain-address.ts | 8 +- .../shared/types/scalar/onchain-tx-hash.ts | 6 +- .../shared/types/scalar/one-time-auth-code.ts | 6 +- .../shared/types/scalar/payment-hash.ts | 6 +- .../types/scalar/phone-code-channel-type.ts | 2 +- .../src/graphql/shared/types/scalar/phone.ts | 6 +- .../graphql/shared/types/scalar/safe-int.ts | 6 +- .../graphql/shared/types/scalar/sat-amount.ts | 8 +- .../shared/types/scalar/signed-amount.ts | 4 +- .../types/scalar/signed-display-amount.ts | 4 +- .../graphql/shared/types/scalar/timestamp.ts | 4 +- .../shared/types/scalar/tx-direction.ts | 2 +- .../graphql/shared/types/scalar/tx-status.ts | 4 +- .../graphql/shared/types/scalar/username.ts | 6 +- .../shared/types/scalar/wallet-currency.ts | 2 +- .../graphql/shared/types/scalar/wallet-id.ts | 6 +- core/api/src/servers/authorization/index.ts | 36 +++--- core/api/src/servers/cron.ts | 22 ++-- .../src/servers/daily-balance-notification.ts | 6 +- core/api/src/servers/errors.ts | 2 +- core/api/src/servers/event-handlers/bria.ts | 18 +-- core/api/src/servers/event-handlers/kratos.ts | 10 +- core/api/src/servers/exporter.ts | 32 +++--- core/api/src/servers/graphql-admin-server.ts | 32 +++--- core/api/src/servers/graphql-main-server.ts | 39 ++++--- core/api/src/servers/graphql-server.ts | 11 +- core/api/src/servers/middlewares/healthz.ts | 7 +- .../src/servers/middlewares/idempotency.ts | 10 +- core/api/src/servers/middlewares/session.ts | 15 +-- core/api/src/servers/middlewares/wallet-id.ts | 10 +- core/api/src/servers/trigger.ts | 64 +++++------ core/api/src/servers/write-sdl.ts | 18 +-- core/api/src/servers/ws-server.ts | 32 +++--- core/api/src/services/bria/errors.ts | 2 +- core/api/src/services/bria/event-handler.ts | 18 +-- .../api/src/services/bria/event-repository.ts | 4 +- core/api/src/services/bria/grpc-client.ts | 4 +- core/api/src/services/bria/index.ts | 45 ++++---- core/api/src/services/cache/local-cache.ts | 7 +- core/api/src/services/cache/redis-cache.ts | 6 +- .../src/services/dealer-price/dealer-price.ts | 43 +++---- core/api/src/services/geetest.ts | 3 +- core/api/src/services/geetest.types.d.ts | 4 +- core/api/src/services/ipfetcher/index.ts | 7 +- .../services/kratos/auth-email-no-password.ts | 23 ++-- .../services/kratos/auth-phone-no-password.ts | 20 ++-- .../kratos/auth-username-password-deviceid.ts | 4 +- core/api/src/services/kratos/cookie.ts | 4 +- core/api/src/services/kratos/cron.ts | 4 +- core/api/src/services/kratos/errors.ts | 4 +- core/api/src/services/kratos/identity.ts | 4 +- core/api/src/services/kratos/index.ts | 4 +- core/api/src/services/kratos/private.ts | 10 +- .../src/services/kratos/tests-but-not-prod.ts | 4 +- core/api/src/services/kratos/totp.ts | 6 +- core/api/src/services/ledger/admin-legacy.ts | 16 +-- core/api/src/services/ledger/admin.ts | 23 ++-- .../src/services/ledger/csv-wallet-export.ts | 5 +- .../src/services/ledger/domain/accounts.ts | 2 +- .../services/ledger/domain/entry-builder.ts | 4 +- core/api/src/services/ledger/domain/errors.ts | 2 +- .../src/services/ledger/facade/intraledger.ts | 4 +- .../ledger/facade/offchain-receive.ts | 4 +- .../services/ledger/facade/offchain-send.ts | 6 +- .../services/ledger/facade/onchain-receive.ts | 4 +- .../services/ledger/facade/onchain-send.ts | 26 ++--- .../ledger/facade/static-account-ids.ts | 4 +- .../src/services/ledger/facade/tx-metadata.ts | 6 +- core/api/src/services/ledger/facade/volume.ts | 12 +- core/api/src/services/ledger/facade/wallet.ts | 4 +- core/api/src/services/ledger/index.ts | 38 ++++--- .../src/services/ledger/paginated-ledger.ts | 6 +- core/api/src/services/ledger/schema.ts | 4 +- core/api/src/services/ledger/send.ts | 8 +- .../ledger/services/transactions-metadata.ts | 16 +-- core/api/src/services/lnd/auth.ts | 3 +- core/api/src/services/lnd/config.ts | 8 +- core/api/src/services/lnd/health.ts | 3 +- core/api/src/services/lnd/index.ts | 43 +++---- core/api/src/services/lnd/rebalancing.ts | 8 +- core/api/src/services/lnd/schema.ts | 3 +- core/api/src/services/lnd/utils.ts | 36 +++--- core/api/src/services/lock/index.ts | 10 +- core/api/src/services/loopd/loop-service.ts | 29 ++--- core/api/src/services/mongodb/index.ts | 17 +-- .../api/src/services/mongoose/accounts-ips.ts | 10 +- core/api/src/services/mongoose/accounts.ts | 14 +-- core/api/src/services/mongoose/ln-payments.ts | 8 +- .../api/src/services/mongoose/payment-flow.ts | 17 +-- core/api/src/services/mongoose/rewards.ts | 4 +- core/api/src/services/mongoose/schema.ts | 15 +-- core/api/src/services/mongoose/users.ts | 4 +- core/api/src/services/mongoose/utils.ts | 8 +- .../src/services/mongoose/wallet-invoices.ts | 11 +- .../mongoose/wallet-on-chain-addresses.ts | 8 +- .../wallet-onchain-pending-receive.ts | 13 ++- core/api/src/services/mongoose/wallets.ts | 16 +-- .../create-push-notification-content.ts | 8 +- core/api/src/services/notifications/index.ts | 27 ++--- .../notifications/push-notifications.ts | 13 ++- core/api/src/services/oathkeeper/index.ts | 7 +- core/api/src/services/price/index.ts | 19 ++-- core/api/src/services/pubsub.ts | 6 +- core/api/src/services/rate-limit/index.ts | 7 +- core/api/src/services/redis/connection.ts | 6 +- core/api/src/services/redis/routes.ts | 6 +- core/api/src/services/svix/errors.ts | 2 +- core/api/src/services/svix/index.ts | 8 +- core/api/src/services/tracing.ts | 4 +- core/api/src/services/twilio.ts | 20 ++-- core/api/src/utils/index.ts | 4 +- core/api/test/e2e/jest.setup.js | 10 +- core/api/test/e2e/servers/kratos.spec.ts | 13 ++- core/api/test/helpers/bitcoin-core.ts | 21 ++-- core/api/test/helpers/bria.ts | 6 +- core/api/test/helpers/check-is-balanced.ts | 15 +-- core/api/test/helpers/index.ts | 13 ++- core/api/test/helpers/kratos.ts | 3 +- core/api/test/helpers/ledger.ts | 24 ++-- core/api/test/helpers/lightning.ts | 22 ++-- core/api/test/helpers/rate-limit.ts | 4 +- core/api/test/helpers/redis.ts | 4 +- core/api/test/helpers/shared.ts | 2 +- core/api/test/helpers/user.ts | 34 +++--- core/api/test/helpers/wallet.ts | 11 +- .../get-transactions-for-accounts.spec.ts | 14 +-- ...-account-from-registration-payload.spec.ts | 6 +- .../app/authentication/extend.spec.ts | 6 +- .../wallets/add-invoice-for-wallet.spec.ts | 8 +- .../add-pending-on-chain-transaction.spec.ts | 10 +- .../add-settled-on-chain-transaction.spec.ts | 12 +- .../wallets/create-on-chain-address.spec.ts | 16 +-- .../wallets/get-last-on-chain-address.spec.ts | 8 +- .../app/wallets/get-on-chain-fee.spec.ts | 10 +- ...ending-onchain-balance-for-wallets.spec.ts | 8 +- .../app/wallets/send-intraledger.spec.ts | 20 ++-- .../app/wallets/send-lightning.spec.ts | 56 +++++----- .../app/wallets/send-onchain.spec.ts | 30 ++--- .../wallets/update-pending-invoices.spec.ts | 18 +-- core/api/test/integration/jest.config.js | 15 +-- core/api/test/integration/jest.setup.js | 10 +- .../services/ledger-facade.spec.ts | 10 +- .../services/ledger-service.spec.ts | 6 +- .../integration/services/lnd-service.spec.ts | 12 +- .../services/onchain-service.spec.ts | 6 +- .../integration/services/stablesats.spec.ts | 4 +- .../services/wallets-repository.spec.ts | 10 +- .../01-setup/01-connection.spec.ts | 6 +- .../01-setup/01-funds-bitcoind-lnds.spec.ts | 4 +- .../01-setup/01-lightning-channels.spec.ts | 6 +- .../02-user-wallet/02-a-user-setup.spec.ts | 14 +-- .../02-user-wallet/02-bria-handlers.spec.ts | 22 ++-- .../02-user-wallet/02-bria.spec.ts | 12 +- .../02-receive-lightning.spec.ts | 8 +- .../02-user-wallet/02-receive-rewards.spec.ts | 18 +-- .../02-send-lightning-limits.spec.ts | 18 +-- .../02-user-wallet/02-tx-display.spec.ts | 50 ++++----- .../accounts/multiple-wallet-account.spec.ts | 11 +- .../app/cron/delete-payments.spec.ts | 10 +- .../app/swap/swap-listener.spec.ts | 10 +- .../app/swap/swap-out.spec.ts | 18 +-- .../app/swap/swap-record-ledger-fee.spec.ts | 6 +- .../app/trigger/trigger.fn.spec.ts | 16 +-- .../app/users/update-language.spec.ts | 6 +- .../app/users/user-role.spec.ts | 2 +- .../app/users/user-wallets.spec.ts | 4 +- .../app/wallets/invoice.spec.ts | 20 ++-- .../test/legacy-integration/jest.config.js | 15 +-- .../api/test/legacy-integration/jest.setup.js | 14 +-- .../notifications/notification.spec.ts | 26 ++--- .../notifications/push-notification.spec.ts | 2 +- .../services/cache/index.spec.ts | 8 +- .../services/dealer/hedge-price.spec.ts | 28 +++-- .../services/dealer/mid-price.spec.ts | 6 +- .../services/ledger/facade.spec.ts | 10 +- .../services/ledger/service.spec.ts | 10 +- .../services/lnd/health.spec.ts | 4 +- .../services/lnd/parse-errors.spec.ts | 6 +- .../services/lnd/utils.spec.ts | 12 +- .../legacy-integration/services/lock.spec.ts | 10 +- .../services/mongoose/user-repository.spec.ts | 4 +- .../services/mongoose/wallet-invoices.spec.ts | 6 +- .../wallet-onchain-pending-receive.spec.ts | 10 +- core/api/test/mocks/get-current-price.ts | 4 +- core/api/test/mocks/price.ts | 2 +- core/api/test/mocks/twilio.ts | 2 +- .../test/unit/app/auth/auth-test-checker.ts | 4 +- .../unit/app/payments/translations.spec.ts | 14 +-- .../unit/app/prices/get-current-price.spec.ts | 14 +-- .../unit/app/prices/get-price-history.spec.ts | 12 +- .../unit/app/prices/list-currencies.spec.ts | 12 +- core/api/test/unit/config.spec.ts | 5 +- .../unit/domain/accounts-ips/index.spec.ts | 2 +- .../domain/accounts/limits-checker.spec.ts | 8 +- .../domain/accounts/limits-volume.spec.ts | 8 +- .../test/unit/domain/accounts/new-account.ts | 4 +- .../unit/domain/authentication/index.spec.ts | 2 +- .../registration-payload-validator.spec.ts | 8 +- .../authentication/secret-validator.spec.ts | 4 +- .../domain/bitcoin/checked-to-sats.spec.ts | 4 +- .../lightning/invoice-expiration.spec.ts | 8 +- .../bitcoin/lightning/ln-invoice.spec.ts | 4 +- .../checked-to-on-chain-address.spec.ts | 6 +- .../onchain/incoming-tx-handler.spec.ts | 6 +- .../bitcoin/onchain/rebalance-checker.spec.ts | 4 +- .../domain/bitcoin/onchain/tx-decoder.spec.ts | 4 +- .../domain/bitcoin/onchain/tx-filter.spec.ts | 4 +- core/api/test/unit/domain/errors.spec.ts | 4 +- .../fiat/display-amounts-converter.spec.ts | 6 +- .../domain/ledger/activity-checker.spec.ts | 8 +- .../domain/ledger/fee-reimbursement.spec.ts | 8 +- .../ledger/imbalance-calculator.spec.ts | 8 +- .../api/test/unit/domain/ledger/index.spec.ts | 6 +- .../unit/domain/notifications/index.spec.ts | 2 +- .../test/unit/domain/payments/index.spec.ts | 2 +- .../test/unit/domain/payments/ln-fees.spec.ts | 6 +- .../unit/domain/payments/price-ratio.spec.ts | 6 +- .../unit/domain/routes/key-factory.spec.ts | 6 +- .../domain/shared/amount-calculator.spec.ts | 2 +- .../unit/domain/swap/swap-out-checker.spec.ts | 4 +- .../users-ips/ip-metadata-authorizer.spec.ts | 4 +- .../unit/domain/users-ips/parse-ips.spec.ts | 2 +- .../users/checked-to-accountlevel.spec.ts | 4 +- .../domain/users/checked-to-language.spec.ts | 4 +- .../users/checked-to-phonenumber.spec.ts | 2 +- .../domain/users/checked-to-username.spec.ts | 2 +- .../users/phone-metadata-authorizer.spec.ts | 6 +- .../users/phone-metadata-validator.spec.ts | 4 +- .../wallet-invoice-builder.spec.ts | 12 +- .../wallet-invoice-checker.spec.ts | 8 +- .../wallet-invoice-receiver.spec.ts | 4 +- .../wallet-address-receiver.spec.ts | 8 +- .../wallets/deposit-fee-calculator.spec.ts | 4 +- .../wallets/payment-input-validator.spec.ts | 10 +- .../domain/wallets/settlement-amounts.spec.ts | 8 +- .../unit/domain/wallets/tx-history.spec.ts | 14 +-- .../wallets/withdrawal-fee-calculator.spec.ts | 4 +- core/api/test/unit/graphql/index.spec.ts | 4 +- core/api/test/unit/jest.config.js | 15 +-- core/api/test/unit/ledger/ledger.spec.ts | 6 +- .../onchain-payment-flow-builder.spec.ts | 16 +-- .../payments/payment-flow-builder.spec.ts | 10 +- .../test/unit/payments/payment-flow.spec.ts | 14 +-- .../services/ipfetcher/fetch-ip-info.spec.ts | 3 +- .../ledger/domain/entry-builder.spec.ts | 8 +- .../domain/fee-only-entry-builder.spec.ts | 8 +- .../ledger/domain/tx-metadata.spec.ts | 10 +- .../test/unit/services/mongoose/utils.spec.ts | 3 +- .../create-push-notification-content.spec.ts | 6 +- .../services/notifications/transactions.ts | 6 +- .../utils/grpc-stream-client/backoff.spec.ts | 2 +- .../grpc-stream-client/stream-builder.spec.ts | 2 +- .../utils/grpc-stream-client/stream.spec.ts | 2 +- core/api/test/unit/utils/index.spec.ts | 4 +- core/api/tsconfig.json | 12 +- 657 files changed, 3306 insertions(+), 3194 deletions(-) diff --git a/core/api/src/app/accounts/account-limit.ts b/core/api/src/app/accounts/account-limit.ts index d645d891a7..3dc02132ff 100644 --- a/core/api/src/app/accounts/account-limit.ts +++ b/core/api/src/app/accounts/account-limit.ts @@ -1,14 +1,14 @@ -import { getAccountLimits, ONE_DAY } from "@config" +import { getAccountLimits, ONE_DAY } from "@/config" import { AccountLimitsType, AccountTxVolumeLimitChecker, AccountTxVolumeRemaining, -} from "@domain/accounts" -import { InvalidAccountLimitTypeError } from "@domain/errors" +} from "@/domain/accounts" +import { InvalidAccountLimitTypeError } from "@/domain/errors" -import * as LedgerFacade from "@services/ledger/facade" -import { AccountsRepository, WalletsRepository } from "@services/mongoose" +import * as LedgerFacade from "@/services/ledger/facade" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" export const remainingIntraLedgerLimit = async ({ accountId, diff --git a/core/api/src/app/accounts/active-accounts.ts b/core/api/src/app/accounts/active-accounts.ts index 30334df84c..f414ed4471 100644 --- a/core/api/src/app/accounts/active-accounts.ts +++ b/core/api/src/app/accounts/active-accounts.ts @@ -1,14 +1,14 @@ -import { USER_ACTIVENESS_MONTHLY_VOLUME_THRESHOLD } from "@config" +import { USER_ACTIVENESS_MONTHLY_VOLUME_THRESHOLD } from "@/config" -import { getCurrentPriceAsWalletPriceRatio } from "@app/prices" +import { getCurrentPriceAsWalletPriceRatio } from "@/app/prices" -import { ErrorLevel } from "@domain/shared" -import { ActivityChecker } from "@domain/ledger" +import { ErrorLevel } from "@/domain/shared" +import { ActivityChecker } from "@/domain/ledger" -import * as LedgerFacade from "@services/ledger/facade" -import { recordExceptionInCurrentSpan } from "@services/tracing" -import { WalletsRepository, AccountsRepository } from "@services/mongoose" -import { UsdDisplayCurrency } from "@domain/fiat" +import * as LedgerFacade from "@/services/ledger/facade" +import { recordExceptionInCurrentSpan } from "@/services/tracing" +import { WalletsRepository, AccountsRepository } from "@/services/mongoose" +import { UsdDisplayCurrency } from "@/domain/fiat" export const getRecentlyActiveAccounts = async function* (): | AsyncGenerator diff --git a/core/api/src/app/accounts/add-new-contact.ts b/core/api/src/app/accounts/add-new-contact.ts index 44f48392b3..86f137dcc0 100644 --- a/core/api/src/app/accounts/add-new-contact.ts +++ b/core/api/src/app/accounts/add-new-contact.ts @@ -1,4 +1,4 @@ -import { AccountsRepository } from "@services/mongoose" +import { AccountsRepository } from "@/services/mongoose" export const addNewContact = async ({ accountId, diff --git a/core/api/src/app/accounts/add-wallet.ts b/core/api/src/app/accounts/add-wallet.ts index 21985b247c..c5bed73718 100644 --- a/core/api/src/app/accounts/add-wallet.ts +++ b/core/api/src/app/accounts/add-wallet.ts @@ -1,4 +1,4 @@ -import { WalletsRepository } from "@services/mongoose" +import { WalletsRepository } from "@/services/mongoose" export const addWallet = async ({ accountId, diff --git a/core/api/src/app/accounts/create-account.ts b/core/api/src/app/accounts/create-account.ts index 8a475e45e0..39a543e4ba 100644 --- a/core/api/src/app/accounts/create-account.ts +++ b/core/api/src/app/accounts/create-account.ts @@ -1,13 +1,13 @@ -import { ConfigError, getAdminAccounts, getDefaultAccountsConfig } from "@config" +import { ConfigError, getAdminAccounts, getDefaultAccountsConfig } from "@/config" -import { WalletType } from "@domain/wallets" -import { AccountLevel } from "@domain/accounts" +import { WalletType } from "@/domain/wallets" +import { AccountLevel } from "@/domain/accounts" import { AccountsRepository, UsersRepository, WalletsRepository, -} from "@services/mongoose" +} from "@/services/mongoose" const initializeCreatedAccount = async ({ account, diff --git a/core/api/src/app/accounts/delete-business-map-info.ts b/core/api/src/app/accounts/delete-business-map-info.ts index a5aabf499a..d12ffe6231 100644 --- a/core/api/src/app/accounts/delete-business-map-info.ts +++ b/core/api/src/app/accounts/delete-business-map-info.ts @@ -1,5 +1,5 @@ -import { checkedToUsername } from "@domain/accounts" -import { AccountsRepository } from "@services/mongoose/accounts" +import { checkedToUsername } from "@/domain/accounts" +import { AccountsRepository } from "@/services/mongoose/accounts" export const deleteBusinessMapInfo = async ({ username, diff --git a/core/api/src/app/accounts/disable-notification-category.ts b/core/api/src/app/accounts/disable-notification-category.ts index 8bc1bc4014..1d38544ac6 100644 --- a/core/api/src/app/accounts/disable-notification-category.ts +++ b/core/api/src/app/accounts/disable-notification-category.ts @@ -1,8 +1,8 @@ import { checkedToNotificationCategory, disableNotificationCategory as domainDisableNotificationCategory, -} from "@domain/notifications" -import { AccountsRepository } from "@services/mongoose" +} from "@/domain/notifications" +import { AccountsRepository } from "@/services/mongoose" export const disableNotificationCategory = async ({ accountId, diff --git a/core/api/src/app/accounts/disable-notification-channel.ts b/core/api/src/app/accounts/disable-notification-channel.ts index 1e5eed47eb..d0b7d4d050 100644 --- a/core/api/src/app/accounts/disable-notification-channel.ts +++ b/core/api/src/app/accounts/disable-notification-channel.ts @@ -1,5 +1,5 @@ -import { disableNotificationChannel as domainDisableNotificationChannel } from "@domain/notifications" -import { AccountsRepository } from "@services/mongoose" +import { disableNotificationChannel as domainDisableNotificationChannel } from "@/domain/notifications" +import { AccountsRepository } from "@/services/mongoose" export const disableNotificationChannel = async ({ accountId, diff --git a/core/api/src/app/accounts/enable-notification-category.ts b/core/api/src/app/accounts/enable-notification-category.ts index 6248e6a499..a2b03be64f 100644 --- a/core/api/src/app/accounts/enable-notification-category.ts +++ b/core/api/src/app/accounts/enable-notification-category.ts @@ -1,8 +1,8 @@ import { checkedToNotificationCategory, enableNotificationCategory as domainEnableNotificationCategory, -} from "@domain/notifications" -import { AccountsRepository } from "@services/mongoose" +} from "@/domain/notifications" +import { AccountsRepository } from "@/services/mongoose" export const enableNotificationCategory = async ({ accountId, diff --git a/core/api/src/app/accounts/enable-notification-channel.ts b/core/api/src/app/accounts/enable-notification-channel.ts index 4843786bf7..834bb3b23d 100644 --- a/core/api/src/app/accounts/enable-notification-channel.ts +++ b/core/api/src/app/accounts/enable-notification-channel.ts @@ -1,5 +1,5 @@ -import { enableNotificationChannel as domainEnableNotificationChannel } from "@domain/notifications" -import { AccountsRepository } from "@services/mongoose" +import { enableNotificationChannel as domainEnableNotificationChannel } from "@/domain/notifications" +import { AccountsRepository } from "@/services/mongoose" export const enableNotificationChannel = async ({ accountId, diff --git a/core/api/src/app/accounts/get-account-transactions-for-contact.ts b/core/api/src/app/accounts/get-account-transactions-for-contact.ts index 5c8eb19d06..9aac2e5964 100644 --- a/core/api/src/app/accounts/get-account-transactions-for-contact.ts +++ b/core/api/src/app/accounts/get-account-transactions-for-contact.ts @@ -1,9 +1,9 @@ -import { memoSharingConfig } from "@config" -import { LedgerError } from "@domain/ledger" -import { WalletTransactionHistory } from "@domain/wallets" +import { memoSharingConfig } from "@/config" +import { LedgerError } from "@/domain/ledger" +import { WalletTransactionHistory } from "@/domain/wallets" -import { getNonEndUserWalletIds, LedgerService } from "@services/ledger" -import { WalletsRepository } from "@services/mongoose" +import { getNonEndUserWalletIds, LedgerService } from "@/services/ledger" +import { WalletsRepository } from "@/services/mongoose" export const getAccountTransactionsForContact = async ({ account, diff --git a/core/api/src/app/accounts/get-contact-by-username.ts b/core/api/src/app/accounts/get-contact-by-username.ts index 0414ae209b..41dcd0a025 100644 --- a/core/api/src/app/accounts/get-contact-by-username.ts +++ b/core/api/src/app/accounts/get-contact-by-username.ts @@ -1,4 +1,4 @@ -import { NoContactForUsernameError } from "@domain/errors" +import { NoContactForUsernameError } from "@/domain/errors" export const getContactByUsername = async ({ account, diff --git a/core/api/src/app/accounts/get-csv-for-account.ts b/core/api/src/app/accounts/get-csv-for-account.ts index 9d86d8f7cf..d6b26ad4da 100644 --- a/core/api/src/app/accounts/get-csv-for-account.ts +++ b/core/api/src/app/accounts/get-csv-for-account.ts @@ -1,5 +1,5 @@ -import { CsvWalletsExport } from "@services/ledger/csv-wallet-export" -import { WalletsRepository } from "@services/mongoose" +import { CsvWalletsExport } from "@/services/ledger/csv-wallet-export" +import { WalletsRepository } from "@/services/mongoose" export const getCSVForAccount = async ( accountId: AccountId, diff --git a/core/api/src/app/accounts/get-transactions-for-account.ts b/core/api/src/app/accounts/get-transactions-for-account.ts index 7ee6f4b730..28b5902fb8 100644 --- a/core/api/src/app/accounts/get-transactions-for-account.ts +++ b/core/api/src/app/accounts/get-transactions-for-account.ts @@ -1,10 +1,11 @@ -import { AccountValidator } from "@domain/accounts" -import { RepositoryError } from "@domain/errors" -import { WalletsRepository } from "@services/mongoose" - import { getTransactionsForWallets } from "../wallets" + import { PartialResult } from "../partial-result" +import { AccountValidator } from "@/domain/accounts" +import { RepositoryError } from "@/domain/errors" +import { WalletsRepository } from "@/services/mongoose" + export const getTransactionsForAccountByWalletIds = async ({ account, walletIds, diff --git a/core/api/src/app/accounts/index.ts b/core/api/src/app/accounts/index.ts index 1daba7632d..19505c3acf 100644 --- a/core/api/src/app/accounts/index.ts +++ b/core/api/src/app/accounts/index.ts @@ -1,4 +1,4 @@ -import { AccountsRepository, WalletsRepository } from "@services/mongoose" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" export * from "./account-limit" export * from "./add-new-contact" diff --git a/core/api/src/app/accounts/mark-account-for-deletion.ts b/core/api/src/app/accounts/mark-account-for-deletion.ts index 7b7719ac06..95a16b36f4 100644 --- a/core/api/src/app/accounts/mark-account-for-deletion.ts +++ b/core/api/src/app/accounts/mark-account-for-deletion.ts @@ -1,9 +1,9 @@ -import { getBalanceForWallet, listWalletsByAccountId } from "@app/wallets" -import { AccountStatus } from "@domain/accounts" -import { AccountHasPositiveBalanceError } from "@domain/authentication/errors" -import { IdentityRepository } from "@services/kratos" -import { AccountsRepository, UsersRepository } from "@services/mongoose" -import { addEventToCurrentSpan } from "@services/tracing" +import { getBalanceForWallet, listWalletsByAccountId } from "@/app/wallets" +import { AccountStatus } from "@/domain/accounts" +import { AccountHasPositiveBalanceError } from "@/domain/authentication/errors" +import { IdentityRepository } from "@/services/kratos" +import { AccountsRepository, UsersRepository } from "@/services/mongoose" +import { addEventToCurrentSpan } from "@/services/tracing" export const markAccountForDeletion = async ({ accountId, diff --git a/core/api/src/app/accounts/send-default-wallet-balance-to-users.ts b/core/api/src/app/accounts/send-default-wallet-balance-to-users.ts index 9a74f279ac..2b63c64e47 100644 --- a/core/api/src/app/accounts/send-default-wallet-balance-to-users.ts +++ b/core/api/src/app/accounts/send-default-wallet-balance-to-users.ts @@ -1,19 +1,19 @@ +import { getRecentlyActiveAccounts } from "./active-accounts" + import { getCurrentPriceAsDisplayPriceRatio, getCurrentPriceAsWalletPriceRatio, -} from "@app/prices" -import { removeDeviceTokens } from "@app/users/remove-device-tokens" +} from "@/app/prices" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" -import { UsdDisplayCurrency } from "@domain/fiat" -import { WalletCurrency } from "@domain/shared" -import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications" +import { UsdDisplayCurrency } from "@/domain/fiat" +import { WalletCurrency } from "@/domain/shared" +import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications" -import { LedgerService } from "@services/ledger" -import { wrapAsyncToRunInSpan } from "@services/tracing" -import { NotificationsService } from "@services/notifications" -import { WalletsRepository, UsersRepository } from "@services/mongoose" - -import { getRecentlyActiveAccounts } from "./active-accounts" +import { LedgerService } from "@/services/ledger" +import { wrapAsyncToRunInSpan } from "@/services/tracing" +import { NotificationsService } from "@/services/notifications" +import { WalletsRepository, UsersRepository } from "@/services/mongoose" export const sendDefaultWalletBalanceToAccounts = async () => { const accounts = getRecentlyActiveAccounts() diff --git a/core/api/src/app/accounts/set-username.ts b/core/api/src/app/accounts/set-username.ts index e8a9367d06..30c1147284 100644 --- a/core/api/src/app/accounts/set-username.ts +++ b/core/api/src/app/accounts/set-username.ts @@ -1,11 +1,11 @@ +import { usernameAvailable } from "./username-available" + import { checkedToUsername, UsernameIsImmutableError, UsernameNotAvailableError, -} from "@domain/accounts" -import { AccountsRepository } from "@services/mongoose" - -import { usernameAvailable } from "./username-available" +} from "@/domain/accounts" +import { AccountsRepository } from "@/services/mongoose" export const setUsername = async ({ id, diff --git a/core/api/src/app/accounts/update-account-ip.ts b/core/api/src/app/accounts/update-account-ip.ts index 47b472460f..b6c0108d3a 100644 --- a/core/api/src/app/accounts/update-account-ip.ts +++ b/core/api/src/app/accounts/update-account-ip.ts @@ -1,14 +1,14 @@ -import { getIpConfig } from "@config" -import { isPrivateIp } from "@domain/accounts-ips" -import { CouldNotFindAccountIpError, RepositoryError } from "@domain/errors" -import { IpFetcherServiceError } from "@domain/ipfetcher" -import { ErrorLevel } from "@domain/shared" -import { IpFetcher } from "@services/ipfetcher" -import { AccountsIpsRepository } from "@services/mongoose/accounts-ips" +import { getIpConfig } from "@/config" +import { isPrivateIp } from "@/domain/accounts-ips" +import { CouldNotFindAccountIpError, RepositoryError } from "@/domain/errors" +import { IpFetcherServiceError } from "@/domain/ipfetcher" +import { ErrorLevel } from "@/domain/shared" +import { IpFetcher } from "@/services/ipfetcher" +import { AccountsIpsRepository } from "@/services/mongoose/accounts-ips" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, -} from "@services/tracing" +} from "@/services/tracing" const accountsIps = AccountsIpsRepository() diff --git a/core/api/src/app/accounts/update-account-level.ts b/core/api/src/app/accounts/update-account-level.ts index b63d770546..5cec6071ca 100644 --- a/core/api/src/app/accounts/update-account-level.ts +++ b/core/api/src/app/accounts/update-account-level.ts @@ -1,4 +1,4 @@ -import { AccountsRepository } from "@services/mongoose" +import { AccountsRepository } from "@/services/mongoose" export const updateAccountLevel = async ({ id, diff --git a/core/api/src/app/accounts/update-account-status.ts b/core/api/src/app/accounts/update-account-status.ts index 01840f0ebc..ec201e3315 100644 --- a/core/api/src/app/accounts/update-account-status.ts +++ b/core/api/src/app/accounts/update-account-status.ts @@ -1,5 +1,5 @@ -import { checkedAccountStatus, checkedToAccountId } from "@domain/accounts" -import { AccountsRepository } from "@services/mongoose" +import { checkedAccountStatus, checkedToAccountId } from "@/domain/accounts" +import { AccountsRepository } from "@/services/mongoose" export const updateAccountStatus = async ({ id: idRaw, diff --git a/core/api/src/app/accounts/update-account-withdraw-fee.ts b/core/api/src/app/accounts/update-account-withdraw-fee.ts index 091da242a4..a66eb46aa3 100644 --- a/core/api/src/app/accounts/update-account-withdraw-fee.ts +++ b/core/api/src/app/accounts/update-account-withdraw-fee.ts @@ -1,5 +1,5 @@ -import { sanityCheckedDefaultAccountWithdrawFee } from "@domain/accounts" -import { AccountsRepository } from "@services/mongoose" +import { sanityCheckedDefaultAccountWithdrawFee } from "@/domain/accounts" +import { AccountsRepository } from "@/services/mongoose" export const updateAccountWithdrawFee = async ({ id, diff --git a/core/api/src/app/accounts/update-business-map-info.ts b/core/api/src/app/accounts/update-business-map-info.ts index eda78a159a..66fa775a8c 100644 --- a/core/api/src/app/accounts/update-business-map-info.ts +++ b/core/api/src/app/accounts/update-business-map-info.ts @@ -1,5 +1,5 @@ -import { checkedCoordinates, checkedMapTitle, checkedToUsername } from "@domain/accounts" -import { AccountsRepository } from "@services/mongoose/accounts" +import { checkedCoordinates, checkedMapTitle, checkedToUsername } from "@/domain/accounts" +import { AccountsRepository } from "@/services/mongoose/accounts" export const updateBusinessMapInfo = async ({ username, diff --git a/core/api/src/app/accounts/update-contact-alias.ts b/core/api/src/app/accounts/update-contact-alias.ts index 0236973b9b..7e7e83a8de 100644 --- a/core/api/src/app/accounts/update-contact-alias.ts +++ b/core/api/src/app/accounts/update-contact-alias.ts @@ -1,6 +1,6 @@ -import { checkedToContactAlias } from "@domain/accounts" -import { ContactNotExistentError } from "@domain/errors" -import { AccountsRepository } from "@services/mongoose" +import { checkedToContactAlias } from "@/domain/accounts" +import { ContactNotExistentError } from "@/domain/errors" +import { AccountsRepository } from "@/services/mongoose" export const updateContactAlias = async ({ accountId, diff --git a/core/api/src/app/accounts/update-default-walletid.ts b/core/api/src/app/accounts/update-default-walletid.ts index 7798895064..2aac99b487 100644 --- a/core/api/src/app/accounts/update-default-walletid.ts +++ b/core/api/src/app/accounts/update-default-walletid.ts @@ -1,5 +1,5 @@ -import { InvalidWalletId } from "@domain/errors" -import { AccountsRepository, WalletsRepository } from "@services/mongoose" +import { InvalidWalletId } from "@/domain/errors" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" export const updateDefaultWalletId = async ({ accountId, diff --git a/core/api/src/app/accounts/update-display-currency.ts b/core/api/src/app/accounts/update-display-currency.ts index b668f72422..9501972010 100644 --- a/core/api/src/app/accounts/update-display-currency.ts +++ b/core/api/src/app/accounts/update-display-currency.ts @@ -1,9 +1,9 @@ -import { listCurrencies } from "@app/prices" +import { listCurrencies } from "@/app/prices" -import { checkedToDisplayCurrency } from "@domain/fiat" -import { InvalidPriceCurrencyError } from "@domain/price" +import { checkedToDisplayCurrency } from "@/domain/fiat" +import { InvalidPriceCurrencyError } from "@/domain/price" -import { AccountsRepository } from "@services/mongoose" +import { AccountsRepository } from "@/services/mongoose" export const updateDisplayCurrency = async ({ accountId, diff --git a/core/api/src/app/accounts/upgrade-device-account.ts b/core/api/src/app/accounts/upgrade-device-account.ts index 671a53af2a..3db902f04b 100644 --- a/core/api/src/app/accounts/upgrade-device-account.ts +++ b/core/api/src/app/accounts/upgrade-device-account.ts @@ -1,5 +1,5 @@ -import { AccountLevel } from "@domain/accounts" -import { AccountsRepository, UsersRepository } from "@services/mongoose" +import { AccountLevel } from "@/domain/accounts" +import { AccountsRepository, UsersRepository } from "@/services/mongoose" export const upgradeAccountFromDeviceToPhone = async ({ userId, diff --git a/core/api/src/app/accounts/username-available.ts b/core/api/src/app/accounts/username-available.ts index 4b3ea860db..4e52254975 100644 --- a/core/api/src/app/accounts/username-available.ts +++ b/core/api/src/app/accounts/username-available.ts @@ -1,6 +1,6 @@ -import { checkedToUsername } from "@domain/accounts" -import { CouldNotFindError } from "@domain/errors" -import { AccountsRepository } from "@services/mongoose" +import { checkedToUsername } from "@/domain/accounts" +import { CouldNotFindError } from "@/domain/errors" +import { AccountsRepository } from "@/services/mongoose" export const usernameAvailable = async ( username: Username, diff --git a/core/api/src/app/admin/backup.ts b/core/api/src/app/admin/backup.ts index e943cacf85..7ca3c0c452 100644 --- a/core/api/src/app/admin/backup.ts +++ b/core/api/src/app/admin/backup.ts @@ -1,3 +1,7 @@ +import { Storage } from "@google-cloud/storage" + +import axios from "axios" + import { DROPBOX_ACCESS_TOKEN, GCS_APPLICATION_CREDENTIALS_PATH, @@ -6,17 +10,15 @@ import { NEXTCLOUD_PASSWORD, NEXTCLOUD_URL, NEXTCLOUD_USER, -} from "@config" -import { ErrorLevel } from "@domain/shared" -import { Storage } from "@google-cloud/storage" +} from "@/config" +import { ErrorLevel } from "@/domain/shared" import { SemanticAttributes, addAttributesToCurrentSpan, addEventToCurrentSpan, asyncRunInSpan, recordExceptionInCurrentSpan, -} from "@services/tracing" -import axios from "axios" +} from "@/services/tracing" export const uploadBackup = (logger: Logger) => diff --git a/core/api/src/app/admin/index.ts b/core/api/src/app/admin/index.ts index b7ef835ff8..af3cd18419 100644 --- a/core/api/src/app/admin/index.ts +++ b/core/api/src/app/admin/index.ts @@ -1,9 +1,9 @@ export * from "./update-user-phone" export * from "./send-admin-push-notification" -import { checkedToAccountUuid, checkedToUsername } from "@domain/accounts" -import { IdentityRepository } from "@services/kratos" -import { AccountsRepository, UsersRepository } from "@services/mongoose" +import { checkedToAccountUuid, checkedToUsername } from "@/domain/accounts" +import { IdentityRepository } from "@/services/kratos" +import { AccountsRepository, UsersRepository } from "@/services/mongoose" export const getAccountByUsername = async (username: string) => { const usernameValid = checkedToUsername(username) diff --git a/core/api/src/app/admin/send-admin-push-notification.ts b/core/api/src/app/admin/send-admin-push-notification.ts index 5694214423..913a41cf20 100644 --- a/core/api/src/app/admin/send-admin-push-notification.ts +++ b/core/api/src/app/admin/send-admin-push-notification.ts @@ -1,11 +1,11 @@ -import { checkedToAccountUuid } from "@domain/accounts" +import { checkedToAccountUuid } from "@/domain/accounts" import { GaloyNotificationCategories, checkedToNotificationCategory, -} from "@domain/notifications" -import { AccountsRepository } from "@services/mongoose/accounts" -import { UsersRepository } from "@services/mongoose/users" -import { NotificationsService } from "@services/notifications" +} from "@/domain/notifications" +import { AccountsRepository } from "@/services/mongoose/accounts" +import { UsersRepository } from "@/services/mongoose/users" +import { NotificationsService } from "@/services/notifications" export const sendAdminPushNotification = async ({ accountId: accountIdRaw, diff --git a/core/api/src/app/admin/update-user-phone.ts b/core/api/src/app/admin/update-user-phone.ts index 1d231acfa4..857b4f6ac2 100644 --- a/core/api/src/app/admin/update-user-phone.ts +++ b/core/api/src/app/admin/update-user-phone.ts @@ -1,9 +1,9 @@ -import { markAccountForDeletion } from "@app/accounts" -import { checkedToAccountUuid } from "@domain/accounts" -import { AuthWithPhonePasswordlessService } from "@services/kratos" -import { AccountsRepository } from "@services/mongoose/accounts" -import { UsersRepository } from "@services/mongoose/users" -import { addAttributesToCurrentSpan } from "@services/tracing" +import { markAccountForDeletion } from "@/app/accounts" +import { checkedToAccountUuid } from "@/domain/accounts" +import { AuthWithPhonePasswordlessService } from "@/services/kratos" +import { AccountsRepository } from "@/services/mongoose/accounts" +import { UsersRepository } from "@/services/mongoose/users" +import { addAttributesToCurrentSpan } from "@/services/tracing" export const updateUserPhone = async ({ accountUuid: accountUuidRaw, diff --git a/core/api/src/app/authentication/create-account-from-registration-payload.ts b/core/api/src/app/authentication/create-account-from-registration-payload.ts index 1b0eab5a87..ec32101bf8 100644 --- a/core/api/src/app/authentication/create-account-from-registration-payload.ts +++ b/core/api/src/app/authentication/create-account-from-registration-payload.ts @@ -1,17 +1,17 @@ -import { KRATOS_CALLBACK_API_KEY, getDefaultAccountsConfig } from "@config" +import { KRATOS_CALLBACK_API_KEY, getDefaultAccountsConfig } from "@/config" -import { CallbackSecretValidator } from "@domain/authentication/secret-validator" -import { RegistrationPayloadValidator } from "@domain/authentication/registration-payload-validator" -import { ErrorLevel } from "@domain/shared" -import { InvalidPhoneNumber, InvalidUserId } from "@domain/errors" +import { CallbackSecretValidator } from "@/domain/authentication/secret-validator" +import { RegistrationPayloadValidator } from "@/domain/authentication/registration-payload-validator" +import { ErrorLevel } from "@/domain/shared" +import { InvalidPhoneNumber, InvalidUserId } from "@/domain/errors" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, -} from "@services/tracing" -import { SchemaIdType } from "@services/kratos" +} from "@/services/tracing" +import { SchemaIdType } from "@/services/kratos" -import { createAccountWithPhoneIdentifier } from "@app/accounts" +import { createAccountWithPhoneIdentifier } from "@/app/accounts" export const createAccountFromRegistrationPayload = async ({ secret, diff --git a/core/api/src/app/authentication/email.ts b/core/api/src/app/authentication/email.ts index efa6431727..6c029829f2 100644 --- a/core/api/src/app/authentication/email.ts +++ b/core/api/src/app/authentication/email.ts @@ -1,7 +1,7 @@ -import { AccountAlreadyHasEmailError } from "@domain/authentication/errors" -import { AuthWithEmailPasswordlessService } from "@services/kratos" -import { baseLogger } from "@services/logger" -import { UsersRepository } from "@services/mongoose" +import { AccountAlreadyHasEmailError } from "@/domain/authentication/errors" +import { AuthWithEmailPasswordlessService } from "@/services/kratos" +import { baseLogger } from "@/services/logger" +import { UsersRepository } from "@/services/mongoose" export const addEmailToIdentity = async ({ email, diff --git a/core/api/src/app/authentication/extend-sessions.ts b/core/api/src/app/authentication/extend-sessions.ts index 2786367724..10a85dc0de 100644 --- a/core/api/src/app/authentication/extend-sessions.ts +++ b/core/api/src/app/authentication/extend-sessions.ts @@ -1,4 +1,4 @@ -import { extendSession } from "@services/kratos" +import { extendSession } from "@/services/kratos" export const maybeExtendSession = async ({ sessionId, diff --git a/core/api/src/app/authentication/get-supported-countries.ts b/core/api/src/app/authentication/get-supported-countries.ts index f8da3cbb52..f57f5f9bf3 100644 --- a/core/api/src/app/authentication/get-supported-countries.ts +++ b/core/api/src/app/authentication/get-supported-countries.ts @@ -1,9 +1,10 @@ +import { getCountries } from "libphonenumber-js" + import { getSmsAuthUnsupportedCountries, getWhatsAppAuthUnsupportedCountries, -} from "@config" -import { getSupportedCountries as getSupportedCountriesDomain } from "@domain/authentication" -import { getCountries } from "libphonenumber-js" +} from "@/config" +import { getSupportedCountries as getSupportedCountriesDomain } from "@/domain/authentication" export const getSupportedCountries = (): Country[] => { return getSupportedCountriesDomain({ diff --git a/core/api/src/app/authentication/login.ts b/core/api/src/app/authentication/login.ts index e44b70de9f..b0507d6fd0 100644 --- a/core/api/src/app/authentication/login.ts +++ b/core/api/src/app/authentication/login.ts @@ -1,59 +1,59 @@ -import { createAccountForDeviceAccount } from "@app/accounts/create-account" +import { + checkFailedLoginAttemptPerIpLimits, + checkFailedLoginAttemptPerLoginIdentifierLimits, + rewardFailedLoginAttemptPerIpLimits, + rewardFailedLoginAttemptPerLoginIdentifierLimits, +} from "./ratelimits" + +import { createAccountForDeviceAccount } from "@/app/accounts/create-account" import { EmailUnverifiedError, IdentifierNotFoundError, -} from "@domain/authentication/errors" +} from "@/domain/authentication/errors" import { checkedToDeviceId, checkedToIdentityPassword, checkedToIdentityUsername, PhoneMetadataAuthorizer, -} from "@domain/users" +} from "@/domain/users" import { AuthWithEmailPasswordlessService, AuthWithPhonePasswordlessService, AuthWithUsernamePasswordDeviceIdService, IdentityRepository, PhoneAccountAlreadyExistsNeedToSweepFundsError, -} from "@services/kratos" +} from "@/services/kratos" -import { LedgerService } from "@services/ledger" -import { WalletsRepository } from "@services/mongoose" +import { LedgerService } from "@/services/ledger" +import { WalletsRepository } from "@/services/mongoose" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, -} from "@services/tracing" +} from "@/services/tracing" -import { upgradeAccountFromDeviceToPhone } from "@app/accounts" -import { checkedToEmailCode } from "@domain/authentication" -import { isPhoneCodeValid, TwilioClient } from "@services/twilio" +import { upgradeAccountFromDeviceToPhone } from "@/app/accounts" +import { checkedToEmailCode } from "@/domain/authentication" +import { isPhoneCodeValid, TwilioClient } from "@/services/twilio" -import { IPMetadataAuthorizer } from "@domain/accounts-ips/ip-metadata-authorizer" +import { IPMetadataAuthorizer } from "@/domain/accounts-ips/ip-metadata-authorizer" -import { getAccountsOnboardConfig } from "@config" +import { getAccountsOnboardConfig } from "@/config" import { UnauthorizedIPForOnboardingError, MissingIPMetadataError, InvalidIpMetadataError, -} from "@domain/errors" +} from "@/domain/errors" import { InvalidPhoneForOnboardingError, InvalidPhoneMetadataForOnboardingError, -} from "@domain/users/errors" -import { IpFetcher } from "@services/ipfetcher" +} from "@/domain/users/errors" +import { IpFetcher } from "@/services/ipfetcher" -import { IpFetcherServiceError } from "@domain/ipfetcher" -import { ErrorLevel } from "@domain/shared" - -import { - checkFailedLoginAttemptPerIpLimits, - checkFailedLoginAttemptPerLoginIdentifierLimits, - rewardFailedLoginAttemptPerIpLimits, - rewardFailedLoginAttemptPerLoginIdentifierLimits, -} from "./ratelimits" +import { IpFetcherServiceError } from "@/domain/ipfetcher" +import { ErrorLevel } from "@/domain/shared" export const loginWithPhoneToken = async ({ phone, diff --git a/core/api/src/app/authentication/logout.ts b/core/api/src/app/authentication/logout.ts index f2209389dd..71e256e17e 100644 --- a/core/api/src/app/authentication/logout.ts +++ b/core/api/src/app/authentication/logout.ts @@ -1,5 +1,8 @@ -import { removeDeviceTokens } from "@app/users/remove-device-tokens" -import { AuthWithPhonePasswordlessService, MissingSessionIdError } from "@services/kratos" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" +import { + AuthWithPhonePasswordlessService, + MissingSessionIdError, +} from "@/services/kratos" export const logoutToken = async ({ userId, diff --git a/core/api/src/app/authentication/phone.ts b/core/api/src/app/authentication/phone.ts index 02fb007dda..dcf5452497 100644 --- a/core/api/src/app/authentication/phone.ts +++ b/core/api/src/app/authentication/phone.ts @@ -1,11 +1,3 @@ -import { PhoneAlreadyExistsError } from "@domain/authentication/errors" - -import { isPhoneCodeValid } from "@services/twilio" - -import { UsersRepository } from "@services/mongoose" - -import { AuthWithEmailPasswordlessService } from "@services/kratos" - import { checkFailedLoginAttemptPerIpLimits, checkFailedLoginAttemptPerLoginIdentifierLimits, @@ -13,6 +5,14 @@ import { rewardFailedLoginAttemptPerLoginIdentifierLimits, } from "./ratelimits" +import { PhoneAlreadyExistsError } from "@/domain/authentication/errors" + +import { isPhoneCodeValid } from "@/services/twilio" + +import { UsersRepository } from "@/services/mongoose" + +import { AuthWithEmailPasswordlessService } from "@/services/kratos" + export const verifyPhone = async ({ userId, phone, diff --git a/core/api/src/app/authentication/ratelimits.ts b/core/api/src/app/authentication/ratelimits.ts index 9f9083e12d..f83a12ea7f 100644 --- a/core/api/src/app/authentication/ratelimits.ts +++ b/core/api/src/app/authentication/ratelimits.ts @@ -1,12 +1,12 @@ import { getFailedLoginAttemptPerIpLimits, getFailedLoginAttemptPerLoginIdentifierLimits, -} from "@config" +} from "@/config" -import { RateLimitConfig, RateLimitPrefix } from "@domain/rate-limit" -import { RateLimiterExceededError } from "@domain/rate-limit/errors" +import { RateLimitConfig, RateLimitPrefix } from "@/domain/rate-limit" +import { RateLimiterExceededError } from "@/domain/rate-limit/errors" -import { RedisRateLimitService, consumeLimiter } from "@services/rate-limit" +import { RedisRateLimitService, consumeLimiter } from "@/services/rate-limit" export const checkFailedLoginAttemptPerIpLimits = async ( ip: IpAddress, diff --git a/core/api/src/app/authentication/request-code.ts b/core/api/src/app/authentication/request-code.ts index f2da66640d..d32c096c7d 100644 --- a/core/api/src/app/authentication/request-code.ts +++ b/core/api/src/app/authentication/request-code.ts @@ -3,17 +3,17 @@ import { UNSECURE_DEFAULT_LOGIN_CODE, getGeetestConfig, getTestAccounts, -} from "@config" -import { TestAccountsChecker } from "@domain/accounts/test-accounts-checker" -import { PhoneAlreadyExistsError } from "@domain/authentication/errors" -import { NotImplementedError } from "@domain/errors" -import { RateLimitConfig } from "@domain/rate-limit" -import { RateLimiterExceededError } from "@domain/rate-limit/errors" -import Geetest from "@services/geetest" -import { AuthWithEmailPasswordlessService } from "@services/kratos" -import { baseLogger } from "@services/logger" -import { consumeLimiter } from "@services/rate-limit" -import { TWILIO_ACCOUNT_TEST, TwilioClient } from "@services/twilio" +} from "@/config" +import { TestAccountsChecker } from "@/domain/accounts/test-accounts-checker" +import { PhoneAlreadyExistsError } from "@/domain/authentication/errors" +import { NotImplementedError } from "@/domain/errors" +import { RateLimitConfig } from "@/domain/rate-limit" +import { RateLimiterExceededError } from "@/domain/rate-limit/errors" +import Geetest from "@/services/geetest" +import { AuthWithEmailPasswordlessService } from "@/services/kratos" +import { baseLogger } from "@/services/logger" +import { consumeLimiter } from "@/services/rate-limit" +import { TWILIO_ACCOUNT_TEST, TwilioClient } from "@/services/twilio" export const requestPhoneCodeWithCaptcha = async ({ phone, diff --git a/core/api/src/app/authentication/totp.ts b/core/api/src/app/authentication/totp.ts index 8dc25ce088..357ae1c8ea 100644 --- a/core/api/src/app/authentication/totp.ts +++ b/core/api/src/app/authentication/totp.ts @@ -1,13 +1,13 @@ -import { AuthTokenUserIdMismatchError } from "@domain/authentication/errors" +import { AuthTokenUserIdMismatchError } from "@/domain/authentication/errors" import { validateKratosToken, kratosValidateTotp, kratosInitiateTotp, kratosElevatingSessionWithTotp, kratosRemoveTotp, -} from "@services/kratos" +} from "@/services/kratos" -import { UsersRepository } from "@services/mongoose" +import { UsersRepository } from "@/services/mongoose" export const initiateTotpRegistration = async ({ authToken, diff --git a/core/api/src/app/bootstrap/index.ts b/core/api/src/app/bootstrap/index.ts index 3d8d6388cc..199c48c4f9 100644 --- a/core/api/src/app/bootstrap/index.ts +++ b/core/api/src/app/bootstrap/index.ts @@ -1,20 +1,20 @@ import { randomUUID } from "crypto" -import { createAccountWithPhoneIdentifier } from "@app/accounts" +import { createAccountWithPhoneIdentifier } from "@/app/accounts" -import { ConfigError, getAdminAccounts, getDefaultAccountsConfig } from "@config" +import { ConfigError, getAdminAccounts, getDefaultAccountsConfig } from "@/config" -import { CouldNotFindAccountFromKratosIdError, CouldNotFindError } from "@domain/errors" -import { WalletCurrency } from "@domain/shared" +import { CouldNotFindAccountFromKratosIdError, CouldNotFindError } from "@/domain/errors" +import { WalletCurrency } from "@/domain/shared" import { AccountsRepository, UsersRepository, WalletsRepository, -} from "@services/mongoose" -import { Account } from "@services/mongoose/schema" -import { toObjectId } from "@services/mongoose/utils" -import { initialStaticAccountIds } from "@services/ledger/facade" +} from "@/services/mongoose" +import { Account } from "@/services/mongoose/schema" +import { toObjectId } from "@/services/mongoose/utils" +import { initialStaticAccountIds } from "@/services/ledger/facade" export const randomUserId = () => randomUUID() as UserId diff --git a/core/api/src/app/callback/index.ts b/core/api/src/app/callback/index.ts index ff18cde2b4..2be92eb778 100644 --- a/core/api/src/app/callback/index.ts +++ b/core/api/src/app/callback/index.ts @@ -1,9 +1,10 @@ -import { getCallbackServiceConfig } from "@config" -import { InvalidUrlError } from "@domain/callback/errors" -import { CallbackService } from "@services/svix" -import { UnknownSvixError } from "@services/svix/errors" import { z } from "zod" +import { getCallbackServiceConfig } from "@/config" +import { InvalidUrlError } from "@/domain/callback/errors" +import { CallbackService } from "@/services/svix" +import { UnknownSvixError } from "@/services/svix/errors" + export const addEndpoint = async ({ accountUuid, url, diff --git a/core/api/src/app/captcha/index.ts b/core/api/src/app/captcha/index.ts index 7b8cade72c..391370ef97 100644 --- a/core/api/src/app/captcha/index.ts +++ b/core/api/src/app/captcha/index.ts @@ -1,5 +1,5 @@ -import { getGeetestConfig } from "@config" -import Geetest from "@services/geetest" +import { getGeetestConfig } from "@/config" +import Geetest from "@/services/geetest" export const registerCaptchaGeetest = async () => { const geeTestConfig = getGeetestConfig() diff --git a/core/api/src/app/comm/submit-feedback.ts b/core/api/src/app/comm/submit-feedback.ts index 1b3095196f..18bcf091db 100644 --- a/core/api/src/app/comm/submit-feedback.ts +++ b/core/api/src/app/comm/submit-feedback.ts @@ -1,9 +1,10 @@ -import { ConfigError, MATTERMOST_WEBHOOK_URL } from "@config" -import { MattermostError } from "@domain/comm/errors" -import { ErrorLevel } from "@domain/shared" -import { recordExceptionInCurrentSpan } from "@services/tracing" import axios from "axios" +import { ConfigError, MATTERMOST_WEBHOOK_URL } from "@/config" +import { MattermostError } from "@/domain/comm/errors" +import { ErrorLevel } from "@/domain/shared" +import { recordExceptionInCurrentSpan } from "@/services/tracing" + export const submitFeedback = async ({ feedback, accountId, diff --git a/core/api/src/app/errors.ts b/core/api/src/app/errors.ts index 64f1e878f4..46c160f5d0 100644 --- a/core/api/src/app/errors.ts +++ b/core/api/src/app/errors.ts @@ -1,30 +1,30 @@ -import * as SharedErrors from "@domain/shared/errors" -import * as DomainErrors from "@domain/errors" -import * as PaymentErrors from "@domain/payments/errors" -import * as LedgerErrors from "@domain/ledger/errors" -import * as CallbackErrors from "@domain/callback/errors" -import * as CommErrors from "@domain/comm/errors" -import * as OnChainErrors from "@domain/bitcoin/onchain/errors" -import * as LightningErrors from "@domain/bitcoin/lightning/errors" -import * as PriceServiceErrors from "@domain/price/errors" -import * as LockServiceErrors from "@domain/lock/errors" -import * as RateLimitServiceErrors from "@domain/rate-limit/errors" -import * as IpFetcherErrors from "@domain/ipfetcher/errors" -import * as AccountErrors from "@domain/accounts/errors" -import * as NotificationsErrors from "@domain/notifications/errors" -import * as CacheErrors from "@domain/cache/errors" -import * as PhoneProviderServiceErrors from "@domain/phone-provider/errors" -import * as DealerPriceErrors from "@domain/dealer-price/errors" -import * as PubSubErrors from "@domain/pubsub/errors" -import * as CaptchaErrors from "@domain/captcha/errors" -import * as AuthenticationErrors from "@domain/authentication/errors" -import * as UserErrors from "@domain/users/errors" -import * as WalletInvoiceErrors from "@domain/wallet-invoices/errors" +import * as SharedErrors from "@/domain/shared/errors" +import * as DomainErrors from "@/domain/errors" +import * as PaymentErrors from "@/domain/payments/errors" +import * as LedgerErrors from "@/domain/ledger/errors" +import * as CallbackErrors from "@/domain/callback/errors" +import * as CommErrors from "@/domain/comm/errors" +import * as OnChainErrors from "@/domain/bitcoin/onchain/errors" +import * as LightningErrors from "@/domain/bitcoin/lightning/errors" +import * as PriceServiceErrors from "@/domain/price/errors" +import * as LockServiceErrors from "@/domain/lock/errors" +import * as RateLimitServiceErrors from "@/domain/rate-limit/errors" +import * as IpFetcherErrors from "@/domain/ipfetcher/errors" +import * as AccountErrors from "@/domain/accounts/errors" +import * as NotificationsErrors from "@/domain/notifications/errors" +import * as CacheErrors from "@/domain/cache/errors" +import * as PhoneProviderServiceErrors from "@/domain/phone-provider/errors" +import * as DealerPriceErrors from "@/domain/dealer-price/errors" +import * as PubSubErrors from "@/domain/pubsub/errors" +import * as CaptchaErrors from "@/domain/captcha/errors" +import * as AuthenticationErrors from "@/domain/authentication/errors" +import * as UserErrors from "@/domain/users/errors" +import * as WalletInvoiceErrors from "@/domain/wallet-invoices/errors" -import * as LedgerFacadeErrors from "@services/ledger/domain/errors" -import * as KratosErrors from "@services/kratos/errors" -import * as BriaEventErrors from "@services/bria/errors" -import * as SvixErrors from "@services/svix/errors" +import * as LedgerFacadeErrors from "@/services/ledger/domain/errors" +import * as KratosErrors from "@/services/kratos/errors" +import * as BriaEventErrors from "@/services/bria/errors" +import * as SvixErrors from "@/services/svix/errors" export const ApplicationErrors = { ...SharedErrors, diff --git a/core/api/src/app/index.ts b/core/api/src/app/index.ts index b825ba2aa7..243fd1ed98 100644 --- a/core/api/src/app/index.ts +++ b/core/api/src/app/index.ts @@ -1,5 +1,3 @@ -import { wrapAsyncToRunInSpan } from "@services/tracing" - import * as AccountsMod from "./accounts" import * as AuthenticationMod from "./authentication" import * as AdminMod from "./admin" @@ -14,6 +12,8 @@ import * as WalletsMod from "./wallets" import * as PaymentsMod from "./payments" import * as SwapMod from "./swap" +import { wrapAsyncToRunInSpan } from "@/services/tracing" + const allFunctions = { Accounts: { ...AccountsMod }, Authentication: { ...AuthenticationMod }, diff --git a/core/api/src/app/lightning/delete-ln-payments.ts b/core/api/src/app/lightning/delete-ln-payments.ts index e75f0c3ab2..f6d43cd788 100644 --- a/core/api/src/app/lightning/delete-ln-payments.ts +++ b/core/api/src/app/lightning/delete-ln-payments.ts @@ -1,12 +1,12 @@ -import { UnknownLightningServiceError } from "@domain/bitcoin/lightning" -import { CouldNotFindLnPaymentFromHashError } from "@domain/errors" -import { LndService } from "@services/lnd" -import { LnPaymentsRepository } from "@services/mongoose" +import { UnknownLightningServiceError } from "@/domain/bitcoin/lightning" +import { CouldNotFindLnPaymentFromHashError } from "@/domain/errors" +import { LndService } from "@/services/lnd" +import { LnPaymentsRepository } from "@/services/mongoose" import { addAttributesToCurrentSpan, asyncRunInSpan, SemanticAttributes, -} from "@services/tracing" +} from "@/services/tracing" export const deleteLnPaymentsBefore = async ( timestamp: Date, diff --git a/core/api/src/app/lightning/get-balances.ts b/core/api/src/app/lightning/get-balances.ts index 9641132e0e..699b7cab5c 100644 --- a/core/api/src/app/lightning/get-balances.ts +++ b/core/api/src/app/lightning/get-balances.ts @@ -1,12 +1,12 @@ -import { SECS_PER_MIN } from "@config" +import { SECS_PER_MIN } from "@/config" -import { toSats } from "@domain/bitcoin" -import { CacheKeys } from "@domain/cache" -import { ErrorLevel } from "@domain/shared" +import { toSats } from "@/domain/bitcoin" +import { CacheKeys } from "@/domain/cache" +import { ErrorLevel } from "@/domain/shared" -import { LndService } from "@services/lnd" -import { RedisCacheService } from "@services/cache" -import { recordExceptionInCurrentSpan } from "@services/tracing" +import { LndService } from "@/services/lnd" +import { RedisCacheService } from "@/services/cache" +import { recordExceptionInCurrentSpan } from "@/services/tracing" const cache = RedisCacheService() diff --git a/core/api/src/app/lightning/get-held-invoices.ts b/core/api/src/app/lightning/get-held-invoices.ts index 6197bc2a35..f5af18914e 100644 --- a/core/api/src/app/lightning/get-held-invoices.ts +++ b/core/api/src/app/lightning/get-held-invoices.ts @@ -1,8 +1,8 @@ -import { ErrorLevel, WalletCurrency } from "@domain/shared" -import { DEFAULT_EXPIRATIONS } from "@domain/bitcoin/lightning/invoice-expiration" +import { ErrorLevel, WalletCurrency } from "@/domain/shared" +import { DEFAULT_EXPIRATIONS } from "@/domain/bitcoin/lightning/invoice-expiration" -import { LndService } from "@services/lnd" -import { recordExceptionInCurrentSpan } from "@services/tracing" +import { LndService } from "@/services/lnd" +import { recordExceptionInCurrentSpan } from "@/services/tracing" export const getHeldInvoicesCount = async (): Promise => { const offChainService = LndService() diff --git a/core/api/src/app/lightning/get-pending-htlc.ts b/core/api/src/app/lightning/get-pending-htlc.ts index b8c7df6cc9..6fa4266468 100644 --- a/core/api/src/app/lightning/get-pending-htlc.ts +++ b/core/api/src/app/lightning/get-pending-htlc.ts @@ -1,7 +1,7 @@ -import { ErrorLevel } from "@domain/shared" +import { ErrorLevel } from "@/domain/shared" -import { LndService } from "@services/lnd" -import { recordExceptionInCurrentSpan } from "@services/tracing" +import { LndService } from "@/services/lnd" +import { recordExceptionInCurrentSpan } from "@/services/tracing" export const getTotalPendingHtlcCount = async (): Promise => { const offChainService = LndService() diff --git a/core/api/src/app/lightning/list-nodes-pubkeys.ts b/core/api/src/app/lightning/list-nodes-pubkeys.ts index ff6235b7b4..ad9cc4cf45 100644 --- a/core/api/src/app/lightning/list-nodes-pubkeys.ts +++ b/core/api/src/app/lightning/list-nodes-pubkeys.ts @@ -1,4 +1,4 @@ -import { LndService } from "@services/lnd" +import { LndService } from "@/services/lnd" export const listNodesPubkeys = async (): Promise => { const offChainService = LndService() diff --git a/core/api/src/app/lightning/lookup-invoice-by-hash.ts b/core/api/src/app/lightning/lookup-invoice-by-hash.ts index 4dba1c9502..d8d1565ac7 100644 --- a/core/api/src/app/lightning/lookup-invoice-by-hash.ts +++ b/core/api/src/app/lightning/lookup-invoice-by-hash.ts @@ -1,6 +1,6 @@ -import { LndService } from "@services/lnd" -import { WalletInvoicesRepository } from "@services/mongoose" -import { RepositoryError } from "@domain/errors" +import { LndService } from "@/services/lnd" +import { WalletInvoicesRepository } from "@/services/mongoose" +import { RepositoryError } from "@/domain/errors" export const lookupInvoiceByHash = async ( paymentHash: PaymentHash, diff --git a/core/api/src/app/lightning/lookup-payment-by-hash.ts b/core/api/src/app/lightning/lookup-payment-by-hash.ts index f698d7c29d..5da9a486e7 100644 --- a/core/api/src/app/lightning/lookup-payment-by-hash.ts +++ b/core/api/src/app/lightning/lookup-payment-by-hash.ts @@ -1,4 +1,4 @@ -import { LndService } from "@services/lnd" +import { LndService } from "@/services/lnd" export const lookupPaymentByHash = async ( paymentHash: PaymentHash, diff --git a/core/api/src/app/lightning/payment-status-checker.ts b/core/api/src/app/lightning/payment-status-checker.ts index c24c5b2c42..bcc208b91a 100644 --- a/core/api/src/app/lightning/payment-status-checker.ts +++ b/core/api/src/app/lightning/payment-status-checker.ts @@ -1,6 +1,6 @@ -import { RepositoryError } from "@domain/errors" -import { decodeInvoice } from "@domain/bitcoin/lightning" -import { LedgerService } from "@services/ledger" +import { RepositoryError } from "@/domain/errors" +import { decodeInvoice } from "@/domain/bitcoin/lightning" +import { LedgerService } from "@/services/ledger" export const PaymentStatusChecker = async (uncheckedPaymentRequest: string) => { const decodedInvoice = decodeInvoice(uncheckedPaymentRequest) diff --git a/core/api/src/app/lightning/update-ln-payments.ts b/core/api/src/app/lightning/update-ln-payments.ts index 3ba6ced6e7..3276ade8b3 100644 --- a/core/api/src/app/lightning/update-ln-payments.ts +++ b/core/api/src/app/lightning/update-ln-payments.ts @@ -1,12 +1,12 @@ -import { UnknownLightningServiceError } from "@domain/bitcoin/lightning" -import { LndService } from "@services/lnd" -import { baseLogger } from "@services/logger" -import { LnPaymentsRepository } from "@services/mongoose/ln-payments" +import { UnknownLightningServiceError } from "@/domain/bitcoin/lightning" +import { LndService } from "@/services/lnd" +import { baseLogger } from "@/services/logger" +import { LnPaymentsRepository } from "@/services/mongoose/ln-payments" import { addAttributesToCurrentSpan, asyncRunInSpan, SemanticAttributes, -} from "@services/tracing" +} from "@/services/tracing" export const updateLnPayments = async (): Promise => { let processedLnPaymentsHashes: PaymentHash[] | ApplicationError = [] diff --git a/core/api/src/app/on-chain/index.ts b/core/api/src/app/on-chain/index.ts index e72256171a..d1db24f352 100644 --- a/core/api/src/app/on-chain/index.ts +++ b/core/api/src/app/on-chain/index.ts @@ -1,7 +1,7 @@ export * from "./rebalance-to-cold-wallet" export * from "./record-hot-to-cold-transfer" -import { OnChainService } from "@services/bria" +import { OnChainService } from "@/services/bria" export const getHotBalance = async (): Promise => { const service = OnChainService() diff --git a/core/api/src/app/on-chain/rebalance-to-cold-wallet.ts b/core/api/src/app/on-chain/rebalance-to-cold-wallet.ts index 4e69f1d3ca..8ea65a9909 100644 --- a/core/api/src/app/on-chain/rebalance-to-cold-wallet.ts +++ b/core/api/src/app/on-chain/rebalance-to-cold-wallet.ts @@ -1,17 +1,17 @@ -import { getColdStorageConfig } from "@config" +import { getOffChainBalance } from "../lightning/get-balances" -import { getCurrentPriceAsDisplayPriceRatio } from "@app/prices" +import { getColdStorageConfig } from "@/config" -import { toSats } from "@domain/bitcoin" -import { UsdDisplayCurrency } from "@domain/fiat" -import { RebalanceChecker } from "@domain/bitcoin/onchain" -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" +import { getCurrentPriceAsDisplayPriceRatio } from "@/app/prices" -import { LndService } from "@services/lnd" -import { OnChainService } from "@services/bria" -import { addAttributesToCurrentSpan } from "@services/tracing" +import { toSats } from "@/domain/bitcoin" +import { UsdDisplayCurrency } from "@/domain/fiat" +import { RebalanceChecker } from "@/domain/bitcoin/onchain" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" -import { getOffChainBalance } from "../lightning/get-balances" +import { LndService } from "@/services/lnd" +import { OnChainService } from "@/services/bria" +import { addAttributesToCurrentSpan } from "@/services/tracing" export const rebalanceToColdWallet = async (): Promise => { const coldStorageConfig = getColdStorageConfig() diff --git a/core/api/src/app/on-chain/record-hot-to-cold-transfer.ts b/core/api/src/app/on-chain/record-hot-to-cold-transfer.ts index 4af0723b06..386755a4d2 100644 --- a/core/api/src/app/on-chain/record-hot-to-cold-transfer.ts +++ b/core/api/src/app/on-chain/record-hot-to-cold-transfer.ts @@ -1,7 +1,7 @@ -import { toSats } from "@domain/bitcoin" -import { LedgerService } from "@services/ledger" -import { getCurrentPriceAsDisplayPriceRatio } from "@app/prices" -import { UsdDisplayCurrency } from "@domain/fiat" +import { toSats } from "@/domain/bitcoin" +import { LedgerService } from "@/services/ledger" +import { getCurrentPriceAsDisplayPriceRatio } from "@/app/prices" +import { UsdDisplayCurrency } from "@/domain/fiat" export const recordHotToColdTransfer = async ({ satoshis, diff --git a/core/api/src/app/payments/add-earn.ts b/core/api/src/app/payments/add-earn.ts index 9502e94765..049aa87cf9 100644 --- a/core/api/src/app/payments/add-earn.ts +++ b/core/api/src/app/payments/add-earn.ts @@ -1,5 +1,7 @@ -import { getRewardsConfig, OnboardingEarn } from "@config" -import { IPMetadataAuthorizer } from "@domain/accounts-ips/ip-metadata-authorizer" +import { intraledgerPaymentSendWalletIdForBtcWallet } from "./send-intraledger" + +import { getRewardsConfig, OnboardingEarn } from "@/config" +import { IPMetadataAuthorizer } from "@/domain/accounts-ips/ip-metadata-authorizer" import { InvalidIpMetadataError, InvalidQuizQuestionIdError, @@ -7,20 +9,18 @@ import { NoBtcWalletExistsForAccountError, UnauthorizedIPError, UnknownRepositoryError, -} from "@domain/errors" -import { InvalidPhoneForRewardError } from "@domain/users/errors" -import { WalletCurrency } from "@domain/shared" -import { PhoneMetadataAuthorizer } from "@domain/users" -import { getFunderWalletId } from "@services/ledger/caching" +} from "@/domain/errors" +import { InvalidPhoneForRewardError } from "@/domain/users/errors" +import { WalletCurrency } from "@/domain/shared" +import { PhoneMetadataAuthorizer } from "@/domain/users" +import { getFunderWalletId } from "@/services/ledger/caching" import { AccountsRepository, RewardsRepository, WalletsRepository, UsersRepository, -} from "@services/mongoose" -import { AccountsIpsRepository } from "@services/mongoose/accounts-ips" - -import { intraledgerPaymentSendWalletIdForBtcWallet } from "./send-intraledger" +} from "@/services/mongoose" +import { AccountsIpsRepository } from "@/services/mongoose/accounts-ips" export const addEarn = async ({ quizQuestionId: quizQuestionIdString, diff --git a/core/api/src/app/payments/get-protocol-fee.ts b/core/api/src/app/payments/get-protocol-fee.ts index e0168c4632..fb59179c9f 100644 --- a/core/api/src/app/payments/get-protocol-fee.ts +++ b/core/api/src/app/payments/get-protocol-fee.ts @@ -1,26 +1,26 @@ -import { decodeInvoice, defaultTimeToExpiryInSeconds } from "@domain/bitcoin/lightning" -import { checkedToWalletId } from "@domain/wallets" +import { PartialResult } from "../partial-result" + +import { constructPaymentFlowBuilder, getPriceRatioForLimits } from "./helpers" + +import { decodeInvoice, defaultTimeToExpiryInSeconds } from "@/domain/bitcoin/lightning" +import { checkedToWalletId } from "@/domain/wallets" import { LnPaymentRequestNonZeroAmountRequiredError, LnPaymentRequestZeroAmountRequiredError, SkipProbeForPubkeyError, -} from "@domain/payments" -import { LndService } from "@services/lnd" +} from "@/domain/payments" +import { LndService } from "@/services/lnd" -import { WalletsRepository, PaymentFlowStateRepository } from "@services/mongoose" -import { DealerPriceService } from "@services/dealer-price" -import { addAttributesToCurrentSpan } from "@services/tracing" +import { WalletsRepository, PaymentFlowStateRepository } from "@/services/mongoose" +import { DealerPriceService } from "@/services/dealer-price" +import { addAttributesToCurrentSpan } from "@/services/tracing" -import { validateIsBtcWallet, validateIsUsdWallet } from "@app/wallets" +import { validateIsBtcWallet, validateIsUsdWallet } from "@/app/wallets" import { checkIntraledgerLimits, checkTradeIntraAccountLimits, checkWithdrawalLimits, -} from "@app/accounts" - -import { PartialResult } from "../partial-result" - -import { constructPaymentFlowBuilder, getPriceRatioForLimits } from "./helpers" +} from "@/app/accounts" const getLightningFeeEstimation = async ({ walletId, diff --git a/core/api/src/app/payments/helpers.ts b/core/api/src/app/payments/helpers.ts index 8f339338d3..6aa04d6a46 100644 --- a/core/api/src/app/payments/helpers.ts +++ b/core/api/src/app/payments/helpers.ts @@ -1,16 +1,16 @@ -import { btcFromUsdMidPriceFn, usdFromBtcMidPriceFn } from "@app/prices" -import { addNewContact } from "@app/accounts/add-new-contact" -import { getValuesToSkipProbe, MIN_SATS_FOR_PRICE_RATIO_PRECISION } from "@config" -import { AlreadyPaidError } from "@domain/errors" -import { LightningPaymentFlowBuilder, WalletPriceRatio } from "@domain/payments" -import { WalletCurrency } from "@domain/shared" -import { LndService } from "@services/lnd" +import { btcFromUsdMidPriceFn, usdFromBtcMidPriceFn } from "@/app/prices" +import { addNewContact } from "@/app/accounts/add-new-contact" +import { getValuesToSkipProbe, MIN_SATS_FOR_PRICE_RATIO_PRECISION } from "@/config" +import { AlreadyPaidError } from "@/domain/errors" +import { LightningPaymentFlowBuilder, WalletPriceRatio } from "@/domain/payments" +import { WalletCurrency } from "@/domain/shared" +import { LndService } from "@/services/lnd" import { AccountsRepository, WalletInvoicesRepository, WalletsRepository, -} from "@services/mongoose" -import { addAttributesToCurrentSpan, wrapAsyncToRunInSpan } from "@services/tracing" +} from "@/services/mongoose" +import { addAttributesToCurrentSpan, wrapAsyncToRunInSpan } from "@/services/tracing" export const constructPaymentFlowBuilder = async < S extends WalletCurrency, diff --git a/core/api/src/app/payments/reimburse-failed-usd.ts b/core/api/src/app/payments/reimburse-failed-usd.ts index 7013397df3..933c807976 100644 --- a/core/api/src/app/payments/reimburse-failed-usd.ts +++ b/core/api/src/app/payments/reimburse-failed-usd.ts @@ -1,10 +1,10 @@ -import { CouldNotFindBtcWalletForAccountError } from "@domain/errors" -import { ErrorLevel, WalletCurrency } from "@domain/shared" +import { CouldNotFindBtcWalletForAccountError } from "@/domain/errors" +import { ErrorLevel, WalletCurrency } from "@/domain/shared" -import { AccountsRepository, WalletsRepository } from "@services/mongoose" -import * as LedgerFacade from "@services/ledger/facade" -import { MissingExpectedDisplayAmountsForTransactionError } from "@domain/ledger" -import { recordExceptionInCurrentSpan } from "@services/tracing" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" +import * as LedgerFacade from "@/services/ledger/facade" +import { MissingExpectedDisplayAmountsForTransactionError } from "@/domain/ledger" +import { recordExceptionInCurrentSpan } from "@/services/tracing" export const reimburseFailedUsdPayment = async < S extends WalletCurrency, diff --git a/core/api/src/app/payments/reimburse-fee.ts b/core/api/src/app/payments/reimburse-fee.ts index 8706332c07..ed5258a9c3 100644 --- a/core/api/src/app/payments/reimburse-fee.ts +++ b/core/api/src/app/payments/reimburse-fee.ts @@ -1,19 +1,19 @@ -import { DisplayAmountsConverter, displayAmountFromNumber } from "@domain/fiat" -import { FeeReimbursement } from "@domain/ledger/fee-reimbursement" +import { DisplayAmountsConverter, displayAmountFromNumber } from "@/domain/fiat" +import { FeeReimbursement } from "@/domain/ledger/fee-reimbursement" import { DisplayPriceRatio, WalletPriceRatio, toDisplayBaseAmount, -} from "@domain/payments" +} from "@/domain/payments" import { paymentAmountFromNumber, WalletCurrency, ZERO_CENTS, ZERO_SATS, -} from "@domain/shared" +} from "@/domain/shared" -import * as LedgerFacade from "@services/ledger/facade" -import { baseLogger } from "@services/logger" +import * as LedgerFacade from "@/services/ledger/facade" +import { baseLogger } from "@/services/logger" export const reimburseFee = async ({ paymentFlow, diff --git a/core/api/src/app/payments/send-intraledger.ts b/core/api/src/app/payments/send-intraledger.ts index 6e67febf11..0f88234e54 100644 --- a/core/api/src/app/payments/send-intraledger.ts +++ b/core/api/src/app/payments/send-intraledger.ts @@ -1,47 +1,47 @@ -import { getCallbackServiceConfig, getValuesToSkipProbe } from "@config" +import { addContactsAfterSend, getPriceRatioForLimits } from "./helpers" + +import { getCallbackServiceConfig, getValuesToSkipProbe } from "@/config" -import { checkIntraledgerLimits, checkTradeIntraAccountLimits } from "@app/accounts" +import { checkIntraledgerLimits, checkTradeIntraAccountLimits } from "@/app/accounts" import { btcFromUsdMidPriceFn, getCurrentPriceAsDisplayPriceRatio, usdFromBtcMidPriceFn, -} from "@app/prices" -import { removeDeviceTokens } from "@app/users/remove-device-tokens" -import { validateIsBtcWallet, validateIsUsdWallet } from "@app/wallets" +} from "@/app/prices" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" +import { validateIsBtcWallet, validateIsUsdWallet } from "@/app/wallets" import { InvalidLightningPaymentFlowBuilderStateError, LightningPaymentFlowBuilder, toDisplayBaseAmount, -} from "@domain/payments" -import { AccountLevel, AccountValidator } from "@domain/accounts" -import { DisplayAmountsConverter } from "@domain/fiat" -import { ErrorLevel, WalletCurrency } from "@domain/shared" -import { PaymentSendStatus } from "@domain/bitcoin/lightning" -import { ResourceExpiredLockServiceError } from "@domain/lock" -import { checkedToWalletId, SettlementMethod } from "@domain/wallets" -import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications" - -import { LockService } from "@services/lock" -import { LedgerService } from "@services/ledger" -import * as LedgerFacade from "@services/ledger/facade" -import { DealerPriceService } from "@services/dealer-price" +} from "@/domain/payments" +import { AccountLevel, AccountValidator } from "@/domain/accounts" +import { DisplayAmountsConverter } from "@/domain/fiat" +import { ErrorLevel, WalletCurrency } from "@/domain/shared" +import { PaymentSendStatus } from "@/domain/bitcoin/lightning" +import { ResourceExpiredLockServiceError } from "@/domain/lock" +import { checkedToWalletId, SettlementMethod } from "@/domain/wallets" +import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications" + +import { LockService } from "@/services/lock" +import { LedgerService } from "@/services/ledger" +import * as LedgerFacade from "@/services/ledger/facade" +import { DealerPriceService } from "@/services/dealer-price" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, -} from "@services/tracing" +} from "@/services/tracing" import { AccountsRepository, WalletsRepository, UsersRepository, -} from "@services/mongoose" -import { NotificationsService } from "@services/notifications" +} from "@/services/mongoose" +import { NotificationsService } from "@/services/notifications" -import { CallbackService } from "@services/svix" +import { CallbackService } from "@/services/svix" -import { CallbackEventType } from "@domain/callback" - -import { addContactsAfterSend, getPriceRatioForLimits } from "./helpers" +import { CallbackEventType } from "@/domain/callback" const dealer = DealerPriceService() diff --git a/core/api/src/app/payments/send-lightning.ts b/core/api/src/app/payments/send-lightning.ts index 5d1c6eecf5..0d7caa74e5 100644 --- a/core/api/src/app/payments/send-lightning.ts +++ b/core/api/src/app/payments/send-lightning.ts @@ -1,13 +1,21 @@ -import { AccountLevel, AccountValidator } from "@domain/accounts" +import { + constructPaymentFlowBuilder, + getPriceRatioForLimits, + addContactsAfterSend, +} from "./helpers" + +import { reimburseFee } from "./reimburse-fee" + +import { AccountLevel, AccountValidator } from "@/domain/accounts" import { decodeInvoice, defaultTimeToExpiryInSeconds, LnAlreadyPaidError, LnPaymentPendingError, PaymentSendStatus, -} from "@domain/bitcoin/lightning" -import { AlreadyPaidError, CouldNotFindLightningPaymentFlowError } from "@domain/errors" -import { DisplayAmountsConverter } from "@domain/fiat" +} from "@/domain/bitcoin/lightning" +import { AlreadyPaidError, CouldNotFindLightningPaymentFlowError } from "@/domain/errors" +import { DisplayAmountsConverter } from "@/domain/fiat" import { InvalidLightningPaymentFlowBuilderStateError, LnFees, @@ -16,20 +24,20 @@ import { LnPaymentRequestZeroAmountRequiredError, WalletPriceRatio, toDisplayBaseAmount, -} from "@domain/payments" +} from "@/domain/payments" import { WalletCurrency, ErrorLevel, checkedToBtcPaymentAmount, checkedToUsdPaymentAmount, -} from "@domain/shared" +} from "@/domain/shared" import { checkedToWalletId, PaymentInitiationMethod, SettlementMethod, -} from "@domain/wallets" +} from "@/domain/wallets" -import { LndService } from "@services/lnd" +import { LndService } from "@/services/lnd" import { LnPaymentsRepository, PaymentFlowStateRepository, @@ -37,42 +45,34 @@ import { WalletsRepository, UsersRepository, AccountsRepository, -} from "@services/mongoose" +} from "@/services/mongoose" -import { DealerPriceService } from "@services/dealer-price" -import { LedgerService } from "@services/ledger" -import { LockService } from "@services/lock" -import { NotificationsService } from "@services/notifications" +import { DealerPriceService } from "@/services/dealer-price" +import { LedgerService } from "@/services/ledger" +import { LockService } from "@/services/lock" +import { NotificationsService } from "@/services/notifications" -import * as LedgerFacade from "@services/ledger/facade" +import * as LedgerFacade from "@/services/ledger/facade" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, -} from "@services/tracing" +} from "@/services/tracing" import { checkIntraledgerLimits, checkTradeIntraAccountLimits, checkWithdrawalLimits, -} from "@app/accounts" -import { getCurrentPriceAsDisplayPriceRatio } from "@app/prices" -import { removeDeviceTokens } from "@app/users/remove-device-tokens" -import { validateIsBtcWallet, validateIsUsdWallet } from "@app/wallets" +} from "@/app/accounts" +import { getCurrentPriceAsDisplayPriceRatio } from "@/app/prices" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" +import { validateIsBtcWallet, validateIsUsdWallet } from "@/app/wallets" -import { ResourceExpiredLockServiceError } from "@domain/lock" -import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications" +import { ResourceExpiredLockServiceError } from "@/domain/lock" +import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications" -import { CallbackService } from "@services/svix" -import { getCallbackServiceConfig } from "@config" -import { CallbackEventType } from "@domain/callback" - -import { - constructPaymentFlowBuilder, - getPriceRatioForLimits, - addContactsAfterSend, -} from "./helpers" - -import { reimburseFee } from "./reimburse-fee" +import { CallbackService } from "@/services/svix" +import { getCallbackServiceConfig } from "@/config" +import { CallbackEventType } from "@/domain/callback" const dealer = DealerPriceService() const paymentFlowRepo = PaymentFlowStateRepository(defaultTimeToExpiryInSeconds) diff --git a/core/api/src/app/payments/send-on-chain.ts b/core/api/src/app/payments/send-on-chain.ts index d526cf6bba..7bb6ba4905 100644 --- a/core/api/src/app/payments/send-on-chain.ts +++ b/core/api/src/app/payments/send-on-chain.ts @@ -1,58 +1,58 @@ -import { NETWORK, getOnChainWalletConfig } from "@config" +import { getPriceRatioForLimits } from "./helpers" + +import { NETWORK, getOnChainWalletConfig } from "@/config" import { checkIntraledgerLimits, checkTradeIntraAccountLimits, checkWithdrawalLimits, -} from "@app/accounts" +} from "@/app/accounts" import { btcFromUsdMidPriceFn, getCurrentPriceAsDisplayPriceRatio, usdFromBtcMidPriceFn, -} from "@app/prices" -import { removeDeviceTokens } from "@app/users/remove-device-tokens" +} from "@/app/prices" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" import { getMinerFeeAndPaymentFlow, validateIsBtcWallet, validateIsUsdWallet, -} from "@app/wallets" - -import { AccountValidator } from "@domain/accounts" -import { PaymentSendStatus } from "@domain/bitcoin/lightning" -import { checkedToOnChainAddress } from "@domain/bitcoin/onchain" -import { CouldNotFindError, InsufficientBalanceError } from "@domain/errors" -import { DisplayAmountsConverter } from "@domain/fiat" -import { ResourceExpiredLockServiceError } from "@domain/lock" -import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications" +} from "@/app/wallets" + +import { AccountValidator } from "@/domain/accounts" +import { PaymentSendStatus } from "@/domain/bitcoin/lightning" +import { checkedToOnChainAddress } from "@/domain/bitcoin/onchain" +import { CouldNotFindError, InsufficientBalanceError } from "@/domain/errors" +import { DisplayAmountsConverter } from "@/domain/fiat" +import { ResourceExpiredLockServiceError } from "@/domain/lock" +import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications" import { InvalidLightningPaymentFlowBuilderStateError, WalletPriceRatio, toDisplayBaseAmount, -} from "@domain/payments" -import { OnChainPaymentFlowBuilder } from "@domain/payments/onchain-payment-flow-builder" -import { WalletCurrency } from "@domain/shared" +} from "@/domain/payments" +import { OnChainPaymentFlowBuilder } from "@/domain/payments/onchain-payment-flow-builder" +import { WalletCurrency } from "@/domain/shared" import { PaymentInputValidator, SettlementMethod, toWalletDescriptor, -} from "@domain/wallets" +} from "@/domain/wallets" -import * as LedgerFacade from "@services/ledger/facade" +import * as LedgerFacade from "@/services/ledger/facade" -import { OnChainService } from "@services/bria" -import { DealerPriceService } from "@services/dealer-price" -import { LedgerService } from "@services/ledger" -import { LockService } from "@services/lock" -import { baseLogger } from "@services/logger" +import { OnChainService } from "@/services/bria" +import { DealerPriceService } from "@/services/dealer-price" +import { LedgerService } from "@/services/ledger" +import { LockService } from "@/services/lock" +import { baseLogger } from "@/services/logger" import { AccountsRepository, UsersRepository, WalletsRepository, -} from "@services/mongoose" -import { NotificationsService } from "@services/notifications" -import { addAttributesToCurrentSpan } from "@services/tracing" - -import { getPriceRatioForLimits } from "./helpers" +} from "@/services/mongoose" +import { NotificationsService } from "@/services/notifications" +import { addAttributesToCurrentSpan } from "@/services/tracing" const { dustThreshold } = getOnChainWalletConfig() const dealer = DealerPriceService() diff --git a/core/api/src/app/payments/translations.ts b/core/api/src/app/payments/translations.ts index d2a0dd2ff6..30e356c053 100644 --- a/core/api/src/app/payments/translations.ts +++ b/core/api/src/app/payments/translations.ts @@ -1,11 +1,11 @@ -import { LedgerTransactionType } from "@domain/ledger" +import { LedgerTransactionType } from "@/domain/ledger" import { MissingPropsInTransactionForPaymentFlowError, NonLnPaymentTransactionForPaymentFlowError, PaymentFlow, -} from "@domain/payments" -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" -import { PaymentInitiationMethod, SettlementMethod } from "@domain/wallets" +} from "@/domain/payments" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" +import { PaymentInitiationMethod, SettlementMethod } from "@/domain/wallets" export const PaymentFlowFromLedgerTransaction = < S extends WalletCurrency, diff --git a/core/api/src/app/payments/update-pending-payments.ts b/core/api/src/app/payments/update-pending-payments.ts index 86e1e49184..c54e5656ff 100644 --- a/core/api/src/app/payments/update-pending-payments.ts +++ b/core/api/src/app/payments/update-pending-payments.ts @@ -1,32 +1,33 @@ -import { toSats } from "@domain/bitcoin" -import { defaultTimeToExpiryInSeconds, PaymentStatus } from "@domain/bitcoin/lightning" -import { InconsistentDataError } from "@domain/errors" +import { reimburseFee } from "./reimburse-fee" + +import { reimburseFailedUsdPayment } from "./reimburse-failed-usd" + +import { PaymentFlowFromLedgerTransaction } from "./translations" + +import { toSats } from "@/domain/bitcoin" +import { defaultTimeToExpiryInSeconds, PaymentStatus } from "@/domain/bitcoin/lightning" +import { InconsistentDataError } from "@/domain/errors" import { CouldNotFindTransactionError, inputAmountFromLedgerTransaction, LedgerTransactionType, MissingExpectedDisplayAmountsForTransactionError, MultiplePendingPaymentsForHashError, -} from "@domain/ledger" -import { MissingPropsInTransactionForPaymentFlowError } from "@domain/payments" -import { setErrorCritical, WalletCurrency } from "@domain/shared" - -import { LedgerService, getNonEndUserWalletIds } from "@services/ledger" -import * as LedgerFacade from "@services/ledger/facade" -import { LndService } from "@services/lnd" -import { LockService } from "@services/lock" +} from "@/domain/ledger" +import { MissingPropsInTransactionForPaymentFlowError } from "@/domain/payments" +import { setErrorCritical, WalletCurrency } from "@/domain/shared" + +import { LedgerService, getNonEndUserWalletIds } from "@/services/ledger" +import * as LedgerFacade from "@/services/ledger/facade" +import { LndService } from "@/services/lnd" +import { LockService } from "@/services/lock" import { AccountsRepository, PaymentFlowStateRepository, WalletsRepository, -} from "@services/mongoose" -import { addAttributesToCurrentSpan, wrapAsyncToRunInSpan } from "@services/tracing" -import { runInParallel } from "@utils" - -import { reimburseFee } from "./reimburse-fee" -import { reimburseFailedUsdPayment } from "./reimburse-failed-usd" - -import { PaymentFlowFromLedgerTransaction } from "./translations" +} from "@/services/mongoose" +import { addAttributesToCurrentSpan, wrapAsyncToRunInSpan } from "@/services/tracing" +import { runInParallel } from "@/utils" export const updatePendingPayments = async (logger: Logger): Promise => { const ledgerService = LedgerService() diff --git a/core/api/src/app/prices/get-current-price.ts b/core/api/src/app/prices/get-current-price.ts index 06aa4770a5..6e57ddcd61 100644 --- a/core/api/src/app/prices/get-current-price.ts +++ b/core/api/src/app/prices/get-current-price.ts @@ -1,13 +1,13 @@ -import { SECS_PER_10_MINS } from "@config" +import { SECS_PER_10_MINS } from "@/config" -import { CacheKeys } from "@domain/cache" -import { WalletCurrency } from "@domain/shared" -import { PriceNotAvailableError } from "@domain/price" -import { checkedToDisplayCurrency, getCurrencyMajorExponent } from "@domain/fiat" -import { toDisplayPriceRatio, toWalletPriceRatio } from "@domain/payments" +import { CacheKeys } from "@/domain/cache" +import { WalletCurrency } from "@/domain/shared" +import { PriceNotAvailableError } from "@/domain/price" +import { checkedToDisplayCurrency, getCurrencyMajorExponent } from "@/domain/fiat" +import { toDisplayPriceRatio, toWalletPriceRatio } from "@/domain/payments" -import { PriceService } from "@services/price" -import { LocalCacheService } from "@services/cache/local-cache" +import { PriceService } from "@/services/price" +import { LocalCacheService } from "@/services/cache/local-cache" export const getCurrentSatPrice = ({ currency, diff --git a/core/api/src/app/prices/get-price-history.ts b/core/api/src/app/prices/get-price-history.ts index 6aaa139cba..69f0ebb808 100644 --- a/core/api/src/app/prices/get-price-history.ts +++ b/core/api/src/app/prices/get-price-history.ts @@ -1,8 +1,8 @@ -import { CacheKeys } from "@domain/cache" -import { toSeconds } from "@domain/primitives" -import { PriceService } from "@services/price" -import { PriceHistoryNotAvailableError } from "@domain/price" -import { LocalCacheService } from "@services/cache/local-cache" +import { CacheKeys } from "@/domain/cache" +import { toSeconds } from "@/domain/primitives" +import { PriceService } from "@/services/price" +import { PriceHistoryNotAvailableError } from "@/domain/price" +import { LocalCacheService } from "@/services/cache/local-cache" export const getPriceHistory = async ({ range, diff --git a/core/api/src/app/prices/list-currencies.ts b/core/api/src/app/prices/list-currencies.ts index 9bf1e436b5..8f6e48ac49 100644 --- a/core/api/src/app/prices/list-currencies.ts +++ b/core/api/src/app/prices/list-currencies.ts @@ -1,7 +1,7 @@ -import { CacheKeys } from "@domain/cache" -import { PriceService } from "@services/price" -import { LocalCacheService } from "@services/cache/local-cache" -import { SECS_PER_10_MINS } from "@config" +import { CacheKeys } from "@/domain/cache" +import { PriceService } from "@/services/price" +import { LocalCacheService } from "@/services/cache/local-cache" +import { SECS_PER_10_MINS } from "@/config" export const listCurrencies = async (): Promise => { return LocalCacheService().getOrSet({ diff --git a/core/api/src/app/prices/mid-price.ts b/core/api/src/app/prices/mid-price.ts index 425d1ee36f..d6193dbc36 100644 --- a/core/api/src/app/prices/mid-price.ts +++ b/core/api/src/app/prices/mid-price.ts @@ -1,17 +1,17 @@ -import { getDealerConfig } from "@config" +import { getCurrentPriceAsWalletPriceRatio } from "./get-current-price" + +import { getDealerConfig } from "@/config" -import { UsdDisplayCurrency } from "@domain/fiat" -import { ErrorLevel, ExchangeCurrencyUnit, WalletCurrency } from "@domain/shared" +import { UsdDisplayCurrency } from "@/domain/fiat" +import { ErrorLevel, ExchangeCurrencyUnit, WalletCurrency } from "@/domain/shared" import { addAttributesToCurrentSpan, asyncRunInSpan, recordExceptionInCurrentSpan, SemanticAttributes, -} from "@services/tracing" -import { DealerPriceService } from "@services/dealer-price" - -import { getCurrentPriceAsWalletPriceRatio } from "./get-current-price" +} from "@/services/tracing" +import { DealerPriceService } from "@/services/dealer-price" const usdHedgeEnabled = getDealerConfig().usd.hedgingEnabled const dealer = DealerPriceService() diff --git a/core/api/src/app/swap/get-active-loopd.ts b/core/api/src/app/swap/get-active-loopd.ts index a7ddde6054..f23a64c671 100644 --- a/core/api/src/app/swap/get-active-loopd.ts +++ b/core/api/src/app/swap/get-active-loopd.ts @@ -1,6 +1,6 @@ -import { NETWORK, getLoopConfig, getSwapConfig } from "@config" -import { SwapErrorNoActiveLoopdNode } from "@domain/swap/errors" -import { getActiveLnd } from "@services/lnd/config" +import { NETWORK, getLoopConfig, getSwapConfig } from "@/config" +import { SwapErrorNoActiveLoopdNode } from "@/domain/swap/errors" +import { getActiveLnd } from "@/services/lnd/config" export const getActiveLoopd = (): LoopdConfig => { const activeOffChainNode = getActiveLnd() diff --git a/core/api/src/app/swap/swap-listener.ts b/core/api/src/app/swap/swap-listener.ts index 820270ff39..4422533694 100644 --- a/core/api/src/app/swap/swap-listener.ts +++ b/core/api/src/app/swap/swap-listener.ts @@ -1,8 +1,8 @@ -import { admin as LedgerAdmin } from "@services/ledger/admin" -import { WalletCurrency } from "@domain/shared" -import { SwapState, SwapType } from "@domain/swap" -import { addAttributesToCurrentSpan } from "@services/tracing" -import { DuplicateError } from "@domain/errors" +import { admin as LedgerAdmin } from "@/services/ledger/admin" +import { WalletCurrency } from "@/domain/shared" +import { SwapState, SwapType } from "@/domain/swap" +import { addAttributesToCurrentSpan } from "@/services/tracing" +import { DuplicateError } from "@/domain/errors" export const handleSwapOutCompleted = async (swapStatus: SwapStatusResultWrapper) => { if (swapStatus.parsedSwapData) { diff --git a/core/api/src/app/swap/swap-out.ts b/core/api/src/app/swap/swap-out.ts index cf373cd21a..00e48a8791 100644 --- a/core/api/src/app/swap/swap-out.ts +++ b/core/api/src/app/swap/swap-out.ts @@ -1,15 +1,15 @@ -import { getSwapConfig } from "@config" -import { NoOutboundLiquidityForSwapError, SwapServiceError } from "@domain/swap/errors" -import { OnChainService } from "@services/bria" -import { SwapOutChecker } from "@domain/swap" -import { baseLogger } from "@services/logger" -import { LoopService } from "@services/loopd" -import { addAttributesToCurrentSpan } from "@services/tracing" -import { LndService } from "@services/lnd" +import { getActiveLoopd } from "./get-active-loopd" -import { WalletCurrency } from "@domain/shared" +import { getSwapConfig } from "@/config" +import { NoOutboundLiquidityForSwapError, SwapServiceError } from "@/domain/swap/errors" +import { OnChainService } from "@/services/bria" +import { SwapOutChecker } from "@/domain/swap" +import { baseLogger } from "@/services/logger" +import { LoopService } from "@/services/loopd" +import { addAttributesToCurrentSpan } from "@/services/tracing" +import { LndService } from "@/services/lnd" -import { getActiveLoopd } from "./get-active-loopd" +import { WalletCurrency } from "@/domain/shared" const logger = baseLogger.child({ module: "swap" }) diff --git a/core/api/src/app/transactions/get-transactions-metadata-by-ids.ts b/core/api/src/app/transactions/get-transactions-metadata-by-ids.ts index e017eb02e3..89e85c0451 100644 --- a/core/api/src/app/transactions/get-transactions-metadata-by-ids.ts +++ b/core/api/src/app/transactions/get-transactions-metadata-by-ids.ts @@ -1,4 +1,4 @@ -import { TransactionsMetadataRepository } from "@services/ledger/services" +import { TransactionsMetadataRepository } from "@/services/ledger/services" export const getTransactionsMetadataByIds = async ( ids: LedgerTransactionId[], diff --git a/core/api/src/app/users/add-device-token.ts b/core/api/src/app/users/add-device-token.ts index cc5a97c415..437a440828 100644 --- a/core/api/src/app/users/add-device-token.ts +++ b/core/api/src/app/users/add-device-token.ts @@ -1,5 +1,5 @@ -import { checkedToDeviceToken } from "@domain/users" -import { UsersRepository } from "@services/mongoose" +import { checkedToDeviceToken } from "@/domain/users" +import { UsersRepository } from "@/services/mongoose" export const addDeviceToken = async ({ userId, diff --git a/core/api/src/app/users/index.ts b/core/api/src/app/users/index.ts index 48731d07d4..8c5295ec47 100644 --- a/core/api/src/app/users/index.ts +++ b/core/api/src/app/users/index.ts @@ -1,4 +1,4 @@ -import { UsersRepository } from "@services/mongoose" +import { UsersRepository } from "@/services/mongoose" export * from "./update-language" export * from "./add-device-token" diff --git a/core/api/src/app/users/remove-device-tokens.ts b/core/api/src/app/users/remove-device-tokens.ts index 58092a56c6..41fe4a4460 100644 --- a/core/api/src/app/users/remove-device-tokens.ts +++ b/core/api/src/app/users/remove-device-tokens.ts @@ -1,4 +1,4 @@ -import { UsersRepository } from "@services/mongoose" +import { UsersRepository } from "@/services/mongoose" export const removeDeviceTokens = async ({ userId, diff --git a/core/api/src/app/users/update-language.ts b/core/api/src/app/users/update-language.ts index a4f0f1f6d7..69ca6f4a79 100644 --- a/core/api/src/app/users/update-language.ts +++ b/core/api/src/app/users/update-language.ts @@ -1,5 +1,5 @@ -import { checkedToLanguage } from "@domain/users" -import { UsersRepository } from "@services/mongoose" +import { checkedToLanguage } from "@/domain/users" +import { UsersRepository } from "@/services/mongoose" export const updateLanguage = async ({ userId, diff --git a/core/api/src/app/wallets/add-invoice-for-wallet.ts b/core/api/src/app/wallets/add-invoice-for-wallet.ts index efc3ed3c0e..9a9a2dc3c8 100644 --- a/core/api/src/app/wallets/add-invoice-for-wallet.ts +++ b/core/api/src/app/wallets/add-invoice-for-wallet.ts @@ -1,23 +1,23 @@ -import { AccountValidator } from "@domain/accounts" -import { toSats } from "@domain/bitcoin" -import { checkedToWalletId } from "@domain/wallets" -import { RateLimitConfig } from "@domain/rate-limit" -import { checkedToMinutes } from "@domain/primitives" -import { RateLimiterExceededError } from "@domain/rate-limit/errors" -import { DEFAULT_EXPIRATIONS } from "@domain/bitcoin/lightning/invoice-expiration" -import { WalletInvoiceBuilder } from "@domain/wallet-invoices/wallet-invoice-builder" -import { checkedToBtcPaymentAmount, checkedToUsdPaymentAmount } from "@domain/shared" - -import { LndService } from "@services/lnd" -import { consumeLimiter } from "@services/rate-limit" -import { DealerPriceService } from "@services/dealer-price" +import { validateIsBtcWallet, validateIsUsdWallet } from "./validate" + +import { AccountValidator } from "@/domain/accounts" +import { toSats } from "@/domain/bitcoin" +import { checkedToWalletId } from "@/domain/wallets" +import { RateLimitConfig } from "@/domain/rate-limit" +import { checkedToMinutes } from "@/domain/primitives" +import { RateLimiterExceededError } from "@/domain/rate-limit/errors" +import { DEFAULT_EXPIRATIONS } from "@/domain/bitcoin/lightning/invoice-expiration" +import { WalletInvoiceBuilder } from "@/domain/wallet-invoices/wallet-invoice-builder" +import { checkedToBtcPaymentAmount, checkedToUsdPaymentAmount } from "@/domain/shared" + +import { LndService } from "@/services/lnd" +import { consumeLimiter } from "@/services/rate-limit" +import { DealerPriceService } from "@/services/dealer-price" import { AccountsRepository, WalletInvoicesRepository, WalletsRepository, -} from "@services/mongoose" - -import { validateIsBtcWallet, validateIsUsdWallet } from "./validate" +} from "@/services/mongoose" const defaultBtcExpiration = DEFAULT_EXPIRATIONS["BTC"].delayMinutes const defaultUsdExpiration = DEFAULT_EXPIRATIONS["USD"].delayMinutes diff --git a/core/api/src/app/wallets/add-pending-on-chain-transaction.ts b/core/api/src/app/wallets/add-pending-on-chain-transaction.ts index 53f5ed07cf..88075f4882 100644 --- a/core/api/src/app/wallets/add-pending-on-chain-transaction.ts +++ b/core/api/src/app/wallets/add-pending-on-chain-transaction.ts @@ -1,29 +1,29 @@ -import { getFeesConfig, getOnChainWalletConfig } from "@config" +import { getFeesConfig, getOnChainWalletConfig } from "@/config" -import { removeDeviceTokens } from "@app/users/remove-device-tokens" -import { getCurrentPriceAsDisplayPriceRatio, usdFromBtcMidPriceFn } from "@app/prices" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" +import { getCurrentPriceAsDisplayPriceRatio, usdFromBtcMidPriceFn } from "@/app/prices" import { DepositFeeCalculator, PaymentInitiationMethod, SettlementMethod, -} from "@domain/wallets" -import { WalletAddressReceiver } from "@domain/wallet-on-chain/wallet-address-receiver" -import { DuplicateKeyForPersistError, LessThanDustThresholdError } from "@domain/errors" -import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications" +} from "@/domain/wallets" +import { WalletAddressReceiver } from "@/domain/wallet-on-chain/wallet-address-receiver" +import { DuplicateKeyForPersistError, LessThanDustThresholdError } from "@/domain/errors" +import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications" import { AccountsRepository, UsersRepository, WalletOnChainPendingReceiveRepository, WalletsRepository, -} from "@services/mongoose" -import { LockService } from "@services/lock" -import { baseLogger } from "@services/logger" -import { LedgerService } from "@services/ledger" -import { DealerPriceService } from "@services/dealer-price" -import { NotificationsService } from "@services/notifications" -import { DisplayAmountsConverter } from "@domain/fiat/display-amounts-converter" +} from "@/services/mongoose" +import { LockService } from "@/services/lock" +import { baseLogger } from "@/services/logger" +import { LedgerService } from "@/services/ledger" +import { DealerPriceService } from "@/services/dealer-price" +import { NotificationsService } from "@/services/notifications" +import { DisplayAmountsConverter } from "@/domain/fiat/display-amounts-converter" const dealer = DealerPriceService() const { dustThreshold } = getOnChainWalletConfig() diff --git a/core/api/src/app/wallets/add-settled-on-chain-transaction.ts b/core/api/src/app/wallets/add-settled-on-chain-transaction.ts index 3c049f67a9..b7ab283bb0 100644 --- a/core/api/src/app/wallets/add-settled-on-chain-transaction.ts +++ b/core/api/src/app/wallets/add-settled-on-chain-transaction.ts @@ -1,32 +1,33 @@ import crypto from "crypto" -import { getFeesConfig, getOnChainWalletConfig } from "@config" +import { getLastOnChainAddress } from "./get-last-on-chain-address" + +import { createOnChainAddress } from "./create-on-chain-address" + +import { getFeesConfig, getOnChainWalletConfig } from "@/config" -import { removeDeviceTokens } from "@app/users/remove-device-tokens" -import { getCurrentPriceAsDisplayPriceRatio, usdFromBtcMidPriceFn } from "@app/prices" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" +import { getCurrentPriceAsDisplayPriceRatio, usdFromBtcMidPriceFn } from "@/app/prices" -import { DepositFeeCalculator } from "@domain/wallets" -import { DisplayAmountsConverter } from "@domain/fiat" -import { CouldNotFindError, LessThanDustThresholdError } from "@domain/errors" -import { WalletAddressReceiver } from "@domain/wallet-on-chain/wallet-address-receiver" -import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications" -import { toDisplayBaseAmount } from "@domain/payments" +import { DepositFeeCalculator } from "@/domain/wallets" +import { DisplayAmountsConverter } from "@/domain/fiat" +import { CouldNotFindError, LessThanDustThresholdError } from "@/domain/errors" +import { WalletAddressReceiver } from "@/domain/wallet-on-chain/wallet-address-receiver" +import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications" +import { toDisplayBaseAmount } from "@/domain/payments" import { AccountsRepository, UsersRepository, WalletOnChainPendingReceiveRepository, WalletsRepository, -} from "@services/mongoose" -import { LockService } from "@services/lock" -import { baseLogger } from "@services/logger" -import { LedgerService } from "@services/ledger" -import * as LedgerFacade from "@services/ledger/facade" -import { DealerPriceService } from "@services/dealer-price" -import { NotificationsService } from "@services/notifications" - -import { getLastOnChainAddress } from "./get-last-on-chain-address" -import { createOnChainAddress } from "./create-on-chain-address" +} from "@/services/mongoose" +import { LockService } from "@/services/lock" +import { baseLogger } from "@/services/logger" +import { LedgerService } from "@/services/ledger" +import * as LedgerFacade from "@/services/ledger/facade" +import { DealerPriceService } from "@/services/dealer-price" +import { NotificationsService } from "@/services/notifications" const ledger = LedgerService() const dealer = DealerPriceService() diff --git a/core/api/src/app/wallets/create-on-chain-address.ts b/core/api/src/app/wallets/create-on-chain-address.ts index 3a508ce981..ed68283dcd 100644 --- a/core/api/src/app/wallets/create-on-chain-address.ts +++ b/core/api/src/app/wallets/create-on-chain-address.ts @@ -1,15 +1,15 @@ -import { AccountValidator } from "@domain/accounts" -import { OnChainAddressNotFoundError } from "@domain/bitcoin/onchain" -import { RateLimitConfig } from "@domain/rate-limit" -import { RateLimiterExceededError } from "@domain/rate-limit/errors" +import { AccountValidator } from "@/domain/accounts" +import { OnChainAddressNotFoundError } from "@/domain/bitcoin/onchain" +import { RateLimitConfig } from "@/domain/rate-limit" +import { RateLimiterExceededError } from "@/domain/rate-limit/errors" -import { OnChainService } from "@services/bria" +import { OnChainService } from "@/services/bria" import { AccountsRepository, WalletOnChainAddressesRepository, WalletsRepository, -} from "@services/mongoose" -import { consumeLimiter } from "@services/rate-limit" +} from "@/services/mongoose" +import { consumeLimiter } from "@/services/rate-limit" export const createOnChainAddress = async ({ walletId, diff --git a/core/api/src/app/wallets/get-balance-for-wallet.ts b/core/api/src/app/wallets/get-balance-for-wallet.ts index e52394757e..58274bab16 100644 --- a/core/api/src/app/wallets/get-balance-for-wallet.ts +++ b/core/api/src/app/wallets/get-balance-for-wallet.ts @@ -1,4 +1,4 @@ -import { LedgerService } from "@services/ledger" +import { LedgerService } from "@/services/ledger" export const getBalanceForWallet = async ({ walletId, diff --git a/core/api/src/app/wallets/get-last-on-chain-address.ts b/core/api/src/app/wallets/get-last-on-chain-address.ts index bd1ba0d0bf..e56202e2e4 100644 --- a/core/api/src/app/wallets/get-last-on-chain-address.ts +++ b/core/api/src/app/wallets/get-last-on-chain-address.ts @@ -1,12 +1,12 @@ -import { AccountValidator } from "@domain/accounts" -import { CouldNotFindError } from "@domain/errors" +import { createOnChainAddress } from "./create-on-chain-address" + +import { AccountValidator } from "@/domain/accounts" +import { CouldNotFindError } from "@/domain/errors" import { AccountsRepository, WalletOnChainAddressesRepository, WalletsRepository, -} from "@services/mongoose" - -import { createOnChainAddress } from "./create-on-chain-address" +} from "@/services/mongoose" export const getLastOnChainAddress = async ( walletId: WalletId, diff --git a/core/api/src/app/wallets/get-on-chain-fee.ts b/core/api/src/app/wallets/get-on-chain-fee.ts index dec28176d1..5e8f73df92 100644 --- a/core/api/src/app/wallets/get-on-chain-fee.ts +++ b/core/api/src/app/wallets/get-on-chain-fee.ts @@ -1,26 +1,26 @@ -import { btcFromUsdMidPriceFn, usdFromBtcMidPriceFn } from "@app/prices" +import { validateIsBtcWallet, validateIsUsdWallet } from "./validate" + +import { btcFromUsdMidPriceFn, usdFromBtcMidPriceFn } from "@/app/prices" -import { getOnChainWalletConfig, NETWORK } from "@config" +import { getOnChainWalletConfig, NETWORK } from "@/config" -import { checkedToOnChainAddress, PayoutSpeed } from "@domain/bitcoin/onchain" -import { CouldNotFindError } from "@domain/errors" -import { OnChainPaymentFlowBuilder } from "@domain/payments/onchain-payment-flow-builder" +import { checkedToOnChainAddress, PayoutSpeed } from "@/domain/bitcoin/onchain" +import { CouldNotFindError } from "@/domain/errors" +import { OnChainPaymentFlowBuilder } from "@/domain/payments/onchain-payment-flow-builder" import { WalletCurrency, checkedToBtcPaymentAmount, checkedToUsdPaymentAmount, -} from "@domain/shared" -import { checkedToWalletId } from "@domain/wallets" +} from "@/domain/shared" +import { checkedToWalletId } from "@/domain/wallets" -import { DealerPriceService } from "@services/dealer-price" -import { LedgerService } from "@services/ledger" -import * as LedgerFacade from "@services/ledger/facade" -import { AccountsRepository, WalletsRepository } from "@services/mongoose" -import { addAttributesToCurrentSpan } from "@services/tracing" +import { DealerPriceService } from "@/services/dealer-price" +import { LedgerService } from "@/services/ledger" +import * as LedgerFacade from "@/services/ledger/facade" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" +import { addAttributesToCurrentSpan } from "@/services/tracing" -import { OnChainService } from "@services/bria" - -import { validateIsBtcWallet, validateIsUsdWallet } from "./validate" +import { OnChainService } from "@/services/bria" const { dustThreshold } = getOnChainWalletConfig() const dealer = DealerPriceService() diff --git a/core/api/src/app/wallets/get-pending-onchain-balance-for-wallet.ts b/core/api/src/app/wallets/get-pending-onchain-balance-for-wallet.ts index 5018a0f268..140223e949 100644 --- a/core/api/src/app/wallets/get-pending-onchain-balance-for-wallet.ts +++ b/core/api/src/app/wallets/get-pending-onchain-balance-for-wallet.ts @@ -1,11 +1,11 @@ import { CouldNotFindError, MultipleCurrenciesForSingleCurrencyOperationError, -} from "@domain/errors" +} from "@/domain/errors" -import { WalletOnChainPendingReceiveRepository } from "@services/mongoose" -import { IncomingOnChainTxHandler } from "@domain/bitcoin/onchain/incoming-tx-handler" -import { WalletCurrency, ZERO_CENTS, ZERO_SATS } from "@domain/shared" +import { WalletOnChainPendingReceiveRepository } from "@/services/mongoose" +import { IncomingOnChainTxHandler } from "@/domain/bitcoin/onchain/incoming-tx-handler" +import { WalletCurrency, ZERO_CENTS, ZERO_SATS } from "@/domain/shared" export const getPendingOnChainBalanceForWallets = async ( wallets: Wallet[], diff --git a/core/api/src/app/wallets/get-transaction-by-id.ts b/core/api/src/app/wallets/get-transaction-by-id.ts index f684c7cff1..b6a2143183 100644 --- a/core/api/src/app/wallets/get-transaction-by-id.ts +++ b/core/api/src/app/wallets/get-transaction-by-id.ts @@ -1,8 +1,8 @@ -import { memoSharingConfig } from "@config" -import { WalletTransactionHistory } from "@domain/wallets" -import { checkedToLedgerTransactionId } from "@domain/ledger" +import { memoSharingConfig } from "@/config" +import { WalletTransactionHistory } from "@/domain/wallets" +import { checkedToLedgerTransactionId } from "@/domain/ledger" -import { getNonEndUserWalletIds, LedgerService } from "@services/ledger" +import { getNonEndUserWalletIds, LedgerService } from "@/services/ledger" export const getTransactionById = async ( id: string, diff --git a/core/api/src/app/wallets/get-transactions-by-addresses.ts b/core/api/src/app/wallets/get-transactions-by-addresses.ts index 8cb19246f1..fc89221ac6 100644 --- a/core/api/src/app/wallets/get-transactions-by-addresses.ts +++ b/core/api/src/app/wallets/get-transactions-by-addresses.ts @@ -1,12 +1,12 @@ -import { memoSharingConfig } from "@config" -import { PartialResult } from "@app/partial-result" +import { memoSharingConfig } from "@/config" +import { PartialResult } from "@/app/partial-result" -import { LedgerError } from "@domain/ledger" -import { WalletTransactionHistory } from "@domain/wallets" -import { CouldNotFindError } from "@domain/errors" +import { LedgerError } from "@/domain/ledger" +import { WalletTransactionHistory } from "@/domain/wallets" +import { CouldNotFindError } from "@/domain/errors" -import { getNonEndUserWalletIds, LedgerService } from "@services/ledger" -import { WalletOnChainPendingReceiveRepository } from "@services/mongoose" +import { getNonEndUserWalletIds, LedgerService } from "@/services/ledger" +import { WalletOnChainPendingReceiveRepository } from "@/services/mongoose" export const getTransactionsForWalletsByAddresses = async ({ wallets, diff --git a/core/api/src/app/wallets/get-transactions-by-hash.ts b/core/api/src/app/wallets/get-transactions-by-hash.ts index 6bdbba5169..38ebd41b03 100644 --- a/core/api/src/app/wallets/get-transactions-by-hash.ts +++ b/core/api/src/app/wallets/get-transactions-by-hash.ts @@ -1,7 +1,7 @@ -import { memoSharingConfig } from "@config" -import { WalletTransactionHistory } from "@domain/wallets" +import { memoSharingConfig } from "@/config" +import { WalletTransactionHistory } from "@/domain/wallets" -import { getNonEndUserWalletIds, LedgerService } from "@services/ledger" +import { getNonEndUserWalletIds, LedgerService } from "@/services/ledger" export const getTransactionsByHash = async ( hash: PaymentHash | OnChainTxHash, diff --git a/core/api/src/app/wallets/get-transactions-for-wallet.ts b/core/api/src/app/wallets/get-transactions-for-wallet.ts index 20df1c9011..56b8799145 100644 --- a/core/api/src/app/wallets/get-transactions-for-wallet.ts +++ b/core/api/src/app/wallets/get-transactions-for-wallet.ts @@ -1,12 +1,12 @@ -import { memoSharingConfig } from "@config" -import { PartialResult } from "@app/partial-result" +import { memoSharingConfig } from "@/config" +import { PartialResult } from "@/app/partial-result" -import { LedgerError } from "@domain/ledger" -import { WalletTransactionHistory } from "@domain/wallets" -import { CouldNotFindError } from "@domain/errors" +import { LedgerError } from "@/domain/ledger" +import { WalletTransactionHistory } from "@/domain/wallets" +import { CouldNotFindError } from "@/domain/errors" -import { getNonEndUserWalletIds, LedgerService } from "@services/ledger" -import { WalletOnChainPendingReceiveRepository } from "@services/mongoose" +import { getNonEndUserWalletIds, LedgerService } from "@/services/ledger" +import { WalletOnChainPendingReceiveRepository } from "@/services/mongoose" export const getTransactionsForWallets = async ({ wallets, diff --git a/core/api/src/app/wallets/index.ts b/core/api/src/app/wallets/index.ts index 4b52d39f33..85bfd63832 100644 --- a/core/api/src/app/wallets/index.ts +++ b/core/api/src/app/wallets/index.ts @@ -17,7 +17,7 @@ export * from "./update-legacy-on-chain-receipt" export * from "./update-pending-invoices" export * from "./validate" -import { WalletsRepository } from "@services/mongoose" +import { WalletsRepository } from "@/services/mongoose" export const getWallet = async (walletId: WalletId) => { const wallets = WalletsRepository() diff --git a/core/api/src/app/wallets/register-broadcasted-payout-txn.ts b/core/api/src/app/wallets/register-broadcasted-payout-txn.ts index a03e4e464b..a15bba60b5 100644 --- a/core/api/src/app/wallets/register-broadcasted-payout-txn.ts +++ b/core/api/src/app/wallets/register-broadcasted-payout-txn.ts @@ -1,4 +1,4 @@ -import * as LedgerFacade from "@services/ledger/facade" +import * as LedgerFacade from "@/services/ledger/facade" export const registerBroadcastedPayout = async ({ payoutId, diff --git a/core/api/src/app/wallets/remove-pending-on-chain-transaction.ts b/core/api/src/app/wallets/remove-pending-on-chain-transaction.ts index 8c40801805..3360f454fb 100644 --- a/core/api/src/app/wallets/remove-pending-on-chain-transaction.ts +++ b/core/api/src/app/wallets/remove-pending-on-chain-transaction.ts @@ -1,8 +1,8 @@ -import { CouldNotFindWalletOnChainPendingReceiveError } from "@domain/errors" +import { CouldNotFindWalletOnChainPendingReceiveError } from "@/domain/errors" import { WalletOnChainPendingReceiveRepository, WalletsRepository, -} from "@services/mongoose" +} from "@/services/mongoose" export const removePendingTransaction = async ({ txId, diff --git a/core/api/src/app/wallets/settle-payout-txn.ts b/core/api/src/app/wallets/settle-payout-txn.ts index 2d5c7a6d65..fd7c3de010 100644 --- a/core/api/src/app/wallets/settle-payout-txn.ts +++ b/core/api/src/app/wallets/settle-payout-txn.ts @@ -1,17 +1,17 @@ -import { removeDeviceTokens } from "@app/users/remove-device-tokens" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" -import { displayAmountFromNumber } from "@domain/fiat" -import { InvalidLedgerTransactionStateError } from "@domain/errors" -import { WalletCurrency, paymentAmountFromNumber } from "@domain/shared" -import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications" +import { displayAmountFromNumber } from "@/domain/fiat" +import { InvalidLedgerTransactionStateError } from "@/domain/errors" +import { WalletCurrency, paymentAmountFromNumber } from "@/domain/shared" +import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications" -import * as LedgerFacade from "@services/ledger/facade" +import * as LedgerFacade from "@/services/ledger/facade" import { AccountsRepository, UsersRepository, WalletsRepository, -} from "@services/mongoose" -import { NotificationsService } from "@services/notifications" +} from "@/services/mongoose" +import { NotificationsService } from "@/services/notifications" export const settlePayout = async ( payoutId: PayoutId, diff --git a/core/api/src/app/wallets/update-legacy-on-chain-receipt.ts b/core/api/src/app/wallets/update-legacy-on-chain-receipt.ts index 19804ba2b9..78c1496942 100644 --- a/core/api/src/app/wallets/update-legacy-on-chain-receipt.ts +++ b/core/api/src/app/wallets/update-legacy-on-chain-receipt.ts @@ -1,29 +1,29 @@ +import { addSettledTransaction } from "./add-settled-on-chain-transaction" + import { NETWORK, ONCHAIN_MIN_CONFIRMATIONS, ONCHAIN_SCAN_DEPTH, SECS_PER_10_MINS, -} from "@config" +} from "@/config" -import { getCurrentPriceAsDisplayPriceRatio } from "@app/prices" +import { getCurrentPriceAsDisplayPriceRatio } from "@/app/prices" -import { TxDecoder } from "@domain/bitcoin/onchain" -import { CacheKeys } from "@domain/cache" -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" +import { TxDecoder } from "@/domain/bitcoin/onchain" +import { CacheKeys } from "@/domain/cache" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" import { CouldNotFindWalletFromOnChainAddressError, CouldNotFindWalletFromOnChainAddressesError, -} from "@domain/errors" -import { UsdDisplayCurrency } from "@domain/fiat" - -import { LockService } from "@services/lock" -import { LedgerService } from "@services/ledger" -import { RedisCacheService } from "@services/cache" -import { WalletsRepository } from "@services/mongoose" -import { LndService } from "@services/lnd" -import { recordExceptionInCurrentSpan } from "@services/tracing" - -import { addSettledTransaction } from "./add-settled-on-chain-transaction" +} from "@/domain/errors" +import { UsdDisplayCurrency } from "@/domain/fiat" + +import { LockService } from "@/services/lock" +import { LedgerService } from "@/services/ledger" +import { RedisCacheService } from "@/services/cache" +import { WalletsRepository } from "@/services/mongoose" +import { LndService } from "@/services/lnd" +import { recordExceptionInCurrentSpan } from "@/services/tracing" const redisCache = RedisCacheService() diff --git a/core/api/src/app/wallets/update-pending-invoices.ts b/core/api/src/app/wallets/update-pending-invoices.ts index 2b85e68b42..8fe1f0e288 100644 --- a/core/api/src/app/wallets/update-pending-invoices.ts +++ b/core/api/src/app/wallets/update-pending-invoices.ts @@ -1,42 +1,42 @@ -import { removeDeviceTokens } from "@app/users/remove-device-tokens" -import { getCurrentPriceAsDisplayPriceRatio, usdFromBtcMidPriceFn } from "@app/prices" +import { removeDeviceTokens } from "@/app/users/remove-device-tokens" +import { getCurrentPriceAsDisplayPriceRatio, usdFromBtcMidPriceFn } from "@/app/prices" import { CouldNotFindError, CouldNotFindWalletInvoiceError, InvalidNonHodlInvoiceError, -} from "@domain/errors" -import { checkedToSats } from "@domain/bitcoin" -import { DisplayAmountsConverter } from "@domain/fiat" -import { InvoiceNotFoundError } from "@domain/bitcoin/lightning" -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" -import { WalletInvoiceReceiver } from "@domain/wallet-invoices/wallet-invoice-receiver" -import { DeviceTokensNotRegisteredNotificationsServiceError } from "@domain/notifications" +} from "@/domain/errors" +import { checkedToSats } from "@/domain/bitcoin" +import { DisplayAmountsConverter } from "@/domain/fiat" +import { InvoiceNotFoundError } from "@/domain/bitcoin/lightning" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" +import { WalletInvoiceReceiver } from "@/domain/wallet-invoices/wallet-invoice-receiver" +import { DeviceTokensNotRegisteredNotificationsServiceError } from "@/domain/notifications" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, wrapAsyncToRunInSpan, -} from "@services/tracing" +} from "@/services/tracing" import { AccountsRepository, WalletInvoicesRepository, WalletsRepository, UsersRepository, -} from "@services/mongoose" -import { LndService } from "@services/lnd" -import { LockService } from "@services/lock" -import * as LedgerFacade from "@services/ledger/facade" -import { DealerPriceService } from "@services/dealer-price" -import { NotificationsService } from "@services/notifications" - -import { elapsedSinceTimestamp, runInParallel } from "@utils" -import { CallbackEventType } from "@domain/callback" -import { AccountLevel } from "@domain/accounts" -import { CallbackService } from "@services/svix" -import { getCallbackServiceConfig } from "@config" -import { toDisplayBaseAmount } from "@domain/payments" -import { WalletInvoiceChecker } from "@domain/wallet-invoices" +} from "@/services/mongoose" +import { LndService } from "@/services/lnd" +import { LockService } from "@/services/lock" +import * as LedgerFacade from "@/services/ledger/facade" +import { DealerPriceService } from "@/services/dealer-price" +import { NotificationsService } from "@/services/notifications" + +import { elapsedSinceTimestamp, runInParallel } from "@/utils" +import { CallbackEventType } from "@/domain/callback" +import { AccountLevel } from "@/domain/accounts" +import { CallbackService } from "@/services/svix" +import { getCallbackServiceConfig } from "@/config" +import { toDisplayBaseAmount } from "@/domain/payments" +import { WalletInvoiceChecker } from "@/domain/wallet-invoices" export const handleHeldInvoices = async (logger: Logger): Promise => { const pendingInvoices = WalletInvoicesRepository().yieldPending() diff --git a/core/api/src/app/wallets/validate.ts b/core/api/src/app/wallets/validate.ts index a214ada919..66e190bdb1 100644 --- a/core/api/src/app/wallets/validate.ts +++ b/core/api/src/app/wallets/validate.ts @@ -1,7 +1,7 @@ -import { WalletCurrency } from "@domain/shared" -import { MismatchedCurrencyForWalletError } from "@domain/errors" +import { WalletCurrency } from "@/domain/shared" +import { MismatchedCurrencyForWalletError } from "@/domain/errors" -import { WalletsRepository } from "@services/mongoose" +import { WalletsRepository } from "@/services/mongoose" export const validateIsBtcWallet = async ( walletId: WalletId, diff --git a/core/api/src/config/index.ts b/core/api/src/config/index.ts index 429f450553..0268d3a474 100644 --- a/core/api/src/config/index.ts +++ b/core/api/src/config/index.ts @@ -1,5 +1,3 @@ -import { toDays } from "@domain/primitives" - import { getBriaPartialConfigFromYaml, MEMO_SHARING_CENTS_THRESHOLD, @@ -12,6 +10,10 @@ export * from "./error" export * from "./yaml" export * from "./schema" +import { ConfigError } from "./error" + +import { toDays } from "@/domain/primitives" + export const MS_PER_SEC = 1000 as MilliSeconds export const MS_PER_HOUR = (60 * 60 * MS_PER_SEC) as MilliSeconds export const MS_PER_DAY = (24 * MS_PER_HOUR) as MilliSeconds @@ -49,8 +51,6 @@ export const getJwksArgs = () => { } } -import { ConfigError } from "./error" - export const getGeetestConfig = () => { const id = GEETEST_ID const key = GEETEST_KEY diff --git a/core/api/src/config/schema.ts b/core/api/src/config/schema.ts index 436818f6be..636429c544 100644 --- a/core/api/src/config/schema.ts +++ b/core/api/src/config/schema.ts @@ -1,5 +1,5 @@ -import { AccountStatus } from "@domain/accounts/primitives" -import { WalletCurrency } from "@domain/shared" +import { AccountStatus } from "@/domain/accounts/primitives" +import { WalletCurrency } from "@/domain/shared" const displayCurrencyConfigSchema = { type: "object", diff --git a/core/api/src/config/yaml.ts b/core/api/src/config/yaml.ts index 5fa0dd8d64..2eeb76ecb2 100644 --- a/core/api/src/config/yaml.ts +++ b/core/api/src/config/yaml.ts @@ -6,23 +6,24 @@ import Ajv from "ajv" import yaml from "js-yaml" import { I18n } from "i18n" -import { baseLogger } from "@services/logger" -import { checkedToScanDepth } from "@domain/bitcoin/onchain" -import { toSats } from "@domain/bitcoin" -import { toCents } from "@domain/fiat" +import mergeWith from "lodash.mergewith" -import { WithdrawalFeePriceMethod } from "@domain/wallets" +import { configSchema } from "./schema" -import { toDays, toSeconds } from "@domain/primitives" +import { ConfigError } from "./error" -import { WalletCurrency } from "@domain/shared" +import { baseLogger } from "@/services/logger" +import { checkedToScanDepth } from "@/domain/bitcoin/onchain" +import { toSats } from "@/domain/bitcoin" +import { toCents } from "@/domain/fiat" -import { AccountLevel } from "@domain/accounts" +import { WithdrawalFeePriceMethod } from "@/domain/wallets" -import mergeWith from "lodash.mergewith" +import { toDays, toSeconds } from "@/domain/primitives" -import { configSchema } from "./schema" -import { ConfigError } from "./error" +import { WalletCurrency } from "@/domain/shared" + +import { AccountLevel } from "@/domain/accounts" const merge = (defaultConfig: unknown, customConfig: unknown) => mergeWith(defaultConfig, customConfig, (a, b) => (Array.isArray(b) ? b : undefined)) diff --git a/core/api/src/debug/clean-pending-payments-for-dead-node.ts b/core/api/src/debug/clean-pending-payments-for-dead-node.ts index 618f2e63c4..a7297b62c6 100644 --- a/core/api/src/debug/clean-pending-payments-for-dead-node.ts +++ b/core/api/src/debug/clean-pending-payments-for-dead-node.ts @@ -7,18 +7,18 @@ * src/debug/clean-pending-payments-for-dead-node.ts */ -import { LedgerTransactionType, UnknownLedgerError } from "@domain/ledger" +import { LedgerTransactionType, UnknownLedgerError } from "@/domain/ledger" -import { isUp } from "@services/lnd/health" -import { lndsConnect } from "@services/lnd/auth" +import { isUp } from "@/services/lnd/health" +import { lndsConnect } from "@/services/lnd/auth" -import { setupMongoConnection } from "@services/mongodb" -import { LedgerService, translateToLedgerTx } from "@services/ledger" -import * as LedgerFacade from "@services/ledger/facade" -import { LockService } from "@services/lock" -import { baseLogger } from "@services/logger" +import { setupMongoConnection } from "@/services/mongodb" +import { LedgerService, translateToLedgerTx } from "@/services/ledger" +import * as LedgerFacade from "@/services/ledger/facade" +import { LockService } from "@/services/lock" +import { baseLogger } from "@/services/logger" -import { MainBook } from "@services/ledger/books" +import { MainBook } from "@/services/ledger/books" const PUBKEY = process.argv[2] diff --git a/core/api/src/debug/create-usd-wallets.ts b/core/api/src/debug/create-usd-wallets.ts index bc52054e0c..7c8daeb361 100644 --- a/core/api/src/debug/create-usd-wallets.ts +++ b/core/api/src/debug/create-usd-wallets.ts @@ -3,13 +3,13 @@ * yarn ts-node --files -r tsconfig-paths/register src/debug/create-usd-wallets.ts */ -import { Accounts as AccountsWithSpans } from "@app" -import { WalletCurrency } from "@domain/shared" -import { WalletType } from "@domain/wallets" -import { isUp } from "@services/lnd/health" -import { lndsConnect } from "@services/lnd/auth" -import { setupMongoConnection } from "@services/mongodb" -import { AccountsRepository } from "@services/mongoose" +import { Accounts as AccountsWithSpans } from "@/app" +import { WalletCurrency } from "@/domain/shared" +import { WalletType } from "@/domain/wallets" +import { isUp } from "@/services/lnd/health" +import { lndsConnect } from "@/services/lnd/auth" +import { setupMongoConnection } from "@/services/mongodb" +import { AccountsRepository } from "@/services/mongoose" const createUsdWallets = async () => { await setupMongoConnection() diff --git a/core/api/src/debug/get-wallet-balance.ts b/core/api/src/debug/get-wallet-balance.ts index 662791e042..7046109b57 100644 --- a/core/api/src/debug/get-wallet-balance.ts +++ b/core/api/src/debug/get-wallet-balance.ts @@ -5,10 +5,10 @@ * * : Wallet id. Must be the last param */ -import { lndsConnect } from "@services/lnd/auth" -import { setupMongoConnection } from "@services/mongodb" -import { LedgerService } from "@services/ledger" -import { isUp } from "@services/lnd/health" +import { lndsConnect } from "@/services/lnd/auth" +import { setupMongoConnection } from "@/services/mongodb" +import { LedgerService } from "@/services/ledger" +import { isUp } from "@/services/lnd/health" const getWalletBalance = async (walletId: WalletId) => { return LedgerService().getWalletBalance(walletId) diff --git a/core/api/src/debug/migrate-ln-payments-listpayments.ts b/core/api/src/debug/migrate-ln-payments-listpayments.ts index ff21a7bd5a..8da4d7dc94 100644 --- a/core/api/src/debug/migrate-ln-payments-listpayments.ts +++ b/core/api/src/debug/migrate-ln-payments-listpayments.ts @@ -8,26 +8,27 @@ */ import { getPayments } from "lightning" -import { isUp } from "@services/lnd/health" -import { lndsConnect } from "@services/lnd/auth" + +import { isUp } from "@/services/lnd/health" +import { lndsConnect } from "@/services/lnd/auth" import { CorruptLndDbError, PaymentStatus, UnknownLightningServiceError, -} from "@domain/bitcoin/lightning" -import { CouldNotFindError } from "@domain/errors" -import { LndService } from "@services/lnd" -import { baseLogger } from "@services/logger" -import { LnPaymentsRepository } from "@services/mongoose" +} from "@/domain/bitcoin/lightning" +import { CouldNotFindError } from "@/domain/errors" +import { LndService } from "@/services/lnd" +import { baseLogger } from "@/services/logger" +import { LnPaymentsRepository } from "@/services/mongoose" import { addAttributesToCurrentSpan, addEventToCurrentSpan, asyncRunInSpan, SemanticAttributes, -} from "@services/tracing" -import { setupMongoConnection } from "@services/mongodb" -import { getLndFromPubkey } from "@services/lnd/config" +} from "@/services/tracing" +import { setupMongoConnection } from "@/services/mongodb" +import { getLndFromPubkey } from "@/services/lnd/config" const indexRegex = /{"offset":(\d+),"limit":\d+}/ diff --git a/core/api/src/debug/migrate-ln-payments-trackpaymentsv2.ts b/core/api/src/debug/migrate-ln-payments-trackpaymentsv2.ts index 9a65a5142f..d29874f0e7 100644 --- a/core/api/src/debug/migrate-ln-payments-trackpaymentsv2.ts +++ b/core/api/src/debug/migrate-ln-payments-trackpaymentsv2.ts @@ -8,21 +8,21 @@ * 2>&1 | tee migration.logs */ -import { isUp } from "@services/lnd/health" -import { lndsConnect } from "@services/lnd/auth" -import { PaymentNotFoundError, PaymentStatus } from "@domain/bitcoin/lightning" -import { CouldNotFindError } from "@domain/errors" -import { LedgerService } from "@services/ledger" -import { LndService } from "@services/lnd" -import { baseLogger } from "@services/logger" -import { LnPaymentsRepository } from "@services/mongoose" +import { isUp } from "@/services/lnd/health" +import { lndsConnect } from "@/services/lnd/auth" +import { PaymentNotFoundError, PaymentStatus } from "@/domain/bitcoin/lightning" +import { CouldNotFindError } from "@/domain/errors" +import { LedgerService } from "@/services/ledger" +import { LndService } from "@/services/lnd" +import { baseLogger } from "@/services/logger" +import { LnPaymentsRepository } from "@/services/mongoose" import { addAttributesToCurrentSpan, addEventToCurrentSpan, asyncRunInSpan, SemanticAttributes, -} from "@services/tracing" -import { setupMongoConnection } from "@services/mongodb" +} from "@/services/tracing" +import { setupMongoConnection } from "@/services/mongodb" let lndService diff --git a/core/api/src/debug/reimburse.ts b/core/api/src/debug/reimburse.ts index ecac968157..63cf6c8c8b 100644 --- a/core/api/src/debug/reimburse.ts +++ b/core/api/src/debug/reimburse.ts @@ -12,16 +12,16 @@ * . ./.envrc && yarn ts-node --files -r tsconfig-paths/register src/debug/reimburse.ts */ -import { Payments } from "@app" -import { checkedToSats } from "@domain/bitcoin" -import { WalletCurrency } from "@domain/shared" -import { checkedToWalletId } from "@domain/wallets" -import { getBankOwnerWalletId } from "@services/ledger/caching" -import { setupMongoConnection } from "@services/mongodb" -import { AccountsRepository, WalletsRepository } from "@services/mongoose" - import { reimbursements } from "./reimbursements.json" +import { Payments } from "@/app" +import { checkedToSats } from "@/domain/bitcoin" +import { WalletCurrency } from "@/domain/shared" +import { checkedToWalletId } from "@/domain/wallets" +import { getBankOwnerWalletId } from "@/services/ledger/caching" +import { setupMongoConnection } from "@/services/mongodb" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" + type reimbursement = { recipientWalletId: string amount: number diff --git a/core/api/src/debug/text-sms.ts b/core/api/src/debug/text-sms.ts index fb8af5be3f..a88d23ad10 100644 --- a/core/api/src/debug/text-sms.ts +++ b/core/api/src/debug/text-sms.ts @@ -1,5 +1,5 @@ // import { baseLogger } from "../logger" -// import { TwilioClient } from "@services/phone-provider" +// import { TwilioClient } from "@/services/phone-provider" // const phone = "add phone number here with extension (ie: +1...)" diff --git a/core/api/src/debug/update-on-chain-receipt.ts b/core/api/src/debug/update-on-chain-receipt.ts index 56b1ac03ed..6b501048f9 100644 --- a/core/api/src/debug/update-on-chain-receipt.ts +++ b/core/api/src/debug/update-on-chain-receipt.ts @@ -3,11 +3,11 @@ * . ./.envrc && yarn ts-node --files -r tsconfig-paths/register src/debug/update-on-chain-receipt.ts */ -import { Wallets } from "@app" -import { baseLogger as logger } from "@services/logger" -import { checkedToScanDepth } from "@domain/bitcoin/onchain" -import { redis } from "@services/redis" -import { setupMongoConnection } from "@services/mongodb" +import { Wallets } from "@/app" +import { baseLogger as logger } from "@/services/logger" +import { checkedToScanDepth } from "@/domain/bitcoin/onchain" +import { redis } from "@/services/redis" +import { setupMongoConnection } from "@/services/mongodb" const updateLegacyOnChainReceipt = async () => { const scanDepth = checkedToScanDepth(2160) // ~15 days diff --git a/core/api/src/debug/update-withdraw-fee-all-accounts.ts b/core/api/src/debug/update-withdraw-fee-all-accounts.ts index fe91f8eed9..965ad12495 100644 --- a/core/api/src/debug/update-withdraw-fee-all-accounts.ts +++ b/core/api/src/debug/update-withdraw-fee-all-accounts.ts @@ -5,10 +5,11 @@ */ import mongoose from "mongoose" -import { updateAccountWithdrawFee } from "@app/accounts/update-account-withdraw-fee" -import { setupMongoConnection } from "@services/mongodb" -import { AccountsRepository } from "@services/mongoose" +import { updateAccountWithdrawFee } from "@/app/accounts/update-account-withdraw-fee" +import { setupMongoConnection } from "@/services/mongodb" + +import { AccountsRepository } from "@/services/mongoose" const updateFee = async (fee: number) => { await setupMongoConnection() diff --git a/core/api/src/debug/update-withdraw-fee.ts b/core/api/src/debug/update-withdraw-fee.ts index f9a29474d3..43049e7146 100644 --- a/core/api/src/debug/update-withdraw-fee.ts +++ b/core/api/src/debug/update-withdraw-fee.ts @@ -13,13 +13,14 @@ */ import mongoose from "mongoose" -import { updateAccountWithdrawFee } from "@app/accounts/update-account-withdraw-fee" -import { setupMongoConnection } from "@services/mongodb" -import { WalletsRepository } from "@services/mongoose" -import { checkedToWalletId } from "@domain/wallets" import { feeUpdateOperations } from "./fee-update-operations.json" +import { updateAccountWithdrawFee } from "@/app/accounts/update-account-withdraw-fee" +import { setupMongoConnection } from "@/services/mongodb" +import { WalletsRepository } from "@/services/mongoose" +import { checkedToWalletId } from "@/domain/wallets" + type feeUpdateOperation = { walletId: string fee: number diff --git a/core/api/src/debug/void-payment.ts b/core/api/src/debug/void-payment.ts index 0e990387e6..71cf5a4c8a 100644 --- a/core/api/src/debug/void-payment.ts +++ b/core/api/src/debug/void-payment.ts @@ -7,14 +7,14 @@ * : payment hash to void. * : true if hash needs to be validated against lnd. Must be the last param */ -import { PaymentStatus } from "@domain/bitcoin/lightning" +import { PaymentStatus } from "@/domain/bitcoin/lightning" -import { LndService } from "@services/lnd" -import { isUp } from "@services/lnd/health" -import { lndsConnect } from "@services/lnd/auth" -import { LedgerService } from "@services/ledger" -import * as LedgerFacade from "@services/ledger/facade" -import { setupMongoConnection } from "@services/mongodb" +import { LndService } from "@/services/lnd" +import { isUp } from "@/services/lnd/health" +import { lndsConnect } from "@/services/lnd/auth" +import { LedgerService } from "@/services/ledger" +import * as LedgerFacade from "@/services/ledger/facade" +import { setupMongoConnection } from "@/services/mongodb" const voidPayment = async ({ journalId, diff --git a/core/api/src/domain/accounts-ips/ip-metadata-authorizer.ts b/core/api/src/domain/accounts-ips/ip-metadata-authorizer.ts index a3580d278a..9ba46e9eec 100644 --- a/core/api/src/domain/accounts-ips/ip-metadata-authorizer.ts +++ b/core/api/src/domain/accounts-ips/ip-metadata-authorizer.ts @@ -3,7 +3,7 @@ import { UnauthorizedIPMetadataASNError, UnauthorizedIPMetadataCountryError, UnauthorizedIPMetadataProxyError, -} from "@domain/errors" +} from "@/domain/errors" export const IPMetadataAuthorizer = ({ denyCountries, diff --git a/core/api/src/domain/accounts/account-validator.ts b/core/api/src/domain/accounts/account-validator.ts index 4befa8c3b3..a49cc25def 100644 --- a/core/api/src/domain/accounts/account-validator.ts +++ b/core/api/src/domain/accounts/account-validator.ts @@ -1,7 +1,7 @@ -import { InactiveAccountError, InvalidWalletId } from "@domain/errors" - import { AccountStatus } from "./primitives" +import { InactiveAccountError, InvalidWalletId } from "@/domain/errors" + export const AccountValidator = ( account: Account, ): AccountValidator | ValidationError => { diff --git a/core/api/src/domain/accounts/errors.ts b/core/api/src/domain/accounts/errors.ts index 483c0bbc22..a9d9ddc495 100644 --- a/core/api/src/domain/accounts/errors.ts +++ b/core/api/src/domain/accounts/errors.ts @@ -1,4 +1,4 @@ -import { DomainError } from "@domain/shared" +import { DomainError } from "@/domain/shared" export class AccountError extends DomainError {} diff --git a/core/api/src/domain/accounts/index.ts b/core/api/src/domain/accounts/index.ts index 7a798e46c0..4901ca1f62 100644 --- a/core/api/src/domain/accounts/index.ts +++ b/core/api/src/domain/accounts/index.ts @@ -1,4 +1,8 @@ -import { toSats } from "@domain/bitcoin" +import { InvalidAccountIdError } from "./errors" + +import { AccountLevel, AccountStatus } from "./primitives" + +import { toSats } from "@/domain/bitcoin" import { InvalidCoordinatesError, InvalidBusinessTitleLengthError, @@ -8,11 +12,7 @@ import { InvalidWithdrawFeeError, InvalidUserId, InvalidAccountLevelError, -} from "@domain/errors" - -import { InvalidAccountIdError } from "./errors" - -import { AccountLevel, AccountStatus } from "./primitives" +} from "@/domain/errors" export * from "./errors" export * from "./limits-checker" diff --git a/core/api/src/domain/accounts/limits-checker.ts b/core/api/src/domain/accounts/limits-checker.ts index e81b5a8344..4d331e380a 100644 --- a/core/api/src/domain/accounts/limits-checker.ts +++ b/core/api/src/domain/accounts/limits-checker.ts @@ -2,7 +2,7 @@ import { IntraledgerLimitsExceededError, TradeIntraAccountLimitsExceededError, WithdrawalLimitsExceededError, -} from "@domain/errors" +} from "@/domain/errors" export const AccountTxVolumeLimitChecker = ( accountLimits: IAccountLimits, diff --git a/core/api/src/domain/accounts/limits-volume.ts b/core/api/src/domain/accounts/limits-volume.ts index 7d7e3f89e2..2beee3ce4a 100644 --- a/core/api/src/domain/accounts/limits-volume.ts +++ b/core/api/src/domain/accounts/limits-volume.ts @@ -1,13 +1,13 @@ +import { AccountLimitsType } from "./primitives" + import { AmountCalculator, paymentAmountFromNumber, UsdPaymentAmount, WalletCurrency, ZERO_CENTS, -} from "@domain/shared" -import { addAttributesToCurrentSpan } from "@services/tracing" - -import { AccountLimitsType } from "./primitives" +} from "@/domain/shared" +import { addAttributesToCurrentSpan } from "@/services/tracing" const calc = AmountCalculator() diff --git a/core/api/src/domain/authentication/errors.ts b/core/api/src/domain/authentication/errors.ts index a2d3a93081..867f4b8ae2 100644 --- a/core/api/src/domain/authentication/errors.ts +++ b/core/api/src/domain/authentication/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ValidationError, ErrorLevel } from "@domain/shared" +import { DomainError, ValidationError, ErrorLevel } from "@/domain/shared" export class AuthenticationError extends DomainError {} export class LikelyNoUserWithThisPhoneExistError extends AuthenticationError {} diff --git a/core/api/src/domain/authentication/index.ts b/core/api/src/domain/authentication/index.ts index 3442d6c43b..aa0b5917bf 100644 --- a/core/api/src/domain/authentication/index.ts +++ b/core/api/src/domain/authentication/index.ts @@ -1,7 +1,7 @@ -import { ChannelType, PhoneCodeInvalidError } from "@domain/phone-provider" - import { EmailCodeInvalidError } from "./errors" +import { ChannelType, PhoneCodeInvalidError } from "@/domain/phone-provider" + export const getSupportedCountries = ({ allCountries, unsupportedSmsCountries, diff --git a/core/api/src/domain/authentication/registration-payload-validator.ts b/core/api/src/domain/authentication/registration-payload-validator.ts index e54b2795c6..7bb9f5025c 100644 --- a/core/api/src/domain/authentication/registration-payload-validator.ts +++ b/core/api/src/domain/authentication/registration-payload-validator.ts @@ -1,11 +1,11 @@ -import { checkedToUserId } from "@domain/accounts" -import { checkedToPhoneNumber, PhoneMetadataValidator } from "@domain/users" - import { MissingRegistrationPayloadPropertiesError, UnsupportedSchemaTypeError, } from "./errors" +import { checkedToUserId } from "@/domain/accounts" +import { checkedToPhoneNumber, PhoneMetadataValidator } from "@/domain/users" + export const RegistrationPayloadValidator = ( schemaId: SchemaId, ): RegistrationPayloadValidator => { diff --git a/core/api/src/domain/bitcoin/index.ts b/core/api/src/domain/bitcoin/index.ts index a6d28eb7d2..38044dfde0 100644 --- a/core/api/src/domain/bitcoin/index.ts +++ b/core/api/src/domain/bitcoin/index.ts @@ -1,5 +1,8 @@ -import { InvalidCurrencyBaseAmountError, InvalidSatoshiAmountError } from "@domain/errors" -import { MAX_SATS, BtcAmountTooLargeError } from "@domain/shared" +import { + InvalidCurrencyBaseAmountError, + InvalidSatoshiAmountError, +} from "@/domain/errors" +import { MAX_SATS, BtcAmountTooLargeError } from "@/domain/shared" export const SATS_PER_BTC = 10 ** 8 diff --git a/core/api/src/domain/bitcoin/lightning/errors.ts b/core/api/src/domain/bitcoin/lightning/errors.ts index ef0a283860..c9bd4b45cb 100644 --- a/core/api/src/domain/bitcoin/lightning/errors.ts +++ b/core/api/src/domain/bitcoin/lightning/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class LightningError extends DomainError {} diff --git a/core/api/src/domain/bitcoin/lightning/index.ts b/core/api/src/domain/bitcoin/lightning/index.ts index afc658e8ae..7c435381a3 100644 --- a/core/api/src/domain/bitcoin/lightning/index.ts +++ b/core/api/src/domain/bitcoin/lightning/index.ts @@ -1,6 +1,6 @@ import { createHash, randomBytes } from "crypto" -import { InvalidPubKeyError } from "@domain/errors" +import { InvalidPubKeyError } from "@/domain/errors" export { decodeInvoice } from "./ln-invoice" export { diff --git a/core/api/src/domain/bitcoin/lightning/invoice-expiration.ts b/core/api/src/domain/bitcoin/lightning/invoice-expiration.ts index 5fc1af2e88..d9de90a9e0 100644 --- a/core/api/src/domain/bitcoin/lightning/invoice-expiration.ts +++ b/core/api/src/domain/bitcoin/lightning/invoice-expiration.ts @@ -1,4 +1,4 @@ -import { toSeconds } from "@domain/primitives" +import { toSeconds } from "@/domain/primitives" const SECS_PER_MIN = toSeconds(60) const SECS_PER_5_MINS = toSeconds(60 * 5) diff --git a/core/api/src/domain/bitcoin/lightning/ln-invoice.ts b/core/api/src/domain/bitcoin/lightning/ln-invoice.ts index b1b79826d7..9cf4ec631e 100644 --- a/core/api/src/domain/bitcoin/lightning/ln-invoice.ts +++ b/core/api/src/domain/bitcoin/lightning/ln-invoice.ts @@ -1,5 +1,3 @@ -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" -import { toMilliSatsFromNumber, toSats } from "@domain/bitcoin" import { parsePaymentRequest } from "invoices" import { @@ -9,6 +7,9 @@ import { UnknownLnInvoiceDecodeError, } from "./errors" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" +import { toMilliSatsFromNumber, toSats } from "@/domain/bitcoin" + export const decodeInvoice = ( uncheckedBolt11EncodedInvoice: string, ): LnInvoice | LnInvoiceDecodeError => { diff --git a/core/api/src/domain/bitcoin/onchain/errors.ts b/core/api/src/domain/bitcoin/onchain/errors.ts index a611f95597..dec6ce4bd3 100644 --- a/core/api/src/domain/bitcoin/onchain/errors.ts +++ b/core/api/src/domain/bitcoin/onchain/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class OnChainError extends DomainError {} diff --git a/core/api/src/domain/bitcoin/onchain/incoming-tx-handler.ts b/core/api/src/domain/bitcoin/onchain/incoming-tx-handler.ts index 7b713f05e2..8eb941c832 100644 --- a/core/api/src/domain/bitcoin/onchain/incoming-tx-handler.ts +++ b/core/api/src/domain/bitcoin/onchain/incoming-tx-handler.ts @@ -1,11 +1,11 @@ -import { MultipleCurrenciesForSingleCurrencyOperationError } from "@domain/errors" +import { MultipleCurrenciesForSingleCurrencyOperationError } from "@/domain/errors" import { AmountCalculator, paymentAmountFromNumber, WalletCurrency, ZERO_CENTS, ZERO_SATS, -} from "@domain/shared" +} from "@/domain/shared" const calc = AmountCalculator() diff --git a/core/api/src/domain/bitcoin/onchain/index.ts b/core/api/src/domain/bitcoin/onchain/index.ts index 965899d529..c2c8fe730b 100644 --- a/core/api/src/domain/bitcoin/onchain/index.ts +++ b/core/api/src/domain/bitcoin/onchain/index.ts @@ -1,4 +1,4 @@ -import { InvalidOnChainAddress, InvalidScanDepthAmount } from "@domain/errors" +import { InvalidOnChainAddress, InvalidScanDepthAmount } from "@/domain/errors" export * from "./errors" export * from "./tx-filter" diff --git a/core/api/src/domain/bitcoin/onchain/rebalance-checker.ts b/core/api/src/domain/bitcoin/onchain/rebalance-checker.ts index 4ac025f2cb..edd797739e 100644 --- a/core/api/src/domain/bitcoin/onchain/rebalance-checker.ts +++ b/core/api/src/domain/bitcoin/onchain/rebalance-checker.ts @@ -1,4 +1,4 @@ -import { toSats } from "@domain/bitcoin" +import { toSats } from "@/domain/bitcoin" export const RebalanceChecker = ({ minOnChainHotWalletBalance, diff --git a/core/api/src/domain/bitcoin/onchain/tx-decoder.ts b/core/api/src/domain/bitcoin/onchain/tx-decoder.ts index e778fe556b..e47e16b481 100644 --- a/core/api/src/domain/bitcoin/onchain/tx-decoder.ts +++ b/core/api/src/domain/bitcoin/onchain/tx-decoder.ts @@ -1,6 +1,7 @@ -import { toSats } from "@domain/bitcoin" import { Transaction, networks, address, Network, TxOutput } from "bitcoinjs-lib" +import { toSats } from "@/domain/bitcoin" + export const TxDecoder = (networkName: BtcNetwork): TxDecoder => { const mapping: { [input in BtcNetwork]: keyof typeof networks } = { mainnet: "bitcoin", diff --git a/core/api/src/domain/cache/errors.ts b/core/api/src/domain/cache/errors.ts index afa29ee420..4b92da3e9b 100644 --- a/core/api/src/domain/cache/errors.ts +++ b/core/api/src/domain/cache/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class CacheError extends DomainError {} diff --git a/core/api/src/domain/callback/errors.ts b/core/api/src/domain/callback/errors.ts index cf99c7e54d..9c2b7ad536 100644 --- a/core/api/src/domain/callback/errors.ts +++ b/core/api/src/domain/callback/errors.ts @@ -1,4 +1,4 @@ -import { DomainError } from "@domain/shared" +import { DomainError } from "@/domain/shared" export class CallbackError extends DomainError {} diff --git a/core/api/src/domain/captcha/errors.ts b/core/api/src/domain/captcha/errors.ts index f3764c3199..c1b768f08c 100644 --- a/core/api/src/domain/captcha/errors.ts +++ b/core/api/src/domain/captcha/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class CaptchaError extends DomainError {} diff --git a/core/api/src/domain/comm/errors.ts b/core/api/src/domain/comm/errors.ts index 8bce2306f1..c8907870f9 100644 --- a/core/api/src/domain/comm/errors.ts +++ b/core/api/src/domain/comm/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class MattermostError extends DomainError { level = ErrorLevel.Critical diff --git a/core/api/src/domain/dealer-price/errors.ts b/core/api/src/domain/dealer-price/errors.ts index a172849c3f..fa2a3fe991 100644 --- a/core/api/src/domain/dealer-price/errors.ts +++ b/core/api/src/domain/dealer-price/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class DealerPriceError extends DomainError {} diff --git a/core/api/src/domain/fiat/display-currency.ts b/core/api/src/domain/fiat/display-currency.ts index 03bbdc4343..ac3e1b83f2 100644 --- a/core/api/src/domain/fiat/display-currency.ts +++ b/core/api/src/domain/fiat/display-currency.ts @@ -1,4 +1,4 @@ -import { safeBigInt, WalletCurrency } from "@domain/shared" +import { safeBigInt, WalletCurrency } from "@/domain/shared" export const CENTS_PER_USD = 100 diff --git a/core/api/src/domain/fiat/index.ts b/core/api/src/domain/fiat/index.ts index 2529ca71b7..4a8707a271 100644 --- a/core/api/src/domain/fiat/index.ts +++ b/core/api/src/domain/fiat/index.ts @@ -3,7 +3,7 @@ import { InvalidNegativeAmountError, InvalidUsdCents, NonIntegerError, -} from "@domain/errors" +} from "@/domain/errors" export * from "./display-currency" export * from "./display-amounts-converter" diff --git a/core/api/src/domain/ipfetcher/errors.ts b/core/api/src/domain/ipfetcher/errors.ts index ffd2b87b64..75a4235d2d 100644 --- a/core/api/src/domain/ipfetcher/errors.ts +++ b/core/api/src/domain/ipfetcher/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class IpFetcherError extends DomainError {} diff --git a/core/api/src/domain/ledger/activity-checker.ts b/core/api/src/domain/ledger/activity-checker.ts index 932007992b..dbea58553e 100644 --- a/core/api/src/domain/ledger/activity-checker.ts +++ b/core/api/src/domain/ledger/activity-checker.ts @@ -1,4 +1,4 @@ -import { AmountCalculator, WalletCurrency, ZERO_CENTS } from "@domain/shared" +import { AmountCalculator, WalletCurrency, ZERO_CENTS } from "@/domain/shared" const MS_PER_HOUR = (60 * 60 * 1000) as MilliSeconds const MS_PER_DAY = (24 * MS_PER_HOUR) as MilliSeconds diff --git a/core/api/src/domain/ledger/errors.ts b/core/api/src/domain/ledger/errors.ts index da0eab8bba..89462b6c2f 100644 --- a/core/api/src/domain/ledger/errors.ts +++ b/core/api/src/domain/ledger/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class LedgerError extends DomainError {} diff --git a/core/api/src/domain/ledger/fee-reimbursement.ts b/core/api/src/domain/ledger/fee-reimbursement.ts index 215680bf97..862c405dce 100644 --- a/core/api/src/domain/ledger/fee-reimbursement.ts +++ b/core/api/src/domain/ledger/fee-reimbursement.ts @@ -1,7 +1,7 @@ -import { WalletCurrency } from "@domain/shared" - import { FeeDifferenceError } from "./errors" +import { WalletCurrency } from "@/domain/shared" + export const FeeReimbursement = ({ prepaidFeeAmount, priceRatio, diff --git a/core/api/src/domain/ledger/imbalance-calculator.ts b/core/api/src/domain/ledger/imbalance-calculator.ts index 4205138b27..287a6d1d9f 100644 --- a/core/api/src/domain/ledger/imbalance-calculator.ts +++ b/core/api/src/domain/ledger/imbalance-calculator.ts @@ -1,7 +1,11 @@ -import { toSats } from "@domain/bitcoin" -import { toCents } from "@domain/fiat" -import { AmountCalculator, paymentAmountFromNumber, WalletCurrency } from "@domain/shared" -import { WithdrawalFeePriceMethod } from "@domain/wallets" +import { toSats } from "@/domain/bitcoin" +import { toCents } from "@/domain/fiat" +import { + AmountCalculator, + paymentAmountFromNumber, + WalletCurrency, +} from "@/domain/shared" +import { WithdrawalFeePriceMethod } from "@/domain/wallets" const MS_PER_HOUR = (60 * 60 * 1000) as MilliSeconds const MS_PER_DAY = (24 * MS_PER_HOUR) as MilliSeconds diff --git a/core/api/src/domain/ledger/index.ts b/core/api/src/domain/ledger/index.ts index ad7a2c54c1..e8529d146c 100644 --- a/core/api/src/domain/ledger/index.ts +++ b/core/api/src/domain/ledger/index.ts @@ -1,9 +1,9 @@ import { InvalidLedgerTransactionId, InvalidLedgerTransactionStateError, -} from "@domain/errors" -import { WalletCurrency } from "@domain/shared" -import { safeBigInt } from "@domain/shared/safe" +} from "@/domain/errors" +import { WalletCurrency } from "@/domain/shared" +import { safeBigInt } from "@/domain/shared/safe" export * from "./errors" export * from "./activity-checker" diff --git a/core/api/src/domain/locale/index.ts b/core/api/src/domain/locale/index.ts index 7920f01045..0a5e74c481 100644 --- a/core/api/src/domain/locale/index.ts +++ b/core/api/src/domain/locale/index.ts @@ -1,4 +1,4 @@ -import { getLocale } from "@config" +import { getLocale } from "@/config" export const getLanguageOrDefault = (userLang: UserLanguageOrEmpty) => userLang || (getLocale() as UserLanguage) diff --git a/core/api/src/domain/lock/errors.ts b/core/api/src/domain/lock/errors.ts index 621cb15d19..6d42ded192 100644 --- a/core/api/src/domain/lock/errors.ts +++ b/core/api/src/domain/lock/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class LockError extends DomainError {} diff --git a/core/api/src/domain/notifications/errors.ts b/core/api/src/domain/notifications/errors.ts index 3dbce67a3a..2513396ff8 100644 --- a/core/api/src/domain/notifications/errors.ts +++ b/core/api/src/domain/notifications/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class NotificationsError extends DomainError {} diff --git a/core/api/src/domain/oathkeeper/errors.ts b/core/api/src/domain/oathkeeper/errors.ts index e1ecbd5fc9..1dca90ecda 100644 --- a/core/api/src/domain/oathkeeper/errors.ts +++ b/core/api/src/domain/oathkeeper/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class OathkeeperError extends DomainError {} diff --git a/core/api/src/domain/payments/errors.ts b/core/api/src/domain/payments/errors.ts index 948acfeb3a..ef843aa65a 100644 --- a/core/api/src/domain/payments/errors.ts +++ b/core/api/src/domain/payments/errors.ts @@ -1,4 +1,4 @@ -import { ValidationError, ErrorLevel } from "@domain/shared" +import { ValidationError, ErrorLevel } from "@/domain/shared" export class InvalidZeroAmountPriceRatioInputError extends ValidationError {} export class SubOneCentSatAmountForUsdSelfSendError extends ValidationError {} diff --git a/core/api/src/domain/payments/ln-fees.ts b/core/api/src/domain/payments/ln-fees.ts index 838e5fccb3..4d2cc28242 100644 --- a/core/api/src/domain/payments/ln-fees.ts +++ b/core/api/src/domain/payments/ln-fees.ts @@ -1,5 +1,5 @@ -import { FEECAP_BASIS_POINTS } from "@domain/bitcoin" -import { MaxFeeTooLargeForRoutelessPaymentError } from "@domain/bitcoin/lightning" +import { FEECAP_BASIS_POINTS } from "@/domain/bitcoin" +import { MaxFeeTooLargeForRoutelessPaymentError } from "@/domain/bitcoin/lightning" import { WalletCurrency, ZERO_SATS, @@ -7,7 +7,7 @@ import { paymentAmountFromNumber, AmountCalculator, ONE_CENT, -} from "@domain/shared" +} from "@/domain/shared" const calc = AmountCalculator() diff --git a/core/api/src/domain/payments/onchain-payment-flow-builder.ts b/core/api/src/domain/payments/onchain-payment-flow-builder.ts index 295994a2eb..49f86bc7fa 100644 --- a/core/api/src/domain/payments/onchain-payment-flow-builder.ts +++ b/core/api/src/domain/payments/onchain-payment-flow-builder.ts @@ -1,25 +1,27 @@ -import { getFeesConfig } from "@config" -import { - AmountCalculator, - ONE_CENT, - paymentAmountFromNumber, - ValidationError, - WalletCurrency, - ZERO_BANK_FEE, -} from "@domain/shared" -import { LessThanDustThresholdError, SelfPaymentError } from "@domain/errors" -import { OnChainFees, PaymentInitiationMethod, SettlementMethod } from "@domain/wallets" -import { ImbalanceCalculator } from "@domain/ledger/imbalance-calculator" - import { InvalidLightningPaymentFlowBuilderStateError, InvalidOnChainPaymentFlowBuilderStateError, InvalidZeroAmountPriceRatioInputError, SubOneCentSatAmountForUsdSelfSendError, } from "./errors" + import { WalletPriceRatio } from "./price-ratio" + import { OnChainPaymentFlow } from "./payment-flow" +import { getFeesConfig } from "@/config" +import { + AmountCalculator, + ONE_CENT, + paymentAmountFromNumber, + ValidationError, + WalletCurrency, + ZERO_BANK_FEE, +} from "@/domain/shared" +import { LessThanDustThresholdError, SelfPaymentError } from "@/domain/errors" +import { OnChainFees, PaymentInitiationMethod, SettlementMethod } from "@/domain/wallets" +import { ImbalanceCalculator } from "@/domain/ledger/imbalance-calculator" + const calc = AmountCalculator() const feeConfig = getFeesConfig() const onChainFees = OnChainFees({ diff --git a/core/api/src/domain/payments/payment-flow-builder.ts b/core/api/src/domain/payments/payment-flow-builder.ts index 47da8fc46f..6759af7c91 100644 --- a/core/api/src/domain/payments/payment-flow-builder.ts +++ b/core/api/src/domain/payments/payment-flow-builder.ts @@ -1,31 +1,34 @@ +import { + InvalidLightningPaymentFlowBuilderStateError, + InvalidLightningPaymentFlowStateError, + InvalidZeroAmountPriceRatioInputError, + SubOneCentSatAmountForUsdSelfSendError, +} from "./errors" + +import { LnFees } from "./ln-fees" + +import { WalletPriceRatio } from "./price-ratio" + +import { PaymentFlow } from "./payment-flow" + import { ValidationError, WalletCurrency, checkedToUsdPaymentAmount, checkedToBtcPaymentAmount, -} from "@domain/shared" -import { SelfPaymentError } from "@domain/errors" -import { PaymentInitiationMethod, SettlementMethod } from "@domain/wallets" +} from "@/domain/shared" +import { SelfPaymentError } from "@/domain/errors" +import { PaymentInitiationMethod, SettlementMethod } from "@/domain/wallets" -import { generateIntraLedgerHash } from "@domain/payments/get-intraledger-hash" +import { generateIntraLedgerHash } from "@/domain/payments/get-intraledger-hash" import { parseFinalChanIdFromInvoice, parseFinalHopsFromInvoice, -} from "@domain/bitcoin/lightning" - -import { addAttributesToCurrentSpan } from "@services/tracing" +} from "@/domain/bitcoin/lightning" -import { ModifiedSet } from "@utils" +import { addAttributesToCurrentSpan } from "@/services/tracing" -import { - InvalidLightningPaymentFlowBuilderStateError, - InvalidLightningPaymentFlowStateError, - InvalidZeroAmountPriceRatioInputError, - SubOneCentSatAmountForUsdSelfSendError, -} from "./errors" -import { LnFees } from "./ln-fees" -import { WalletPriceRatio } from "./price-ratio" -import { PaymentFlow } from "./payment-flow" +import { ModifiedSet } from "@/utils" export const LightningPaymentFlowBuilder = ( config: LightningPaymentFlowBuilderConfig, diff --git a/core/api/src/domain/payments/payment-flow.ts b/core/api/src/domain/payments/payment-flow.ts index 2550c79895..0650b05382 100644 --- a/core/api/src/domain/payments/payment-flow.ts +++ b/core/api/src/domain/payments/payment-flow.ts @@ -1,7 +1,3 @@ -import { InsufficientBalanceError, InvalidCurrencyForWalletError } from "@domain/errors" -import { AmountCalculator, ErrorLevel, WalletCurrency } from "@domain/shared" -import { recordExceptionInCurrentSpan } from "@services/tracing" - import { InvalidLightningPaymentFlowBuilderStateError, IntraLedgerHashPresentInLnFlowError, @@ -11,6 +7,10 @@ import { import { RouteValidator } from "./route-validator" +import { InsufficientBalanceError, InvalidCurrencyForWalletError } from "@/domain/errors" +import { AmountCalculator, ErrorLevel, WalletCurrency } from "@/domain/shared" +import { recordExceptionInCurrentSpan } from "@/services/tracing" + export const PaymentFlowCommon = ( state: PaymentFlowCommonState, ): PaymentFlowCommon => { diff --git a/core/api/src/domain/payments/price-ratio.ts b/core/api/src/domain/payments/price-ratio.ts index 9a0320086f..15f7490da4 100644 --- a/core/api/src/domain/payments/price-ratio.ts +++ b/core/api/src/domain/payments/price-ratio.ts @@ -1,9 +1,9 @@ -import { RATIO_PRECISION } from "@config" +import { InvalidZeroAmountPriceRatioInputError } from "./errors" -import { getCurrencyMajorExponent } from "@domain/fiat" -import { AmountCalculator, safeBigInt, WalletCurrency } from "@domain/shared" +import { RATIO_PRECISION } from "@/config" -import { InvalidZeroAmountPriceRatioInputError } from "./errors" +import { getCurrencyMajorExponent } from "@/domain/fiat" +import { AmountCalculator, safeBigInt, WalletCurrency } from "@/domain/shared" const calc = AmountCalculator() diff --git a/core/api/src/domain/payments/route-validator.ts b/core/api/src/domain/payments/route-validator.ts index 1bcbeb1044..a585d2088b 100644 --- a/core/api/src/domain/payments/route-validator.ts +++ b/core/api/src/domain/payments/route-validator.ts @@ -1,4 +1,4 @@ -import { BadAmountForRouteError } from "@domain/errors" +import { BadAmountForRouteError } from "@/domain/errors" export const RouteValidator = (rawRoute: RawRoute): RouteValidator => { const validate = (btcPaymentAmount: BtcPaymentAmount): true | ApplicationError => { diff --git a/core/api/src/domain/phone-provider/errors.ts b/core/api/src/domain/phone-provider/errors.ts index 1f37d937ad..d168bc6691 100644 --- a/core/api/src/domain/phone-provider/errors.ts +++ b/core/api/src/domain/phone-provider/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class PhoneProviderServiceError extends DomainError {} diff --git a/core/api/src/domain/phone-provider/index.types.d.ts b/core/api/src/domain/phone-provider/index.types.d.ts index 8a43bd2cf9..96f6b072ed 100644 --- a/core/api/src/domain/phone-provider/index.types.d.ts +++ b/core/api/src/domain/phone-provider/index.types.d.ts @@ -1,6 +1,6 @@ type PhoneProviderServiceError = import("./errors").PhoneProviderServiceError type UnknownPhoneProviderServiceError = - import("@domain/phone-provider").UnknownPhoneProviderServiceError + import("@/domain/phone-provider").UnknownPhoneProviderServiceError type PhoneCodeInvalidError = import("./errors").PhoneCodeInvalidError interface IPhoneProviderService { diff --git a/core/api/src/domain/price/errors.ts b/core/api/src/domain/price/errors.ts index e25376a73e..c6fa47b3fd 100644 --- a/core/api/src/domain/price/errors.ts +++ b/core/api/src/domain/price/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel, ValidationError } from "@domain/shared" +import { DomainError, ErrorLevel, ValidationError } from "@/domain/shared" export class PriceError extends DomainError {} diff --git a/core/api/src/domain/primitives/index.ts b/core/api/src/domain/primitives/index.ts index d2a73ec58d..28800d6aa2 100644 --- a/core/api/src/domain/primitives/index.ts +++ b/core/api/src/domain/primitives/index.ts @@ -1,4 +1,4 @@ -import { InvalidMinutesError } from "@domain/errors" +import { InvalidMinutesError } from "@/domain/errors" export const toSeconds = (seconds: number): Seconds => { return seconds as Seconds diff --git a/core/api/src/domain/pubsub/errors.ts b/core/api/src/domain/pubsub/errors.ts index f991d2a34d..0659a1971b 100644 --- a/core/api/src/domain/pubsub/errors.ts +++ b/core/api/src/domain/pubsub/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class PubSubError extends DomainError {} diff --git a/core/api/src/domain/rate-limit/errors.ts b/core/api/src/domain/rate-limit/errors.ts index e139302b61..9c24128599 100644 --- a/core/api/src/domain/rate-limit/errors.ts +++ b/core/api/src/domain/rate-limit/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class RateLimitError extends DomainError {} diff --git a/core/api/src/domain/rate-limit/index.ts b/core/api/src/domain/rate-limit/index.ts index 16402ec31d..9f66fe4043 100644 --- a/core/api/src/domain/rate-limit/index.ts +++ b/core/api/src/domain/rate-limit/index.ts @@ -1,13 +1,3 @@ -import { - getFailedLoginAttemptPerIpLimits, - getFailedLoginAttemptPerLoginIdentifierLimits, - getInvoiceCreateAttemptLimits, - getInvoiceCreateForRecipientAttemptLimits, - getOnChainAddressCreateAttemptLimits, - getRequestCodePerIpLimits, - getRequestCodePerLoginIdentifierLimits, -} from "@config" - import { InvoiceCreateForRecipientRateLimiterExceededError, InvoiceCreateRateLimiterExceededError, @@ -18,6 +8,16 @@ import { UserCodeAttemptIdentifierRateLimiterExceededError, } from "./errors" +import { + getFailedLoginAttemptPerIpLimits, + getFailedLoginAttemptPerLoginIdentifierLimits, + getInvoiceCreateAttemptLimits, + getInvoiceCreateForRecipientAttemptLimits, + getOnChainAddressCreateAttemptLimits, + getRequestCodePerIpLimits, + getRequestCodePerLoginIdentifierLimits, +} from "@/config" + export const RateLimitPrefix = { requestCodeAttemptPerLoginIdentifier: "request_code_attempt_id", requestCodeAttemptPerIp: "request_code_attempt_ip", diff --git a/core/api/src/domain/swap/errors.ts b/core/api/src/domain/swap/errors.ts index 0f162d0c29..43a49f10c7 100644 --- a/core/api/src/domain/swap/errors.ts +++ b/core/api/src/domain/swap/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class SwapError extends DomainError {} export class NoOutboundLiquidityForSwapError extends DomainError {} diff --git a/core/api/src/domain/swap/swap-out-checker.ts b/core/api/src/domain/swap/swap-out-checker.ts index 4936c709df..32c88f9edf 100644 --- a/core/api/src/domain/swap/swap-out-checker.ts +++ b/core/api/src/domain/swap/swap-out-checker.ts @@ -1,4 +1,4 @@ -import { ZERO_SATS } from "@domain/shared" +import { ZERO_SATS } from "@/domain/shared" export const SwapOutChecker = ({ loopOutWhenHotWalletLessThanConfig, diff --git a/core/api/src/domain/users/errors.ts b/core/api/src/domain/users/errors.ts index ee4fc79eda..45ec48219e 100644 --- a/core/api/src/domain/users/errors.ts +++ b/core/api/src/domain/users/errors.ts @@ -1,5 +1,5 @@ -import { AuthorizationError } from "@domain/errors" -import { ValidationError, ErrorLevel } from "@domain/shared" +import { AuthorizationError } from "@/domain/errors" +import { ValidationError, ErrorLevel } from "@/domain/shared" export class UnauthorizedPhoneError extends AuthorizationError {} export class ExpectedPhoneMetadataMissingError extends UnauthorizedPhoneError {} diff --git a/core/api/src/domain/users/index.ts b/core/api/src/domain/users/index.ts index 94beb53538..1c6fb89e89 100644 --- a/core/api/src/domain/users/index.ts +++ b/core/api/src/domain/users/index.ts @@ -1,3 +1,5 @@ +import { Languages } from "./languages" + import { InvalidDeviceId, InvalidDeviceTokenError, @@ -6,9 +8,7 @@ import { InvalidIdentityUsername, InvalidLanguageError, InvalidPhoneNumber, -} from "@domain/errors" - -import { Languages } from "./languages" +} from "@/domain/errors" export * from "./phone-metadata-authorizer" export * from "./phone-metadata-validator" diff --git a/core/api/src/domain/users/phone-metadata-validator.ts b/core/api/src/domain/users/phone-metadata-validator.ts index 6e818fa72e..d363a5072c 100644 --- a/core/api/src/domain/users/phone-metadata-validator.ts +++ b/core/api/src/domain/users/phone-metadata-validator.ts @@ -1,5 +1,3 @@ -import { CarrierType } from "@domain/phone-provider" - import { InvalidCarrierForPhoneMetadataError, InvalidCarrierTypeForPhoneMetadataError, @@ -8,6 +6,8 @@ import { InvalidMobileCountryCodeForPhoneMetadataError, } from "./errors" +import { CarrierType } from "@/domain/phone-provider" + const checkedToCarrierType = ( rawCarrierType: string | undefined | null, ): CarrierType | ValidationError => { diff --git a/core/api/src/domain/wallet-invoices/errors.ts b/core/api/src/domain/wallet-invoices/errors.ts index e3038d06f6..4bcc520980 100644 --- a/core/api/src/domain/wallet-invoices/errors.ts +++ b/core/api/src/domain/wallet-invoices/errors.ts @@ -1,4 +1,4 @@ -import { ValidationError, ErrorLevel } from "@domain/shared" +import { ValidationError, ErrorLevel } from "@/domain/shared" export class SubOneCentSatAmountForUsdReceiveError extends ValidationError {} export class InvalidWalletInvoiceBuilderStateError extends ValidationError { diff --git a/core/api/src/domain/wallet-invoices/wallet-invoice-builder.ts b/core/api/src/domain/wallet-invoices/wallet-invoice-builder.ts index 5cf166091e..6c1fe5f051 100644 --- a/core/api/src/domain/wallet-invoices/wallet-invoice-builder.ts +++ b/core/api/src/domain/wallet-invoices/wallet-invoice-builder.ts @@ -1,15 +1,15 @@ -import { - getSecretAndPaymentHash, - invoiceExpirationForCurrency, -} from "@domain/bitcoin/lightning" -import { WalletCurrency, ZERO_SATS } from "@domain/shared" -import { toSeconds } from "@domain/primitives" - import { InvalidWalletInvoiceBuilderStateError, SubOneCentSatAmountForUsdReceiveError, } from "./errors" +import { + getSecretAndPaymentHash, + invoiceExpirationForCurrency, +} from "@/domain/bitcoin/lightning" +import { WalletCurrency, ZERO_SATS } from "@/domain/shared" +import { toSeconds } from "@/domain/primitives" + export const WalletInvoiceBuilder = ( config: WalletInvoiceBuilderConfig, ): WalletInvoiceBuilder => { diff --git a/core/api/src/domain/wallet-invoices/wallet-invoice-checker.ts b/core/api/src/domain/wallet-invoices/wallet-invoice-checker.ts index 4ea62896e6..f1f5c34026 100644 --- a/core/api/src/domain/wallet-invoices/wallet-invoice-checker.ts +++ b/core/api/src/domain/wallet-invoices/wallet-invoice-checker.ts @@ -1,6 +1,6 @@ -import { invoiceExpirationForCurrency } from "@domain/bitcoin/lightning" -import { CouldNotFindWalletInvoiceError } from "@domain/errors" -import { WalletCurrency } from "@domain/shared" +import { invoiceExpirationForCurrency } from "@/domain/bitcoin/lightning" +import { CouldNotFindWalletInvoiceError } from "@/domain/errors" +import { WalletCurrency } from "@/domain/shared" export const WalletInvoiceChecker = ( walletInvoice: WalletInvoice | RepositoryError, diff --git a/core/api/src/domain/wallet-invoices/wallet-invoice-receiver.ts b/core/api/src/domain/wallet-invoices/wallet-invoice-receiver.ts index 62277add25..c790694eb8 100644 --- a/core/api/src/domain/wallet-invoices/wallet-invoice-receiver.ts +++ b/core/api/src/domain/wallet-invoices/wallet-invoice-receiver.ts @@ -1,5 +1,8 @@ -import { InvalidZeroAmountPriceRatioInputError, WalletPriceRatio } from "@domain/payments" -import { AmountCalculator, WalletCurrency, ZERO_BANK_FEE } from "@domain/shared" +import { + InvalidZeroAmountPriceRatioInputError, + WalletPriceRatio, +} from "@/domain/payments" +import { AmountCalculator, WalletCurrency, ZERO_BANK_FEE } from "@/domain/shared" const calc = AmountCalculator() diff --git a/core/api/src/domain/wallet-on-chain/wallet-address-receiver.ts b/core/api/src/domain/wallet-on-chain/wallet-address-receiver.ts index 948c40b5d3..c892adaf02 100644 --- a/core/api/src/domain/wallet-on-chain/wallet-address-receiver.ts +++ b/core/api/src/domain/wallet-on-chain/wallet-address-receiver.ts @@ -1,6 +1,6 @@ -import { AmountLessThanFeeError } from "@domain/errors" -import { WalletPriceRatio } from "@domain/payments" -import { AmountCalculator, WalletCurrency, ZERO_BANK_FEE } from "@domain/shared" +import { AmountLessThanFeeError } from "@/domain/errors" +import { WalletPriceRatio } from "@/domain/payments" +import { AmountCalculator, WalletCurrency, ZERO_BANK_FEE } from "@/domain/shared" const calc = AmountCalculator() diff --git a/core/api/src/domain/wallets/deposit-fee-calculator.ts b/core/api/src/domain/wallets/deposit-fee-calculator.ts index 1b2dffac45..8db78639d8 100644 --- a/core/api/src/domain/wallets/deposit-fee-calculator.ts +++ b/core/api/src/domain/wallets/deposit-fee-calculator.ts @@ -1,4 +1,4 @@ -import { AmountCalculator, ZERO_SATS } from "@domain/shared" +import { AmountCalculator, ZERO_SATS } from "@/domain/shared" const calc = AmountCalculator() diff --git a/core/api/src/domain/wallets/payment-input-validator.ts b/core/api/src/domain/wallets/payment-input-validator.ts index a36a5f1111..78aa753d8b 100644 --- a/core/api/src/domain/wallets/payment-input-validator.ts +++ b/core/api/src/domain/wallets/payment-input-validator.ts @@ -1,13 +1,13 @@ -import { AccountStatus } from "@domain/accounts" -import { InactiveAccountError, InvalidWalletId, SelfPaymentError } from "@domain/errors" +import { checkedToWalletId } from "./validation" + +import { AccountStatus } from "@/domain/accounts" +import { InactiveAccountError, InvalidWalletId, SelfPaymentError } from "@/domain/errors" import { WalletCurrency, checkedToBtcPaymentAmount, checkedToUsdPaymentAmount, -} from "@domain/shared" - -import { checkedToWalletId } from "./validation" +} from "@/domain/shared" export const PaymentInputValidator = ( getWalletFn: PaymentInputValidatorConfig, diff --git a/core/api/src/domain/wallets/settlement-amounts.ts b/core/api/src/domain/wallets/settlement-amounts.ts index 948944a34a..d673ce1daf 100644 --- a/core/api/src/domain/wallets/settlement-amounts.ts +++ b/core/api/src/domain/wallets/settlement-amounts.ts @@ -1,13 +1,13 @@ -import { toSats } from "@domain/bitcoin" +import { toSats } from "@/domain/bitcoin" import { getCurrencyMajorExponent, displayAmountFromNumber, toCents, UsdDisplayCurrency, -} from "@domain/fiat" -import { ErrorLevel, WalletCurrency } from "@domain/shared" +} from "@/domain/fiat" +import { ErrorLevel, WalletCurrency } from "@/domain/shared" -import { recordExceptionInCurrentSpan } from "@services/tracing" +import { recordExceptionInCurrentSpan } from "@/services/tracing" export const SettlementAmounts = () => { const fromTxn = ( diff --git a/core/api/src/domain/wallets/tx-history.ts b/core/api/src/domain/wallets/tx-history.ts index 610854fc95..5fb4e71536 100644 --- a/core/api/src/domain/wallets/tx-history.ts +++ b/core/api/src/domain/wallets/tx-history.ts @@ -1,12 +1,14 @@ -import { UsdDisplayCurrency, priceAmountFromNumber, toCents } from "@domain/fiat" -import { toSats } from "@domain/bitcoin" -import { WalletCurrency } from "@domain/shared" -import { AdminLedgerTransactionType, LedgerTransactionType } from "@domain/ledger" - import { TxStatus } from "./tx-status" + import { PaymentInitiationMethod, SettlementMethod } from "./tx-methods" + import { SettlementAmounts } from "./settlement-amounts" +import { UsdDisplayCurrency, priceAmountFromNumber, toCents } from "@/domain/fiat" +import { toSats } from "@/domain/bitcoin" +import { WalletCurrency } from "@/domain/shared" +import { AdminLedgerTransactionType, LedgerTransactionType } from "@/domain/ledger" + const translateLedgerTxnToWalletTxn = ({ txn, nonEndUserWalletIds, diff --git a/core/api/src/domain/wallets/validation.ts b/core/api/src/domain/wallets/validation.ts index 5315012706..1841a5b42a 100644 --- a/core/api/src/domain/wallets/validation.ts +++ b/core/api/src/domain/wallets/validation.ts @@ -1,4 +1,4 @@ -import { InvalidWalletId } from "@domain/errors" +import { InvalidWalletId } from "@/domain/errors" const UuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i diff --git a/core/api/src/domain/wallets/withdrawal-fee-calculator.ts b/core/api/src/domain/wallets/withdrawal-fee-calculator.ts index dd56311369..3259f00129 100644 --- a/core/api/src/domain/wallets/withdrawal-fee-calculator.ts +++ b/core/api/src/domain/wallets/withdrawal-fee-calculator.ts @@ -1,4 +1,4 @@ -import { AmountCalculator, ZERO_CENTS, ZERO_SATS } from "@domain/shared" +import { AmountCalculator, ZERO_CENTS, ZERO_SATS } from "@/domain/shared" const calc = AmountCalculator() diff --git a/core/api/src/graphql/admin/mutations.ts b/core/api/src/graphql/admin/mutations.ts index 3407c9939b..2a40044ff0 100644 --- a/core/api/src/graphql/admin/mutations.ts +++ b/core/api/src/graphql/admin/mutations.ts @@ -1,17 +1,19 @@ -import { GT } from "@graphql/index" - -import UserLoginMutation from "@graphql/shared/root/mutation/user-login" -import CaptchaRequestAuthCodeMutation from "@graphql/shared/root/mutation/captcha-request-auth-code" -import CaptchaCreateChallengeMutation from "@graphql/shared/root/mutation/captcha-create-challenge" - -import AccountUpdateLevelMutation from "@graphql/admin/root/mutation/account-update-level" -import AccountUpdateStatusMutation from "@graphql/admin/root/mutation/account-update-status" -import BusinessUpdateMapInfoMutation from "@graphql/admin/root/mutation/business-update-map-info" - import UserUpdatePhoneMutation from "./root/mutation/user-update-phone" + import BusinessDeleteMapInfoMutation from "./root/mutation/delete-business-map" + import AdminPushNotificationSendMutation from "./root/mutation/admin-push-notification-send" +import { GT } from "@/graphql/index" + +import UserLoginMutation from "@/graphql/shared/root/mutation/user-login" +import CaptchaRequestAuthCodeMutation from "@/graphql/shared/root/mutation/captcha-request-auth-code" +import CaptchaCreateChallengeMutation from "@/graphql/shared/root/mutation/captcha-create-challenge" + +import AccountUpdateLevelMutation from "@/graphql/admin/root/mutation/account-update-level" +import AccountUpdateStatusMutation from "@/graphql/admin/root/mutation/account-update-status" +import BusinessUpdateMapInfoMutation from "@/graphql/admin/root/mutation/business-update-map-info" + export const mutationFields = { unauthed: { userLogin: UserLoginMutation, diff --git a/core/api/src/graphql/admin/queries.ts b/core/api/src/graphql/admin/queries.ts index b94e5a0955..6c3c6b0f50 100644 --- a/core/api/src/graphql/admin/queries.ts +++ b/core/api/src/graphql/admin/queries.ts @@ -1,5 +1,3 @@ -import { GT } from "@graphql/index" - import AllLevelsQuery from "./root/query/all-levels" import LightningInvoiceQuery from "./root/query/lightning-invoice" import LightningPaymentQuery from "./root/query/lightning-payment" @@ -12,6 +10,8 @@ import ListWalletIdsQuery from "./root/query/all-walletids" import WalletQuery from "./root/query/wallet" import AccountDetailsByAccountId from "./root/query/account-details-by-account-id" +import { GT } from "@/graphql/index" + export const queryFields = { unauthed: {}, authed: { diff --git a/core/api/src/graphql/admin/root/mutation/account-update-level.ts b/core/api/src/graphql/admin/root/mutation/account-update-level.ts index 62e7c0dba0..ade007b75d 100644 --- a/core/api/src/graphql/admin/root/mutation/account-update-level.ts +++ b/core/api/src/graphql/admin/root/mutation/account-update-level.ts @@ -1,8 +1,8 @@ -import { Accounts } from "@app" -import AccountDetailPayload from "@graphql/admin/types/payload/account-detail" -import AccountLevel from "@graphql/shared/types/scalar/account-level" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" +import { Accounts } from "@/app" +import AccountDetailPayload from "@/graphql/admin/types/payload/account-detail" +import AccountLevel from "@/graphql/shared/types/scalar/account-level" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" const AccountUpdateLevelInput = GT.Input({ name: "AccountUpdateLevelInput", diff --git a/core/api/src/graphql/admin/root/mutation/account-update-status.ts b/core/api/src/graphql/admin/root/mutation/account-update-status.ts index bf21039007..0cd268789a 100644 --- a/core/api/src/graphql/admin/root/mutation/account-update-status.ts +++ b/core/api/src/graphql/admin/root/mutation/account-update-status.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AccountDetailPayload from "@graphql/admin/types/payload/account-detail" -import AccountStatus from "@graphql/admin/types/scalar/account-status" -import { Accounts } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import AccountDetailPayload from "@/graphql/admin/types/payload/account-detail" +import AccountStatus from "@/graphql/admin/types/scalar/account-status" +import { Accounts } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const AccountUpdateStatusInput = GT.Input({ name: "AccountUpdateStatusInput", diff --git a/core/api/src/graphql/admin/root/mutation/admin-push-notification-send.ts b/core/api/src/graphql/admin/root/mutation/admin-push-notification-send.ts index 41123f5bdc..7719cdf69d 100644 --- a/core/api/src/graphql/admin/root/mutation/admin-push-notification-send.ts +++ b/core/api/src/graphql/admin/root/mutation/admin-push-notification-send.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AdminPushNotificationSendPayload from "@graphql/admin/types/payload/admin-push-notification-send" -import { Admin } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import NotificationCategory from "@graphql/shared/types/scalar/notification-category" +import AdminPushNotificationSendPayload from "@/graphql/admin/types/payload/admin-push-notification-send" +import { Admin } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import NotificationCategory from "@/graphql/shared/types/scalar/notification-category" const AdminPushNotificationSendInput = GT.Input({ name: "AdminPushNotificationSendInput", diff --git a/core/api/src/graphql/admin/root/mutation/business-update-map-info.ts b/core/api/src/graphql/admin/root/mutation/business-update-map-info.ts index 91ee49a3a5..d18747a579 100644 --- a/core/api/src/graphql/admin/root/mutation/business-update-map-info.ts +++ b/core/api/src/graphql/admin/root/mutation/business-update-map-info.ts @@ -1,8 +1,8 @@ -import { Accounts } from "@app" -import AccountDetailPayload from "@graphql/admin/types/payload/account-detail" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" -import Username from "@graphql/shared/types/scalar/username" +import { Accounts } from "@/app" +import AccountDetailPayload from "@/graphql/admin/types/payload/account-detail" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" +import Username from "@/graphql/shared/types/scalar/username" const BusinessUpdateMapInfoInput = GT.Input({ name: "BusinessUpdateMapInfoInput", diff --git a/core/api/src/graphql/admin/root/mutation/delete-business-map.ts b/core/api/src/graphql/admin/root/mutation/delete-business-map.ts index 256d4d6b1f..3e5c62e77f 100644 --- a/core/api/src/graphql/admin/root/mutation/delete-business-map.ts +++ b/core/api/src/graphql/admin/root/mutation/delete-business-map.ts @@ -1,8 +1,8 @@ -import { Accounts } from "@app" -import AccountDetailPayload from "@graphql/admin/types/payload/account-detail" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" -import Username from "@graphql/shared/types/scalar/username" +import { Accounts } from "@/app" +import AccountDetailPayload from "@/graphql/admin/types/payload/account-detail" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" +import Username from "@/graphql/shared/types/scalar/username" const BusinessDeleteMapInfoInput = GT.Input({ name: "BusinessDeleteMapInfoInput", diff --git a/core/api/src/graphql/admin/root/mutation/user-update-phone.ts b/core/api/src/graphql/admin/root/mutation/user-update-phone.ts index 3e3c35bb64..e7ce49d0d9 100644 --- a/core/api/src/graphql/admin/root/mutation/user-update-phone.ts +++ b/core/api/src/graphql/admin/root/mutation/user-update-phone.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AccountDetailPayload from "@graphql/admin/types/payload/account-detail" -import { Admin } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import Phone from "@graphql/shared/types/scalar/phone" +import AccountDetailPayload from "@/graphql/admin/types/payload/account-detail" +import { Admin } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import Phone from "@/graphql/shared/types/scalar/phone" const UserUpdatePhoneInput = GT.Input({ name: "UserUpdatePhoneInput", diff --git a/core/api/src/graphql/admin/root/query/account-details-by-account-id.ts b/core/api/src/graphql/admin/root/query/account-details-by-account-id.ts index 3e979e53e8..b568e4ff6b 100644 --- a/core/api/src/graphql/admin/root/query/account-details-by-account-id.ts +++ b/core/api/src/graphql/admin/root/query/account-details-by-account-id.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AuditedAccount from "@graphql/admin/types/object/account" -import { mapError } from "@graphql/error-map" +import AuditedAccount from "@/graphql/admin/types/object/account" +import { mapError } from "@/graphql/error-map" -import { Admin } from "@app" +import { Admin } from "@/app" const AccountDetailsByAccountId = GT.Field({ args: { diff --git a/core/api/src/graphql/admin/root/query/account-details-by-email.ts b/core/api/src/graphql/admin/root/query/account-details-by-email.ts index 87d6219b22..27983c39c9 100644 --- a/core/api/src/graphql/admin/root/query/account-details-by-email.ts +++ b/core/api/src/graphql/admin/root/query/account-details-by-email.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AuditedAccount from "@graphql/admin/types/object/account" -import { mapError } from "@graphql/error-map" +import AuditedAccount from "@/graphql/admin/types/object/account" +import { mapError } from "@/graphql/error-map" -import { Admin } from "@app" -import EmailAddress from "@graphql/shared/types/scalar/email-address" +import { Admin } from "@/app" +import EmailAddress from "@/graphql/shared/types/scalar/email-address" const AccountDetailsByUserEmailQuery = GT.Field< null, diff --git a/core/api/src/graphql/admin/root/query/account-details-by-phone.ts b/core/api/src/graphql/admin/root/query/account-details-by-phone.ts index ae80e73a2e..cab926dfe1 100644 --- a/core/api/src/graphql/admin/root/query/account-details-by-phone.ts +++ b/core/api/src/graphql/admin/root/query/account-details-by-phone.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AuditedAccount from "@graphql/admin/types/object/account" -import Phone from "@graphql/shared/types/scalar/phone" -import { mapError } from "@graphql/error-map" +import AuditedAccount from "@/graphql/admin/types/object/account" +import Phone from "@/graphql/shared/types/scalar/phone" +import { mapError } from "@/graphql/error-map" -import { Admin } from "@app" +import { Admin } from "@/app" const AccountDetailsByUserPhoneQuery = GT.Field< null, diff --git a/core/api/src/graphql/admin/root/query/account-details-by-username.ts b/core/api/src/graphql/admin/root/query/account-details-by-username.ts index 6574602b85..2e0e34311d 100644 --- a/core/api/src/graphql/admin/root/query/account-details-by-username.ts +++ b/core/api/src/graphql/admin/root/query/account-details-by-username.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AuditedAccount from "@graphql/admin/types/object/account" -import Username from "@graphql/shared/types/scalar/username" -import { mapError } from "@graphql/error-map" +import AuditedAccount from "@/graphql/admin/types/object/account" +import Username from "@/graphql/shared/types/scalar/username" +import { mapError } from "@/graphql/error-map" -import { Admin } from "@app" +import { Admin } from "@/app" const AccountDetailsByUsernameQuery = GT.Field({ args: { diff --git a/core/api/src/graphql/admin/root/query/all-levels.ts b/core/api/src/graphql/admin/root/query/all-levels.ts index cbfcaf5dd1..e034a5a87f 100644 --- a/core/api/src/graphql/admin/root/query/all-levels.ts +++ b/core/api/src/graphql/admin/root/query/all-levels.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Levels } from "@config" +import { Levels } from "@/config" -import AccountLevel from "@graphql/shared/types/scalar/account-level" +import AccountLevel from "@/graphql/shared/types/scalar/account-level" const AllLevelsQuery = GT.Field({ type: GT.NonNullList(AccountLevel), diff --git a/core/api/src/graphql/admin/root/query/all-walletids.ts b/core/api/src/graphql/admin/root/query/all-walletids.ts index d4398bdf29..92b33d6275 100644 --- a/core/api/src/graphql/admin/root/query/all-walletids.ts +++ b/core/api/src/graphql/admin/root/query/all-walletids.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" -import { Wallets } from "@app" -import WalletCurrency from "@graphql/shared/types/scalar/wallet-currency" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" +import { Wallets } from "@/app" +import WalletCurrency from "@/graphql/shared/types/scalar/wallet-currency" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" const ListWalletIdsQuery = GT.Field({ type: GT.NonNullList(WalletId), diff --git a/core/api/src/graphql/admin/root/query/lightning-invoice.ts b/core/api/src/graphql/admin/root/query/lightning-invoice.ts index 0e3f422824..2f82df8b19 100644 --- a/core/api/src/graphql/admin/root/query/lightning-invoice.ts +++ b/core/api/src/graphql/admin/root/query/lightning-invoice.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" -import { Lightning } from "@app" -import PaymentHash from "@graphql/shared/types/scalar/payment-hash" -import LightningInvoice from "@graphql/admin/types/object/lightning-invoice" -import { mapError } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import { Lightning } from "@/app" +import PaymentHash from "@/graphql/shared/types/scalar/payment-hash" +import LightningInvoice from "@/graphql/admin/types/object/lightning-invoice" +import { mapError } from "@/graphql/error-map" const LightningInvoiceQuery = GT.Field({ type: GT.NonNull(LightningInvoice), diff --git a/core/api/src/graphql/admin/root/query/lightning-payment.ts b/core/api/src/graphql/admin/root/query/lightning-payment.ts index b4907a2438..4fddcdbb62 100644 --- a/core/api/src/graphql/admin/root/query/lightning-payment.ts +++ b/core/api/src/graphql/admin/root/query/lightning-payment.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" -import { Lightning } from "@app" -import PaymentHash from "@graphql/shared/types/scalar/payment-hash" -import LightningPayment from "@graphql/admin/types/object/lightning-payment" -import { mapError } from "@graphql/error-map" -import { LnPaymentsRepository } from "@services/mongoose" +import { GT } from "@/graphql/index" +import { Lightning } from "@/app" +import PaymentHash from "@/graphql/shared/types/scalar/payment-hash" +import LightningPayment from "@/graphql/admin/types/object/lightning-payment" +import { mapError } from "@/graphql/error-map" +import { LnPaymentsRepository } from "@/services/mongoose" const LightningPaymentQuery = GT.Field({ type: GT.NonNull(LightningPayment), diff --git a/core/api/src/graphql/admin/root/query/transaction-by-id.ts b/core/api/src/graphql/admin/root/query/transaction-by-id.ts index fadb7936b5..8772749389 100644 --- a/core/api/src/graphql/admin/root/query/transaction-by-id.ts +++ b/core/api/src/graphql/admin/root/query/transaction-by-id.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Wallets } from "@app" -import Transaction from "@graphql/shared/types/object/transaction" -import { mapError } from "@graphql/error-map" +import { Wallets } from "@/app" +import Transaction from "@/graphql/shared/types/object/transaction" +import { mapError } from "@/graphql/error-map" const TransactionByIdQuery = GT.Field({ type: Transaction, diff --git a/core/api/src/graphql/admin/root/query/transactions-by-hash.ts b/core/api/src/graphql/admin/root/query/transactions-by-hash.ts index 3e6f1d88bf..1dbba86718 100644 --- a/core/api/src/graphql/admin/root/query/transactions-by-hash.ts +++ b/core/api/src/graphql/admin/root/query/transactions-by-hash.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Wallets } from "@app" -import Transaction from "@graphql/shared/types/object/transaction" -import PaymentHash from "@graphql/shared/types/scalar/payment-hash" -import { mapError } from "@graphql/error-map" +import { Wallets } from "@/app" +import Transaction from "@/graphql/shared/types/object/transaction" +import PaymentHash from "@/graphql/shared/types/scalar/payment-hash" +import { mapError } from "@/graphql/error-map" const TransactionsByHashQuery = GT.Field({ type: GT.List(Transaction), diff --git a/core/api/src/graphql/admin/root/query/wallet.ts b/core/api/src/graphql/admin/root/query/wallet.ts index 9ce0d6b18e..ec93bcb7e1 100644 --- a/core/api/src/graphql/admin/root/query/wallet.ts +++ b/core/api/src/graphql/admin/root/query/wallet.ts @@ -1,7 +1,7 @@ -import { Wallets } from "@app" -import { GT } from "@graphql/index" -import IWallet from "@graphql/shared/types/abstract/wallet" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { Wallets } from "@/app" +import { GT } from "@/graphql/index" +import IWallet from "@/graphql/shared/types/abstract/wallet" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" const WalletQuery = GT.Field({ type: GT.NonNull(IWallet), diff --git a/core/api/src/graphql/admin/types/index.ts b/core/api/src/graphql/admin/types/index.ts index 566bf6c921..be595fab5b 100644 --- a/core/api/src/graphql/admin/types/index.ts +++ b/core/api/src/graphql/admin/types/index.ts @@ -1,5 +1,5 @@ -import BtcWallet from "@graphql/shared/types/object/btc-wallet" -import GraphQLApplicationError from "@graphql/shared/types/object/graphql-application-error" -import UsdWallet from "@graphql/shared/types/object/usd-wallet" +import BtcWallet from "@/graphql/shared/types/object/btc-wallet" +import GraphQLApplicationError from "@/graphql/shared/types/object/graphql-application-error" +import UsdWallet from "@/graphql/shared/types/object/usd-wallet" export const ALL_INTERFACE_TYPES = [GraphQLApplicationError, BtcWallet, UsdWallet] diff --git a/core/api/src/graphql/admin/types/object/account.ts b/core/api/src/graphql/admin/types/object/account.ts index 715e9c90b7..b30c9c9b74 100644 --- a/core/api/src/graphql/admin/types/object/account.ts +++ b/core/api/src/graphql/admin/types/object/account.ts @@ -1,18 +1,19 @@ -import { Wallets, Users } from "@app" -import { GT } from "@graphql/index" -import Coordinates from "@graphql/shared/types/object/coordinates" -import Timestamp from "@graphql/shared/types/scalar/timestamp" -import Username from "@graphql/shared/types/scalar/username" import { GraphQLObjectType } from "graphql" -import Wallet from "@graphql/shared/types/abstract/wallet" -import { mapError } from "@graphql/error-map" - -import AccountLevel from "@graphql/shared/types/scalar/account-level" import AccountStatus from "../scalar/account-status" import GraphQLUser from "./user" +import { Wallets, Users } from "@/app" +import { GT } from "@/graphql/index" +import Coordinates from "@/graphql/shared/types/object/coordinates" +import Timestamp from "@/graphql/shared/types/scalar/timestamp" +import Username from "@/graphql/shared/types/scalar/username" +import Wallet from "@/graphql/shared/types/abstract/wallet" +import { mapError } from "@/graphql/error-map" + +import AccountLevel from "@/graphql/shared/types/scalar/account-level" + const AuditedAccount: GraphQLObjectType = GT.Object({ name: "AuditedAccount", description: diff --git a/core/api/src/graphql/admin/types/object/lightning-invoice.ts b/core/api/src/graphql/admin/types/object/lightning-invoice.ts index dac66852da..c4c3b4ade1 100644 --- a/core/api/src/graphql/admin/types/object/lightning-invoice.ts +++ b/core/api/src/graphql/admin/types/object/lightning-invoice.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" -import LnPaymentPreImage from "@graphql/shared/types/scalar/ln-payment-preimage" -import LnPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import Timestamp from "@graphql/shared/types/scalar/timestamp" +import { GT } from "@/graphql/index" +import LnPaymentPreImage from "@/graphql/shared/types/scalar/ln-payment-preimage" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import Timestamp from "@/graphql/shared/types/scalar/timestamp" const LightningInvoice = GT.Object({ name: "LightningInvoice", diff --git a/core/api/src/graphql/admin/types/object/lightning-payment.ts b/core/api/src/graphql/admin/types/object/lightning-payment.ts index 8d1a033e8e..d3f9b56b22 100644 --- a/core/api/src/graphql/admin/types/object/lightning-payment.ts +++ b/core/api/src/graphql/admin/types/object/lightning-payment.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" -import LnPubkey from "@graphql/shared/types/scalar/ln-pubkey" -import Timestamp from "@graphql/shared/types/scalar/timestamp" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import LnPaymentStatus from "@graphql/shared/types/scalar/ln-payment-status" -import LnPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import LnPaymentPreImage from "@graphql/shared/types/scalar/ln-payment-preimage" +import { GT } from "@/graphql/index" +import LnPubkey from "@/graphql/shared/types/scalar/ln-pubkey" +import Timestamp from "@/graphql/shared/types/scalar/timestamp" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import LnPaymentStatus from "@/graphql/shared/types/scalar/ln-payment-status" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import LnPaymentPreImage from "@/graphql/shared/types/scalar/ln-payment-preimage" const LightningPayment = GT.Object({ name: "LightningPayment", diff --git a/core/api/src/graphql/admin/types/object/user.ts b/core/api/src/graphql/admin/types/object/user.ts index e4c8123785..f14b9d3413 100644 --- a/core/api/src/graphql/admin/types/object/user.ts +++ b/core/api/src/graphql/admin/types/object/user.ts @@ -1,12 +1,12 @@ -import { mapError } from "@graphql/error-map" -import { GT } from "@graphql/index" -import GraphQLEmail from "@graphql/shared/types/object/email" -import Language from "@graphql/shared/types/scalar/language" -import Phone from "@graphql/shared/types/scalar/phone" -import Timestamp from "@graphql/shared/types/scalar/timestamp" +import { mapError } from "@/graphql/error-map" +import { GT } from "@/graphql/index" +import GraphQLEmail from "@/graphql/shared/types/object/email" +import Language from "@/graphql/shared/types/scalar/language" +import Phone from "@/graphql/shared/types/scalar/phone" +import Timestamp from "@/graphql/shared/types/scalar/timestamp" // FIXME should not use service -import { IdentityRepository } from "@services/kratos" +import { IdentityRepository } from "@/services/kratos" const User = GT.Object({ name: "AuditedUser", diff --git a/core/api/src/graphql/admin/types/payload/account-detail.ts b/core/api/src/graphql/admin/types/payload/account-detail.ts index 61e7556b96..d111afb441 100644 --- a/core/api/src/graphql/admin/types/payload/account-detail.ts +++ b/core/api/src/graphql/admin/types/payload/account-detail.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" -import IError from "@graphql/shared/types/abstract/error" - import GraphQLAccount from "../object/account" +import { GT } from "@/graphql/index" +import IError from "@/graphql/shared/types/abstract/error" + const AccountDetailPayload = GT.Object({ name: "AccountDetailPayload", fields: () => ({ diff --git a/core/api/src/graphql/admin/types/payload/admin-push-notification-send.ts b/core/api/src/graphql/admin/types/payload/admin-push-notification-send.ts index 553ef5975d..76643494e0 100644 --- a/core/api/src/graphql/admin/types/payload/admin-push-notification-send.ts +++ b/core/api/src/graphql/admin/types/payload/admin-push-notification-send.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import IError from "@graphql/shared/types/abstract/error" +import { GT } from "@/graphql/index" +import IError from "@/graphql/shared/types/abstract/error" const AdminPushNotificationSendPayload = GT.Object({ name: "AdminPushNotificationSendPayload", diff --git a/core/api/src/graphql/admin/types/payload/wallet-details.ts b/core/api/src/graphql/admin/types/payload/wallet-details.ts index 4908ad3513..1cb001f4e8 100644 --- a/core/api/src/graphql/admin/types/payload/wallet-details.ts +++ b/core/api/src/graphql/admin/types/payload/wallet-details.ts @@ -1,6 +1,6 @@ -import { GT } from "@graphql/index" -import IError from "@graphql/shared/types/abstract/error" -import Wallet from "@graphql/shared/types/abstract/wallet" +import { GT } from "@/graphql/index" +import IError from "@/graphql/shared/types/abstract/error" +import Wallet from "@/graphql/shared/types/abstract/wallet" const WalletDetailsPayload = GT.Object({ name: "WalletDetailsPayload", diff --git a/core/api/src/graphql/admin/types/scalar/account-status.ts b/core/api/src/graphql/admin/types/scalar/account-status.ts index bb5d15637b..adca4ad78a 100644 --- a/core/api/src/graphql/admin/types/scalar/account-status.ts +++ b/core/api/src/graphql/admin/types/scalar/account-status.ts @@ -1,5 +1,5 @@ -import { AccountStatus as DomainAccountStatus } from "@domain/accounts" -import { GT } from "@graphql/index" +import { AccountStatus as DomainAccountStatus } from "@/domain/accounts" +import { GT } from "@/graphql/index" const AccountStatus = GT.Enum({ name: "AccountStatus", diff --git a/core/api/src/graphql/connections.ts b/core/api/src/graphql/connections.ts index 0952bc0810..40f42c9303 100644 --- a/core/api/src/graphql/connections.ts +++ b/core/api/src/graphql/connections.ts @@ -1,11 +1,11 @@ import { getNamedType, resolveObjMapThunk } from "graphql" import { ConnectionConfig, GraphQLConnectionDefinitions } from "graphql-relay" -import { InputValidationError } from "@graphql/error" -import { DEFAULT_MAX_CONNECTION_LIMIT } from "@services/ledger/paginated-ledger" - import { GT } from "." +import { InputValidationError } from "@/graphql/error" +import { DEFAULT_MAX_CONNECTION_LIMIT } from "@/services/ledger/paginated-ledger" + const CURSOR_REGEX = /^[A-Fa-f0-9]{24}$/ // The following function is temporary. It should be replaced by db pagination. diff --git a/core/api/src/graphql/error-map.ts b/core/api/src/graphql/error-map.ts index 4f57624996..0cc43d6a19 100644 --- a/core/api/src/graphql/error-map.ts +++ b/core/api/src/graphql/error-map.ts @@ -33,8 +33,8 @@ import { UnauthorizedIPError, UnauthorizedIPMetadataProxyError, UnauthorizedIPMetadataCountryError, -} from "@graphql/error" -import { baseLogger } from "@services/logger" +} from "@/graphql/error" +import { baseLogger } from "@/services/logger" const assertUnreachable = (x: never): never => { throw new Error(`This should never compile with ${x}`) diff --git a/core/api/src/graphql/error.ts b/core/api/src/graphql/error.ts index 6142914294..8f68b2ce1c 100644 --- a/core/api/src/graphql/error.ts +++ b/core/api/src/graphql/error.ts @@ -1,8 +1,8 @@ import { ApolloError } from "apollo-server-errors" -import { getOnChainWalletConfig } from "@config" +import { getOnChainWalletConfig } from "@/config" -import { baseLogger } from "@services/logger" +import { baseLogger } from "@/services/logger" const onChainWalletConfig = getOnChainWalletConfig() diff --git a/core/api/src/graphql/public/index.ts b/core/api/src/graphql/public/index.ts index cdc6b973b5..98863c70dd 100644 --- a/core/api/src/graphql/public/index.ts +++ b/core/api/src/graphql/public/index.ts @@ -1,11 +1,11 @@ import { GraphQLSchema } from "graphql" -import { ALL_INTERFACE_TYPES } from "@graphql/public/types" - import { QueryType } from "./queries" import { MutationType } from "./mutations" import { SubscriptionType } from "./subscriptions" +import { ALL_INTERFACE_TYPES } from "@/graphql/public/types" + export { queryFields } from "./queries" export { mutationFields } from "./mutations" diff --git a/core/api/src/graphql/public/mutations.ts b/core/api/src/graphql/public/mutations.ts index 73a1a77eb9..25b7843ec7 100644 --- a/core/api/src/graphql/public/mutations.ts +++ b/core/api/src/graphql/public/mutations.ts @@ -1,60 +1,65 @@ -import { GT } from "@graphql/index" - -import DeviceNotificationTokenCreateMutation from "@graphql/public/root/mutation/device-notification-token-create" -import IntraLedgerPaymentSendMutation from "@graphql/public/root/mutation/intraledger-payment-send" -import IntraLedgerUsdPaymentSendMutation from "@graphql/public/root/mutation/intraledger-usd-payment-send" -import LnInvoiceCreateMutation from "@graphql/public/root/mutation/ln-invoice-create" -import LnUsdInvoiceCreateMutation from "@graphql/public/root/mutation/ln-usd-invoice-create" -import LnInvoiceCreateOnBehalfOfRecipientMutation from "@graphql/public/root/mutation/ln-invoice-create-on-behalf-of-recipient" -import LnUsdInvoiceCreateOnBehalfOfRecipientMutation from "@graphql/public/root/mutation/ln-usd-invoice-create-on-behalf-of-recipient" -import LnUsdInvoiceBtcDenominatedCreateOnBehalfOfRecipientMutation from "@graphql/public/root/mutation/ln-usd-invoice-btc-denominated-create-on-behalf-of-recipient" -import LnInvoiceFeeProbeMutation from "@graphql/public/root/mutation/ln-invoice-fee-probe" -import LnUsdInvoiceFeeProbeMutation from "@graphql/public/root/mutation/ln-usd-invoice-fee-probe" -import LnInvoicePaymentSendMutation from "@graphql/public/root/mutation/ln-invoice-payment-send" -import LnNoAmountInvoiceCreateMutation from "@graphql/public/root/mutation/ln-noamount-invoice-create" -import LnNoAmountInvoiceCreateOnBehalfOfRecipientMutation from "@graphql/public/root/mutation/ln-noamount-invoice-create-on-behalf-of-recipient" -import LnNoAmountInvoiceFeeProbeMutation from "@graphql/public/root/mutation/ln-noamount-invoice-fee-probe" -import LnNoAmountUsdInvoiceFeeProbeMutation from "@graphql/public/root/mutation/ln-noamount-usd-invoice-fee-probe" -import LnNoAmountInvoicePaymentSendMutation from "@graphql/public/root/mutation/ln-noamount-invoice-payment-send" -import LnNoAmountUsdInvoicePaymentSendMutation from "@graphql/public/root/mutation/ln-noamount-usd-invoice-payment-send" -import OnChainAddressCreateMutation from "@graphql/public/root/mutation/on-chain-address-create" -import OnChainAddressCurrentMutation from "@graphql/public/root/mutation/on-chain-address-current" -import UserLoginMutation from "@graphql/shared/root/mutation/user-login" - -import UserLogoutMutation from "@graphql/public/root/mutation/user-logout" -import UserUpdateLanguageMutation from "@graphql/public/root/mutation/user-update-language" -import UserUpdateUsernameMutation from "@graphql/public/root/mutation/user-update-username" -import AccountUpdateDefaultWalletIdMutation from "@graphql/public/root/mutation/account-update-default-wallet-id" -import AccountUpdateDisplayCurrencyMutation from "@graphql/public/root/mutation/account-update-display-currency" -import UserContactUpdateAliasMutation from "@graphql/public/root/mutation/user-contact-update-alias" -import UserQuizQuestionUpdateCompletedMutation from "@graphql/public/root/mutation/user-quiz-question-update-completed" -import OnChainPaymentSendMutation from "@graphql/public/root/mutation/onchain-payment-send" -import OnChainUsdPaymentSendMutation from "@graphql/public/root/mutation/onchain-usd-payment-send" -import OnChainUsdPaymentSendAsBtcDenominatedMutation from "@graphql/public/root/mutation/onchain-usd-payment-send-as-sats" -import OnChainPaymentSendAllMutation from "@graphql/public/root/mutation/onchain-payment-send-all" -import CaptchaRequestAuthCodeMutation from "@graphql/shared/root/mutation/captcha-request-auth-code" -import CaptchaCreateChallengeMutation from "@graphql/shared/root/mutation/captcha-create-challenge" -import QuizCompletedMutation from "@graphql/public/root/mutation/quiz-completed" -import AccountDeleteMutation from "@graphql/public/root/mutation/account-delete" -import UserLoginUpgradeMutation from "@graphql/public/root/mutation/user-login-upgrade" -import UserEmailRegistrationInitiateMutation from "@graphql/public/root/mutation/user-email-registration-initiate" -import UserEmailRegistrationValidateMutation from "@graphql/public/root/mutation/user-email-registration-validate" -import FeedbackSubmitMutation from "@graphql/public/root/mutation/feedback-submit" -import UserEmailDeleteMutation from "@graphql/public/root/mutation/user-email-delete" -import UserPhoneDeleteMutation from "@graphql/public/root/mutation/user-phone-delete" -import UserTotpRegistrationInitiateMutation from "@graphql/public/root/mutation/user-totp-registration-initiate" -import UserTotpRegistrationValidateMutation from "@graphql/public/root/mutation/user-totp-registration-validate" -import UserPhoneRegistrationInitiateMutation from "@graphql/public/root/mutation/user-phone-registration-initiate" -import UserPhoneRegistrationValidateMutation from "@graphql/public/root/mutation/user-phone-registration-validate" -import UserTotpDeleteMutation from "@graphql/public/root/mutation/user-totp-delete" - import CallbackEndpointAdd from "./root/mutation/callback-endpoint-add" + import CallbackEndpointDelete from "./root/mutation/callback-endpoint-delete" + import AccountEnableNotificationCategoryMutation from "./root/mutation/account-enable-notification-category-for-channel" + import AccountDisableNotificationCategoryMutation from "./root/mutation/account-disable-notification-category-for-channel" + import AccountEnableNotificationChannelMutation from "./root/mutation/account-enable-notification-channel" + import AccountDisableNotificationChannelMutation from "./root/mutation/account-disable-notification-channel" +import { GT } from "@/graphql/index" + +import DeviceNotificationTokenCreateMutation from "@/graphql/public/root/mutation/device-notification-token-create" +import IntraLedgerPaymentSendMutation from "@/graphql/public/root/mutation/intraledger-payment-send" +import IntraLedgerUsdPaymentSendMutation from "@/graphql/public/root/mutation/intraledger-usd-payment-send" +import LnInvoiceCreateMutation from "@/graphql/public/root/mutation/ln-invoice-create" +import LnUsdInvoiceCreateMutation from "@/graphql/public/root/mutation/ln-usd-invoice-create" +import LnInvoiceCreateOnBehalfOfRecipientMutation from "@/graphql/public/root/mutation/ln-invoice-create-on-behalf-of-recipient" +import LnUsdInvoiceCreateOnBehalfOfRecipientMutation from "@/graphql/public/root/mutation/ln-usd-invoice-create-on-behalf-of-recipient" +import LnUsdInvoiceBtcDenominatedCreateOnBehalfOfRecipientMutation from "@/graphql/public/root/mutation/ln-usd-invoice-btc-denominated-create-on-behalf-of-recipient" +import LnInvoiceFeeProbeMutation from "@/graphql/public/root/mutation/ln-invoice-fee-probe" +import LnUsdInvoiceFeeProbeMutation from "@/graphql/public/root/mutation/ln-usd-invoice-fee-probe" +import LnInvoicePaymentSendMutation from "@/graphql/public/root/mutation/ln-invoice-payment-send" +import LnNoAmountInvoiceCreateMutation from "@/graphql/public/root/mutation/ln-noamount-invoice-create" +import LnNoAmountInvoiceCreateOnBehalfOfRecipientMutation from "@/graphql/public/root/mutation/ln-noamount-invoice-create-on-behalf-of-recipient" +import LnNoAmountInvoiceFeeProbeMutation from "@/graphql/public/root/mutation/ln-noamount-invoice-fee-probe" +import LnNoAmountUsdInvoiceFeeProbeMutation from "@/graphql/public/root/mutation/ln-noamount-usd-invoice-fee-probe" +import LnNoAmountInvoicePaymentSendMutation from "@/graphql/public/root/mutation/ln-noamount-invoice-payment-send" +import LnNoAmountUsdInvoicePaymentSendMutation from "@/graphql/public/root/mutation/ln-noamount-usd-invoice-payment-send" +import OnChainAddressCreateMutation from "@/graphql/public/root/mutation/on-chain-address-create" +import OnChainAddressCurrentMutation from "@/graphql/public/root/mutation/on-chain-address-current" +import UserLoginMutation from "@/graphql/shared/root/mutation/user-login" + +import UserLogoutMutation from "@/graphql/public/root/mutation/user-logout" +import UserUpdateLanguageMutation from "@/graphql/public/root/mutation/user-update-language" +import UserUpdateUsernameMutation from "@/graphql/public/root/mutation/user-update-username" +import AccountUpdateDefaultWalletIdMutation from "@/graphql/public/root/mutation/account-update-default-wallet-id" +import AccountUpdateDisplayCurrencyMutation from "@/graphql/public/root/mutation/account-update-display-currency" +import UserContactUpdateAliasMutation from "@/graphql/public/root/mutation/user-contact-update-alias" +import UserQuizQuestionUpdateCompletedMutation from "@/graphql/public/root/mutation/user-quiz-question-update-completed" +import OnChainPaymentSendMutation from "@/graphql/public/root/mutation/onchain-payment-send" +import OnChainUsdPaymentSendMutation from "@/graphql/public/root/mutation/onchain-usd-payment-send" +import OnChainUsdPaymentSendAsBtcDenominatedMutation from "@/graphql/public/root/mutation/onchain-usd-payment-send-as-sats" +import OnChainPaymentSendAllMutation from "@/graphql/public/root/mutation/onchain-payment-send-all" +import CaptchaRequestAuthCodeMutation from "@/graphql/shared/root/mutation/captcha-request-auth-code" +import CaptchaCreateChallengeMutation from "@/graphql/shared/root/mutation/captcha-create-challenge" +import QuizCompletedMutation from "@/graphql/public/root/mutation/quiz-completed" +import AccountDeleteMutation from "@/graphql/public/root/mutation/account-delete" +import UserLoginUpgradeMutation from "@/graphql/public/root/mutation/user-login-upgrade" +import UserEmailRegistrationInitiateMutation from "@/graphql/public/root/mutation/user-email-registration-initiate" +import UserEmailRegistrationValidateMutation from "@/graphql/public/root/mutation/user-email-registration-validate" +import FeedbackSubmitMutation from "@/graphql/public/root/mutation/feedback-submit" +import UserEmailDeleteMutation from "@/graphql/public/root/mutation/user-email-delete" +import UserPhoneDeleteMutation from "@/graphql/public/root/mutation/user-phone-delete" +import UserTotpRegistrationInitiateMutation from "@/graphql/public/root/mutation/user-totp-registration-initiate" +import UserTotpRegistrationValidateMutation from "@/graphql/public/root/mutation/user-totp-registration-validate" +import UserPhoneRegistrationInitiateMutation from "@/graphql/public/root/mutation/user-phone-registration-initiate" +import UserPhoneRegistrationValidateMutation from "@/graphql/public/root/mutation/user-phone-registration-validate" +import UserTotpDeleteMutation from "@/graphql/public/root/mutation/user-totp-delete" + // TODO: // const fields: { [key: string]: GraphQLFieldConfig } export const mutationFields = { unauthed: { diff --git a/core/api/src/graphql/public/queries.ts b/core/api/src/graphql/public/queries.ts index b41983aeb6..d2024cf9cb 100644 --- a/core/api/src/graphql/public/queries.ts +++ b/core/api/src/graphql/public/queries.ts @@ -1,21 +1,21 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import MeQuery from "@graphql/public/root/query/me" -import GlobalsQuery from "@graphql/public/root/query/globals" -import BtcPriceQuery from "@graphql/public/root/query/btc-price" -import CurrencyListQuery from "@graphql/public/root/query/currency-list" -import BtcPriceListQuery from "@graphql/public/root/query/btc-price-list" -import QuizQuestionsQuery from "@graphql/public/root/query/quiz-questions" -import RealtimePriceQuery from "@graphql/public/root/query/realtime-price" -import MobileVersionsQuery from "@graphql/public/root/query/mobile-versions" -import OnChainTxFeeQuery from "@graphql/public/root/query/on-chain-tx-fee-query" -import OnChainUsdTxFeeQuery from "@graphql/public/root/query/on-chain-usd-tx-fee-query" -import OnChainUsdTxFeeAsBtcDenominatedQuery from "@graphql/public/root/query/on-chain-usd-tx-fee-query-as-sats" -import UsernameAvailableQuery from "@graphql/public/root/query/username-available" -import BusinessMapMarkersQuery from "@graphql/public/root/query/business-map-markers" -import AccountDefaultWalletQuery from "@graphql/public/root/query/account-default-wallet" -import AccountDefaultWalletIdQuery from "@graphql/public/root/query/account-default-wallet-id" -import LnInvoicePaymentStatusQuery from "@graphql/public/root/query/ln-invoice-payment-status" +import MeQuery from "@/graphql/public/root/query/me" +import GlobalsQuery from "@/graphql/public/root/query/globals" +import BtcPriceQuery from "@/graphql/public/root/query/btc-price" +import CurrencyListQuery from "@/graphql/public/root/query/currency-list" +import BtcPriceListQuery from "@/graphql/public/root/query/btc-price-list" +import QuizQuestionsQuery from "@/graphql/public/root/query/quiz-questions" +import RealtimePriceQuery from "@/graphql/public/root/query/realtime-price" +import MobileVersionsQuery from "@/graphql/public/root/query/mobile-versions" +import OnChainTxFeeQuery from "@/graphql/public/root/query/on-chain-tx-fee-query" +import OnChainUsdTxFeeQuery from "@/graphql/public/root/query/on-chain-usd-tx-fee-query" +import OnChainUsdTxFeeAsBtcDenominatedQuery from "@/graphql/public/root/query/on-chain-usd-tx-fee-query-as-sats" +import UsernameAvailableQuery from "@/graphql/public/root/query/username-available" +import BusinessMapMarkersQuery from "@/graphql/public/root/query/business-map-markers" +import AccountDefaultWalletQuery from "@/graphql/public/root/query/account-default-wallet" +import AccountDefaultWalletIdQuery from "@/graphql/public/root/query/account-default-wallet-id" +import LnInvoicePaymentStatusQuery from "@/graphql/public/root/query/ln-invoice-payment-status" export const queryFields = { unauthed: { diff --git a/core/api/src/graphql/public/root/mutation/account-delete.ts b/core/api/src/graphql/public/root/mutation/account-delete.ts index 19fe90e5fc..6375691d37 100644 --- a/core/api/src/graphql/public/root/mutation/account-delete.ts +++ b/core/api/src/graphql/public/root/mutation/account-delete.ts @@ -1,8 +1,8 @@ -import { Accounts } from "@app" +import { Accounts } from "@/app" -import { GT } from "@graphql/index" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import AccountDeletePayload from "@graphql/public/types/payload/account-delete" +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import AccountDeletePayload from "@/graphql/public/types/payload/account-delete" const AccountDeleteMutation = GT.Field({ extensions: { diff --git a/core/api/src/graphql/public/root/mutation/account-disable-notification-category-for-channel.ts b/core/api/src/graphql/public/root/mutation/account-disable-notification-category-for-channel.ts index 274faab7c2..1d1d428d44 100644 --- a/core/api/src/graphql/public/root/mutation/account-disable-notification-category-for-channel.ts +++ b/core/api/src/graphql/public/root/mutation/account-disable-notification-category-for-channel.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AccountUpdateNotificationSettingsPayload from "@graphql/public/types/payload/account-update-notification-settings" -import { Accounts } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import NotificationChannel from "@graphql/shared/types/scalar/notification-channel" -import NotificationCategory from "@graphql/shared/types/scalar/notification-category" +import AccountUpdateNotificationSettingsPayload from "@/graphql/public/types/payload/account-update-notification-settings" +import { Accounts } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import NotificationChannel from "@/graphql/shared/types/scalar/notification-channel" +import NotificationCategory from "@/graphql/shared/types/scalar/notification-category" const AccountDisableNotificationCategoryInput = GT.Input({ name: "AccountDisableNotificationCategoryInput", diff --git a/core/api/src/graphql/public/root/mutation/account-disable-notification-channel.ts b/core/api/src/graphql/public/root/mutation/account-disable-notification-channel.ts index 40c06977de..dc79195cae 100644 --- a/core/api/src/graphql/public/root/mutation/account-disable-notification-channel.ts +++ b/core/api/src/graphql/public/root/mutation/account-disable-notification-channel.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AccountUpdateNotificationSettingsPayload from "@graphql/public/types/payload/account-update-notification-settings" -import { Accounts } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import NotificationChannel from "@graphql/shared/types/scalar/notification-channel" +import AccountUpdateNotificationSettingsPayload from "@/graphql/public/types/payload/account-update-notification-settings" +import { Accounts } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import NotificationChannel from "@/graphql/shared/types/scalar/notification-channel" const AccountDisableNotificationChannelInput = GT.Input({ name: "AccountDisableNotificationChannelInput", diff --git a/core/api/src/graphql/public/root/mutation/account-enable-notification-category-for-channel.ts b/core/api/src/graphql/public/root/mutation/account-enable-notification-category-for-channel.ts index c52cd3d89c..415ef3d2a4 100644 --- a/core/api/src/graphql/public/root/mutation/account-enable-notification-category-for-channel.ts +++ b/core/api/src/graphql/public/root/mutation/account-enable-notification-category-for-channel.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AccountUpdateNotificationSettingsPayload from "@graphql/public/types/payload/account-update-notification-settings" -import { Accounts } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import NotificationChannel from "@graphql/shared/types/scalar/notification-channel" -import NotificationCategory from "@graphql/shared/types/scalar/notification-category" +import AccountUpdateNotificationSettingsPayload from "@/graphql/public/types/payload/account-update-notification-settings" +import { Accounts } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import NotificationChannel from "@/graphql/shared/types/scalar/notification-channel" +import NotificationCategory from "@/graphql/shared/types/scalar/notification-category" const AccountEnableNotificationCategoryInput = GT.Input({ name: "AccountEnableNotificationCategoryInput", diff --git a/core/api/src/graphql/public/root/mutation/account-enable-notification-channel.ts b/core/api/src/graphql/public/root/mutation/account-enable-notification-channel.ts index 5cd1372054..8057906372 100644 --- a/core/api/src/graphql/public/root/mutation/account-enable-notification-channel.ts +++ b/core/api/src/graphql/public/root/mutation/account-enable-notification-channel.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import AccountUpdateNotificationSettingsPayload from "@graphql/public/types/payload/account-update-notification-settings" -import { Accounts } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import NotificationChannel from "@graphql/shared/types/scalar/notification-channel" +import AccountUpdateNotificationSettingsPayload from "@/graphql/public/types/payload/account-update-notification-settings" +import { Accounts } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import NotificationChannel from "@/graphql/shared/types/scalar/notification-channel" const AccountEnableNotificationChannelInput = GT.Input({ name: "AccountEnableNotificationChannelInput", diff --git a/core/api/src/graphql/public/root/mutation/account-update-default-wallet-id.ts b/core/api/src/graphql/public/root/mutation/account-update-default-wallet-id.ts index 2870bb8d14..5c56d2d4fd 100644 --- a/core/api/src/graphql/public/root/mutation/account-update-default-wallet-id.ts +++ b/core/api/src/graphql/public/root/mutation/account-update-default-wallet-id.ts @@ -1,9 +1,9 @@ -import { Accounts } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" +import { Accounts } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" -import AccountUpdateDefaultWalletIdPayload from "@graphql/public/types/payload/account-update-default-wallet-id" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import AccountUpdateDefaultWalletIdPayload from "@/graphql/public/types/payload/account-update-default-wallet-id" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" const AccountUpdateDefaultWalletIdInput = GT.Input({ name: "AccountUpdateDefaultWalletIdInput", diff --git a/core/api/src/graphql/public/root/mutation/account-update-display-currency.ts b/core/api/src/graphql/public/root/mutation/account-update-display-currency.ts index f9c5c13662..b7ac45674a 100644 --- a/core/api/src/graphql/public/root/mutation/account-update-display-currency.ts +++ b/core/api/src/graphql/public/root/mutation/account-update-display-currency.ts @@ -1,9 +1,9 @@ -import { Accounts } from "@app" +import { Accounts } from "@/app" -import { GT } from "@graphql/index" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import DisplayCurrency from "@graphql/shared/types/scalar/display-currency" -import AccountUpdateDisplayCurrencyPayload from "@graphql/public/types/payload/account-update-display-currency" +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import DisplayCurrency from "@/graphql/shared/types/scalar/display-currency" +import AccountUpdateDisplayCurrencyPayload from "@/graphql/public/types/payload/account-update-display-currency" const AccountUpdateDisplayCurrencyInput = GT.Input({ name: "AccountUpdateDisplayCurrencyInput", diff --git a/core/api/src/graphql/public/root/mutation/callback-endpoint-add.ts b/core/api/src/graphql/public/root/mutation/callback-endpoint-add.ts index 64742a4c0e..aafadf1e24 100644 --- a/core/api/src/graphql/public/root/mutation/callback-endpoint-add.ts +++ b/core/api/src/graphql/public/root/mutation/callback-endpoint-add.ts @@ -1,9 +1,9 @@ -import { Callback } from "@app" +import { Callback } from "@/app" -import { GT } from "@graphql/index" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import EndpointUrl from "@graphql/public/types/scalar/endpoint-url" -import CallbackEndpointAddPayload from "@graphql/public/types/payload/callback-endpoint-add" +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import EndpointUrl from "@/graphql/public/types/scalar/endpoint-url" +import CallbackEndpointAddPayload from "@/graphql/public/types/payload/callback-endpoint-add" const CallbackEndpointAddInput = GT.Input({ name: "CallbackEndpointAddInput", diff --git a/core/api/src/graphql/public/root/mutation/callback-endpoint-delete.ts b/core/api/src/graphql/public/root/mutation/callback-endpoint-delete.ts index fd740b9bb5..3c1379f1f7 100644 --- a/core/api/src/graphql/public/root/mutation/callback-endpoint-delete.ts +++ b/core/api/src/graphql/public/root/mutation/callback-endpoint-delete.ts @@ -1,9 +1,9 @@ -import { Callback } from "@app" +import { Callback } from "@/app" -import { GT } from "@graphql/index" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import EndpointId from "@graphql/public/types/scalar/endpoint-id" -import SuccessPayload from "@graphql/shared/types/payload/success-payload" +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import EndpointId from "@/graphql/public/types/scalar/endpoint-id" +import SuccessPayload from "@/graphql/shared/types/payload/success-payload" const CallbackEndpointDeleteInput = GT.Input({ name: "CallbackEndpointDeleteInput", diff --git a/core/api/src/graphql/public/root/mutation/device-notification-token-create.ts b/core/api/src/graphql/public/root/mutation/device-notification-token-create.ts index e76aa2b445..ec3a95603a 100644 --- a/core/api/src/graphql/public/root/mutation/device-notification-token-create.ts +++ b/core/api/src/graphql/public/root/mutation/device-notification-token-create.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import SuccessPayload from "@graphql/shared/types/payload/success-payload" +import SuccessPayload from "@/graphql/shared/types/payload/success-payload" -import { Users } from "@app" -import { parseErrorMessageFromUnknown } from "@domain/shared" +import { Users } from "@/app" +import { parseErrorMessageFromUnknown } from "@/domain/shared" const DeviceNotificationTokenCreateInput = GT.Input({ name: "DeviceNotificationTokenCreateInput", diff --git a/core/api/src/graphql/public/root/mutation/feedback-submit.ts b/core/api/src/graphql/public/root/mutation/feedback-submit.ts index 4807fca679..30e65321e6 100644 --- a/core/api/src/graphql/public/root/mutation/feedback-submit.ts +++ b/core/api/src/graphql/public/root/mutation/feedback-submit.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import SuccessPayload from "@graphql/shared/types/payload/success-payload" -import Feedback from "@graphql/public/types/scalar/feedback" -import { Comm } from "@app" +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import SuccessPayload from "@/graphql/shared/types/payload/success-payload" +import Feedback from "@/graphql/public/types/scalar/feedback" +import { Comm } from "@/app" const FeedbackSubmitInput = GT.Input({ name: "FeedbackSubmitInput", diff --git a/core/api/src/graphql/public/root/mutation/intraledger-payment-send.ts b/core/api/src/graphql/public/root/mutation/intraledger-payment-send.ts index 0f23c44ca0..60581a6d6f 100644 --- a/core/api/src/graphql/public/root/mutation/intraledger-payment-send.ts +++ b/core/api/src/graphql/public/root/mutation/intraledger-payment-send.ts @@ -1,13 +1,14 @@ -import { Accounts, Payments } from "@app" -import { checkedToWalletId } from "@domain/wallets" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import Memo from "@graphql/shared/types/scalar/memo" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import WalletId from "@graphql/shared/types/scalar/wallet-id" import dedent from "dedent" +import { Accounts, Payments } from "@/app" +import { checkedToWalletId } from "@/domain/wallets" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import Memo from "@/graphql/shared/types/scalar/memo" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" + const IntraLedgerPaymentSendInput = GT.Input({ name: "IntraLedgerPaymentSendInput", fields: () => ({ diff --git a/core/api/src/graphql/public/root/mutation/intraledger-usd-payment-send.ts b/core/api/src/graphql/public/root/mutation/intraledger-usd-payment-send.ts index 432e52c6a4..55bbae7ba7 100644 --- a/core/api/src/graphql/public/root/mutation/intraledger-usd-payment-send.ts +++ b/core/api/src/graphql/public/root/mutation/intraledger-usd-payment-send.ts @@ -1,13 +1,14 @@ -import { Accounts, Payments } from "@app" -import { checkedToWalletId } from "@domain/wallets" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import CentAmount from "@graphql/public/types/scalar/cent-amount" -import Memo from "@graphql/shared/types/scalar/memo" -import WalletId from "@graphql/shared/types/scalar/wallet-id" import dedent from "dedent" +import { Accounts, Payments } from "@/app" +import { checkedToWalletId } from "@/domain/wallets" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" +import Memo from "@/graphql/shared/types/scalar/memo" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" + const IntraLedgerUsdPaymentSendInput = GT.Input({ name: "IntraLedgerUsdPaymentSendInput", fields: () => ({ diff --git a/core/api/src/graphql/public/root/mutation/ln-invoice-create-on-behalf-of-recipient.ts b/core/api/src/graphql/public/root/mutation/ln-invoice-create-on-behalf-of-recipient.ts index 2644e1f6f8..67e2a8f257 100644 --- a/core/api/src/graphql/public/root/mutation/ln-invoice-create-on-behalf-of-recipient.ts +++ b/core/api/src/graphql/public/root/mutation/ln-invoice-create-on-behalf-of-recipient.ts @@ -1,15 +1,15 @@ import dedent from "dedent" -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import Minutes from "@graphql/public/types/scalar/minutes" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import Hex32Bytes from "@graphql/public/types/scalar/hex32bytes" -import LnInvoicePayload from "@graphql/public/types/payload/ln-invoice" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import Minutes from "@/graphql/public/types/scalar/minutes" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import Hex32Bytes from "@/graphql/public/types/scalar/hex32bytes" +import LnInvoicePayload from "@/graphql/public/types/payload/ln-invoice" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const LnInvoiceCreateOnBehalfOfRecipientInput = GT.Input({ name: "LnInvoiceCreateOnBehalfOfRecipientInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-invoice-create.ts b/core/api/src/graphql/public/root/mutation/ln-invoice-create.ts index cb84391872..703b812fc4 100644 --- a/core/api/src/graphql/public/root/mutation/ln-invoice-create.ts +++ b/core/api/src/graphql/public/root/mutation/ln-invoice-create.ts @@ -1,14 +1,14 @@ import dedent from "dedent" -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import Minutes from "@graphql/public/types/scalar/minutes" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import LnInvoicePayload from "@graphql/public/types/payload/ln-invoice" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import Minutes from "@/graphql/public/types/scalar/minutes" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import LnInvoicePayload from "@/graphql/public/types/payload/ln-invoice" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const LnInvoiceCreateInput = GT.Input({ name: "LnInvoiceCreateInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-invoice-fee-probe.ts b/core/api/src/graphql/public/root/mutation/ln-invoice-fee-probe.ts index beb2e21176..22a3991e97 100644 --- a/core/api/src/graphql/public/root/mutation/ln-invoice-fee-probe.ts +++ b/core/api/src/graphql/public/root/mutation/ln-invoice-fee-probe.ts @@ -1,14 +1,14 @@ -import { InvalidFeeProbeStateError } from "@domain/bitcoin/lightning" +import { normalizePaymentAmount } from "../../../shared/root/mutation" -import { Payments } from "@app" +import { InvalidFeeProbeStateError } from "@/domain/bitcoin/lightning" -import { GT } from "@graphql/index" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import SatAmountPayload from "@graphql/public/types/payload/sat-amount" -import LnPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { Payments } from "@/app" -import { normalizePaymentAmount } from "../../../shared/root/mutation" +import { GT } from "@/graphql/index" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import SatAmountPayload from "@/graphql/public/types/payload/sat-amount" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const LnInvoiceFeeProbeInput = GT.Input({ name: "LnInvoiceFeeProbeInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-invoice-payment-send.ts b/core/api/src/graphql/public/root/mutation/ln-invoice-payment-send.ts index d4443018ba..72c873d9e4 100644 --- a/core/api/src/graphql/public/root/mutation/ln-invoice-payment-send.ts +++ b/core/api/src/graphql/public/root/mutation/ln-invoice-payment-send.ts @@ -1,13 +1,14 @@ -import { Payments } from "@app" -import { InputValidationError } from "@graphql/error" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import LnPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import Memo from "@graphql/shared/types/scalar/memo" -import WalletId from "@graphql/shared/types/scalar/wallet-id" import dedent from "dedent" +import { Payments } from "@/app" +import { InputValidationError } from "@/graphql/error" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import Memo from "@/graphql/shared/types/scalar/memo" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" + const LnInvoicePaymentInput = GT.Input({ name: "LnInvoicePaymentInput", fields: () => ({ diff --git a/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-create-on-behalf-of-recipient.ts b/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-create-on-behalf-of-recipient.ts index 55713ab542..7ca5d8a177 100644 --- a/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-create-on-behalf-of-recipient.ts +++ b/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-create-on-behalf-of-recipient.ts @@ -1,13 +1,13 @@ import dedent from "dedent" -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import Minutes from "@graphql/public/types/scalar/minutes" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import LnNoAmountInvoicePayload from "@graphql/public/types/payload/ln-noamount-invoice" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import Minutes from "@/graphql/public/types/scalar/minutes" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import LnNoAmountInvoicePayload from "@/graphql/public/types/payload/ln-noamount-invoice" const LnNoAmountInvoiceCreateOnBehalfOfRecipientInput = GT.Input({ name: "LnNoAmountInvoiceCreateOnBehalfOfRecipientInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-create.ts b/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-create.ts index c8c78da69a..2218c2becf 100644 --- a/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-create.ts +++ b/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-create.ts @@ -1,13 +1,13 @@ import dedent from "dedent" -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import Minutes from "@graphql/public/types/scalar/minutes" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import LnNoAmountInvoicePayload from "@graphql/public/types/payload/ln-noamount-invoice" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import Minutes from "@/graphql/public/types/scalar/minutes" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import LnNoAmountInvoicePayload from "@/graphql/public/types/payload/ln-noamount-invoice" const LnNoAmountInvoiceCreateInput = GT.Input({ name: "LnNoAmountInvoiceCreateInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-fee-probe.ts b/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-fee-probe.ts index fee01b33b1..2abbfc867f 100644 --- a/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-fee-probe.ts +++ b/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-fee-probe.ts @@ -1,15 +1,15 @@ -import { InvalidFeeProbeStateError } from "@domain/bitcoin/lightning" +import { normalizePaymentAmount } from "../../../shared/root/mutation" -import { Payments } from "@app" +import { InvalidFeeProbeStateError } from "@/domain/bitcoin/lightning" -import { GT } from "@graphql/index" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import SatAmountPayload from "@graphql/public/types/payload/sat-amount" -import LnPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { Payments } from "@/app" -import { normalizePaymentAmount } from "../../../shared/root/mutation" +import { GT } from "@/graphql/index" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import SatAmountPayload from "@/graphql/public/types/payload/sat-amount" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const LnNoAmountInvoiceFeeProbeInput = GT.Input({ name: "LnNoAmountInvoiceFeeProbeInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-payment-send.ts b/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-payment-send.ts index d7d1380cde..7bfe81f0f2 100644 --- a/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-payment-send.ts +++ b/core/api/src/graphql/public/root/mutation/ln-noamount-invoice-payment-send.ts @@ -1,14 +1,15 @@ -import { GT } from "@graphql/index" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import Memo from "@graphql/shared/types/scalar/memo" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import { Payments } from "@app" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import LnIPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import { InputValidationError } from "@graphql/error" import dedent from "dedent" +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import Memo from "@/graphql/shared/types/scalar/memo" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import { Payments } from "@/app" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import LnIPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import { InputValidationError } from "@/graphql/error" + const LnNoAmountInvoicePaymentInput = GT.Input({ name: "LnNoAmountInvoicePaymentInput", fields: () => ({ diff --git a/core/api/src/graphql/public/root/mutation/ln-noamount-usd-invoice-fee-probe.ts b/core/api/src/graphql/public/root/mutation/ln-noamount-usd-invoice-fee-probe.ts index b3c016473e..acdb977f87 100644 --- a/core/api/src/graphql/public/root/mutation/ln-noamount-usd-invoice-fee-probe.ts +++ b/core/api/src/graphql/public/root/mutation/ln-noamount-usd-invoice-fee-probe.ts @@ -1,15 +1,15 @@ -import { InvalidFeeProbeStateError } from "@domain/bitcoin/lightning" +import { normalizePaymentAmount } from "../../../shared/root/mutation" -import { Payments } from "@app" +import { InvalidFeeProbeStateError } from "@/domain/bitcoin/lightning" -import { GT } from "@graphql/index" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import CentAmount from "@graphql/public/types/scalar/cent-amount" -import CentAmountPayload from "@graphql/public/types/payload/cent-amount" -import LnPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { Payments } from "@/app" -import { normalizePaymentAmount } from "../../../shared/root/mutation" +import { GT } from "@/graphql/index" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" +import CentAmountPayload from "@/graphql/public/types/payload/cent-amount" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const LnNoAmountUsdInvoiceFeeProbeInput = GT.Input({ name: "LnNoAmountUsdInvoiceFeeProbeInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-noamount-usd-invoice-payment-send.ts b/core/api/src/graphql/public/root/mutation/ln-noamount-usd-invoice-payment-send.ts index cb20531fef..311b11fc79 100644 --- a/core/api/src/graphql/public/root/mutation/ln-noamount-usd-invoice-payment-send.ts +++ b/core/api/src/graphql/public/root/mutation/ln-noamount-usd-invoice-payment-send.ts @@ -1,14 +1,15 @@ -import { GT } from "@graphql/index" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import Memo from "@graphql/shared/types/scalar/memo" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import { Payments } from "@app" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import LnIPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import { InputValidationError } from "@graphql/error" -import CentAmount from "@graphql/public/types/scalar/cent-amount" import dedent from "dedent" +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import Memo from "@/graphql/shared/types/scalar/memo" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import { Payments } from "@/app" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import LnIPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import { InputValidationError } from "@/graphql/error" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" + const LnNoAmountUsdInvoicePaymentInput = GT.Input({ name: "LnNoAmountUsdInvoicePaymentInput", fields: () => ({ diff --git a/core/api/src/graphql/public/root/mutation/ln-usd-invoice-btc-denominated-create-on-behalf-of-recipient.ts b/core/api/src/graphql/public/root/mutation/ln-usd-invoice-btc-denominated-create-on-behalf-of-recipient.ts index 59a7725256..a891441876 100644 --- a/core/api/src/graphql/public/root/mutation/ln-usd-invoice-btc-denominated-create-on-behalf-of-recipient.ts +++ b/core/api/src/graphql/public/root/mutation/ln-usd-invoice-btc-denominated-create-on-behalf-of-recipient.ts @@ -1,15 +1,15 @@ import dedent from "dedent" -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import Minutes from "@graphql/public/types/scalar/minutes" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import Hex32Bytes from "@graphql/public/types/scalar/hex32bytes" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import LnInvoicePayload from "@graphql/public/types/payload/ln-invoice" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import Minutes from "@/graphql/public/types/scalar/minutes" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import Hex32Bytes from "@/graphql/public/types/scalar/hex32bytes" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import LnInvoicePayload from "@/graphql/public/types/payload/ln-invoice" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const LnUsdInvoiceBtcDenominatedCreateOnBehalfOfRecipientInput = GT.Input({ name: "LnUsdInvoiceBtcDenominatedCreateOnBehalfOfRecipientInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-usd-invoice-create-on-behalf-of-recipient.ts b/core/api/src/graphql/public/root/mutation/ln-usd-invoice-create-on-behalf-of-recipient.ts index 7a18599756..7584798c75 100644 --- a/core/api/src/graphql/public/root/mutation/ln-usd-invoice-create-on-behalf-of-recipient.ts +++ b/core/api/src/graphql/public/root/mutation/ln-usd-invoice-create-on-behalf-of-recipient.ts @@ -1,15 +1,15 @@ import dedent from "dedent" -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import Minutes from "@graphql/public/types/scalar/minutes" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import Hex32Bytes from "@graphql/public/types/scalar/hex32bytes" -import CentAmount from "@graphql/public/types/scalar/cent-amount" -import LnInvoicePayload from "@graphql/public/types/payload/ln-invoice" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import Minutes from "@/graphql/public/types/scalar/minutes" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import Hex32Bytes from "@/graphql/public/types/scalar/hex32bytes" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" +import LnInvoicePayload from "@/graphql/public/types/payload/ln-invoice" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const LnUsdInvoiceCreateOnBehalfOfRecipientInput = GT.Input({ name: "LnUsdInvoiceCreateOnBehalfOfRecipientInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-usd-invoice-create.ts b/core/api/src/graphql/public/root/mutation/ln-usd-invoice-create.ts index 8c78bcd3bf..8518335457 100644 --- a/core/api/src/graphql/public/root/mutation/ln-usd-invoice-create.ts +++ b/core/api/src/graphql/public/root/mutation/ln-usd-invoice-create.ts @@ -1,14 +1,14 @@ import dedent from "dedent" -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import Minutes from "@graphql/public/types/scalar/minutes" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import CentAmount from "@graphql/public/types/scalar/cent-amount" -import LnInvoicePayload from "@graphql/public/types/payload/ln-invoice" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import Minutes from "@/graphql/public/types/scalar/minutes" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" +import LnInvoicePayload from "@/graphql/public/types/payload/ln-invoice" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const LnUsdInvoiceCreateInput = GT.Input({ name: "LnUsdInvoiceCreateInput", diff --git a/core/api/src/graphql/public/root/mutation/ln-usd-invoice-fee-probe.ts b/core/api/src/graphql/public/root/mutation/ln-usd-invoice-fee-probe.ts index 7093828341..b65b1b2866 100644 --- a/core/api/src/graphql/public/root/mutation/ln-usd-invoice-fee-probe.ts +++ b/core/api/src/graphql/public/root/mutation/ln-usd-invoice-fee-probe.ts @@ -1,16 +1,16 @@ -import { InvalidFeeProbeStateError } from "@domain/bitcoin/lightning" +import { normalizePaymentAmount } from "../../../shared/root/mutation" -import { Payments } from "@app" +import { InvalidFeeProbeStateError } from "@/domain/bitcoin/lightning" -import { GT } from "@graphql/index" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import CentAmountPayload from "@graphql/public/types/payload/sat-amount" -import LnPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { Payments } from "@/app" -import { checkedToWalletId } from "@domain/wallets" +import { GT } from "@/graphql/index" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import CentAmountPayload from "@/graphql/public/types/payload/sat-amount" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" -import { normalizePaymentAmount } from "../../../shared/root/mutation" +import { checkedToWalletId } from "@/domain/wallets" const LnUsdInvoiceFeeProbeInput = GT.Input({ name: "LnUsdInvoiceFeeProbeInput", diff --git a/core/api/src/graphql/public/root/mutation/on-chain-address-create.ts b/core/api/src/graphql/public/root/mutation/on-chain-address-create.ts index 269e717da1..c4d0526829 100644 --- a/core/api/src/graphql/public/root/mutation/on-chain-address-create.ts +++ b/core/api/src/graphql/public/root/mutation/on-chain-address-create.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" -import { Wallets } from "@app" -import OnChainAddressPayload from "@graphql/public/types/payload/on-chain-address" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import { Wallets } from "@/app" +import OnChainAddressPayload from "@/graphql/public/types/payload/on-chain-address" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const OnChainAddressCreateInput = GT.Input({ name: "OnChainAddressCreateInput", diff --git a/core/api/src/graphql/public/root/mutation/on-chain-address-current.ts b/core/api/src/graphql/public/root/mutation/on-chain-address-current.ts index 8245f36e10..ed69dc3531 100644 --- a/core/api/src/graphql/public/root/mutation/on-chain-address-current.ts +++ b/core/api/src/graphql/public/root/mutation/on-chain-address-current.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import OnChainAddressPayload from "@graphql/public/types/payload/on-chain-address" -import { Wallets } from "@app" +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import OnChainAddressPayload from "@/graphql/public/types/payload/on-chain-address" +import { Wallets } from "@/app" const OnChainAddressCurrentInput = GT.Input({ name: "OnChainAddressCurrentInput", diff --git a/core/api/src/graphql/public/root/mutation/onchain-payment-send-all.ts b/core/api/src/graphql/public/root/mutation/onchain-payment-send-all.ts index 55be869fbe..fa20558409 100644 --- a/core/api/src/graphql/public/root/mutation/onchain-payment-send-all.ts +++ b/core/api/src/graphql/public/root/mutation/onchain-payment-send-all.ts @@ -1,14 +1,14 @@ -import { PayoutSpeed as DomainPayoutSpeed } from "@domain/bitcoin/onchain" +import { PayoutSpeed as DomainPayoutSpeed } from "@/domain/bitcoin/onchain" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import OnChainAddress from "@graphql/shared/types/scalar/on-chain-address" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import PayoutSpeed from "@graphql/public/types/scalar/payout-speed" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import OnChainAddress from "@/graphql/shared/types/scalar/on-chain-address" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import PayoutSpeed from "@/graphql/public/types/scalar/payout-speed" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" -import { Payments } from "@app" +import { Payments } from "@/app" const OnChainPaymentSendAllInput = GT.Input({ name: "OnChainPaymentSendAllInput", diff --git a/core/api/src/graphql/public/root/mutation/onchain-payment-send.ts b/core/api/src/graphql/public/root/mutation/onchain-payment-send.ts index 51c5962ab6..5045323248 100644 --- a/core/api/src/graphql/public/root/mutation/onchain-payment-send.ts +++ b/core/api/src/graphql/public/root/mutation/onchain-payment-send.ts @@ -1,15 +1,15 @@ -import { PayoutSpeed as DomainPayoutSpeed } from "@domain/bitcoin/onchain" +import { PayoutSpeed as DomainPayoutSpeed } from "@/domain/bitcoin/onchain" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import OnChainAddress from "@graphql/shared/types/scalar/on-chain-address" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import PayoutSpeed from "@graphql/public/types/scalar/payout-speed" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import OnChainAddress from "@/graphql/shared/types/scalar/on-chain-address" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import PayoutSpeed from "@/graphql/public/types/scalar/payout-speed" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" -import { Payments } from "@app" +import { Payments } from "@/app" const OnChainPaymentSendInput = GT.Input({ name: "OnChainPaymentSendInput", diff --git a/core/api/src/graphql/public/root/mutation/onchain-usd-payment-send-as-sats.ts b/core/api/src/graphql/public/root/mutation/onchain-usd-payment-send-as-sats.ts index 41030c50a5..958dec94ee 100644 --- a/core/api/src/graphql/public/root/mutation/onchain-usd-payment-send-as-sats.ts +++ b/core/api/src/graphql/public/root/mutation/onchain-usd-payment-send-as-sats.ts @@ -1,15 +1,15 @@ -import { PayoutSpeed as DomainPayoutSpeed } from "@domain/bitcoin/onchain" +import { PayoutSpeed as DomainPayoutSpeed } from "@/domain/bitcoin/onchain" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import OnChainAddress from "@graphql/shared/types/scalar/on-chain-address" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import PayoutSpeed from "@graphql/public/types/scalar/payout-speed" -import SatsAmount from "@graphql/shared/types/scalar/sat-amount" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import OnChainAddress from "@/graphql/shared/types/scalar/on-chain-address" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import PayoutSpeed from "@/graphql/public/types/scalar/payout-speed" +import SatsAmount from "@/graphql/shared/types/scalar/sat-amount" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" -import { Payments } from "@app" +import { Payments } from "@/app" const OnChainUsdPaymentSendAsBtcDenominatedInput = GT.Input({ name: "OnChainUsdPaymentSendAsBtcDenominatedInput", diff --git a/core/api/src/graphql/public/root/mutation/onchain-usd-payment-send.ts b/core/api/src/graphql/public/root/mutation/onchain-usd-payment-send.ts index 178a70f1a4..7bb64a04bd 100644 --- a/core/api/src/graphql/public/root/mutation/onchain-usd-payment-send.ts +++ b/core/api/src/graphql/public/root/mutation/onchain-usd-payment-send.ts @@ -1,15 +1,15 @@ -import { PayoutSpeed as DomainPayoutSpeed } from "@domain/bitcoin/onchain" +import { PayoutSpeed as DomainPayoutSpeed } from "@/domain/bitcoin/onchain" -import { GT } from "@graphql/index" -import Memo from "@graphql/shared/types/scalar/memo" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import CentAmount from "@graphql/public/types/scalar/cent-amount" -import OnChainAddress from "@graphql/shared/types/scalar/on-chain-address" -import PaymentSendPayload from "@graphql/public/types/payload/payment-send" -import PayoutSpeed from "@graphql/public/types/scalar/payout-speed" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" +import Memo from "@/graphql/shared/types/scalar/memo" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" +import OnChainAddress from "@/graphql/shared/types/scalar/on-chain-address" +import PaymentSendPayload from "@/graphql/public/types/payload/payment-send" +import PayoutSpeed from "@/graphql/public/types/scalar/payout-speed" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" -import { Payments } from "@app" +import { Payments } from "@/app" const OnChainUsdPaymentSendInput = GT.Input({ name: "OnChainUsdPaymentSendInput", diff --git a/core/api/src/graphql/public/root/mutation/quiz-completed.ts b/core/api/src/graphql/public/root/mutation/quiz-completed.ts index 2bbb4dc4a1..9656e44f15 100644 --- a/core/api/src/graphql/public/root/mutation/quiz-completed.ts +++ b/core/api/src/graphql/public/root/mutation/quiz-completed.ts @@ -1,8 +1,8 @@ -import { Payments } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" +import { Payments } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" -import QuizCompleted from "@graphql/public/types/payload/quiz-completed" +import QuizCompleted from "@/graphql/public/types/payload/quiz-completed" const QuizCompletedInput = GT.Input({ name: "QuizCompletedInput", diff --git a/core/api/src/graphql/public/root/mutation/user-contact-update-alias.ts b/core/api/src/graphql/public/root/mutation/user-contact-update-alias.ts index 613094b105..a33afe240c 100644 --- a/core/api/src/graphql/public/root/mutation/user-contact-update-alias.ts +++ b/core/api/src/graphql/public/root/mutation/user-contact-update-alias.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" -import UserContactUpdateAliasPayload from "@graphql/public/types/payload/user-contact-update-alias" -import ContactAlias from "@graphql/public/types/scalar/contact-alias" -import Username from "@graphql/shared/types/scalar/username" -import { Accounts } from "@app" -import { InputValidationError } from "@graphql/error" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import UserContactUpdateAliasPayload from "@/graphql/public/types/payload/user-contact-update-alias" +import ContactAlias from "@/graphql/public/types/scalar/contact-alias" +import Username from "@/graphql/shared/types/scalar/username" +import { Accounts } from "@/app" +import { InputValidationError } from "@/graphql/error" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const UserContactUpdateAliasInput = GT.Input({ name: "UserContactUpdateAliasInput", diff --git a/core/api/src/graphql/public/root/mutation/user-email-delete.ts b/core/api/src/graphql/public/root/mutation/user-email-delete.ts index f1e726c4b8..7a1a564d71 100644 --- a/core/api/src/graphql/public/root/mutation/user-email-delete.ts +++ b/core/api/src/graphql/public/root/mutation/user-email-delete.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import UserEmailDeletePayload from "@graphql/public/types/payload/user-email-delete" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import UserEmailDeletePayload from "@/graphql/public/types/payload/user-email-delete" const UserEmailDeleteMutation = GT.Field({ extensions: { diff --git a/core/api/src/graphql/public/root/mutation/user-email-registration-initiate.ts b/core/api/src/graphql/public/root/mutation/user-email-registration-initiate.ts index d57b7a47d3..e1de989364 100644 --- a/core/api/src/graphql/public/root/mutation/user-email-registration-initiate.ts +++ b/core/api/src/graphql/public/root/mutation/user-email-registration-initiate.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import EmailAddress from "@graphql/shared/types/scalar/email-address" -import UserEmailRegistrationInitiatePayload from "@graphql/public/types/payload/user-email-registration-initiate" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import EmailAddress from "@/graphql/shared/types/scalar/email-address" +import UserEmailRegistrationInitiatePayload from "@/graphql/public/types/payload/user-email-registration-initiate" const UserEmailRegistrationInitiateInput = GT.Input({ name: "UserEmailRegistrationInitiateInput", diff --git a/core/api/src/graphql/public/root/mutation/user-email-registration-validate.ts b/core/api/src/graphql/public/root/mutation/user-email-registration-validate.ts index 92e2624b0b..165d9e3dbc 100644 --- a/core/api/src/graphql/public/root/mutation/user-email-registration-validate.ts +++ b/core/api/src/graphql/public/root/mutation/user-email-registration-validate.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import EmailRegistrationId from "@graphql/public/types/scalar/email-verify-id" -import OneTimeAuthCode from "@graphql/shared/types/scalar/one-time-auth-code" -import UserEmailRegistrationValidatePayload from "@graphql/public/types/payload/user-email-registration-validate" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import EmailRegistrationId from "@/graphql/public/types/scalar/email-verify-id" +import OneTimeAuthCode from "@/graphql/shared/types/scalar/one-time-auth-code" +import UserEmailRegistrationValidatePayload from "@/graphql/public/types/payload/user-email-registration-validate" const UserEmailRegistrationValidateInput = GT.Input({ name: "UserEmailRegistrationValidateInput", diff --git a/core/api/src/graphql/public/root/mutation/user-login-upgrade.ts b/core/api/src/graphql/public/root/mutation/user-login-upgrade.ts index fb4de92124..a0f048bb77 100644 --- a/core/api/src/graphql/public/root/mutation/user-login-upgrade.ts +++ b/core/api/src/graphql/public/root/mutation/user-login-upgrade.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" -import OneTimeAuthCode from "@graphql/shared/types/scalar/one-time-auth-code" +import { GT } from "@/graphql/index" +import OneTimeAuthCode from "@/graphql/shared/types/scalar/one-time-auth-code" -import Phone from "@graphql/shared/types/scalar/phone" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import UpgradePayload from "@graphql/public/types/payload/upgrade-payload" +import Phone from "@/graphql/shared/types/scalar/phone" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import UpgradePayload from "@/graphql/public/types/payload/upgrade-payload" const UserLoginUpgradeInput = GT.Input({ name: "UserLoginUpgradeInput", diff --git a/core/api/src/graphql/public/root/mutation/user-logout.ts b/core/api/src/graphql/public/root/mutation/user-logout.ts index 76696e63ac..c31710f059 100644 --- a/core/api/src/graphql/public/root/mutation/user-logout.ts +++ b/core/api/src/graphql/public/root/mutation/user-logout.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { logoutToken } from "@app/authentication" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import SuccessPayload from "@graphql/shared/types/payload/success-payload" +import { logoutToken } from "@/app/authentication" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import SuccessPayload from "@/graphql/shared/types/payload/success-payload" const UserLogoutInput = GT.Input({ name: "UserLogoutInput", diff --git a/core/api/src/graphql/public/root/mutation/user-phone-delete.ts b/core/api/src/graphql/public/root/mutation/user-phone-delete.ts index 2f5e6eb575..57b779f6b3 100644 --- a/core/api/src/graphql/public/root/mutation/user-phone-delete.ts +++ b/core/api/src/graphql/public/root/mutation/user-phone-delete.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import UserPhoneDeletePayload from "@graphql/public/types/payload/user-phone-delete" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import UserPhoneDeletePayload from "@/graphql/public/types/payload/user-phone-delete" const UserPhoneDeleteMutation = GT.Field({ extensions: { diff --git a/core/api/src/graphql/public/root/mutation/user-phone-registration-initiate.ts b/core/api/src/graphql/public/root/mutation/user-phone-registration-initiate.ts index a439eed5da..70771aed4b 100644 --- a/core/api/src/graphql/public/root/mutation/user-phone-registration-initiate.ts +++ b/core/api/src/graphql/public/root/mutation/user-phone-registration-initiate.ts @@ -1,12 +1,12 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import Phone from "@graphql/shared/types/scalar/phone" -import SuccessPayload from "@graphql/shared/types/payload/success-payload" -import { ChannelType } from "@domain/phone-provider" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import Phone from "@/graphql/shared/types/scalar/phone" +import SuccessPayload from "@/graphql/shared/types/payload/success-payload" +import { ChannelType } from "@/domain/phone-provider" -import PhoneCodeChannelType from "@graphql/shared/types/scalar/phone-code-channel-type" +import PhoneCodeChannelType from "@/graphql/shared/types/scalar/phone-code-channel-type" const UserPhoneRegistrationInitiateInput = GT.Input({ name: "UserPhoneRegistrationInitiateInput", diff --git a/core/api/src/graphql/public/root/mutation/user-phone-registration-validate.ts b/core/api/src/graphql/public/root/mutation/user-phone-registration-validate.ts index cbf73fec82..ecab5cdb1c 100644 --- a/core/api/src/graphql/public/root/mutation/user-phone-registration-validate.ts +++ b/core/api/src/graphql/public/root/mutation/user-phone-registration-validate.ts @@ -1,11 +1,11 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import Phone from "@graphql/shared/types/scalar/phone" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import Phone from "@/graphql/shared/types/scalar/phone" -import OneTimeAuthCode from "@graphql/shared/types/scalar/one-time-auth-code" -import UserPhoneRegistrationValidatePayload from "@graphql/public/types/payload/user-phone-registration-validate" +import OneTimeAuthCode from "@/graphql/shared/types/scalar/one-time-auth-code" +import UserPhoneRegistrationValidatePayload from "@/graphql/public/types/payload/user-phone-registration-validate" const UserPhoneRegistrationValidateInput = GT.Input({ name: "UserPhoneRegistrationValidateInput", diff --git a/core/api/src/graphql/public/root/mutation/user-quiz-question-update-completed.ts b/core/api/src/graphql/public/root/mutation/user-quiz-question-update-completed.ts index 35d9be3ca1..b5a884dc5e 100644 --- a/core/api/src/graphql/public/root/mutation/user-quiz-question-update-completed.ts +++ b/core/api/src/graphql/public/root/mutation/user-quiz-question-update-completed.ts @@ -1,8 +1,8 @@ -import { Payments } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" +import { Payments } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" -import UserQuizQuestionUpdateCompletedPayload from "@graphql/public/types/payload/user-quiz-question-update-completed" +import UserQuizQuestionUpdateCompletedPayload from "@/graphql/public/types/payload/user-quiz-question-update-completed" const UserQuizQuestionUpdateCompletedInput = GT.Input({ name: "UserQuizQuestionUpdateCompletedInput", diff --git a/core/api/src/graphql/public/root/mutation/user-totp-delete.ts b/core/api/src/graphql/public/root/mutation/user-totp-delete.ts index 41931fe982..eac36d1c02 100644 --- a/core/api/src/graphql/public/root/mutation/user-totp-delete.ts +++ b/core/api/src/graphql/public/root/mutation/user-totp-delete.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import UserTotpDeletePayload from "@graphql/public/types/payload/user-totp-delete" -import AuthToken from "@graphql/shared/types/scalar/auth-token" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import UserTotpDeletePayload from "@/graphql/public/types/payload/user-totp-delete" +import AuthToken from "@/graphql/shared/types/scalar/auth-token" const UserTotpDeleteInput = GT.Input({ name: "UserTotpDeleteInput", diff --git a/core/api/src/graphql/public/root/mutation/user-totp-registration-initiate.ts b/core/api/src/graphql/public/root/mutation/user-totp-registration-initiate.ts index 271d78e7ff..33b0c349c1 100644 --- a/core/api/src/graphql/public/root/mutation/user-totp-registration-initiate.ts +++ b/core/api/src/graphql/public/root/mutation/user-totp-registration-initiate.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import AuthToken from "@graphql/shared/types/scalar/auth-token" -import UserTotpRegistrationInitiatePayload from "@graphql/public/types/payload/user-totp-registration-initiate" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import AuthToken from "@/graphql/shared/types/scalar/auth-token" +import UserTotpRegistrationInitiatePayload from "@/graphql/public/types/payload/user-totp-registration-initiate" const UserTotpRegistrationInitiateInput = GT.Input({ name: "UserTotpRegistrationInitiateInput", diff --git a/core/api/src/graphql/public/root/mutation/user-totp-registration-validate.ts b/core/api/src/graphql/public/root/mutation/user-totp-registration-validate.ts index b510c3762a..9daf210f45 100644 --- a/core/api/src/graphql/public/root/mutation/user-totp-registration-validate.ts +++ b/core/api/src/graphql/public/root/mutation/user-totp-registration-validate.ts @@ -1,11 +1,11 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import AuthToken from "@graphql/shared/types/scalar/auth-token" -import TotpCode from "@graphql/public/types/scalar/totp-code" -import TotpRegistrationId from "@graphql/public/types/scalar/totp-verify-id" -import UserTotpRegistrationValidatePayload from "@graphql/public/types/payload/user-totp-registration-validate" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import AuthToken from "@/graphql/shared/types/scalar/auth-token" +import TotpCode from "@/graphql/public/types/scalar/totp-code" +import TotpRegistrationId from "@/graphql/public/types/scalar/totp-verify-id" +import UserTotpRegistrationValidatePayload from "@/graphql/public/types/payload/user-totp-registration-validate" const UserTotpRegistrationValidateInput = GT.Input({ name: "UserTotpRegistrationValidateInput", diff --git a/core/api/src/graphql/public/root/mutation/user-update-language.ts b/core/api/src/graphql/public/root/mutation/user-update-language.ts index cf41e8daad..9eb5957cc5 100644 --- a/core/api/src/graphql/public/root/mutation/user-update-language.ts +++ b/core/api/src/graphql/public/root/mutation/user-update-language.ts @@ -1,9 +1,9 @@ -import { Users } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" +import { Users } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" -import UserUpdateLanguagePayload from "@graphql/public/types/payload/user-update-language" -import Language from "@graphql/shared/types/scalar/language" +import UserUpdateLanguagePayload from "@/graphql/public/types/payload/user-update-language" +import Language from "@/graphql/shared/types/scalar/language" const UserUpdateLanguageInput = GT.Input({ name: "UserUpdateLanguageInput", diff --git a/core/api/src/graphql/public/root/mutation/user-update-username.ts b/core/api/src/graphql/public/root/mutation/user-update-username.ts index f6e028db71..e736ef28ba 100644 --- a/core/api/src/graphql/public/root/mutation/user-update-username.ts +++ b/core/api/src/graphql/public/root/mutation/user-update-username.ts @@ -1,10 +1,10 @@ -import { Accounts } from "@app" -import { UsernameIsImmutableError } from "@domain/accounts" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" +import { Accounts } from "@/app" +import { UsernameIsImmutableError } from "@/domain/accounts" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" -import UserUpdateUsernamePayload from "@graphql/public/types/payload/user-update-username" -import Username from "@graphql/shared/types/scalar/username" +import UserUpdateUsernamePayload from "@/graphql/public/types/payload/user-update-username" +import Username from "@/graphql/shared/types/scalar/username" const UserUpdateUsernameInput = GT.Input({ name: "UserUpdateUsernameInput", diff --git a/core/api/src/graphql/public/root/query/account-default-wallet-id.ts b/core/api/src/graphql/public/root/query/account-default-wallet-id.ts index 23763eddad..7d6494b18d 100644 --- a/core/api/src/graphql/public/root/query/account-default-wallet-id.ts +++ b/core/api/src/graphql/public/root/query/account-default-wallet-id.ts @@ -1,8 +1,8 @@ -import { mapError } from "@graphql/error-map" -import { GT } from "@graphql/index" -import Username from "@graphql/shared/types/scalar/username" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import { AccountsRepository } from "@services/mongoose" +import { mapError } from "@/graphql/error-map" +import { GT } from "@/graphql/index" +import Username from "@/graphql/shared/types/scalar/username" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import { AccountsRepository } from "@/services/mongoose" const AccountDefaultWalletIdQuery = GT.Field({ deprecationReason: "will be migrated to AccountDefaultWalletId", diff --git a/core/api/src/graphql/public/root/query/account-default-wallet.ts b/core/api/src/graphql/public/root/query/account-default-wallet.ts index 1387c01691..4b1cb0f073 100644 --- a/core/api/src/graphql/public/root/query/account-default-wallet.ts +++ b/core/api/src/graphql/public/root/query/account-default-wallet.ts @@ -1,11 +1,11 @@ -import { Wallets } from "@app" -import { CouldNotFindWalletFromUsernameAndCurrencyError } from "@domain/errors" -import { mapError } from "@graphql/error-map" -import { GT } from "@graphql/index" -import Username from "@graphql/shared/types/scalar/username" -import WalletCurrency from "@graphql/shared/types/scalar/wallet-currency" -import PublicWallet from "@graphql/public/types/abstract/public-wallet" -import { AccountsRepository } from "@services/mongoose" +import { Wallets } from "@/app" +import { CouldNotFindWalletFromUsernameAndCurrencyError } from "@/domain/errors" +import { mapError } from "@/graphql/error-map" +import { GT } from "@/graphql/index" +import Username from "@/graphql/shared/types/scalar/username" +import WalletCurrency from "@/graphql/shared/types/scalar/wallet-currency" +import PublicWallet from "@/graphql/public/types/abstract/public-wallet" +import { AccountsRepository } from "@/services/mongoose" const AccountDefaultWalletQuery = GT.Field({ type: GT.NonNull(PublicWallet), diff --git a/core/api/src/graphql/public/root/query/btc-price-list.ts b/core/api/src/graphql/public/root/query/btc-price-list.ts index 387d72843e..68588b07c9 100644 --- a/core/api/src/graphql/public/root/query/btc-price-list.ts +++ b/core/api/src/graphql/public/root/query/btc-price-list.ts @@ -1,16 +1,16 @@ -import { Prices } from "@app" +import { Prices } from "@/app" -import { SATS_PER_BTC } from "@domain/bitcoin" -import { BTC_PRICE_PRECISION_OFFSET, UsdDisplayCurrency } from "@domain/fiat" -import { PriceInterval, PriceRange } from "@domain/price" +import { SATS_PER_BTC } from "@/domain/bitcoin" +import { BTC_PRICE_PRECISION_OFFSET, UsdDisplayCurrency } from "@/domain/fiat" +import { PriceInterval, PriceRange } from "@/domain/price" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" import PriceGraphRange, { priceRangeValues, -} from "@graphql/public/types/scalar/price-graph-range" -import { InputValidationError } from "@graphql/error" -import PricePoint from "@graphql/public/types/object/price-point" +} from "@/graphql/public/types/scalar/price-graph-range" +import { InputValidationError } from "@/graphql/error" +import PricePoint from "@/graphql/public/types/object/price-point" const parseRange: ( string: (typeof priceRangeValues)[number], diff --git a/core/api/src/graphql/public/root/query/btc-price.ts b/core/api/src/graphql/public/root/query/btc-price.ts index 6026bb208e..7189576c0d 100644 --- a/core/api/src/graphql/public/root/query/btc-price.ts +++ b/core/api/src/graphql/public/root/query/btc-price.ts @@ -1,11 +1,11 @@ -import { Prices } from "@app" +import { Prices } from "@/app" -import { SAT_PRICE_PRECISION_OFFSET, UsdDisplayCurrency } from "@domain/fiat" +import { SAT_PRICE_PRECISION_OFFSET, UsdDisplayCurrency } from "@/domain/fiat" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" -import Price from "@graphql/public/types/object/price" -import DisplayCurrencyGT from "@graphql/shared/types/scalar/display-currency" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" +import Price from "@/graphql/public/types/object/price" +import DisplayCurrencyGT from "@/graphql/shared/types/scalar/display-currency" const BtcPriceQuery = GT.Field({ deprecationReason: "Deprecated in favor of realtimePrice", diff --git a/core/api/src/graphql/public/root/query/business-map-markers.ts b/core/api/src/graphql/public/root/query/business-map-markers.ts index 819b8185b4..8bbbb29121 100644 --- a/core/api/src/graphql/public/root/query/business-map-markers.ts +++ b/core/api/src/graphql/public/root/query/business-map-markers.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import MapMarker from "@graphql/public/types/object/map-marker" -import { mapError } from "@graphql/error-map" -import { Accounts } from "@app" +import MapMarker from "@/graphql/public/types/object/map-marker" +import { mapError } from "@/graphql/error-map" +import { Accounts } from "@/app" const BusinessMapMarkersQuery = GT.Field({ type: GT.List(MapMarker), diff --git a/core/api/src/graphql/public/root/query/currency-list.ts b/core/api/src/graphql/public/root/query/currency-list.ts index 90ead908c4..e06045fe54 100644 --- a/core/api/src/graphql/public/root/query/currency-list.ts +++ b/core/api/src/graphql/public/root/query/currency-list.ts @@ -1,8 +1,8 @@ -import { Prices } from "@app" +import { Prices } from "@/app" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" -import Currency from "@graphql/public/types/object/currency" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" +import Currency from "@/graphql/public/types/object/currency" const CurrencyListQuery = GT.Field({ type: GT.NonNullList(Currency), diff --git a/core/api/src/graphql/public/root/query/globals.ts b/core/api/src/graphql/public/root/query/globals.ts index 1e81ea04b2..3ccb4a9204 100644 --- a/core/api/src/graphql/public/root/query/globals.ts +++ b/core/api/src/graphql/public/root/query/globals.ts @@ -4,14 +4,14 @@ import { getGaloyBuildInformation, getLightningAddressDomain, getLightningAddressDomainAliases, -} from "@config" +} from "@/config" -import { Lightning } from "@app" +import { Lightning } from "@/app" -import { getSupportedCountries } from "@app/authentication/get-supported-countries" +import { getSupportedCountries } from "@/app/authentication/get-supported-countries" -import { GT } from "@graphql/index" -import Globals from "@graphql/public/types/object/globals" +import { GT } from "@/graphql/index" +import Globals from "@/graphql/public/types/object/globals" const feesConfig = getFeesConfig() diff --git a/core/api/src/graphql/public/root/query/ln-invoice-payment-status.ts b/core/api/src/graphql/public/root/query/ln-invoice-payment-status.ts index 3a68a9e16d..1a75826056 100644 --- a/core/api/src/graphql/public/root/query/ln-invoice-payment-status.ts +++ b/core/api/src/graphql/public/root/query/ln-invoice-payment-status.ts @@ -1,9 +1,9 @@ -import { Lightning } from "@app" +import { Lightning } from "@/app" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" -import LnInvoicePaymentStatusPayload from "@graphql/public/types/payload/ln-invoice-payment-status" -import LnInvoicePaymentStatusInput from "@graphql/public/types/object/ln-invoice-payment-status-input" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" +import LnInvoicePaymentStatusPayload from "@/graphql/public/types/payload/ln-invoice-payment-status" +import LnInvoicePaymentStatusInput from "@/graphql/public/types/object/ln-invoice-payment-status-input" const LnInvoicePaymentStatusQuery = GT.Field({ type: GT.NonNull(LnInvoicePaymentStatusPayload), diff --git a/core/api/src/graphql/public/root/query/me.ts b/core/api/src/graphql/public/root/query/me.ts index 2028c39c01..3bae99f8d7 100644 --- a/core/api/src/graphql/public/root/query/me.ts +++ b/core/api/src/graphql/public/root/query/me.ts @@ -1,6 +1,6 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import GraphQLUser from "@graphql/public/types/object/user" +import GraphQLUser from "@/graphql/public/types/object/user" const MeQuery = GT.Field({ type: GraphQLUser, diff --git a/core/api/src/graphql/public/root/query/mobile-versions.ts b/core/api/src/graphql/public/root/query/mobile-versions.ts index e33087d100..74668e02eb 100644 --- a/core/api/src/graphql/public/root/query/mobile-versions.ts +++ b/core/api/src/graphql/public/root/query/mobile-versions.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import MobileVersions from "@graphql/public/types/object/mobile-versions" -import { getBuildVersions } from "@config" +import MobileVersions from "@/graphql/public/types/object/mobile-versions" +import { getBuildVersions } from "@/config" const MobileVersionsQuery = GT.Field({ type: GT.List(MobileVersions), diff --git a/core/api/src/graphql/public/root/query/on-chain-tx-fee-query.ts b/core/api/src/graphql/public/root/query/on-chain-tx-fee-query.ts index 672df7ec83..a174492874 100644 --- a/core/api/src/graphql/public/root/query/on-chain-tx-fee-query.ts +++ b/core/api/src/graphql/public/root/query/on-chain-tx-fee-query.ts @@ -1,18 +1,18 @@ -import { Wallets } from "@app" +import { normalizePaymentAmount } from "../../../shared/root/mutation" -import { PayoutSpeed as DomainPayoutSpeed } from "@domain/bitcoin/onchain" +import { Wallets } from "@/app" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" +import { PayoutSpeed as DomainPayoutSpeed } from "@/domain/bitcoin/onchain" -import OnChainAddress from "@graphql/shared/types/scalar/on-chain-address" -import PayoutSpeed from "@graphql/public/types/scalar/payout-speed" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" -import OnChainTxFee from "@graphql/public/types/object/onchain-tx-fee" +import OnChainAddress from "@/graphql/shared/types/scalar/on-chain-address" +import PayoutSpeed from "@/graphql/public/types/scalar/payout-speed" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" -import { normalizePaymentAmount } from "../../../shared/root/mutation" +import OnChainTxFee from "@/graphql/public/types/object/onchain-tx-fee" const OnChainTxFeeQuery = GT.Field({ type: GT.NonNull(OnChainTxFee), diff --git a/core/api/src/graphql/public/root/query/on-chain-usd-tx-fee-query-as-sats.ts b/core/api/src/graphql/public/root/query/on-chain-usd-tx-fee-query-as-sats.ts index a0b129febb..2066cf1938 100644 --- a/core/api/src/graphql/public/root/query/on-chain-usd-tx-fee-query-as-sats.ts +++ b/core/api/src/graphql/public/root/query/on-chain-usd-tx-fee-query-as-sats.ts @@ -1,18 +1,18 @@ -import { PayoutSpeed as DomainPayoutSpeed } from "@domain/bitcoin/onchain" +import { normalizePaymentAmount } from "../../../shared/root/mutation" -import { Wallets } from "@app" +import { PayoutSpeed as DomainPayoutSpeed } from "@/domain/bitcoin/onchain" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" +import { Wallets } from "@/app" -import OnChainAddress from "@graphql/shared/types/scalar/on-chain-address" -import PayoutSpeed from "@graphql/public/types/scalar/payout-speed" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" -import OnChainUsdTxFee from "@graphql/public/types/object/onchain-usd-tx-fee" +import OnChainAddress from "@/graphql/shared/types/scalar/on-chain-address" +import PayoutSpeed from "@/graphql/public/types/scalar/payout-speed" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" -import { normalizePaymentAmount } from "../../../shared/root/mutation" +import OnChainUsdTxFee from "@/graphql/public/types/object/onchain-usd-tx-fee" const OnChainUsdTxFeeAsBtcDenominatedQuery = GT.Field({ type: GT.NonNull(OnChainUsdTxFee), diff --git a/core/api/src/graphql/public/root/query/on-chain-usd-tx-fee-query.ts b/core/api/src/graphql/public/root/query/on-chain-usd-tx-fee-query.ts index cfdc191d9a..726d7f60c7 100644 --- a/core/api/src/graphql/public/root/query/on-chain-usd-tx-fee-query.ts +++ b/core/api/src/graphql/public/root/query/on-chain-usd-tx-fee-query.ts @@ -1,18 +1,18 @@ -import { PayoutSpeed as DomainPayoutSpeed } from "@domain/bitcoin/onchain" +import { normalizePaymentAmount } from "../../../shared/root/mutation" -import { Wallets } from "@app" +import { PayoutSpeed as DomainPayoutSpeed } from "@/domain/bitcoin/onchain" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" +import { Wallets } from "@/app" -import CentAmount from "@graphql/public/types/scalar/cent-amount" -import OnChainAddress from "@graphql/shared/types/scalar/on-chain-address" -import PayoutSpeed from "@graphql/public/types/scalar/payout-speed" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" -import OnChainUsdTxFee from "@graphql/public/types/object/onchain-usd-tx-fee" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" +import OnChainAddress from "@/graphql/shared/types/scalar/on-chain-address" +import PayoutSpeed from "@/graphql/public/types/scalar/payout-speed" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" -import { normalizePaymentAmount } from "../../../shared/root/mutation" +import OnChainUsdTxFee from "@/graphql/public/types/object/onchain-usd-tx-fee" const OnChainUsdTxFeeQuery = GT.Field({ type: GT.NonNull(OnChainUsdTxFee), diff --git a/core/api/src/graphql/public/root/query/quiz-questions.ts b/core/api/src/graphql/public/root/query/quiz-questions.ts index f09548feef..9d1b7ab9d2 100644 --- a/core/api/src/graphql/public/root/query/quiz-questions.ts +++ b/core/api/src/graphql/public/root/query/quiz-questions.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import QuizQuestion from "@graphql/public/types/object/quiz-question" -import { OnboardingEarn } from "@config" +import QuizQuestion from "@/graphql/public/types/object/quiz-question" +import { OnboardingEarn } from "@/config" const QuizQuestionsQuery = GT.Field({ deprecationReason: diff --git a/core/api/src/graphql/public/root/query/realtime-price.ts b/core/api/src/graphql/public/root/query/realtime-price.ts index 955c8594e0..8896ae535b 100644 --- a/core/api/src/graphql/public/root/query/realtime-price.ts +++ b/core/api/src/graphql/public/root/query/realtime-price.ts @@ -1,16 +1,16 @@ -import { Prices } from "@app" +import { Prices } from "@/app" import { majorToMinorUnit, USD_PRICE_PRECISION_OFFSET, SAT_PRICE_PRECISION_OFFSET, UsdDisplayCurrency, -} from "@domain/fiat" +} from "@/domain/fiat" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" -import RealtimePrice from "@graphql/public/types/object/realtime-price" -import DisplayCurrencyGT from "@graphql/shared/types/scalar/display-currency" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" +import RealtimePrice from "@/graphql/public/types/object/realtime-price" +import DisplayCurrencyGT from "@/graphql/shared/types/scalar/display-currency" const RealtimePriceQuery = GT.Field({ type: GT.NonNull(RealtimePrice), diff --git a/core/api/src/graphql/public/root/query/username-available.ts b/core/api/src/graphql/public/root/query/username-available.ts index 59b74d1265..188c411cc3 100644 --- a/core/api/src/graphql/public/root/query/username-available.ts +++ b/core/api/src/graphql/public/root/query/username-available.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" -import Username from "@graphql/shared/types/scalar/username" -import { mapError } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import Username from "@/graphql/shared/types/scalar/username" +import { mapError } from "@/graphql/error-map" -import { Accounts } from "@app" +import { Accounts } from "@/app" const UsernameAvailableQuery = GT.Field({ type: GT.Boolean, diff --git a/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status.ts b/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status.ts index 7c9e435162..f05dba2f76 100644 --- a/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status.ts +++ b/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status.ts @@ -1,15 +1,15 @@ -import { Lightning } from "@app" +import { Lightning } from "@/app" -import { customPubSubTrigger, PubSubDefaultTriggers } from "@domain/pubsub" +import { customPubSubTrigger, PubSubDefaultTriggers } from "@/domain/pubsub" -import { PubSubService } from "@services/pubsub" -import { baseLogger } from "@services/logger" +import { PubSubService } from "@/services/pubsub" +import { baseLogger } from "@/services/logger" -import { GT } from "@graphql/index" -import LnInvoicePaymentStatusPayload from "@graphql/public/types/payload/ln-invoice-payment-status" -import LnInvoicePaymentStatusInput from "@graphql/public/types/object/ln-invoice-payment-status-input" -import { UnknownClientError } from "@graphql/error" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import LnInvoicePaymentStatusPayload from "@/graphql/public/types/payload/ln-invoice-payment-status" +import LnInvoicePaymentStatusInput from "@/graphql/public/types/object/ln-invoice-payment-status-input" +import { UnknownClientError } from "@/graphql/error" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const pubsub = PubSubService() diff --git a/core/api/src/graphql/public/root/subscription/my-updates.ts b/core/api/src/graphql/public/root/subscription/my-updates.ts index 882400f7e1..79ade4fc99 100644 --- a/core/api/src/graphql/public/root/subscription/my-updates.ts +++ b/core/api/src/graphql/public/root/subscription/my-updates.ts @@ -1,28 +1,28 @@ -import { Prices } from "@app" +import { Prices } from "@/app" import { majorToMinorUnit, SAT_PRICE_PRECISION_OFFSET, USD_PRICE_PRECISION_OFFSET, UsdDisplayCurrency, -} from "@domain/fiat" -import { customPubSubTrigger, PubSubDefaultTriggers } from "@domain/pubsub" - -import { GT } from "@graphql/index" -import Price from "@graphql/public/types/object/price" -import IError from "@graphql/shared/types/abstract/error" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import GraphQLUser from "@graphql/public/types/object/user" -import PaymentHash from "@graphql/shared/types/scalar/payment-hash" -import RealtimePrice from "@graphql/public/types/object/realtime-price" -import OnChainTxHash from "@graphql/shared/types/scalar/onchain-tx-hash" -import { AuthenticationError, UnknownClientError } from "@graphql/error" -import TxNotificationType from "@graphql/public/types/scalar/tx-notification-type" -import InvoicePaymentStatus from "@graphql/public/types/scalar/invoice-payment-status" - -import { baseLogger } from "@services/logger" -import { PubSubService } from "@services/pubsub" +} from "@/domain/fiat" +import { customPubSubTrigger, PubSubDefaultTriggers } from "@/domain/pubsub" + +import { GT } from "@/graphql/index" +import Price from "@/graphql/public/types/object/price" +import IError from "@/graphql/shared/types/abstract/error" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import GraphQLUser from "@/graphql/public/types/object/user" +import PaymentHash from "@/graphql/shared/types/scalar/payment-hash" +import RealtimePrice from "@/graphql/public/types/object/realtime-price" +import OnChainTxHash from "@/graphql/shared/types/scalar/onchain-tx-hash" +import { AuthenticationError, UnknownClientError } from "@/graphql/error" +import TxNotificationType from "@/graphql/public/types/scalar/tx-notification-type" +import InvoicePaymentStatus from "@/graphql/public/types/scalar/invoice-payment-status" + +import { baseLogger } from "@/services/logger" +import { PubSubService } from "@/services/pubsub" const pubsub = PubSubService() diff --git a/core/api/src/graphql/public/root/subscription/price.ts b/core/api/src/graphql/public/root/subscription/price.ts index f8c2b64663..10730ac30a 100644 --- a/core/api/src/graphql/public/root/subscription/price.ts +++ b/core/api/src/graphql/public/root/subscription/price.ts @@ -1,23 +1,23 @@ import crypto from "crypto" -import { Prices } from "@app" +import { Prices } from "@/app" -import { customPubSubTrigger, PubSubDefaultTriggers } from "@domain/pubsub" +import { customPubSubTrigger, PubSubDefaultTriggers } from "@/domain/pubsub" import { checkedToDisplayCurrency, majorToMinorUnit, SAT_PRICE_PRECISION_OFFSET, UsdDisplayCurrency, -} from "@domain/fiat" +} from "@/domain/fiat" -import { GT } from "@graphql/index" -import { UnknownClientError } from "@graphql/error" -import PricePayload from "@graphql/public/types/payload/price" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" -import ExchangeCurrencyUnit from "@graphql/public/types/scalar/exchange-currency-unit" +import { GT } from "@/graphql/index" +import { UnknownClientError } from "@/graphql/error" +import PricePayload from "@/graphql/public/types/payload/price" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" +import ExchangeCurrencyUnit from "@/graphql/public/types/scalar/exchange-currency-unit" -import { PubSubService } from "@services/pubsub" -import { baseLogger } from "@services/logger" +import { PubSubService } from "@/services/pubsub" +import { baseLogger } from "@/services/logger" const pubsub = PubSubService() diff --git a/core/api/src/graphql/public/root/subscription/realtime-price.ts b/core/api/src/graphql/public/root/subscription/realtime-price.ts index 06348f271f..252224c76b 100644 --- a/core/api/src/graphql/public/root/subscription/realtime-price.ts +++ b/core/api/src/graphql/public/root/subscription/realtime-price.ts @@ -1,24 +1,24 @@ import crypto from "crypto" -import { Prices } from "@app" +import { Prices } from "@/app" -import { customPubSubTrigger, PubSubDefaultTriggers } from "@domain/pubsub" +import { customPubSubTrigger, PubSubDefaultTriggers } from "@/domain/pubsub" import { checkedToDisplayCurrency, majorToMinorUnit, SAT_PRICE_PRECISION_OFFSET, USD_PRICE_PRECISION_OFFSET, UsdDisplayCurrency, -} from "@domain/fiat" +} from "@/domain/fiat" -import { GT } from "@graphql/index" -import { UnknownClientError } from "@graphql/error" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import DisplayCurrencyGT from "@graphql/shared/types/scalar/display-currency" -import RealtimePricePayload from "@graphql/public/types/payload/realtime-price" +import { GT } from "@/graphql/index" +import { UnknownClientError } from "@/graphql/error" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import DisplayCurrencyGT from "@/graphql/shared/types/scalar/display-currency" +import RealtimePricePayload from "@/graphql/public/types/payload/realtime-price" -import { PubSubService } from "@services/pubsub" -import { baseLogger } from "@services/logger" +import { PubSubService } from "@/services/pubsub" +import { baseLogger } from "@/services/logger" const pubsub = PubSubService() diff --git a/core/api/src/graphql/public/subscriptions.ts b/core/api/src/graphql/public/subscriptions.ts index b36918bbea..b9c35d3867 100644 --- a/core/api/src/graphql/public/subscriptions.ts +++ b/core/api/src/graphql/public/subscriptions.ts @@ -1,14 +1,14 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import PriceSubscription from "@graphql/public/root/subscription/price" -import MyUpdatesSubscription from "@graphql/public/root/subscription/my-updates" -import RealtimePriceSubscription from "@graphql/public/root/subscription/realtime-price" -import LnInvoicePaymentStatusSubscription from "@graphql/public/root/subscription/ln-invoice-payment-status" +import PriceSubscription from "@/graphql/public/root/subscription/price" +import MyUpdatesSubscription from "@/graphql/public/root/subscription/my-updates" +import RealtimePriceSubscription from "@/graphql/public/root/subscription/realtime-price" +import LnInvoicePaymentStatusSubscription from "@/graphql/public/root/subscription/ln-invoice-payment-status" import { ACCOUNT_USERNAME, addAttributesToCurrentSpan, SemanticAttributes, -} from "@services/tracing" +} from "@/services/tracing" const fields = { myUpdates: MyUpdatesSubscription, diff --git a/core/api/src/graphql/public/types/abstract/account-limit.ts b/core/api/src/graphql/public/types/abstract/account-limit.ts index 08199c5cf7..4ce57367cb 100644 --- a/core/api/src/graphql/public/types/abstract/account-limit.ts +++ b/core/api/src/graphql/public/types/abstract/account-limit.ts @@ -1,6 +1,6 @@ -import { GT } from "@graphql/index" -import CentAmount from "@graphql/public/types/scalar/cent-amount" -import Seconds from "@graphql/public/types/scalar/seconds" +import { GT } from "@/graphql/index" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" +import Seconds from "@/graphql/public/types/scalar/seconds" const IAccountLimit = GT.Interface({ name: "AccountLimit", diff --git a/core/api/src/graphql/public/types/abstract/account.ts b/core/api/src/graphql/public/types/abstract/account.ts index 8b96aadd8f..4245c833c5 100644 --- a/core/api/src/graphql/public/types/abstract/account.ts +++ b/core/api/src/graphql/public/types/abstract/account.ts @@ -1,18 +1,20 @@ -import { GT } from "@graphql/index" -import { connectionArgs } from "@graphql/connections" - -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import AccountLimits from "@graphql/public/types/object/account-limits" -import RealtimePrice from "@graphql/public/types/object/realtime-price" -import DisplayCurrency from "@graphql/shared/types/scalar/display-currency" -import { TransactionConnection } from "@graphql/shared/types/object/transaction" - import AccountLevel from "../../../shared/types/scalar/account-level" import Wallet from "../../../shared/types/abstract/wallet" + import CallbackEndpoint from "../object/callback-endpoint" + import { NotificationSettings } from "../object/notification-settings" +import { GT } from "@/graphql/index" +import { connectionArgs } from "@/graphql/connections" + +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import AccountLimits from "@/graphql/public/types/object/account-limits" +import RealtimePrice from "@/graphql/public/types/object/realtime-price" +import DisplayCurrency from "@/graphql/shared/types/scalar/display-currency" +import { TransactionConnection } from "@/graphql/shared/types/object/transaction" + const IAccount = GT.Interface({ name: "Account", fields: () => ({ diff --git a/core/api/src/graphql/public/types/abstract/public-wallet.ts b/core/api/src/graphql/public/types/abstract/public-wallet.ts index 20ab854594..afc6740fd1 100644 --- a/core/api/src/graphql/public/types/abstract/public-wallet.ts +++ b/core/api/src/graphql/public/types/abstract/public-wallet.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import WalletCurrency from "../../../shared/types/scalar/wallet-currency" +import { GT } from "@/graphql/index" + const IPublicWallet = GT.Object({ name: "PublicWallet", description: diff --git a/core/api/src/graphql/public/types/object/account-contact.ts b/core/api/src/graphql/public/types/object/account-contact.ts index 440b46d453..0f4144f618 100644 --- a/core/api/src/graphql/public/types/object/account-contact.ts +++ b/core/api/src/graphql/public/types/object/account-contact.ts @@ -1,19 +1,21 @@ -import { Accounts } from "@app" -import { checkedToUsername } from "@domain/accounts" -import { GT } from "@graphql/index" import dedent from "dedent" -import { - checkedConnectionArgs, - connectionArgs, - connectionFromPaginatedArray, -} from "@graphql/connections" -import { mapError } from "@graphql/error-map" import ContactAlias from "../scalar/contact-alias" + import Username from "../../../shared/types/scalar/username" import { TransactionConnection } from "../../../shared/types/object/transaction" +import { Accounts } from "@/app" +import { checkedToUsername } from "@/domain/accounts" +import { GT } from "@/graphql/index" +import { + checkedConnectionArgs, + connectionArgs, + connectionFromPaginatedArray, +} from "@/graphql/connections" +import { mapError } from "@/graphql/error-map" + const AccountContact = GT.Object({ name: "UserContact", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/account-limits.ts b/core/api/src/graphql/public/types/object/account-limits.ts index 4a2561e9f3..a0a32e5db6 100644 --- a/core/api/src/graphql/public/types/object/account-limits.ts +++ b/core/api/src/graphql/public/types/object/account-limits.ts @@ -1,7 +1,7 @@ -import { AccountLimitsRange, AccountLimitsType } from "@domain/accounts" -import { GT } from "@graphql/index" +import { AccountLimitsRange, AccountLimitsType } from "@/domain/accounts" +import { GT } from "@/graphql/index" -import AccountLimit from "@graphql/public/types/abstract/account-limit" +import AccountLimit from "@/graphql/public/types/abstract/account-limit" const AccountLimits = GT.Object({ name: "AccountLimits", diff --git a/core/api/src/graphql/public/types/object/build-information.ts b/core/api/src/graphql/public/types/object/build-information.ts index 4cf00235cd..adf3c26fa8 100644 --- a/core/api/src/graphql/public/types/object/build-information.ts +++ b/core/api/src/graphql/public/types/object/build-information.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const BuildInformation = GT.Object({ name: "BuildInformation", diff --git a/core/api/src/graphql/public/types/object/business-account.ts b/core/api/src/graphql/public/types/object/business-account.ts index 934c4c52e7..4dcb87de5a 100644 --- a/core/api/src/graphql/public/types/object/business-account.ts +++ b/core/api/src/graphql/public/types/object/business-account.ts @@ -1,22 +1,3 @@ -import { Accounts, Prices, Wallets } from "@app" - -import { - majorToMinorUnit, - SAT_PRICE_PRECISION_OFFSET, - USD_PRICE_PRECISION_OFFSET, -} from "@domain/fiat" -import { CouldNotFindTransactionsForAccountError } from "@domain/errors" - -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" -import { - connectionArgs, - connectionFromPaginatedArray, - checkedConnectionArgs, -} from "@graphql/connections" - -import { WalletsRepository } from "@services/mongoose" - import IAccount from "../abstract/account" import Wallet from "../../../shared/types/abstract/wallet" @@ -30,6 +11,23 @@ import { TransactionConnection } from "../../../shared/types/object/transaction" import RealtimePrice from "./realtime-price" import { NotificationSettings } from "./notification-settings" +import { WalletsRepository } from "@/services/mongoose" + +import { + connectionArgs, + connectionFromPaginatedArray, + checkedConnectionArgs, +} from "@/graphql/connections" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" +import { + majorToMinorUnit, + SAT_PRICE_PRECISION_OFFSET, + USD_PRICE_PRECISION_OFFSET, +} from "@/domain/fiat" +import { CouldNotFindTransactionsForAccountError } from "@/domain/errors" +import { Accounts, Prices, Wallets } from "@/app" + const BusinessAccount = GT.Object({ name: "BusinessAccount", interfaces: () => [IAccount], diff --git a/core/api/src/graphql/public/types/object/callback-endpoint.ts b/core/api/src/graphql/public/types/object/callback-endpoint.ts index 699d557aac..4b5fa5ffdf 100644 --- a/core/api/src/graphql/public/types/object/callback-endpoint.ts +++ b/core/api/src/graphql/public/types/object/callback-endpoint.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import EndpointId from "../scalar/endpoint-id" import EndpointUrl from "../scalar/endpoint-url" +import { GT } from "@/graphql/index" + const CallbackEndpoint = GT.Object({ name: "CallbackEndpoint", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/consumer-account.ts b/core/api/src/graphql/public/types/object/consumer-account.ts index 64acb10e1c..e8800b8936 100644 --- a/core/api/src/graphql/public/types/object/consumer-account.ts +++ b/core/api/src/graphql/public/types/object/consumer-account.ts @@ -1,38 +1,41 @@ -import { Accounts, Prices, Wallets } from "@app" +import AccountLevel from "../../../shared/types/scalar/account-level" + +import { TransactionConnection } from "../../../shared/types/object/transaction" + +import AccountLimits from "./account-limits" + +import Quiz from "./quiz" + +import CallbackEndpoint from "./callback-endpoint" + +import { NotificationSettings } from "./notification-settings" + +import { Accounts, Prices, Wallets } from "@/app" import { majorToMinorUnit, SAT_PRICE_PRECISION_OFFSET, USD_PRICE_PRECISION_OFFSET, -} from "@domain/fiat" -import { CouldNotFindTransactionsForAccountError } from "@domain/errors" +} from "@/domain/fiat" +import { CouldNotFindTransactionsForAccountError } from "@/domain/errors" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" import { connectionArgs, connectionFromPaginatedArray, checkedConnectionArgs, -} from "@graphql/connections" - -import Wallet from "@graphql/shared/types/abstract/wallet" -import IAccount from "@graphql/public/types/abstract/account" -import WalletId from "@graphql/shared/types/scalar/wallet-id" -import RealtimePrice from "@graphql/public/types/object/realtime-price" -import DisplayCurrency from "@graphql/shared/types/scalar/display-currency" - -import { WalletsRepository } from "@services/mongoose" +} from "@/graphql/connections" -import { listEndpoints } from "@app/callback" - -import AccountLevel from "../../../shared/types/scalar/account-level" +import Wallet from "@/graphql/shared/types/abstract/wallet" +import IAccount from "@/graphql/public/types/abstract/account" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" +import RealtimePrice from "@/graphql/public/types/object/realtime-price" +import DisplayCurrency from "@/graphql/shared/types/scalar/display-currency" -import { TransactionConnection } from "../../../shared/types/object/transaction" +import { WalletsRepository } from "@/services/mongoose" -import AccountLimits from "./account-limits" -import Quiz from "./quiz" -import CallbackEndpoint from "./callback-endpoint" -import { NotificationSettings } from "./notification-settings" +import { listEndpoints } from "@/app/callback" const ConsumerAccount = GT.Object({ name: "ConsumerAccount", diff --git a/core/api/src/graphql/public/types/object/country.ts b/core/api/src/graphql/public/types/object/country.ts index b53ad12f96..17c28afd19 100644 --- a/core/api/src/graphql/public/types/object/country.ts +++ b/core/api/src/graphql/public/types/object/country.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import CountryCode from "../scalar/country-code" import PhoneCodeChannelType from "../../../shared/types/scalar/phone-code-channel-type" +import { GT } from "@/graphql/index" + const Country = GT.Object({ name: "Country", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/currency.ts b/core/api/src/graphql/public/types/object/currency.ts index e6e879d2ae..34a1f9f5c1 100644 --- a/core/api/src/graphql/public/types/object/currency.ts +++ b/core/api/src/graphql/public/types/object/currency.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const Currency = GT.Object({ name: "Currency", diff --git a/core/api/src/graphql/public/types/object/fees-information.ts b/core/api/src/graphql/public/types/object/fees-information.ts index 8834583fd0..c8ec0e7b2c 100644 --- a/core/api/src/graphql/public/types/object/fees-information.ts +++ b/core/api/src/graphql/public/types/object/fees-information.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const DepositFeesInformation = GT.Object({ name: "DepositFeesInformation", diff --git a/core/api/src/graphql/public/types/object/global-settings.ts b/core/api/src/graphql/public/types/object/global-settings.ts index afa17db794..7542858c15 100644 --- a/core/api/src/graphql/public/types/object/global-settings.ts +++ b/core/api/src/graphql/public/types/object/global-settings.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import WalletCurrency from "../../../shared/types/scalar/wallet-currency" +import { GT } from "@/graphql/index" + const GlobalSettings = GT.Object({ name: "GlobalSettings", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/globals.ts b/core/api/src/graphql/public/types/object/globals.ts index 7bc43fccba..e0d5256435 100644 --- a/core/api/src/graphql/public/types/object/globals.ts +++ b/core/api/src/graphql/public/types/object/globals.ts @@ -1,5 +1,4 @@ import dedent from "dedent" -import { GT } from "@graphql/index" import Network from "../scalar/network" @@ -7,6 +6,8 @@ import Country from "./country" import FeesInformation from "./fees-information" import BuildInformation from "./build-information" +import { GT } from "@/graphql/index" + const Globals = GT.Object({ name: "Globals", description: diff --git a/core/api/src/graphql/public/types/object/limits.ts b/core/api/src/graphql/public/types/object/limits.ts index fc84ed5fb3..b938402505 100644 --- a/core/api/src/graphql/public/types/object/limits.ts +++ b/core/api/src/graphql/public/types/object/limits.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const Limits = GT.Object({ // TODO: update name for type, too generic. we already type like AccountLimits. diff --git a/core/api/src/graphql/public/types/object/ln-invoice-payment-status-input.ts b/core/api/src/graphql/public/types/object/ln-invoice-payment-status-input.ts index 4e6b11fa6a..11dad2fb49 100644 --- a/core/api/src/graphql/public/types/object/ln-invoice-payment-status-input.ts +++ b/core/api/src/graphql/public/types/object/ln-invoice-payment-status-input.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import LnPaymentRequest from "@graphql/shared/types/scalar/ln-payment-request" +import { GT } from "@/graphql/index" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" const LnInvoicePaymentStatusInput = GT.Input({ name: "LnInvoicePaymentStatusInput", diff --git a/core/api/src/graphql/public/types/object/ln-invoice.ts b/core/api/src/graphql/public/types/object/ln-invoice.ts index 0c661e5a70..f414ebf895 100644 --- a/core/api/src/graphql/public/types/object/ln-invoice.ts +++ b/core/api/src/graphql/public/types/object/ln-invoice.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" - import LnPaymentRequest from "../../../shared/types/scalar/ln-payment-request" import PaymentHash from "../../../shared/types/scalar/payment-hash" import LnPaymentSecret from "../../../shared/types/scalar/ln-payment-secret" import SatAmount from "../../../shared/types/scalar/sat-amount" +import { GT } from "@/graphql/index" + const LnInvoice = GT.Object({ name: "LnInvoice", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/ln-noamount-invoice.ts b/core/api/src/graphql/public/types/object/ln-noamount-invoice.ts index a3c1e7277a..efa9883c38 100644 --- a/core/api/src/graphql/public/types/object/ln-noamount-invoice.ts +++ b/core/api/src/graphql/public/types/object/ln-noamount-invoice.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import LnPaymentRequest from "../../../shared/types/scalar/ln-payment-request" import PaymentHash from "../../../shared/types/scalar/payment-hash" import LnPaymentSecret from "../../../shared/types/scalar/ln-payment-secret" +import { GT } from "@/graphql/index" + const LnNoAmountInvoice = GT.Object({ name: "LnNoAmountInvoice", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/map-info.ts b/core/api/src/graphql/public/types/object/map-info.ts index 915ae3e712..601ebe8528 100644 --- a/core/api/src/graphql/public/types/object/map-info.ts +++ b/core/api/src/graphql/public/types/object/map-info.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import Coordinates from "../../../shared/types/object/coordinates" +import { GT } from "@/graphql/index" + const MapInfo = GT.Object({ name: "MapInfo", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/map-marker.ts b/core/api/src/graphql/public/types/object/map-marker.ts index 40a04e624b..7e49c9894d 100644 --- a/core/api/src/graphql/public/types/object/map-marker.ts +++ b/core/api/src/graphql/public/types/object/map-marker.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import Username from "../../../shared/types/scalar/username" import MapInfo from "./map-info" +import { GT } from "@/graphql/index" + const MapMarker = GT.Object({ name: "MapMarker", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/mobile-versions.ts b/core/api/src/graphql/public/types/object/mobile-versions.ts index 2960b4e058..ac2fc59b6a 100644 --- a/core/api/src/graphql/public/types/object/mobile-versions.ts +++ b/core/api/src/graphql/public/types/object/mobile-versions.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const MobileVersions = GT.Object({ name: "MobileVersions", diff --git a/core/api/src/graphql/public/types/object/notification-channel-settings.ts b/core/api/src/graphql/public/types/object/notification-channel-settings.ts index 09d965b5a1..0262892005 100644 --- a/core/api/src/graphql/public/types/object/notification-channel-settings.ts +++ b/core/api/src/graphql/public/types/object/notification-channel-settings.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import NotificationCategory from "@graphql/shared/types/scalar/notification-category" +import { GT } from "@/graphql/index" +import NotificationCategory from "@/graphql/shared/types/scalar/notification-category" export const NotificationChannelSettings = GT.Object< NotificationChannelSettings, diff --git a/core/api/src/graphql/public/types/object/notification-settings.ts b/core/api/src/graphql/public/types/object/notification-settings.ts index 231238ba5b..7c8e59c9db 100644 --- a/core/api/src/graphql/public/types/object/notification-settings.ts +++ b/core/api/src/graphql/public/types/object/notification-settings.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import { NotificationChannelSettings } from "./notification-channel-settings" +import { GT } from "@/graphql/index" + export const NotificationSettings = GT.Object< NotificationSettings, GraphQLPublicContextAuth diff --git a/core/api/src/graphql/public/types/object/onchain-tx-fee.ts b/core/api/src/graphql/public/types/object/onchain-tx-fee.ts index 61ca6400b9..7a5bd34f03 100644 --- a/core/api/src/graphql/public/types/object/onchain-tx-fee.ts +++ b/core/api/src/graphql/public/types/object/onchain-tx-fee.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import SatAmount from "../../../shared/types/scalar/sat-amount" +import { GT } from "@/graphql/index" + const OnChainTxFee = GT.Object({ name: "OnChainTxFee", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/onchain-usd-tx-fee.ts b/core/api/src/graphql/public/types/object/onchain-usd-tx-fee.ts index 11d894a196..a2910f818d 100644 --- a/core/api/src/graphql/public/types/object/onchain-usd-tx-fee.ts +++ b/core/api/src/graphql/public/types/object/onchain-usd-tx-fee.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import CentAmount from "../scalar/cent-amount" +import { GT } from "@/graphql/index" + const OnChainUsdTxFee = GT.Object({ name: "OnChainUsdTxFee", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/one-day-account-limit.ts b/core/api/src/graphql/public/types/object/one-day-account-limit.ts index 4023d24b01..8e606736cd 100644 --- a/core/api/src/graphql/public/types/object/one-day-account-limit.ts +++ b/core/api/src/graphql/public/types/object/one-day-account-limit.ts @@ -1,15 +1,15 @@ -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" -import IAccountLimit from "@graphql/public/types/abstract/account-limit" -import CentAmount from "@graphql/public/types/scalar/cent-amount" -import Seconds from "@graphql/public/types/scalar/seconds" -import { normalizePaymentAmount } from "@graphql/shared/root/mutation" +import { GT } from "@/graphql/index" +import { mapError } from "@/graphql/error-map" +import IAccountLimit from "@/graphql/public/types/abstract/account-limit" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" +import Seconds from "@/graphql/public/types/scalar/seconds" +import { normalizePaymentAmount } from "@/graphql/shared/root/mutation" -import { Accounts } from "@app" -import { AccountLimitsRange, AccountLimitsType } from "@domain/accounts" -import { SECS_PER_DAY, getDealerConfig } from "@config" -import { InvalidAccountLimitTypeError } from "@domain/errors" -import { getMidPriceRatio } from "@app/prices" +import { Accounts } from "@/app" +import { AccountLimitsRange, AccountLimitsType } from "@/domain/accounts" +import { SECS_PER_DAY, getDealerConfig } from "@/config" +import { InvalidAccountLimitTypeError } from "@/domain/errors" +import { getMidPriceRatio } from "@/app/prices" const OneDayAccountLimit = GT.Object<{ account: Account diff --git a/core/api/src/graphql/public/types/object/price-of-one-sat-in-minor-unit.ts b/core/api/src/graphql/public/types/object/price-of-one-sat-in-minor-unit.ts index a073d42db6..87b7140f11 100644 --- a/core/api/src/graphql/public/types/object/price-of-one-sat-in-minor-unit.ts +++ b/core/api/src/graphql/public/types/object/price-of-one-sat-in-minor-unit.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IPrice from "../../../shared/types/abstract/price" import SafeInt from "../../../shared/types/scalar/safe-int" +import { GT } from "@/graphql/index" + const PriceOfOneSatInMinorUnit = GT.Object({ name: "PriceOfOneSatInMinorUnit", interfaces: () => [IPrice], diff --git a/core/api/src/graphql/public/types/object/price-of-one-usd-cent-in-minor-unit.ts b/core/api/src/graphql/public/types/object/price-of-one-usd-cent-in-minor-unit.ts index cb24072055..ed9b224697 100644 --- a/core/api/src/graphql/public/types/object/price-of-one-usd-cent-in-minor-unit.ts +++ b/core/api/src/graphql/public/types/object/price-of-one-usd-cent-in-minor-unit.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IPrice from "../../../shared/types/abstract/price" import SafeInt from "../../../shared/types/scalar/safe-int" +import { GT } from "@/graphql/index" + const PriceOfOneUsdCentInMinorUnit = GT.Object({ name: "PriceOfOneUsdCentInMinorUnit", interfaces: () => [IPrice], diff --git a/core/api/src/graphql/public/types/object/price-point.ts b/core/api/src/graphql/public/types/object/price-point.ts index 62210d044a..31402e14bb 100644 --- a/core/api/src/graphql/public/types/object/price-point.ts +++ b/core/api/src/graphql/public/types/object/price-point.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import Timestamp from "../../../shared/types/scalar/timestamp" import Price from "./price" +import { GT } from "@/graphql/index" + const PricePoint = GT.Object({ name: "PricePoint", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/price.ts b/core/api/src/graphql/public/types/object/price.ts index cae4b90ff4..6b1cf0be0a 100644 --- a/core/api/src/graphql/public/types/object/price.ts +++ b/core/api/src/graphql/public/types/object/price.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import SafeInt from "../../../shared/types/scalar/safe-int" +import { GT } from "@/graphql/index" + const Price = GT.Object({ name: "Price", description: diff --git a/core/api/src/graphql/public/types/object/quiz-question.ts b/core/api/src/graphql/public/types/object/quiz-question.ts index 47cc07c0d5..cb9cd6363f 100644 --- a/core/api/src/graphql/public/types/object/quiz-question.ts +++ b/core/api/src/graphql/public/types/object/quiz-question.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import SatAmount from "../../../shared/types/scalar/sat-amount" +import { GT } from "@/graphql/index" + // deprecated // TODO: remove const QuizQuestion = GT.Object({ name: "QuizQuestion", diff --git a/core/api/src/graphql/public/types/object/quiz.ts b/core/api/src/graphql/public/types/object/quiz.ts index f1bed20069..699fbb1b5b 100644 --- a/core/api/src/graphql/public/types/object/quiz.ts +++ b/core/api/src/graphql/public/types/object/quiz.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import SatAmount from "../../../shared/types/scalar/sat-amount" +import { GT } from "@/graphql/index" + const Quiz = GT.Object({ name: "Quiz", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/realtime-price.ts b/core/api/src/graphql/public/types/object/realtime-price.ts index 49a74eef1e..51e2c3d67f 100644 --- a/core/api/src/graphql/public/types/object/realtime-price.ts +++ b/core/api/src/graphql/public/types/object/realtime-price.ts @@ -1,7 +1,5 @@ import getUuidByString from "uuid-by-string" -import { GT } from "@graphql/index" - import Timestamp from "../../../shared/types/scalar/timestamp" import DisplayCurrencyGT from "../../../shared/types/scalar/display-currency" @@ -9,6 +7,8 @@ import DisplayCurrencyGT from "../../../shared/types/scalar/display-currency" import PriceOfOneSatInMinorUnit from "./price-of-one-sat-in-minor-unit" import PriceOfOneUsdCentInMinorUnit from "./price-of-one-usd-cent-in-minor-unit" +import { GT } from "@/graphql/index" + const RealtimePrice = GT.Object({ name: "RealtimePrice", fields: () => ({ diff --git a/core/api/src/graphql/public/types/object/user-quiz-question.ts b/core/api/src/graphql/public/types/object/user-quiz-question.ts index d611b14625..612b429962 100644 --- a/core/api/src/graphql/public/types/object/user-quiz-question.ts +++ b/core/api/src/graphql/public/types/object/user-quiz-question.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import QuizQuestion from "./quiz-question" +import { GT } from "@/graphql/index" + // deprecated // TODO: remove const UserQuizQuestion = GT.Object({ name: "UserQuizQuestion", diff --git a/core/api/src/graphql/public/types/object/user.ts b/core/api/src/graphql/public/types/object/user.ts index 3cf2e12551..d951566a4e 100644 --- a/core/api/src/graphql/public/types/object/user.ts +++ b/core/api/src/graphql/public/types/object/user.ts @@ -1,16 +1,6 @@ import dedent from "dedent" -import { GT } from "@graphql/index" - -import { Accounts } from "@app" - -import { mapError } from "@graphql/error-map" -import { UnknownClientError } from "@graphql/error" - -import { baseLogger } from "@services/logger" - // FIXME should not use service -import { IdentityRepository } from "@services/kratos" import Account from "../abstract/account" @@ -25,6 +15,13 @@ import GraphQLEmail from "../../../shared/types/object/email" import AccountContact from "./account-contact" import UserQuizQuestion from "./user-quiz-question" +import { IdentityRepository } from "@/services/kratos" +import { UnknownClientError } from "@/graphql/error" +import { baseLogger } from "@/services/logger" +import { Accounts } from "@/app" +import { mapError } from "@/graphql/error-map" +import { GT } from "@/graphql/index" + const GraphQLUser = GT.Object({ name: "User", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/account-delete.ts b/core/api/src/graphql/public/types/payload/account-delete.ts index a74f324cd0..51c3693a87 100644 --- a/core/api/src/graphql/public/types/payload/account-delete.ts +++ b/core/api/src/graphql/public/types/payload/account-delete.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" +import { GT } from "@/graphql/index" + const AccountDeletePayload = GT.Object({ name: "AccountDeletePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/account-update-default-wallet-id.ts b/core/api/src/graphql/public/types/payload/account-update-default-wallet-id.ts index bbc8dd750d..1480fac6e1 100644 --- a/core/api/src/graphql/public/types/payload/account-update-default-wallet-id.ts +++ b/core/api/src/graphql/public/types/payload/account-update-default-wallet-id.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import ConsumerAccount from "../object/consumer-account" +import { GT } from "@/graphql/index" + const AccountUpdateDefaultWalletIdPayload = GT.Object({ name: "AccountUpdateDefaultWalletIdPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/account-update-display-currency.ts b/core/api/src/graphql/public/types/payload/account-update-display-currency.ts index 1e3b95f4f3..e36229be33 100644 --- a/core/api/src/graphql/public/types/payload/account-update-display-currency.ts +++ b/core/api/src/graphql/public/types/payload/account-update-display-currency.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import ConsumerAccount from "../object/consumer-account" +import { GT } from "@/graphql/index" + const AccountUpdateDisplayCurrencyPayload = GT.Object({ name: "AccountUpdateDisplayCurrencyPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/account-update-notification-settings.ts b/core/api/src/graphql/public/types/payload/account-update-notification-settings.ts index 0ef91e3124..8c160b6397 100644 --- a/core/api/src/graphql/public/types/payload/account-update-notification-settings.ts +++ b/core/api/src/graphql/public/types/payload/account-update-notification-settings.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import ConsumerAccount from "../object/consumer-account" +import { GT } from "@/graphql/index" + const AccountUpdateNotificationSettingsPayload = GT.Object({ name: "AccountUpdateNotificationSettingsPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/callback-endpoint-add.ts b/core/api/src/graphql/public/types/payload/callback-endpoint-add.ts index afb6350596..1e287a1b87 100644 --- a/core/api/src/graphql/public/types/payload/callback-endpoint-add.ts +++ b/core/api/src/graphql/public/types/payload/callback-endpoint-add.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import EndpointId from "../scalar/endpoint-id" +import { GT } from "@/graphql/index" + const CallbackEndpointAddPayload = GT.Object({ name: "CallbackEndpointAddPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/cent-amount.ts b/core/api/src/graphql/public/types/payload/cent-amount.ts index b0a75dbad3..c9842e4d7b 100644 --- a/core/api/src/graphql/public/types/payload/cent-amount.ts +++ b/core/api/src/graphql/public/types/payload/cent-amount.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import IError from "@graphql/shared/types/abstract/error" -import CentAmount from "@graphql/public/types/scalar/cent-amount" +import IError from "@/graphql/shared/types/abstract/error" +import CentAmount from "@/graphql/public/types/scalar/cent-amount" const CentAmountPayload = GT.Object({ name: "CentAmountPayload", diff --git a/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts b/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts index 252728f064..ac638c5b2f 100644 --- a/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts +++ b/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import InvoicePaymentStatus from "../scalar/invoice-payment-status" +import { GT } from "@/graphql/index" + const LnInvoicePaymentStatusPayload = GT.Object({ name: "LnInvoicePaymentStatusPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/ln-invoice.ts b/core/api/src/graphql/public/types/payload/ln-invoice.ts index 378d08b607..0f93d6dd88 100644 --- a/core/api/src/graphql/public/types/payload/ln-invoice.ts +++ b/core/api/src/graphql/public/types/payload/ln-invoice.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import LnInvoice from "../object/ln-invoice" +import { GT } from "@/graphql/index" + const LnInvoicePayload = GT.Object({ name: "LnInvoicePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/ln-noamount-invoice.ts b/core/api/src/graphql/public/types/payload/ln-noamount-invoice.ts index 011f15e99e..35a3ccde2b 100644 --- a/core/api/src/graphql/public/types/payload/ln-noamount-invoice.ts +++ b/core/api/src/graphql/public/types/payload/ln-noamount-invoice.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import LnNoAmountInvoice from "../object/ln-noamount-invoice" +import { GT } from "@/graphql/index" + const LnNoAmountInvoicePayload = GT.Object({ name: "LnNoAmountInvoicePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/on-chain-address.ts b/core/api/src/graphql/public/types/payload/on-chain-address.ts index a7ac74be4a..2502c9c7eb 100644 --- a/core/api/src/graphql/public/types/payload/on-chain-address.ts +++ b/core/api/src/graphql/public/types/payload/on-chain-address.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import OnChainAddress from "../../../shared/types/scalar/on-chain-address" +import { GT } from "@/graphql/index" + const OnChainAddressPayload = GT.Object({ name: "OnChainAddressPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/payment-send.ts b/core/api/src/graphql/public/types/payload/payment-send.ts index 1f27a249a6..92f03b4b52 100644 --- a/core/api/src/graphql/public/types/payload/payment-send.ts +++ b/core/api/src/graphql/public/types/payload/payment-send.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import PaymentSendResult from "../scalar/payment-send-result" +import { GT } from "@/graphql/index" + const PaymentSendPayload = GT.Object({ name: "PaymentSendPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/price.ts b/core/api/src/graphql/public/types/payload/price.ts index 21ccee76e4..6993022665 100644 --- a/core/api/src/graphql/public/types/payload/price.ts +++ b/core/api/src/graphql/public/types/payload/price.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import Price from "../object/price" +import { GT } from "@/graphql/index" + const PricePayload = GT.Object({ name: "PricePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/quiz-completed.ts b/core/api/src/graphql/public/types/payload/quiz-completed.ts index 314df2f6fe..0e6ba19580 100644 --- a/core/api/src/graphql/public/types/payload/quiz-completed.ts +++ b/core/api/src/graphql/public/types/payload/quiz-completed.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import Quiz from "../object/quiz" +import { GT } from "@/graphql/index" + const QuizCompletedPayload = GT.Object({ name: "QuizCompletedPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/realtime-price.ts b/core/api/src/graphql/public/types/payload/realtime-price.ts index f012c943cf..18e3b0a322 100644 --- a/core/api/src/graphql/public/types/payload/realtime-price.ts +++ b/core/api/src/graphql/public/types/payload/realtime-price.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import RealtimePrice from "../object/realtime-price" +import { GT } from "@/graphql/index" + const RealtimePricePayload = GT.Object({ name: "RealtimePricePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/sat-amount.ts b/core/api/src/graphql/public/types/payload/sat-amount.ts index e380a1e93a..da9f0aea48 100644 --- a/core/api/src/graphql/public/types/payload/sat-amount.ts +++ b/core/api/src/graphql/public/types/payload/sat-amount.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import IError from "@graphql/shared/types/abstract/error" -import SatAmount from "@graphql/shared/types/scalar/sat-amount" +import IError from "@/graphql/shared/types/abstract/error" +import SatAmount from "@/graphql/shared/types/scalar/sat-amount" const SatAmountPayload = GT.Object({ name: "SatAmountPayload", diff --git a/core/api/src/graphql/public/types/payload/upgrade-payload.ts b/core/api/src/graphql/public/types/payload/upgrade-payload.ts index 9ece6931e4..3ae646157c 100644 --- a/core/api/src/graphql/public/types/payload/upgrade-payload.ts +++ b/core/api/src/graphql/public/types/payload/upgrade-payload.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" +import IError from "../../../shared/types/abstract/error" -import AuthToken from "@graphql/shared/types/scalar/auth-token" +import { GT } from "@/graphql/index" -import IError from "../../../shared/types/abstract/error" +import AuthToken from "@/graphql/shared/types/scalar/auth-token" const UpgradePayload = GT.Object({ name: "UpgradePayload", diff --git a/core/api/src/graphql/public/types/payload/user-contact-update-alias.ts b/core/api/src/graphql/public/types/payload/user-contact-update-alias.ts index d34995b8f9..b85b43f421 100644 --- a/core/api/src/graphql/public/types/payload/user-contact-update-alias.ts +++ b/core/api/src/graphql/public/types/payload/user-contact-update-alias.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import AccountContact from "../object/account-contact" +import { GT } from "@/graphql/index" + const AccountContactUpdateAliasPayload = GT.Object({ name: "UserContactUpdateAliasPayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-email-delete.ts b/core/api/src/graphql/public/types/payload/user-email-delete.ts index b6a7f11048..665d09fc99 100644 --- a/core/api/src/graphql/public/types/payload/user-email-delete.ts +++ b/core/api/src/graphql/public/types/payload/user-email-delete.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import GraphQLUser from "../object/user" import IError from "../../../shared/types/abstract/error" +import { GT } from "@/graphql/index" + const UserEmailDeletePayload = GT.Object({ name: "UserEmailDeletePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-email-registration-initiate.ts b/core/api/src/graphql/public/types/payload/user-email-registration-initiate.ts index c36aa42ea4..3a724f14da 100644 --- a/core/api/src/graphql/public/types/payload/user-email-registration-initiate.ts +++ b/core/api/src/graphql/public/types/payload/user-email-registration-initiate.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import EmailRegistrationId from "../scalar/email-verify-id" import GraphQLUser from "../object/user" +import { GT } from "@/graphql/index" + const UserEmailRegistrationInitiatePayload = GT.Object({ name: "UserEmailRegistrationInitiatePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-email-registration-validate.ts b/core/api/src/graphql/public/types/payload/user-email-registration-validate.ts index d3c1e8d0b5..176ff6a2d5 100644 --- a/core/api/src/graphql/public/types/payload/user-email-registration-validate.ts +++ b/core/api/src/graphql/public/types/payload/user-email-registration-validate.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import GraphQLUser from "../object/user" import IError from "../../../shared/types/abstract/error" +import { GT } from "@/graphql/index" + const UserEmailRegistrationValidatePayload = GT.Object({ name: "UserEmailRegistrationValidatePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-phone-delete.ts b/core/api/src/graphql/public/types/payload/user-phone-delete.ts index 3a14541934..b4d5d7883c 100644 --- a/core/api/src/graphql/public/types/payload/user-phone-delete.ts +++ b/core/api/src/graphql/public/types/payload/user-phone-delete.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import GraphQLUser from "../object/user" import IError from "../../../shared/types/abstract/error" +import { GT } from "@/graphql/index" + const UserPhoneDeletePayload = GT.Object({ name: "UserPhoneDeletePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-phone-registration-validate.ts b/core/api/src/graphql/public/types/payload/user-phone-registration-validate.ts index 837e2c8470..095e679a8b 100644 --- a/core/api/src/graphql/public/types/payload/user-phone-registration-validate.ts +++ b/core/api/src/graphql/public/types/payload/user-phone-registration-validate.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import GraphQLUser from "../object/user" import IError from "../../../shared/types/abstract/error" +import { GT } from "@/graphql/index" + const UserPhoneRegistrationValidatePayload = GT.Object({ name: "UserPhoneRegistrationValidatePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-quiz-question-update-completed.ts b/core/api/src/graphql/public/types/payload/user-quiz-question-update-completed.ts index 7447e50562..48acc6c7f3 100644 --- a/core/api/src/graphql/public/types/payload/user-quiz-question-update-completed.ts +++ b/core/api/src/graphql/public/types/payload/user-quiz-question-update-completed.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import UserQuizQuestion from "../object/user-quiz-question" +import { GT } from "@/graphql/index" + // deprecated in favor of QuizCompletedMutation const UserQuizQuestionUpdateCompletedPayload = GT.Object({ name: "UserQuizQuestionUpdateCompletedPayload", diff --git a/core/api/src/graphql/public/types/payload/user-totp-delete.ts b/core/api/src/graphql/public/types/payload/user-totp-delete.ts index f1d6da38e1..0446f4760b 100644 --- a/core/api/src/graphql/public/types/payload/user-totp-delete.ts +++ b/core/api/src/graphql/public/types/payload/user-totp-delete.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import GraphQLUser from "../object/user" import IError from "../../../shared/types/abstract/error" +import { GT } from "@/graphql/index" + const UserTotpDeletePayload = GT.Object({ name: "UserTotpDeletePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-totp-registration-initiate.ts b/core/api/src/graphql/public/types/payload/user-totp-registration-initiate.ts index 71475ba90b..6423fe25f4 100644 --- a/core/api/src/graphql/public/types/payload/user-totp-registration-initiate.ts +++ b/core/api/src/graphql/public/types/payload/user-totp-registration-initiate.ts @@ -1,9 +1,9 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import TotpRegistrationId from "../scalar/totp-verify-id" import TotpSecret from "../scalar/totp-secret" +import { GT } from "@/graphql/index" + const UserTotpRegistrationInitiatePayload = GT.Object({ name: "UserTotpRegistrationInitiatePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-totp-registration-validate.ts b/core/api/src/graphql/public/types/payload/user-totp-registration-validate.ts index b91e1e1e93..83e7a809f9 100644 --- a/core/api/src/graphql/public/types/payload/user-totp-registration-validate.ts +++ b/core/api/src/graphql/public/types/payload/user-totp-registration-validate.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import GraphQLUser from "../object/user" +import { GT } from "@/graphql/index" + const UserTotpRegistrationValidatePayload = GT.Object({ name: "UserTotpRegistrationValidatePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-update-language.ts b/core/api/src/graphql/public/types/payload/user-update-language.ts index 4a4ccacab5..5bc600fe01 100644 --- a/core/api/src/graphql/public/types/payload/user-update-language.ts +++ b/core/api/src/graphql/public/types/payload/user-update-language.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import GraphQLUser from "../object/user" import IError from "../../../shared/types/abstract/error" +import { GT } from "@/graphql/index" + const UserUpdateLanguagePayload = GT.Object({ name: "UserUpdateLanguagePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/payload/user-update-username.ts b/core/api/src/graphql/public/types/payload/user-update-username.ts index 2ac117e1c8..89892eb36d 100644 --- a/core/api/src/graphql/public/types/payload/user-update-username.ts +++ b/core/api/src/graphql/public/types/payload/user-update-username.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IError from "../../../shared/types/abstract/error" import GraphQLUser from "../object/user" +import { GT } from "@/graphql/index" + const UserUpdateUsernamePayload = GT.Object({ name: "UserUpdateUsernamePayload", fields: () => ({ diff --git a/core/api/src/graphql/public/types/scalar/cent-amount.ts b/core/api/src/graphql/public/types/scalar/cent-amount.ts index 92e718d6e2..b5e11cfc3f 100644 --- a/core/api/src/graphql/public/types/scalar/cent-amount.ts +++ b/core/api/src/graphql/public/types/scalar/cent-amount.ts @@ -1,6 +1,6 @@ -import { MAX_CENTS } from "@domain/shared" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { MAX_CENTS } from "@/domain/shared" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const CentAmount = GT.Scalar({ name: "CentAmount", diff --git a/core/api/src/graphql/public/types/scalar/contact-alias.ts b/core/api/src/graphql/public/types/scalar/contact-alias.ts index de309b51a7..e568b789be 100644 --- a/core/api/src/graphql/public/types/scalar/contact-alias.ts +++ b/core/api/src/graphql/public/types/scalar/contact-alias.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const ContactAlias = GT.Scalar({ name: "ContactAlias", diff --git a/core/api/src/graphql/public/types/scalar/country-code.ts b/core/api/src/graphql/public/types/scalar/country-code.ts index 435a3c6040..6e2650956c 100644 --- a/core/api/src/graphql/public/types/scalar/country-code.ts +++ b/core/api/src/graphql/public/types/scalar/country-code.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import { InputValidationError } from "@graphql/error" +import { GT } from "@/graphql/index" +import { InputValidationError } from "@/graphql/error" const CountryCode = GT.Scalar({ name: "CountryCode", diff --git a/core/api/src/graphql/public/types/scalar/email-verify-id.ts b/core/api/src/graphql/public/types/scalar/email-verify-id.ts index 49a8d97acf..1c063b28a1 100644 --- a/core/api/src/graphql/public/types/scalar/email-verify-id.ts +++ b/core/api/src/graphql/public/types/scalar/email-verify-id.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import { checkedToEmailRegistrationId } from "@services/kratos" +import { GT } from "@/graphql/index" +import { checkedToEmailRegistrationId } from "@/services/kratos" const EmailRegistrationId = GT.Scalar({ name: "EmailRegistrationId", diff --git a/core/api/src/graphql/public/types/scalar/endpoint-id.ts b/core/api/src/graphql/public/types/scalar/endpoint-id.ts index 556c2c45d3..3ce18515b5 100644 --- a/core/api/src/graphql/public/types/scalar/endpoint-id.ts +++ b/core/api/src/graphql/public/types/scalar/endpoint-id.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const EndpointId = GT.Scalar({ name: "EndpointId", diff --git a/core/api/src/graphql/public/types/scalar/endpoint-url.ts b/core/api/src/graphql/public/types/scalar/endpoint-url.ts index d2a24d6036..edb8e0a691 100644 --- a/core/api/src/graphql/public/types/scalar/endpoint-url.ts +++ b/core/api/src/graphql/public/types/scalar/endpoint-url.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const EndpointUrl = GT.Scalar({ name: "EndpointUrl", diff --git a/core/api/src/graphql/public/types/scalar/exchange-currency-unit.ts b/core/api/src/graphql/public/types/scalar/exchange-currency-unit.ts index da48d1cab7..41a5b42c66 100644 --- a/core/api/src/graphql/public/types/scalar/exchange-currency-unit.ts +++ b/core/api/src/graphql/public/types/scalar/exchange-currency-unit.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const ExchangeCurrencyUnit = GT.Enum({ name: "ExchangeCurrencyUnit", diff --git a/core/api/src/graphql/public/types/scalar/fee-reimbursement-hash.ts b/core/api/src/graphql/public/types/scalar/fee-reimbursement-hash.ts index 5c116039e1..69cec548e8 100644 --- a/core/api/src/graphql/public/types/scalar/fee-reimbursement-hash.ts +++ b/core/api/src/graphql/public/types/scalar/fee-reimbursement-hash.ts @@ -1,6 +1,6 @@ -import { isSha256Hash } from "@domain/bitcoin" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { isSha256Hash } from "@/domain/bitcoin" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const FeeReimbursementHash = GT.Scalar({ name: "FeeReimbursementHash", diff --git a/core/api/src/graphql/public/types/scalar/feedback.ts b/core/api/src/graphql/public/types/scalar/feedback.ts index 7ef098f997..761c77650a 100644 --- a/core/api/src/graphql/public/types/scalar/feedback.ts +++ b/core/api/src/graphql/public/types/scalar/feedback.ts @@ -1,6 +1,6 @@ -import { MAX_LENGTH_FOR_FEEDBACK } from "@config" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { MAX_LENGTH_FOR_FEEDBACK } from "@/config" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const Feedback = GT.Scalar({ name: "Feedback", diff --git a/core/api/src/graphql/public/types/scalar/hex32bytes.ts b/core/api/src/graphql/public/types/scalar/hex32bytes.ts index 70dfa4f17b..eaafa9fb84 100644 --- a/core/api/src/graphql/public/types/scalar/hex32bytes.ts +++ b/core/api/src/graphql/public/types/scalar/hex32bytes.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const Hex32Bytes = GT.Scalar({ name: "Hex32Bytes", diff --git a/core/api/src/graphql/public/types/scalar/invoice-payment-status.ts b/core/api/src/graphql/public/types/scalar/invoice-payment-status.ts index 831f559726..564eadfd8b 100644 --- a/core/api/src/graphql/public/types/scalar/invoice-payment-status.ts +++ b/core/api/src/graphql/public/types/scalar/invoice-payment-status.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const InvoicePaymentStatus = GT.Enum({ name: "InvoicePaymentStatus", diff --git a/core/api/src/graphql/public/types/scalar/ln-noamount-invoice-payment-request.ts b/core/api/src/graphql/public/types/scalar/ln-noamount-invoice-payment-request.ts index 0fc1fb7154..9a8ec3f593 100644 --- a/core/api/src/graphql/public/types/scalar/ln-noamount-invoice-payment-request.ts +++ b/core/api/src/graphql/public/types/scalar/ln-noamount-invoice-payment-request.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const LnNoAmountInvoicePaymentRequest = GT.Scalar({ name: "LnNoAmountInvoicePaymentRequest", diff --git a/core/api/src/graphql/public/types/scalar/minutes.ts b/core/api/src/graphql/public/types/scalar/minutes.ts index 9b1c10c6be..23df5348ba 100644 --- a/core/api/src/graphql/public/types/scalar/minutes.ts +++ b/core/api/src/graphql/public/types/scalar/minutes.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import { InputValidationError } from "@graphql/error" +import { GT } from "@/graphql/index" +import { InputValidationError } from "@/graphql/error" const Minutes = GT.Scalar({ name: "Minutes", diff --git a/core/api/src/graphql/public/types/scalar/network.ts b/core/api/src/graphql/public/types/scalar/network.ts index c63a5d6082..259342345c 100644 --- a/core/api/src/graphql/public/types/scalar/network.ts +++ b/core/api/src/graphql/public/types/scalar/network.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const Network = GT.Enum({ name: "Network", diff --git a/core/api/src/graphql/public/types/scalar/payment-send-result.ts b/core/api/src/graphql/public/types/scalar/payment-send-result.ts index bf658740b0..b7d083e98b 100644 --- a/core/api/src/graphql/public/types/scalar/payment-send-result.ts +++ b/core/api/src/graphql/public/types/scalar/payment-send-result.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const PaymentSendResult = GT.Enum({ name: "PaymentSendResult", diff --git a/core/api/src/graphql/public/types/scalar/payout-speed.ts b/core/api/src/graphql/public/types/scalar/payout-speed.ts index 717bcaa815..1ca1931c15 100644 --- a/core/api/src/graphql/public/types/scalar/payout-speed.ts +++ b/core/api/src/graphql/public/types/scalar/payout-speed.ts @@ -1,5 +1,5 @@ -import { PayoutSpeed as DomainPayoutSpeed } from "@domain/bitcoin/onchain" -import { GT } from "@graphql/index" +import { PayoutSpeed as DomainPayoutSpeed } from "@/domain/bitcoin/onchain" +import { GT } from "@/graphql/index" const PayoutSpeed = GT.Enum({ name: "PayoutSpeed", diff --git a/core/api/src/graphql/public/types/scalar/price-graph-range.ts b/core/api/src/graphql/public/types/scalar/price-graph-range.ts index 46ed29969a..6df597589f 100644 --- a/core/api/src/graphql/public/types/scalar/price-graph-range.ts +++ b/core/api/src/graphql/public/types/scalar/price-graph-range.ts @@ -1,6 +1,6 @@ import { GraphQLEnumValueConfigMap } from "graphql" -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" export const priceRangeValues = [ "ONE_DAY", diff --git a/core/api/src/graphql/public/types/scalar/seconds.ts b/core/api/src/graphql/public/types/scalar/seconds.ts index e8d7499332..daa7f5f6b3 100644 --- a/core/api/src/graphql/public/types/scalar/seconds.ts +++ b/core/api/src/graphql/public/types/scalar/seconds.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const Seconds = GT.Scalar({ name: "Seconds", diff --git a/core/api/src/graphql/public/types/scalar/totp-code.ts b/core/api/src/graphql/public/types/scalar/totp-code.ts index 1ca05caad8..cfb8d5a3e5 100644 --- a/core/api/src/graphql/public/types/scalar/totp-code.ts +++ b/core/api/src/graphql/public/types/scalar/totp-code.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import { checkedToTotpCode } from "@services/kratos" +import { GT } from "@/graphql/index" +import { checkedToTotpCode } from "@/services/kratos" const TotpCode = GT.Scalar({ name: "TotpCode", diff --git a/core/api/src/graphql/public/types/scalar/totp-secret.ts b/core/api/src/graphql/public/types/scalar/totp-secret.ts index 2faa189d33..6ce541c79b 100644 --- a/core/api/src/graphql/public/types/scalar/totp-secret.ts +++ b/core/api/src/graphql/public/types/scalar/totp-secret.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const TotpSecret = GT.Scalar({ name: "TotpSecret", diff --git a/core/api/src/graphql/public/types/scalar/totp-verify-id.ts b/core/api/src/graphql/public/types/scalar/totp-verify-id.ts index c203df79f9..84fd5b303f 100644 --- a/core/api/src/graphql/public/types/scalar/totp-verify-id.ts +++ b/core/api/src/graphql/public/types/scalar/totp-verify-id.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import { checkedToTotpRegistrationId } from "@services/kratos" +import { GT } from "@/graphql/index" +import { checkedToTotpRegistrationId } from "@/services/kratos" const TotpRegistrationId = GT.Scalar({ name: "TotpRegistrationId", diff --git a/core/api/src/graphql/public/types/scalar/tx-notification-type.ts b/core/api/src/graphql/public/types/scalar/tx-notification-type.ts index 1a2655b1e5..a9bb602eec 100644 --- a/core/api/src/graphql/public/types/scalar/tx-notification-type.ts +++ b/core/api/src/graphql/public/types/scalar/tx-notification-type.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const TxNotificationType = GT.Enum({ name: "TxNotificationType", diff --git a/core/api/src/graphql/shared/root/mutation/captcha-create-challenge.ts b/core/api/src/graphql/shared/root/mutation/captcha-create-challenge.ts index a20d96af04..4a1e41f499 100644 --- a/core/api/src/graphql/shared/root/mutation/captcha-create-challenge.ts +++ b/core/api/src/graphql/shared/root/mutation/captcha-create-challenge.ts @@ -1,8 +1,8 @@ -import { registerCaptchaGeetest } from "@app/captcha" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { GT } from "@graphql/index" +import { registerCaptchaGeetest } from "@/app/captcha" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { GT } from "@/graphql/index" -import CaptchaCreateChallengePayload from "@graphql/shared/types/payload/captcha-create-challenge" +import CaptchaCreateChallengePayload from "@/graphql/shared/types/payload/captcha-create-challenge" const CaptchaCreateChallengeMutation = GT.Field({ extensions: { diff --git a/core/api/src/graphql/shared/root/mutation/captcha-request-auth-code.ts b/core/api/src/graphql/shared/root/mutation/captcha-request-auth-code.ts index 10238204a9..acd410752c 100644 --- a/core/api/src/graphql/shared/root/mutation/captcha-request-auth-code.ts +++ b/core/api/src/graphql/shared/root/mutation/captcha-request-auth-code.ts @@ -1,12 +1,12 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import Phone from "@graphql/shared/types/scalar/phone" -import SuccessPayload from "@graphql/shared/types/payload/success-payload" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" -import { ChannelType } from "@domain/phone-provider" -import PhoneCodeChannelType from "@graphql/shared/types/scalar/phone-code-channel-type" -import { InputValidationError } from "@graphql/error" +import Phone from "@/graphql/shared/types/scalar/phone" +import SuccessPayload from "@/graphql/shared/types/payload/success-payload" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { ChannelType } from "@/domain/phone-provider" +import PhoneCodeChannelType from "@/graphql/shared/types/scalar/phone-code-channel-type" +import { InputValidationError } from "@/graphql/error" const CaptchaRequestAuthCodeInput = GT.Input({ name: "CaptchaRequestAuthCodeInput", diff --git a/core/api/src/graphql/shared/root/mutation/index.ts b/core/api/src/graphql/shared/root/mutation/index.ts index 0747f000c8..8ca6c82fa7 100644 --- a/core/api/src/graphql/shared/root/mutation/index.ts +++ b/core/api/src/graphql/shared/root/mutation/index.ts @@ -1,4 +1,4 @@ -import { ExchangeCurrencyUnit, WalletCurrency } from "@domain/shared" +import { ExchangeCurrencyUnit, WalletCurrency } from "@/domain/shared" export const normalizePaymentAmount = ( paymentAmount: PaymentAmount, diff --git a/core/api/src/graphql/shared/root/mutation/user-login.ts b/core/api/src/graphql/shared/root/mutation/user-login.ts index 615f75e2df..ef17a7f77f 100644 --- a/core/api/src/graphql/shared/root/mutation/user-login.ts +++ b/core/api/src/graphql/shared/root/mutation/user-login.ts @@ -1,10 +1,10 @@ -import { GT } from "@graphql/index" -import OneTimeAuthCode from "@graphql/shared/types/scalar/one-time-auth-code" +import { GT } from "@/graphql/index" +import OneTimeAuthCode from "@/graphql/shared/types/scalar/one-time-auth-code" -import Phone from "@graphql/shared/types/scalar/phone" -import AuthTokenPayload from "@graphql/shared/types/payload/auth-token" -import { Authentication } from "@app" -import { mapAndParseErrorForGqlResponse } from "@graphql/error-map" +import Phone from "@/graphql/shared/types/scalar/phone" +import AuthTokenPayload from "@/graphql/shared/types/payload/auth-token" +import { Authentication } from "@/app" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" const UserLoginInput = GT.Input({ name: "UserLoginInput", diff --git a/core/api/src/graphql/shared/types/abstract/error.ts b/core/api/src/graphql/shared/types/abstract/error.ts index 7876ddef7b..cd294648ce 100644 --- a/core/api/src/graphql/shared/types/abstract/error.ts +++ b/core/api/src/graphql/shared/types/abstract/error.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const IError = GT.Interface({ name: "Error", diff --git a/core/api/src/graphql/shared/types/abstract/initiation-via.ts b/core/api/src/graphql/shared/types/abstract/initiation-via.ts index 33d67a8d67..d0a431390a 100644 --- a/core/api/src/graphql/shared/types/abstract/initiation-via.ts +++ b/core/api/src/graphql/shared/types/abstract/initiation-via.ts @@ -1,12 +1,12 @@ -import { GT } from "@graphql/index" - -import { PaymentInitiationMethod } from "@domain/wallets" - import WalletId from "../scalar/wallet-id" import Username from "../scalar/username" import OnChainAddress from "../scalar/on-chain-address" import PaymentHash from "../scalar/payment-hash" +import { PaymentInitiationMethod } from "@/domain/wallets" + +import { GT } from "@/graphql/index" + const InitiationViaIntraLedger = GT.Object({ name: "InitiationViaIntraLedger", isTypeOf: (source) => source.type === PaymentInitiationMethod.IntraLedger, diff --git a/core/api/src/graphql/shared/types/abstract/price.ts b/core/api/src/graphql/shared/types/abstract/price.ts index a6be5f0e90..954d686cc6 100644 --- a/core/api/src/graphql/shared/types/abstract/price.ts +++ b/core/api/src/graphql/shared/types/abstract/price.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import SafeInt from "../scalar/safe-int" +import { GT } from "@/graphql/index" + const IPrice = GT.Interface({ name: "PriceInterface", fields: () => ({ diff --git a/core/api/src/graphql/shared/types/abstract/settlement-via.ts b/core/api/src/graphql/shared/types/abstract/settlement-via.ts index 17f77cd51e..8baa154446 100644 --- a/core/api/src/graphql/shared/types/abstract/settlement-via.ts +++ b/core/api/src/graphql/shared/types/abstract/settlement-via.ts @@ -1,17 +1,18 @@ import dedent from "dedent" -import { GT } from "@graphql/index" +import OnChainTxHash from "../scalar/onchain-tx-hash" -import { SettlementMethod } from "@domain/wallets" +import LnPaymentSecret from "../scalar/ln-payment-secret" -import WalletId from "@graphql/shared/types/scalar/wallet-id" +import { GT } from "@/graphql/index" -import Username from "@graphql/shared/types/scalar/username" +import { SettlementMethod } from "@/domain/wallets" -import LnPaymentPreImage from "@graphql/shared/types/scalar/ln-payment-preimage" +import WalletId from "@/graphql/shared/types/scalar/wallet-id" -import OnChainTxHash from "../scalar/onchain-tx-hash" -import LnPaymentSecret from "../scalar/ln-payment-secret" +import Username from "@/graphql/shared/types/scalar/username" + +import LnPaymentPreImage from "@/graphql/shared/types/scalar/ln-payment-preimage" const SettlementViaIntraLedger = GT.Object({ name: "SettlementViaIntraLedger", diff --git a/core/api/src/graphql/shared/types/abstract/wallet.ts b/core/api/src/graphql/shared/types/abstract/wallet.ts index 4de74cb7e0..49456e43f4 100644 --- a/core/api/src/graphql/shared/types/abstract/wallet.ts +++ b/core/api/src/graphql/shared/types/abstract/wallet.ts @@ -1,13 +1,13 @@ import dedent from "dedent" -import { GT } from "@graphql/index" -import { connectionArgs } from "@graphql/connections" - import { TransactionConnection } from "../object/transaction" import WalletCurrency from "../scalar/wallet-currency" import SignedAmount from "../scalar/signed-amount" import OnChainAddress from "../scalar/on-chain-address" +import { connectionArgs } from "@/graphql/connections" +import { GT } from "@/graphql/index" + const IWallet = GT.Interface({ name: "Wallet", description: "A generic wallet which stores value in one of our supported currencies.", diff --git a/core/api/src/graphql/shared/types/object/btc-wallet.ts b/core/api/src/graphql/shared/types/object/btc-wallet.ts index ad3933b839..f32d1dd9f1 100644 --- a/core/api/src/graphql/shared/types/object/btc-wallet.ts +++ b/core/api/src/graphql/shared/types/object/btc-wallet.ts @@ -1,24 +1,26 @@ -import { GT } from "@graphql/index" -import { normalizePaymentAmount } from "@graphql/shared/root/mutation" -import { - connectionArgs, - connectionFromPaginatedArray, - checkedConnectionArgs, -} from "@graphql/connections" -import { mapError } from "@graphql/error-map" - -import { Wallets } from "@app" - -import { WalletCurrency as WalletCurrencyDomain } from "@domain/shared" - import IWallet from "../abstract/wallet" import SignedAmount from "../scalar/signed-amount" + import WalletCurrency from "../scalar/wallet-currency" + import OnChainAddress from "../scalar/on-chain-address" import { TransactionConnection } from "./transaction" +import { GT } from "@/graphql/index" +import { normalizePaymentAmount } from "@/graphql/shared/root/mutation" +import { + connectionArgs, + connectionFromPaginatedArray, + checkedConnectionArgs, +} from "@/graphql/connections" +import { mapError } from "@/graphql/error-map" + +import { Wallets } from "@/app" + +import { WalletCurrency as WalletCurrencyDomain } from "@/domain/shared" + const BtcWallet = GT.Object({ name: "BTCWallet", description: diff --git a/core/api/src/graphql/shared/types/object/coordinates.ts b/core/api/src/graphql/shared/types/object/coordinates.ts index 98fd457aa6..92504bfc76 100644 --- a/core/api/src/graphql/shared/types/object/coordinates.ts +++ b/core/api/src/graphql/shared/types/object/coordinates.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const Coordinates = GT.Object({ name: "Coordinates", diff --git a/core/api/src/graphql/shared/types/object/email.ts b/core/api/src/graphql/shared/types/object/email.ts index 38c65a8941..0e12a92d07 100644 --- a/core/api/src/graphql/shared/types/object/email.ts +++ b/core/api/src/graphql/shared/types/object/email.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import EmailAddress from "../scalar/email-address" +import { GT } from "@/graphql/index" + const GraphQLEmail = GT.Object({ name: "Email", fields: () => ({ diff --git a/core/api/src/graphql/shared/types/object/graphql-application-error.ts b/core/api/src/graphql/shared/types/object/graphql-application-error.ts index eea9ecc56b..f2a625427e 100644 --- a/core/api/src/graphql/shared/types/object/graphql-application-error.ts +++ b/core/api/src/graphql/shared/types/object/graphql-application-error.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import IError from "../abstract/error" +import { GT } from "@/graphql/index" + const GraphQLApplicationError = GT.Object({ name: "GraphQLApplicationError", interfaces: () => [IError], diff --git a/core/api/src/graphql/shared/types/object/price-of-one-settlement-minor-unit-in-display-minor-unit.ts b/core/api/src/graphql/shared/types/object/price-of-one-settlement-minor-unit-in-display-minor-unit.ts index 72b9325532..5d44a25832 100644 --- a/core/api/src/graphql/shared/types/object/price-of-one-settlement-minor-unit-in-display-minor-unit.ts +++ b/core/api/src/graphql/shared/types/object/price-of-one-settlement-minor-unit-in-display-minor-unit.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" - import IPrice from "../abstract/price" import SafeInt from "../scalar/safe-int" +import { GT } from "@/graphql/index" + const PriceOfOneSettlementMinorUnitInDisplayMinorUnit = GT.Object({ name: "PriceOfOneSettlementMinorUnitInDisplayMinorUnit", interfaces: () => [IPrice], diff --git a/core/api/src/graphql/shared/types/object/transaction.ts b/core/api/src/graphql/shared/types/object/transaction.ts index 5ee920fcc7..b281bcbc92 100644 --- a/core/api/src/graphql/shared/types/object/transaction.ts +++ b/core/api/src/graphql/shared/types/object/transaction.ts @@ -1,15 +1,6 @@ import dedent from "dedent" import getUuidByString from "uuid-by-string" -import { GT } from "@graphql/index" -import { mapError } from "@graphql/error-map" -import { connectionDefinitions } from "@graphql/connections" -import { normalizeDisplayPrice } from "@graphql/shared/root/mutation" - -import { TxStatus as DomainTxStatus } from "@domain/wallets" -import { checkedToDisplayCurrency } from "@domain/fiat" -import { parseErrorFromUnknown } from "@domain/shared" - import InitiationVia from "../abstract/initiation-via" import SettlementVia from "../abstract/settlement-via" @@ -24,6 +15,14 @@ import TxDirection, { txDirectionValues } from "../scalar/tx-direction" import PriceOfOneSettlementMinorUnitInDisplayMinorUnit from "./price-of-one-settlement-minor-unit-in-display-minor-unit" +import { parseErrorFromUnknown } from "@/domain/shared" +import { TxStatus as DomainTxStatus } from "@/domain/wallets" +import { checkedToDisplayCurrency } from "@/domain/fiat" +import { normalizeDisplayPrice } from "@/graphql/shared/root/mutation" +import { connectionDefinitions } from "@/graphql/connections" +import { mapError } from "@/graphql/error-map" +import { GT } from "@/graphql/index" + const Transaction = GT.Object({ name: "Transaction", description: dedent`Give details about an individual transaction. diff --git a/core/api/src/graphql/shared/types/object/usd-wallet.ts b/core/api/src/graphql/shared/types/object/usd-wallet.ts index ee74b1b9c5..2a7c71afe9 100644 --- a/core/api/src/graphql/shared/types/object/usd-wallet.ts +++ b/core/api/src/graphql/shared/types/object/usd-wallet.ts @@ -1,24 +1,26 @@ -import { GT } from "@graphql/index" -import { - connectionArgs, - connectionFromPaginatedArray, - checkedConnectionArgs, -} from "@graphql/connections" -import { normalizePaymentAmount } from "@graphql/shared/root/mutation" -import { mapError } from "@graphql/error-map" - -import { Wallets } from "@app" - -import { WalletCurrency as WalletCurrencyDomain } from "@domain/shared" - import IWallet from "../abstract/wallet" import WalletCurrency from "../scalar/wallet-currency" + import SignedAmount from "../scalar/signed-amount" + import OnChainAddress from "../scalar/on-chain-address" import { TransactionConnection } from "./transaction" +import { GT } from "@/graphql/index" +import { + connectionArgs, + connectionFromPaginatedArray, + checkedConnectionArgs, +} from "@/graphql/connections" +import { normalizePaymentAmount } from "@/graphql/shared/root/mutation" +import { mapError } from "@/graphql/error-map" + +import { Wallets } from "@/app" + +import { WalletCurrency as WalletCurrencyDomain } from "@/domain/shared" + const UsdWallet = GT.Object({ name: "UsdWallet", description: diff --git a/core/api/src/graphql/shared/types/payload/auth-token.ts b/core/api/src/graphql/shared/types/payload/auth-token.ts index bf639c76a5..e73bad66f2 100644 --- a/core/api/src/graphql/shared/types/payload/auth-token.ts +++ b/core/api/src/graphql/shared/types/payload/auth-token.ts @@ -1,8 +1,8 @@ -import { GT } from "@graphql/index" -import AuthToken from "@graphql/shared/types/scalar/auth-token" - import IError from "../abstract/error" +import { GT } from "@/graphql/index" +import AuthToken from "@/graphql/shared/types/scalar/auth-token" + const AuthTokenPayload = GT.Object({ name: "AuthTokenPayload", fields: () => ({ diff --git a/core/api/src/graphql/shared/types/payload/captcha-create-challenge.ts b/core/api/src/graphql/shared/types/payload/captcha-create-challenge.ts index 95650599be..d5ae27a0ef 100644 --- a/core/api/src/graphql/shared/types/payload/captcha-create-challenge.ts +++ b/core/api/src/graphql/shared/types/payload/captcha-create-challenge.ts @@ -1,6 +1,6 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" -import IError from "@graphql/shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" const CaptchaCreateChallengeResult = GT.Object({ name: "CaptchaCreateChallengeResult", diff --git a/core/api/src/graphql/shared/types/payload/success-payload.ts b/core/api/src/graphql/shared/types/payload/success-payload.ts index af13f29505..2f884b2732 100644 --- a/core/api/src/graphql/shared/types/payload/success-payload.ts +++ b/core/api/src/graphql/shared/types/payload/success-payload.ts @@ -1,7 +1,7 @@ -import { GT } from "@graphql/index" - import IError from "../abstract/error" +import { GT } from "@/graphql/index" + const SuccessPayload = GT.Object({ name: "SuccessPayload", fields: () => ({ diff --git a/core/api/src/graphql/shared/types/scalar/account-level.ts b/core/api/src/graphql/shared/types/scalar/account-level.ts index 463e6eee0f..0e7014ee6d 100644 --- a/core/api/src/graphql/shared/types/scalar/account-level.ts +++ b/core/api/src/graphql/shared/types/scalar/account-level.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const AccountLevel = GT.Enum({ name: "AccountLevel", diff --git a/core/api/src/graphql/shared/types/scalar/auth-token.ts b/core/api/src/graphql/shared/types/scalar/auth-token.ts index 5bb370d026..b4a4b48169 100644 --- a/core/api/src/graphql/shared/types/scalar/auth-token.ts +++ b/core/api/src/graphql/shared/types/scalar/auth-token.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import { checkedToAuthToken } from "@services/kratos" +import { GT } from "@/graphql/index" +import { checkedToAuthToken } from "@/services/kratos" const AuthToken = GT.Scalar({ name: "AuthToken", diff --git a/core/api/src/graphql/shared/types/scalar/display-currency.ts b/core/api/src/graphql/shared/types/scalar/display-currency.ts index ef6d5160d4..93c45ee8e3 100644 --- a/core/api/src/graphql/shared/types/scalar/display-currency.ts +++ b/core/api/src/graphql/shared/types/scalar/display-currency.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import { InputValidationError } from "@graphql/error" +import { GT } from "@/graphql/index" +import { InputValidationError } from "@/graphql/error" const DisplayCurrency = GT.Scalar({ name: "DisplayCurrency", diff --git a/core/api/src/graphql/shared/types/scalar/email-address.ts b/core/api/src/graphql/shared/types/scalar/email-address.ts index 9396d6bee3..d0dd7853e6 100644 --- a/core/api/src/graphql/shared/types/scalar/email-address.ts +++ b/core/api/src/graphql/shared/types/scalar/email-address.ts @@ -1,6 +1,6 @@ -import { checkedToEmailAddress } from "@domain/users" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { checkedToEmailAddress } from "@/domain/users" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const EmailAddress = GT.Scalar({ name: "EmailAddress", diff --git a/core/api/src/graphql/shared/types/scalar/language.ts b/core/api/src/graphql/shared/types/scalar/language.ts index d00a534b12..ffdf02a4ac 100644 --- a/core/api/src/graphql/shared/types/scalar/language.ts +++ b/core/api/src/graphql/shared/types/scalar/language.ts @@ -1,6 +1,6 @@ -import { Languages } from "@domain/users" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { Languages } from "@/domain/users" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" type InternalLang = UserLanguage | "" type ExternalLang = UserLanguage diff --git a/core/api/src/graphql/shared/types/scalar/ln-payment-preimage.ts b/core/api/src/graphql/shared/types/scalar/ln-payment-preimage.ts index af86f382c3..508c5a5248 100644 --- a/core/api/src/graphql/shared/types/scalar/ln-payment-preimage.ts +++ b/core/api/src/graphql/shared/types/scalar/ln-payment-preimage.ts @@ -1,6 +1,6 @@ -import { isSha256Hash } from "@domain/bitcoin" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { isSha256Hash } from "@/domain/bitcoin" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const LnPaymentPreImage = GT.Scalar({ name: "LnPaymentPreImage", diff --git a/core/api/src/graphql/shared/types/scalar/ln-payment-request.ts b/core/api/src/graphql/shared/types/scalar/ln-payment-request.ts index 66daf29f7c..9892b2ae48 100644 --- a/core/api/src/graphql/shared/types/scalar/ln-payment-request.ts +++ b/core/api/src/graphql/shared/types/scalar/ln-payment-request.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const LnPaymentRequest = GT.Scalar({ name: "LnPaymentRequest", diff --git a/core/api/src/graphql/shared/types/scalar/ln-payment-secret.ts b/core/api/src/graphql/shared/types/scalar/ln-payment-secret.ts index 25de2605bb..57716ddba0 100644 --- a/core/api/src/graphql/shared/types/scalar/ln-payment-secret.ts +++ b/core/api/src/graphql/shared/types/scalar/ln-payment-secret.ts @@ -1,6 +1,6 @@ -import { isSha256Hash } from "@domain/bitcoin" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { isSha256Hash } from "@/domain/bitcoin" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const LnPaymentSecret = GT.Scalar({ name: "LnPaymentSecret", diff --git a/core/api/src/graphql/shared/types/scalar/ln-payment-status.ts b/core/api/src/graphql/shared/types/scalar/ln-payment-status.ts index a21e57171f..2083bef737 100644 --- a/core/api/src/graphql/shared/types/scalar/ln-payment-status.ts +++ b/core/api/src/graphql/shared/types/scalar/ln-payment-status.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const LnPaymentStatus = GT.Enum({ name: "LnPaymentStatus", diff --git a/core/api/src/graphql/shared/types/scalar/ln-pubkey.ts b/core/api/src/graphql/shared/types/scalar/ln-pubkey.ts index 55d3ade2bd..2a73c163ec 100644 --- a/core/api/src/graphql/shared/types/scalar/ln-pubkey.ts +++ b/core/api/src/graphql/shared/types/scalar/ln-pubkey.ts @@ -1,6 +1,6 @@ -import { checkedToPubkey } from "@domain/bitcoin/lightning" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { checkedToPubkey } from "@/domain/bitcoin/lightning" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const LnPubkey = GT.Scalar({ name: "LnPubkey", diff --git a/core/api/src/graphql/shared/types/scalar/memo.ts b/core/api/src/graphql/shared/types/scalar/memo.ts index 2ea03d1c4c..8364474257 100644 --- a/core/api/src/graphql/shared/types/scalar/memo.ts +++ b/core/api/src/graphql/shared/types/scalar/memo.ts @@ -1,6 +1,6 @@ -import { MAX_BYTES_FOR_MEMO } from "@config" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { MAX_BYTES_FOR_MEMO } from "@/config" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const Memo = GT.Scalar({ name: "Memo", diff --git a/core/api/src/graphql/shared/types/scalar/notification-category.ts b/core/api/src/graphql/shared/types/scalar/notification-category.ts index 27207eeccd..88c46c852f 100644 --- a/core/api/src/graphql/shared/types/scalar/notification-category.ts +++ b/core/api/src/graphql/shared/types/scalar/notification-category.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const NotificationCategory = GT.Scalar({ name: "NotificationCategory", diff --git a/core/api/src/graphql/shared/types/scalar/notification-channel.ts b/core/api/src/graphql/shared/types/scalar/notification-channel.ts index 8481ea5205..bca5ae4d80 100644 --- a/core/api/src/graphql/shared/types/scalar/notification-channel.ts +++ b/core/api/src/graphql/shared/types/scalar/notification-channel.ts @@ -1,5 +1,5 @@ -import { NotificationChannel as NotificationChannelDomain } from "@domain/notifications" -import { GT } from "@graphql/index" +import { NotificationChannel as NotificationChannelDomain } from "@/domain/notifications" +import { GT } from "@/graphql/index" const NotificationChannel = GT.Enum({ name: "NotificationChannel", diff --git a/core/api/src/graphql/shared/types/scalar/on-chain-address.ts b/core/api/src/graphql/shared/types/scalar/on-chain-address.ts index a5e47ba512..165b1a60fe 100644 --- a/core/api/src/graphql/shared/types/scalar/on-chain-address.ts +++ b/core/api/src/graphql/shared/types/scalar/on-chain-address.ts @@ -1,7 +1,7 @@ -import { NETWORK } from "@config" -import { checkedToOnChainAddress } from "@domain/bitcoin/onchain" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { NETWORK } from "@/config" +import { checkedToOnChainAddress } from "@/domain/bitcoin/onchain" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const OnChainAddress = GT.Scalar({ name: "OnChainAddress", diff --git a/core/api/src/graphql/shared/types/scalar/onchain-tx-hash.ts b/core/api/src/graphql/shared/types/scalar/onchain-tx-hash.ts index 41ec236612..7118bfac16 100644 --- a/core/api/src/graphql/shared/types/scalar/onchain-tx-hash.ts +++ b/core/api/src/graphql/shared/types/scalar/onchain-tx-hash.ts @@ -1,6 +1,6 @@ -import { isSha256Hash } from "@domain/bitcoin" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { isSha256Hash } from "@/domain/bitcoin" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const OnChainTxHash = GT.Scalar({ name: "OnChainTxHash", diff --git a/core/api/src/graphql/shared/types/scalar/one-time-auth-code.ts b/core/api/src/graphql/shared/types/scalar/one-time-auth-code.ts index 6ba27b40e4..3241dbf0c2 100644 --- a/core/api/src/graphql/shared/types/scalar/one-time-auth-code.ts +++ b/core/api/src/graphql/shared/types/scalar/one-time-auth-code.ts @@ -1,6 +1,6 @@ -import { validOneTimeAuthCodeValue } from "@domain/authentication" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { validOneTimeAuthCodeValue } from "@/domain/authentication" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const OneTimeAuthCode = GT.Scalar({ name: "OneTimeAuthCode", diff --git a/core/api/src/graphql/shared/types/scalar/payment-hash.ts b/core/api/src/graphql/shared/types/scalar/payment-hash.ts index 555c704874..6ac3cd0137 100644 --- a/core/api/src/graphql/shared/types/scalar/payment-hash.ts +++ b/core/api/src/graphql/shared/types/scalar/payment-hash.ts @@ -1,6 +1,6 @@ -import { isSha256Hash } from "@domain/bitcoin" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { isSha256Hash } from "@/domain/bitcoin" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const PaymentHash = GT.Scalar({ name: "PaymentHash", diff --git a/core/api/src/graphql/shared/types/scalar/phone-code-channel-type.ts b/core/api/src/graphql/shared/types/scalar/phone-code-channel-type.ts index 9d3e819a40..572251d81b 100644 --- a/core/api/src/graphql/shared/types/scalar/phone-code-channel-type.ts +++ b/core/api/src/graphql/shared/types/scalar/phone-code-channel-type.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const PhoneCodeChannelType = GT.Enum({ name: "PhoneCodeChannelType", diff --git a/core/api/src/graphql/shared/types/scalar/phone.ts b/core/api/src/graphql/shared/types/scalar/phone.ts index 977f6ba746..91d3a36458 100644 --- a/core/api/src/graphql/shared/types/scalar/phone.ts +++ b/core/api/src/graphql/shared/types/scalar/phone.ts @@ -1,6 +1,6 @@ -import { checkedToPhoneNumber } from "@domain/users" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { checkedToPhoneNumber } from "@/domain/users" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const Phone = GT.Scalar({ name: "Phone", diff --git a/core/api/src/graphql/shared/types/scalar/safe-int.ts b/core/api/src/graphql/shared/types/scalar/safe-int.ts index d149c478d1..6c725e3657 100644 --- a/core/api/src/graphql/shared/types/scalar/safe-int.ts +++ b/core/api/src/graphql/shared/types/scalar/safe-int.ts @@ -1,6 +1,6 @@ -import { ValidationInternalError } from "@graphql/error" -import { GT } from "@graphql/index" -import { baseLogger } from "@services/logger" +import { ValidationInternalError } from "@/graphql/error" +import { GT } from "@/graphql/index" +import { baseLogger } from "@/services/logger" const MAX_INT = Number.MAX_SAFE_INTEGER const MIN_INT = Number.MIN_SAFE_INTEGER diff --git a/core/api/src/graphql/shared/types/scalar/sat-amount.ts b/core/api/src/graphql/shared/types/scalar/sat-amount.ts index 850f7ead9f..5bcf399875 100644 --- a/core/api/src/graphql/shared/types/scalar/sat-amount.ts +++ b/core/api/src/graphql/shared/types/scalar/sat-amount.ts @@ -1,7 +1,7 @@ -import { ErrorLevel, MAX_SATS } from "@domain/shared" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" -import { recordExceptionInCurrentSpan } from "@services/tracing" +import { ErrorLevel, MAX_SATS } from "@/domain/shared" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" +import { recordExceptionInCurrentSpan } from "@/services/tracing" const SatAmount = GT.Scalar({ name: "SatAmount", diff --git a/core/api/src/graphql/shared/types/scalar/signed-amount.ts b/core/api/src/graphql/shared/types/scalar/signed-amount.ts index 7cf10ee8fc..11d8d6ba35 100644 --- a/core/api/src/graphql/shared/types/scalar/signed-amount.ts +++ b/core/api/src/graphql/shared/types/scalar/signed-amount.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const SignedAmount = GT.Scalar({ name: "SignedAmount", diff --git a/core/api/src/graphql/shared/types/scalar/signed-display-amount.ts b/core/api/src/graphql/shared/types/scalar/signed-display-amount.ts index ab0981c7dc..f2a96e601e 100644 --- a/core/api/src/graphql/shared/types/scalar/signed-display-amount.ts +++ b/core/api/src/graphql/shared/types/scalar/signed-display-amount.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const isNumber = (value: string) => /^-?(\d+|\d*\.\d+)$/.test(value) diff --git a/core/api/src/graphql/shared/types/scalar/timestamp.ts b/core/api/src/graphql/shared/types/scalar/timestamp.ts index b71794305a..822cbdfe7d 100644 --- a/core/api/src/graphql/shared/types/scalar/timestamp.ts +++ b/core/api/src/graphql/shared/types/scalar/timestamp.ts @@ -1,5 +1,5 @@ -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" type InternalDate = Date type ExternalDate = number | InputValidationError diff --git a/core/api/src/graphql/shared/types/scalar/tx-direction.ts b/core/api/src/graphql/shared/types/scalar/tx-direction.ts index 607aee76c0..21c6385736 100644 --- a/core/api/src/graphql/shared/types/scalar/tx-direction.ts +++ b/core/api/src/graphql/shared/types/scalar/tx-direction.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" export const txDirectionValues = { SEND: "send", diff --git a/core/api/src/graphql/shared/types/scalar/tx-status.ts b/core/api/src/graphql/shared/types/scalar/tx-status.ts index 0b88bc6223..11e42b6b0a 100644 --- a/core/api/src/graphql/shared/types/scalar/tx-status.ts +++ b/core/api/src/graphql/shared/types/scalar/tx-status.ts @@ -1,5 +1,5 @@ -import { GT } from "@graphql/index" -import { TxStatus as DomainTxStatus } from "@domain/wallets" +import { GT } from "@/graphql/index" +import { TxStatus as DomainTxStatus } from "@/domain/wallets" const TxStatus = GT.Enum({ name: "TxStatus", diff --git a/core/api/src/graphql/shared/types/scalar/username.ts b/core/api/src/graphql/shared/types/scalar/username.ts index 7071223d20..c0878dc521 100644 --- a/core/api/src/graphql/shared/types/scalar/username.ts +++ b/core/api/src/graphql/shared/types/scalar/username.ts @@ -1,6 +1,6 @@ -import { UsernameRegex } from "@domain/accounts" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { UsernameRegex } from "@/domain/accounts" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const Username = GT.Scalar({ name: "Username", diff --git a/core/api/src/graphql/shared/types/scalar/wallet-currency.ts b/core/api/src/graphql/shared/types/scalar/wallet-currency.ts index 65b9090b6f..c10621d9a2 100644 --- a/core/api/src/graphql/shared/types/scalar/wallet-currency.ts +++ b/core/api/src/graphql/shared/types/scalar/wallet-currency.ts @@ -1,4 +1,4 @@ -import { GT } from "@graphql/index" +import { GT } from "@/graphql/index" const WalletCurrency = GT.Enum({ name: "WalletCurrency", diff --git a/core/api/src/graphql/shared/types/scalar/wallet-id.ts b/core/api/src/graphql/shared/types/scalar/wallet-id.ts index 656b19499c..56476a1a31 100644 --- a/core/api/src/graphql/shared/types/scalar/wallet-id.ts +++ b/core/api/src/graphql/shared/types/scalar/wallet-id.ts @@ -1,6 +1,6 @@ -import { checkedToWalletId } from "@domain/wallets" -import { InputValidationError } from "@graphql/error" -import { GT } from "@graphql/index" +import { checkedToWalletId } from "@/domain/wallets" +import { InputValidationError } from "@/graphql/error" +import { GT } from "@/graphql/index" const WalletId = GT.Scalar({ name: "WalletId", diff --git a/core/api/src/servers/authorization/index.ts b/core/api/src/servers/authorization/index.ts index 92872d25ff..12167467c9 100644 --- a/core/api/src/servers/authorization/index.ts +++ b/core/api/src/servers/authorization/index.ts @@ -1,15 +1,20 @@ import cors from "cors" import express, { NextFunction, Request, Response } from "express" -import { Authentication } from "@app" import basicAuth from "basic-auth" -import { mapError } from "@graphql/error-map" +import bodyParser from "body-parser" + +import cookieParser from "cookie-parser" + +import { Authentication } from "@/app" + +import { mapError } from "@/graphql/error-map" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, tracer, -} from "@services/tracing" +} from "@/services/tracing" import { elevatingSessionWithTotp, @@ -17,36 +22,33 @@ import { loginWithEmailToken, logoutCookie, requestEmailCode, -} from "@app/authentication" -import { parseIps } from "@domain/accounts-ips" -import { checkedToEmailAddress, checkedToPhoneNumber } from "@domain/users" -import bodyParser from "body-parser" - -import cookieParser from "cookie-parser" +} from "@/app/authentication" +import { parseIps } from "@/domain/accounts-ips" +import { checkedToEmailAddress, checkedToPhoneNumber } from "@/domain/users" import { checkedToAuthToken, checkedToEmailLoginId, checkedToTotpCode, validateKratosCookie, -} from "@services/kratos" +} from "@/services/kratos" -import { KratosCookie, parseKratosCookies } from "@services/kratos/cookie" +import { KratosCookie, parseKratosCookies } from "@/services/kratos/cookie" -import { UNSECURE_IP_FROM_REQUEST_OBJECT } from "@config" +import { UNSECURE_IP_FROM_REQUEST_OBJECT } from "@/config" -import { parseErrorMessageFromUnknown } from "@domain/shared" +import { parseErrorMessageFromUnknown } from "@/domain/shared" -import { checkedToEmailCode, validOneTimeAuthCodeValue } from "@domain/authentication" +import { checkedToEmailCode, validOneTimeAuthCodeValue } from "@/domain/authentication" import { EmailCodeInvalidError, EmailValidationSubmittedTooOftenError, -} from "@domain/authentication/errors" +} from "@/domain/authentication/errors" -import { UserLoginIpRateLimiterExceededError } from "@domain/rate-limit/errors" +import { UserLoginIpRateLimiterExceededError } from "@/domain/rate-limit/errors" -import { registerCaptchaGeetest } from "@app/captcha" +import { registerCaptchaGeetest } from "@/app/captcha" const authRouter = express.Router({ caseSensitive: true }) diff --git a/core/api/src/servers/cron.ts b/core/api/src/servers/cron.ts index e139fd212b..0d37e4eaa1 100644 --- a/core/api/src/servers/cron.ts +++ b/core/api/src/servers/cron.ts @@ -1,28 +1,28 @@ -import { OnChain, Lightning, Wallets, Payments, Swap } from "@app" +import { OnChain, Lightning, Wallets, Payments, Swap } from "@/app" -import { getCronConfig, TWO_MONTHS_IN_MS } from "@config" +import { getCronConfig, TWO_MONTHS_IN_MS } from "@/config" -import { ErrorLevel } from "@domain/shared" -import { OperationInterruptedError } from "@domain/errors" +import { ErrorLevel } from "@/domain/shared" +import { OperationInterruptedError } from "@/domain/errors" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, wrapAsyncToRunInSpan, -} from "@services/tracing" +} from "@/services/tracing" import { deleteExpiredLightningPaymentFlows, deleteExpiredWalletInvoice, deleteFailedPaymentsAttemptAllLnds, updateEscrows, updateRoutingRevenues, -} from "@services/lnd/utils" -import { baseLogger } from "@services/logger" -import { setupMongoConnection } from "@services/mongodb" -import { activateLndHealthCheck, checkAllLndHealth } from "@services/lnd/health" +} from "@/services/lnd/utils" +import { baseLogger } from "@/services/logger" +import { setupMongoConnection } from "@/services/mongodb" +import { activateLndHealthCheck, checkAllLndHealth } from "@/services/lnd/health" -import { elapsedSinceTimestamp, sleep } from "@utils" -import { rebalancingInternalChannels } from "@services/lnd/rebalancing" +import { elapsedSinceTimestamp, sleep } from "@/utils" +import { rebalancingInternalChannels } from "@/services/lnd/rebalancing" const logger = baseLogger.child({ module: "cron" }) diff --git a/core/api/src/servers/daily-balance-notification.ts b/core/api/src/servers/daily-balance-notification.ts index 3a30362594..8bcbbb49d9 100644 --- a/core/api/src/servers/daily-balance-notification.ts +++ b/core/api/src/servers/daily-balance-notification.ts @@ -1,6 +1,6 @@ -import { sendDefaultWalletBalanceToAccounts } from "@app/accounts/send-default-wallet-balance-to-users" -import { baseLogger } from "@services/logger" -import { setupMongoConnection } from "@services/mongodb" +import { sendDefaultWalletBalanceToAccounts } from "@/app/accounts/send-default-wallet-balance-to-users" +import { baseLogger } from "@/services/logger" +import { setupMongoConnection } from "@/services/mongodb" const main = async () => { const mongoose = await setupMongoConnection() diff --git a/core/api/src/servers/errors.ts b/core/api/src/servers/errors.ts index f6b9dedc44..39c4aa20b6 100644 --- a/core/api/src/servers/errors.ts +++ b/core/api/src/servers/errors.ts @@ -1,3 +1,3 @@ -import { DomainError } from "@domain/shared" +import { DomainError } from "@/domain/shared" export class SubscriptionInterruptedError extends DomainError {} diff --git a/core/api/src/servers/event-handlers/bria.ts b/core/api/src/servers/event-handlers/bria.ts index 96e08d7d17..9eea26599d 100644 --- a/core/api/src/servers/event-handlers/bria.ts +++ b/core/api/src/servers/event-handlers/bria.ts @@ -1,18 +1,18 @@ -import { Wallets, OnChain } from "@app" +import { Wallets, OnChain } from "@/app" import { AmountLessThanFeeError, CouldNotFindWalletFromOnChainAddressError, LessThanDustThresholdError, NoTransactionToUpdateError, -} from "@domain/errors" - -import { NoTransactionToSettleError } from "@services/ledger/domain/errors" -import * as LedgerFacade from "@services/ledger/facade" -import { baseLogger } from "@services/logger" -import { BriaPayloadType } from "@services/bria" -import { EventAugmentationMissingError } from "@services/bria/errors" -import { addAttributesToCurrentSpan } from "@services/tracing" +} from "@/domain/errors" + +import { NoTransactionToSettleError } from "@/services/ledger/domain/errors" +import * as LedgerFacade from "@/services/ledger/facade" +import { baseLogger } from "@/services/logger" +import { BriaPayloadType } from "@/services/bria" +import { EventAugmentationMissingError } from "@/services/bria/errors" +import { addAttributesToCurrentSpan } from "@/services/tracing" export const briaEventHandler = async (event: BriaEvent): Promise => { baseLogger.info( diff --git a/core/api/src/servers/event-handlers/kratos.ts b/core/api/src/servers/event-handlers/kratos.ts index f37ab140cd..3ef432f335 100644 --- a/core/api/src/servers/event-handlers/kratos.ts +++ b/core/api/src/servers/event-handlers/kratos.ts @@ -1,16 +1,16 @@ import cors from "cors" import express from "express" -import { Authentication } from "@app" +import { Authentication } from "@/app" import { SecretForAuthNCallbackError, RegistrationPayloadValidationError, -} from "@domain/authentication/errors" -import { ErrorLevel } from "@domain/shared" +} from "@/domain/authentication/errors" +import { ErrorLevel } from "@/domain/shared" -import { baseLogger } from "@services/logger" -import { recordExceptionInCurrentSpan, wrapAsyncToRunInSpan } from "@services/tracing" +import { baseLogger } from "@/services/logger" +import { recordExceptionInCurrentSpan, wrapAsyncToRunInSpan } from "@/services/tracing" const errorResponseMessages: { [key: string]: string } = { MissingSecretForAuthNCallbackError: "missing authorization header", diff --git a/core/api/src/servers/exporter.ts b/core/api/src/servers/exporter.ts index 98570c60f3..87142b2ceb 100644 --- a/core/api/src/servers/exporter.ts +++ b/core/api/src/servers/exporter.ts @@ -1,34 +1,34 @@ import express from "express" import client, { register } from "prom-client" -import { EXPORTER_PORT, SECS_PER_5_MINS } from "@config" +import healthzHandler from "./middlewares/healthz" + +import { EXPORTER_PORT, SECS_PER_5_MINS } from "@/config" -import { Lightning, OnChain } from "@app" +import { Lightning, OnChain } from "@/app" -import { toSeconds } from "@domain/primitives" +import { toSeconds } from "@/domain/primitives" import { asyncRunInSpan, addAttributesToCurrentSpan, wrapAsyncToRunInSpan, -} from "@services/tracing" +} from "@/services/tracing" import { getBankOwnerWalletId, getDealerBtcWalletId, getDealerUsdWalletId, getFunderWalletId, -} from "@services/ledger/caching" -import { LndService } from "@services/lnd" -import { baseLogger } from "@services/logger" -import { LedgerService } from "@services/ledger" -import { Account } from "@services/mongoose/schema" -import { LocalCacheService } from "@services/cache" -import { activateLndHealthCheck } from "@services/lnd/health" -import { ledgerAdmin, setupMongoConnection } from "@services/mongodb" - -import { timeoutWithCancel } from "@utils" - -import healthzHandler from "./middlewares/healthz" +} from "@/services/ledger/caching" +import { LndService } from "@/services/lnd" +import { baseLogger } from "@/services/logger" +import { LedgerService } from "@/services/ledger" +import { Account } from "@/services/mongoose/schema" +import { LocalCacheService } from "@/services/cache" +import { activateLndHealthCheck } from "@/services/lnd/health" +import { ledgerAdmin, setupMongoConnection } from "@/services/mongodb" + +import { timeoutWithCancel } from "@/utils" const TIMEOUT_WALLET_BALANCE = 30000 diff --git a/core/api/src/servers/graphql-admin-server.ts b/core/api/src/servers/graphql-admin-server.ts index 68465fae97..240e4f178d 100644 --- a/core/api/src/servers/graphql-admin-server.ts +++ b/core/api/src/servers/graphql-admin-server.ts @@ -2,36 +2,36 @@ import { applyMiddleware } from "graphql-middleware" import { and, rule, shield } from "graphql-shield" import { RuleAnd } from "graphql-shield/typings/rules" -import { baseLogger } from "@services/logger" -import { setupMongoConnection } from "@services/mongodb" +import { NextFunction, Request, Response } from "express" -import { activateLndHealthCheck } from "@services/lnd/health" +import DataLoader from "dataloader" -import { adminMutationFields, adminQueryFields, gqlAdminSchema } from "@graphql/admin" +import { isAuthenticated, startApolloServer } from "./graphql-server" -import { GALOY_ADMIN_PORT, UNSECURE_IP_FROM_REQUEST_OBJECT } from "@config" +import { baseLogger } from "@/services/logger" +import { setupMongoConnection } from "@/services/mongodb" -import { NextFunction, Request, Response } from "express" +import { activateLndHealthCheck } from "@/services/lnd/health" + +import { adminMutationFields, adminQueryFields, gqlAdminSchema } from "@/graphql/admin" + +import { GALOY_ADMIN_PORT, UNSECURE_IP_FROM_REQUEST_OBJECT } from "@/config" import { SemanticAttributes, addAttributesToCurrentSpanAndPropagate, recordExceptionInCurrentSpan, -} from "@services/tracing" - -import { parseIps } from "@domain/accounts-ips" +} from "@/services/tracing" -import DataLoader from "dataloader" +import { parseIps } from "@/domain/accounts-ips" -import { Transactions } from "@app" +import { Transactions } from "@/app" -import { AuthorizationError } from "@graphql/error" +import { AuthorizationError } from "@/graphql/error" -import { checkedToUserId } from "@domain/accounts" +import { checkedToUserId } from "@/domain/accounts" -import { AccountsRepository } from "@services/mongoose" - -import { isAuthenticated, startApolloServer } from "./graphql-server" +import { AccountsRepository } from "@/services/mongoose" export const isEditor = rule({ cache: "contextual" })(( parent, diff --git a/core/api/src/servers/graphql-main-server.ts b/core/api/src/servers/graphql-main-server.ts index a6449363e6..92fe77035b 100644 --- a/core/api/src/servers/graphql-main-server.ts +++ b/core/api/src/servers/graphql-main-server.ts @@ -1,33 +1,38 @@ import { applyMiddleware } from "graphql-middleware" -import { GALOY_API_PORT, UNSECURE_IP_FROM_REQUEST_OBJECT } from "@config" - -import { AuthorizationError } from "@graphql/error" -import { gqlMainSchema, mutationFields, queryFields } from "@graphql/public" - -import { bootstrap } from "@app/bootstrap" -import { activateLndHealthCheck } from "@services/lnd/health" -import { baseLogger } from "@services/logger" -import { setupMongoConnection } from "@services/mongodb" import { shield } from "graphql-shield" + import { Rule } from "graphql-shield/typings/rules" -import { - ACCOUNT_USERNAME, - SemanticAttributes, - addAttributesToCurrentSpanAndPropagate, - recordExceptionInCurrentSpan, -} from "@services/tracing" import { NextFunction, Request, Response } from "express" -import { parseIps } from "@domain/accounts-ips" - import { startApolloServerForAdminSchema } from "./graphql-admin-server" + import { isAuthenticated, startApolloServer } from "./graphql-server" + import { walletIdMiddleware } from "./middlewares/wallet-id" import { sessionPublicContext } from "./middlewares/session" +import { GALOY_API_PORT, UNSECURE_IP_FROM_REQUEST_OBJECT } from "@/config" + +import { AuthorizationError } from "@/graphql/error" +import { gqlMainSchema, mutationFields, queryFields } from "@/graphql/public" + +import { bootstrap } from "@/app/bootstrap" +import { activateLndHealthCheck } from "@/services/lnd/health" +import { baseLogger } from "@/services/logger" +import { setupMongoConnection } from "@/services/mongodb" + +import { + ACCOUNT_USERNAME, + SemanticAttributes, + addAttributesToCurrentSpanAndPropagate, + recordExceptionInCurrentSpan, +} from "@/services/tracing" + +import { parseIps } from "@/domain/accounts-ips" + const setGqlContext = async ( req: Request, res: Response, diff --git a/core/api/src/servers/graphql-server.ts b/core/api/src/servers/graphql-server.ts index 4e2dbc538b..fa78398e7d 100644 --- a/core/api/src/servers/graphql-server.ts +++ b/core/api/src/servers/graphql-server.ts @@ -2,8 +2,6 @@ import { createServer } from "http" import express, { NextFunction, Request, Response } from "express" -import { getJwksArgs } from "@config" -import { baseLogger } from "@services/logger" import { ApolloServerPluginDrainHttpServer } from "apollo-server-core" import { ApolloError, ApolloServer } from "apollo-server-express" import { GetVerificationKey, expressjwt } from "express-jwt" @@ -12,21 +10,22 @@ import { rule } from "graphql-shield" import jsonwebtoken from "jsonwebtoken" import PinoHttp from "pino-http" -import { mapError } from "@graphql/error-map" - import { fieldExtensionsEstimator, simpleEstimator } from "graphql-query-complexity" import { createComplexityPlugin } from "graphql-query-complexity-apollo-plugin" import jwksRsa from "jwks-rsa" -import { parseUnknownDomainErrorFromUnknown } from "@domain/shared" - import authRouter from "./authorization" import kratosCallback from "./event-handlers/kratos" import healthzHandler from "./middlewares/healthz" import { idempotencyMiddleware } from "./middlewares/idempotency" +import { parseUnknownDomainErrorFromUnknown } from "@/domain/shared" +import { mapError } from "@/graphql/error-map" +import { baseLogger } from "@/services/logger" +import { getJwksArgs } from "@/config" + const graphqlLogger = baseLogger.child({ module: "graphql", }) diff --git a/core/api/src/servers/middlewares/healthz.ts b/core/api/src/servers/middlewares/healthz.ts index 3fa4573452..0b48ddb242 100644 --- a/core/api/src/servers/middlewares/healthz.ts +++ b/core/api/src/servers/middlewares/healthz.ts @@ -1,8 +1,9 @@ import express from "express" import mongoose from "mongoose" -import { redis } from "@services/redis" -import { lndStatusEvent } from "@services/lnd/health" -import { OnChainService } from "@services/bria" + +import { redis } from "@/services/redis" +import { lndStatusEvent } from "@/services/lnd/health" +import { OnChainService } from "@/services/bria" type HealthzArgs = { checkDbConnectionStatus: boolean diff --git a/core/api/src/servers/middlewares/idempotency.ts b/core/api/src/servers/middlewares/idempotency.ts index 9081950424..f2af482d4d 100644 --- a/core/api/src/servers/middlewares/idempotency.ts +++ b/core/api/src/servers/middlewares/idempotency.ts @@ -1,10 +1,12 @@ -import { InvalidIdempotencyKeyError } from "@domain/errors" -import { ResourceAttemptsTimelockServiceError } from "@domain/lock" -import { LockService } from "@services/lock" -import { addAttributesToCurrentSpan } from "@services/tracing" import { json } from "body-parser" + import { NextFunction, Request, Response } from "express" +import { InvalidIdempotencyKeyError } from "@/domain/errors" +import { ResourceAttemptsTimelockServiceError } from "@/domain/lock" +import { LockService } from "@/services/lock" +import { addAttributesToCurrentSpan } from "@/services/tracing" + // Create lock service instance const lockService = LockService() diff --git a/core/api/src/servers/middlewares/session.ts b/core/api/src/servers/middlewares/session.ts index 7cabafd2f4..2fa2a8d57d 100644 --- a/core/api/src/servers/middlewares/session.ts +++ b/core/api/src/servers/middlewares/session.ts @@ -1,14 +1,15 @@ import DataLoader from "dataloader" -import { Accounts, Transactions } from "@app" -import { recordExceptionInCurrentSpan } from "@services/tracing" import jsonwebtoken from "jsonwebtoken" -import { maybeExtendSession } from "@app/authentication" -import { checkedToUserId } from "@domain/accounts" -import { ValidationError } from "@domain/shared" -import { baseLogger } from "@services/logger" -import { UsersRepository } from "@services/mongoose" +import { Accounts, Transactions } from "@/app" +import { recordExceptionInCurrentSpan } from "@/services/tracing" + +import { maybeExtendSession } from "@/app/authentication" +import { checkedToUserId } from "@/domain/accounts" +import { ValidationError } from "@/domain/shared" +import { baseLogger } from "@/services/logger" +import { UsersRepository } from "@/services/mongoose" export const sessionPublicContext = async ({ tokenPayload, diff --git a/core/api/src/servers/middlewares/wallet-id.ts b/core/api/src/servers/middlewares/wallet-id.ts index d107cfd5d7..fa062881cf 100644 --- a/core/api/src/servers/middlewares/wallet-id.ts +++ b/core/api/src/servers/middlewares/wallet-id.ts @@ -1,10 +1,10 @@ import { GraphQLResolveInfo, GraphQLFieldResolver } from "graphql" -import { Accounts } from "@app" -import { mapError } from "@graphql/error-map" -import { mutationFields, queryFields } from "@graphql/public" -import { InvalidAccountError, InvalidWalletForAccountError } from "@domain/accounts" -import { InvalidWalletId } from "@domain/errors" +import { Accounts } from "@/app" +import { mapError } from "@/graphql/error-map" +import { mutationFields, queryFields } from "@/graphql/public" +import { InvalidAccountError, InvalidWalletForAccountError } from "@/domain/accounts" +import { InvalidWalletId } from "@/domain/errors" type InputArgs = Record<"input", Record> diff --git a/core/api/src/servers/trigger.ts b/core/api/src/servers/trigger.ts index 6ffb8ce048..54711b4eba 100644 --- a/core/api/src/servers/trigger.ts +++ b/core/api/src/servers/trigger.ts @@ -18,43 +18,45 @@ import { } from "lightning" import debounce from "lodash.debounce" -import { getSwapConfig, NETWORK, ONCHAIN_MIN_CONFIRMATIONS, TRIGGER_PORT } from "@config" +import { SubscriptionInterruptedError } from "./errors" + +import { briaEventHandler } from "./event-handlers/bria" + +import healthzHandler from "./middlewares/healthz" + +import { getSwapConfig, NETWORK, ONCHAIN_MIN_CONFIRMATIONS, TRIGGER_PORT } from "@/config" import { Payments, Prices as PricesWithSpans, Swap as SwapWithSpans, Wallets as WalletWithSpans, -} from "@app" -import { uploadBackup } from "@app/admin/backup" -import { lnd1LoopConfig, lnd2LoopConfig } from "@app/swap/get-active-loopd" -import * as Wallets from "@app/wallets" - -import { TxDecoder } from "@domain/bitcoin/onchain" -import { CacheKeys } from "@domain/cache" -import { CouldNotFindWalletFromOnChainAddressError } from "@domain/errors" -import { SwapTriggerError } from "@domain/swap/errors" -import { checkedToDisplayCurrency } from "@domain/fiat" -import { DEFAULT_EXPIRATIONS } from "@domain/bitcoin/lightning/invoice-expiration" -import { ErrorLevel, paymentAmountFromNumber, WalletCurrency } from "@domain/shared" -import { WalletInvoiceChecker } from "@domain/wallet-invoices" - -import { BriaSubscriber } from "@services/bria" -import { RedisCacheService } from "@services/cache" -import { LedgerService } from "@services/ledger" -import { LndService } from "@services/lnd" -import { activateLndHealthCheck, lndStatusEvent } from "@services/lnd/health" -import { onChannelUpdated } from "@services/lnd/utils" -import { baseLogger } from "@services/logger" -import { LoopService } from "@services/loopd" -import { setupMongoConnection } from "@services/mongodb" -import { WalletInvoicesRepository } from "@services/mongoose" -import { NotificationsService } from "@services/notifications" -import { recordExceptionInCurrentSpan, wrapAsyncToRunInSpan } from "@services/tracing" - -import { SubscriptionInterruptedError } from "./errors" -import { briaEventHandler } from "./event-handlers/bria" -import healthzHandler from "./middlewares/healthz" +} from "@/app" +import { uploadBackup } from "@/app/admin/backup" +import { lnd1LoopConfig, lnd2LoopConfig } from "@/app/swap/get-active-loopd" +import * as Wallets from "@/app/wallets" + +import { TxDecoder } from "@/domain/bitcoin/onchain" +import { CacheKeys } from "@/domain/cache" +import { CouldNotFindWalletFromOnChainAddressError } from "@/domain/errors" +import { SwapTriggerError } from "@/domain/swap/errors" +import { checkedToDisplayCurrency } from "@/domain/fiat" +import { DEFAULT_EXPIRATIONS } from "@/domain/bitcoin/lightning/invoice-expiration" +import { ErrorLevel, paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" +import { WalletInvoiceChecker } from "@/domain/wallet-invoices" + +import { BriaSubscriber } from "@/services/bria" +import { RedisCacheService } from "@/services/cache" +import { LedgerService } from "@/services/ledger" +import { LndService } from "@/services/lnd" +import { activateLndHealthCheck, lndStatusEvent } from "@/services/lnd/health" +import { onChannelUpdated } from "@/services/lnd/utils" +import { baseLogger } from "@/services/logger" +import { LoopService } from "@/services/loopd" +import { setupMongoConnection } from "@/services/mongodb" +import { WalletInvoicesRepository } from "@/services/mongoose" +import { NotificationsService } from "@/services/notifications" +import { recordExceptionInCurrentSpan, wrapAsyncToRunInSpan } from "@/services/tracing" const redisCache = RedisCacheService() const logger = baseLogger.child({ module: "trigger" }) diff --git a/core/api/src/servers/write-sdl.ts b/core/api/src/servers/write-sdl.ts index a3c8bf8e2d..1977ccf7ef 100644 --- a/core/api/src/servers/write-sdl.ts +++ b/core/api/src/servers/write-sdl.ts @@ -3,19 +3,19 @@ import path from "path" import { GraphQLSchema, lexicographicSortSchema, printSchema } from "graphql" -import { QueryType as QueryTypeAdmin } from "@graphql/admin/queries" -import { MutationType as MutationTypeAdmin } from "@graphql/admin/mutations" -import { ALL_INTERFACE_TYPES as ALL_INTERFACE_TYPES_ADMIN } from "@graphql/admin/types" +import { QueryType as QueryTypeAdmin } from "@/graphql/admin/queries" +import { MutationType as MutationTypeAdmin } from "@/graphql/admin/mutations" +import { ALL_INTERFACE_TYPES as ALL_INTERFACE_TYPES_ADMIN } from "@/graphql/admin/types" -import { ALL_INTERFACE_TYPES } from "@graphql/public/types" +import { ALL_INTERFACE_TYPES } from "@/graphql/public/types" -import { QueryType } from "@graphql/public/queries" +import { QueryType } from "@/graphql/public/queries" -import { MutationType } from "@graphql/public/mutations" -import { SubscriptionType } from "@graphql/public/subscriptions" +import { MutationType } from "@/graphql/public/mutations" +import { SubscriptionType } from "@/graphql/public/subscriptions" -export { queryFields } from "@graphql/public/queries" -export { mutationFields } from "@graphql/public/mutations" +export { queryFields } from "@/graphql/public/queries" +export { mutationFields } from "@/graphql/public/mutations" export const gqlAdminSchema = new GraphQLSchema({ query: QueryTypeAdmin, diff --git a/core/api/src/servers/ws-server.ts b/core/api/src/servers/ws-server.ts index 60e30ab269..355f2329ed 100644 --- a/core/api/src/servers/ws-server.ts +++ b/core/api/src/servers/ws-server.ts @@ -1,32 +1,36 @@ import { getOperationAST, GraphQLError, parse, validate } from "graphql" import { WebSocketServer } from "ws" -import { gqlMainSchema } from "@graphql/public" + import { Extra, useServer } from "graphql-ws/lib/use/ws" -import { getJwksArgs, UNSECURE_IP_FROM_REQUEST_OBJECT, WEBSOCKET_PORT } from "@config" import { Context } from "graphql-ws" -import jsonwebtoken from "jsonwebtoken" -import { parseIps } from "@domain/accounts-ips" -import { ErrorLevel } from "@domain/shared" +import jsonwebtoken from "jsonwebtoken" import jwksRsa from "jwks-rsa" -import { validateKratosCookie } from "@services/kratos" -import { baseLogger } from "@services/logger" -import { setupMongoConnection } from "@services/mongodb" -import { sendOathkeeperRequestGraphql } from "@services/oathkeeper" +import cookie from "cookie" + +import { sessionPublicContext } from "./middlewares/session" + +import { gqlMainSchema } from "@/graphql/public" + +import { getJwksArgs, UNSECURE_IP_FROM_REQUEST_OBJECT, WEBSOCKET_PORT } from "@/config" + +import { parseIps } from "@/domain/accounts-ips" +import { ErrorLevel } from "@/domain/shared" + +import { validateKratosCookie } from "@/services/kratos" +import { baseLogger } from "@/services/logger" +import { setupMongoConnection } from "@/services/mongodb" +import { sendOathkeeperRequestGraphql } from "@/services/oathkeeper" import { addAttributesToCurrentSpan, addEventToCurrentSpan, recordExceptionInCurrentSpan, wrapAsyncToRunInSpan, -} from "@services/tracing" - -import cookie from "cookie" - -import { sessionPublicContext } from "./middlewares/session" +} from "@/services/tracing" const schema = gqlMainSchema diff --git a/core/api/src/services/bria/errors.ts b/core/api/src/services/bria/errors.ts index 4b8f0fa134..c84d3fe882 100644 --- a/core/api/src/services/bria/errors.ts +++ b/core/api/src/services/bria/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class BriaEventError extends DomainError {} export class EventAugmentationMissingError extends BriaEventError { diff --git a/core/api/src/services/bria/event-handler.ts b/core/api/src/services/bria/event-handler.ts index 1347e39f8b..c82c89c8d0 100644 --- a/core/api/src/services/bria/event-handler.ts +++ b/core/api/src/services/bria/event-handler.ts @@ -1,11 +1,3 @@ -import { ErrorLevel, WalletCurrency, paymentAmountFromNumber } from "@domain/shared" - -import { baseLogger } from "@services/logger" -import { - addAttributesToCurrentSpan, - recordExceptionInCurrentSpan, -} from "@services/tracing" - import { EventAugmentationMissingError, ExpectedAddressInfoMissingInEventError, @@ -19,9 +11,19 @@ import { NoPayloadFoundError, UnknownPayloadTypeReceivedError, } from "./errors" + import { BriaEventRepo } from "./event-repository" + import { BriaEvent as RawBriaEvent, SubscribeAllRequest } from "./proto/bria_pb" +import { ErrorLevel, WalletCurrency, paymentAmountFromNumber } from "@/domain/shared" + +import { baseLogger } from "@/services/logger" +import { + addAttributesToCurrentSpan, + recordExceptionInCurrentSpan, +} from "@/services/tracing" + export const BriaPayloadType = { UtxoDetected: "utxo_detected", UtxoDropped: "utxo_dropped", diff --git a/core/api/src/services/bria/event-repository.ts b/core/api/src/services/bria/event-repository.ts index 47398013ee..ab60974493 100644 --- a/core/api/src/services/bria/event-repository.ts +++ b/core/api/src/services/bria/event-repository.ts @@ -1,7 +1,7 @@ -import { UnknownRepositoryError } from "@domain/errors" - import { BriaEventModel } from "./schema" +import { UnknownRepositoryError } from "@/domain/errors" + export const BriaEventRepo = () => { const persistEvent = async (event: BriaEvent): Promise => { try { diff --git a/core/api/src/services/bria/grpc-client.ts b/core/api/src/services/bria/grpc-client.ts index 5291a40717..4bfea11c12 100644 --- a/core/api/src/services/bria/grpc-client.ts +++ b/core/api/src/services/bria/grpc-client.ts @@ -2,8 +2,6 @@ import { promisify } from "util" import { credentials, Metadata } from "@grpc/grpc-js" -import { BRIA_HOST, BRIA_PORT } from "@config" - import { EstimatePayoutFeeRequest, EstimatePayoutFeeResponse, @@ -20,6 +18,8 @@ import { } from "./proto/bria_pb" import { BriaServiceClient } from "./proto/bria_grpc_pb" +import { BRIA_HOST, BRIA_PORT } from "@/config" + const briaEndpoint = `${BRIA_HOST}:${BRIA_PORT}` const bitcoinBridgeClient = new BriaServiceClient( diff --git a/core/api/src/services/bria/index.ts b/core/api/src/services/bria/index.ts index c8acd6567d..d4ad1edbe3 100644 --- a/core/api/src/services/bria/index.ts +++ b/core/api/src/services/bria/index.ts @@ -1,29 +1,12 @@ import { Metadata, status } from "@grpc/grpc-js" import { ListValue, Struct, Value } from "google-protobuf/google/protobuf/struct_pb" -import { BRIA_API_KEY, getBriaConfig } from "@config" - -import { - OnChainAddressAlreadyCreatedForRequestIdError, - OnChainAddressNotFoundError, - PayoutDestinationBlocked, - PayoutNotFoundError, - UnknownOnChainServiceError, -} from "@domain/bitcoin/onchain" -import { - WalletCurrency, - parseErrorMessageFromUnknown, - paymentAmountFromNumber, -} from "@domain/shared" - -import { baseLogger } from "@services/logger" -import { wrapAsyncFunctionsToRunInSpan, wrapAsyncToRunInSpan } from "@services/tracing" - -import { GrpcStreamClient } from "@utils" - import { UnknownBriaEventError } from "./errors" + import { eventDataHandler } from "./event-handler" + import { BriaEventRepo } from "./event-repository" + import { estimatePayoutFee, getAddress, @@ -33,6 +16,7 @@ import { submitPayout, subscribeAll, } from "./grpc-client" + import { EstimatePayoutFeeRequest, GetAddressRequest, @@ -43,6 +27,27 @@ import { SubmitPayoutRequest, SubscribeAllRequest, } from "./proto/bria_pb" + +import { BRIA_API_KEY, getBriaConfig } from "@/config" + +import { + OnChainAddressAlreadyCreatedForRequestIdError, + OnChainAddressNotFoundError, + PayoutDestinationBlocked, + PayoutNotFoundError, + UnknownOnChainServiceError, +} from "@/domain/bitcoin/onchain" +import { + WalletCurrency, + parseErrorMessageFromUnknown, + paymentAmountFromNumber, +} from "@/domain/shared" + +import { baseLogger } from "@/services/logger" +import { wrapAsyncFunctionsToRunInSpan, wrapAsyncToRunInSpan } from "@/services/tracing" + +import { GrpcStreamClient } from "@/utils" + export { BriaPayloadType } from "./event-handler" const briaConfig = getBriaConfig() diff --git a/core/api/src/services/cache/local-cache.ts b/core/api/src/services/cache/local-cache.ts index acf26fc008..728419a409 100644 --- a/core/api/src/services/cache/local-cache.ts +++ b/core/api/src/services/cache/local-cache.ts @@ -1,10 +1,11 @@ +import NodeCache from "node-cache" + import { CacheNotAvailableError, CacheUndefinedError, UnknownCacheServiceError, -} from "@domain/cache" -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" -import NodeCache from "node-cache" +} from "@/domain/cache" +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" const localCache = new NodeCache() diff --git a/core/api/src/services/cache/redis-cache.ts b/core/api/src/services/cache/redis-cache.ts index 23298d9015..df81992bd5 100644 --- a/core/api/src/services/cache/redis-cache.ts +++ b/core/api/src/services/cache/redis-cache.ts @@ -2,9 +2,9 @@ import { CacheNotAvailableError, CacheUndefinedError, UnknownCacheServiceError, -} from "@domain/cache" -import { redisCache } from "@services/redis" -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" +} from "@/domain/cache" +import { redisCache } from "@/services/redis" +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" export const RedisCacheService = (): ICacheService => { const set = async ({ diff --git a/core/api/src/services/dealer-price/dealer-price.ts b/core/api/src/services/dealer-price/dealer-price.ts index cccd7e5357..809574e126 100644 --- a/core/api/src/services/dealer-price/dealer-price.ts +++ b/core/api/src/services/dealer-price/dealer-price.ts @@ -1,31 +1,11 @@ import util from "util" -import { PRICE_SERVER_HOST, PRICE_SERVER_PORT } from "@config" - import { credentials } from "@grpc/grpc-js" -import { - parseErrorMessageFromUnknown, - paymentAmountFromNumber, - WalletCurrency, -} from "@domain/shared" - -import { - DealerStalePriceError, - NoConnectionToDealerError, - NoDealerPriceDataAvailableError, - UnknownDealerPriceServiceError, -} from "@domain/dealer-price" - -import { defaultTimeToExpiryInSeconds } from "@domain/bitcoin/lightning" - -import { toWalletPriceRatio } from "@domain/payments" - -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" - import { baseLogger } from "../logger" import { PriceServiceClient } from "./proto/services/price/v1/price_service_grpc_pb" + import { GetCentsFromSatsForFutureBuyRequest, GetCentsFromSatsForFutureBuyResponse, @@ -47,6 +27,27 @@ import { GetSatsFromCentsForImmediateSellResponse, } from "./proto/services/price/v1/price_service_pb" +import { PRICE_SERVER_HOST, PRICE_SERVER_PORT } from "@/config" + +import { + parseErrorMessageFromUnknown, + paymentAmountFromNumber, + WalletCurrency, +} from "@/domain/shared" + +import { + DealerStalePriceError, + NoConnectionToDealerError, + NoDealerPriceDataAvailableError, + UnknownDealerPriceServiceError, +} from "@/domain/dealer-price" + +import { defaultTimeToExpiryInSeconds } from "@/domain/bitcoin/lightning" + +import { toWalletPriceRatio } from "@/domain/payments" + +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" + const client = new PriceServiceClient( `${PRICE_SERVER_HOST}:${PRICE_SERVER_PORT}`, credentials.createInsecure(), diff --git a/core/api/src/services/geetest.ts b/core/api/src/services/geetest.ts index 195d569c8e..3d881ef869 100644 --- a/core/api/src/services/geetest.ts +++ b/core/api/src/services/geetest.ts @@ -3,12 +3,13 @@ // https://docs.geetest.com/captcha/apirefer/api/server // doing this: "If the storage space is not sufficient: Send request to check bypass status before starting the verification process." -import { CaptchaUserFailToPassError, UnknownCaptchaError } from "@domain/captcha/errors" import axios from "axios" import GeetestLib from "gt3-server-node-express-sdk/sdk/geetest_lib" // galoy fork import { addEventToCurrentSpan, recordExceptionInCurrentSpan } from "./tracing" +import { CaptchaUserFailToPassError, UnknownCaptchaError } from "@/domain/captcha/errors" + const sendRequest = async (params: { gt: string }) => { const requestUrl = "https://bypass.geetest.com/v1/bypass_status.php" let bypassRes: string diff --git a/core/api/src/services/geetest.types.d.ts b/core/api/src/services/geetest.types.d.ts index c37cee0865..57df40600f 100644 --- a/core/api/src/services/geetest.types.d.ts +++ b/core/api/src/services/geetest.types.d.ts @@ -1,5 +1,5 @@ -type CaptchaError = import("@domain/captcha/errors").CaptchaError -type UnknownCaptchaError = import("@domain/captcha/errors").UnknownCaptchaError +type CaptchaError = import("@/domain/captcha/errors").CaptchaError +type UnknownCaptchaError = import("@/domain/captcha/errors").UnknownCaptchaError type GeetestRegister = { success: number diff --git a/core/api/src/services/ipfetcher/index.ts b/core/api/src/services/ipfetcher/index.ts index 93426ecc23..80378f0ba8 100644 --- a/core/api/src/services/ipfetcher/index.ts +++ b/core/api/src/services/ipfetcher/index.ts @@ -1,10 +1,11 @@ import axios from "axios" -import { UnknownIpFetcherServiceError } from "@domain/ipfetcher" -import { PROXY_CHECK_APIKEY } from "@config" + +import { UnknownIpFetcherServiceError } from "@/domain/ipfetcher" +import { PROXY_CHECK_APIKEY } from "@/config" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, -} from "@services/tracing" +} from "@/services/tracing" type Params = { vpn: string diff --git a/core/api/src/services/kratos/auth-email-no-password.ts b/core/api/src/services/kratos/auth-email-no-password.ts index 7a179a2a7b..b724c1d1c5 100644 --- a/core/api/src/services/kratos/auth-email-no-password.ts +++ b/core/api/src/services/kratos/auth-email-no-password.ts @@ -1,20 +1,7 @@ -import { KRATOS_MASTER_USER_PASSWORD, KRATOS_PG_CON } from "@config" - -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" - import { isAxiosError } from "axios" -import { - EmailCodeInvalidError, - EmailUnverifiedError, - EmailValidationSubmittedTooOftenError, - LikelyUserAlreadyExistError, -} from "@domain/authentication/errors" - import { UpdateIdentityBody } from "@ory/client" -import { checkedToEmailAddress } from "@domain/users" - import knex from "knex" import { createCookieLoginFlow } from "./cookie" @@ -29,6 +16,16 @@ import { import { kratosAdmin, kratosPublic, toDomainIdentityEmailPhone } from "./private" import { SchemaIdType } from "./schema" +import { checkedToEmailAddress } from "@/domain/users" +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" +import { + EmailCodeInvalidError, + EmailUnverifiedError, + EmailValidationSubmittedTooOftenError, + LikelyUserAlreadyExistError, +} from "@/domain/authentication/errors" +import { KRATOS_MASTER_USER_PASSWORD, KRATOS_PG_CON } from "@/config" + const getKratosKnex = () => knex({ client: "pg", diff --git a/core/api/src/services/kratos/auth-phone-no-password.ts b/core/api/src/services/kratos/auth-phone-no-password.ts index 7cb65358dc..847b4ea6ee 100644 --- a/core/api/src/services/kratos/auth-phone-no-password.ts +++ b/core/api/src/services/kratos/auth-phone-no-password.ts @@ -2,15 +2,6 @@ import { CreateIdentityBody, UpdateIdentityBody } from "@ory/client" import libCookie from "cookie" import setCookie from "set-cookie-parser" -import { KRATOS_MASTER_USER_PASSWORD } from "@config" - -import { - LikelyNoUserWithThisPhoneExistError, - LikelyUserAlreadyExistError, -} from "@domain/authentication/errors" - -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" - import { AuthenticationKratosError, IncompatibleSchemaUpgradeError, @@ -18,9 +9,20 @@ import { KratosError, UnknownKratosError, } from "./errors" + import { kratosAdmin, kratosPublic, toDomainIdentityPhone } from "./private" + import { SchemaIdType } from "./schema" +import { KRATOS_MASTER_USER_PASSWORD } from "@/config" + +import { + LikelyNoUserWithThisPhoneExistError, + LikelyUserAlreadyExistError, +} from "@/domain/authentication/errors" + +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" + // login with phone export const AuthWithPhonePasswordlessService = (): IAuthWithPhonePasswordlessService => { diff --git a/core/api/src/services/kratos/auth-username-password-deviceid.ts b/core/api/src/services/kratos/auth-username-password-deviceid.ts index bd5558cdd3..049fb41b8b 100644 --- a/core/api/src/services/kratos/auth-username-password-deviceid.ts +++ b/core/api/src/services/kratos/auth-username-password-deviceid.ts @@ -1,7 +1,5 @@ import { CreateIdentityBody } from "@ory/client" -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" - import { isAxiosError } from "axios" import { @@ -12,6 +10,8 @@ import { import { kratosAdmin, kratosPublic } from "./private" import { AuthWithPhonePasswordlessService } from "./auth-phone-no-password" +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" + export const AuthWithUsernamePasswordDeviceIdService = (): IAuthWithUsernamePasswordDeviceIdService => { const createIdentityWithSession = async ({ diff --git a/core/api/src/services/kratos/cookie.ts b/core/api/src/services/kratos/cookie.ts index ef2d116f97..93e79e6e19 100644 --- a/core/api/src/services/kratos/cookie.ts +++ b/core/api/src/services/kratos/cookie.ts @@ -1,11 +1,11 @@ import libCookie from "cookie" import setCookie, { Cookie } from "set-cookie-parser" -import { ICookieOptions } from "@domain/authentication/cookie" - import { kratosPublic } from "./private" import { KratosError } from "./errors" +import { ICookieOptions } from "@/domain/authentication/cookie" + export const createCookieLoginFlow = async (): Promise< | { flowId: string diff --git a/core/api/src/services/kratos/cron.ts b/core/api/src/services/kratos/cron.ts index 44efe0baeb..4b9d2ac2f7 100644 --- a/core/api/src/services/kratos/cron.ts +++ b/core/api/src/services/kratos/cron.ts @@ -1,8 +1,8 @@ -import { addAttributesToCurrentSpan } from "@services/tracing" - import { UnknownKratosError } from "./errors" import { kratosAdmin } from "./private" +import { addAttributesToCurrentSpan } from "@/services/tracing" + export const extendSession = async ( sessionId: SessionId, ): Promise => { diff --git a/core/api/src/services/kratos/errors.ts b/core/api/src/services/kratos/errors.ts index 546ddcaa20..87e7d2f17c 100644 --- a/core/api/src/services/kratos/errors.ts +++ b/core/api/src/services/kratos/errors.ts @@ -1,5 +1,5 @@ -import { AuthenticationError } from "@domain/authentication/errors" -import { ErrorLevel } from "@domain/shared" +import { AuthenticationError } from "@/domain/authentication/errors" +import { ErrorLevel } from "@/domain/shared" export class KratosError extends AuthenticationError {} diff --git a/core/api/src/services/kratos/identity.ts b/core/api/src/services/kratos/identity.ts index e8f0ac11db..16d5f36ab8 100644 --- a/core/api/src/services/kratos/identity.ts +++ b/core/api/src/services/kratos/identity.ts @@ -1,10 +1,10 @@ import { Identity as KratosIdentity } from "@ory/client" -import { IdentifierNotFoundError } from "@domain/authentication/errors" - import { KratosError, UnknownKratosError } from "./errors" import { kratosAdmin, toDomainIdentity } from "./private" +import { IdentifierNotFoundError } from "@/domain/authentication/errors" + export const getNextPage = (link: string): number | undefined => { const links = link.split(",") const next = links.find((l) => l.includes('rel="next"')) diff --git a/core/api/src/services/kratos/index.ts b/core/api/src/services/kratos/index.ts index ced0c52fe9..2523e151a2 100644 --- a/core/api/src/services/kratos/index.ts +++ b/core/api/src/services/kratos/index.ts @@ -1,8 +1,8 @@ -import { InvalidFlowId, InvalidTotpCode } from "@domain/errors" - import { AuthenticationKratosError, UnknownKratosError } from "./errors" import { kratosAdmin, kratosPublic, toDomainSession } from "./private" +import { InvalidFlowId, InvalidTotpCode } from "@/domain/errors" + export * from "./auth-phone-no-password" export * from "./auth-email-no-password" export * from "./auth-username-password-deviceid" diff --git a/core/api/src/services/kratos/private.ts b/core/api/src/services/kratos/private.ts index bc60002ea6..0fe6924e47 100644 --- a/core/api/src/services/kratos/private.ts +++ b/core/api/src/services/kratos/private.ts @@ -1,8 +1,4 @@ -import { ErrorLevel } from "@domain/shared" import { Configuration, FrontendApi, IdentityApi } from "@ory/client" -import { recordExceptionInCurrentSpan } from "@services/tracing" - -import { KRATOS_ADMIN_API, KRATOS_PUBLIC_API } from "@config" import { InvalidIdentitySessionKratosError, @@ -10,8 +6,14 @@ import { MissingExpiredAtKratosError, UnknownKratosError, } from "./errors" + import { SchemaIdType } from "./schema" +import { ErrorLevel } from "@/domain/shared" +import { recordExceptionInCurrentSpan } from "@/services/tracing" + +import { KRATOS_ADMIN_API, KRATOS_PUBLIC_API } from "@/config" + export const kratosPublic = new FrontendApi( new Configuration({ basePath: KRATOS_PUBLIC_API }), ) diff --git a/core/api/src/services/kratos/tests-but-not-prod.ts b/core/api/src/services/kratos/tests-but-not-prod.ts index 034055985f..c68b87b1c4 100644 --- a/core/api/src/services/kratos/tests-but-not-prod.ts +++ b/core/api/src/services/kratos/tests-but-not-prod.ts @@ -1,10 +1,10 @@ import { IdentityState } from "@ory/client" -import { baseLogger } from "@services/logger" - import { UnknownKratosError } from "./errors" import { kratosAdmin } from "./private" +import { baseLogger } from "@/services/logger" + export const activateUser = async (kratosUserId: UserId): Promise => { let identity: KratosIdentity try { diff --git a/core/api/src/services/kratos/totp.ts b/core/api/src/services/kratos/totp.ts index d800ad57cf..996a1fa117 100644 --- a/core/api/src/services/kratos/totp.ts +++ b/core/api/src/services/kratos/totp.ts @@ -1,10 +1,7 @@ -import { LikelyNoUserWithThisPhoneExistError } from "@domain/authentication/errors" import { UiNodeTextAttributes } from "@ory/client" import { isAxiosError } from "axios" -import { KRATOS_MASTER_USER_PASSWORD } from "@config" - import { AuthenticationKratosError, MissingTotpKratosError, @@ -13,6 +10,9 @@ import { } from "./errors" import { kratosPublic } from "./private" +import { KRATOS_MASTER_USER_PASSWORD } from "@/config" +import { LikelyNoUserWithThisPhoneExistError } from "@/domain/authentication/errors" + export const kratosInitiateTotp = async (token: AuthToken) => { try { const res = await kratosPublic.createNativeSettingsFlow({ xSessionToken: token }) diff --git a/core/api/src/services/ledger/admin-legacy.ts b/core/api/src/services/ledger/admin-legacy.ts index 54c75fef61..6301c51a52 100644 --- a/core/api/src/services/ledger/admin-legacy.ts +++ b/core/api/src/services/ledger/admin-legacy.ts @@ -1,11 +1,3 @@ -import { - LedgerTransactionType, - liabilitiesMainAccount, - toLiabilitiesWalletId, - UnknownLedgerError, -} from "@domain/ledger" -import { WalletCurrency } from "@domain/shared" - import { MainBook } from "./books" import { getBankOwnerWalletId } from "./caching" import { @@ -16,6 +8,14 @@ import { onChainLedgerAccountId, } from "./domain/accounts" +import { WalletCurrency } from "@/domain/shared" +import { + LedgerTransactionType, + liabilitiesMainAccount, + toLiabilitiesWalletId, + UnknownLedgerError, +} from "@/domain/ledger" + const getWalletBalance = async (account: string, query = {}) => { const params = { account, currency: "BTC", ...query } const { balance } = await MainBook.balance(params) diff --git a/core/api/src/services/ledger/admin.ts b/core/api/src/services/ledger/admin.ts index ab4a2ab5c9..26d984a805 100644 --- a/core/api/src/services/ledger/admin.ts +++ b/core/api/src/services/ledger/admin.ts @@ -1,15 +1,5 @@ -import { - CouldNotFindTransactionMetadataError, - LedgerTransactionType, - toLiabilitiesWalletId, - UnknownLedgerError, -} from "@domain/ledger" -import { WalletCurrency } from "@domain/shared" -import { DuplicateError } from "@domain/errors" -import { SwapProvider } from "@domain/swap" -import { sha256 } from "@domain/bitcoin/lightning" - import { MainBook, Transaction } from "./books" + import { getBankOwnerWalletId } from "./caching" import { TransactionsMetadataRepository } from "./services" @@ -18,6 +8,17 @@ import { coldStorageAccountId, lndLedgerAccountId } from "./domain/accounts" import { translateToLedgerJournal } from "./helpers" +import { + CouldNotFindTransactionMetadataError, + LedgerTransactionType, + toLiabilitiesWalletId, + UnknownLedgerError, +} from "@/domain/ledger" +import { WalletCurrency } from "@/domain/shared" +import { DuplicateError } from "@/domain/errors" +import { SwapProvider } from "@/domain/swap" +import { sha256 } from "@/domain/bitcoin/lightning" + const txMetadataRepo = TransactionsMetadataRepository() export const admin = { diff --git a/core/api/src/services/ledger/csv-wallet-export.ts b/core/api/src/services/ledger/csv-wallet-export.ts index b5ad3c86fe..51a295e36f 100644 --- a/core/api/src/services/ledger/csv-wallet-export.ts +++ b/core/api/src/services/ledger/csv-wallet-export.ts @@ -1,7 +1,8 @@ -import { LedgerService } from "@services/ledger" -import { baseLogger } from "@services/logger" import { createObjectCsvStringifier, createObjectCsvWriter } from "csv-writer" +import { LedgerService } from "@/services/ledger" +import { baseLogger } from "@/services/logger" + const headers_field = [ "id", "walletId", diff --git a/core/api/src/services/ledger/domain/accounts.ts b/core/api/src/services/ledger/domain/accounts.ts index 4a8b8e7cf5..2965b1cd26 100644 --- a/core/api/src/services/ledger/domain/accounts.ts +++ b/core/api/src/services/ledger/domain/accounts.ts @@ -1,7 +1,7 @@ // an accounting reminder: // https://en.wikipedia.org/wiki/Double-entry_bookkeeping -import { WalletCurrency } from "@domain/shared" +import { WalletCurrency } from "@/domain/shared" // assets: export const assetsMainAccount = "Assets" diff --git a/core/api/src/services/ledger/domain/entry-builder.ts b/core/api/src/services/ledger/domain/entry-builder.ts index 581e4a1081..1bc946f177 100644 --- a/core/api/src/services/ledger/domain/entry-builder.ts +++ b/core/api/src/services/ledger/domain/entry-builder.ts @@ -1,11 +1,11 @@ -import { AmountCalculator, WalletCurrency } from "@domain/shared" - import { coldStorageAccountDescriptor, lndLedgerAccountDescriptor, onChainLedgerAccountDescriptor, } from "./accounts" +import { AmountCalculator, WalletCurrency } from "@/domain/shared" + const calc = AmountCalculator() export const EntryBuilder = ({ diff --git a/core/api/src/services/ledger/domain/errors.ts b/core/api/src/services/ledger/domain/errors.ts index 3910c743f7..08ab98c0de 100644 --- a/core/api/src/services/ledger/domain/errors.ts +++ b/core/api/src/services/ledger/domain/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class LedgerFacadeError extends DomainError {} export class NoTransactionToSettleError extends LedgerFacadeError {} diff --git a/core/api/src/services/ledger/facade/intraledger.ts b/core/api/src/services/ledger/facade/intraledger.ts index 1be2273805..371865e570 100644 --- a/core/api/src/services/ledger/facade/intraledger.ts +++ b/core/api/src/services/ledger/facade/intraledger.ts @@ -1,5 +1,3 @@ -import { ZERO_BANK_FEE } from "@domain/shared" - import { MainBook } from "../books" import { EntryBuilder, toLedgerAccountDescriptor } from "../domain" @@ -7,6 +5,8 @@ import { persistAndReturnEntry } from "../helpers" import { staticAccountIds } from "./static-account-ids" +import { ZERO_BANK_FEE } from "@/domain/shared" + export const recordIntraledger = async ({ description, senderWalletDescriptor, diff --git a/core/api/src/services/ledger/facade/offchain-receive.ts b/core/api/src/services/ledger/facade/offchain-receive.ts index 6a61a18b42..f5d87deb6f 100644 --- a/core/api/src/services/ledger/facade/offchain-receive.ts +++ b/core/api/src/services/ledger/facade/offchain-receive.ts @@ -1,5 +1,3 @@ -import { AmountCalculator, ZERO_CENTS, ZERO_SATS } from "@domain/shared" - import { MainBook } from "../books" import { EntryBuilder, toLedgerAccountDescriptor } from "../domain" @@ -7,6 +5,8 @@ import { persistAndReturnEntry } from "../helpers" import { staticAccountIds } from "./static-account-ids" +import { AmountCalculator, ZERO_CENTS, ZERO_SATS } from "@/domain/shared" + const calc = AmountCalculator() export const recordReceiveOffChain = async ({ diff --git a/core/api/src/services/ledger/facade/offchain-send.ts b/core/api/src/services/ledger/facade/offchain-send.ts index 1d593251f3..dc42a708c5 100644 --- a/core/api/src/services/ledger/facade/offchain-send.ts +++ b/core/api/src/services/ledger/facade/offchain-send.ts @@ -1,6 +1,3 @@ -import { ZERO_CENTS, ZERO_SATS } from "@domain/shared" -import { UnknownLedgerError } from "@domain/ledger" - import { MainBook, Transaction } from "../books" import { EntryBuilder, toLedgerAccountDescriptor } from "../domain" @@ -12,6 +9,9 @@ import { translateToLedgerJournal } from ".." import { staticAccountIds } from "./static-account-ids" +import { UnknownLedgerError } from "@/domain/ledger" +import { ZERO_CENTS, ZERO_SATS } from "@/domain/shared" + export const recordSendOffChain = async ({ description, senderWalletDescriptor, diff --git a/core/api/src/services/ledger/facade/onchain-receive.ts b/core/api/src/services/ledger/facade/onchain-receive.ts index afad484222..8107cdc1ca 100644 --- a/core/api/src/services/ledger/facade/onchain-receive.ts +++ b/core/api/src/services/ledger/facade/onchain-receive.ts @@ -1,5 +1,3 @@ -import { AmountCalculator, ZERO_CENTS, ZERO_SATS } from "@domain/shared" - import { MainBook } from "../books" import { EntryBuilder, toLedgerAccountDescriptor } from "../domain" @@ -8,6 +6,8 @@ import { persistAndReturnEntry } from "../helpers" import { staticAccountIds } from "./static-account-ids" +import { AmountCalculator, ZERO_CENTS, ZERO_SATS } from "@/domain/shared" + const calc = AmountCalculator() export const recordReceiveOnChain = async ({ diff --git a/core/api/src/services/ledger/facade/onchain-send.ts b/core/api/src/services/ledger/facade/onchain-send.ts index cb4e92faf4..70e1bab182 100644 --- a/core/api/src/services/ledger/facade/onchain-send.ts +++ b/core/api/src/services/ledger/facade/onchain-send.ts @@ -1,17 +1,3 @@ -import { - WalletCurrency, - ZERO_CENTS, - ZERO_SATS, - paymentAmountFromNumber, -} from "@domain/shared" - -import { - InvalidLedgerTransactionStateError, - NoTransactionToUpdateError, -} from "@domain/errors" - -import { isValidObjectId, toObjectId } from "@services/mongoose/utils" - import { MainBook, Transaction } from "../books" import { getBankOwnerWalletId, getNonEndUserWalletIds } from "../caching" @@ -27,6 +13,18 @@ import { translateToLedgerTx } from ".." import { staticAccountIds } from "./static-account-ids" +import { + InvalidLedgerTransactionStateError, + NoTransactionToUpdateError, +} from "@/domain/errors" +import { isValidObjectId, toObjectId } from "@/services/mongoose/utils" +import { + WalletCurrency, + ZERO_CENTS, + ZERO_SATS, + paymentAmountFromNumber, +} from "@/domain/shared" + export const getTransactionsByPayoutId = async ( payoutId: PayoutId, ): Promise[] | LedgerServiceError> => { diff --git a/core/api/src/services/ledger/facade/static-account-ids.ts b/core/api/src/services/ledger/facade/static-account-ids.ts index 59982b9a1f..f30da9e23e 100644 --- a/core/api/src/services/ledger/facade/static-account-ids.ts +++ b/core/api/src/services/ledger/facade/static-account-ids.ts @@ -1,8 +1,8 @@ -import { UnknownLedgerError } from "@domain/ledger" - import * as caching from "../caching" import { toLedgerAccountId } from "../domain" +import { UnknownLedgerError } from "@/domain/ledger" + export const staticAccountIds = async () => { try { return { diff --git a/core/api/src/services/ledger/facade/tx-metadata.ts b/core/api/src/services/ledger/facade/tx-metadata.ts index 5b2eb7ad7c..e2c0c8add0 100644 --- a/core/api/src/services/ledger/facade/tx-metadata.ts +++ b/core/api/src/services/ledger/facade/tx-metadata.ts @@ -1,6 +1,6 @@ -import { toSats } from "@domain/bitcoin" -import { UsdDisplayCurrency, toCents } from "@domain/fiat" -import { LedgerTransactionType } from "@domain/ledger" +import { toSats } from "@/domain/bitcoin" +import { UsdDisplayCurrency, toCents } from "@/domain/fiat" +import { LedgerTransactionType } from "@/domain/ledger" const displayArgsFromArgs = ({ senderAmountDisplayCurrency, diff --git a/core/api/src/services/ledger/facade/volume.ts b/core/api/src/services/ledger/facade/volume.ts index ea9799148c..97b13fa29c 100644 --- a/core/api/src/services/ledger/facade/volume.ts +++ b/core/api/src/services/ledger/facade/volume.ts @@ -1,15 +1,15 @@ +import { Transaction } from "../books" + import { LedgerTransactionType, UnknownLedgerError, toLiabilitiesWalletId, -} from "@domain/ledger" +} from "@/domain/ledger" -import { timestampDaysAgo } from "@utils" +import { timestampDaysAgo } from "@/utils" -import { paymentAmountFromNumber } from "@domain/shared" -import { addAttributesToCurrentSpan } from "@services/tracing" - -import { Transaction } from "../books" +import { paymentAmountFromNumber } from "@/domain/shared" +import { addAttributesToCurrentSpan } from "@/services/tracing" export const TxnGroups = { allPaymentVolumeSince: [ diff --git a/core/api/src/services/ledger/facade/wallet.ts b/core/api/src/services/ledger/facade/wallet.ts index 3b4153ba38..69ca0b0bbf 100644 --- a/core/api/src/services/ledger/facade/wallet.ts +++ b/core/api/src/services/ledger/facade/wallet.ts @@ -1,9 +1,9 @@ -import { paymentAmountFromNumber } from "@domain/shared" - import { MainBook } from "../books" import { toLedgerAccountId } from "../domain" import { UnknownLedgerError } from "../domain/errors" +import { paymentAmountFromNumber } from "@/domain/shared" + export const getLedgerAccountBalanceForWalletId = async ({ id: walletId, currency, diff --git a/core/api/src/services/ledger/index.ts b/core/api/src/services/ledger/index.ts index 7264563c54..0c6db4be75 100644 --- a/core/api/src/services/ledger/index.ts +++ b/core/api/src/services/ledger/index.ts @@ -3,40 +3,46 @@ * https://en.wikipedia.org/wiki/Double-entry_bookkeeping */ -import { toSats } from "@domain/bitcoin" -import { toCents } from "@domain/fiat" +import { admin } from "./admin" + +import * as adminLegacy from "./admin-legacy" + +import { MainBook, Transaction } from "./books" + +import { paginatedLedger } from "./paginated-ledger" + +import * as caching from "./caching" + +import { TransactionsMetadataRepository } from "./services" + +import { send } from "./send" + +import { toSats } from "@/domain/bitcoin" +import { toCents } from "@/domain/fiat" import { LedgerTransactionType, liabilitiesMainAccount, toLiabilitiesWalletId, toWalletId, -} from "@domain/ledger" -import { BalanceLessThanZeroError } from "@domain/errors" +} from "@/domain/ledger" +import { BalanceLessThanZeroError } from "@/domain/errors" import { CouldNotFindTransactionError, LedgerError, LedgerServiceError, UnknownLedgerError, -} from "@domain/ledger/errors" +} from "@/domain/ledger/errors" import { balanceAmountFromNumber, BigIntFloatConversionError, ErrorLevel, WalletCurrency, -} from "@domain/shared" -import { fromObjectId, toObjectId } from "@services/mongoose/utils" +} from "@/domain/shared" +import { fromObjectId, toObjectId } from "@/services/mongoose/utils" import { recordExceptionInCurrentSpan, wrapAsyncFunctionsToRunInSpan, -} from "@services/tracing" - -import { admin } from "./admin" -import * as adminLegacy from "./admin-legacy" -import { MainBook, Transaction } from "./books" -import { paginatedLedger } from "./paginated-ledger" -import * as caching from "./caching" -import { TransactionsMetadataRepository } from "./services" -import { send } from "./send" +} from "@/services/tracing" export { getNonEndUserWalletIds } from "./caching" export { translateToLedgerJournal } from "./helpers" diff --git a/core/api/src/services/ledger/paginated-ledger.ts b/core/api/src/services/ledger/paginated-ledger.ts index 64e6c68568..9e93cf92fc 100644 --- a/core/api/src/services/ledger/paginated-ledger.ts +++ b/core/api/src/services/ledger/paginated-ledger.ts @@ -7,11 +7,11 @@ import { Types } from "mongoose" import { parseFilterQuery } from "medici/build/helper/parse/parseFilterQuery" -import { InvalidPaginationArgumentsError } from "@domain/ledger" -import { Transaction } from "@services/ledger/schema" - import { MainBook } from "./books" +import { InvalidPaginationArgumentsError } from "@/domain/ledger" +import { Transaction } from "@/services/ledger/schema" + export const DEFAULT_MAX_CONNECTION_LIMIT = 100 type IFilterQuery = { diff --git a/core/api/src/services/ledger/schema.ts b/core/api/src/services/ledger/schema.ts index c59968a372..1ae52325dc 100644 --- a/core/api/src/services/ledger/schema.ts +++ b/core/api/src/services/ledger/schema.ts @@ -1,7 +1,9 @@ import mongoose from "mongoose" -import { LedgerTransactionType } from "@domain/ledger" + import { setTransactionSchema } from "medici" +import { LedgerTransactionType } from "@/domain/ledger" + // TODO migration: // rename type: on_us to intraledger diff --git a/core/api/src/services/ledger/send.ts b/core/api/src/services/ledger/send.ts index 2707bf54ad..0071fe0d60 100644 --- a/core/api/src/services/ledger/send.ts +++ b/core/api/src/services/ledger/send.ts @@ -1,13 +1,13 @@ -import { LedgerServiceError, UnknownLedgerError } from "@domain/ledger/errors" - -import { toObjectId } from "@services/mongoose/utils" - import { MainBook, Transaction } from "./books" import { TransactionsMetadataRepository } from "./services" import { translateToLedgerJournal } from "./helpers" +import { toObjectId } from "@/services/mongoose/utils" + +import { LedgerServiceError, UnknownLedgerError } from "@/domain/ledger/errors" + const txMetadataRepo = TransactionsMetadataRepository() export const send = { diff --git a/core/api/src/services/ledger/services/transactions-metadata.ts b/core/api/src/services/ledger/services/transactions-metadata.ts index 3da0fd6e74..8f3b25b453 100644 --- a/core/api/src/services/ledger/services/transactions-metadata.ts +++ b/core/api/src/services/ledger/services/transactions-metadata.ts @@ -1,15 +1,15 @@ -import { NoTransactionToUpdateError, UnknownRepositoryError } from "@domain/errors" +import { TransactionMetadata } from "../schema" + +import { NoTransactionToUpdateError, UnknownRepositoryError } from "@/domain/errors" import { CouldNotFindExpectedTransactionMetadataError, CouldNotFindTransactionMetadataError, MismatchedResultForTransactionMetadataQuery, -} from "@domain/ledger" -import { ErrorLevel } from "@domain/shared" -import { fromObjectId, toObjectId, parseRepositoryError } from "@services/mongoose/utils" -import { recordExceptionInCurrentSpan } from "@services/tracing" -import { ModifiedSet } from "@utils" - -import { TransactionMetadata } from "../schema" +} from "@/domain/ledger" +import { ErrorLevel } from "@/domain/shared" +import { fromObjectId, toObjectId, parseRepositoryError } from "@/services/mongoose/utils" +import { recordExceptionInCurrentSpan } from "@/services/tracing" +import { ModifiedSet } from "@/utils" export const TransactionsMetadataRepository = (): ITransactionsMetadataRepository => { const updateByHash = async ( diff --git a/core/api/src/services/lnd/auth.ts b/core/api/src/services/lnd/auth.ts index fb7bddcd52..d2c051996c 100644 --- a/core/api/src/services/lnd/auth.ts +++ b/core/api/src/services/lnd/auth.ts @@ -1,4 +1,5 @@ import { authenticatedLndGrpc, unauthenticatedLndGrpc } from "lightning" + import { LND1_DNS, LND1_MACAROON, @@ -15,7 +16,7 @@ import { LND2_TLS, LND2_TYPE, LND_PRIORITY, -} from "@config" +} from "@/config" const addProps = (array: LndParams[]) => { const result: LndConnect[] = array.map((input) => { diff --git a/core/api/src/services/lnd/config.ts b/core/api/src/services/lnd/config.ts index 667d022281..4de7d3c64d 100644 --- a/core/api/src/services/lnd/config.ts +++ b/core/api/src/services/lnd/config.ts @@ -1,11 +1,11 @@ +import { lndsConnect } from "./auth" + import { NoValidNodeForPubkeyError, OffChainServiceUnavailableError, -} from "@domain/bitcoin/lightning" +} from "@/domain/bitcoin/lightning" -import { OnChainServiceUnavailableError } from "@domain/bitcoin/onchain" - -import { lndsConnect } from "./auth" +import { OnChainServiceUnavailableError } from "@/domain/bitcoin/onchain" export const getLnds = ({ type, diff --git a/core/api/src/services/lnd/health.ts b/core/api/src/services/lnd/health.ts index 9450980335..fe88439b11 100644 --- a/core/api/src/services/lnd/health.ts +++ b/core/api/src/services/lnd/health.ts @@ -1,10 +1,11 @@ import { EventEmitter } from "events" import { getWalletStatus } from "lightning" -import { baseLogger } from "@services/logger" import { lndsConnect } from "./auth" +import { baseLogger } from "@/services/logger" + /* Check the status of the wallet and emit current state */ diff --git a/core/api/src/services/lnd/index.ts b/core/api/src/services/lnd/index.ts index 327c8f6597..396b5a14b4 100644 --- a/core/api/src/services/lnd/index.ts +++ b/core/api/src/services/lnd/index.ts @@ -29,9 +29,21 @@ import { } from "lightning" import lnService from "ln-service" -import { NETWORK, SECS_PER_5_MINS } from "@config" +import sumBy from "lodash.sumby" + +import { KnownLndErrorDetails } from "./errors" + +import { + getActiveLnd, + getActiveOnchainLnd, + getLndFromPubkey, + getLnds, + parseLndErrorDetails, +} from "./config" + +import { NETWORK, SECS_PER_5_MINS } from "@/config" -import { toMilliSatsFromString, toSats } from "@domain/bitcoin" +import { toMilliSatsFromString, toSats } from "@/domain/bitcoin" import { BadPaymentDataError, CorruptLndDbError, @@ -62,31 +74,20 @@ import { UnknownNextPeerError, UnknownRouteNotFoundError, decodeInvoice, -} from "@domain/bitcoin/lightning" -import { IncomingOnChainTransaction } from "@domain/bitcoin/onchain" -import { CacheKeys } from "@domain/cache" -import { LnFees } from "@domain/payments" +} from "@/domain/bitcoin/lightning" +import { IncomingOnChainTransaction } from "@/domain/bitcoin/onchain" +import { CacheKeys } from "@/domain/cache" +import { LnFees } from "@/domain/payments" import { WalletCurrency, parseErrorMessageFromUnknown, paymentAmountFromNumber, -} from "@domain/shared" +} from "@/domain/shared" -import { LocalCacheService } from "@services/cache" -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" +import { LocalCacheService } from "@/services/cache" +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" -import { timeoutWithCancel } from "@utils" - -import sumBy from "lodash.sumby" - -import { KnownLndErrorDetails } from "./errors" -import { - getActiveLnd, - getActiveOnchainLnd, - getLndFromPubkey, - getLnds, - parseLndErrorDetails, -} from "./config" +import { timeoutWithCancel } from "@/utils" const TIMEOUT_PAYMENT = NETWORK !== "regtest" ? 45000 : 3000 diff --git a/core/api/src/services/lnd/rebalancing.ts b/core/api/src/services/lnd/rebalancing.ts index 674433cab5..1f78930972 100644 --- a/core/api/src/services/lnd/rebalancing.ts +++ b/core/api/src/services/lnd/rebalancing.ts @@ -1,7 +1,3 @@ -import { baseLogger } from "@services/logger" - -import { delayWhile } from "@utils" - import { GetChannelsResult, createInvoice, @@ -13,6 +9,10 @@ import { getLnds } from "./config" import { LndService } from "." +import { delayWhile } from "@/utils" + +import { baseLogger } from "@/services/logger" + export const rebalancingInternalChannels = async () => { const lndService = LndService() if (lndService instanceof Error) throw lndService diff --git a/core/api/src/services/lnd/schema.ts b/core/api/src/services/lnd/schema.ts index 6f5cd76aed..f3e5b59eac 100644 --- a/core/api/src/services/lnd/schema.ts +++ b/core/api/src/services/lnd/schema.ts @@ -1,6 +1,7 @@ -import { PaymentStatus } from "@domain/bitcoin/lightning" import mongoose from "mongoose" +import { PaymentStatus } from "@/domain/bitcoin/lightning" + const Schema = mongoose.Schema const confirmedDetailsSchema = new Schema({ diff --git a/core/api/src/services/lnd/utils.ts b/core/api/src/services/lnd/utils.ts index 3f4f663d3c..114d37ec6a 100644 --- a/core/api/src/services/lnd/utils.ts +++ b/core/api/src/services/lnd/utils.ts @@ -1,21 +1,5 @@ import { assert } from "console" -import { MS_PER_DAY, ONCHAIN_SCAN_DEPTH_CHANNEL_UPDATE, ONE_DAY } from "@config" -import { toSats } from "@domain/bitcoin" -import { defaultTimeToExpiryInSeconds } from "@domain/bitcoin/lightning" -import { CouldNotFindError } from "@domain/errors" - -import { - addLndChannelOpeningOrClosingFee, - addLndRoutingRevenue, - updateLndEscrow, -} from "@services/ledger/admin-legacy" -import { baseLogger } from "@services/logger" -import { PaymentFlowStateRepository, WalletInvoicesRepository } from "@services/mongoose" -import { DbMetadata } from "@services/mongoose/schema" - -import { timestampDaysAgo } from "@utils" - import { SubscribeToChannelsChannelClosedEvent, SubscribeToChannelsChannelOpenedEvent, @@ -29,13 +13,33 @@ import { getPendingChainBalance, getWalletInfo, } from "lightning" + import groupBy from "lodash.groupby" + import map from "lodash.map" + import mapValues from "lodash.mapvalues" + import sumBy from "lodash.sumby" import { getActiveLnd, getLnds, offchainLnds } from "./config" +import { MS_PER_DAY, ONCHAIN_SCAN_DEPTH_CHANNEL_UPDATE, ONE_DAY } from "@/config" +import { toSats } from "@/domain/bitcoin" +import { defaultTimeToExpiryInSeconds } from "@/domain/bitcoin/lightning" +import { CouldNotFindError } from "@/domain/errors" + +import { + addLndChannelOpeningOrClosingFee, + addLndRoutingRevenue, + updateLndEscrow, +} from "@/services/ledger/admin-legacy" +import { baseLogger } from "@/services/logger" +import { PaymentFlowStateRepository, WalletInvoicesRepository } from "@/services/mongoose" +import { DbMetadata } from "@/services/mongoose/schema" + +import { timestampDaysAgo } from "@/utils" + export const deleteExpiredWalletInvoice = async (): Promise => { const walletInvoicesRepo = WalletInvoicesRepository() diff --git a/core/api/src/services/lock/index.ts b/core/api/src/services/lock/index.ts index 185f127874..5b2ec0d1ce 100644 --- a/core/api/src/services/lock/index.ts +++ b/core/api/src/services/lock/index.ts @@ -1,17 +1,17 @@ import Redlock, { ExecutionError } from "redlock" -import { NETWORK } from "@config" +import { NETWORK } from "@/config" import { ResourceAttemptsRedlockServiceError, ResourceAttemptsTimelockServiceError, ResourceExpiredLockServiceError, UnknownLockServiceError, -} from "@domain/lock" -import { parseErrorMessageFromUnknown } from "@domain/shared" +} from "@/domain/lock" +import { parseErrorMessageFromUnknown } from "@/domain/shared" -import { redis } from "@services/redis" -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" +import { redis } from "@/services/redis" +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" const durationLockIdempotencyKey = (1000 * 60 * 60) as MilliSeconds // 1 hour diff --git a/core/api/src/services/loopd/loop-service.ts b/core/api/src/services/loopd/loop-service.ts index 1f9364949d..3321a761c7 100644 --- a/core/api/src/services/loopd/loop-service.ts +++ b/core/api/src/services/loopd/loop-service.ts @@ -2,22 +2,11 @@ import util from "util" import * as grpc from "@grpc/grpc-js" -import { - SwapClientNotResponding, - SwapServiceError, - UnknownSwapServiceError, - SwapErrorChannelBalanceTooLow, -} from "@domain/swap/errors" -import { SwapType as DomainSwapType } from "@domain/swap" -import { ServiceClient } from "@grpc/grpc-js/build/src/make-client" -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" -import { BtcNetwork } from "@domain/bitcoin" - -import { SwapState as DomainSwapState } from "@domain/swap/index" -import { WalletCurrency } from "@domain/shared" +import { ServiceClient } from "@grpc/grpc-js/build/src/make-client" import { SwapClientClient } from "./protos/loop_grpc_pb" + import { FailureReason, QuoteRequest, @@ -33,6 +22,20 @@ import { OutTermsResponse, } from "./protos/loop_pb" +import { + SwapClientNotResponding, + SwapServiceError, + UnknownSwapServiceError, + SwapErrorChannelBalanceTooLow, +} from "@/domain/swap/errors" +import { SwapType as DomainSwapType } from "@/domain/swap" +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" +import { BtcNetwork } from "@/domain/bitcoin" + +import { SwapState as DomainSwapState } from "@/domain/swap/index" + +import { WalletCurrency } from "@/domain/shared" + export const LoopService = ({ macaroon, tlsCert, diff --git a/core/api/src/services/mongodb/index.ts b/core/api/src/services/mongodb/index.ts index 9a2b41bd06..70792333e6 100644 --- a/core/api/src/services/mongodb/index.ts +++ b/core/api/src/services/mongodb/index.ts @@ -1,5 +1,9 @@ import mongoose from "mongoose" +import { baseLogger } from "../logger" + +import { Account } from "../mongoose/schema" + import { MONGODB_CON, MissingBankOwnerAccountConfigError, @@ -8,14 +12,11 @@ import { MissingFunderAccountConfigError, MissingUsdDealerWalletConfigError, UnknownConfigError, -} from "@config" -import { WalletCurrency } from "@domain/shared" -import { lazyLoadLedgerAdmin } from "@services/ledger" -import { WalletsRepository } from "@services/mongoose" -import { fromObjectId } from "@services/mongoose/utils" - -import { baseLogger } from "../logger" -import { Account } from "../mongoose/schema" +} from "@/config" +import { WalletCurrency } from "@/domain/shared" +import { lazyLoadLedgerAdmin } from "@/services/ledger" +import { WalletsRepository } from "@/services/mongoose" +import { fromObjectId } from "@/services/mongoose/utils" export const ledgerAdmin = lazyLoadLedgerAdmin({ bankOwnerWalletResolver: async () => { diff --git a/core/api/src/services/mongoose/accounts-ips.ts b/core/api/src/services/mongoose/accounts-ips.ts index 527ce85eac..8a271c2932 100644 --- a/core/api/src/services/mongoose/accounts-ips.ts +++ b/core/api/src/services/mongoose/accounts-ips.ts @@ -1,8 +1,12 @@ -import { AccountIps } from "@services/mongoose/schema" +import { fromObjectId, toObjectId, parseRepositoryError } from "./utils" -import { CouldNotFindAccountIpError, PersistError, RepositoryError } from "@domain/errors" +import { AccountIps } from "@/services/mongoose/schema" -import { fromObjectId, toObjectId, parseRepositoryError } from "./utils" +import { + CouldNotFindAccountIpError, + PersistError, + RepositoryError, +} from "@/domain/errors" type UpdateQuery = { $set: { diff --git a/core/api/src/services/mongoose/accounts.ts b/core/api/src/services/mongoose/accounts.ts index f66958022c..e9171f880f 100644 --- a/core/api/src/services/mongoose/accounts.ts +++ b/core/api/src/services/mongoose/accounts.ts @@ -1,18 +1,18 @@ -import { OnboardingEarn } from "@config" +import { fromObjectId, parseRepositoryError, toObjectId } from "./utils" + +import { OnboardingEarn } from "@/config" -import { AccountStatus } from "@domain/accounts" +import { AccountStatus } from "@/domain/accounts" import { CouldNotFindAccountError, CouldNotFindAccountFromKratosIdError, CouldNotFindAccountFromUsernameError, CouldNotFindAccountFromUuidError, RepositoryError, -} from "@domain/errors" -import { UsdDisplayCurrency } from "@domain/fiat" +} from "@/domain/errors" +import { UsdDisplayCurrency } from "@/domain/fiat" -import { Account } from "@services/mongoose/schema" - -import { fromObjectId, parseRepositoryError, toObjectId } from "./utils" +import { Account } from "@/services/mongoose/schema" const caseInsensitiveRegex = (input: string) => { return new RegExp(`^${input}$`, "i") diff --git a/core/api/src/services/mongoose/ln-payments.ts b/core/api/src/services/mongoose/ln-payments.ts index 3a8efa55f0..dc192dde9d 100644 --- a/core/api/src/services/mongoose/ln-payments.ts +++ b/core/api/src/services/mongoose/ln-payments.ts @@ -1,9 +1,9 @@ -import { toMilliSatsFromNumber, toSats } from "@domain/bitcoin" -import { CouldNotFindLnPaymentFromHashError } from "@domain/errors" -import { LnPayment } from "@services/lnd/schema" - import { parseRepositoryError } from "./utils" +import { toMilliSatsFromNumber, toSats } from "@/domain/bitcoin" +import { CouldNotFindLnPaymentFromHashError } from "@/domain/errors" +import { LnPayment } from "@/services/lnd/schema" + export const LnPaymentsRepository = (): ILnPaymentsRepository => { const findByPaymentHash = async ( paymentHash: PaymentHash, diff --git a/core/api/src/services/mongoose/payment-flow.ts b/core/api/src/services/mongoose/payment-flow.ts index e3f6d3af64..6be5d45d42 100644 --- a/core/api/src/services/mongoose/payment-flow.ts +++ b/core/api/src/services/mongoose/payment-flow.ts @@ -1,17 +1,18 @@ +import { parseRepositoryError } from "./utils" + +import { PaymentFlowState } from "./schema" + import { CouldNotFindLightningPaymentFlowError, CouldNotUpdateLightningPaymentFlowError, NoExpiredLightningPaymentFlowsError, BadInputsForFindError, UnknownRepositoryError, -} from "@domain/errors" -import { InvalidLightningPaymentFlowStateError, PaymentFlow } from "@domain/payments" -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" -import { safeBigInt } from "@domain/shared/safe" -import { elapsedSinceTimestamp } from "@utils" - -import { parseRepositoryError } from "./utils" -import { PaymentFlowState } from "./schema" +} from "@/domain/errors" +import { InvalidLightningPaymentFlowStateError, PaymentFlow } from "@/domain/payments" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" +import { safeBigInt } from "@/domain/shared/safe" +import { elapsedSinceTimestamp } from "@/utils" export const PaymentFlowStateRepository = ( expiryTimeInSeconds: Seconds, diff --git a/core/api/src/services/mongoose/rewards.ts b/core/api/src/services/mongoose/rewards.ts index 89b1344330..252c2dc098 100644 --- a/core/api/src/services/mongoose/rewards.ts +++ b/core/api/src/services/mongoose/rewards.ts @@ -1,9 +1,9 @@ -import { RewardAlreadyPresentError, UnknownRepositoryError } from "@domain/errors" - import { Account } from "./schema" import { toObjectId } from "./utils" +import { RewardAlreadyPresentError, UnknownRepositoryError } from "@/domain/errors" + // FIXME: improve boundary export const RewardsRepository = (accountId: AccountId) => { const add = async (quizQuestionId: QuizQuestionId) => { diff --git a/core/api/src/services/mongoose/schema.ts b/core/api/src/services/mongoose/schema.ts index 80c79419e2..314f80fa48 100644 --- a/core/api/src/services/mongoose/schema.ts +++ b/core/api/src/services/mongoose/schema.ts @@ -1,16 +1,17 @@ import crypto from "crypto" -import { getDefaultAccountsConfig, getFeesConfig, Levels } from "@config" -import { AccountStatus, UsernameRegex } from "@domain/accounts" -import { WalletIdRegex, WalletType } from "@domain/wallets" -import { WalletCurrency } from "@domain/shared" import mongoose from "mongoose" -import { Languages } from "@domain/users" +import { WalletRecord } from "./wallets" -import { CarrierType } from "@domain/phone-provider" +import { getDefaultAccountsConfig, getFeesConfig, Levels } from "@/config" +import { AccountStatus, UsernameRegex } from "@/domain/accounts" +import { WalletIdRegex, WalletType } from "@/domain/wallets" +import { WalletCurrency } from "@/domain/shared" -import { WalletRecord } from "./wallets" +import { Languages } from "@/domain/users" + +import { CarrierType } from "@/domain/phone-provider" // TODO migration: // rename InvoiceUser collection to walletInvoice diff --git a/core/api/src/services/mongoose/users.ts b/core/api/src/services/mongoose/users.ts index c41be79671..e5b5a2875c 100644 --- a/core/api/src/services/mongoose/users.ts +++ b/core/api/src/services/mongoose/users.ts @@ -1,9 +1,9 @@ -import { CouldNotFindUserFromPhoneError, RepositoryError } from "@domain/errors" - import { User } from "./schema" import { parseRepositoryError } from "./utils" +import { CouldNotFindUserFromPhoneError, RepositoryError } from "@/domain/errors" + export const translateToUser = (user: UserRecord): User => { const language = (user?.language ?? "") as UserLanguageOrEmpty const deviceTokens = user.deviceTokens ?? [] diff --git a/core/api/src/services/mongoose/utils.ts b/core/api/src/services/mongoose/utils.ts index 66ad1db3d3..42ed0fea8b 100644 --- a/core/api/src/services/mongoose/utils.ts +++ b/core/api/src/services/mongoose/utils.ts @@ -1,13 +1,13 @@ +import { Types } from "mongoose" + import { CannotConnectToDbError, DbConnectionClosedError, DuplicateKeyForPersistError, InvalidDocumentIdForDbError, UnknownRepositoryError, -} from "@domain/errors" -import { parseErrorMessageFromUnknown } from "@domain/shared" - -import { Types } from "mongoose" +} from "@/domain/errors" +import { parseErrorMessageFromUnknown } from "@/domain/shared" export const isValidObjectId = (id: T): boolean => { return Types.ObjectId.isValid(id) diff --git a/core/api/src/services/mongoose/wallet-invoices.ts b/core/api/src/services/mongoose/wallet-invoices.ts index 656edde5ee..0d455bbfdd 100644 --- a/core/api/src/services/mongoose/wallet-invoices.ts +++ b/core/api/src/services/mongoose/wallet-invoices.ts @@ -1,12 +1,13 @@ +import { WalletInvoice } from "./schema" + +import { parseRepositoryError } from "./utils" + import { CouldNotFindWalletInvoiceError, RepositoryError, UnknownRepositoryError, -} from "@domain/errors" -import { UsdPaymentAmount } from "@domain/shared" - -import { WalletInvoice } from "./schema" -import { parseRepositoryError } from "./utils" +} from "@/domain/errors" +import { UsdPaymentAmount } from "@/domain/shared" export const WalletInvoicesRepository = (): IWalletInvoicesRepository => { const persistNew = async ({ diff --git a/core/api/src/services/mongoose/wallet-on-chain-addresses.ts b/core/api/src/services/mongoose/wallet-on-chain-addresses.ts index 98f5dd2be0..e9dc194acd 100644 --- a/core/api/src/services/mongoose/wallet-on-chain-addresses.ts +++ b/core/api/src/services/mongoose/wallet-on-chain-addresses.ts @@ -1,9 +1,9 @@ -import { CouldNotFindError, PersistError, RepositoryError } from "@domain/errors" -import { baseLogger } from "@services/logger" -import { Wallet } from "@services/mongoose/schema" - import { parseRepositoryError } from "./utils" +import { CouldNotFindError, PersistError, RepositoryError } from "@/domain/errors" +import { baseLogger } from "@/services/logger" +import { Wallet } from "@/services/mongoose/schema" + export const WalletOnChainAddressesRepository = (): IWalletOnChainAddressesRepository => { const persistNew = async ({ walletId, diff --git a/core/api/src/services/mongoose/wallet-onchain-pending-receive.ts b/core/api/src/services/mongoose/wallet-onchain-pending-receive.ts index 703f0406ca..f874db3ee6 100644 --- a/core/api/src/services/mongoose/wallet-onchain-pending-receive.ts +++ b/core/api/src/services/mongoose/wallet-onchain-pending-receive.ts @@ -1,14 +1,15 @@ import getUuidByString from "uuid-by-string" -import { toSats } from "@domain/bitcoin" -import { toCents } from "@domain/fiat" -import { TxStatus } from "@domain/wallets" -import { WalletCurrency } from "@domain/shared" -import { CouldNotFindWalletOnChainPendingReceiveError } from "@domain/errors" - import { WalletOnChainPendingReceive } from "./schema" + import { parseRepositoryError } from "./utils" +import { toSats } from "@/domain/bitcoin" +import { toCents } from "@/domain/fiat" +import { TxStatus } from "@/domain/wallets" +import { WalletCurrency } from "@/domain/shared" +import { CouldNotFindWalletOnChainPendingReceiveError } from "@/domain/errors" + export const WalletOnChainPendingReceiveRepository = (): IWalletOnChainPendingReceiveRepository => { const listByWalletIds = async ({ diff --git a/core/api/src/services/mongoose/wallets.ts b/core/api/src/services/mongoose/wallets.ts index de2b4f05a7..29c6fb3305 100644 --- a/core/api/src/services/mongoose/wallets.ts +++ b/core/api/src/services/mongoose/wallets.ts @@ -1,7 +1,13 @@ import { Types } from "mongoose" -import { WalletCurrency } from "@domain/shared" -import { toWalletDescriptor } from "@domain/wallets" +import { AccountsRepository } from "./accounts" + +import { Wallet } from "./schema" + +import { toObjectId, fromObjectId, parseRepositoryError } from "./utils" + +import { WalletCurrency } from "@/domain/shared" +import { toWalletDescriptor } from "@/domain/wallets" import { CouldNotFindWalletFromAccountIdAndCurrencyError, CouldNotFindWalletFromIdError, @@ -10,11 +16,7 @@ import { CouldNotListWalletsFromAccountIdError, CouldNotListWalletsFromWalletCurrencyError, MultipleWalletsFoundForAccountIdAndCurrency, -} from "@domain/errors" - -import { AccountsRepository } from "./accounts" -import { Wallet } from "./schema" -import { toObjectId, fromObjectId, parseRepositoryError } from "./utils" +} from "@/domain/errors" export interface WalletRecord { id: string diff --git a/core/api/src/services/notifications/create-push-notification-content.ts b/core/api/src/services/notifications/create-push-notification-content.ts index 99c8750158..8931461e6f 100644 --- a/core/api/src/services/notifications/create-push-notification-content.ts +++ b/core/api/src/services/notifications/create-push-notification-content.ts @@ -1,8 +1,8 @@ -import { getI18nInstance } from "@config" +import { getI18nInstance } from "@/config" -import { getCurrencyMajorExponent, MajorExponent } from "@domain/fiat" -import { WalletCurrency } from "@domain/shared" -import { getLanguageOrDefault } from "@domain/locale" +import { getCurrencyMajorExponent, MajorExponent } from "@/domain/fiat" +import { WalletCurrency } from "@/domain/shared" +import { getLanguageOrDefault } from "@/domain/locale" const i18n = getI18nInstance() diff --git a/core/api/src/services/notifications/index.ts b/core/api/src/services/notifications/index.ts index f6fd773879..122ad9f508 100644 --- a/core/api/src/services/notifications/index.ts +++ b/core/api/src/services/notifications/index.ts @@ -1,22 +1,23 @@ -import { toSats } from "@domain/bitcoin" -import { WalletCurrency } from "@domain/shared" -import { toCents, UsdDisplayCurrency } from "@domain/fiat" -import { customPubSubTrigger, PubSubDefaultTriggers } from "@domain/pubsub" -import { - GaloyNotificationCategories, - NotificationsServiceError, - NotificationType, -} from "@domain/notifications" - -import { PubSubService } from "@services/pubsub" -import { wrapAsyncFunctionsToRunInSpan } from "@services/tracing" - import { handleCommonNotificationErrors, PushNotificationsService, } from "./push-notifications" + import { createPushNotificationContent } from "./create-push-notification-content" +import { toSats } from "@/domain/bitcoin" +import { WalletCurrency } from "@/domain/shared" +import { toCents, UsdDisplayCurrency } from "@/domain/fiat" +import { customPubSubTrigger, PubSubDefaultTriggers } from "@/domain/pubsub" +import { + GaloyNotificationCategories, + NotificationsServiceError, + NotificationType, +} from "@/domain/notifications" + +import { PubSubService } from "@/services/pubsub" +import { wrapAsyncFunctionsToRunInSpan } from "@/services/tracing" + export const NotificationsService = (): INotificationsService => { const pubsub = PubSubService() const pushNotification = PushNotificationsService() diff --git a/core/api/src/services/notifications/push-notifications.ts b/core/api/src/services/notifications/push-notifications.ts index 2af84e2c76..1722e4a506 100644 --- a/core/api/src/services/notifications/push-notifications.ts +++ b/core/api/src/services/notifications/push-notifications.ts @@ -1,5 +1,7 @@ import * as admin from "firebase-admin" +import { Messaging } from "firebase-admin/lib/messaging/messaging" + import { DeviceTokensNotRegisteredNotificationsServiceError, InvalidDeviceNotificationsServiceError, @@ -8,17 +10,16 @@ import { NotificationsServiceUnreachableServerError, UnknownNotificationsServiceError, shouldSendNotification, -} from "@domain/notifications" -import { ErrorLevel, parseErrorMessageFromUnknown } from "@domain/shared" -import { baseLogger } from "@services/logger" +} from "@/domain/notifications" +import { ErrorLevel, parseErrorMessageFromUnknown } from "@/domain/shared" +import { baseLogger } from "@/services/logger" import { addAttributesToCurrentSpan, recordExceptionInCurrentSpan, wrapAsyncToRunInSpan, -} from "@services/tracing" -import { Messaging } from "firebase-admin/lib/messaging/messaging" +} from "@/services/tracing" -import { GOOGLE_APPLICATION_CREDENTIALS } from "@config" +import { GOOGLE_APPLICATION_CREDENTIALS } from "@/config" const logger = baseLogger.child({ module: "notifications" }) diff --git a/core/api/src/services/oathkeeper/index.ts b/core/api/src/services/oathkeeper/index.ts index 2de54128a1..5abc68cc24 100644 --- a/core/api/src/services/oathkeeper/index.ts +++ b/core/api/src/services/oathkeeper/index.ts @@ -1,12 +1,13 @@ -import { OATHKEEPER_DECISION_ENDPOINT } from "@config" +import axios, { isAxiosError } from "axios" + +import { OATHKEEPER_DECISION_ENDPOINT } from "@/config" import { OathkeeperError, OathkeeperForbiddenServiceError, OathkeeperMissingAuthorizationHeaderError, OathkeeperUnauthorizedServiceError, UnknownOathkeeperServiceError, -} from "@domain/oathkeeper/errors" -import axios, { isAxiosError } from "axios" +} from "@/domain/oathkeeper/errors" export const sendOathkeeperRequestGraphql = async ( token: AuthToken | undefined, diff --git a/core/api/src/services/price/index.ts b/core/api/src/services/price/index.ts index 847d212cff..e1e6c902c0 100644 --- a/core/api/src/services/price/index.ts +++ b/core/api/src/services/price/index.ts @@ -1,24 +1,25 @@ import util from "util" import { credentials } from "@grpc/grpc-js" + +import { baseLogger } from "../logger" + +import { PriceHistoryProtoDescriptor, PriceProtoDescriptor } from "./grpc" + import { PriceServiceError, UnknownPriceServiceError, PriceNotAvailableError, PriceCurrenciesNotAvailableError, -} from "@domain/price" +} from "@/domain/price" -import { SATS_PER_BTC } from "@domain/bitcoin" +import { SATS_PER_BTC } from "@/domain/bitcoin" -import { WalletCurrency } from "@domain/shared" +import { WalletCurrency } from "@/domain/shared" -import { CENTS_PER_USD, UsdDisplayCurrency } from "@domain/fiat" +import { CENTS_PER_USD, UsdDisplayCurrency } from "@/domain/fiat" -import { PRICE_HISTORY_HOST, PRICE_HISTORY_PORT, PRICE_HOST, PRICE_PORT } from "@config" - -import { baseLogger } from "../logger" - -import { PriceHistoryProtoDescriptor, PriceProtoDescriptor } from "./grpc" +import { PRICE_HISTORY_HOST, PRICE_HISTORY_PORT, PRICE_HOST, PRICE_PORT } from "@/config" const priceUrl = PRICE_HOST const pricePort = PRICE_PORT diff --git a/core/api/src/services/pubsub.ts b/core/api/src/services/pubsub.ts index a6f25fd727..b06d2d40f6 100644 --- a/core/api/src/services/pubsub.ts +++ b/core/api/src/services/pubsub.ts @@ -1,8 +1,8 @@ -import { PubSubServiceError, UnknownPubSubError } from "@domain/pubsub" +import { redisPubSub } from "./redis" -import { sleep } from "@utils" +import { PubSubServiceError, UnknownPubSubError } from "@/domain/pubsub" -import { redisPubSub } from "./redis" +import { sleep } from "@/utils" export const PubSubService = (): IPubSubService => { const createAsyncIterator = ({ diff --git a/core/api/src/services/rate-limit/index.ts b/core/api/src/services/rate-limit/index.ts index caef13bc5a..c2264fd03b 100644 --- a/core/api/src/services/rate-limit/index.ts +++ b/core/api/src/services/rate-limit/index.ts @@ -1,9 +1,10 @@ +import { RateLimiterRedis } from "rate-limiter-flexible" + import { RateLimiterExceededError, UnknownRateLimitServiceError, -} from "@domain/rate-limit/errors" -import { redis } from "@services/redis" -import { RateLimiterRedis } from "rate-limiter-flexible" +} from "@/domain/rate-limit/errors" +import { redis } from "@/services/redis" export const RedisRateLimitService = ({ keyPrefix, diff --git a/core/api/src/services/redis/connection.ts b/core/api/src/services/redis/connection.ts index e7beb704f6..baeb54b8f2 100644 --- a/core/api/src/services/redis/connection.ts +++ b/core/api/src/services/redis/connection.ts @@ -1,7 +1,9 @@ import RedisCache from "ioredis-cache" import { RedisPubSub } from "graphql-redis-subscriptions" -import { baseLogger } from "@services/logger" + import Redis from "ioredis" + +import { baseLogger } from "@/services/logger" import { REDIS_0_DNS, REDIS_0_PORT, @@ -12,7 +14,7 @@ import { REDIS_MASTER_NAME, REDIS_PASSWORD, REDIS_TYPE, -} from "@config" +} from "@/config" let connectionObj = {} diff --git a/core/api/src/services/redis/routes.ts b/core/api/src/services/redis/routes.ts index d4ef782bfa..c37b01f8ac 100644 --- a/core/api/src/services/redis/routes.ts +++ b/core/api/src/services/redis/routes.ts @@ -1,8 +1,8 @@ -import { defaultTimeToExpiryInSeconds } from "@domain/bitcoin/lightning/invoice-expiration" -import { CouldNotFindError, UnknownRepositoryError } from "@domain/errors" - import { redis } from "./connection" +import { defaultTimeToExpiryInSeconds } from "@/domain/bitcoin/lightning/invoice-expiration" +import { CouldNotFindError, UnknownRepositoryError } from "@/domain/errors" + export const RoutesCache = (): IRoutesCache => { const store = async ({ key, diff --git a/core/api/src/services/svix/errors.ts b/core/api/src/services/svix/errors.ts index 844330d809..ce6a32a2a2 100644 --- a/core/api/src/services/svix/errors.ts +++ b/core/api/src/services/svix/errors.ts @@ -1,4 +1,4 @@ -import { DomainError, ErrorLevel } from "@domain/shared" +import { DomainError, ErrorLevel } from "@/domain/shared" export class SvixEventError extends DomainError {} diff --git a/core/api/src/services/svix/index.ts b/core/api/src/services/svix/index.ts index 52111d6ba5..7db6f5d7b2 100644 --- a/core/api/src/services/svix/index.ts +++ b/core/api/src/services/svix/index.ts @@ -1,13 +1,13 @@ import { ApplicationIn, Svix } from "svix" -import { baseLogger } from "@services/logger" +import { SvixError, UnknownSvixError } from "./errors" + +import { baseLogger } from "@/services/logger" import { addAttributesToCurrentSpan, wrapAsyncFunctionsToRunInSpan, -} from "@services/tracing" - -import { SvixError, UnknownSvixError } from "./errors" +} from "@/services/tracing" function prefixObjectKeys( obj: Record, diff --git a/core/api/src/services/tracing.ts b/core/api/src/services/tracing.ts index 8d60e757df..1d682e7d05 100644 --- a/core/api/src/services/tracing.ts +++ b/core/api/src/services/tracing.ts @@ -26,11 +26,13 @@ import { Context, AttributeValue, } from "@opentelemetry/api" -import { ErrorLevel, RankedErrorLevel, parseErrorFromUnknown } from "@domain/shared" + import { NetInstrumentation } from "@opentelemetry/instrumentation-net" import type * as graphqlTypes from "graphql" import { Resource } from "@opentelemetry/resources" + +import { ErrorLevel, RankedErrorLevel, parseErrorFromUnknown } from "@/domain/shared" type ExtendedException = Exclude & { level?: ErrorLevel } diff --git a/core/api/src/services/twilio.ts b/core/api/src/services/twilio.ts index 914ab7b5d7..8931f91206 100644 --- a/core/api/src/services/twilio.ts +++ b/core/api/src/services/twilio.ts @@ -1,12 +1,16 @@ import twilio from "twilio" +import { isAxiosError } from "axios" + +import { wrapAsyncFunctionsToRunInSpan } from "./tracing" + import { TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_VERIFY_SERVICE_ID, UNSECURE_DEFAULT_LOGIN_CODE, getTestAccounts, -} from "@config" +} from "@/config" import { ExpiredOrNonExistentPhoneNumberError, InvalidOrApprovedVerificationError, @@ -19,16 +23,12 @@ import { RestrictedRegionPhoneProviderError, UnknownPhoneProviderServiceError, UnsubscribedRecipientPhoneProviderError, -} from "@domain/phone-provider" -import { baseLogger } from "@services/logger" +} from "@/domain/phone-provider" +import { baseLogger } from "@/services/logger" -import { TestAccountsChecker } from "@domain/accounts/test-accounts-checker" -import { NotImplementedError } from "@domain/errors" -import { parseErrorMessageFromUnknown } from "@domain/shared" - -import { isAxiosError } from "axios" - -import { wrapAsyncFunctionsToRunInSpan } from "./tracing" +import { TestAccountsChecker } from "@/domain/accounts/test-accounts-checker" +import { NotImplementedError } from "@/domain/errors" +import { parseErrorMessageFromUnknown } from "@/domain/shared" export const TWILIO_ACCOUNT_TEST = "AC_twilio_id" diff --git a/core/api/src/utils/index.ts b/core/api/src/utils/index.ts index a49882a37b..f665a9eb1e 100644 --- a/core/api/src/utils/index.ts +++ b/core/api/src/utils/index.ts @@ -1,5 +1,5 @@ -import { MS_PER_DAY, MS_PER_SEC } from "@config" -import { NonIntegerError } from "@domain/errors" +import { MS_PER_DAY, MS_PER_SEC } from "@/config" +import { NonIntegerError } from "@/domain/errors" export * as GrpcStreamClient from "./grpc-stream-client" diff --git a/core/api/test/e2e/jest.setup.js b/core/api/test/e2e/jest.setup.js index ad99914fae..f8d29d2175 100644 --- a/core/api/test/e2e/jest.setup.js +++ b/core/api/test/e2e/jest.setup.js @@ -1,15 +1,15 @@ -const { disconnectAll } = require("@services/redis") -const { setupMongoConnection } = require("@services/mongodb") +const { disconnectAll } = require("@/services/redis") +const { setupMongoConnection } = require("@/services/mongodb") -jest.mock("@services/lnd/auth", () => { - const module = jest.requireActual("@services/lnd/auth") +jest.mock("@/services/lnd/auth", () => { + const module = jest.requireActual("@/services/lnd/auth") const lndsConnect = module.lndsConnect.map((p) => ({ ...p, active: true })) return { ...module, lndsConnect } }) let mongoose -jest.mock("@services/twilio", () => require("test/mocks/twilio")) +jest.mock("@/services/twilio", () => require("test/mocks/twilio")) beforeAll(async () => { mongoose = await setupMongoConnection(true) diff --git a/core/api/test/e2e/servers/kratos.spec.ts b/core/api/test/e2e/servers/kratos.spec.ts index 7315a1ce55..3b3adefad9 100644 --- a/core/api/test/e2e/servers/kratos.spec.ts +++ b/core/api/test/e2e/servers/kratos.spec.ts @@ -1,9 +1,11 @@ +import { authenticator } from "otplib" + import { AuthenticationError, EmailCodeInvalidError, LikelyNoUserWithThisPhoneExistError, LikelyUserAlreadyExistError, -} from "@domain/authentication/errors" +} from "@/domain/authentication/errors" import { AuthWithPhonePasswordlessService, AuthWithUsernamePasswordDeviceIdService, @@ -21,16 +23,15 @@ import { kratosElevatingSessionWithTotp, SchemaIdType, kratosRemoveTotp, -} from "@services/kratos" -import { kratosAdmin, kratosPublic } from "@services/kratos/private" +} from "@/services/kratos" +import { kratosAdmin, kratosPublic } from "@/services/kratos/private" import { activateUser, deactivateUser, revokeSessions, -} from "@services/kratos/tests-but-not-prod" -import { authenticator } from "otplib" +} from "@/services/kratos/tests-but-not-prod" -import { sleep } from "@utils" +import { sleep } from "@/utils" import { getError, randomEmail, randomPhone } from "test/helpers" diff --git a/core/api/test/helpers/bitcoin-core.ts b/core/api/test/helpers/bitcoin-core.ts index d23505e473..b88b6158ea 100644 --- a/core/api/test/helpers/bitcoin-core.ts +++ b/core/api/test/helpers/bitcoin-core.ts @@ -1,14 +1,5 @@ import { authenticatedBitcoind, createWallet, importDescriptors } from "bitcoin-cli-ts" -import { LedgerService } from "@services/ledger" - -import { toSats } from "@domain/bitcoin" -import { parseErrorMessageFromUnknown } from "@domain/shared" - -import { updateLegacyOnChainReceipt } from "@app/wallets" - -import { baseLogger } from "@services/logger" - import { BitcoindClient, bitcoindDefaultClient, @@ -16,10 +7,22 @@ import { BitcoindWalletClient, getBitcoinCoreSignerRPCConfig, } from "./bitcoind" + import { descriptors as signerDescriptors } from "./signer-wallet" + import { lndCreateOnChainAddress } from "./wallet" + import { waitUntilBlockHeight } from "./lightning" +import { LedgerService } from "@/services/ledger" + +import { toSats } from "@/domain/bitcoin" +import { parseErrorMessageFromUnknown } from "@/domain/shared" + +import { updateLegacyOnChainReceipt } from "@/app/wallets" + +import { baseLogger } from "@/services/logger" + export const RANDOM_ADDRESS = "2N1AdXp9qihogpSmSBXSSfgeUFgTYyjVWqo" export const bitcoindClient = bitcoindDefaultClient // no wallet export const bitcoindSignerClient = new BitcoindClient(getBitcoinCoreSignerRPCConfig()) diff --git a/core/api/test/helpers/bria.ts b/core/api/test/helpers/bria.ts index a38e383662..3020525ea5 100644 --- a/core/api/test/helpers/bria.ts +++ b/core/api/test/helpers/bria.ts @@ -1,6 +1,3 @@ -import { BriaSubscriber, OnChainService } from "@services/bria" -import { baseLogger } from "@services/logger" - import { RANDOM_ADDRESS, bitcoindClient, @@ -11,6 +8,9 @@ import { import { waitFor, waitForNoErrorWithCount } from "./shared" +import { BriaSubscriber, OnChainService } from "@/services/bria" +import { baseLogger } from "@/services/logger" + export const getBriaBalance = async (): Promise => { const service = OnChainService() const hot = await service.getHotBalance() diff --git a/core/api/test/helpers/check-is-balanced.ts b/core/api/test/helpers/check-is-balanced.ts index cbd1d4faa0..9fd7f44626 100644 --- a/core/api/test/helpers/check-is-balanced.ts +++ b/core/api/test/helpers/check-is-balanced.ts @@ -1,16 +1,17 @@ -import { updatePendingPayments } from "@app/payments" -import { handleHeldInvoices, updateLegacyOnChainReceipt } from "@app/wallets" -import { baseLogger } from "@services/logger" - -import { ledgerAdmin } from "@services/mongodb" -import { lndsBalances } from "@services/lnd/utils" - import { waitUntilChannelBalanceSyncE2e, waitUntilChannelBalanceSyncIntegration, } from "./lightning" + import { getBriaBalance } from "./bria" +import { updatePendingPayments } from "@/app/payments" +import { handleHeldInvoices, updateLegacyOnChainReceipt } from "@/app/wallets" +import { baseLogger } from "@/services/logger" + +import { ledgerAdmin } from "@/services/mongodb" +import { lndsBalances } from "@/services/lnd/utils" + const logger = baseLogger.child({ module: "test" }) export const checkIsBalanced = async () => { diff --git a/core/api/test/helpers/index.ts b/core/api/test/helpers/index.ts index 3e78fdac21..cd2bf8d45c 100644 --- a/core/api/test/helpers/index.ts +++ b/core/api/test/helpers/index.ts @@ -1,13 +1,16 @@ -import { gqlAdminSchema } from "@graphql/admin" import { ExecutionResult, graphql, Source } from "graphql" + import { ObjMap } from "graphql/jsutils/ObjMap" -import { AccountsRepository } from "@services/mongoose" -import { getCurrencyMajorExponent, priceAmountFromNumber } from "@domain/fiat" -import { DepositFeeCalculator } from "@domain/wallets" -import { AmountCalculator } from "@domain/shared" import { randomUserId } from "./random" +import { gqlAdminSchema } from "@/graphql/admin" + +import { AccountsRepository } from "@/services/mongoose" +import { getCurrencyMajorExponent, priceAmountFromNumber } from "@/domain/fiat" +import { DepositFeeCalculator } from "@/domain/wallets" +import { AmountCalculator } from "@/domain/shared" + export * from "./bitcoin-core" export * from "./bria" export * from "./check-is-balanced" diff --git a/core/api/test/helpers/kratos.ts b/core/api/test/helpers/kratos.ts index 641088a6eb..5147e04e3c 100644 --- a/core/api/test/helpers/kratos.ts +++ b/core/api/test/helpers/kratos.ts @@ -1,6 +1,7 @@ -import { KRATOS_PG_CON } from "@config" import knex from "knex" +import { KRATOS_PG_CON } from "@/config" + const getKratosKnex = () => knex({ client: "pg", // specify the database client diff --git a/core/api/test/helpers/ledger.ts b/core/api/test/helpers/ledger.ts index ba4981ceed..ee1dd96072 100644 --- a/core/api/test/helpers/ledger.ts +++ b/core/api/test/helpers/ledger.ts @@ -2,22 +2,22 @@ import crypto from "crypto" import mongoose from "mongoose" -import { WalletCurrency, ZERO_CENTS, ZERO_SATS } from "@domain/shared" -import { toSats } from "@domain/bitcoin" -import { LedgerTransactionType, toLiabilitiesWalletId } from "@domain/ledger" - -import { toObjectId } from "@services/mongoose/utils" -import { MainBook } from "@services/ledger/books" -import { translateToLedgerJournal } from "@services/ledger" -import { getBankOwnerWalletId } from "@services/ledger/caching" +import { generateHash } from "./generate-hash" + +import { WalletCurrency, ZERO_CENTS, ZERO_SATS } from "@/domain/shared" +import { toSats } from "@/domain/bitcoin" +import { LedgerTransactionType, toLiabilitiesWalletId } from "@/domain/ledger" + +import { toObjectId } from "@/services/mongoose/utils" +import { MainBook } from "@/services/ledger/books" +import { translateToLedgerJournal } from "@/services/ledger" +import { getBankOwnerWalletId } from "@/services/ledger/caching" import { coldStorageAccountId, escrowAccountId, lndLedgerAccountId, -} from "@services/ledger/domain" -import * as LedgerFacade from "@services/ledger/facade" - -import { generateHash } from "./generate-hash" +} from "@/services/ledger/domain" +import * as LedgerFacade from "@/services/ledger/facade" const Journal = mongoose.models.Medici_Journal const Transaction = mongoose.models.Medici_Transaction diff --git a/core/api/test/helpers/lightning.ts b/core/api/test/helpers/lightning.ts index 4ca80e8138..6edc5e8d7a 100644 --- a/core/api/test/helpers/lightning.ts +++ b/core/api/test/helpers/lightning.ts @@ -1,14 +1,5 @@ import { once } from "events" -import { Wallets } from "@app" - -import { WalletCurrency } from "@domain/shared" -import { onChannelUpdated, updateEscrows } from "@services/lnd/utils" -import { baseLogger } from "@services/logger" -import { WalletsRepository } from "@services/mongoose" - -import { sleep } from "@utils" - import { authenticatedLndGrpc, closeChannel, @@ -29,8 +20,6 @@ import { import { parsePaymentRequest } from "invoices" -import { offchainLnds, onchainLnds } from "@services/lnd/config" - import { bitcoindClient, bitcoindOutside, @@ -40,6 +29,17 @@ import { import { waitFor } from "./shared" +import { Wallets } from "@/app" + +import { WalletCurrency } from "@/domain/shared" +import { onChannelUpdated, updateEscrows } from "@/services/lnd/utils" +import { baseLogger } from "@/services/logger" +import { WalletsRepository } from "@/services/mongoose" + +import { sleep } from "@/utils" + +import { offchainLnds, onchainLnds } from "@/services/lnd/config" + export * from "lightning" export const lnd1 = offchainLnds[0].lnd diff --git a/core/api/test/helpers/rate-limit.ts b/core/api/test/helpers/rate-limit.ts index a2e0e4cc2d..40fe86da39 100644 --- a/core/api/test/helpers/rate-limit.ts +++ b/core/api/test/helpers/rate-limit.ts @@ -1,5 +1,5 @@ -import { RateLimitConfig } from "@domain/rate-limit" -import { resetLimiter } from "@services/rate-limit" +import { RateLimitConfig } from "@/domain/rate-limit" +import { resetLimiter } from "@/services/rate-limit" export const resetSelfAccountIdLimits = async ( accountId: AccountId, diff --git a/core/api/test/helpers/redis.ts b/core/api/test/helpers/redis.ts index 356f1b603e..1421fb2f99 100644 --- a/core/api/test/helpers/redis.ts +++ b/core/api/test/helpers/redis.ts @@ -1,5 +1,5 @@ -import { RateLimitPrefix } from "@domain/rate-limit" -import { redis } from "@services/redis" +import { RateLimitPrefix } from "@/domain/rate-limit" +import { redis } from "@/services/redis" export const clearKeys = async (prefix: string) => { const keys = await redis.keys(`${prefix}:*`) diff --git a/core/api/test/helpers/shared.ts b/core/api/test/helpers/shared.ts index 60c8c549c6..d215513c7e 100644 --- a/core/api/test/helpers/shared.ts +++ b/core/api/test/helpers/shared.ts @@ -1,4 +1,4 @@ -import { sleep } from "@utils" +import { sleep } from "@/utils" export const waitFor = async (f) => { let res diff --git a/core/api/test/helpers/user.ts b/core/api/test/helpers/user.ts index 944aade0da..4788df1b09 100644 --- a/core/api/test/helpers/user.ts +++ b/core/api/test/helpers/user.ts @@ -1,30 +1,30 @@ -import { addWallet, createAccountWithPhoneIdentifier } from "@app/accounts" -import { addWalletIfNonexistent } from "@app/accounts/add-wallet" -import { getAdminAccounts, getDefaultAccountsConfig } from "@config" +import { lndOutside1, safePay } from "./lightning" + +import { randomPhone, randomUserId } from "." + +import { addWallet, createAccountWithPhoneIdentifier } from "@/app/accounts" +import { addWalletIfNonexistent } from "@/app/accounts/add-wallet" +import { getAdminAccounts, getDefaultAccountsConfig } from "@/config" -import { CouldNotFindAccountFromKratosIdError, CouldNotFindError } from "@domain/errors" -import { WalletCurrency } from "@domain/shared" -import { WalletType } from "@domain/wallets" +import { CouldNotFindAccountFromKratosIdError, CouldNotFindError } from "@/domain/errors" +import { WalletCurrency } from "@/domain/shared" +import { WalletType } from "@/domain/wallets" import { AccountsRepository, UsersRepository, WalletsRepository, -} from "@services/mongoose" -import { AccountsIpsRepository } from "@services/mongoose/accounts-ips" -import { Account } from "@services/mongoose/schema" +} from "@/services/mongoose" +import { AccountsIpsRepository } from "@/services/mongoose/accounts-ips" +import { Account } from "@/services/mongoose/schema" -import { baseLogger } from "@services/logger" +import { baseLogger } from "@/services/logger" -import { Accounts, Wallets } from "@app" +import { Accounts, Wallets } from "@/app" -import { sleep } from "@utils" +import { sleep } from "@/utils" -import { AccountLevel, AccountStatus } from "@domain/accounts" - -import { lndOutside1, safePay } from "./lightning" - -import { randomPhone, randomUserId } from "." +import { AccountLevel, AccountStatus } from "@/domain/accounts" const accounts = AccountsRepository() diff --git a/core/api/test/helpers/wallet.ts b/core/api/test/helpers/wallet.ts index cae452dca7..82fc01def8 100644 --- a/core/api/test/helpers/wallet.ts +++ b/core/api/test/helpers/wallet.ts @@ -1,9 +1,10 @@ import { createChainAddress } from "lightning" -import { PartialResult } from "@app/partial-result" -import { getBalanceForWallet, getTransactionsForWallets } from "@app/wallets" -import { RepositoryError } from "@domain/errors" -import { WalletsRepository, WalletOnChainAddressesRepository } from "@services/mongoose" -import { getActiveLnd } from "@services/lnd/config" + +import { PartialResult } from "@/app/partial-result" +import { getBalanceForWallet, getTransactionsForWallets } from "@/app/wallets" +import { RepositoryError } from "@/domain/errors" +import { WalletsRepository, WalletOnChainAddressesRepository } from "@/services/mongoose" +import { getActiveLnd } from "@/services/lnd/config" export const getBalanceHelper = async ( walletId: WalletId, diff --git a/core/api/test/integration/app/accounts/get-transactions-for-accounts.spec.ts b/core/api/test/integration/app/accounts/get-transactions-for-accounts.spec.ts index 8f0bf8e997..8d557ace25 100644 --- a/core/api/test/integration/app/accounts/get-transactions-for-accounts.spec.ts +++ b/core/api/test/integration/app/accounts/get-transactions-for-accounts.spec.ts @@ -1,13 +1,13 @@ -import { Accounts } from "@app" +import { Accounts } from "@/app" -import { toSats } from "@domain/bitcoin" -import { UsdDisplayCurrency, toCents } from "@domain/fiat" -import { InvalidWalletId } from "@domain/errors" +import { toSats } from "@/domain/bitcoin" +import { UsdDisplayCurrency, toCents } from "@/domain/fiat" +import { InvalidWalletId } from "@/domain/errors" -import { AccountsRepository } from "@services/mongoose" -import { Transaction } from "@services/ledger/schema" +import { AccountsRepository } from "@/services/mongoose" +import { Transaction } from "@/services/ledger/schema" -import { AmountCalculator, WalletCurrency } from "@domain/shared" +import { AmountCalculator, WalletCurrency } from "@/domain/shared" import { createMandatoryUsers, diff --git a/core/api/test/integration/app/authentication/create-account-from-registration-payload.spec.ts b/core/api/test/integration/app/authentication/create-account-from-registration-payload.spec.ts index 1b8325501c..1b9bfea007 100644 --- a/core/api/test/integration/app/authentication/create-account-from-registration-payload.spec.ts +++ b/core/api/test/integration/app/authentication/create-account-from-registration-payload.spec.ts @@ -1,9 +1,9 @@ -import { createAccountFromRegistrationPayload } from "@app/authentication" -import { KRATOS_CALLBACK_API_KEY } from "@config" +import { createAccountFromRegistrationPayload } from "@/app/authentication" +import { KRATOS_CALLBACK_API_KEY } from "@/config" import { SecretForAuthNCallbackError, RegistrationPayloadValidationError, -} from "@domain/authentication/errors" +} from "@/domain/authentication/errors" describe("createAccountFromRegistrationPayload", () => { it("fails with bad auth key", async () => { diff --git a/core/api/test/integration/app/authentication/extend.spec.ts b/core/api/test/integration/app/authentication/extend.spec.ts index ce8f27bfe5..3d4503f1a2 100644 --- a/core/api/test/integration/app/authentication/extend.spec.ts +++ b/core/api/test/integration/app/authentication/extend.spec.ts @@ -1,7 +1,7 @@ -import { maybeExtendSession } from "@app/authentication" -import { extendSession } from "@services/kratos" +import { maybeExtendSession } from "@/app/authentication" +import { extendSession } from "@/services/kratos" -jest.mock("@services/kratos", () => { +jest.mock("@/services/kratos", () => { return { extendSession: jest.fn(), } diff --git a/core/api/test/integration/app/wallets/add-invoice-for-wallet.spec.ts b/core/api/test/integration/app/wallets/add-invoice-for-wallet.spec.ts index 1e546e92ef..90a0eabbd5 100644 --- a/core/api/test/integration/app/wallets/add-invoice-for-wallet.spec.ts +++ b/core/api/test/integration/app/wallets/add-invoice-for-wallet.spec.ts @@ -1,9 +1,9 @@ -import { Accounts, Wallets } from "@app" +import { Accounts, Wallets } from "@/app" -import { AccountStatus } from "@domain/accounts" -import { InactiveAccountError } from "@domain/errors" +import { AccountStatus } from "@/domain/accounts" +import { InactiveAccountError } from "@/domain/errors" -import { AccountsRepository } from "@services/mongoose" +import { AccountsRepository } from "@/services/mongoose" import { createRandomUserAndBtcWallet } from "test/helpers" diff --git a/core/api/test/integration/app/wallets/add-pending-on-chain-transaction.spec.ts b/core/api/test/integration/app/wallets/add-pending-on-chain-transaction.spec.ts index bdef931412..c19d683513 100644 --- a/core/api/test/integration/app/wallets/add-pending-on-chain-transaction.spec.ts +++ b/core/api/test/integration/app/wallets/add-pending-on-chain-transaction.spec.ts @@ -1,10 +1,10 @@ -import { addPendingTransaction } from "@app/wallets" +import { addPendingTransaction } from "@/app/wallets" -import { WalletCurrency } from "@domain/shared" +import { WalletCurrency } from "@/domain/shared" -import { WalletOnChainAddressesRepository } from "@services/mongoose" -import { Wallet, WalletOnChainPendingReceive } from "@services/mongoose/schema" -import * as PushNotificationsServiceImpl from "@services/notifications/push-notifications" +import { WalletOnChainAddressesRepository } from "@/services/mongoose" +import { Wallet, WalletOnChainPendingReceive } from "@/services/mongoose/schema" +import * as PushNotificationsServiceImpl from "@/services/notifications/push-notifications" import { createRandomUserAndWallets } from "test/helpers" diff --git a/core/api/test/integration/app/wallets/add-settled-on-chain-transaction.spec.ts b/core/api/test/integration/app/wallets/add-settled-on-chain-transaction.spec.ts index b8636a21ab..2a5a65474d 100644 --- a/core/api/test/integration/app/wallets/add-settled-on-chain-transaction.spec.ts +++ b/core/api/test/integration/app/wallets/add-settled-on-chain-transaction.spec.ts @@ -1,11 +1,11 @@ -import { addSettledTransaction } from "@app/wallets" +import { addSettledTransaction } from "@/app/wallets" -import { WalletCurrency } from "@domain/shared" -import { Transaction, TransactionMetadata } from "@services/ledger/schema" +import { WalletCurrency } from "@/domain/shared" +import { Transaction, TransactionMetadata } from "@/services/ledger/schema" -import { WalletOnChainAddressesRepository } from "@services/mongoose" -import { Wallet } from "@services/mongoose/schema" -import * as PushNotificationsServiceImpl from "@services/notifications/push-notifications" +import { WalletOnChainAddressesRepository } from "@/services/mongoose" +import { Wallet } from "@/services/mongoose/schema" +import * as PushNotificationsServiceImpl from "@/services/notifications/push-notifications" import { createMandatoryUsers, createRandomUserAndWallets } from "test/helpers" diff --git a/core/api/test/integration/app/wallets/create-on-chain-address.spec.ts b/core/api/test/integration/app/wallets/create-on-chain-address.spec.ts index 6753d292d7..acf5c55295 100644 --- a/core/api/test/integration/app/wallets/create-on-chain-address.spec.ts +++ b/core/api/test/integration/app/wallets/create-on-chain-address.spec.ts @@ -1,15 +1,15 @@ -import { Accounts, Wallets } from "@app" +import { Accounts, Wallets } from "@/app" -import { AccountStatus } from "@domain/accounts" -import { RateLimitConfig } from "@domain/rate-limit" -import { InactiveAccountError } from "@domain/errors" +import { AccountStatus } from "@/domain/accounts" +import { RateLimitConfig } from "@/domain/rate-limit" +import { InactiveAccountError } from "@/domain/errors" import { OnChainAddressCreateRateLimiterExceededError, RateLimiterExceededError, -} from "@domain/rate-limit/errors" +} from "@/domain/rate-limit/errors" -import { AccountsRepository } from "@services/mongoose" -import * as RateLimitImpl from "@services/rate-limit" +import { AccountsRepository } from "@/services/mongoose" +import * as RateLimitImpl from "@/services/rate-limit" import { createRandomUserAndBtcWallet } from "test/helpers" @@ -66,7 +66,7 @@ describe("onChainAddress", () => { if (newAccount instanceof Error) throw newAccount // Setup limiter mock - const { RedisRateLimitService } = jest.requireActual("@services/rate-limit") + const { RedisRateLimitService } = jest.requireActual("@/services/rate-limit") const rateLimitServiceSpy = jest .spyOn(RateLimitImpl, "RedisRateLimitService") .mockReturnValue({ diff --git a/core/api/test/integration/app/wallets/get-last-on-chain-address.spec.ts b/core/api/test/integration/app/wallets/get-last-on-chain-address.spec.ts index 557f462aa3..652eaae845 100644 --- a/core/api/test/integration/app/wallets/get-last-on-chain-address.spec.ts +++ b/core/api/test/integration/app/wallets/get-last-on-chain-address.spec.ts @@ -1,9 +1,9 @@ -import { Accounts, Wallets } from "@app" +import { Accounts, Wallets } from "@/app" -import { AccountStatus } from "@domain/accounts" -import { InactiveAccountError } from "@domain/errors" +import { AccountStatus } from "@/domain/accounts" +import { InactiveAccountError } from "@/domain/errors" -import { AccountsRepository } from "@services/mongoose" +import { AccountsRepository } from "@/services/mongoose" import { createRandomUserAndBtcWallet } from "test/helpers" diff --git a/core/api/test/integration/app/wallets/get-on-chain-fee.spec.ts b/core/api/test/integration/app/wallets/get-on-chain-fee.spec.ts index 9385cbd3fe..60e74c2b09 100644 --- a/core/api/test/integration/app/wallets/get-on-chain-fee.spec.ts +++ b/core/api/test/integration/app/wallets/get-on-chain-fee.spec.ts @@ -1,11 +1,11 @@ -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { getOnChainWalletConfig } from "@config" +import { getOnChainWalletConfig } from "@/config" -import { PayoutSpeed } from "@domain/bitcoin/onchain" -import { LessThanDustThresholdError } from "@domain/errors" +import { PayoutSpeed } from "@/domain/bitcoin/onchain" +import { LessThanDustThresholdError } from "@/domain/errors" -import { AccountsRepository } from "@services/mongoose" +import { AccountsRepository } from "@/services/mongoose" import { createRandomUserAndWallets } from "test/helpers" diff --git a/core/api/test/integration/app/wallets/get-pending-onchain-balance-for-wallets.spec.ts b/core/api/test/integration/app/wallets/get-pending-onchain-balance-for-wallets.spec.ts index 54a877d215..e72c2e9409 100644 --- a/core/api/test/integration/app/wallets/get-pending-onchain-balance-for-wallets.spec.ts +++ b/core/api/test/integration/app/wallets/get-pending-onchain-balance-for-wallets.spec.ts @@ -1,9 +1,9 @@ -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { ZERO_SATS } from "@domain/shared" -import { MultipleCurrenciesForSingleCurrencyOperationError } from "@domain/errors" +import { ZERO_SATS } from "@/domain/shared" +import { MultipleCurrenciesForSingleCurrencyOperationError } from "@/domain/errors" -import { WalletsRepository } from "@services/mongoose" +import { WalletsRepository } from "@/services/mongoose" import { createRandomUserAndBtcWallet, createRandomUserAndWallets } from "test/helpers" diff --git a/core/api/test/integration/app/wallets/send-intraledger.spec.ts b/core/api/test/integration/app/wallets/send-intraledger.spec.ts index f6bea1bd0f..f203f1c5fe 100644 --- a/core/api/test/integration/app/wallets/send-intraledger.spec.ts +++ b/core/api/test/integration/app/wallets/send-intraledger.spec.ts @@ -1,21 +1,21 @@ -import { Accounts, Payments } from "@app" +import { Accounts, Payments } from "@/app" -import { AccountStatus } from "@domain/accounts" -import { toSats } from "@domain/bitcoin" -import { PaymentSendStatus } from "@domain/bitcoin/lightning" -import { UsdDisplayCurrency, toCents } from "@domain/fiat" +import { AccountStatus } from "@/domain/accounts" +import { toSats } from "@/domain/bitcoin" +import { PaymentSendStatus } from "@/domain/bitcoin/lightning" +import { UsdDisplayCurrency, toCents } from "@/domain/fiat" import { InactiveAccountError, IntraledgerLimitsExceededError, SelfPaymentError, TradeIntraAccountLimitsExceededError, -} from "@domain/errors" +} from "@/domain/errors" -import { AccountsRepository } from "@services/mongoose" -import { Transaction } from "@services/ledger/schema" -import * as PushNotificationsServiceImpl from "@services/notifications/push-notifications" +import { AccountsRepository } from "@/services/mongoose" +import { Transaction } from "@/services/ledger/schema" +import * as PushNotificationsServiceImpl from "@/services/notifications/push-notifications" -import { AmountCalculator, WalletCurrency } from "@domain/shared" +import { AmountCalculator, WalletCurrency } from "@/domain/shared" import { createMandatoryUsers, diff --git a/core/api/test/integration/app/wallets/send-lightning.spec.ts b/core/api/test/integration/app/wallets/send-lightning.spec.ts index 6be024fa1c..f22a19b95a 100644 --- a/core/api/test/integration/app/wallets/send-lightning.spec.ts +++ b/core/api/test/integration/app/wallets/send-lightning.spec.ts @@ -1,14 +1,14 @@ -import { Accounts, Payments } from "@app" +import { Accounts, Payments } from "@/app" -import { AccountStatus } from "@domain/accounts" -import { toSats } from "@domain/bitcoin" +import { AccountStatus } from "@/domain/accounts" +import { toSats } from "@/domain/bitcoin" import { MaxFeeTooLargeForRoutelessPaymentError, PaymentSendStatus, decodeInvoice, -} from "@domain/bitcoin/lightning" -import { UsdDisplayCurrency, toCents } from "@domain/fiat" -import { LnPaymentRequestNonZeroAmountRequiredError } from "@domain/payments" +} from "@/domain/bitcoin/lightning" +import { UsdDisplayCurrency, toCents } from "@/domain/fiat" +import { LnPaymentRequestNonZeroAmountRequiredError } from "@/domain/payments" import { InactiveAccountError, InsufficientBalanceError, @@ -16,21 +16,21 @@ import { SelfPaymentError, TradeIntraAccountLimitsExceededError, WithdrawalLimitsExceededError, -} from "@domain/errors" -import { AmountCalculator, WalletCurrency } from "@domain/shared" -import * as LnFeesImpl from "@domain/payments" +} from "@/domain/errors" +import { AmountCalculator, WalletCurrency } from "@/domain/shared" +import * as LnFeesImpl from "@/domain/payments" import { AccountsRepository, LnPaymentsRepository, WalletInvoicesRepository, -} from "@services/mongoose" -import { LedgerService } from "@services/ledger" -import { Transaction, TransactionMetadata } from "@services/ledger/schema" -import { WalletInvoice } from "@services/mongoose/schema" -import { LnPayment } from "@services/lnd/schema" -import * as LndImpl from "@services/lnd" -import * as PushNotificationsServiceImpl from "@services/notifications/push-notifications" +} from "@/services/mongoose" +import { LedgerService } from "@/services/ledger" +import { Transaction, TransactionMetadata } from "@/services/ledger/schema" +import { WalletInvoice } from "@/services/mongoose/schema" +import { LnPayment } from "@/services/lnd/schema" +import * as LndImpl from "@/services/lnd" +import * as PushNotificationsServiceImpl from "@/services/notifications/push-notifications" import { createMandatoryUsers, @@ -160,7 +160,7 @@ describe("initiated via lightning", () => { describe("settles via lightning", () => { it("fails if sender account is locked", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [], @@ -208,7 +208,7 @@ describe("initiated via lightning", () => { it("fails when user has insufficient balance", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [], @@ -236,7 +236,7 @@ describe("initiated via lightning", () => { it("fails to pay zero amount invoice without separate amount", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [], @@ -264,7 +264,7 @@ describe("initiated via lightning", () => { it("fails if user sends balance amount without accounting for fee", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [], @@ -346,14 +346,14 @@ describe("initiated via lightning", () => { it("pay zero amount invoice & revert txn when verifyMaxFee fails", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [], defaultPubkey: (): Pubkey => DEFAULT_PUBKEY, }) - const { LnFees: LnFeesOrig } = jest.requireActual("@domain/payments") + const { LnFees: LnFeesOrig } = jest.requireActual("@/domain/payments") const lndFeesSpy = jest.spyOn(LnFeesImpl, "LnFees").mockReturnValue({ ...LnFeesOrig(), verifyMaxFee: () => new MaxFeeTooLargeForRoutelessPaymentError(), @@ -415,7 +415,7 @@ describe("initiated via lightning", () => { it("persists ln-payment on successful ln send", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), defaultPubkey: (): Pubkey => DEFAULT_PUBKEY, @@ -471,7 +471,7 @@ describe("initiated via lightning", () => { const { paymentHash, destination } = lnInvoice // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [destination], @@ -536,7 +536,7 @@ describe("initiated via lightning", () => { it("fails if sends to self", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [lnInvoice.destination], @@ -585,7 +585,7 @@ describe("initiated via lightning", () => { it("fails if amount greater than trade-intra-account limit", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [ @@ -669,7 +669,7 @@ describe("initiated via lightning", () => { it("fails if amount greater than intraledger limit", async () => { // Setup mocks - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [ @@ -755,7 +755,7 @@ describe("initiated via lightning", () => { sendNotification: jest.fn(), })) - const { LndService: LnServiceOrig } = jest.requireActual("@services/lnd") + const { LndService: LnServiceOrig } = jest.requireActual("@/services/lnd") const lndServiceSpy = jest.spyOn(LndImpl, "LndService").mockReturnValue({ ...LnServiceOrig(), listAllPubkeys: () => [noAmountLnInvoice.destination], diff --git a/core/api/test/integration/app/wallets/send-onchain.spec.ts b/core/api/test/integration/app/wallets/send-onchain.spec.ts index 66cb22ed48..62cb1e9569 100644 --- a/core/api/test/integration/app/wallets/send-onchain.spec.ts +++ b/core/api/test/integration/app/wallets/send-onchain.spec.ts @@ -1,33 +1,33 @@ -import { Accounts, Prices, Wallets, Payments } from "@app" +import { Accounts, Prices, Wallets, Payments } from "@/app" -import { getAccountLimits, getOnChainWalletConfig, ONE_DAY } from "@config" +import { getAccountLimits, getOnChainWalletConfig, ONE_DAY } from "@/config" -import { AccountStatus } from "@domain/accounts" -import { toSats } from "@domain/bitcoin" -import { toCents, UsdDisplayCurrency } from "@domain/fiat" +import { AccountStatus } from "@/domain/accounts" +import { toSats } from "@/domain/bitcoin" +import { toCents, UsdDisplayCurrency } from "@/domain/fiat" import { InactiveAccountError, InsufficientBalanceError, LessThanDustThresholdError, LimitsExceededError, SelfPaymentError, -} from "@domain/errors" -import { SubOneCentSatAmountForUsdSelfSendError } from "@domain/payments" +} from "@/domain/errors" +import { SubOneCentSatAmountForUsdSelfSendError } from "@/domain/payments" import { AmountCalculator, WalletCurrency, InvalidBtcPaymentAmountError, -} from "@domain/shared" +} from "@/domain/shared" -import { PayoutSpeed } from "@domain/bitcoin/onchain" -import { PaymentSendStatus } from "@domain/bitcoin/lightning" +import { PayoutSpeed } from "@/domain/bitcoin/onchain" +import { PaymentSendStatus } from "@/domain/bitcoin/lightning" -import { AccountsRepository } from "@services/mongoose" -import { Transaction, TransactionMetadata } from "@services/ledger/schema" -import * as PushNotificationsServiceImpl from "@services/notifications/push-notifications" -import { DealerPriceService } from "@services/dealer-price" +import { AccountsRepository } from "@/services/mongoose" +import { Transaction, TransactionMetadata } from "@/services/ledger/schema" +import * as PushNotificationsServiceImpl from "@/services/notifications/push-notifications" +import { DealerPriceService } from "@/services/dealer-price" -import { timestampDaysAgo } from "@utils" +import { timestampDaysAgo } from "@/utils" import { createMandatoryUsers, diff --git a/core/api/test/integration/app/wallets/update-pending-invoices.spec.ts b/core/api/test/integration/app/wallets/update-pending-invoices.spec.ts index 9fa8959713..9ec452845f 100644 --- a/core/api/test/integration/app/wallets/update-pending-invoices.spec.ts +++ b/core/api/test/integration/app/wallets/update-pending-invoices.spec.ts @@ -1,14 +1,14 @@ import { randomUUID } from "crypto" -import { handleHeldInvoices } from "@app/wallets" -import * as UpdatePendingInvoicesImpl from "@app/wallets/update-pending-invoices" - -import { DEFAULT_EXPIRATIONS } from "@domain/bitcoin/lightning/invoice-expiration" -import { WalletCurrency } from "@domain/shared" -import { baseLogger } from "@services/logger" -import { WalletInvoicesRepository } from "@services/mongoose" -import { WalletInvoice } from "@services/mongoose/schema" -import { getSecretAndPaymentHash } from "@domain/bitcoin/lightning" +import { handleHeldInvoices } from "@/app/wallets" +import * as UpdatePendingInvoicesImpl from "@/app/wallets/update-pending-invoices" + +import { DEFAULT_EXPIRATIONS } from "@/domain/bitcoin/lightning/invoice-expiration" +import { WalletCurrency } from "@/domain/shared" +import { baseLogger } from "@/services/logger" +import { WalletInvoicesRepository } from "@/services/mongoose" +import { WalletInvoice } from "@/services/mongoose/schema" +import { getSecretAndPaymentHash } from "@/domain/bitcoin/lightning" afterEach(async () => { await WalletInvoice.deleteMany({}) diff --git a/core/api/test/integration/jest.config.js b/core/api/test/integration/jest.config.js index 59f6787dda..2c2d75a586 100644 --- a/core/api/test/integration/jest.config.js +++ b/core/api/test/integration/jest.config.js @@ -11,16 +11,7 @@ module.exports = { setupFilesAfterEnv: ["/test/integration/jest.setup.js"], testEnvironment: "node", moduleNameMapper: { - "^@config$": ["src/config/index"], - "^@app$": ["src/app/index"], - "^@utils$": ["src/utils/index"], - - "^@core/(.*)$": ["src/core/$1"], - "^@app/(.*)$": ["src/app/$1"], - "^@domain/(.*)$": ["src/domain/$1"], - "^@services/(.*)$": ["src/services/$1"], - "^@servers/(.*)$": ["src/servers/$1"], - "^@graphql/(.*)$": ["src/graphql/$1"], - "^test/(.*)$": ["test/$1"], - }, + "^@/(.*)$": ["/src/$1"], + "^test/(.*)$": ["/test/$1"], + } } diff --git a/core/api/test/integration/jest.setup.js b/core/api/test/integration/jest.setup.js index b5ae868e6a..5eefa4f30a 100644 --- a/core/api/test/integration/jest.setup.js +++ b/core/api/test/integration/jest.setup.js @@ -1,16 +1,16 @@ -const { disconnectAll } = require("@services/redis") -const { setupMongoConnection } = require("@services/mongodb") +const { disconnectAll } = require("@/services/redis") +const { setupMongoConnection } = require("@/services/mongodb") let mongoose -jest.mock("@services/lnd/auth", () => { - const module = jest.requireActual("@services/lnd/auth") +jest.mock("@/services/lnd/auth", () => { + const module = jest.requireActual("@/services/lnd/auth") const lndsConnect = module.lndsConnect.map((p) => ({ ...p, active: true })) return { ...module, lndsConnect } }) // Mock prices -jest.mock("@app/prices/get-current-price", () => require("test/mocks/get-current-price")) +jest.mock("@/app/prices/get-current-price", () => require("test/mocks/get-current-price")) beforeAll(async () => { mongoose = await setupMongoConnection(true) diff --git a/core/api/test/integration/services/ledger-facade.spec.ts b/core/api/test/integration/services/ledger-facade.spec.ts index 50dfb697dc..012616fb67 100644 --- a/core/api/test/integration/services/ledger-facade.spec.ts +++ b/core/api/test/integration/services/ledger-facade.spec.ts @@ -1,11 +1,11 @@ import crypto from "crypto" -import { BtcWalletDescriptor, UsdWalletDescriptor, WalletCurrency } from "@domain/shared" -import { LedgerTransactionType } from "@domain/ledger" -import { UsdDisplayCurrency } from "@domain/fiat" -import { CouldNotFindError } from "@domain/errors" +import { BtcWalletDescriptor, UsdWalletDescriptor, WalletCurrency } from "@/domain/shared" +import { LedgerTransactionType } from "@/domain/ledger" +import { UsdDisplayCurrency } from "@/domain/fiat" +import { CouldNotFindError } from "@/domain/errors" -import { LedgerService } from "@services/ledger" +import { LedgerService } from "@/services/ledger" import { createMandatoryUsers } from "test/helpers" import { diff --git a/core/api/test/integration/services/ledger-service.spec.ts b/core/api/test/integration/services/ledger-service.spec.ts index 1a257f67b6..c16c7f11ae 100644 --- a/core/api/test/integration/services/ledger-service.spec.ts +++ b/core/api/test/integration/services/ledger-service.spec.ts @@ -1,6 +1,6 @@ -import { UnknownLedgerError } from "@domain/ledger" -import { BtcWalletDescriptor, UsdWalletDescriptor, WalletCurrency } from "@domain/shared" -import { LedgerService } from "@services/ledger" +import { UnknownLedgerError } from "@/domain/ledger" +import { BtcWalletDescriptor, UsdWalletDescriptor, WalletCurrency } from "@/domain/shared" +import { LedgerService } from "@/services/ledger" import { createMandatoryUsers, recordWalletIdIntraLedgerPayment } from "test/helpers" diff --git a/core/api/test/integration/services/lnd-service.spec.ts b/core/api/test/integration/services/lnd-service.spec.ts index d3e7f9c8e2..f58cee46f8 100644 --- a/core/api/test/integration/services/lnd-service.spec.ts +++ b/core/api/test/integration/services/lnd-service.spec.ts @@ -5,8 +5,8 @@ import { deleteForwardingReputations, } from "lightning" -import { WalletCurrency } from "@domain/shared" -import { toSats } from "@domain/bitcoin" +import { WalletCurrency } from "@/domain/shared" +import { toSats } from "@/domain/bitcoin" import { LnAlreadyPaidError, PaymentNotFoundError, @@ -14,12 +14,12 @@ import { PaymentStatus, RouteNotFoundError, decodeInvoice, -} from "@domain/bitcoin/lightning" -import { LnFees } from "@domain/payments" +} from "@/domain/bitcoin/lightning" +import { LnFees } from "@/domain/payments" -import { LndService } from "@services/lnd" +import { LndService } from "@/services/lnd" -import { sleep } from "@utils" +import { sleep } from "@/utils" import { bitcoindClient, diff --git a/core/api/test/integration/services/onchain-service.spec.ts b/core/api/test/integration/services/onchain-service.spec.ts index 4824987b74..1e1f96a7c1 100644 --- a/core/api/test/integration/services/onchain-service.spec.ts +++ b/core/api/test/integration/services/onchain-service.spec.ts @@ -1,6 +1,6 @@ -import { OnChainAddressAlreadyCreatedForRequestIdError } from "@domain/bitcoin/onchain" -import { WalletCurrency } from "@domain/shared" -import { OnChainService } from "@services/bria" +import { OnChainAddressAlreadyCreatedForRequestIdError } from "@/domain/bitcoin/onchain" +import { WalletCurrency } from "@/domain/shared" +import { OnChainService } from "@/services/bria" const onchain = OnChainService() diff --git a/core/api/test/integration/services/stablesats.spec.ts b/core/api/test/integration/services/stablesats.spec.ts index d346d27aa5..badaa53ebd 100644 --- a/core/api/test/integration/services/stablesats.spec.ts +++ b/core/api/test/integration/services/stablesats.spec.ts @@ -9,8 +9,8 @@ // can change the mocked rates without breaking tests), and we find some other way to // communicate how the different stablesats methods work. -import { WalletCurrency } from "@domain/shared" -import { DealerPriceService } from "@services/dealer-price" +import { WalletCurrency } from "@/domain/shared" +import { DealerPriceService } from "@/services/dealer-price" const dealerFns = DealerPriceService() diff --git a/core/api/test/integration/services/wallets-repository.spec.ts b/core/api/test/integration/services/wallets-repository.spec.ts index ae163e521e..f7e3c46bb7 100644 --- a/core/api/test/integration/services/wallets-repository.spec.ts +++ b/core/api/test/integration/services/wallets-repository.spec.ts @@ -2,11 +2,11 @@ import { CouldNotFindWalletFromAccountIdAndCurrencyError, MultipleWalletsFoundForAccountIdAndCurrency, RepositoryError, -} from "@domain/errors" -import { WalletCurrency } from "@domain/shared" -import { WalletsRepository } from "@services/mongoose" -import { Wallet } from "@services/mongoose/schema" -import { toObjectId } from "@services/mongoose/utils" +} from "@/domain/errors" +import { WalletCurrency } from "@/domain/shared" +import { WalletsRepository } from "@/services/mongoose" +import { Wallet } from "@/services/mongoose/schema" +import { toObjectId } from "@/services/mongoose/utils" const wallets = WalletsRepository() const accountId = "00112233445566778899aabb" as AccountId diff --git a/core/api/test/legacy-integration/01-setup/01-connection.spec.ts b/core/api/test/legacy-integration/01-setup/01-connection.spec.ts index 15a756e985..fd9c17a949 100644 --- a/core/api/test/legacy-integration/01-setup/01-connection.spec.ts +++ b/core/api/test/legacy-integration/01-setup/01-connection.spec.ts @@ -1,6 +1,6 @@ -import { OnChainService } from "@services/bria" -import { redis } from "@services/redis" -import { Account } from "@services/mongoose/schema" +import { OnChainService } from "@/services/bria" +import { redis } from "@/services/redis" +import { Account } from "@/services/mongoose/schema" import { lnd1, diff --git a/core/api/test/legacy-integration/01-setup/01-funds-bitcoind-lnds.spec.ts b/core/api/test/legacy-integration/01-setup/01-funds-bitcoind-lnds.spec.ts index 7b05e86855..0779afb7b1 100644 --- a/core/api/test/legacy-integration/01-setup/01-funds-bitcoind-lnds.spec.ts +++ b/core/api/test/legacy-integration/01-setup/01-funds-bitcoind-lnds.spec.ts @@ -1,5 +1,5 @@ -import { btc2sat, sat2btc } from "@domain/bitcoin" -import { getFunderWalletId } from "@services/ledger/caching" +import { btc2sat, sat2btc } from "@/domain/bitcoin" +import { getFunderWalletId } from "@/services/ledger/caching" import { bitcoindClient, diff --git a/core/api/test/legacy-integration/01-setup/01-lightning-channels.spec.ts b/core/api/test/legacy-integration/01-setup/01-lightning-channels.spec.ts index c97f0f7794..6f0645d4f4 100644 --- a/core/api/test/legacy-integration/01-setup/01-lightning-channels.spec.ts +++ b/core/api/test/legacy-integration/01-setup/01-lightning-channels.spec.ts @@ -1,6 +1,6 @@ -import { onChannelUpdated, updateEscrows } from "@services/lnd/utils" -import { ledgerAdmin } from "@services/mongodb" -import { sleep } from "@utils" +import { onChannelUpdated, updateEscrows } from "@/services/lnd/utils" +import { ledgerAdmin } from "@/services/mongodb" +import { sleep } from "@/utils" import { checkIsBalanced, diff --git a/core/api/test/legacy-integration/02-user-wallet/02-a-user-setup.spec.ts b/core/api/test/legacy-integration/02-user-wallet/02-a-user-setup.spec.ts index 9594c6567d..8ee86fe9fb 100644 --- a/core/api/test/legacy-integration/02-user-wallet/02-a-user-setup.spec.ts +++ b/core/api/test/legacy-integration/02-user-wallet/02-a-user-setup.spec.ts @@ -1,12 +1,12 @@ import { randomUUID } from "crypto" -import { Accounts } from "@app" -import { setUsername } from "@app/accounts" -import { UsernameIsImmutableError, UsernameNotAvailableError } from "@domain/accounts" -import { ValidationError } from "@domain/shared" -import { CsvWalletsExport } from "@services/ledger/csv-wallet-export" -import { AccountsRepository } from "@services/mongoose" -import { Account } from "@services/mongoose/schema" +import { Accounts } from "@/app" +import { setUsername } from "@/app/accounts" +import { UsernameIsImmutableError, UsernameNotAvailableError } from "@/domain/accounts" +import { ValidationError } from "@/domain/shared" +import { CsvWalletsExport } from "@/services/ledger/csv-wallet-export" +import { AccountsRepository } from "@/services/mongoose" +import { Account } from "@/services/mongoose/schema" import { createMandatoryUsers, diff --git a/core/api/test/legacy-integration/02-user-wallet/02-bria-handlers.spec.ts b/core/api/test/legacy-integration/02-user-wallet/02-bria-handlers.spec.ts index f4092cf121..ccd4dc086f 100644 --- a/core/api/test/legacy-integration/02-user-wallet/02-bria-handlers.spec.ts +++ b/core/api/test/legacy-integration/02-user-wallet/02-bria-handlers.spec.ts @@ -1,6 +1,6 @@ import crypto from "crypto" -import { getOnChainWalletConfig } from "@config" +import { getOnChainWalletConfig } from "@/config" import { addPendingTransaction, @@ -8,23 +8,23 @@ import { addSettledTransaction, getLastOnChainAddress, registerBroadcastedPayout, -} from "@app/wallets" +} from "@/app/wallets" -import { AmountCalculator, WalletCurrency, ZERO_SATS } from "@domain/shared" -import { UnknownLedgerError, toLiabilitiesWalletId } from "@domain/ledger" -import { DisplayPriceRatio, WalletPriceRatio } from "@domain/payments" +import { AmountCalculator, WalletCurrency, ZERO_SATS } from "@/domain/shared" +import { UnknownLedgerError, toLiabilitiesWalletId } from "@/domain/ledger" +import { DisplayPriceRatio, WalletPriceRatio } from "@/domain/payments" import { DisplayAmountsConverter, UsdDisplayCurrency, displayAmountFromNumber, -} from "@domain/fiat" +} from "@/domain/fiat" -import { WalletOnChainPendingReceive } from "@services/mongoose/schema" -import { Transaction } from "@services/ledger/schema" -import * as LedgerFacade from "@services/ledger/facade" -import { getBankOwnerWalletId } from "@services/ledger/caching" +import { WalletOnChainPendingReceive } from "@/services/mongoose/schema" +import { Transaction } from "@/services/ledger/schema" +import * as LedgerFacade from "@/services/ledger/facade" +import { getBankOwnerWalletId } from "@/services/ledger/caching" -import { LessThanDustThresholdError } from "@domain/errors" +import { LessThanDustThresholdError } from "@/domain/errors" import { generateHash, createRandomUserAndBtcWallet } from "test/helpers" diff --git a/core/api/test/legacy-integration/02-user-wallet/02-bria.spec.ts b/core/api/test/legacy-integration/02-user-wallet/02-bria.spec.ts index 1e2e2a3537..94ebd89b9c 100644 --- a/core/api/test/legacy-integration/02-user-wallet/02-bria.spec.ts +++ b/core/api/test/legacy-integration/02-user-wallet/02-bria.spec.ts @@ -1,11 +1,11 @@ -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { sat2btc, toSats } from "@domain/bitcoin" -import { UnknownRepositoryError } from "@domain/errors" -import { utxoSettledEventHandler } from "@servers/event-handlers/bria" +import { sat2btc, toSats } from "@/domain/bitcoin" +import { UnknownRepositoryError } from "@/domain/errors" +import { utxoSettledEventHandler } from "@/servers/event-handlers/bria" -import { BriaSubscriber, BriaPayloadType } from "@services/bria" -import { GrpcStreamClient, timeoutWithCancel } from "@utils" +import { BriaSubscriber, BriaPayloadType } from "@/services/bria" +import { GrpcStreamClient, timeoutWithCancel } from "@/utils" import { bitcoindClient, diff --git a/core/api/test/legacy-integration/02-user-wallet/02-receive-lightning.spec.ts b/core/api/test/legacy-integration/02-user-wallet/02-receive-lightning.spec.ts index 2edd162b0d..606b42af54 100644 --- a/core/api/test/legacy-integration/02-user-wallet/02-receive-lightning.spec.ts +++ b/core/api/test/legacy-integration/02-user-wallet/02-receive-lightning.spec.ts @@ -1,10 +1,10 @@ -import * as Wallets from "@app/wallets" +import * as Wallets from "@/app/wallets" -import { toSats } from "@domain/bitcoin" +import { toSats } from "@/domain/bitcoin" -import { baseLogger } from "@services/logger" +import { baseLogger } from "@/services/logger" -import { sleep } from "@utils" +import { sleep } from "@/utils" import { checkIsBalanced, diff --git a/core/api/test/legacy-integration/02-user-wallet/02-receive-rewards.spec.ts b/core/api/test/legacy-integration/02-user-wallet/02-receive-rewards.spec.ts index a878e944a6..3d82dbb6bf 100644 --- a/core/api/test/legacy-integration/02-user-wallet/02-receive-rewards.spec.ts +++ b/core/api/test/legacy-integration/02-user-wallet/02-receive-rewards.spec.ts @@ -1,10 +1,12 @@ -import { Payments } from "@app" -import { MEMO_SHARING_SATS_THRESHOLD, OnboardingEarn } from "@config" -import { getFunderWalletId } from "@services/ledger/caching" -import { AccountsRepository, WalletsRepository } from "@services/mongoose" import difference from "lodash.difference" + import find from "lodash.find" +import { Payments } from "@/app" +import { MEMO_SHARING_SATS_THRESHOLD, OnboardingEarn } from "@/config" +import { getFunderWalletId } from "@/services/ledger/caching" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" + import { checkIsBalanced, createUserAndWalletFromPhone, @@ -28,8 +30,8 @@ const onBoardingEarnAmt: number = Object.keys(OnboardingEarn) .filter((k) => find(onBoardingEarnIds, (o) => o === k)) .reduce((p, k) => p + OnboardingEarn[k], 0) -jest.mock("@config", () => { - const config = jest.requireActual("@config") +jest.mock("@/config", () => { + const config = jest.requireActual("@/config") config.yamlConfig.rewards = { denyPhoneCountries: [], allowPhoneCountries: ["US"], @@ -41,13 +43,13 @@ jest.mock("@config", () => { return config }) -jest.mock("@domain/accounts-ips/ip-metadata-authorizer", () => ({ +jest.mock("@/domain/accounts-ips/ip-metadata-authorizer", () => ({ IPMetadataAuthorizer: () => ({ authorize: () => true, }), })) -jest.mock("@domain/users", () => ({ +jest.mock("@/domain/users", () => ({ PhoneMetadataAuthorizer: () => ({ authorize: () => true, }), diff --git a/core/api/test/legacy-integration/02-user-wallet/02-send-lightning-limits.spec.ts b/core/api/test/legacy-integration/02-user-wallet/02-send-lightning-limits.spec.ts index 49905de6ac..484144db12 100644 --- a/core/api/test/legacy-integration/02-user-wallet/02-send-lightning-limits.spec.ts +++ b/core/api/test/legacy-integration/02-user-wallet/02-send-lightning-limits.spec.ts @@ -1,13 +1,13 @@ -import { Payments, Wallets } from "@app" -import { getMidPriceRatio } from "@app/prices" +import { Payments, Wallets } from "@/app" +import { getMidPriceRatio } from "@/app/prices" -import { getDealerConfig } from "@config" +import { getDealerConfig } from "@/config" -import { PaymentSendStatus } from "@domain/bitcoin/lightning" -import { LimitsExceededError } from "@domain/errors" -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" +import { PaymentSendStatus } from "@/domain/bitcoin/lightning" +import { LimitsExceededError } from "@/domain/errors" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" -import { AccountsRepository } from "@services/mongoose" +import { AccountsRepository } from "@/services/mongoose" import { addNewWallet, @@ -29,8 +29,8 @@ const accountLimits: IAccountLimits = { tradeIntraAccountLimit: MOCKED_LIMIT, } -jest.mock("@config", () => { - const config = jest.requireActual("@config") +jest.mock("@/config", () => { + const config = jest.requireActual("@/config") return { ...config, getDealerConfig: jest.fn().mockReturnValue({ diff --git a/core/api/test/legacy-integration/02-user-wallet/02-tx-display.spec.ts b/core/api/test/legacy-integration/02-user-wallet/02-tx-display.spec.ts index 81cb352475..80d033cb77 100644 --- a/core/api/test/legacy-integration/02-user-wallet/02-tx-display.spec.ts +++ b/core/api/test/legacy-integration/02-user-wallet/02-tx-display.spec.ts @@ -1,35 +1,35 @@ -import { Payments, Wallets } from "@app" -import { getCurrentPriceAsDisplayPriceRatio } from "@app/prices" +import { Payments, Wallets } from "@/app" +import { getCurrentPriceAsDisplayPriceRatio } from "@/app/prices" import { MaxFeeTooLargeForRoutelessPaymentError, PaymentSendStatus, -} from "@domain/bitcoin/lightning" -import { sat2btc, toSats } from "@domain/bitcoin" -import { LedgerTransactionType, UnknownLedgerError } from "@domain/ledger" -import * as LnFeesImpl from "@domain/payments" -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" -import { TxStatus } from "@domain/wallets" -import { UsdDisplayCurrency, displayAmountFromNumber } from "@domain/fiat" - -import { updateDisplayCurrency } from "@app/accounts" - -import { PayoutSpeed } from "@domain/bitcoin/onchain" - -import { translateToLedgerTx } from "@services/ledger" -import { MainBook, Transaction } from "@services/ledger/books" -import * as BriaImpl from "@services/bria" -import { BriaPayloadType } from "@services/bria" -import { AccountsRepository } from "@services/mongoose" -import { toObjectId } from "@services/mongoose/utils" -import { baseLogger } from "@services/logger" +} from "@/domain/bitcoin/lightning" +import { sat2btc, toSats } from "@/domain/bitcoin" +import { LedgerTransactionType, UnknownLedgerError } from "@/domain/ledger" +import * as LnFeesImpl from "@/domain/payments" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" +import { TxStatus } from "@/domain/wallets" +import { UsdDisplayCurrency, displayAmountFromNumber } from "@/domain/fiat" + +import { updateDisplayCurrency } from "@/app/accounts" + +import { PayoutSpeed } from "@/domain/bitcoin/onchain" + +import { translateToLedgerTx } from "@/services/ledger" +import { MainBook, Transaction } from "@/services/ledger/books" +import * as BriaImpl from "@/services/bria" +import { BriaPayloadType } from "@/services/bria" +import { AccountsRepository } from "@/services/mongoose" +import { toObjectId } from "@/services/mongoose/utils" +import { baseLogger } from "@/services/logger" import { utxoDetectedEventHandler, utxoSettledEventHandler, -} from "@servers/event-handlers/bria" +} from "@/servers/event-handlers/bria" -import { sleep } from "@utils" +import { sleep } from "@/utils" import { bitcoindClient, @@ -570,7 +570,7 @@ describe("Display properties on transactions", () => { it("(LnFailedPaymentReceiveLedgerMetadata) pay zero amount invoice & revert txn when verifyMaxFee fails", async () => { // TxMetadata: // - LnFailedPaymentReceiveLedgerMetadata - const { LnFees: LnFeesOrig } = jest.requireActual("@domain/payments") + const { LnFees: LnFeesOrig } = jest.requireActual("@/domain/payments") const lndFeesSpy = jest.spyOn(LnFeesImpl, "LnFees").mockReturnValue({ ...LnFeesOrig(), verifyMaxFee: () => new MaxFeeTooLargeForRoutelessPaymentError(), @@ -994,7 +994,7 @@ describe("Display properties on transactions", () => { // - OnChainSendLedgerMetadata const { OnChainService: OnChainServiceOrig } = - jest.requireActual("@services/bria") + jest.requireActual("@/services/bria") const briaSpy = jest.spyOn(BriaImpl, "OnChainService").mockReturnValue({ ...OnChainServiceOrig(), queuePayoutToAddress: async () => "payoutId" as PayoutId, diff --git a/core/api/test/legacy-integration/app/accounts/multiple-wallet-account.spec.ts b/core/api/test/legacy-integration/app/accounts/multiple-wallet-account.spec.ts index 7e61b02590..307e20a03a 100644 --- a/core/api/test/legacy-integration/app/accounts/multiple-wallet-account.spec.ts +++ b/core/api/test/legacy-integration/app/accounts/multiple-wallet-account.spec.ts @@ -1,10 +1,11 @@ -import { Accounts } from "@app" -import { getDefaultAccountsConfig } from "@config" -import { WalletCurrency } from "@domain/shared" -import { WalletType } from "@domain/wallets" -import { WalletsRepository } from "@services/mongoose" import mongoose from "mongoose" +import { Accounts } from "@/app" +import { getDefaultAccountsConfig } from "@/config" +import { WalletCurrency } from "@/domain/shared" +import { WalletType } from "@/domain/wallets" +import { WalletsRepository } from "@/services/mongoose" + import { createUserAndWalletFromPhone, getAccountByPhone, diff --git a/core/api/test/legacy-integration/app/cron/delete-payments.spec.ts b/core/api/test/legacy-integration/app/cron/delete-payments.spec.ts index a5e7dac9a9..6a2f4df51b 100644 --- a/core/api/test/legacy-integration/app/cron/delete-payments.spec.ts +++ b/core/api/test/legacy-integration/app/cron/delete-payments.spec.ts @@ -1,15 +1,15 @@ -import { Lightning, Payments } from "@app" +import { Lightning, Payments } from "@/app" -import { TWO_MONTHS_IN_MS } from "@config" +import { TWO_MONTHS_IN_MS } from "@/config" -import { toSats } from "@domain/bitcoin" +import { toSats } from "@/domain/bitcoin" import { PaymentNotFoundError, PaymentSendStatus, PaymentStatus, -} from "@domain/bitcoin/lightning" +} from "@/domain/bitcoin/lightning" -import { LndService } from "@services/lnd" +import { LndService } from "@/services/lnd" import { bitcoindClient, diff --git a/core/api/test/legacy-integration/app/swap/swap-listener.spec.ts b/core/api/test/legacy-integration/app/swap/swap-listener.spec.ts index 3f276b03f0..1d6c35c3ff 100644 --- a/core/api/test/legacy-integration/app/swap/swap-listener.spec.ts +++ b/core/api/test/legacy-integration/app/swap/swap-listener.spec.ts @@ -1,9 +1,9 @@ /* eslint-disable jest/no-conditional-expect */ -import { handleSwapOutCompleted } from "@app/swap" -import { lnd1LoopConfig } from "@app/swap/get-active-loopd" -import { WalletCurrency } from "@domain/shared" -import { LoopService } from "@services/loopd" -import { sleep } from "@utils" +import { handleSwapOutCompleted } from "@/app/swap" +import { lnd1LoopConfig } from "@/app/swap/get-active-loopd" +import { WalletCurrency } from "@/domain/shared" +import { LoopService } from "@/services/loopd" +import { sleep } from "@/utils" import { mineBlockAndSyncAll } from "test/helpers" diff --git a/core/api/test/legacy-integration/app/swap/swap-out.spec.ts b/core/api/test/legacy-integration/app/swap/swap-out.spec.ts index 15ed86ebe3..8351e43469 100644 --- a/core/api/test/legacy-integration/app/swap/swap-out.spec.ts +++ b/core/api/test/legacy-integration/app/swap/swap-out.spec.ts @@ -1,22 +1,22 @@ /* eslint-disable jest/no-conditional-expect */ -import { swapOut } from "@app/swap" +import { swapOut } from "@/app/swap" import { getActiveLoopd, lnd1LoopConfig, lnd2LoopConfig, -} from "@app/swap/get-active-loopd" -import { OnChainService } from "@services/bria" +} from "@/app/swap/get-active-loopd" +import { OnChainService } from "@/services/bria" import { SwapClientNotResponding, SwapErrorChannelBalanceTooLow, -} from "@domain/swap/errors" -import { SwapOutChecker } from "@domain/swap" -import { WalletCurrency, ZERO_SATS } from "@domain/shared" +} from "@/domain/swap/errors" +import { SwapOutChecker } from "@/domain/swap" +import { WalletCurrency, ZERO_SATS } from "@/domain/shared" -import { baseLogger } from "@services/logger" -import { LoopService } from "@services/loopd" -import { lndsBalances } from "@services/lnd/utils" +import { baseLogger } from "@/services/logger" +import { LoopService } from "@/services/loopd" +import { lndsBalances } from "@/services/lnd/utils" describe("Swap", () => { const activeLoopd = getActiveLoopd() diff --git a/core/api/test/legacy-integration/app/swap/swap-record-ledger-fee.spec.ts b/core/api/test/legacy-integration/app/swap/swap-record-ledger-fee.spec.ts index 8134e2e2fa..fa453bb108 100644 --- a/core/api/test/legacy-integration/app/swap/swap-record-ledger-fee.spec.ts +++ b/core/api/test/legacy-integration/app/swap/swap-record-ledger-fee.spec.ts @@ -1,6 +1,6 @@ -import { DuplicateError } from "@domain/errors" -import { SwapState, SwapType } from "@domain/swap" -import { admin as LedgerAdmin } from "@services/ledger/admin" +import { DuplicateError } from "@/domain/errors" +import { SwapState, SwapType } from "@/domain/swap" +import { admin as LedgerAdmin } from "@/services/ledger/admin" describe("Swap Record ledger Fee", () => { let entryId: LedgerTransactionId[] = [] diff --git a/core/api/test/legacy-integration/app/trigger/trigger.fn.spec.ts b/core/api/test/legacy-integration/app/trigger/trigger.fn.spec.ts index 7154d13e52..0973c96681 100644 --- a/core/api/test/legacy-integration/app/trigger/trigger.fn.spec.ts +++ b/core/api/test/legacy-integration/app/trigger/trigger.fn.spec.ts @@ -1,16 +1,16 @@ -import { getFeesConfig, ONCHAIN_MIN_CONFIRMATIONS } from "@config" +import { getFeesConfig, ONCHAIN_MIN_CONFIRMATIONS } from "@/config" -import { Wallets } from "@app" +import { Wallets } from "@/app" -import { TxStatus } from "@domain/wallets" -import { sat2btc, toSats } from "@domain/bitcoin" -import { paymentAmountFromNumber, WalletCurrency } from "@domain/shared" +import { TxStatus } from "@/domain/wallets" +import { sat2btc, toSats } from "@/domain/bitcoin" +import { paymentAmountFromNumber, WalletCurrency } from "@/domain/shared" -import { onchainBlockEventHandler } from "@servers/trigger" +import { onchainBlockEventHandler } from "@/servers/trigger" -import { baseLogger } from "@services/logger" +import { baseLogger } from "@/services/logger" -import { sleep } from "@utils" +import { sleep } from "@/utils" import { amountAfterFeeDeduction, diff --git a/core/api/test/legacy-integration/app/users/update-language.spec.ts b/core/api/test/legacy-integration/app/users/update-language.spec.ts index e6e8333406..7598cc0501 100644 --- a/core/api/test/legacy-integration/app/users/update-language.spec.ts +++ b/core/api/test/legacy-integration/app/users/update-language.spec.ts @@ -1,6 +1,6 @@ -import { Users } from "@app" -import { InvalidLanguageError } from "@domain/errors" -import { UsersRepository } from "@services/mongoose" +import { Users } from "@/app" +import { InvalidLanguageError } from "@/domain/errors" +import { UsersRepository } from "@/services/mongoose" import { createUserAndWalletFromPhone, getUserIdByPhone, randomPhone } from "test/helpers" diff --git a/core/api/test/legacy-integration/app/users/user-role.spec.ts b/core/api/test/legacy-integration/app/users/user-role.spec.ts index f3750ecbb1..7c98bff33b 100644 --- a/core/api/test/legacy-integration/app/users/user-role.spec.ts +++ b/core/api/test/legacy-integration/app/users/user-role.spec.ts @@ -1,4 +1,4 @@ -import { AccountsRepository } from "@services/mongoose" +import { AccountsRepository } from "@/services/mongoose" import { createUserAndWalletFromPhone, getUserIdByPhone } from "test/helpers" diff --git a/core/api/test/legacy-integration/app/users/user-wallets.spec.ts b/core/api/test/legacy-integration/app/users/user-wallets.spec.ts index b17f2b0d50..78db99abab 100644 --- a/core/api/test/legacy-integration/app/users/user-wallets.spec.ts +++ b/core/api/test/legacy-integration/app/users/user-wallets.spec.ts @@ -1,5 +1,5 @@ -import { WalletCurrency } from "@domain/shared" -import { AccountsRepository, WalletsRepository } from "@services/mongoose" +import { WalletCurrency } from "@/domain/shared" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" import { createAccount } from "test/helpers" diff --git a/core/api/test/legacy-integration/app/wallets/invoice.spec.ts b/core/api/test/legacy-integration/app/wallets/invoice.spec.ts index 678b491705..8d956927c4 100644 --- a/core/api/test/legacy-integration/app/wallets/invoice.spec.ts +++ b/core/api/test/legacy-integration/app/wallets/invoice.spec.ts @@ -1,19 +1,19 @@ -import { Wallets } from "@app" -import { addWallet } from "@app/accounts/add-wallet" +import { Wallets } from "@/app" +import { addWallet } from "@/app/accounts/add-wallet" import { getInvoiceCreateAttemptLimits, getInvoiceCreateForRecipientAttemptLimits, -} from "@config" -import { decodeInvoice } from "@domain/bitcoin/lightning" -import { toCents } from "@domain/fiat" +} from "@/config" +import { decodeInvoice } from "@/domain/bitcoin/lightning" +import { toCents } from "@/domain/fiat" import { InvoiceCreateForRecipientRateLimiterExceededError, InvoiceCreateRateLimiterExceededError, -} from "@domain/rate-limit/errors" -import { WalletCurrency } from "@domain/shared" -import { WalletType } from "@domain/wallets" -import { DealerPriceService } from "@services/dealer-price" -import { WalletInvoicesRepository } from "@services/mongoose" +} from "@/domain/rate-limit/errors" +import { WalletCurrency } from "@/domain/shared" +import { WalletType } from "@/domain/wallets" +import { DealerPriceService } from "@/services/dealer-price" +import { WalletInvoicesRepository } from "@/services/mongoose" import { createUserAndWalletFromPhone, diff --git a/core/api/test/legacy-integration/jest.config.js b/core/api/test/legacy-integration/jest.config.js index fb5eb3e2e0..7ac9d11343 100644 --- a/core/api/test/legacy-integration/jest.config.js +++ b/core/api/test/legacy-integration/jest.config.js @@ -12,16 +12,7 @@ module.exports = { setupFilesAfterEnv: ["/test/legacy-integration/jest.setup.js"], testEnvironment: "node", moduleNameMapper: { - "^@config$": ["src/config/index"], - "^@app$": ["src/app/index"], - "^@utils$": ["src/utils/index"], - - "^@core/(.*)$": ["src/core/$1"], - "^@app/(.*)$": ["src/app/$1"], - "^@domain/(.*)$": ["src/domain/$1"], - "^@services/(.*)$": ["src/services/$1"], - "^@servers/(.*)$": ["src/servers/$1"], - "^@graphql/(.*)$": ["src/graphql/$1"], - "^test/(.*)$": ["test/$1"], - }, + "^@/(.*)$": ["/src/$1"], + "^test/(.*)$": ["/test/$1"], + } } diff --git a/core/api/test/legacy-integration/jest.setup.js b/core/api/test/legacy-integration/jest.setup.js index 5203f1049e..850f9ee026 100644 --- a/core/api/test/legacy-integration/jest.setup.js +++ b/core/api/test/legacy-integration/jest.setup.js @@ -1,15 +1,15 @@ -const { disconnectAll } = require("@services/redis") -const { setupMongoConnection } = require("@services/mongodb") +const { disconnectAll } = require("@/services/redis") +const { setupMongoConnection } = require("@/services/mongodb") -jest.mock("@services/lnd/auth", () => { - const module = jest.requireActual("@services/lnd/auth") +jest.mock("@/services/lnd/auth", () => { + const module = jest.requireActual("@/services/lnd/auth") const lndsConnect = module.lndsConnect.map((p) => ({ ...p, active: true })) return { ...module, lndsConnect } }) -jest.mock("@app/prices/get-current-price", () => require("test/mocks/get-current-price")) -jest.mock("@services/twilio", () => require("test/mocks/twilio")) -jest.mock("@services/price", () => require("test/mocks/price")) +jest.mock("@/app/prices/get-current-price", () => require("test/mocks/get-current-price")) +jest.mock("@/services/twilio", () => require("test/mocks/twilio")) +jest.mock("@/services/price", () => require("test/mocks/price")) let mongoose diff --git a/core/api/test/legacy-integration/notifications/notification.spec.ts b/core/api/test/legacy-integration/notifications/notification.spec.ts index d5df3ccaea..efb1b3d506 100644 --- a/core/api/test/legacy-integration/notifications/notification.spec.ts +++ b/core/api/test/legacy-integration/notifications/notification.spec.ts @@ -1,24 +1,24 @@ -import { getRecentlyActiveAccounts } from "@app/accounts/active-accounts" -import { sendDefaultWalletBalanceToAccounts } from "@app/accounts/send-default-wallet-balance-to-users" +import { getRecentlyActiveAccounts } from "@/app/accounts/active-accounts" +import { sendDefaultWalletBalanceToAccounts } from "@/app/accounts/send-default-wallet-balance-to-users" -import { toSats } from "@domain/bitcoin" -import { UsdDisplayCurrency } from "@domain/fiat" -import { LedgerService } from "@services/ledger" -import * as serviceLedger from "@services/ledger" +import { toSats } from "@/domain/bitcoin" +import { UsdDisplayCurrency } from "@/domain/fiat" +import { LedgerService } from "@/services/ledger" +import * as serviceLedger from "@/services/ledger" import { WalletsRepository, UsersRepository, AccountsRepository, -} from "@services/mongoose" -import { createPushNotificationContent } from "@services/notifications/create-push-notification-content" -import * as PushNotificationsServiceImpl from "@services/notifications/push-notifications" -import { NotificationsService } from "@services/notifications" +} from "@/services/mongoose" +import { createPushNotificationContent } from "@/services/notifications/create-push-notification-content" +import * as PushNotificationsServiceImpl from "@/services/notifications/push-notifications" +import { NotificationsService } from "@/services/notifications" import { getCurrentPriceAsWalletPriceRatio, getCurrentPriceAsDisplayPriceRatio, -} from "@app/prices" -import { WalletCurrency } from "@domain/shared" -import { GaloyNotificationCategories } from "@domain/notifications" +} from "@/app/prices" +import { WalletCurrency } from "@/domain/shared" +import { GaloyNotificationCategories } from "@/domain/notifications" let spy let displayPriceRatios: Record> diff --git a/core/api/test/legacy-integration/notifications/push-notification.spec.ts b/core/api/test/legacy-integration/notifications/push-notification.spec.ts index bcc71a2e1a..4c7e4b1f71 100644 --- a/core/api/test/legacy-integration/notifications/push-notification.spec.ts +++ b/core/api/test/legacy-integration/notifications/push-notification.spec.ts @@ -1,7 +1,7 @@ import { PushNotificationsService, SendFilteredPushNotificationStatus, -} from "@services/notifications/push-notifications" +} from "@/services/notifications/push-notifications" describe("push notification", () => { it("should filter a notification", async () => { diff --git a/core/api/test/legacy-integration/services/cache/index.spec.ts b/core/api/test/legacy-integration/services/cache/index.spec.ts index 47aa31ee94..f0e310bd5d 100644 --- a/core/api/test/legacy-integration/services/cache/index.spec.ts +++ b/core/api/test/legacy-integration/services/cache/index.spec.ts @@ -1,11 +1,11 @@ import { createHash, randomBytes } from "crypto" -import { SECS_PER_10_MINS } from "@config" +import { SECS_PER_10_MINS } from "@/config" -import { toSats } from "@domain/bitcoin" -import { uniqueAddressesForTxn } from "@domain/bitcoin/onchain" +import { toSats } from "@/domain/bitcoin" +import { uniqueAddressesForTxn } from "@/domain/bitcoin/onchain" -import { RedisCacheService } from "@services/cache" +import { RedisCacheService } from "@/services/cache" const randomString = (length) => { const sha256 = (buffer: Buffer) => createHash("sha256").update(buffer).digest("hex") diff --git a/core/api/test/legacy-integration/services/dealer/hedge-price.spec.ts b/core/api/test/legacy-integration/services/dealer/hedge-price.spec.ts index 0812209aea..de0106a3e8 100644 --- a/core/api/test/legacy-integration/services/dealer/hedge-price.spec.ts +++ b/core/api/test/legacy-integration/services/dealer/hedge-price.spec.ts @@ -1,20 +1,24 @@ -import { Payments, Wallets } from "@app" -import { getMidPriceRatio } from "@app/prices" -import { getDealerConfig } from "@config" - -import { toSats } from "@domain/bitcoin" -import { toCents } from "@domain/fiat" -import { SubOneCentSatAmountForUsdSelfSendError } from "@domain/payments" -import { AmountCalculator, paymentAmountFromNumber, WalletCurrency } from "@domain/shared" -import { baseLogger } from "@services/logger" -import { AccountsRepository, WalletsRepository } from "@services/mongoose" +import { Payments, Wallets } from "@/app" +import { getMidPriceRatio } from "@/app/prices" +import { getDealerConfig } from "@/config" + +import { toSats } from "@/domain/bitcoin" +import { toCents } from "@/domain/fiat" +import { SubOneCentSatAmountForUsdSelfSendError } from "@/domain/payments" +import { + AmountCalculator, + paymentAmountFromNumber, + WalletCurrency, +} from "@/domain/shared" +import { baseLogger } from "@/services/logger" +import { AccountsRepository, WalletsRepository } from "@/services/mongoose" import { createAccount, fundWallet, getBalanceHelper } from "test/helpers" class ZeroAmountForUsdRecipientError extends Error {} -jest.mock("@config", () => { - const config = jest.requireActual("@config") +jest.mock("@/config", () => { + const config = jest.requireActual("@/config") return { ...config, getInvoiceCreateAttemptLimits: jest.fn().mockReturnValue({ diff --git a/core/api/test/legacy-integration/services/dealer/mid-price.spec.ts b/core/api/test/legacy-integration/services/dealer/mid-price.spec.ts index 64a2404946..5c0531d59d 100644 --- a/core/api/test/legacy-integration/services/dealer/mid-price.spec.ts +++ b/core/api/test/legacy-integration/services/dealer/mid-price.spec.ts @@ -1,7 +1,7 @@ -import { getCurrentPriceAsWalletPriceRatio, getMidPriceRatio } from "@app/prices" -import { UsdDisplayCurrency } from "@domain/fiat" +import { getCurrentPriceAsWalletPriceRatio, getMidPriceRatio } from "@/app/prices" +import { UsdDisplayCurrency } from "@/domain/fiat" -import { DealerPriceService } from "@services/dealer-price" +import { DealerPriceService } from "@/services/dealer-price" describe("getMidPriceRatio", () => { const fetchPrices = async () => { diff --git a/core/api/test/legacy-integration/services/ledger/facade.spec.ts b/core/api/test/legacy-integration/services/ledger/facade.spec.ts index f0307d6620..d6b5ff5cb7 100644 --- a/core/api/test/legacy-integration/services/ledger/facade.spec.ts +++ b/core/api/test/legacy-integration/services/ledger/facade.spec.ts @@ -1,19 +1,19 @@ /* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "testInternalTx", "testExternalTx"] }] */ import crypto from "crypto" -import { ONE_DAY } from "@config" +import { ONE_DAY } from "@/config" import { AmountCalculator, BtcWalletDescriptor, UsdWalletDescriptor, WalletCurrency, -} from "@domain/shared" -import { LedgerTransactionType } from "@domain/ledger" +} from "@/domain/shared" +import { LedgerTransactionType } from "@/domain/ledger" -import * as LedgerFacade from "@services/ledger/facade" +import * as LedgerFacade from "@/services/ledger/facade" -import { ModifiedSet, timestampDaysAgo } from "@utils" +import { ModifiedSet, timestampDaysAgo } from "@/utils" import { recordLnIntraLedgerPayment, diff --git a/core/api/test/legacy-integration/services/ledger/service.spec.ts b/core/api/test/legacy-integration/services/ledger/service.spec.ts index f0307d6620..d6b5ff5cb7 100644 --- a/core/api/test/legacy-integration/services/ledger/service.spec.ts +++ b/core/api/test/legacy-integration/services/ledger/service.spec.ts @@ -1,19 +1,19 @@ /* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "testInternalTx", "testExternalTx"] }] */ import crypto from "crypto" -import { ONE_DAY } from "@config" +import { ONE_DAY } from "@/config" import { AmountCalculator, BtcWalletDescriptor, UsdWalletDescriptor, WalletCurrency, -} from "@domain/shared" -import { LedgerTransactionType } from "@domain/ledger" +} from "@/domain/shared" +import { LedgerTransactionType } from "@/domain/ledger" -import * as LedgerFacade from "@services/ledger/facade" +import * as LedgerFacade from "@/services/ledger/facade" -import { ModifiedSet, timestampDaysAgo } from "@utils" +import { ModifiedSet, timestampDaysAgo } from "@/utils" import { recordLnIntraLedgerPayment, diff --git a/core/api/test/legacy-integration/services/lnd/health.spec.ts b/core/api/test/legacy-integration/services/lnd/health.spec.ts index b327e17e8d..d0e63a9b0a 100644 --- a/core/api/test/legacy-integration/services/lnd/health.spec.ts +++ b/core/api/test/legacy-integration/services/lnd/health.spec.ts @@ -1,6 +1,6 @@ -import { isUp, lndStatusEvent } from "@services/lnd/health" +import { isUp, lndStatusEvent } from "@/services/lnd/health" -import { lndsConnect } from "@services/lnd/auth" +import { lndsConnect } from "@/services/lnd/auth" import { clearAccountLocks } from "test/helpers/redis" diff --git a/core/api/test/legacy-integration/services/lnd/parse-errors.spec.ts b/core/api/test/legacy-integration/services/lnd/parse-errors.spec.ts index 7991ef8b3b..c963cd7ad2 100644 --- a/core/api/test/legacy-integration/services/lnd/parse-errors.spec.ts +++ b/core/api/test/legacy-integration/services/lnd/parse-errors.spec.ts @@ -1,6 +1,3 @@ -import { decodeInvoice } from "@domain/bitcoin/lightning" -import { getActiveLnd, parseLndErrorDetails } from "@services/lnd/config" - import { createInvoice, payViaPaymentDetails, @@ -8,6 +5,9 @@ import { LightningError as LnError, } from "lightning" +import { decodeInvoice } from "@/domain/bitcoin/lightning" +import { getActiveLnd, parseLndErrorDetails } from "@/services/lnd/config" + import { getError, lndOutside1 } from "test/helpers" describe("'lightning' library error handling", () => { diff --git a/core/api/test/legacy-integration/services/lnd/utils.spec.ts b/core/api/test/legacy-integration/services/lnd/utils.spec.ts index 2bc7c4d5a3..600885b8ef 100644 --- a/core/api/test/legacy-integration/services/lnd/utils.spec.ts +++ b/core/api/test/legacy-integration/services/lnd/utils.spec.ts @@ -1,10 +1,10 @@ -import { MS_PER_DAY, ONE_DAY } from "@config" -import { deleteExpiredWalletInvoice, updateRoutingRevenues } from "@services/lnd/utils" -import { baseLogger } from "@services/logger" -import { ledgerAdmin } from "@services/mongodb" -import { DbMetadata, WalletInvoice } from "@services/mongoose/schema" +import { MS_PER_DAY, ONE_DAY } from "@/config" +import { deleteExpiredWalletInvoice, updateRoutingRevenues } from "@/services/lnd/utils" +import { baseLogger } from "@/services/logger" +import { ledgerAdmin } from "@/services/mongodb" +import { DbMetadata, WalletInvoice } from "@/services/mongoose/schema" -import { sleep, timestampDaysAgo } from "@utils" +import { sleep, timestampDaysAgo } from "@/utils" import { cancelHodlInvoice, diff --git a/core/api/test/legacy-integration/services/lock.spec.ts b/core/api/test/legacy-integration/services/lock.spec.ts index ebff9af59c..5a1ee16b70 100644 --- a/core/api/test/legacy-integration/services/lock.spec.ts +++ b/core/api/test/legacy-integration/services/lock.spec.ts @@ -1,9 +1,9 @@ -import { sleep } from "@utils" -import { LockService, redlock } from "@services/lock" +import { sleep } from "@/utils" +import { LockService, redlock } from "@/services/lock" -import { redis } from "@services/redis" -import { baseLogger } from "@services/logger" -import { ResourceAttemptsRedlockServiceError } from "@domain/lock" +import { redis } from "@/services/redis" +import { baseLogger } from "@/services/logger" +import { ResourceAttemptsRedlockServiceError } from "@/domain/lock" describe("Lock", () => { describe("lockWalletId", () => { diff --git a/core/api/test/legacy-integration/services/mongoose/user-repository.spec.ts b/core/api/test/legacy-integration/services/mongoose/user-repository.spec.ts index c3705eae87..a54b8331af 100644 --- a/core/api/test/legacy-integration/services/mongoose/user-repository.spec.ts +++ b/core/api/test/legacy-integration/services/mongoose/user-repository.spec.ts @@ -1,5 +1,5 @@ -import { DuplicateKeyForPersistError } from "@domain/errors" -import { UsersRepository } from "@services/mongoose" +import { DuplicateKeyForPersistError } from "@/domain/errors" +import { UsersRepository } from "@/services/mongoose" import { randomUserId, randomPhone } from "test/helpers" diff --git a/core/api/test/legacy-integration/services/mongoose/wallet-invoices.spec.ts b/core/api/test/legacy-integration/services/mongoose/wallet-invoices.spec.ts index 874dd46d48..df5a9784f1 100644 --- a/core/api/test/legacy-integration/services/mongoose/wallet-invoices.spec.ts +++ b/core/api/test/legacy-integration/services/mongoose/wallet-invoices.spec.ts @@ -1,8 +1,8 @@ import crypto from "crypto" -import { WalletCurrency } from "@domain/shared" -import { getSecretAndPaymentHash } from "@domain/bitcoin/lightning" -import { WalletInvoicesRepository } from "@services/mongoose" +import { WalletCurrency } from "@/domain/shared" +import { getSecretAndPaymentHash } from "@/domain/bitcoin/lightning" +import { WalletInvoicesRepository } from "@/services/mongoose" import { createUserAndWalletFromPhone, randomPhone } from "test/helpers" diff --git a/core/api/test/legacy-integration/services/mongoose/wallet-onchain-pending-receive.spec.ts b/core/api/test/legacy-integration/services/mongoose/wallet-onchain-pending-receive.spec.ts index c70011d19b..acda3bee17 100644 --- a/core/api/test/legacy-integration/services/mongoose/wallet-onchain-pending-receive.spec.ts +++ b/core/api/test/legacy-integration/services/mongoose/wallet-onchain-pending-receive.spec.ts @@ -1,12 +1,12 @@ -import { UsdDisplayCurrency } from "@domain/fiat" -import { WalletCurrency } from "@domain/shared" +import { UsdDisplayCurrency } from "@/domain/fiat" +import { WalletCurrency } from "@/domain/shared" import { CouldNotFindWalletOnChainPendingReceiveError, UnknownRepositoryError, -} from "@domain/errors" +} from "@/domain/errors" -import { WalletOnChainPendingReceiveRepository } from "@services/mongoose" -import { WalletOnChainPendingReceive } from "@services/mongoose/schema" +import { WalletOnChainPendingReceiveRepository } from "@/services/mongoose" +import { WalletOnChainPendingReceive } from "@/services/mongoose/schema" import { generateHash } from "test/helpers" diff --git a/core/api/test/mocks/get-current-price.ts b/core/api/test/mocks/get-current-price.ts index 708426e283..a72bfdf296 100644 --- a/core/api/test/mocks/get-current-price.ts +++ b/core/api/test/mocks/get-current-price.ts @@ -1,5 +1,5 @@ -import { getCurrencyMajorExponent } from "@domain/fiat" -import { toDisplayPriceRatio, toWalletPriceRatio } from "@domain/payments" +import { getCurrencyMajorExponent } from "@/domain/fiat" +import { toDisplayPriceRatio, toWalletPriceRatio } from "@/domain/payments" export const getCurrentSatPrice = async ({ currency, diff --git a/core/api/test/mocks/price.ts b/core/api/test/mocks/price.ts index 55e7a45fbb..8a7fe08054 100644 --- a/core/api/test/mocks/price.ts +++ b/core/api/test/mocks/price.ts @@ -1,4 +1,4 @@ -import { NotImplementedError } from "@domain/errors" +import { NotImplementedError } from "@/domain/errors" export const PriceService = (): IPriceService => { return { diff --git a/core/api/test/mocks/twilio.ts b/core/api/test/mocks/twilio.ts index 71b1edf85c..5ca8a08d0a 100644 --- a/core/api/test/mocks/twilio.ts +++ b/core/api/test/mocks/twilio.ts @@ -1,4 +1,4 @@ -import { yamlConfig } from "@config" +import { yamlConfig } from "@/config" export const TwilioClient = () => { const initiateVerify = async () => { diff --git a/core/api/test/unit/app/auth/auth-test-checker.ts b/core/api/test/unit/app/auth/auth-test-checker.ts index 661c92dc94..cd652ca1ca 100644 --- a/core/api/test/unit/app/auth/auth-test-checker.ts +++ b/core/api/test/unit/app/auth/auth-test-checker.ts @@ -1,5 +1,5 @@ -import { getTestAccounts } from "@config" -import { TestAccountsChecker } from "@domain/accounts/test-accounts-checker" +import { getTestAccounts } from "@/config" +import { TestAccountsChecker } from "@/domain/accounts/test-accounts-checker" describe("test-accounts", () => { const testAccounts = getTestAccounts() diff --git a/core/api/test/unit/app/payments/translations.spec.ts b/core/api/test/unit/app/payments/translations.spec.ts index d0124f3199..550ced64c4 100644 --- a/core/api/test/unit/app/payments/translations.spec.ts +++ b/core/api/test/unit/app/payments/translations.spec.ts @@ -1,14 +1,14 @@ -import { toSats } from "@domain/bitcoin" -import { toCents } from "@domain/fiat" -import { LedgerTransactionType } from "@domain/ledger" +import { toSats } from "@/domain/bitcoin" +import { toCents } from "@/domain/fiat" +import { LedgerTransactionType } from "@/domain/ledger" import { MissingPropsInTransactionForPaymentFlowError, NonLnPaymentTransactionForPaymentFlowError, -} from "@domain/payments" -import { WalletCurrency } from "@domain/shared" -import { PaymentInitiationMethod, SettlementMethod } from "@domain/wallets" +} from "@/domain/payments" +import { WalletCurrency } from "@/domain/shared" +import { PaymentInitiationMethod, SettlementMethod } from "@/domain/wallets" -import { PaymentFlowFromLedgerTransaction } from "@app/payments/translations" +import { PaymentFlowFromLedgerTransaction } from "@/app/payments/translations" describe("PaymentFlowFromLedgerTransaction", () => { const satsAmount = toSats(20_000) diff --git a/core/api/test/unit/app/prices/get-current-price.spec.ts b/core/api/test/unit/app/prices/get-current-price.spec.ts index 787e7955be..9d9583bbd9 100644 --- a/core/api/test/unit/app/prices/get-current-price.spec.ts +++ b/core/api/test/unit/app/prices/get-current-price.spec.ts @@ -1,12 +1,12 @@ -import { CacheKeys } from "@domain/cache" -import { UsdDisplayCurrency } from "@domain/fiat" -import { PriceNotAvailableError } from "@domain/price" +import { CacheKeys } from "@/domain/cache" +import { UsdDisplayCurrency } from "@/domain/fiat" +import { PriceNotAvailableError } from "@/domain/price" -import * as PriceServiceImpl from "@services/price" -import { LocalCacheService } from "@services/cache/local-cache" -import { getCurrentSatPrice, getCurrentUsdCentPrice } from "@app/prices" +import * as PriceServiceImpl from "@/services/price" +import { LocalCacheService } from "@/services/cache/local-cache" +import { getCurrentSatPrice, getCurrentUsdCentPrice } from "@/app/prices" -jest.mock("@services/tracing", () => ({ +jest.mock("@/services/tracing", () => ({ wrapAsyncFunctionsToRunInSpan: ({ fns }) => fns, })) diff --git a/core/api/test/unit/app/prices/get-price-history.spec.ts b/core/api/test/unit/app/prices/get-price-history.spec.ts index 8485108fea..77047694b5 100644 --- a/core/api/test/unit/app/prices/get-price-history.spec.ts +++ b/core/api/test/unit/app/prices/get-price-history.spec.ts @@ -3,12 +3,12 @@ import { PriceInterval, PriceRange, UnknownPriceServiceError, -} from "@domain/price" -import { CacheKeys } from "@domain/cache" -import * as PriceServiceImpl from "@services/price" -import { LocalCacheService } from "@services/cache/local-cache" +} from "@/domain/price" +import { CacheKeys } from "@/domain/cache" +import * as PriceServiceImpl from "@/services/price" +import { LocalCacheService } from "@/services/cache/local-cache" -import { getPriceHistory } from "@app/prices" +import { getPriceHistory } from "@/app/prices" import { generateSatoshiPriceHistory } from "test/helpers/price" @@ -18,7 +18,7 @@ beforeEach(async () => { }) }) -jest.mock("@services/tracing", () => ({ +jest.mock("@/services/tracing", () => ({ wrapAsyncFunctionsToRunInSpan: ({ fns }) => fns, })) diff --git a/core/api/test/unit/app/prices/list-currencies.spec.ts b/core/api/test/unit/app/prices/list-currencies.spec.ts index 31157b5e0d..7286a85137 100644 --- a/core/api/test/unit/app/prices/list-currencies.spec.ts +++ b/core/api/test/unit/app/prices/list-currencies.spec.ts @@ -1,10 +1,10 @@ -import { CacheKeys } from "@domain/cache" -import * as PriceServiceImpl from "@services/price" -import { LocalCacheService } from "@services/cache/local-cache" -import { PriceCurrenciesNotAvailableError } from "@domain/price" -import { listCurrencies } from "@app/prices" +import { CacheKeys } from "@/domain/cache" +import * as PriceServiceImpl from "@/services/price" +import { LocalCacheService } from "@/services/cache/local-cache" +import { PriceCurrenciesNotAvailableError } from "@/domain/price" +import { listCurrencies } from "@/app/prices" -jest.mock("@services/tracing", () => ({ +jest.mock("@/services/tracing", () => ({ wrapAsyncFunctionsToRunInSpan: ({ fns }) => fns, })) diff --git a/core/api/test/unit/config.spec.ts b/core/api/test/unit/config.spec.ts index 09c75047a7..47543a3550 100644 --- a/core/api/test/unit/config.spec.ts +++ b/core/api/test/unit/config.spec.ts @@ -1,12 +1,13 @@ import fs from "fs" -import { configSchema, getAccountLimits, yamlConfig } from "@config" -import { toCents } from "@domain/fiat" import Ajv from "ajv" import yaml from "js-yaml" import mergeWith from "lodash.mergewith" +import { toCents } from "@/domain/fiat" +import { configSchema, getAccountLimits, yamlConfig } from "@/config" + const ajv = new Ajv() let validate diff --git a/core/api/test/unit/domain/accounts-ips/index.spec.ts b/core/api/test/unit/domain/accounts-ips/index.spec.ts index e00fc9951f..bd396fd1c3 100644 --- a/core/api/test/unit/domain/accounts-ips/index.spec.ts +++ b/core/api/test/unit/domain/accounts-ips/index.spec.ts @@ -1,4 +1,4 @@ -import { isPrivateIp } from "@domain/accounts-ips" +import { isPrivateIp } from "@/domain/accounts-ips" describe("isPrivateIp", () => { it("check ipv6 private address validation", () => { diff --git a/core/api/test/unit/domain/accounts/limits-checker.spec.ts b/core/api/test/unit/domain/accounts/limits-checker.spec.ts index ec4350f332..171fb69284 100644 --- a/core/api/test/unit/domain/accounts/limits-checker.spec.ts +++ b/core/api/test/unit/domain/accounts/limits-checker.spec.ts @@ -1,11 +1,11 @@ -import { getAccountLimits } from "@config" -import { AccountTxVolumeLimitChecker } from "@domain/accounts" +import { getAccountLimits } from "@/config" +import { AccountTxVolumeLimitChecker } from "@/domain/accounts" import { IntraledgerLimitsExceededError, TradeIntraAccountLimitsExceededError, WithdrawalLimitsExceededError, -} from "@domain/errors" -import { AmountCalculator, WalletCurrency } from "@domain/shared" +} from "@/domain/errors" +import { AmountCalculator, WalletCurrency } from "@/domain/shared" let usdPaymentAmount: UsdPaymentAmount let accountLimits: IAccountLimits diff --git a/core/api/test/unit/domain/accounts/limits-volume.spec.ts b/core/api/test/unit/domain/accounts/limits-volume.spec.ts index 31b5e8a13f..b13eef2ffc 100644 --- a/core/api/test/unit/domain/accounts/limits-volume.spec.ts +++ b/core/api/test/unit/domain/accounts/limits-volume.spec.ts @@ -1,6 +1,6 @@ -import { getAccountLimits } from "@config" -import { AccountTxVolumeRemaining } from "@domain/accounts" -import { WalletPriceRatio } from "@domain/payments" +import { getAccountLimits } from "@/config" +import { AccountTxVolumeRemaining } from "@/domain/accounts" +import { WalletPriceRatio } from "@/domain/payments" import { AmountCalculator, ONE_CENT, @@ -8,7 +8,7 @@ import { ZERO_CENTS, ZERO_SATS, paymentAmountFromNumber, -} from "@domain/shared" +} from "@/domain/shared" const calc = AmountCalculator() diff --git a/core/api/test/unit/domain/accounts/new-account.ts b/core/api/test/unit/domain/accounts/new-account.ts index e009f98510..6bb9889cca 100644 --- a/core/api/test/unit/domain/accounts/new-account.ts +++ b/core/api/test/unit/domain/accounts/new-account.ts @@ -1,5 +1,5 @@ -import { Account } from "@services/mongoose/schema" -import { getDefaultAccountsConfig } from "@config" +import { Account } from "@/services/mongoose/schema" +import { getDefaultAccountsConfig } from "@/config" describe("New Account", () => { it("uses the default account status", async () => { diff --git a/core/api/test/unit/domain/authentication/index.spec.ts b/core/api/test/unit/domain/authentication/index.spec.ts index 02c86866c9..83b9d8b252 100644 --- a/core/api/test/unit/domain/authentication/index.spec.ts +++ b/core/api/test/unit/domain/authentication/index.spec.ts @@ -1,4 +1,4 @@ -import { getSupportedCountries } from "@domain/authentication" +import { getSupportedCountries } from "@/domain/authentication" describe("getSupportedCountries", () => { it("returns supported countries", () => { diff --git a/core/api/test/unit/domain/authentication/registration-payload-validator.spec.ts b/core/api/test/unit/domain/authentication/registration-payload-validator.spec.ts index 21b51b043c..310bffce3f 100644 --- a/core/api/test/unit/domain/authentication/registration-payload-validator.spec.ts +++ b/core/api/test/unit/domain/authentication/registration-payload-validator.spec.ts @@ -1,11 +1,11 @@ import { MissingRegistrationPayloadPropertiesError, UnsupportedSchemaTypeError, -} from "@domain/authentication/errors" -import { RegistrationPayloadValidator } from "@domain/authentication/registration-payload-validator" -import { InvalidPhoneNumber, InvalidUserId } from "@domain/errors" +} from "@/domain/authentication/errors" +import { RegistrationPayloadValidator } from "@/domain/authentication/registration-payload-validator" +import { InvalidPhoneNumber, InvalidUserId } from "@/domain/errors" -import { SchemaIdType } from "@services/kratos" +import { SchemaIdType } from "@/services/kratos" import { randomPhone, randomUserId } from "test/helpers/random" diff --git a/core/api/test/unit/domain/authentication/secret-validator.spec.ts b/core/api/test/unit/domain/authentication/secret-validator.spec.ts index 2b1280fd6e..8f4a98b5d7 100644 --- a/core/api/test/unit/domain/authentication/secret-validator.spec.ts +++ b/core/api/test/unit/domain/authentication/secret-validator.spec.ts @@ -1,8 +1,8 @@ import { InvalidSecretForAuthNCallbackError, MissingSecretForAuthNCallbackError, -} from "@domain/authentication/errors" -import { CallbackSecretValidator } from "@domain/authentication/secret-validator" +} from "@/domain/authentication/errors" +import { CallbackSecretValidator } from "@/domain/authentication/secret-validator" const DUMMY_CALLBACK_API_KEY = "dummy-callback-api-key" diff --git a/core/api/test/unit/domain/bitcoin/checked-to-sats.spec.ts b/core/api/test/unit/domain/bitcoin/checked-to-sats.spec.ts index fe0c752b4e..5d04bead56 100644 --- a/core/api/test/unit/domain/bitcoin/checked-to-sats.spec.ts +++ b/core/api/test/unit/domain/bitcoin/checked-to-sats.spec.ts @@ -1,5 +1,5 @@ -import { checkedToSats } from "@domain/bitcoin" -import { MAX_SATS } from "@domain/shared" +import { checkedToSats } from "@/domain/bitcoin" +import { MAX_SATS } from "@/domain/shared" describe("sats-amount-check", () => { it("Positive amount value for satoshis passes", () => { diff --git a/core/api/test/unit/domain/bitcoin/lightning/invoice-expiration.spec.ts b/core/api/test/unit/domain/bitcoin/lightning/invoice-expiration.spec.ts index 0ad37308f9..88b9a95842 100644 --- a/core/api/test/unit/domain/bitcoin/lightning/invoice-expiration.spec.ts +++ b/core/api/test/unit/domain/bitcoin/lightning/invoice-expiration.spec.ts @@ -1,8 +1,8 @@ -import { SECS_PER_10_MINS, SECS_PER_DAY } from "@config" +import { SECS_PER_10_MINS, SECS_PER_DAY } from "@/config" -import { toSeconds } from "@domain/primitives" -import { WalletCurrency } from "@domain/shared" -import { invoiceExpirationForCurrency } from "@domain/bitcoin/lightning" +import { toSeconds } from "@/domain/primitives" +import { WalletCurrency } from "@/domain/shared" +import { invoiceExpirationForCurrency } from "@/domain/bitcoin/lightning" describe("invoiceExpirationForCurrency", () => { const BTC = WalletCurrency.Btc diff --git a/core/api/test/unit/domain/bitcoin/lightning/ln-invoice.spec.ts b/core/api/test/unit/domain/bitcoin/lightning/ln-invoice.spec.ts index 2247805a50..16b0e9cd16 100644 --- a/core/api/test/unit/domain/bitcoin/lightning/ln-invoice.spec.ts +++ b/core/api/test/unit/domain/bitcoin/lightning/ln-invoice.spec.ts @@ -1,5 +1,5 @@ -import { LnInvoiceDecodeError, decodeInvoice } from "@domain/bitcoin/lightning" -import { toSats } from "@domain/bitcoin" +import { LnInvoiceDecodeError, decodeInvoice } from "@/domain/bitcoin/lightning" +import { toSats } from "@/domain/bitcoin" describe("decodeInvoice", () => { const validBolt11Invoice = diff --git a/core/api/test/unit/domain/bitcoin/onchain/checked-to-on-chain-address.spec.ts b/core/api/test/unit/domain/bitcoin/onchain/checked-to-on-chain-address.spec.ts index 5623936713..097273826d 100644 --- a/core/api/test/unit/domain/bitcoin/onchain/checked-to-on-chain-address.spec.ts +++ b/core/api/test/unit/domain/bitcoin/onchain/checked-to-on-chain-address.spec.ts @@ -1,6 +1,6 @@ -import { BtcNetwork } from "@domain/bitcoin" -import { checkedToOnChainAddress } from "@domain/bitcoin/onchain" -import { InvalidOnChainAddress } from "@domain/errors" +import { BtcNetwork } from "@/domain/bitcoin" +import { checkedToOnChainAddress } from "@/domain/bitcoin/onchain" +import { InvalidOnChainAddress } from "@/domain/errors" const addresses = [ { network: "mainnet", address: "17sELMebjQNf1k1CRucF67QAtegNsTjXUn" }, diff --git a/core/api/test/unit/domain/bitcoin/onchain/incoming-tx-handler.spec.ts b/core/api/test/unit/domain/bitcoin/onchain/incoming-tx-handler.spec.ts index cc1872f9a5..bbe9e2fc93 100644 --- a/core/api/test/unit/domain/bitcoin/onchain/incoming-tx-handler.spec.ts +++ b/core/api/test/unit/domain/bitcoin/onchain/incoming-tx-handler.spec.ts @@ -1,6 +1,6 @@ -import { toSats } from "@domain/bitcoin" -import { IncomingOnChainTxHandler } from "@domain/bitcoin/onchain/incoming-tx-handler" -import { WalletCurrency } from "@domain/shared" +import { toSats } from "@/domain/bitcoin" +import { IncomingOnChainTxHandler } from "@/domain/bitcoin/onchain/incoming-tx-handler" +import { WalletCurrency } from "@/domain/shared" describe("handleIncomingOnChainTransactions", () => { const balancesByKey = (amountsByKey: { diff --git a/core/api/test/unit/domain/bitcoin/onchain/rebalance-checker.spec.ts b/core/api/test/unit/domain/bitcoin/onchain/rebalance-checker.spec.ts index 6c47beb99a..600c70bd08 100644 --- a/core/api/test/unit/domain/bitcoin/onchain/rebalance-checker.spec.ts +++ b/core/api/test/unit/domain/bitcoin/onchain/rebalance-checker.spec.ts @@ -1,5 +1,5 @@ -import { toSats } from "@domain/bitcoin" -import { RebalanceChecker } from "@domain/bitcoin/onchain" +import { toSats } from "@/domain/bitcoin" +import { RebalanceChecker } from "@/domain/bitcoin/onchain" describe("RebalanceChecker", () => { it("returns the amount that should be rebalanced", async () => { diff --git a/core/api/test/unit/domain/bitcoin/onchain/tx-decoder.spec.ts b/core/api/test/unit/domain/bitcoin/onchain/tx-decoder.spec.ts index dbaf81fd31..49365ef964 100644 --- a/core/api/test/unit/domain/bitcoin/onchain/tx-decoder.spec.ts +++ b/core/api/test/unit/domain/bitcoin/onchain/tx-decoder.spec.ts @@ -1,5 +1,5 @@ -import { TxDecoder, TransactionDecodeError } from "@domain/bitcoin/onchain" -import { toSats } from "@domain/bitcoin" +import { TxDecoder, TransactionDecodeError } from "@/domain/bitcoin/onchain" +import { toSats } from "@/domain/bitcoin" describe("decodeOnChainTransaction", () => { it("decodes a tx hex", () => { diff --git a/core/api/test/unit/domain/bitcoin/onchain/tx-filter.spec.ts b/core/api/test/unit/domain/bitcoin/onchain/tx-filter.spec.ts index f89a29b53b..d7a074190e 100644 --- a/core/api/test/unit/domain/bitcoin/onchain/tx-filter.spec.ts +++ b/core/api/test/unit/domain/bitcoin/onchain/tx-filter.spec.ts @@ -1,5 +1,5 @@ -import { toSats } from "@domain/bitcoin" -import { TxFilter, IncomingOnChainTransaction } from "@domain/bitcoin/onchain" +import { toSats } from "@/domain/bitcoin" +import { TxFilter, IncomingOnChainTransaction } from "@/domain/bitcoin/onchain" describe("TxFilter", () => { it("filters greater than equal to confs", () => { diff --git a/core/api/test/unit/domain/errors.spec.ts b/core/api/test/unit/domain/errors.spec.ts index 5a09adf2ba..73f3f383d4 100644 --- a/core/api/test/unit/domain/errors.spec.ts +++ b/core/api/test/unit/domain/errors.spec.ts @@ -1,4 +1,4 @@ -import { ValidationError } from "@domain/shared" +import { ValidationError } from "@/domain/shared" import { CouldNotFindError, @@ -6,7 +6,7 @@ import { UnknownRepositoryError, InvalidSatoshiAmountError, InvalidWalletId, -} from "@domain/errors" +} from "@/domain/errors" describe("errors.ts", () => { it("validate that repository errors are valid errors", () => { diff --git a/core/api/test/unit/domain/fiat/display-amounts-converter.spec.ts b/core/api/test/unit/domain/fiat/display-amounts-converter.spec.ts index 3191c1ed2d..6a72f4184c 100644 --- a/core/api/test/unit/domain/fiat/display-amounts-converter.spec.ts +++ b/core/api/test/unit/domain/fiat/display-amounts-converter.spec.ts @@ -1,7 +1,7 @@ -import { DisplayAmountsConverter, UsdDisplayCurrency } from "@domain/fiat" +import { DisplayAmountsConverter, UsdDisplayCurrency } from "@/domain/fiat" -import { WalletCurrency, ZERO_CENTS, ZERO_SATS } from "@domain/shared" -import { DisplayPriceRatio } from "@domain/payments" +import { WalletCurrency, ZERO_CENTS, ZERO_SATS } from "@/domain/shared" +import { DisplayPriceRatio } from "@/domain/payments" describe("DisplayAmountsConverter", () => { const amounts: AmountsAndFees = { diff --git a/core/api/test/unit/domain/ledger/activity-checker.spec.ts b/core/api/test/unit/domain/ledger/activity-checker.spec.ts index dd1ba68705..0b1db9387a 100644 --- a/core/api/test/unit/domain/ledger/activity-checker.spec.ts +++ b/core/api/test/unit/domain/ledger/activity-checker.spec.ts @@ -1,7 +1,7 @@ -import { toCents } from "@domain/fiat" -import { ActivityChecker } from "@domain/ledger/activity-checker" -import { WalletPriceRatio } from "@domain/payments" -import { WalletCurrency } from "@domain/shared" +import { toCents } from "@/domain/fiat" +import { ActivityChecker } from "@/domain/ledger/activity-checker" +import { WalletPriceRatio } from "@/domain/payments" +import { WalletCurrency } from "@/domain/shared" let btcWallet: Wallet, usdWallet: Wallet diff --git a/core/api/test/unit/domain/ledger/fee-reimbursement.spec.ts b/core/api/test/unit/domain/ledger/fee-reimbursement.spec.ts index 8bb353f5b8..ebb2662915 100644 --- a/core/api/test/unit/domain/ledger/fee-reimbursement.spec.ts +++ b/core/api/test/unit/domain/ledger/fee-reimbursement.spec.ts @@ -1,7 +1,7 @@ -import { FeeDifferenceError } from "@domain/ledger" -import { FeeReimbursement } from "@domain/ledger/fee-reimbursement" -import { WalletPriceRatio } from "@domain/payments" -import { WalletCurrency } from "@domain/shared" +import { FeeDifferenceError } from "@/domain/ledger" +import { FeeReimbursement } from "@/domain/ledger/fee-reimbursement" +import { WalletPriceRatio } from "@/domain/payments" +import { WalletCurrency } from "@/domain/shared" describe("FeeReimbursement", () => { it("returns a fee difference for reimbursement", () => { diff --git a/core/api/test/unit/domain/ledger/imbalance-calculator.spec.ts b/core/api/test/unit/domain/ledger/imbalance-calculator.spec.ts index df98ec2847..e7390050cd 100644 --- a/core/api/test/unit/domain/ledger/imbalance-calculator.spec.ts +++ b/core/api/test/unit/domain/ledger/imbalance-calculator.spec.ts @@ -1,7 +1,7 @@ -import { ONE_DAY } from "@config" -import { ImbalanceCalculator } from "@domain/ledger/imbalance-calculator" -import { BtcPaymentAmount, WalletCurrency, ZERO_SATS } from "@domain/shared" -import { WithdrawalFeePriceMethod } from "@domain/wallets" +import { ONE_DAY } from "@/config" +import { ImbalanceCalculator } from "@/domain/ledger/imbalance-calculator" +import { BtcPaymentAmount, WalletCurrency, ZERO_SATS } from "@/domain/shared" +import { WithdrawalFeePriceMethod } from "@/domain/wallets" const btcWallet: Wallet = { id: "walletId" as WalletId, diff --git a/core/api/test/unit/domain/ledger/index.spec.ts b/core/api/test/unit/domain/ledger/index.spec.ts index 35f043483f..5d22f573af 100644 --- a/core/api/test/unit/domain/ledger/index.spec.ts +++ b/core/api/test/unit/domain/ledger/index.spec.ts @@ -1,6 +1,6 @@ -import { LedgerTransactionType, liabilitiesMainAccount } from "@domain/ledger" -import { translateToLedgerTx } from "@services/ledger" -import { toObjectId } from "@services/mongoose/utils" +import { LedgerTransactionType, liabilitiesMainAccount } from "@/domain/ledger" +import { translateToLedgerTx } from "@/services/ledger" +import { toObjectId } from "@/services/mongoose/utils" describe("LedgerService", () => { it("translates ILedgerTransaction to LedgerTransaction", () => { diff --git a/core/api/test/unit/domain/notifications/index.spec.ts b/core/api/test/unit/domain/notifications/index.spec.ts index 76d9d3b23f..b92ec82a31 100644 --- a/core/api/test/unit/domain/notifications/index.spec.ts +++ b/core/api/test/unit/domain/notifications/index.spec.ts @@ -4,7 +4,7 @@ import { enableNotificationChannel, disableNotificationChannel, shouldSendNotification, -} from "@domain/notifications" +} from "@/domain/notifications" describe("Notifications - push notification filtering", () => { describe("shouldSendPushNotification", () => { diff --git a/core/api/test/unit/domain/payments/index.spec.ts b/core/api/test/unit/domain/payments/index.spec.ts index 2aecb51193..8449a8955f 100644 --- a/core/api/test/unit/domain/payments/index.spec.ts +++ b/core/api/test/unit/domain/payments/index.spec.ts @@ -8,7 +8,7 @@ import { checkedToUsdPaymentAmount, InvalidBtcPaymentAmountError, InvalidUsdPaymentAmountError, -} from "@domain/shared" +} from "@/domain/shared" describe("checkedToBtcPaymentAmount", () => { it("errors on null", () => { diff --git a/core/api/test/unit/domain/payments/ln-fees.spec.ts b/core/api/test/unit/domain/payments/ln-fees.spec.ts index 5f9abf5e03..1fe0fe07e7 100644 --- a/core/api/test/unit/domain/payments/ln-fees.spec.ts +++ b/core/api/test/unit/domain/payments/ln-fees.spec.ts @@ -1,6 +1,6 @@ -import { AmountCalculator, ONE_CENT, ONE_SAT, WalletCurrency } from "@domain/shared" -import { LnFees, WalletPriceRatio } from "@domain/payments" -import { MaxFeeTooLargeForRoutelessPaymentError } from "@domain/bitcoin/lightning" +import { AmountCalculator, ONE_CENT, ONE_SAT, WalletCurrency } from "@/domain/shared" +import { LnFees, WalletPriceRatio } from "@/domain/payments" +import { MaxFeeTooLargeForRoutelessPaymentError } from "@/domain/bitcoin/lightning" const calc = AmountCalculator() diff --git a/core/api/test/unit/domain/payments/price-ratio.spec.ts b/core/api/test/unit/domain/payments/price-ratio.spec.ts index b54ebb2d69..a11176b832 100644 --- a/core/api/test/unit/domain/payments/price-ratio.spec.ts +++ b/core/api/test/unit/domain/payments/price-ratio.spec.ts @@ -1,4 +1,4 @@ -import { WalletCurrency } from "@domain/shared" +import { WalletCurrency } from "@/domain/shared" import { DisplayPriceRatio, InvalidZeroAmountPriceRatioInputError, @@ -6,8 +6,8 @@ import { toDisplayPriceRatio, toWalletPriceRatio, WalletPriceRatio, -} from "@domain/payments" -import { UsdDisplayCurrency } from "@domain/fiat" +} from "@/domain/payments" +import { UsdDisplayCurrency } from "@/domain/fiat" describe("PriceRatio", () => { const otherQuoteAmount = 100n diff --git a/core/api/test/unit/domain/routes/key-factory.spec.ts b/core/api/test/unit/domain/routes/key-factory.spec.ts index 01214dc6ab..c0601c6791 100644 --- a/core/api/test/unit/domain/routes/key-factory.spec.ts +++ b/core/api/test/unit/domain/routes/key-factory.spec.ts @@ -1,6 +1,6 @@ -import { toMilliSatsFromNumber } from "@domain/bitcoin" -import { toCents } from "@domain/fiat" -import { CachedRouteLookupKeyFactory } from "@domain/routes/key-factory" +import { toMilliSatsFromNumber } from "@/domain/bitcoin" +import { toCents } from "@/domain/fiat" +import { CachedRouteLookupKeyFactory } from "@/domain/routes/key-factory" describe("cached route key generator", () => { it("generated a valid key for msats", () => { diff --git a/core/api/test/unit/domain/shared/amount-calculator.spec.ts b/core/api/test/unit/domain/shared/amount-calculator.spec.ts index ce1978f5c3..734df9548c 100644 --- a/core/api/test/unit/domain/shared/amount-calculator.spec.ts +++ b/core/api/test/unit/domain/shared/amount-calculator.spec.ts @@ -1,4 +1,4 @@ -import { AmountCalculator, WalletCurrency } from "@domain/shared" +import { AmountCalculator, WalletCurrency } from "@/domain/shared" describe("AmountCalculator", () => { const calc = AmountCalculator() diff --git a/core/api/test/unit/domain/swap/swap-out-checker.spec.ts b/core/api/test/unit/domain/swap/swap-out-checker.spec.ts index 9b3fd1bf91..438fa7fa6f 100644 --- a/core/api/test/unit/domain/swap/swap-out-checker.spec.ts +++ b/core/api/test/unit/domain/swap/swap-out-checker.spec.ts @@ -1,5 +1,5 @@ -import { WalletCurrency, ZERO_SATS } from "@domain/shared" -import { SwapOutChecker } from "@domain/swap" +import { WalletCurrency, ZERO_SATS } from "@/domain/shared" +import { SwapOutChecker } from "@/domain/swap" describe("SwapOutChecker", () => { it("returns the amount that should be swapped", () => { diff --git a/core/api/test/unit/domain/users-ips/ip-metadata-authorizer.spec.ts b/core/api/test/unit/domain/users-ips/ip-metadata-authorizer.spec.ts index 01f3300995..d5b51142c3 100644 --- a/core/api/test/unit/domain/users-ips/ip-metadata-authorizer.spec.ts +++ b/core/api/test/unit/domain/users-ips/ip-metadata-authorizer.spec.ts @@ -3,8 +3,8 @@ import { MissingIPMetadataError, UnauthorizedIPMetadataCountryError, UnauthorizedIPMetadataProxyError, -} from "@domain/errors" -import { IPMetadataAuthorizer } from "@domain/accounts-ips/ip-metadata-authorizer" +} from "@/domain/errors" +import { IPMetadataAuthorizer } from "@/domain/accounts-ips/ip-metadata-authorizer" const defaultConfig = { denyCountries: [], diff --git a/core/api/test/unit/domain/users-ips/parse-ips.spec.ts b/core/api/test/unit/domain/users-ips/parse-ips.spec.ts index e6e61360cf..8144077e0f 100644 --- a/core/api/test/unit/domain/users-ips/parse-ips.spec.ts +++ b/core/api/test/unit/domain/users-ips/parse-ips.spec.ts @@ -1,4 +1,4 @@ -import { parseIps } from "@domain/accounts-ips" +import { parseIps } from "@/domain/accounts-ips" describe("parseIps", () => { it("returns undefined if ip is empty", () => { diff --git a/core/api/test/unit/domain/users/checked-to-accountlevel.spec.ts b/core/api/test/unit/domain/users/checked-to-accountlevel.spec.ts index 4b66c7a16a..d94fe4cabf 100644 --- a/core/api/test/unit/domain/users/checked-to-accountlevel.spec.ts +++ b/core/api/test/unit/domain/users/checked-to-accountlevel.spec.ts @@ -1,5 +1,5 @@ -import { checkedToAccountLevel } from "@domain/accounts" -import { InvalidAccountLevelError } from "@domain/errors" +import { checkedToAccountLevel } from "@/domain/accounts" +import { InvalidAccountLevelError } from "@/domain/errors" describe("account-level-check", () => { it("Passes with valid account levels", () => { diff --git a/core/api/test/unit/domain/users/checked-to-language.spec.ts b/core/api/test/unit/domain/users/checked-to-language.spec.ts index bf68a7fcd1..d1e6b2a282 100644 --- a/core/api/test/unit/domain/users/checked-to-language.spec.ts +++ b/core/api/test/unit/domain/users/checked-to-language.spec.ts @@ -1,5 +1,5 @@ -import { InvalidLanguageError } from "@domain/errors" -import { checkedToLanguage } from "@domain/users" +import { InvalidLanguageError } from "@/domain/errors" +import { checkedToLanguage } from "@/domain/users" describe("language-check", () => { it("Passes with valid languages", () => { diff --git a/core/api/test/unit/domain/users/checked-to-phonenumber.spec.ts b/core/api/test/unit/domain/users/checked-to-phonenumber.spec.ts index 2ba90184ba..5c860e04d5 100644 --- a/core/api/test/unit/domain/users/checked-to-phonenumber.spec.ts +++ b/core/api/test/unit/domain/users/checked-to-phonenumber.spec.ts @@ -1,4 +1,4 @@ -import { checkedToPhoneNumber } from "@domain/users" +import { checkedToPhoneNumber } from "@/domain/users" describe("phonenumber-check", () => { it("Fail just prefix", () => { diff --git a/core/api/test/unit/domain/users/checked-to-username.spec.ts b/core/api/test/unit/domain/users/checked-to-username.spec.ts index 910b8ab29d..30617ccd93 100644 --- a/core/api/test/unit/domain/users/checked-to-username.spec.ts +++ b/core/api/test/unit/domain/users/checked-to-username.spec.ts @@ -1,4 +1,4 @@ -import { checkedToUsername } from "@domain/accounts" +import { checkedToUsername } from "@/domain/accounts" describe("username-check", () => { it("Passes alphanumeric username", () => { diff --git a/core/api/test/unit/domain/users/phone-metadata-authorizer.spec.ts b/core/api/test/unit/domain/users/phone-metadata-authorizer.spec.ts index 6a70d6b039..12ce0f3c6e 100644 --- a/core/api/test/unit/domain/users/phone-metadata-authorizer.spec.ts +++ b/core/api/test/unit/domain/users/phone-metadata-authorizer.spec.ts @@ -1,10 +1,10 @@ -import { getRewardsConfig, yamlConfig } from "@config" +import { getRewardsConfig, yamlConfig } from "@/config" import { PhoneCountryNotAllowedError, PhoneCarrierTypeNotAllowedError, ExpectedPhoneMetadataMissingError, -} from "@domain/users/errors" -import { PhoneMetadataAuthorizer } from "@domain/users" +} from "@/domain/users/errors" +import { PhoneMetadataAuthorizer } from "@/domain/users" beforeEach(async () => { yamlConfig.rewards = { diff --git a/core/api/test/unit/domain/users/phone-metadata-validator.spec.ts b/core/api/test/unit/domain/users/phone-metadata-validator.spec.ts index 971a32d282..e9126ad60c 100644 --- a/core/api/test/unit/domain/users/phone-metadata-validator.spec.ts +++ b/core/api/test/unit/domain/users/phone-metadata-validator.spec.ts @@ -4,8 +4,8 @@ import { InvalidCountryCodeForPhoneMetadataError, InvalidErrorCodeForPhoneMetadataError, InvalidMobileCountryCodeForPhoneMetadataError, -} from "@domain/users/errors" -import { PhoneMetadataValidator } from "@domain/users" +} from "@/domain/users/errors" +import { PhoneMetadataValidator } from "@/domain/users" describe("PhoneMetadataValidator", () => { it("returns valid PhoneMetadata object", async () => { diff --git a/core/api/test/unit/domain/wallet-invoices/wallet-invoice-builder.spec.ts b/core/api/test/unit/domain/wallet-invoices/wallet-invoice-builder.spec.ts index 15a63538a1..210467d40f 100644 --- a/core/api/test/unit/domain/wallet-invoices/wallet-invoice-builder.spec.ts +++ b/core/api/test/unit/domain/wallet-invoices/wallet-invoice-builder.spec.ts @@ -1,18 +1,18 @@ -import { toSats } from "@domain/bitcoin" -import { sha256 } from "@domain/bitcoin/lightning" -import { checkedToMinutes } from "@domain/primitives" +import { toSats } from "@/domain/bitcoin" +import { sha256 } from "@/domain/bitcoin/lightning" +import { checkedToMinutes } from "@/domain/primitives" import { BtcPaymentAmount, UsdPaymentAmount, WalletCurrency, checkedToBtcPaymentAmount, checkedToUsdPaymentAmount, -} from "@domain/shared" +} from "@/domain/shared" import { InvalidWalletInvoiceBuilderStateError, SubOneCentSatAmountForUsdReceiveError, -} from "@domain/wallet-invoices/errors" -import { WalletInvoiceBuilder } from "@domain/wallet-invoices/wallet-invoice-builder" +} from "@/domain/wallet-invoices/errors" +import { WalletInvoiceBuilder } from "@/domain/wallet-invoices/wallet-invoice-builder" describe("WalletInvoiceBuilder", () => { const recipientBtcWallet = { diff --git a/core/api/test/unit/domain/wallet-invoices/wallet-invoice-checker.spec.ts b/core/api/test/unit/domain/wallet-invoices/wallet-invoice-checker.spec.ts index 5ac69ed696..3528410fa3 100644 --- a/core/api/test/unit/domain/wallet-invoices/wallet-invoice-checker.spec.ts +++ b/core/api/test/unit/domain/wallet-invoices/wallet-invoice-checker.spec.ts @@ -1,7 +1,7 @@ -import { DEFAULT_EXPIRATIONS } from "@domain/bitcoin/lightning/invoice-expiration" -import { CouldNotFindWalletInvoiceError, RepositoryError } from "@domain/errors" -import { WalletCurrency } from "@domain/shared" -import { WalletInvoiceChecker } from "@domain/wallet-invoices" +import { DEFAULT_EXPIRATIONS } from "@/domain/bitcoin/lightning/invoice-expiration" +import { CouldNotFindWalletInvoiceError, RepositoryError } from "@/domain/errors" +import { WalletCurrency } from "@/domain/shared" +import { WalletInvoiceChecker } from "@/domain/wallet-invoices" const goodWalletInvoice = { paymentHash: "paymentHash" as PaymentHash, diff --git a/core/api/test/unit/domain/wallet-invoices/wallet-invoice-receiver.spec.ts b/core/api/test/unit/domain/wallet-invoices/wallet-invoice-receiver.spec.ts index cf10d18312..a30568dd6f 100644 --- a/core/api/test/unit/domain/wallet-invoices/wallet-invoice-receiver.spec.ts +++ b/core/api/test/unit/domain/wallet-invoices/wallet-invoice-receiver.spec.ts @@ -4,9 +4,9 @@ import { WalletCurrency, ZERO_CENTS, ZERO_SATS, -} from "@domain/shared" +} from "@/domain/shared" -import { WalletInvoiceReceiver } from "@domain/wallet-invoices/wallet-invoice-receiver" +import { WalletInvoiceReceiver } from "@/domain/wallet-invoices/wallet-invoice-receiver" describe("WalletInvoiceReceiver", () => { const midPriceRatio = 2n diff --git a/core/api/test/unit/domain/wallet-on-chain-addresses/wallet-address-receiver.spec.ts b/core/api/test/unit/domain/wallet-on-chain-addresses/wallet-address-receiver.spec.ts index 7f4f9673d3..fdcd735b88 100644 --- a/core/api/test/unit/domain/wallet-on-chain-addresses/wallet-address-receiver.spec.ts +++ b/core/api/test/unit/domain/wallet-on-chain-addresses/wallet-address-receiver.spec.ts @@ -1,8 +1,8 @@ -import { AmountLessThanFeeError } from "@domain/errors" -import { WalletPriceRatio } from "@domain/payments" -import { AmountCalculator, BtcPaymentAmount, WalletCurrency } from "@domain/shared" +import { AmountLessThanFeeError } from "@/domain/errors" +import { WalletPriceRatio } from "@/domain/payments" +import { AmountCalculator, BtcPaymentAmount, WalletCurrency } from "@/domain/shared" -import { WalletAddressReceiver } from "@domain/wallet-on-chain/wallet-address-receiver" +import { WalletAddressReceiver } from "@/domain/wallet-on-chain/wallet-address-receiver" const calc = AmountCalculator() diff --git a/core/api/test/unit/domain/wallets/deposit-fee-calculator.spec.ts b/core/api/test/unit/domain/wallets/deposit-fee-calculator.spec.ts index 1e11ee37f7..d4f734a24e 100644 --- a/core/api/test/unit/domain/wallets/deposit-fee-calculator.spec.ts +++ b/core/api/test/unit/domain/wallets/deposit-fee-calculator.spec.ts @@ -1,5 +1,5 @@ -import { DepositFeeCalculator } from "@domain/wallets" -import { WalletCurrency, ZERO_SATS } from "@domain/shared" +import { DepositFeeCalculator } from "@/domain/wallets" +import { WalletCurrency, ZERO_SATS } from "@/domain/shared" describe("DepositFeeCalculator", () => { const calculator = DepositFeeCalculator() diff --git a/core/api/test/unit/domain/wallets/payment-input-validator.spec.ts b/core/api/test/unit/domain/wallets/payment-input-validator.spec.ts index 522043df41..a8f11623c4 100644 --- a/core/api/test/unit/domain/wallets/payment-input-validator.spec.ts +++ b/core/api/test/unit/domain/wallets/payment-input-validator.spec.ts @@ -1,10 +1,10 @@ import crypto from "crypto" -import { UsdDisplayCurrency } from "@domain/fiat" -import { AccountLevel, AccountStatus } from "@domain/accounts" -import { InvalidAccountStatusError, SelfPaymentError } from "@domain/errors" -import { PaymentInputValidator, WalletType } from "@domain/wallets" -import { WalletCurrency, InvalidBtcPaymentAmountError } from "@domain/shared" +import { UsdDisplayCurrency } from "@/domain/fiat" +import { AccountLevel, AccountStatus } from "@/domain/accounts" +import { InvalidAccountStatusError, SelfPaymentError } from "@/domain/errors" +import { PaymentInputValidator, WalletType } from "@/domain/wallets" +import { WalletCurrency, InvalidBtcPaymentAmountError } from "@/domain/shared" describe("PaymentInputValidator", () => { const dummyAccount: Account = { diff --git a/core/api/test/unit/domain/wallets/settlement-amounts.spec.ts b/core/api/test/unit/domain/wallets/settlement-amounts.spec.ts index 5e34a90b06..76debd1c96 100644 --- a/core/api/test/unit/domain/wallets/settlement-amounts.spec.ts +++ b/core/api/test/unit/domain/wallets/settlement-amounts.spec.ts @@ -1,7 +1,7 @@ -import { toSats } from "@domain/bitcoin" -import { UsdDisplayCurrency, displayAmountFromNumber, toCents } from "@domain/fiat" -import { WalletCurrency } from "@domain/shared" -import { SettlementAmounts } from "@domain/wallets/settlement-amounts" +import { toSats } from "@/domain/bitcoin" +import { UsdDisplayCurrency, displayAmountFromNumber, toCents } from "@/domain/fiat" +import { WalletCurrency } from "@/domain/shared" +import { SettlementAmounts } from "@/domain/wallets/settlement-amounts" describe("SettlementAmounts", () => { const txnCommon = { diff --git a/core/api/test/unit/domain/wallets/tx-history.spec.ts b/core/api/test/unit/domain/wallets/tx-history.spec.ts index c58a181307..9e168d3cd4 100644 --- a/core/api/test/unit/domain/wallets/tx-history.spec.ts +++ b/core/api/test/unit/domain/wallets/tx-history.spec.ts @@ -1,20 +1,20 @@ import crypto from "crypto" -import { LedgerTransactionType } from "@domain/ledger" -import { SettlementMethod, PaymentInitiationMethod, TxStatus } from "@domain/wallets" +import { LedgerTransactionType } from "@/domain/ledger" +import { SettlementMethod, PaymentInitiationMethod, TxStatus } from "@/domain/wallets" import { displayCurrencyPerBaseUnitFromAmounts, translateMemo, WalletTransactionHistory, -} from "@domain/wallets/tx-history" -import { toSats } from "@domain/bitcoin" +} from "@/domain/wallets/tx-history" +import { toSats } from "@/domain/bitcoin" import { memoSharingConfig, MEMO_SHARING_CENTS_THRESHOLD, MEMO_SHARING_SATS_THRESHOLD, -} from "@config" -import { WalletCurrency } from "@domain/shared" -import { UsdDisplayCurrency, priceAmountFromNumber, toCents } from "@domain/fiat" +} from "@/config" +import { WalletCurrency } from "@/domain/shared" +import { UsdDisplayCurrency, priceAmountFromNumber, toCents } from "@/domain/fiat" describe("translates ledger txs to wallet txs", () => { const timestamp = new Date() diff --git a/core/api/test/unit/domain/wallets/withdrawal-fee-calculator.spec.ts b/core/api/test/unit/domain/wallets/withdrawal-fee-calculator.spec.ts index b1c3532274..76b504c808 100644 --- a/core/api/test/unit/domain/wallets/withdrawal-fee-calculator.spec.ts +++ b/core/api/test/unit/domain/wallets/withdrawal-fee-calculator.spec.ts @@ -1,5 +1,5 @@ -import { OnChainFees } from "@domain/wallets" -import { AmountCalculator, WalletCurrency, ZERO_SATS } from "@domain/shared" +import { OnChainFees } from "@/domain/wallets" +import { AmountCalculator, WalletCurrency, ZERO_SATS } from "@/domain/shared" const thresholdImbalance = { amount: BigInt(1_000_000), diff --git a/core/api/test/unit/graphql/index.spec.ts b/core/api/test/unit/graphql/index.spec.ts index 245c619214..e174981d8c 100644 --- a/core/api/test/unit/graphql/index.spec.ts +++ b/core/api/test/unit/graphql/index.spec.ts @@ -1,5 +1,5 @@ -import { ExchangeCurrencyUnit, WalletCurrency } from "@domain/shared" -import { normalizePaymentAmount } from "@graphql/shared/root/mutation" +import { ExchangeCurrencyUnit, WalletCurrency } from "@/domain/shared" +import { normalizePaymentAmount } from "@/graphql/shared/root/mutation" describe("normalizePaymentAmount", () => { it("returns the correct type", () => { diff --git a/core/api/test/unit/jest.config.js b/core/api/test/unit/jest.config.js index 9e637e7e0e..845335430e 100644 --- a/core/api/test/unit/jest.config.js +++ b/core/api/test/unit/jest.config.js @@ -10,16 +10,7 @@ module.exports = { testRegex: ".*\\.spec\\.ts$", testEnvironment: "node", moduleNameMapper: { - "^@config$": ["src/config/index"], - "^@app$": ["src/app/index"], - "^@utils$": ["src/utils/index"], - - "^@core/(.*)$": ["src/core/$1"], - "^@app/(.*)$": ["src/app/$1"], - "^@domain/(.*)$": ["src/domain/$1"], - "^@services/(.*)$": ["src/services/$1"], - "^@servers/(.*)$": ["src/servers/$1"], - "^@graphql/(.*)$": ["src/graphql/$1"], - "^test/(.*)$": ["test/$1"], - }, + "^@/(.*)$": ["/src/$1"], + "^test/(.*)$": ["/test/$1"], + } } diff --git a/core/api/test/unit/ledger/ledger.spec.ts b/core/api/test/unit/ledger/ledger.spec.ts index fab7b52bd0..4ec65df577 100644 --- a/core/api/test/unit/ledger/ledger.spec.ts +++ b/core/api/test/unit/ledger/ledger.spec.ts @@ -1,6 +1,10 @@ import crypto from "crypto" -import { liabilitiesMainAccount, toLiabilitiesWalletId, toWalletId } from "@domain/ledger" +import { + liabilitiesMainAccount, + toLiabilitiesWalletId, + toWalletId, +} from "@/domain/ledger" describe("ledger.ts", () => { describe("resolveWalletId", () => { diff --git a/core/api/test/unit/payments/onchain-payment-flow-builder.spec.ts b/core/api/test/unit/payments/onchain-payment-flow-builder.spec.ts index b8d60db578..54a851da0e 100644 --- a/core/api/test/unit/payments/onchain-payment-flow-builder.spec.ts +++ b/core/api/test/unit/payments/onchain-payment-flow-builder.spec.ts @@ -1,22 +1,22 @@ -import { getFeesConfig, getOnChainWalletConfig } from "@config" +import { getFeesConfig, getOnChainWalletConfig } from "@/config" -import { SettlementMethod, PaymentInitiationMethod, OnChainFees } from "@domain/wallets" -import { LessThanDustThresholdError, SelfPaymentError } from "@domain/errors" +import { SettlementMethod, PaymentInitiationMethod, OnChainFees } from "@/domain/wallets" +import { LessThanDustThresholdError, SelfPaymentError } from "@/domain/errors" import { InvalidOnChainPaymentFlowBuilderStateError, SubOneCentSatAmountForUsdSelfSendError, WalletPriceRatio, -} from "@domain/payments" +} from "@/domain/payments" import { BtcPaymentAmount, ONE_CENT, paymentAmountFromNumber, ValidationError, WalletCurrency, -} from "@domain/shared" -import { OnChainPaymentFlowBuilder } from "@domain/payments/onchain-payment-flow-builder" -import { toSats } from "@domain/bitcoin" -import { ImbalanceCalculator } from "@domain/ledger/imbalance-calculator" +} from "@/domain/shared" +import { OnChainPaymentFlowBuilder } from "@/domain/payments/onchain-payment-flow-builder" +import { toSats } from "@/domain/bitcoin" +import { ImbalanceCalculator } from "@/domain/ledger/imbalance-calculator" const feeConfig = getFeesConfig() const { dustThreshold } = getOnChainWalletConfig() diff --git a/core/api/test/unit/payments/payment-flow-builder.spec.ts b/core/api/test/unit/payments/payment-flow-builder.spec.ts index a192f6cde5..6a221fc93a 100644 --- a/core/api/test/unit/payments/payment-flow-builder.spec.ts +++ b/core/api/test/unit/payments/payment-flow-builder.spec.ts @@ -1,15 +1,15 @@ /* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "checkSettlementMethod", "checkInvoice", "checkSenderWallet", "checkRecipientWallet"] }] */ -import { SettlementMethod, PaymentInitiationMethod } from "@domain/wallets" -import { decodeInvoice } from "@domain/bitcoin/lightning" -import { SelfPaymentError } from "@domain/errors" +import { SettlementMethod, PaymentInitiationMethod } from "@/domain/wallets" +import { decodeInvoice } from "@/domain/bitcoin/lightning" +import { SelfPaymentError } from "@/domain/errors" import { LightningPaymentFlowBuilder, LnFees, InvalidLightningPaymentFlowBuilderStateError, WalletPriceRatio, SubOneCentSatAmountForUsdSelfSendError, -} from "@domain/payments" -import { ONE_CENT, ValidationError, WalletCurrency } from "@domain/shared" +} from "@/domain/payments" +import { ONE_CENT, ValidationError, WalletCurrency } from "@/domain/shared" const skippedPubkey = "038f8f113c580048d847d6949371726653e02b928196bad310e3eda39ff61723f6" as Pubkey diff --git a/core/api/test/unit/payments/payment-flow.spec.ts b/core/api/test/unit/payments/payment-flow.spec.ts index 7ad3694c30..4f082cbdce 100644 --- a/core/api/test/unit/payments/payment-flow.spec.ts +++ b/core/api/test/unit/payments/payment-flow.spec.ts @@ -1,10 +1,10 @@ -import { toSats } from "@domain/bitcoin" -import { InsufficientBalanceError, InvalidCurrencyForWalletError } from "@domain/errors" -import { toCents } from "@domain/fiat" -import { inputAmountFromLedgerTransaction } from "@domain/ledger" -import { OnChainPaymentFlow, PaymentFlow } from "@domain/payments" -import { WalletCurrency, safeBigInt, AmountCalculator } from "@domain/shared" -import { PaymentInitiationMethod, SettlementMethod } from "@domain/wallets" +import { toSats } from "@/domain/bitcoin" +import { InsufficientBalanceError, InvalidCurrencyForWalletError } from "@/domain/errors" +import { toCents } from "@/domain/fiat" +import { inputAmountFromLedgerTransaction } from "@/domain/ledger" +import { OnChainPaymentFlow, PaymentFlow } from "@/domain/payments" +import { WalletCurrency, safeBigInt, AmountCalculator } from "@/domain/shared" +import { PaymentInitiationMethod, SettlementMethod } from "@/domain/wallets" const calc = AmountCalculator() diff --git a/core/api/test/unit/services/ipfetcher/fetch-ip-info.spec.ts b/core/api/test/unit/services/ipfetcher/fetch-ip-info.spec.ts index f0dee6ede0..8bd23d6960 100644 --- a/core/api/test/unit/services/ipfetcher/fetch-ip-info.spec.ts +++ b/core/api/test/unit/services/ipfetcher/fetch-ip-info.spec.ts @@ -1,6 +1,7 @@ import axios from "axios" import MockAdapter from "axios-mock-adapter" -import { IpFetcher } from "@services/ipfetcher" + +import { IpFetcher } from "@/services/ipfetcher" let mock diff --git a/core/api/test/unit/services/ledger/domain/entry-builder.spec.ts b/core/api/test/unit/services/ledger/domain/entry-builder.spec.ts index a7e39aabb9..725625519b 100644 --- a/core/api/test/unit/services/ledger/domain/entry-builder.spec.ts +++ b/core/api/test/unit/services/ledger/domain/entry-builder.spec.ts @@ -2,15 +2,15 @@ import { Entry, IJournal } from "medici" -import { WalletCurrency, AmountCalculator, ZERO_BANK_FEE } from "@domain/shared" +import { WalletCurrency, AmountCalculator, ZERO_BANK_FEE } from "@/domain/shared" import { lndLedgerAccountId, EntryBuilder, onChainLedgerAccountId, -} from "@services/ledger/domain" -import { MainBook } from "@services/ledger/books" -import { UsdDisplayCurrency } from "@domain/fiat" +} from "@/services/ledger/domain" +import { MainBook } from "@/services/ledger/books" +import { UsdDisplayCurrency } from "@/domain/fiat" const createEntry = () => MainBook.entry("") diff --git a/core/api/test/unit/services/ledger/domain/fee-only-entry-builder.spec.ts b/core/api/test/unit/services/ledger/domain/fee-only-entry-builder.spec.ts index 5866b0d416..e7c610d802 100644 --- a/core/api/test/unit/services/ledger/domain/fee-only-entry-builder.spec.ts +++ b/core/api/test/unit/services/ledger/domain/fee-only-entry-builder.spec.ts @@ -1,10 +1,10 @@ /* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "expectEntryToEqual", "expectJournalToBeBalanced"] }] */ -import { WalletCurrency } from "@domain/shared" +import { WalletCurrency } from "@/domain/shared" -import { onChainLedgerAccountId } from "@services/ledger/domain" -import { MainBook } from "@services/ledger/books" -import { FeeOnlyEntryBuilder } from "@services/ledger/domain/fee-only-entry-builder" +import { onChainLedgerAccountId } from "@/services/ledger/domain" +import { MainBook } from "@/services/ledger/books" +import { FeeOnlyEntryBuilder } from "@/services/ledger/domain/fee-only-entry-builder" const createEntry = () => MainBook.entry("") diff --git a/core/api/test/unit/services/ledger/domain/tx-metadata.spec.ts b/core/api/test/unit/services/ledger/domain/tx-metadata.spec.ts index e4409e1915..d520d990dc 100644 --- a/core/api/test/unit/services/ledger/domain/tx-metadata.spec.ts +++ b/core/api/test/unit/services/ledger/domain/tx-metadata.spec.ts @@ -1,7 +1,7 @@ -import { toSats } from "@domain/bitcoin" -import { UsdDisplayCurrency, toCents } from "@domain/fiat" -import { LedgerTransactionType } from "@domain/ledger" -import { WalletCurrency, ZERO_CENTS, ZERO_SATS } from "@domain/shared" +import { toSats } from "@/domain/bitcoin" +import { UsdDisplayCurrency, toCents } from "@/domain/fiat" +import { LedgerTransactionType } from "@/domain/ledger" +import { WalletCurrency, ZERO_CENTS, ZERO_SATS } from "@/domain/shared" import { LnIntraledgerLedgerMetadata, LnTradeIntraAccountLedgerMetadata, @@ -15,7 +15,7 @@ import { LnReceiveLedgerMetadata, LnFeeReimbursementReceiveLedgerMetadata, LnFailedPaymentReceiveLedgerMetadata, -} from "@services/ledger/facade" +} from "@/services/ledger/facade" describe("Tx metadata", () => { const senderUsername = "sender" as Username diff --git a/core/api/test/unit/services/mongoose/utils.spec.ts b/core/api/test/unit/services/mongoose/utils.spec.ts index 5f5525a614..22345d088a 100644 --- a/core/api/test/unit/services/mongoose/utils.spec.ts +++ b/core/api/test/unit/services/mongoose/utils.spec.ts @@ -1,5 +1,6 @@ import { Types } from "mongoose" -import { toObjectId, fromObjectId } from "@services/mongoose/utils" + +import { toObjectId, fromObjectId } from "@/services/mongoose/utils" describe("toObjectId / fromObjectId", () => { it("presevers identity", () => { diff --git a/core/api/test/unit/services/notifications/create-push-notification-content.spec.ts b/core/api/test/unit/services/notifications/create-push-notification-content.spec.ts index af9cfc8b1a..8354e425a3 100644 --- a/core/api/test/unit/services/notifications/create-push-notification-content.spec.ts +++ b/core/api/test/unit/services/notifications/create-push-notification-content.spec.ts @@ -1,6 +1,3 @@ -import { getLocale } from "@config" -import { createPushNotificationContent } from "@services/notifications/create-push-notification-content" - import { btcTransactions, usdTransactions, @@ -8,6 +5,9 @@ import { usdTransactionsWithDisplayCurrency, } from "./transactions" +import { getLocale } from "@/config" +import { createPushNotificationContent } from "@/services/notifications/create-push-notification-content" + const userLanguage = getLocale() describe("Notifications - createPushNotificationContent", () => { diff --git a/core/api/test/unit/services/notifications/transactions.ts b/core/api/test/unit/services/notifications/transactions.ts index ad4442644d..6a4a66fdbc 100644 --- a/core/api/test/unit/services/notifications/transactions.ts +++ b/core/api/test/unit/services/notifications/transactions.ts @@ -1,6 +1,6 @@ -import { NotificationType } from "@domain/notifications" -import { WalletCurrency } from "@domain/shared" -import { UsdDisplayCurrency } from "@domain/fiat" +import { NotificationType } from "@/domain/notifications" +import { WalletCurrency } from "@/domain/shared" +import { UsdDisplayCurrency } from "@/domain/fiat" const usdDisplayPaymentAmount = { amountInMinor: 500n, diff --git a/core/api/test/unit/utils/grpc-stream-client/backoff.spec.ts b/core/api/test/unit/utils/grpc-stream-client/backoff.spec.ts index acbe9e51e2..ee0bcc19fa 100644 --- a/core/api/test/unit/utils/grpc-stream-client/backoff.spec.ts +++ b/core/api/test/unit/utils/grpc-stream-client/backoff.spec.ts @@ -1,4 +1,4 @@ -import { GrpcStreamClient } from "@utils" +import { GrpcStreamClient } from "@/utils" const { FibonacciBackoff } = GrpcStreamClient diff --git a/core/api/test/unit/utils/grpc-stream-client/stream-builder.spec.ts b/core/api/test/unit/utils/grpc-stream-client/stream-builder.spec.ts index 544d3b9846..b84ad95a10 100644 --- a/core/api/test/unit/utils/grpc-stream-client/stream-builder.spec.ts +++ b/core/api/test/unit/utils/grpc-stream-client/stream-builder.spec.ts @@ -1,7 +1,7 @@ import { Metadata } from "@grpc/grpc-js" import { Empty } from "google-protobuf/google/protobuf/empty_pb" -import { GrpcStreamClient } from "@utils" +import { GrpcStreamClient } from "@/utils" const { streamBuilder, Stream, StreamEvents } = GrpcStreamClient diff --git a/core/api/test/unit/utils/grpc-stream-client/stream.spec.ts b/core/api/test/unit/utils/grpc-stream-client/stream.spec.ts index dfaca52d38..b8849713a4 100644 --- a/core/api/test/unit/utils/grpc-stream-client/stream.spec.ts +++ b/core/api/test/unit/utils/grpc-stream-client/stream.spec.ts @@ -1,7 +1,7 @@ import { Metadata, ServiceError } from "@grpc/grpc-js" import { Empty } from "google-protobuf/google/protobuf/empty_pb" -import { GrpcStreamClient } from "@utils" +import { GrpcStreamClient } from "@/utils" const { Stream, StreamEvents } = GrpcStreamClient diff --git a/core/api/test/unit/utils/index.spec.ts b/core/api/test/unit/utils/index.spec.ts index 4f9d016602..f663f71938 100644 --- a/core/api/test/unit/utils/index.spec.ts +++ b/core/api/test/unit/utils/index.spec.ts @@ -1,5 +1,5 @@ -import { btc2sat, sat2btc } from "@domain/bitcoin" -import { elapsedSinceTimestamp } from "@utils" +import { btc2sat, sat2btc } from "@/domain/bitcoin" +import { elapsedSinceTimestamp } from "@/utils" describe("utils", () => { describe("btc2sat", () => { diff --git a/core/api/tsconfig.json b/core/api/tsconfig.json index 7d9d80f900..14e695a4d1 100644 --- a/core/api/tsconfig.json +++ b/core/api/tsconfig.json @@ -11,15 +11,9 @@ "moduleResolution": "node", "resolveJsonModule": true, "paths": { - "@config": ["src/config/index"], - "@core/*": ["src/core/*"], - "@app/*": ["src/app/*"], - "@app": ["src/app/index"], - "@domain/*": ["src/domain/*"], - "@services/*": ["src/services/*"], - "@utils": ["src/utils/index"], - "@graphql/*": ["src/graphql/*"], - "@servers/*": ["src/servers/*"] + "@/*": [ + "src/*" + ] } }, "compileOnSave": true,