From 8f668fe5eadc41cd68c77dc9ce94144b88fd3aa1 Mon Sep 17 00:00:00 2001 From: Phillip Ho Date: Fri, 6 Dec 2024 22:52:38 +0800 Subject: [PATCH] Revert "refactor: clearer folder organization (#792)" (#795) This reverts commit 5d405f037b6110b43c7176cef9d1b7ae2f3543ed. --- .vscode/settings.json | 17 ++++++++ Dockerfile | 1 - package.json | 4 +- src/{shared/schemas => constants}/relayer.ts | 0 .../db/chainIndexers/getChainIndexer.ts | 2 +- .../db/chainIndexers/upsertChainIndexer.ts | 2 +- src/{shared => }/db/client.ts | 6 +-- .../db/configuration/getConfiguration.ts | 6 +-- .../db/configuration/updateConfiguration.ts | 0 .../createContractEventLogs.ts | 4 +- .../deleteContractEventLogs.ts | 0 .../contractEventLogs/getContractEventLogs.ts | 0 .../createContractSubscription.ts | 0 .../deleteContractSubscription.ts | 0 .../getContractSubscriptions.ts | 0 .../createContractTransactionReceipts.ts | 2 +- .../deleteContractTransactionReceipts.ts | 0 .../getContractTransactionReceipts.ts | 0 src/{shared => }/db/keypair/delete.ts | 0 src/{shared => }/db/keypair/get.ts | 0 src/{shared => }/db/keypair/insert.ts | 6 +-- src/{shared => }/db/keypair/list.ts | 0 .../db/permissions/deletePermissions.ts | 0 .../db/permissions/getPermissions.ts | 2 +- .../db/permissions/updatePermissions.ts | 0 src/{shared => }/db/relayer/getRelayerById.ts | 0 src/{shared => }/db/tokens/createToken.ts | 0 src/{shared => }/db/tokens/getAccessTokens.ts | 0 src/{shared => }/db/tokens/getToken.ts | 0 src/{shared => }/db/tokens/revokeToken.ts | 0 src/{shared => }/db/tokens/updateToken.ts | 0 src/{shared => }/db/transactions/db.ts | 0 src/{shared => }/db/transactions/queueTx.ts | 4 +- .../db/wallets/createWalletDetails.ts | 2 +- .../db/wallets/deleteWalletDetails.ts | 0 src/{shared => }/db/wallets/getAllWallets.ts | 2 +- .../db/wallets/getWalletDetails.ts | 2 +- src/{shared => }/db/wallets/nonceMap.ts | 2 +- .../db/wallets/updateWalletDetails.ts | 0 src/{shared => }/db/wallets/walletNonce.ts | 0 src/{shared => }/db/webhooks/createWebhook.ts | 2 +- .../db/webhooks/getAllWebhooks.ts | 0 src/{shared => }/db/webhooks/getWebhook.ts | 0 src/{shared => }/db/webhooks/revokeWebhook.ts | 0 src/index.ts | 7 ++-- src/{shared => }/lib/cache/swr.ts | 0 .../lib/chain/chain-capabilities.ts | 0 .../transaction/get-transaction-receipt.ts | 0 src/polyfill.ts | 2 +- src/{shared/schemas => schema}/config.ts | 0 src/{shared/schemas => schema}/extension.ts | 0 src/{shared/schemas => schema}/prisma.ts | 0 src/{shared/schemas => schema}/wallet.ts | 0 src/{shared/schemas => schema}/webhooks.ts | 0 {scripts => src/scripts}/apply-migrations.ts | 10 ++--- {scripts => src/scripts}/generate-sdk.ts | 0 {scripts => src/scripts}/setup-db.ts | 8 ++-- src/server/index.ts | 10 ++--- src/server/listeners/updateTxListener.ts | 6 +-- src/server/middleware/adminRoutes.ts | 2 +- src/server/middleware/auth.ts | 30 +++++++------- src/server/middleware/cors.ts | 2 +- src/server/middleware/engineMode.ts | 2 +- src/server/middleware/error.ts | 4 +- src/server/middleware/logs.ts | 2 +- src/server/middleware/prometheus.ts | 4 +- src/server/middleware/rateLimit.ts | 4 +- src/server/middleware/websocket.ts | 2 +- src/server/routes/admin/nonces.ts | 14 +++---- src/server/routes/admin/transaction.ts | 14 +++---- .../routes/auth/access-tokens/create.ts | 10 ++--- .../routes/auth/access-tokens/getAll.ts | 2 +- .../routes/auth/access-tokens/revoke.ts | 4 +- .../routes/auth/access-tokens/update.ts | 4 +- src/server/routes/auth/keypair/add.ts | 12 +++--- src/server/routes/auth/keypair/list.ts | 11 ++--- src/server/routes/auth/keypair/remove.ts | 8 ++-- src/server/routes/auth/permissions/getAll.ts | 2 +- src/server/routes/auth/permissions/grant.ts | 4 +- src/server/routes/auth/permissions/revoke.ts | 2 +- .../routes/backend-wallet/cancel-nonces.ts | 6 +-- src/server/routes/backend-wallet/create.ts | 4 +- src/server/routes/backend-wallet/getAll.ts | 2 +- .../routes/backend-wallet/getBalance.ts | 6 +-- src/server/routes/backend-wallet/getNonce.ts | 2 +- .../routes/backend-wallet/getTransactions.ts | 6 +-- .../backend-wallet/getTransactionsByNonce.ts | 8 ++-- src/server/routes/backend-wallet/import.ts | 2 +- src/server/routes/backend-wallet/remove.ts | 8 ++-- .../routes/backend-wallet/reset-nonces.ts | 2 +- .../routes/backend-wallet/sendTransaction.ts | 2 +- .../backend-wallet/sendTransactionBatch.ts | 2 +- .../routes/backend-wallet/signMessage.ts | 6 +-- .../routes/backend-wallet/signTransaction.ts | 6 +-- .../routes/backend-wallet/signTypedData.ts | 6 +-- .../backend-wallet/simulateTransaction.ts | 4 +- src/server/routes/backend-wallet/transfer.ts | 10 ++--- src/server/routes/backend-wallet/update.ts | 6 +-- src/server/routes/backend-wallet/withdraw.ts | 12 +++--- src/server/routes/chain/get.ts | 2 +- src/server/routes/chain/getAll.ts | 2 +- src/server/routes/configuration/auth/get.ts | 6 +-- .../routes/configuration/auth/update.ts | 8 ++-- .../backend-wallet-balance/get.ts | 6 +-- .../backend-wallet-balance/update.ts | 4 +- src/server/routes/configuration/cache/get.ts | 6 +-- .../routes/configuration/cache/update.ts | 12 +++--- src/server/routes/configuration/chains/get.ts | 2 +- .../routes/configuration/chains/update.ts | 6 +-- .../contract-subscriptions/get.ts | 6 +-- .../contract-subscriptions/update.ts | 4 +- src/server/routes/configuration/cors/add.ts | 8 ++-- src/server/routes/configuration/cors/get.ts | 6 +-- .../routes/configuration/cors/remove.ts | 8 ++-- src/server/routes/configuration/cors/set.ts | 4 +- src/server/routes/configuration/ip/get.ts | 6 +-- src/server/routes/configuration/ip/set.ts | 8 ++-- .../routes/configuration/transactions/get.ts | 2 +- .../configuration/transactions/update.ts | 4 +- .../routes/configuration/wallets/get.ts | 4 +- .../routes/configuration/wallets/update.ts | 6 +-- .../routes/contract/events/getAllEvents.ts | 6 +-- .../contract/events/getContractEventLogs.ts | 4 +- .../events/getEventLogsByTimestamp.ts | 2 +- .../routes/contract/events/getEvents.ts | 6 +-- .../contract/events/paginateEventLogs.ts | 4 +- .../extensions/account/read/getAllAdmins.ts | 6 +-- .../extensions/account/read/getAllSessions.ts | 6 +-- .../extensions/account/write/grantAdmin.ts | 4 +- .../extensions/account/write/grantSession.ts | 4 +- .../extensions/account/write/revokeAdmin.ts | 4 +- .../extensions/account/write/revokeSession.ts | 4 +- .../extensions/account/write/updateSession.ts | 4 +- .../accountFactory/read/getAllAccounts.ts | 6 +-- .../read/getAssociatedAccounts.ts | 6 +-- .../accountFactory/read/isAccountDeployed.ts | 6 +-- .../read/predictAccountAddress.ts | 2 +- .../accountFactory/write/createAccount.ts | 6 +-- .../extensions/erc1155/read/balanceOf.ts | 2 +- .../extensions/erc1155/read/canClaim.ts | 2 +- .../contract/extensions/erc1155/read/get.ts | 2 +- .../erc1155/read/getActiveClaimConditions.ts | 2 +- .../extensions/erc1155/read/getAll.ts | 2 +- .../erc1155/read/getAllClaimConditions.ts | 2 +- .../read/getClaimIneligibilityReasons.ts | 2 +- .../erc1155/read/getClaimerProofs.ts | 2 +- .../extensions/erc1155/read/getOwned.ts | 2 +- .../extensions/erc1155/read/isApproved.ts | 2 +- .../erc1155/read/signatureGenerate.ts | 10 ++--- .../extensions/erc1155/read/totalCount.ts | 2 +- .../extensions/erc1155/read/totalSupply.ts | 2 +- .../extensions/erc1155/write/airdrop.ts | 4 +- .../contract/extensions/erc1155/write/burn.ts | 4 +- .../extensions/erc1155/write/burnBatch.ts | 4 +- .../extensions/erc1155/write/claimTo.ts | 6 +-- .../extensions/erc1155/write/lazyMint.ts | 4 +- .../erc1155/write/mintAdditionalSupplyTo.ts | 4 +- .../extensions/erc1155/write/mintBatchTo.ts | 4 +- .../extensions/erc1155/write/mintTo.ts | 4 +- .../erc1155/write/setApprovalForAll.ts | 4 +- .../erc1155/write/setBatchClaimConditions.ts | 4 +- .../erc1155/write/setClaimConditions.ts | 4 +- .../extensions/erc1155/write/signatureMint.ts | 4 +- .../extensions/erc1155/write/transfer.ts | 8 ++-- .../extensions/erc1155/write/transferFrom.ts | 8 ++-- .../erc1155/write/updateClaimConditions.ts | 4 +- .../erc1155/write/updateTokenMetadata.ts | 4 +- .../extensions/erc20/read/allowanceOf.ts | 2 +- .../extensions/erc20/read/balanceOf.ts | 2 +- .../extensions/erc20/read/canClaim.ts | 6 +-- .../contract/extensions/erc20/read/get.ts | 2 +- .../erc20/read/getActiveClaimConditions.ts | 2 +- .../erc20/read/getAllClaimConditions.ts | 2 +- .../read/getClaimIneligibilityReasons.ts | 2 +- .../extensions/erc20/read/getClaimerProofs.ts | 2 +- .../erc20/read/signatureGenerate.ts | 10 ++--- .../extensions/erc20/read/totalSupply.ts | 2 +- .../contract/extensions/erc20/write/burn.ts | 4 +- .../extensions/erc20/write/burnFrom.ts | 4 +- .../extensions/erc20/write/claimTo.ts | 6 +-- .../extensions/erc20/write/mintBatchTo.ts | 4 +- .../contract/extensions/erc20/write/mintTo.ts | 4 +- .../extensions/erc20/write/setAllowance.ts | 4 +- .../erc20/write/setClaimConditions.ts | 4 +- .../extensions/erc20/write/signatureMint.ts | 4 +- .../extensions/erc20/write/transfer.ts | 8 ++-- .../extensions/erc20/write/transferFrom.ts | 8 ++-- .../erc20/write/updateClaimConditions.ts | 4 +- .../extensions/erc721/read/balanceOf.ts | 2 +- .../extensions/erc721/read/canClaim.ts | 2 +- .../contract/extensions/erc721/read/get.ts | 2 +- .../erc721/read/getActiveClaimConditions.ts | 2 +- .../contract/extensions/erc721/read/getAll.ts | 2 +- .../erc721/read/getAllClaimConditions.ts | 2 +- .../read/getClaimIneligibilityReasons.ts | 2 +- .../erc721/read/getClaimerProofs.ts | 2 +- .../extensions/erc721/read/getOwned.ts | 2 +- .../extensions/erc721/read/isApproved.ts | 2 +- .../erc721/read/signatureGenerate.ts | 10 ++--- .../erc721/read/signaturePrepare.ts | 6 +-- .../erc721/read/totalClaimedSupply.ts | 2 +- .../extensions/erc721/read/totalCount.ts | 2 +- .../erc721/read/totalUnclaimedSupply.ts | 2 +- .../contract/extensions/erc721/write/burn.ts | 4 +- .../extensions/erc721/write/claimTo.ts | 6 +-- .../extensions/erc721/write/lazyMint.ts | 8 ++-- .../extensions/erc721/write/mintBatchTo.ts | 8 ++-- .../extensions/erc721/write/mintTo.ts | 8 ++-- .../erc721/write/setApprovalForAll.ts | 8 ++-- .../erc721/write/setApprovalForToken.ts | 8 ++-- .../erc721/write/setClaimConditions.ts | 10 ++--- .../extensions/erc721/write/signatureMint.ts | 18 ++++---- .../extensions/erc721/write/transfer.ts | 8 ++-- .../extensions/erc721/write/transferFrom.ts | 8 ++-- .../erc721/write/updateClaimConditions.ts | 10 ++--- .../erc721/write/updateTokenMetadata.ts | 8 ++-- .../directListings/read/getAll.ts | 2 +- .../directListings/read/getAllValid.ts | 2 +- .../directListings/read/getListing.ts | 2 +- .../directListings/read/getTotalCount.ts | 2 +- .../read/isBuyerApprovedForListing.ts | 2 +- .../read/isCurrencyApprovedForListing.ts | 2 +- .../write/approveBuyerForReservedListing.ts | 4 +- .../directListings/write/buyFromListing.ts | 4 +- .../directListings/write/cancelListing.ts | 4 +- .../directListings/write/createListing.ts | 4 +- .../revokeBuyerApprovalForReservedListing.ts | 4 +- .../write/revokeCurrencyApprovalForListing.ts | 4 +- .../directListings/write/updateListing.ts | 4 +- .../englishAuctions/read/getAll.ts | 2 +- .../englishAuctions/read/getAllValid.ts | 2 +- .../englishAuctions/read/getAuction.ts | 2 +- .../englishAuctions/read/getBidBufferBps.ts | 2 +- .../englishAuctions/read/getMinimumNextBid.ts | 2 +- .../englishAuctions/read/getTotalCount.ts | 2 +- .../englishAuctions/read/getWinner.ts | 2 +- .../englishAuctions/read/getWinningBid.ts | 2 +- .../englishAuctions/read/isWinningBid.ts | 2 +- .../englishAuctions/write/buyoutAuction.ts | 4 +- .../englishAuctions/write/cancelAuction.ts | 4 +- .../write/closeAuctionForBidder.ts | 4 +- .../write/closeAuctionForSeller.ts | 4 +- .../englishAuctions/write/createAuction.ts | 4 +- .../englishAuctions/write/executeSale.ts | 4 +- .../englishAuctions/write/makeBid.ts | 4 +- .../marketplaceV3/offers/read/getAll.ts | 2 +- .../marketplaceV3/offers/read/getAllValid.ts | 2 +- .../marketplaceV3/offers/read/getOffer.ts | 2 +- .../offers/read/getTotalCount.ts | 2 +- .../marketplaceV3/offers/write/acceptOffer.ts | 4 +- .../marketplaceV3/offers/write/cancelOffer.ts | 4 +- .../marketplaceV3/offers/write/makeOffer.ts | 4 +- src/server/routes/contract/metadata/abi.ts | 2 +- src/server/routes/contract/metadata/events.ts | 2 +- .../routes/contract/metadata/extensions.ts | 6 +-- .../routes/contract/metadata/functions.ts | 6 +-- src/server/routes/contract/read/read.ts | 4 +- src/server/routes/contract/roles/read/get.ts | 2 +- .../routes/contract/roles/read/getAll.ts | 2 +- .../routes/contract/roles/write/grant.ts | 4 +- .../routes/contract/roles/write/revoke.ts | 4 +- .../royalties/read/getDefaultRoyaltyInfo.ts | 6 +-- .../royalties/read/getTokenRoyaltyInfo.ts | 2 +- .../royalties/write/setDefaultRoyaltyInfo.ts | 8 ++-- .../royalties/write/setTokenRoyaltyInfo.ts | 8 ++-- .../subscriptions/addContractSubscription.ts | 20 ++++----- .../getContractIndexedBlockRange.ts | 2 +- .../subscriptions/getContractSubscriptions.ts | 6 +-- .../contract/subscriptions/getLatestBlock.ts | 2 +- .../removeContractSubscription.ts | 8 ++-- .../transactions/getTransactionReceipts.ts | 8 ++-- .../getTransactionReceiptsByTimestamp.ts | 2 +- .../paginateTransactionReceipts.ts | 4 +- src/server/routes/contract/write/write.ts | 6 +-- src/server/routes/deploy/prebuilt.ts | 10 ++--- src/server/routes/deploy/prebuilts/edition.ts | 10 ++--- .../routes/deploy/prebuilts/editionDrop.ts | 10 ++--- .../routes/deploy/prebuilts/marketplaceV3.ts | 10 ++--- .../routes/deploy/prebuilts/multiwrap.ts | 10 ++--- .../routes/deploy/prebuilts/nftCollection.ts | 10 ++--- src/server/routes/deploy/prebuilts/nftDrop.ts | 10 ++--- src/server/routes/deploy/prebuilts/pack.ts | 10 ++--- .../routes/deploy/prebuilts/signatureDrop.ts | 10 ++--- src/server/routes/deploy/prebuilts/split.ts | 10 ++--- src/server/routes/deploy/prebuilts/token.ts | 10 ++--- .../routes/deploy/prebuilts/tokenDrop.ts | 10 ++--- src/server/routes/deploy/prebuilts/vote.ts | 10 ++--- src/server/routes/deploy/published.ts | 8 ++-- src/server/routes/relayer/create.ts | 2 +- src/server/routes/relayer/getAll.ts | 2 +- src/server/routes/relayer/index.ts | 8 ++-- src/server/routes/relayer/revoke.ts | 2 +- src/server/routes/relayer/update.ts | 2 +- src/server/routes/system/health.ts | 8 ++-- src/server/routes/system/queue.ts | 6 +-- .../routes/transaction/blockchain/getLogs.ts | 8 ++-- .../transaction/blockchain/getReceipt.ts | 4 +- .../blockchain/getUserOpReceipt.ts | 2 +- .../transaction/blockchain/sendSignedTx.ts | 4 +- .../blockchain/sendSignedUserOp.ts | 4 +- src/server/routes/transaction/cancel.ts | 18 ++++---- src/server/routes/transaction/getAll.ts | 2 +- .../transaction/getAllDeployedContracts.ts | 6 +-- src/server/routes/transaction/retry-failed.ts | 6 +-- src/server/routes/transaction/retry.ts | 10 ++--- src/server/routes/transaction/status.ts | 10 ++--- src/server/routes/transaction/sync-retry.ts | 21 ++++------ src/server/routes/webhooks/create.ts | 8 ++-- src/server/routes/webhooks/events.ts | 6 +-- src/server/routes/webhooks/getAll.ts | 2 +- src/server/routes/webhooks/revoke.ts | 4 +- src/server/routes/webhooks/test.ts | 4 +- .../auth.ts => server/schemas/auth/index.ts} | 0 .../keypair.ts => server/schemas/keypairs.ts} | 4 +- src/server/schemas/transaction/index.ts | 2 +- src/server/schemas/wallet/index.ts | 2 +- src/server/utils/chain.ts | 2 +- src/server/utils/storage/localStorage.ts | 8 ++-- src/server/utils/transactionOverrides.ts | 4 +- .../utils/wallets/createGcpKmsWallet.ts | 6 +-- src/server/utils/wallets/createLocalWallet.ts | 6 +-- src/server/utils/wallets/createSmartWallet.ts | 6 +-- .../utils/wallets/fetchAwsKmsWalletParams.ts | 2 +- .../utils/wallets/fetchGcpKmsWalletParams.ts | 2 +- src/server/utils/wallets/getAwsKmsAccount.ts | 2 +- src/server/utils/wallets/getGcpKmsAccount.ts | 2 +- src/server/utils/wallets/getLocalWallet.ts | 10 ++--- src/server/utils/wallets/getSmartWallet.ts | 6 +-- .../utils/wallets/importAwsKmsWallet.ts | 6 +-- .../utils/wallets/importGcpKmsWallet.ts | 6 +-- src/server/utils/wallets/importLocalWallet.ts | 2 +- src/server/utils/websocket.ts | 12 +++--- {tests/unit => src/tests}/auth.test.ts | 27 ++++++------ {tests/unit => src/tests}/aws-arn.test.ts | 2 +- {tests/unit => src/tests}/chain.test.ts | 4 +- {tests/shared => src/tests/config}/aws-kms.ts | 0 {tests/shared => src/tests/config}/gcp-kms.ts | 0 .../tests}/gcp-resource-path.test.ts | 2 +- {tests/unit => src/tests}/math.test.ts | 2 +- {tests/unit => src/tests}/schema.test.ts | 4 +- {tests => src/tests}/shared/chain.ts | 0 {tests => src/tests}/shared/client.ts | 0 {tests => src/tests}/shared/typed-data.ts | 0 {tests/unit => src/tests}/swr.test.ts | 2 +- {tests/unit => src/tests}/validator.test.ts | 2 +- .../tests/wallets}/aws-kms.test.ts | 7 +++- .../tests/wallets}/gcp-kms.test.ts | 8 ++-- src/{shared => }/utils/account.ts | 12 +++--- src/{shared => }/utils/auth.ts | 0 src/{shared => }/utils/block.ts | 0 src/{shared => }/utils/cache/accessToken.ts | 0 src/{shared => }/utils/cache/authWallet.ts | 0 src/{shared => }/utils/cache/clearCache.ts | 0 src/{shared => }/utils/cache/getConfig.ts | 2 +- src/{shared => }/utils/cache/getContract.ts | 6 +-- src/{shared => }/utils/cache/getContractv5.ts | 0 src/{shared => }/utils/cache/getSdk.ts | 2 +- .../utils/cache/getSmartWalletV5.ts | 0 src/{shared => }/utils/cache/getWallet.ts | 14 +++---- src/{shared => }/utils/cache/getWebhook.ts | 2 +- src/{shared => }/utils/cache/keypair.ts | 0 src/{shared => }/utils/chain.ts | 0 src/{shared => }/utils/cron/clearCacheCron.ts | 0 src/{shared => }/utils/cron/isValidCron.ts | 2 +- src/{shared => }/utils/crypto.ts | 0 src/{shared => }/utils/date.ts | 0 src/{shared => }/utils/env.ts | 0 src/{shared => }/utils/error.ts | 0 src/{shared => }/utils/ethers.ts | 0 .../utils/indexer/getBlockTime.ts | 0 src/{shared => }/utils/logger.ts | 0 src/{shared => }/utils/math.ts | 0 src/{shared => }/utils/primitiveTypes.ts | 0 src/{shared => }/utils/prometheus.ts | 2 +- src/{shared => }/utils/redis/lock.ts | 0 src/{shared => }/utils/redis/redis.ts | 0 src/{shared => }/utils/sdk.ts | 0 src/{ => utils}/tracer.ts | 2 +- .../utils/transaction/cancelTransaction.ts | 0 .../utils/transaction/insertTransaction.ts | 8 ++-- .../utils/transaction/queueTransation.ts | 6 +-- .../transaction/simulateQueuedTransaction.ts | 0 src/{shared => }/utils/transaction/types.ts | 0 src/{shared => }/utils/transaction/webhook.ts | 4 +- src/{shared => }/utils/usage.ts | 18 ++++---- src/{shared => }/utils/webhook.ts | 0 src/worker/indexers/chainIndexerRegistry.ts | 4 +- src/worker/listeners/chainIndexerListener.ts | 4 +- src/worker/listeners/configListener.ts | 8 ++-- src/worker/listeners/webhookListener.ts | 6 +-- .../queues/cancelRecycledNoncesQueue.ts | 2 +- .../migratePostgresTransactionsQueue.ts | 2 +- src/worker/queues/mineTransactionQueue.ts | 2 +- src/worker/queues/nonceHealthCheckQueue.ts | 2 +- src/worker/queues/nonceResyncQueue.ts | 2 +- src/worker/queues/processEventLogsQueue.ts | 6 +-- .../queues/processTransactionReceiptsQueue.ts | 6 +-- src/worker/queues/pruneTransactionsQueue.ts | 2 +- src/worker/queues/queues.ts | 4 +- src/worker/queues/sendTransactionQueue.ts | 2 +- src/worker/queues/sendWebhookQueue.ts | 8 ++-- .../tasks/cancelRecycledNoncesWorker.ts | 14 +++---- src/worker/tasks/chainIndexer.ts | 14 +++---- src/worker/tasks/manageChainIndexers.ts | 2 +- .../migratePostgresTransactionsWorker.ts | 19 ++++----- src/worker/tasks/mineTransactionWorker.ts | 39 ++++++++---------- src/worker/tasks/nonceHealthCheckWorker.ts | 6 +-- src/worker/tasks/nonceResyncWorker.ts | 14 +++---- src/worker/tasks/processEventLogsWorker.ts | 18 ++++---- .../tasks/processTransactionReceiptsWorker.ts | 18 ++++---- src/worker/tasks/pruneTransactionsWorker.ts | 8 ++-- src/worker/tasks/sendTransactionWorker.ts | 30 +++++++------- src/worker/tasks/sendWebhookWorker.ts | 13 +++--- src/worker/utils/contractId.ts | 2 + src/worker/utils/nonce.ts | 25 +++++++++++ {tests => test}/e2e/.env.test.example | 0 {tests => test}/e2e/.gitignore | 0 {tests => test}/e2e/README.md | 0 {tests => test}/e2e/bun.lockb | Bin {tests => test}/e2e/config.ts | 0 {tests => test}/e2e/package.json | 0 {tests => test}/e2e/scripts/counter.ts | 4 +- {tests => test}/e2e/tests/extensions.test.ts | 2 +- {tests => test}/e2e/tests/load.test.ts | 2 +- {tests => test}/e2e/tests/read.test.ts | 2 +- .../e2e/tests/routes/erc1155-transfer.test.ts | 0 .../e2e/tests/routes/erc20-transfer.test.ts | 2 +- .../e2e/tests/routes/erc721-transfer.test.ts | 0 .../e2e/tests/routes/signMessage.test.ts | 0 .../e2e/tests/routes/signaturePrepare.test.ts | 0 .../e2e/tests/routes/write.test.ts | 8 ++-- {tests => test}/e2e/tests/setup.ts | 2 +- .../e2e/tests/sign-transaction.test.ts | 0 .../smart-aws-wallet.test.ts | 0 .../smart-gcp-wallet.test.ts | 0 .../smart-local-wallet-sdk-v4.test.ts | 0 .../smart-local-wallet.test.ts | 0 {tests => test}/e2e/tests/smoke.test.ts | 0 {tests => test}/e2e/tests/userop.test.ts | 2 +- .../e2e/tests/utils/getBlockTime.test.ts | 0 {tests => test}/e2e/tsconfig.json | 0 {tests => test}/e2e/utils/anvil.ts | 0 {tests => test}/e2e/utils/engine.ts | 2 +- {tests => test}/e2e/utils/statistics.ts | 0 {tests => test}/e2e/utils/transactions.ts | 4 +- {tests => test}/e2e/utils/wallets.ts | 0 tsconfig.json | 2 +- vitest.config.ts | 3 +- vitest.global-setup.ts | 28 ++++++------- 449 files changed, 1000 insertions(+), 978 deletions(-) create mode 100644 .vscode/settings.json rename src/{shared/schemas => constants}/relayer.ts (100%) rename src/{shared => }/db/chainIndexers/getChainIndexer.ts (94%) rename src/{shared => }/db/chainIndexers/upsertChainIndexer.ts (91%) rename src/{shared => }/db/client.ts (84%) rename src/{shared => }/db/configuration/getConfiguration.ts (98%) rename src/{shared => }/db/configuration/updateConfiguration.ts (100%) rename src/{shared => }/db/contractEventLogs/createContractEventLogs.ts (78%) rename src/{shared => }/db/contractEventLogs/deleteContractEventLogs.ts (100%) rename src/{shared => }/db/contractEventLogs/getContractEventLogs.ts (100%) rename src/{shared => }/db/contractSubscriptions/createContractSubscription.ts (100%) rename src/{shared => }/db/contractSubscriptions/deleteContractSubscription.ts (100%) rename src/{shared => }/db/contractSubscriptions/getContractSubscriptions.ts (100%) rename src/{shared => }/db/contractTransactionReceipts/createContractTransactionReceipts.ts (91%) rename src/{shared => }/db/contractTransactionReceipts/deleteContractTransactionReceipts.ts (100%) rename src/{shared => }/db/contractTransactionReceipts/getContractTransactionReceipts.ts (100%) rename src/{shared => }/db/keypair/delete.ts (100%) rename src/{shared => }/db/keypair/get.ts (100%) rename src/{shared => }/db/keypair/insert.ts (72%) rename src/{shared => }/db/keypair/list.ts (100%) rename src/{shared => }/db/permissions/deletePermissions.ts (100%) rename src/{shared => }/db/permissions/getPermissions.ts (92%) rename src/{shared => }/db/permissions/updatePermissions.ts (100%) rename src/{shared => }/db/relayer/getRelayerById.ts (100%) rename src/{shared => }/db/tokens/createToken.ts (100%) rename src/{shared => }/db/tokens/getAccessTokens.ts (100%) rename src/{shared => }/db/tokens/getToken.ts (100%) rename src/{shared => }/db/tokens/revokeToken.ts (100%) rename src/{shared => }/db/tokens/updateToken.ts (100%) rename src/{shared => }/db/transactions/db.ts (100%) rename src/{shared => }/db/transactions/queueTx.ts (95%) rename src/{shared => }/db/wallets/createWalletDetails.ts (98%) rename src/{shared => }/db/wallets/deleteWalletDetails.ts (100%) rename src/{shared => }/db/wallets/getAllWallets.ts (86%) rename src/{shared => }/db/wallets/getWalletDetails.ts (99%) rename src/{shared => }/db/wallets/nonceMap.ts (98%) rename src/{shared => }/db/wallets/updateWalletDetails.ts (100%) rename src/{shared => }/db/wallets/walletNonce.ts (100%) rename src/{shared => }/db/webhooks/createWebhook.ts (91%) rename src/{shared => }/db/webhooks/getAllWebhooks.ts (100%) rename src/{shared => }/db/webhooks/getWebhook.ts (100%) rename src/{shared => }/db/webhooks/revokeWebhook.ts (100%) rename src/{shared => }/lib/cache/swr.ts (100%) rename src/{shared => }/lib/chain/chain-capabilities.ts (100%) rename src/{shared => }/lib/transaction/get-transaction-receipt.ts (100%) rename src/{shared/schemas => schema}/config.ts (100%) rename src/{shared/schemas => schema}/extension.ts (100%) rename src/{shared/schemas => schema}/prisma.ts (100%) rename src/{shared/schemas => schema}/wallet.ts (100%) rename src/{shared/schemas => schema}/webhooks.ts (100%) rename {scripts => src/scripts}/apply-migrations.ts (88%) rename {scripts => src/scripts}/generate-sdk.ts (100%) rename {scripts => src/scripts}/setup-db.ts (79%) rename src/{shared/schemas/auth.ts => server/schemas/auth/index.ts} (100%) rename src/{shared/schemas/keypair.ts => server/schemas/keypairs.ts} (93%) rename {tests/unit => src/tests}/auth.test.ts (96%) rename {tests/unit => src/tests}/aws-arn.test.ts (97%) rename {tests/unit => src/tests}/chain.test.ts (96%) rename {tests/shared => src/tests/config}/aws-kms.ts (100%) rename {tests/shared => src/tests/config}/gcp-kms.ts (100%) rename {tests/unit => src/tests}/gcp-resource-path.test.ts (97%) rename {tests/unit => src/tests}/math.test.ts (93%) rename {tests/unit => src/tests}/schema.test.ts (97%) rename {tests => src/tests}/shared/chain.ts (100%) rename {tests => src/tests}/shared/client.ts (100%) rename {tests => src/tests}/shared/typed-data.ts (100%) rename {tests/unit => src/tests}/swr.test.ts (98%) rename {tests/unit => src/tests}/validator.test.ts (94%) rename {tests/unit => src/tests/wallets}/aws-kms.test.ts (95%) rename {tests/unit => src/tests/wallets}/gcp-kms.test.ts (94%) rename src/{shared => }/utils/account.ts (93%) rename src/{shared => }/utils/auth.ts (100%) rename src/{shared => }/utils/block.ts (100%) rename src/{shared => }/utils/cache/accessToken.ts (100%) rename src/{shared => }/utils/cache/authWallet.ts (100%) rename src/{shared => }/utils/cache/clearCache.ts (100%) rename src/{shared => }/utils/cache/getConfig.ts (86%) rename src/{shared => }/utils/cache/getContract.ts (82%) rename src/{shared => }/utils/cache/getContractv5.ts (100%) rename src/{shared => }/utils/cache/getSdk.ts (97%) rename src/{shared => }/utils/cache/getSmartWalletV5.ts (100%) rename src/{shared => }/utils/cache/getWallet.ts (91%) rename src/{shared => }/utils/cache/getWebhook.ts (91%) rename src/{shared => }/utils/cache/keypair.ts (100%) rename src/{shared => }/utils/chain.ts (100%) rename src/{shared => }/utils/cron/clearCacheCron.ts (100%) rename src/{shared => }/utils/cron/isValidCron.ts (96%) rename src/{shared => }/utils/crypto.ts (100%) rename src/{shared => }/utils/date.ts (100%) rename src/{shared => }/utils/env.ts (100%) rename src/{shared => }/utils/error.ts (100%) rename src/{shared => }/utils/ethers.ts (100%) rename src/{shared => }/utils/indexer/getBlockTime.ts (100%) rename src/{shared => }/utils/logger.ts (100%) rename src/{shared => }/utils/math.ts (100%) rename src/{shared => }/utils/primitiveTypes.ts (100%) rename src/{shared => }/utils/prometheus.ts (98%) rename src/{shared => }/utils/redis/lock.ts (100%) rename src/{shared => }/utils/redis/redis.ts (100%) rename src/{shared => }/utils/sdk.ts (100%) rename src/{ => utils}/tracer.ts (79%) rename src/{shared => }/utils/transaction/cancelTransaction.ts (100%) rename src/{shared => }/utils/transaction/insertTransaction.ts (95%) rename src/{shared => }/utils/transaction/queueTransation.ts (90%) rename src/{shared => }/utils/transaction/simulateQueuedTransaction.ts (100%) rename src/{shared => }/utils/transaction/types.ts (100%) rename src/{shared => }/utils/transaction/webhook.ts (80%) rename src/{shared => }/utils/usage.ts (86%) rename src/{shared => }/utils/webhook.ts (100%) create mode 100644 src/worker/utils/contractId.ts create mode 100644 src/worker/utils/nonce.ts rename {tests => test}/e2e/.env.test.example (100%) rename {tests => test}/e2e/.gitignore (100%) rename {tests => test}/e2e/README.md (100%) rename {tests => test}/e2e/bun.lockb (100%) rename {tests => test}/e2e/config.ts (100%) rename {tests => test}/e2e/package.json (100%) rename {tests => test}/e2e/scripts/counter.ts (90%) rename {tests => test}/e2e/tests/extensions.test.ts (98%) rename {tests => test}/e2e/tests/load.test.ts (98%) rename {tests => test}/e2e/tests/read.test.ts (99%) rename {tests => test}/e2e/tests/routes/erc1155-transfer.test.ts (100%) rename {tests => test}/e2e/tests/routes/erc20-transfer.test.ts (99%) rename {tests => test}/e2e/tests/routes/erc721-transfer.test.ts (100%) rename {tests => test}/e2e/tests/routes/signMessage.test.ts (100%) rename {tests => test}/e2e/tests/routes/signaturePrepare.test.ts (100%) rename {tests => test}/e2e/tests/routes/write.test.ts (97%) rename {tests => test}/e2e/tests/setup.ts (96%) rename {tests => test}/e2e/tests/sign-transaction.test.ts (100%) rename {tests => test}/e2e/tests/smart-backend-wallet/smart-aws-wallet.test.ts (100%) rename {tests => test}/e2e/tests/smart-backend-wallet/smart-gcp-wallet.test.ts (100%) rename {tests => test}/e2e/tests/smart-backend-wallet/smart-local-wallet-sdk-v4.test.ts (100%) rename {tests => test}/e2e/tests/smart-backend-wallet/smart-local-wallet.test.ts (100%) rename {tests => test}/e2e/tests/smoke.test.ts (100%) rename {tests => test}/e2e/tests/userop.test.ts (98%) rename {tests => test}/e2e/tests/utils/getBlockTime.test.ts (100%) rename {tests => test}/e2e/tsconfig.json (100%) rename {tests => test}/e2e/utils/anvil.ts (100%) rename {tests => test}/e2e/utils/engine.ts (95%) rename {tests => test}/e2e/utils/statistics.ts (100%) rename {tests => test}/e2e/utils/transactions.ts (95%) rename {tests => test}/e2e/utils/wallets.ts (100%) diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..3bbcfc60d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,17 @@ +{ + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit", + "source.eslint.fixAll": "explicit" + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }], + "typescript.tsdk": "node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true, + "[prisma]": { + "editor.defaultFormatter": "Prisma.prisma" + }, + "[typescript]": { + "editor.defaultFormatter": "biomejs.biome" + } +} diff --git a/Dockerfile b/Dockerfile index 9728e659f..4cf99266f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,7 +64,6 @@ COPY --from=build /app/package.json . COPY --from=build /app/node_modules ./node_modules COPY --from=build /app/src/prisma/* ./src/prisma/ COPY --from=build /app/dist ./dist -COPY --from=build /app/scripts ./dist/scripts # Replace the schema path in the package.json file RUN sed -i 's_"schema": "./src/prisma/schema.prisma"_"schema": "./dist/prisma/schema.prisma"_g' package.json diff --git a/package.json b/package.json index f8497a342..371ab1621 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "dev:run": "npx nodemon --watch 'src/**/*.ts' --exec 'npx tsx ./src/index.ts' --files src/index.ts", "build": "rm -rf dist && tsc -p ./tsconfig.json --outDir dist", "build:docker": "docker build . -f Dockerfile -t prod", - "generate:sdk": "npx tsx ./scripts/generate-sdk && cd ./sdk && yarn build", - "prisma:setup:dev": "npx tsx ./scripts/setup-db.ts", + "generate:sdk": "npx tsx ./src/scripts/generate-sdk && cd ./sdk && yarn build", + "prisma:setup:dev": "npx tsx ./src/scripts/setup-db.ts", "prisma:setup:prod": "npx tsx ./dist/scripts/setup-db.js", "start": "yarn prisma:setup:prod && yarn start:migrations && yarn start:run", "start:migrations": "npx tsx ./dist/scripts/apply-migrations.js", diff --git a/src/shared/schemas/relayer.ts b/src/constants/relayer.ts similarity index 100% rename from src/shared/schemas/relayer.ts rename to src/constants/relayer.ts diff --git a/src/shared/db/chainIndexers/getChainIndexer.ts b/src/db/chainIndexers/getChainIndexer.ts similarity index 94% rename from src/shared/db/chainIndexers/getChainIndexer.ts rename to src/db/chainIndexers/getChainIndexer.ts index ae7f3e7e8..166c2f228 100644 --- a/src/shared/db/chainIndexers/getChainIndexer.ts +++ b/src/db/chainIndexers/getChainIndexer.ts @@ -1,5 +1,5 @@ import { Prisma } from "@prisma/client"; -import type { PrismaTransaction } from "../../schemas/prisma"; +import type { PrismaTransaction } from "../../schema/prisma"; import { getPrismaWithPostgresTx } from "../client"; interface GetLastIndexedBlockParams { diff --git a/src/shared/db/chainIndexers/upsertChainIndexer.ts b/src/db/chainIndexers/upsertChainIndexer.ts similarity index 91% rename from src/shared/db/chainIndexers/upsertChainIndexer.ts rename to src/db/chainIndexers/upsertChainIndexer.ts index 744a12a81..123a2a464 100644 --- a/src/shared/db/chainIndexers/upsertChainIndexer.ts +++ b/src/db/chainIndexers/upsertChainIndexer.ts @@ -1,4 +1,4 @@ -import type { PrismaTransaction } from "../../schemas/prisma"; +import type { PrismaTransaction } from "../../schema/prisma"; import { getPrismaWithPostgresTx } from "../client"; interface UpsertChainIndexerParams { diff --git a/src/shared/db/client.ts b/src/db/client.ts similarity index 84% rename from src/shared/db/client.ts rename to src/db/client.ts index 9c57b1417..bddb0eafe 100644 --- a/src/shared/db/client.ts +++ b/src/db/client.ts @@ -1,6 +1,6 @@ import { PrismaClient } from "@prisma/client"; -import pg, { type Knex } from "knex"; -import type { PrismaTransaction } from "../schemas/prisma"; +import pg, { Knex } from "knex"; +import { PrismaTransaction } from "../schema/prisma"; import { env } from "../utils/env"; export const prisma = new PrismaClient({ @@ -26,7 +26,7 @@ export const isDatabaseReachable = async () => { try { await prisma.walletDetails.findFirst(); return true; - } catch { + } catch (error) { return false; } }; diff --git a/src/shared/db/configuration/getConfiguration.ts b/src/db/configuration/getConfiguration.ts similarity index 98% rename from src/shared/db/configuration/getConfiguration.ts rename to src/db/configuration/getConfiguration.ts index 5d1698ccd..67c47f9a6 100644 --- a/src/shared/db/configuration/getConfiguration.ts +++ b/src/db/configuration/getConfiguration.ts @@ -7,9 +7,9 @@ import type { AwsWalletConfiguration, GcpWalletConfiguration, ParsedConfig, -} from "../../schemas/config"; -import { WalletType } from "../../schemas/wallet"; -import { mandatoryAllowedCorsUrls } from "../../../server/utils/cors-urls"; +} from "../../schema/config"; +import { WalletType } from "../../schema/wallet"; +import { mandatoryAllowedCorsUrls } from "../../server/utils/cors-urls"; import type { networkResponseSchema } from "../../utils/cache/getSdk"; import { decrypt } from "../../utils/crypto"; import { env } from "../../utils/env"; diff --git a/src/shared/db/configuration/updateConfiguration.ts b/src/db/configuration/updateConfiguration.ts similarity index 100% rename from src/shared/db/configuration/updateConfiguration.ts rename to src/db/configuration/updateConfiguration.ts diff --git a/src/shared/db/contractEventLogs/createContractEventLogs.ts b/src/db/contractEventLogs/createContractEventLogs.ts similarity index 78% rename from src/shared/db/contractEventLogs/createContractEventLogs.ts rename to src/db/contractEventLogs/createContractEventLogs.ts index 5b4c94e13..cb498e9c1 100644 --- a/src/shared/db/contractEventLogs/createContractEventLogs.ts +++ b/src/db/contractEventLogs/createContractEventLogs.ts @@ -1,5 +1,5 @@ -import type { ContractEventLogs, Prisma } from "@prisma/client"; -import type { PrismaTransaction } from "../../schemas/prisma"; +import { ContractEventLogs, Prisma } from "@prisma/client"; +import { PrismaTransaction } from "../../schema/prisma"; import { getPrismaWithPostgresTx } from "../client"; export interface BulkInsertContractLogsParams { diff --git a/src/shared/db/contractEventLogs/deleteContractEventLogs.ts b/src/db/contractEventLogs/deleteContractEventLogs.ts similarity index 100% rename from src/shared/db/contractEventLogs/deleteContractEventLogs.ts rename to src/db/contractEventLogs/deleteContractEventLogs.ts diff --git a/src/shared/db/contractEventLogs/getContractEventLogs.ts b/src/db/contractEventLogs/getContractEventLogs.ts similarity index 100% rename from src/shared/db/contractEventLogs/getContractEventLogs.ts rename to src/db/contractEventLogs/getContractEventLogs.ts diff --git a/src/shared/db/contractSubscriptions/createContractSubscription.ts b/src/db/contractSubscriptions/createContractSubscription.ts similarity index 100% rename from src/shared/db/contractSubscriptions/createContractSubscription.ts rename to src/db/contractSubscriptions/createContractSubscription.ts diff --git a/src/shared/db/contractSubscriptions/deleteContractSubscription.ts b/src/db/contractSubscriptions/deleteContractSubscription.ts similarity index 100% rename from src/shared/db/contractSubscriptions/deleteContractSubscription.ts rename to src/db/contractSubscriptions/deleteContractSubscription.ts diff --git a/src/shared/db/contractSubscriptions/getContractSubscriptions.ts b/src/db/contractSubscriptions/getContractSubscriptions.ts similarity index 100% rename from src/shared/db/contractSubscriptions/getContractSubscriptions.ts rename to src/db/contractSubscriptions/getContractSubscriptions.ts diff --git a/src/shared/db/contractTransactionReceipts/createContractTransactionReceipts.ts b/src/db/contractTransactionReceipts/createContractTransactionReceipts.ts similarity index 91% rename from src/shared/db/contractTransactionReceipts/createContractTransactionReceipts.ts rename to src/db/contractTransactionReceipts/createContractTransactionReceipts.ts index ac3396516..1cd733b4c 100644 --- a/src/shared/db/contractTransactionReceipts/createContractTransactionReceipts.ts +++ b/src/db/contractTransactionReceipts/createContractTransactionReceipts.ts @@ -1,5 +1,5 @@ import { ContractTransactionReceipts, Prisma } from "@prisma/client"; -import { PrismaTransaction } from "../../schemas/prisma"; +import { PrismaTransaction } from "../../schema/prisma"; import { getPrismaWithPostgresTx } from "../client"; export interface BulkInsertContractLogsParams { diff --git a/src/shared/db/contractTransactionReceipts/deleteContractTransactionReceipts.ts b/src/db/contractTransactionReceipts/deleteContractTransactionReceipts.ts similarity index 100% rename from src/shared/db/contractTransactionReceipts/deleteContractTransactionReceipts.ts rename to src/db/contractTransactionReceipts/deleteContractTransactionReceipts.ts diff --git a/src/shared/db/contractTransactionReceipts/getContractTransactionReceipts.ts b/src/db/contractTransactionReceipts/getContractTransactionReceipts.ts similarity index 100% rename from src/shared/db/contractTransactionReceipts/getContractTransactionReceipts.ts rename to src/db/contractTransactionReceipts/getContractTransactionReceipts.ts diff --git a/src/shared/db/keypair/delete.ts b/src/db/keypair/delete.ts similarity index 100% rename from src/shared/db/keypair/delete.ts rename to src/db/keypair/delete.ts diff --git a/src/shared/db/keypair/get.ts b/src/db/keypair/get.ts similarity index 100% rename from src/shared/db/keypair/get.ts rename to src/db/keypair/get.ts diff --git a/src/shared/db/keypair/insert.ts b/src/db/keypair/insert.ts similarity index 72% rename from src/shared/db/keypair/insert.ts rename to src/db/keypair/insert.ts index 77f1ada59..c6d7b737d 100644 --- a/src/shared/db/keypair/insert.ts +++ b/src/db/keypair/insert.ts @@ -1,6 +1,6 @@ -import type { Keypairs } from "@prisma/client"; -import { createHash } from "node:crypto"; -import type { KeypairAlgorithm } from "../../schemas/keypair"; +import { Keypairs } from "@prisma/client"; +import { createHash } from "crypto"; +import { KeypairAlgorithm } from "../../server/schemas/keypairs"; import { prisma } from "../client"; export const insertKeypair = async ({ diff --git a/src/shared/db/keypair/list.ts b/src/db/keypair/list.ts similarity index 100% rename from src/shared/db/keypair/list.ts rename to src/db/keypair/list.ts diff --git a/src/shared/db/permissions/deletePermissions.ts b/src/db/permissions/deletePermissions.ts similarity index 100% rename from src/shared/db/permissions/deletePermissions.ts rename to src/db/permissions/deletePermissions.ts diff --git a/src/shared/db/permissions/getPermissions.ts b/src/db/permissions/getPermissions.ts similarity index 92% rename from src/shared/db/permissions/getPermissions.ts rename to src/db/permissions/getPermissions.ts index 7017ae12e..6d178b5eb 100644 --- a/src/shared/db/permissions/getPermissions.ts +++ b/src/db/permissions/getPermissions.ts @@ -1,4 +1,4 @@ -import { Permission } from "../../schemas/auth"; +import { Permission } from "../../server/schemas/auth"; import { env } from "../../utils/env"; import { prisma } from "../client"; diff --git a/src/shared/db/permissions/updatePermissions.ts b/src/db/permissions/updatePermissions.ts similarity index 100% rename from src/shared/db/permissions/updatePermissions.ts rename to src/db/permissions/updatePermissions.ts diff --git a/src/shared/db/relayer/getRelayerById.ts b/src/db/relayer/getRelayerById.ts similarity index 100% rename from src/shared/db/relayer/getRelayerById.ts rename to src/db/relayer/getRelayerById.ts diff --git a/src/shared/db/tokens/createToken.ts b/src/db/tokens/createToken.ts similarity index 100% rename from src/shared/db/tokens/createToken.ts rename to src/db/tokens/createToken.ts diff --git a/src/shared/db/tokens/getAccessTokens.ts b/src/db/tokens/getAccessTokens.ts similarity index 100% rename from src/shared/db/tokens/getAccessTokens.ts rename to src/db/tokens/getAccessTokens.ts diff --git a/src/shared/db/tokens/getToken.ts b/src/db/tokens/getToken.ts similarity index 100% rename from src/shared/db/tokens/getToken.ts rename to src/db/tokens/getToken.ts diff --git a/src/shared/db/tokens/revokeToken.ts b/src/db/tokens/revokeToken.ts similarity index 100% rename from src/shared/db/tokens/revokeToken.ts rename to src/db/tokens/revokeToken.ts diff --git a/src/shared/db/tokens/updateToken.ts b/src/db/tokens/updateToken.ts similarity index 100% rename from src/shared/db/tokens/updateToken.ts rename to src/db/tokens/updateToken.ts diff --git a/src/shared/db/transactions/db.ts b/src/db/transactions/db.ts similarity index 100% rename from src/shared/db/transactions/db.ts rename to src/db/transactions/db.ts diff --git a/src/shared/db/transactions/queueTx.ts b/src/db/transactions/queueTx.ts similarity index 95% rename from src/shared/db/transactions/queueTx.ts rename to src/db/transactions/queueTx.ts index 4c12eeae0..76baa3656 100644 --- a/src/shared/db/transactions/queueTx.ts +++ b/src/db/transactions/queueTx.ts @@ -1,11 +1,11 @@ import type { DeployTransaction, Transaction } from "@thirdweb-dev/sdk"; import type { ERC4337EthersSigner } from "@thirdweb-dev/wallets/dist/declarations/src/evm/connectors/smart-wallet/lib/erc4337-signer"; import { ZERO_ADDRESS, type Address } from "thirdweb"; -import type { ContractExtension } from "../../schemas/extension"; +import type { ContractExtension } from "../../schema/extension"; +import { parseTransactionOverrides } from "../../server/utils/transactionOverrides"; import { maybeBigInt, normalizeAddress } from "../../utils/primitiveTypes"; import { insertTransaction } from "../../utils/transaction/insertTransaction"; import type { InsertedTransaction } from "../../utils/transaction/types"; -import { parseTransactionOverrides } from "../../../server/utils/transactionOverrides"; interface QueueTxParams { // we should move away from Transaction type (v4 SDK) diff --git a/src/shared/db/wallets/createWalletDetails.ts b/src/db/wallets/createWalletDetails.ts similarity index 98% rename from src/shared/db/wallets/createWalletDetails.ts rename to src/db/wallets/createWalletDetails.ts index 2dbb2f242..13f89c41a 100644 --- a/src/shared/db/wallets/createWalletDetails.ts +++ b/src/db/wallets/createWalletDetails.ts @@ -1,5 +1,5 @@ import type { Address } from "thirdweb"; -import type { PrismaTransaction } from "../../schemas/prisma"; +import type { PrismaTransaction } from "../../schema/prisma"; import { encrypt } from "../../utils/crypto"; import { getPrismaWithPostgresTx } from "../client"; diff --git a/src/shared/db/wallets/deleteWalletDetails.ts b/src/db/wallets/deleteWalletDetails.ts similarity index 100% rename from src/shared/db/wallets/deleteWalletDetails.ts rename to src/db/wallets/deleteWalletDetails.ts diff --git a/src/shared/db/wallets/getAllWallets.ts b/src/db/wallets/getAllWallets.ts similarity index 86% rename from src/shared/db/wallets/getAllWallets.ts rename to src/db/wallets/getAllWallets.ts index 5f0603e81..fd8ef80a0 100644 --- a/src/shared/db/wallets/getAllWallets.ts +++ b/src/db/wallets/getAllWallets.ts @@ -1,4 +1,4 @@ -import { PrismaTransaction } from "../../schemas/prisma"; +import { PrismaTransaction } from "../../schema/prisma"; import { getPrismaWithPostgresTx } from "../client"; interface GetAllWalletsParams { diff --git a/src/shared/db/wallets/getWalletDetails.ts b/src/db/wallets/getWalletDetails.ts similarity index 99% rename from src/shared/db/wallets/getWalletDetails.ts rename to src/db/wallets/getWalletDetails.ts index fcbc8e9d6..fcc8db3f5 100644 --- a/src/shared/db/wallets/getWalletDetails.ts +++ b/src/db/wallets/getWalletDetails.ts @@ -1,6 +1,6 @@ import { getAddress } from "thirdweb"; import { z } from "zod"; -import type { PrismaTransaction } from "../../schemas/prisma"; +import type { PrismaTransaction } from "../../schema/prisma"; import { getConfig } from "../../utils/cache/getConfig"; import { decrypt } from "../../utils/crypto"; import { env } from "../../utils/env"; diff --git a/src/shared/db/wallets/nonceMap.ts b/src/db/wallets/nonceMap.ts similarity index 98% rename from src/shared/db/wallets/nonceMap.ts rename to src/db/wallets/nonceMap.ts index aac67c2be..868b00dcc 100644 --- a/src/shared/db/wallets/nonceMap.ts +++ b/src/db/wallets/nonceMap.ts @@ -1,4 +1,4 @@ -import type { Address } from "thirdweb"; +import { Address } from "thirdweb"; import { env } from "../../utils/env"; import { normalizeAddress } from "../../utils/primitiveTypes"; import { redis } from "../../utils/redis/redis"; diff --git a/src/shared/db/wallets/updateWalletDetails.ts b/src/db/wallets/updateWalletDetails.ts similarity index 100% rename from src/shared/db/wallets/updateWalletDetails.ts rename to src/db/wallets/updateWalletDetails.ts diff --git a/src/shared/db/wallets/walletNonce.ts b/src/db/wallets/walletNonce.ts similarity index 100% rename from src/shared/db/wallets/walletNonce.ts rename to src/db/wallets/walletNonce.ts diff --git a/src/shared/db/webhooks/createWebhook.ts b/src/db/webhooks/createWebhook.ts similarity index 91% rename from src/shared/db/webhooks/createWebhook.ts rename to src/db/webhooks/createWebhook.ts index 7c32a5f13..8e8bb66d7 100644 --- a/src/shared/db/webhooks/createWebhook.ts +++ b/src/db/webhooks/createWebhook.ts @@ -1,6 +1,6 @@ import { Webhooks } from "@prisma/client"; import { createHash, randomBytes } from "crypto"; -import { WebhooksEventTypes } from "../../schemas/webhooks"; +import { WebhooksEventTypes } from "../../schema/webhooks"; import { prisma } from "../client"; interface CreateWebhooksParams { diff --git a/src/shared/db/webhooks/getAllWebhooks.ts b/src/db/webhooks/getAllWebhooks.ts similarity index 100% rename from src/shared/db/webhooks/getAllWebhooks.ts rename to src/db/webhooks/getAllWebhooks.ts diff --git a/src/shared/db/webhooks/getWebhook.ts b/src/db/webhooks/getWebhook.ts similarity index 100% rename from src/shared/db/webhooks/getWebhook.ts rename to src/db/webhooks/getWebhook.ts diff --git a/src/shared/db/webhooks/revokeWebhook.ts b/src/db/webhooks/revokeWebhook.ts similarity index 100% rename from src/shared/db/webhooks/revokeWebhook.ts rename to src/db/webhooks/revokeWebhook.ts diff --git a/src/index.ts b/src/index.ts index ba0d72ebb..764540ee4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,8 @@ import "./polyfill"; -import "./tracer"; - import { initServer } from "./server"; -import { env } from "./shared/utils/env"; -import { logger } from "./shared/utils/logger"; +import { env } from "./utils/env"; +import { logger } from "./utils/logger"; +import "./utils/tracer"; import { initWorker } from "./worker"; import { CancelRecycledNoncesQueue } from "./worker/queues/cancelRecycledNoncesQueue"; import { MigratePostgresTransactionsQueue } from "./worker/queues/migratePostgresTransactionsQueue"; diff --git a/src/shared/lib/cache/swr.ts b/src/lib/cache/swr.ts similarity index 100% rename from src/shared/lib/cache/swr.ts rename to src/lib/cache/swr.ts diff --git a/src/shared/lib/chain/chain-capabilities.ts b/src/lib/chain/chain-capabilities.ts similarity index 100% rename from src/shared/lib/chain/chain-capabilities.ts rename to src/lib/chain/chain-capabilities.ts diff --git a/src/shared/lib/transaction/get-transaction-receipt.ts b/src/lib/transaction/get-transaction-receipt.ts similarity index 100% rename from src/shared/lib/transaction/get-transaction-receipt.ts rename to src/lib/transaction/get-transaction-receipt.ts diff --git a/src/polyfill.ts b/src/polyfill.ts index 029207c32..103de544e 100644 --- a/src/polyfill.ts +++ b/src/polyfill.ts @@ -1,4 +1,4 @@ -import * as crypto from "node:crypto"; +import * as crypto from "crypto"; if (typeof globalThis.crypto === "undefined") { (globalThis as any).crypto = crypto; diff --git a/src/shared/schemas/config.ts b/src/schema/config.ts similarity index 100% rename from src/shared/schemas/config.ts rename to src/schema/config.ts diff --git a/src/shared/schemas/extension.ts b/src/schema/extension.ts similarity index 100% rename from src/shared/schemas/extension.ts rename to src/schema/extension.ts diff --git a/src/shared/schemas/prisma.ts b/src/schema/prisma.ts similarity index 100% rename from src/shared/schemas/prisma.ts rename to src/schema/prisma.ts diff --git a/src/shared/schemas/wallet.ts b/src/schema/wallet.ts similarity index 100% rename from src/shared/schemas/wallet.ts rename to src/schema/wallet.ts diff --git a/src/shared/schemas/webhooks.ts b/src/schema/webhooks.ts similarity index 100% rename from src/shared/schemas/webhooks.ts rename to src/schema/webhooks.ts diff --git a/scripts/apply-migrations.ts b/src/scripts/apply-migrations.ts similarity index 88% rename from scripts/apply-migrations.ts rename to src/scripts/apply-migrations.ts index 12b16ff3b..cda3af90c 100644 --- a/scripts/apply-migrations.ts +++ b/src/scripts/apply-migrations.ts @@ -1,10 +1,6 @@ -import { logger } from "../src/shared/utils/logger"; -import { - acquireLock, - releaseLock, - waitForLock, -} from "../src/shared/utils/redis/lock"; -import { redis } from "../src/shared/utils/redis/redis"; +import { logger } from "../utils/logger"; +import { acquireLock, releaseLock, waitForLock } from "../utils/redis/lock"; +import { redis } from "../utils/redis/redis"; const MIGRATION_LOCK_TTL_SECONDS = 60; diff --git a/scripts/generate-sdk.ts b/src/scripts/generate-sdk.ts similarity index 100% rename from scripts/generate-sdk.ts rename to src/scripts/generate-sdk.ts diff --git a/scripts/setup-db.ts b/src/scripts/setup-db.ts similarity index 79% rename from scripts/setup-db.ts rename to src/scripts/setup-db.ts index fa6dad550..80d992fd9 100644 --- a/scripts/setup-db.ts +++ b/src/scripts/setup-db.ts @@ -1,5 +1,5 @@ -import { execSync } from "node:child_process"; -import { prisma } from "../src/shared/db/client"; +import { execSync } from "child_process"; +import { prisma } from "../db/client"; const main = async () => { const [{ exists: hasWalletsTable }]: [{ exists: boolean }] = @@ -14,8 +14,8 @@ const main = async () => { const schema = process.env.NODE_ENV === "production" - ? "./dist/prisma/schema.prisma" - : "./src/prisma/schema.prisma"; + ? `./dist/prisma/schema.prisma` + : `./src/prisma/schema.prisma`; if (hasWalletsTable) { execSync(`yarn prisma migrate reset --force --schema ${schema}`, { diff --git a/src/server/index.ts b/src/server/index.ts index a0a576dfc..4b6deb374 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -3,11 +3,11 @@ import fastify, { type FastifyInstance } from "fastify"; import * as fs from "node:fs"; import path from "node:path"; import { URL } from "node:url"; -import { clearCacheCron } from "../shared/utils/cron/clearCacheCron"; -import { env } from "../shared/utils/env"; -import { logger } from "../shared/utils/logger"; -import { metricsServer } from "../shared/utils/prometheus"; -import { withServerUsageReporting } from "../shared/utils/usage"; +import { clearCacheCron } from "../utils/cron/clearCacheCron"; +import { env } from "../utils/env"; +import { logger } from "../utils/logger"; +import { metricsServer } from "../utils/prometheus"; +import { withServerUsageReporting } from "../utils/usage"; import { updateTxListener } from "./listeners/updateTxListener"; import { withAdminRoutes } from "./middleware/adminRoutes"; import { withAuth } from "./middleware/auth"; diff --git a/src/server/listeners/updateTxListener.ts b/src/server/listeners/updateTxListener.ts index 150a41650..d8ff01ebf 100644 --- a/src/server/listeners/updateTxListener.ts +++ b/src/server/listeners/updateTxListener.ts @@ -1,6 +1,6 @@ -import { knex } from "../../shared/db/client"; -import { TransactionDB } from "../../shared/db/transactions/db"; -import { logger } from "../../shared/utils/logger"; +import { knex } from "../../db/client"; +import { TransactionDB } from "../../db/transactions/db"; +import { logger } from "../../utils/logger"; import { toTransactionSchema } from "../schemas/transaction"; import { subscriptionsData } from "../schemas/websocket"; import { diff --git a/src/server/middleware/adminRoutes.ts b/src/server/middleware/adminRoutes.ts index 297330a13..1dac982df 100644 --- a/src/server/middleware/adminRoutes.ts +++ b/src/server/middleware/adminRoutes.ts @@ -5,7 +5,7 @@ import type { Queue } from "bullmq"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { timingSafeEqual } from "node:crypto"; -import { env } from "../../shared/utils/env"; +import { env } from "../../utils/env"; import { CancelRecycledNoncesQueue } from "../../worker/queues/cancelRecycledNoncesQueue"; import { MigratePostgresTransactionsQueue } from "../../worker/queues/migratePostgresTransactionsQueue"; import { MineTransactionQueue } from "../../worker/queues/mineTransactionQueue"; diff --git a/src/server/middleware/auth.ts b/src/server/middleware/auth.ts index 022519a41..19883aa98 100644 --- a/src/server/middleware/auth.ts +++ b/src/server/middleware/auth.ts @@ -5,25 +5,25 @@ import { type ThirdwebAuthUser, } from "@thirdweb-dev/auth/fastify"; import { AsyncWallet } from "@thirdweb-dev/wallets/evm/wallets/async"; -import { createHash } from "node:crypto"; +import { createHash } from "crypto"; import type { FastifyInstance } from "fastify"; import type { FastifyRequest } from "fastify/types/request"; import jsonwebtoken, { type JwtPayload } from "jsonwebtoken"; import { validate as uuidValidate } from "uuid"; -import { getPermissions } from "../../shared/db/permissions/getPermissions"; -import { createToken } from "../../shared/db/tokens/createToken"; -import { revokeToken } from "../../shared/db/tokens/revokeToken"; -import { WebhooksEventTypes } from "../../shared/schemas/webhooks"; -import { THIRDWEB_DASHBOARD_ISSUER, handleSiwe } from "../../shared/utils/auth"; -import { getAccessToken } from "../../shared/utils/cache/accessToken"; -import { getAuthWallet } from "../../shared/utils/cache/authWallet"; -import { getConfig } from "../../shared/utils/cache/getConfig"; -import { getWebhooksByEventType } from "../../shared/utils/cache/getWebhook"; -import { getKeypair } from "../../shared/utils/cache/keypair"; -import { env } from "../../shared/utils/env"; -import { logger } from "../../shared/utils/logger"; -import { sendWebhookRequest } from "../../shared/utils/webhook"; -import { Permission } from "../../shared/schemas/auth"; +import { getPermissions } from "../../db/permissions/getPermissions"; +import { createToken } from "../../db/tokens/createToken"; +import { revokeToken } from "../../db/tokens/revokeToken"; +import { WebhooksEventTypes } from "../../schema/webhooks"; +import { THIRDWEB_DASHBOARD_ISSUER, handleSiwe } from "../../utils/auth"; +import { getAccessToken } from "../../utils/cache/accessToken"; +import { getAuthWallet } from "../../utils/cache/authWallet"; +import { getConfig } from "../../utils/cache/getConfig"; +import { getWebhooksByEventType } from "../../utils/cache/getWebhook"; +import { getKeypair } from "../../utils/cache/keypair"; +import { env } from "../../utils/env"; +import { logger } from "../../utils/logger"; +import { sendWebhookRequest } from "../../utils/webhook"; +import { Permission } from "../schemas/auth"; import { ADMIN_QUEUES_BASEPATH } from "./adminRoutes"; import { OPENAPI_ROUTES } from "./openApi"; diff --git a/src/server/middleware/cors.ts b/src/server/middleware/cors.ts index da81b02fa..ce9997a52 100644 --- a/src/server/middleware/cors.ts +++ b/src/server/middleware/cors.ts @@ -1,5 +1,5 @@ import type { FastifyInstance } from "fastify"; -import { getConfig } from "../../shared/utils/cache/getConfig"; +import { getConfig } from "../../utils/cache/getConfig"; import { ADMIN_QUEUES_BASEPATH } from "./adminRoutes"; const STANDARD_METHODS = "GET,POST,DELETE,PUT,PATCH,HEAD,PUT,PATCH,POST,DELETE"; diff --git a/src/server/middleware/engineMode.ts b/src/server/middleware/engineMode.ts index 9abd2c220..c111c5fdd 100644 --- a/src/server/middleware/engineMode.ts +++ b/src/server/middleware/engineMode.ts @@ -1,5 +1,5 @@ import type { FastifyInstance } from "fastify"; -import { env } from "../../shared/utils/env"; +import { env } from "../../utils/env"; export function withEnforceEngineMode(server: FastifyInstance) { if (env.ENGINE_MODE === "sandbox") { diff --git a/src/server/middleware/error.ts b/src/server/middleware/error.ts index f993750f9..5b321cbfd 100644 --- a/src/server/middleware/error.ts +++ b/src/server/middleware/error.ts @@ -1,8 +1,8 @@ import type { FastifyInstance } from "fastify"; import { ReasonPhrases, StatusCodes } from "http-status-codes"; import { ZodError } from "zod"; -import { env } from "../../shared/utils/env"; -import { parseEthersError } from "../../shared/utils/ethers"; +import { env } from "../../utils/env"; +import { parseEthersError } from "../../utils/ethers"; export type CustomError = { message: string; diff --git a/src/server/middleware/logs.ts b/src/server/middleware/logs.ts index 3ba0cfaf7..e5ed3a6b5 100644 --- a/src/server/middleware/logs.ts +++ b/src/server/middleware/logs.ts @@ -1,6 +1,6 @@ import type { FastifyInstance } from "fastify"; import { stringify } from "thirdweb/utils"; -import { logger } from "../../shared/utils/logger"; +import { logger } from "../../utils/logger"; import { ADMIN_QUEUES_BASEPATH } from "./adminRoutes"; import { OPENAPI_ROUTES } from "./openApi"; diff --git a/src/server/middleware/prometheus.ts b/src/server/middleware/prometheus.ts index 29a54b252..64bae9d49 100644 --- a/src/server/middleware/prometheus.ts +++ b/src/server/middleware/prometheus.ts @@ -1,6 +1,6 @@ import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify"; -import { env } from "../../shared/utils/env"; -import { recordMetrics } from "../../shared/utils/prometheus"; +import { env } from "../../utils/env"; +import { recordMetrics } from "../../utils/prometheus"; export function withPrometheus(server: FastifyInstance) { if (!env.METRICS_ENABLED) { diff --git a/src/server/middleware/rateLimit.ts b/src/server/middleware/rateLimit.ts index 96911855a..97c3f72cd 100644 --- a/src/server/middleware/rateLimit.ts +++ b/src/server/middleware/rateLimit.ts @@ -1,7 +1,7 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { env } from "../../shared/utils/env"; -import { redis } from "../../shared/utils/redis/redis"; +import { env } from "../../utils/env"; +import { redis } from "../../utils/redis/redis"; import { createCustomError } from "./error"; import { OPENAPI_ROUTES } from "./openApi"; diff --git a/src/server/middleware/websocket.ts b/src/server/middleware/websocket.ts index b84363dd3..6c7ebceef 100644 --- a/src/server/middleware/websocket.ts +++ b/src/server/middleware/websocket.ts @@ -1,6 +1,6 @@ import WebSocketPlugin from "@fastify/websocket"; import type { FastifyInstance } from "fastify"; -import { logger } from "../../shared/utils/logger"; +import { logger } from "../../utils/logger"; export async function withWebSocket(server: FastifyInstance) { await server.register(WebSocketPlugin, { diff --git a/src/server/routes/admin/nonces.ts b/src/server/routes/admin/nonces.ts index 75e109405..2a2f528d3 100644 --- a/src/server/routes/admin/nonces.ts +++ b/src/server/routes/admin/nonces.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { - type Address, + Address, eth_getTransactionCount, getAddress, getRpcClient, @@ -12,10 +12,10 @@ import { lastUsedNonceKey, recycledNoncesKey, sentNoncesKey, -} from "../../../shared/db/wallets/walletNonce"; -import { getChain } from "../../../shared/utils/chain"; -import { redis } from "../../../shared/utils/redis/redis"; -import { thirdwebClient } from "../../../shared/utils/sdk"; +} from "../../../db/wallets/walletNonce"; +import { getChain } from "../../../utils/chain"; +import { redis } from "../../../utils/redis/redis"; +import { thirdwebClient } from "../../../utils/sdk"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { walletWithAddressParamSchema } from "../../schemas/wallet"; diff --git a/src/server/routes/admin/transaction.ts b/src/server/routes/admin/transaction.ts index d8eace0b7..5827e5d24 100644 --- a/src/server/routes/admin/transaction.ts +++ b/src/server/routes/admin/transaction.ts @@ -1,12 +1,12 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { Queue } from "bullmq"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { Queue } from "bullmq"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { stringify } from "thirdweb/utils"; -import { TransactionDB } from "../../../shared/db/transactions/db"; -import { getConfig } from "../../../shared/utils/cache/getConfig"; -import { maybeDate } from "../../../shared/utils/primitiveTypes"; -import { redis } from "../../../shared/utils/redis/redis"; +import { TransactionDB } from "../../../db/transactions/db"; +import { getConfig } from "../../../utils/cache/getConfig"; +import { maybeDate } from "../../../utils/primitiveTypes"; +import { redis } from "../../../utils/redis/redis"; import { MineTransactionQueue } from "../../../worker/queues/mineTransactionQueue"; import { SendTransactionQueue } from "../../../worker/queues/sendTransactionQueue"; import { createCustomError } from "../../middleware/error"; diff --git a/src/server/routes/auth/access-tokens/create.ts b/src/server/routes/auth/access-tokens/create.ts index b69b6cf20..9c33113cd 100644 --- a/src/server/routes/auth/access-tokens/create.ts +++ b/src/server/routes/auth/access-tokens/create.ts @@ -3,11 +3,11 @@ import { buildJWT } from "@thirdweb-dev/auth"; import { LocalWallet } from "@thirdweb-dev/wallets"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { createToken } from "../../../../shared/db/tokens/createToken"; -import { accessTokenCache } from "../../../../shared/utils/cache/accessToken"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; -import { env } from "../../../../shared/utils/env"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { createToken } from "../../../../db/tokens/createToken"; +import { accessTokenCache } from "../../../../utils/cache/accessToken"; +import { getConfig } from "../../../../utils/cache/getConfig"; +import { env } from "../../../../utils/env"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { AccessTokenSchema } from "./getAll"; diff --git a/src/server/routes/auth/access-tokens/getAll.ts b/src/server/routes/auth/access-tokens/getAll.ts index 9cbe3646b..181f35ec8 100644 --- a/src/server/routes/auth/access-tokens/getAll.ts +++ b/src/server/routes/auth/access-tokens/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getAccessTokens } from "../../../../shared/db/tokens/getAccessTokens"; +import { getAccessTokens } from "../../../../db/tokens/getAccessTokens"; import { AddressSchema } from "../../../schemas/address"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/auth/access-tokens/revoke.ts b/src/server/routes/auth/access-tokens/revoke.ts index 39aad0a00..2d509bb65 100644 --- a/src/server/routes/auth/access-tokens/revoke.ts +++ b/src/server/routes/auth/access-tokens/revoke.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { revokeToken } from "../../../../shared/db/tokens/revokeToken"; -import { accessTokenCache } from "../../../../shared/utils/cache/accessToken"; +import { revokeToken } from "../../../../db/tokens/revokeToken"; +import { accessTokenCache } from "../../../../utils/cache/accessToken"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const requestBodySchema = Type.Object({ diff --git a/src/server/routes/auth/access-tokens/update.ts b/src/server/routes/auth/access-tokens/update.ts index f09b5ce5f..a5d730fdb 100644 --- a/src/server/routes/auth/access-tokens/update.ts +++ b/src/server/routes/auth/access-tokens/update.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateToken } from "../../../../shared/db/tokens/updateToken"; -import { accessTokenCache } from "../../../../shared/utils/cache/accessToken"; +import { updateToken } from "../../../../db/tokens/updateToken"; +import { accessTokenCache } from "../../../../utils/cache/accessToken"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const requestBodySchema = Type.Object({ diff --git a/src/server/routes/auth/keypair/add.ts b/src/server/routes/auth/keypair/add.ts index 2aab345ba..3ecc24364 100644 --- a/src/server/routes/auth/keypair/add.ts +++ b/src/server/routes/auth/keypair/add.ts @@ -1,15 +1,15 @@ -import { type Keypairs, Prisma } from "@prisma/client"; -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Keypairs, Prisma } from "@prisma/client"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { insertKeypair } from "../../../../shared/db/keypair/insert"; -import { isWellFormedPublicKey } from "../../../../shared/utils/crypto"; +import { insertKeypair } from "../../../../db/keypair/insert"; +import { isWellFormedPublicKey } from "../../../../utils/crypto"; import { createCustomError } from "../../../middleware/error"; import { KeypairAlgorithmSchema, KeypairSchema, toKeypairSchema, -} from "../../../../shared/schemas/keypair"; +} from "../../../schemas/keypairs"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const requestBodySchema = Type.Object({ diff --git a/src/server/routes/auth/keypair/list.ts b/src/server/routes/auth/keypair/list.ts index 81fab4e68..8c4395f0e 100644 --- a/src/server/routes/auth/keypair/list.ts +++ b/src/server/routes/auth/keypair/list.ts @@ -1,11 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { listKeypairs } from "../../../../shared/db/keypair/list"; -import { - KeypairSchema, - toKeypairSchema, -} from "../../../../shared/schemas/keypair"; +import { listKeypairs } from "../../../../db/keypair/list"; +import { KeypairSchema, toKeypairSchema } from "../../../schemas/keypairs"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const responseBodySchema = Type.Object({ diff --git a/src/server/routes/auth/keypair/remove.ts b/src/server/routes/auth/keypair/remove.ts index 6cc65f2ff..939979d52 100644 --- a/src/server/routes/auth/keypair/remove.ts +++ b/src/server/routes/auth/keypair/remove.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { deleteKeypair } from "../../../../shared/db/keypair/delete"; -import { keypairCache } from "../../../../shared/utils/cache/keypair"; +import { deleteKeypair } from "../../../../db/keypair/delete"; +import { keypairCache } from "../../../../utils/cache/keypair"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const requestBodySchema = Type.Object({ diff --git a/src/server/routes/auth/permissions/getAll.ts b/src/server/routes/auth/permissions/getAll.ts index 22e4b1478..7a4f5d4a4 100644 --- a/src/server/routes/auth/permissions/getAll.ts +++ b/src/server/routes/auth/permissions/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { prisma } from "../../../../shared/db/client"; +import { prisma } from "../../../../db/client"; import { AddressSchema } from "../../../schemas/address"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/auth/permissions/grant.ts b/src/server/routes/auth/permissions/grant.ts index fcde00839..6f9ef49ee 100644 --- a/src/server/routes/auth/permissions/grant.ts +++ b/src/server/routes/auth/permissions/grant.ts @@ -1,9 +1,9 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updatePermissions } from "../../../../shared/db/permissions/updatePermissions"; +import { updatePermissions } from "../../../../db/permissions/updatePermissions"; import { AddressSchema } from "../../../schemas/address"; -import { permissionsSchema } from "../../../../shared/schemas/auth"; +import { permissionsSchema } from "../../../schemas/auth"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const requestBodySchema = Type.Object({ diff --git a/src/server/routes/auth/permissions/revoke.ts b/src/server/routes/auth/permissions/revoke.ts index 6e72d7364..08f1609bb 100644 --- a/src/server/routes/auth/permissions/revoke.ts +++ b/src/server/routes/auth/permissions/revoke.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { deletePermissions } from "../../../../shared/db/permissions/deletePermissions"; +import { deletePermissions } from "../../../../db/permissions/deletePermissions"; import { AddressSchema } from "../../../schemas/address"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/backend-wallet/cancel-nonces.ts b/src/server/routes/backend-wallet/cancel-nonces.ts index 47803817c..cb4f6cf73 100644 --- a/src/server/routes/backend-wallet/cancel-nonces.ts +++ b/src/server/routes/backend-wallet/cancel-nonces.ts @@ -3,9 +3,9 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { eth_getTransactionCount, getRpcClient } from "thirdweb"; import { checksumAddress } from "thirdweb/utils"; -import { getChain } from "../../../shared/utils/chain"; -import { thirdwebClient } from "../../../shared/utils/sdk"; -import { sendCancellationTransaction } from "../../../shared/utils/transaction/cancelTransaction"; +import { getChain } from "../../../utils/chain"; +import { thirdwebClient } from "../../../utils/sdk"; +import { sendCancellationTransaction } from "../../../utils/transaction/cancelTransaction"; import { requestQuerystringSchema, standardResponseSchema, diff --git a/src/server/routes/backend-wallet/create.ts b/src/server/routes/backend-wallet/create.ts index 64162c5d0..c25ff560c 100644 --- a/src/server/routes/backend-wallet/create.ts +++ b/src/server/routes/backend-wallet/create.ts @@ -6,8 +6,8 @@ import { DEFAULT_ACCOUNT_FACTORY_V0_7, ENTRYPOINT_ADDRESS_v0_7, } from "thirdweb/wallets/smart"; -import { WalletType } from "../../../shared/schemas/wallet"; -import { getConfig } from "../../../shared/utils/cache/getConfig"; +import { WalletType } from "../../../schema/wallet"; +import { getConfig } from "../../../utils/cache/getConfig"; import { createCustomError } from "../../middleware/error"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/backend-wallet/getAll.ts b/src/server/routes/backend-wallet/getAll.ts index 0a2b0e36f..a9a9b1a48 100644 --- a/src/server/routes/backend-wallet/getAll.ts +++ b/src/server/routes/backend-wallet/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getAllWallets } from "../../../shared/db/wallets/getAllWallets"; +import { getAllWallets } from "../../../db/wallets/getAllWallets"; import { standardResponseSchema, walletDetailsSchema, diff --git a/src/server/routes/backend-wallet/getBalance.ts b/src/server/routes/backend-wallet/getBalance.ts index 01f262991..45a9987af 100644 --- a/src/server/routes/backend-wallet/getBalance.ts +++ b/src/server/routes/backend-wallet/getBalance.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getSdk } from "../../../shared/utils/cache/getSdk"; +import { getSdk } from "../../../utils/cache/getSdk"; import { AddressSchema } from "../../schemas/address"; import { currencyValueSchema, diff --git a/src/server/routes/backend-wallet/getNonce.ts b/src/server/routes/backend-wallet/getNonce.ts index f5ef87ac3..593cc9ed9 100644 --- a/src/server/routes/backend-wallet/getNonce.ts +++ b/src/server/routes/backend-wallet/getNonce.ts @@ -2,7 +2,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import type { Address } from "thirdweb"; -import { inspectNonce } from "../../../shared/db/wallets/walletNonce"; +import { inspectNonce } from "../../../db/wallets/walletNonce"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { walletWithAddressParamSchema } from "../../schemas/wallet"; import { getChainIdFromChain } from "../../utils/chain"; diff --git a/src/server/routes/backend-wallet/getTransactions.ts b/src/server/routes/backend-wallet/getTransactions.ts index 24a215697..5e8dcf89e 100644 --- a/src/server/routes/backend-wallet/getTransactions.ts +++ b/src/server/routes/backend-wallet/getTransactions.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getAddress } from "thirdweb"; -import { TransactionDB } from "../../../shared/db/transactions/db"; +import { TransactionDB } from "../../../db/transactions/db"; import { PaginationSchema } from "../../schemas/pagination"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { diff --git a/src/server/routes/backend-wallet/getTransactionsByNonce.ts b/src/server/routes/backend-wallet/getTransactionsByNonce.ts index 0be1571d3..b804df6aa 100644 --- a/src/server/routes/backend-wallet/getTransactionsByNonce.ts +++ b/src/server/routes/backend-wallet/getTransactionsByNonce.ts @@ -1,10 +1,10 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { TransactionDB } from "../../../shared/db/transactions/db"; -import { getNonceMap } from "../../../shared/db/wallets/nonceMap"; -import { normalizeAddress } from "../../../shared/utils/primitiveTypes"; -import type { AnyTransaction } from "../../../shared/utils/transaction/types"; +import { TransactionDB } from "../../../db/transactions/db"; +import { getNonceMap } from "../../../db/wallets/nonceMap"; +import { normalizeAddress } from "../../../utils/primitiveTypes"; +import type { AnyTransaction } from "../../../utils/transaction/types"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { TransactionSchema, diff --git a/src/server/routes/backend-wallet/import.ts b/src/server/routes/backend-wallet/import.ts index 88a93d48b..510059a14 100644 --- a/src/server/routes/backend-wallet/import.ts +++ b/src/server/routes/backend-wallet/import.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../utils/cache/getConfig"; import { createCustomError } from "../../middleware/error"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/backend-wallet/remove.ts b/src/server/routes/backend-wallet/remove.ts index 9f57ace6c..431c118d8 100644 --- a/src/server/routes/backend-wallet/remove.ts +++ b/src/server/routes/backend-wallet/remove.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { deleteWalletDetails } from "../../../shared/db/wallets/deleteWalletDetails"; +import { Address } from "thirdweb"; +import { deleteWalletDetails } from "../../../db/wallets/deleteWalletDetails"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/backend-wallet/reset-nonces.ts b/src/server/routes/backend-wallet/reset-nonces.ts index 3237a161a..0ec4c30e8 100644 --- a/src/server/routes/backend-wallet/reset-nonces.ts +++ b/src/server/routes/backend-wallet/reset-nonces.ts @@ -6,7 +6,7 @@ import { deleteNoncesForBackendWallets, getUsedBackendWallets, syncLatestNonceFromOnchain, -} from "../../../shared/db/wallets/walletNonce"; +} from "../../../db/wallets/walletNonce"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/backend-wallet/sendTransaction.ts b/src/server/routes/backend-wallet/sendTransaction.ts index d23add987..bb29f9386 100644 --- a/src/server/routes/backend-wallet/sendTransaction.ts +++ b/src/server/routes/backend-wallet/sendTransaction.ts @@ -2,7 +2,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import type { Address, Hex } from "thirdweb"; -import { insertTransaction } from "../../../shared/utils/transaction/insertTransaction"; +import { insertTransaction } from "../../../utils/transaction/insertTransaction"; import { AddressSchema } from "../../schemas/address"; import { requestQuerystringSchema, diff --git a/src/server/routes/backend-wallet/sendTransactionBatch.ts b/src/server/routes/backend-wallet/sendTransactionBatch.ts index d887e9bed..3d69c4431 100644 --- a/src/server/routes/backend-wallet/sendTransactionBatch.ts +++ b/src/server/routes/backend-wallet/sendTransactionBatch.ts @@ -2,7 +2,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import type { Address, Hex } from "thirdweb"; -import { insertTransaction } from "../../../shared/utils/transaction/insertTransaction"; +import { insertTransaction } from "../../../utils/transaction/insertTransaction"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { txOverridesWithValueSchema } from "../../schemas/txOverrides"; diff --git a/src/server/routes/backend-wallet/signMessage.ts b/src/server/routes/backend-wallet/signMessage.ts index 45f9cb69d..ac810a795 100644 --- a/src/server/routes/backend-wallet/signMessage.ts +++ b/src/server/routes/backend-wallet/signMessage.ts @@ -6,9 +6,9 @@ import { arbitrumSepolia } from "thirdweb/chains"; import { getWalletDetails, isSmartBackendWallet, -} from "../../../shared/db/wallets/getWalletDetails"; -import { walletDetailsToAccount } from "../../../shared/utils/account"; -import { getChain } from "../../../shared/utils/chain"; +} from "../../../db/wallets/getWalletDetails"; +import { walletDetailsToAccount } from "../../../utils/account"; +import { getChain } from "../../../utils/chain"; import { createCustomError } from "../../middleware/error"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { walletHeaderSchema } from "../../schemas/wallet"; diff --git a/src/server/routes/backend-wallet/signTransaction.ts b/src/server/routes/backend-wallet/signTransaction.ts index 7af06715e..c6a73c2c2 100644 --- a/src/server/routes/backend-wallet/signTransaction.ts +++ b/src/server/routes/backend-wallet/signTransaction.ts @@ -2,13 +2,13 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import type { Hex } from "thirdweb"; -import { getAccount } from "../../../shared/utils/account"; +import { getAccount } from "../../../utils/account"; import { getChecksumAddress, maybeBigInt, maybeInt, -} from "../../../shared/utils/primitiveTypes"; -import { toTransactionType } from "../../../shared/utils/sdk"; +} from "../../../utils/primitiveTypes"; +import { toTransactionType } from "../../../utils/sdk"; import { createCustomError } from "../../middleware/error"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { walletHeaderSchema } from "../../schemas/wallet"; diff --git a/src/server/routes/backend-wallet/signTypedData.ts b/src/server/routes/backend-wallet/signTypedData.ts index 6033e309b..6c4705eea 100644 --- a/src/server/routes/backend-wallet/signTypedData.ts +++ b/src/server/routes/backend-wallet/signTypedData.ts @@ -1,8 +1,8 @@ import type { TypedDataSigner } from "@ethersproject/abstract-signer"; -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getWallet } from "../../../shared/utils/cache/getWallet"; +import { getWallet } from "../../../utils/cache/getWallet"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { walletHeaderSchema } from "../../schemas/wallet"; diff --git a/src/server/routes/backend-wallet/simulateTransaction.ts b/src/server/routes/backend-wallet/simulateTransaction.ts index eec049d0f..e30e5d662 100644 --- a/src/server/routes/backend-wallet/simulateTransaction.ts +++ b/src/server/routes/backend-wallet/simulateTransaction.ts @@ -3,8 +3,8 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { randomUUID } from "node:crypto"; import type { Address, Hex } from "thirdweb"; -import { doSimulateTransaction } from "../../../shared/utils/transaction/simulateQueuedTransaction"; -import type { QueuedTransaction } from "../../../shared/utils/transaction/types"; +import { doSimulateTransaction } from "../../../utils/transaction/simulateQueuedTransaction"; +import type { QueuedTransaction } from "../../../utils/transaction/types"; import { createCustomError } from "../../middleware/error"; import { AddressSchema } from "../../schemas/address"; import { diff --git a/src/server/routes/backend-wallet/transfer.ts b/src/server/routes/backend-wallet/transfer.ts index 98a1f6fb4..d45b6cd28 100644 --- a/src/server/routes/backend-wallet/transfer.ts +++ b/src/server/routes/backend-wallet/transfer.ts @@ -10,11 +10,11 @@ import { } from "thirdweb"; import { transfer as transferERC20 } from "thirdweb/extensions/erc20"; import { isContractDeployed, resolvePromisedValue } from "thirdweb/utils"; -import { getChain } from "../../../shared/utils/chain"; -import { normalizeAddress } from "../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../shared/utils/sdk"; -import { insertTransaction } from "../../../shared/utils/transaction/insertTransaction"; -import type { InsertedTransaction } from "../../../shared/utils/transaction/types"; +import { getChain } from "../../../utils/chain"; +import { normalizeAddress } from "../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../utils/sdk"; +import { insertTransaction } from "../../../utils/transaction/insertTransaction"; +import type { InsertedTransaction } from "../../../utils/transaction/types"; import { createCustomError } from "../../middleware/error"; import { AddressSchema } from "../../schemas/address"; import { TokenAmountStringSchema } from "../../schemas/number"; diff --git a/src/server/routes/backend-wallet/update.ts b/src/server/routes/backend-wallet/update.ts index 8baabfacf..5c916d8d8 100644 --- a/src/server/routes/backend-wallet/update.ts +++ b/src/server/routes/backend-wallet/update.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateWalletDetails } from "../../../shared/db/wallets/updateWalletDetails"; +import { updateWalletDetails } from "../../../db/wallets/updateWalletDetails"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/backend-wallet/withdraw.ts b/src/server/routes/backend-wallet/withdraw.ts index 0cfe6fe36..e7815ac72 100644 --- a/src/server/routes/backend-wallet/withdraw.ts +++ b/src/server/routes/backend-wallet/withdraw.ts @@ -9,12 +9,12 @@ import { } from "thirdweb"; import { getChainMetadata } from "thirdweb/chains"; import { getWalletBalance } from "thirdweb/wallets"; -import { getAccount } from "../../../shared/utils/account"; -import { getChain } from "../../../shared/utils/chain"; -import { logger } from "../../../shared/utils/logger"; -import { getChecksumAddress } from "../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../shared/utils/sdk"; -import type { PopulatedTransaction } from "../../../shared/utils/transaction/types"; +import { getAccount } from "../../../utils/account"; +import { getChain } from "../../../utils/chain"; +import { logger } from "../../../utils/logger"; +import { getChecksumAddress } from "../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../utils/sdk"; +import type { PopulatedTransaction } from "../../../utils/transaction/types"; import { createCustomError } from "../../middleware/error"; import { AddressSchema, TransactionHashSchema } from "../../schemas/address"; import { TokenAmountStringSchema } from "../../schemas/number"; diff --git a/src/server/routes/chain/get.ts b/src/server/routes/chain/get.ts index c271613a3..b01c90bed 100644 --- a/src/server/routes/chain/get.ts +++ b/src/server/routes/chain/get.ts @@ -2,7 +2,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getChainMetadata } from "thirdweb/chains"; -import { getChain } from "../../../shared/utils/chain"; +import { getChain } from "../../../utils/chain"; import { chainRequestQuerystringSchema, chainResponseSchema, diff --git a/src/server/routes/chain/getAll.ts b/src/server/routes/chain/getAll.ts index c5644f337..e1b85cf0d 100644 --- a/src/server/routes/chain/getAll.ts +++ b/src/server/routes/chain/getAll.ts @@ -2,7 +2,7 @@ import { Type, type Static } from "@sinclair/typebox"; import { fetchChains } from "@thirdweb-dev/chains"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../utils/cache/getConfig"; import { chainResponseSchema } from "../../schemas/chain"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/configuration/auth/get.ts b/src/server/routes/configuration/auth/get.ts index 23163fa35..9f8bc0f32 100644 --- a/src/server/routes/configuration/auth/get.ts +++ b/src/server/routes/configuration/auth/get.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; export const responseBodySchema = Type.Object({ diff --git a/src/server/routes/configuration/auth/update.ts b/src/server/routes/configuration/auth/update.ts index 07ab148b3..411dd683f 100644 --- a/src/server/routes/configuration/auth/update.ts +++ b/src/server/routes/configuration/auth/update.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { responseBodySchema } from "./get"; diff --git a/src/server/routes/configuration/backend-wallet-balance/get.ts b/src/server/routes/configuration/backend-wallet-balance/get.ts index ab430ecc4..1fce8a8ee 100644 --- a/src/server/routes/configuration/backend-wallet-balance/get.ts +++ b/src/server/routes/configuration/backend-wallet-balance/get.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; export const responseBodySchema = Type.Object({ diff --git a/src/server/routes/configuration/backend-wallet-balance/update.ts b/src/server/routes/configuration/backend-wallet-balance/update.ts index e47a75af6..edb386e9d 100644 --- a/src/server/routes/configuration/backend-wallet-balance/update.ts +++ b/src/server/routes/configuration/backend-wallet-balance/update.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { WeiAmountStringSchema } from "../../../schemas/number"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { responseBodySchema } from "./get"; diff --git a/src/server/routes/configuration/cache/get.ts b/src/server/routes/configuration/cache/get.ts index 5ff178bd0..2d4542585 100644 --- a/src/server/routes/configuration/cache/get.ts +++ b/src/server/routes/configuration/cache/get.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; export const responseBodySchema = Type.Object({ diff --git a/src/server/routes/configuration/cache/update.ts b/src/server/routes/configuration/cache/update.ts index a87ef1546..96d34db0b 100644 --- a/src/server/routes/configuration/cache/update.ts +++ b/src/server/routes/configuration/cache/update.ts @@ -1,10 +1,10 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; -import { clearCacheCron } from "../../../../shared/utils/cron/clearCacheCron"; -import { isValidCron } from "../../../../shared/utils/cron/isValidCron"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; +import { clearCacheCron } from "../../../../utils/cron/clearCacheCron"; +import { isValidCron } from "../../../../utils/cron/isValidCron"; import { createCustomError } from "../../../middleware/error"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { responseBodySchema } from "./get"; diff --git a/src/server/routes/configuration/chains/get.ts b/src/server/routes/configuration/chains/get.ts index 6b38f9139..588927206 100644 --- a/src/server/routes/configuration/chains/get.ts +++ b/src/server/routes/configuration/chains/get.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { chainResponseSchema } from "../../../schemas/chain"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/configuration/chains/update.ts b/src/server/routes/configuration/chains/update.ts index 589eb0797..5ae3ed225 100644 --- a/src/server/routes/configuration/chains/update.ts +++ b/src/server/routes/configuration/chains/update.ts @@ -1,9 +1,9 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; -import { sdkCache } from "../../../../shared/utils/cache/getSdk"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; +import { sdkCache } from "../../../../utils/cache/getSdk"; import { chainResponseSchema } from "../../../schemas/chain"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { responseBodySchema } from "./get"; diff --git a/src/server/routes/configuration/contract-subscriptions/get.ts b/src/server/routes/configuration/contract-subscriptions/get.ts index ae6dc97dc..36d42d582 100644 --- a/src/server/routes/configuration/contract-subscriptions/get.ts +++ b/src/server/routes/configuration/contract-subscriptions/get.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { contractSubscriptionConfigurationSchema, standardResponseSchema, diff --git a/src/server/routes/configuration/contract-subscriptions/update.ts b/src/server/routes/configuration/contract-subscriptions/update.ts index fdc0897d0..501ce8b4b 100644 --- a/src/server/routes/configuration/contract-subscriptions/update.ts +++ b/src/server/routes/configuration/contract-subscriptions/update.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { createCustomError } from "../../../middleware/error"; import { contractSubscriptionConfigurationSchema, diff --git a/src/server/routes/configuration/cors/add.ts b/src/server/routes/configuration/cors/add.ts index 24d085d07..aace6cb26 100644 --- a/src/server/routes/configuration/cors/add.ts +++ b/src/server/routes/configuration/cors/add.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { mandatoryAllowedCorsUrls } from "../../../utils/cors-urls"; import { responseBodySchema } from "./get"; diff --git a/src/server/routes/configuration/cors/get.ts b/src/server/routes/configuration/cors/get.ts index f5cbab52b..37a1aa9bb 100644 --- a/src/server/routes/configuration/cors/get.ts +++ b/src/server/routes/configuration/cors/get.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { mandatoryAllowedCorsUrls } from "../../../utils/cors-urls"; diff --git a/src/server/routes/configuration/cors/remove.ts b/src/server/routes/configuration/cors/remove.ts index a1d4c7c98..d32a819ef 100644 --- a/src/server/routes/configuration/cors/remove.ts +++ b/src/server/routes/configuration/cors/remove.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { createCustomError } from "../../../middleware/error"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { mandatoryAllowedCorsUrls } from "../../../utils/cors-urls"; diff --git a/src/server/routes/configuration/cors/set.ts b/src/server/routes/configuration/cors/set.ts index a1a7540bc..54ddf3e84 100644 --- a/src/server/routes/configuration/cors/set.ts +++ b/src/server/routes/configuration/cors/set.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { mandatoryAllowedCorsUrls } from "../../../utils/cors-urls"; import { responseBodySchema } from "./get"; diff --git a/src/server/routes/configuration/ip/get.ts b/src/server/routes/configuration/ip/get.ts index 1f916c14f..99250011e 100644 --- a/src/server/routes/configuration/ip/get.ts +++ b/src/server/routes/configuration/ip/get.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; export const responseBodySchema = Type.Object({ diff --git a/src/server/routes/configuration/ip/set.ts b/src/server/routes/configuration/ip/set.ts index 8dab64868..e92a319ce 100644 --- a/src/server/routes/configuration/ip/set.ts +++ b/src/server/routes/configuration/ip/set.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { responseBodySchema } from "./get"; diff --git a/src/server/routes/configuration/transactions/get.ts b/src/server/routes/configuration/transactions/get.ts index c1d95ff5e..33cdfeac3 100644 --- a/src/server/routes/configuration/transactions/get.ts +++ b/src/server/routes/configuration/transactions/get.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const responseBodySchema = Type.Object({ diff --git a/src/server/routes/configuration/transactions/update.ts b/src/server/routes/configuration/transactions/update.ts index c5322dca4..c94db43ce 100644 --- a/src/server/routes/configuration/transactions/update.ts +++ b/src/server/routes/configuration/transactions/update.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const requestBodySchema = Type.Partial( diff --git a/src/server/routes/configuration/wallets/get.ts b/src/server/routes/configuration/wallets/get.ts index eded75a5e..d170cbea5 100644 --- a/src/server/routes/configuration/wallets/get.ts +++ b/src/server/routes/configuration/wallets/get.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { WalletType } from "../../../../shared/schemas/wallet"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { WalletType } from "../../../../schema/wallet"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; export const responseBodySchema = Type.Object({ diff --git a/src/server/routes/configuration/wallets/update.ts b/src/server/routes/configuration/wallets/update.ts index 9b79e6146..d21182227 100644 --- a/src/server/routes/configuration/wallets/update.ts +++ b/src/server/routes/configuration/wallets/update.ts @@ -1,9 +1,9 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { updateConfiguration } from "../../../../shared/db/configuration/updateConfiguration"; -import { WalletType } from "../../../../shared/schemas/wallet"; -import { getConfig } from "../../../../shared/utils/cache/getConfig"; +import { updateConfiguration } from "../../../../db/configuration/updateConfiguration"; +import { WalletType } from "../../../../schema/wallet"; +import { getConfig } from "../../../../utils/cache/getConfig"; import { createCustomError } from "../../../middleware/error"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { responseBodySchema } from "./get"; diff --git a/src/server/routes/contract/events/getAllEvents.ts b/src/server/routes/contract/events/getAllEvents.ts index 5d6150779..a28264b45 100644 --- a/src/server/routes/contract/events/getAllEvents.ts +++ b/src/server/routes/contract/events/getAllEvents.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../utils/cache/getContract"; import { contractEventSchema, eventsQuerystringSchema, diff --git a/src/server/routes/contract/events/getContractEventLogs.ts b/src/server/routes/contract/events/getContractEventLogs.ts index 47a12a269..85e0a0c3c 100644 --- a/src/server/routes/contract/events/getContractEventLogs.ts +++ b/src/server/routes/contract/events/getContractEventLogs.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContractEventLogsByBlockAndTopics } from "../../../../shared/db/contractEventLogs/getContractEventLogs"; -import { isContractSubscribed } from "../../../../shared/db/contractSubscriptions/getContractSubscriptions"; +import { getContractEventLogsByBlockAndTopics } from "../../../../db/contractEventLogs/getContractEventLogs"; +import { isContractSubscribed } from "../../../../db/contractSubscriptions/getContractSubscriptions"; import { createCustomError } from "../../../middleware/error"; import { AddressSchema, TransactionHashSchema } from "../../../schemas/address"; import { diff --git a/src/server/routes/contract/events/getEventLogsByTimestamp.ts b/src/server/routes/contract/events/getEventLogsByTimestamp.ts index 267ab1eb8..2cde46d21 100644 --- a/src/server/routes/contract/events/getEventLogsByTimestamp.ts +++ b/src/server/routes/contract/events/getEventLogsByTimestamp.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getEventLogsByBlockTimestamp } from "../../../../shared/db/contractEventLogs/getContractEventLogs"; +import { getEventLogsByBlockTimestamp } from "../../../../db/contractEventLogs/getContractEventLogs"; import { AddressSchema } from "../../../schemas/address"; import { eventLogSchema } from "../../../schemas/eventLog"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/contract/events/getEvents.ts b/src/server/routes/contract/events/getEvents.ts index 69cabe01c..f30839eba 100644 --- a/src/server/routes/contract/events/getEvents.ts +++ b/src/server/routes/contract/events/getEvents.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../utils/cache/getContract"; import { contractEventSchema, eventsQuerystringSchema, diff --git a/src/server/routes/contract/events/paginateEventLogs.ts b/src/server/routes/contract/events/paginateEventLogs.ts index 1767a4c07..02a4c5212 100644 --- a/src/server/routes/contract/events/paginateEventLogs.ts +++ b/src/server/routes/contract/events/paginateEventLogs.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfiguration } from "../../../../shared/db/configuration/getConfiguration"; -import { getEventLogsByCursor } from "../../../../shared/db/contractEventLogs/getContractEventLogs"; +import { getConfiguration } from "../../../../db/configuration/getConfiguration"; +import { getEventLogsByCursor } from "../../../../db/contractEventLogs/getContractEventLogs"; import { AddressSchema } from "../../../schemas/address"; import { eventLogSchema, toEventLogSchema } from "../../../schemas/eventLog"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/contract/extensions/account/read/getAllAdmins.ts b/src/server/routes/contract/extensions/account/read/getAllAdmins.ts index ea6428780..13d5d38a2 100644 --- a/src/server/routes/contract/extensions/account/read/getAllAdmins.ts +++ b/src/server/routes/contract/extensions/account/read/getAllAdmins.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/account/read/getAllSessions.ts b/src/server/routes/contract/extensions/account/read/getAllSessions.ts index 68db22c51..fd3bd971a 100644 --- a/src/server/routes/contract/extensions/account/read/getAllSessions.ts +++ b/src/server/routes/contract/extensions/account/read/getAllSessions.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { sessionSchema } from "../../../../../schemas/account"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/account/write/grantAdmin.ts b/src/server/routes/contract/extensions/account/write/grantAdmin.ts index 2a7120ca8..6d5b11e82 100644 --- a/src/server/routes/contract/extensions/account/write/grantAdmin.ts +++ b/src/server/routes/contract/extensions/account/write/grantAdmin.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/account/write/grantSession.ts b/src/server/routes/contract/extensions/account/write/grantSession.ts index ab04cfcfa..0e64558d7 100644 --- a/src/server/routes/contract/extensions/account/write/grantSession.ts +++ b/src/server/routes/contract/extensions/account/write/grantSession.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { sessionSchema } from "../../../../../schemas/account"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/account/write/revokeAdmin.ts b/src/server/routes/contract/extensions/account/write/revokeAdmin.ts index 2b19ee104..2e21671aa 100644 --- a/src/server/routes/contract/extensions/account/write/revokeAdmin.ts +++ b/src/server/routes/contract/extensions/account/write/revokeAdmin.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/account/write/revokeSession.ts b/src/server/routes/contract/extensions/account/write/revokeSession.ts index 58c74d8c7..f71e40218 100644 --- a/src/server/routes/contract/extensions/account/write/revokeSession.ts +++ b/src/server/routes/contract/extensions/account/write/revokeSession.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/account/write/updateSession.ts b/src/server/routes/contract/extensions/account/write/updateSession.ts index daade19b1..46da67695 100644 --- a/src/server/routes/contract/extensions/account/write/updateSession.ts +++ b/src/server/routes/contract/extensions/account/write/updateSession.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/accountFactory/read/getAllAccounts.ts b/src/server/routes/contract/extensions/accountFactory/read/getAllAccounts.ts index 7fd003c0d..5a5208679 100644 --- a/src/server/routes/contract/extensions/accountFactory/read/getAllAccounts.ts +++ b/src/server/routes/contract/extensions/accountFactory/read/getAllAccounts.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/accountFactory/read/getAssociatedAccounts.ts b/src/server/routes/contract/extensions/accountFactory/read/getAssociatedAccounts.ts index d3a9020cd..66f1ad35a 100644 --- a/src/server/routes/contract/extensions/accountFactory/read/getAssociatedAccounts.ts +++ b/src/server/routes/contract/extensions/accountFactory/read/getAssociatedAccounts.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/accountFactory/read/isAccountDeployed.ts b/src/server/routes/contract/extensions/accountFactory/read/isAccountDeployed.ts index bce8ff614..0ccbbde66 100644 --- a/src/server/routes/contract/extensions/accountFactory/read/isAccountDeployed.ts +++ b/src/server/routes/contract/extensions/accountFactory/read/isAccountDeployed.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/accountFactory/read/predictAccountAddress.ts b/src/server/routes/contract/extensions/accountFactory/read/predictAccountAddress.ts index e540a46f0..e4f0089aa 100644 --- a/src/server/routes/contract/extensions/accountFactory/read/predictAccountAddress.ts +++ b/src/server/routes/contract/extensions/accountFactory/read/predictAccountAddress.ts @@ -2,7 +2,7 @@ import { type Static, Type } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { predictAddress } from "thirdweb/wallets/smart"; -import { getContractV5 } from "../../../../../../shared/utils/cache/getContractv5"; +import { getContractV5 } from "../../../../../../utils/cache/getContractv5"; import { AddressSchema } from "../../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/accountFactory/write/createAccount.ts b/src/server/routes/contract/extensions/accountFactory/write/createAccount.ts index 1eb2a60b4..55f2c34d6 100644 --- a/src/server/routes/contract/extensions/accountFactory/write/createAccount.ts +++ b/src/server/routes/contract/extensions/accountFactory/write/createAccount.ts @@ -4,9 +4,9 @@ import { StatusCodes } from "http-status-codes"; import { createAccount as factoryCreateAccount } from "thirdweb/extensions/erc4337"; import { isHex, stringToHex } from "thirdweb/utils"; import { predictAddress } from "thirdweb/wallets/smart"; -import { getContractV5 } from "../../../../../../shared/utils/cache/getContractv5"; -import { redis } from "../../../../../../shared/utils/redis/redis"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getContractV5 } from "../../../../../../utils/cache/getContractv5"; +import { redis } from "../../../../../../utils/redis/redis"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema } from "../../../../../schemas/address"; import { prebuiltDeployResponseSchema } from "../../../../../schemas/prebuilts"; import { diff --git a/src/server/routes/contract/extensions/erc1155/read/balanceOf.ts b/src/server/routes/contract/extensions/erc1155/read/balanceOf.ts index 2cfa5c07a..635da28ae 100644 --- a/src/server/routes/contract/extensions/erc1155/read/balanceOf.ts +++ b/src/server/routes/contract/extensions/erc1155/read/balanceOf.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc1155ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/read/canClaim.ts b/src/server/routes/contract/extensions/erc1155/read/canClaim.ts index c5bcba524..5b100dd11 100644 --- a/src/server/routes/contract/extensions/erc1155/read/canClaim.ts +++ b/src/server/routes/contract/extensions/erc1155/read/canClaim.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc1155/read/get.ts b/src/server/routes/contract/extensions/erc1155/read/get.ts index acb439591..c9edfafca 100644 --- a/src/server/routes/contract/extensions/erc1155/read/get.ts +++ b/src/server/routes/contract/extensions/erc1155/read/get.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { nftSchema } from "../../../../../schemas/nft"; import { erc1155ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/read/getActiveClaimConditions.ts b/src/server/routes/contract/extensions/erc1155/read/getActiveClaimConditions.ts index 739707d3c..62f7807b4 100644 --- a/src/server/routes/contract/extensions/erc1155/read/getActiveClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc1155/read/getActiveClaimConditions.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionOutputSchema } from "../../../../../schemas/claimConditions"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/read/getAll.ts b/src/server/routes/contract/extensions/erc1155/read/getAll.ts index 42b563c1f..8d1018a5b 100644 --- a/src/server/routes/contract/extensions/erc1155/read/getAll.ts +++ b/src/server/routes/contract/extensions/erc1155/read/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { nftSchema } from "../../../../../schemas/nft"; import { erc1155ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/read/getAllClaimConditions.ts b/src/server/routes/contract/extensions/erc1155/read/getAllClaimConditions.ts index 9003f2db4..5bc021d5d 100644 --- a/src/server/routes/contract/extensions/erc1155/read/getAllClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc1155/read/getAllClaimConditions.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionOutputSchema } from "../../../../../schemas/claimConditions"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/read/getClaimIneligibilityReasons.ts b/src/server/routes/contract/extensions/erc1155/read/getClaimIneligibilityReasons.ts index 8b061be03..d50a6af03 100644 --- a/src/server/routes/contract/extensions/erc1155/read/getClaimIneligibilityReasons.ts +++ b/src/server/routes/contract/extensions/erc1155/read/getClaimIneligibilityReasons.ts @@ -2,7 +2,7 @@ import { Type, type Static } from "@sinclair/typebox"; import { ClaimEligibility } from "@thirdweb-dev/sdk"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { NumberStringSchema } from "../../../../../schemas/number"; import { diff --git a/src/server/routes/contract/extensions/erc1155/read/getClaimerProofs.ts b/src/server/routes/contract/extensions/erc1155/read/getClaimerProofs.ts index 05e53b95e..59a130fb0 100644 --- a/src/server/routes/contract/extensions/erc1155/read/getClaimerProofs.ts +++ b/src/server/routes/contract/extensions/erc1155/read/getClaimerProofs.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { claimerProofSchema } from "../../../../../schemas/claimConditions"; import { diff --git a/src/server/routes/contract/extensions/erc1155/read/getOwned.ts b/src/server/routes/contract/extensions/erc1155/read/getOwned.ts index d4a8f08dc..e56383bd0 100644 --- a/src/server/routes/contract/extensions/erc1155/read/getOwned.ts +++ b/src/server/routes/contract/extensions/erc1155/read/getOwned.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { nftSchema } from "../../../../../schemas/nft"; import { diff --git a/src/server/routes/contract/extensions/erc1155/read/isApproved.ts b/src/server/routes/contract/extensions/erc1155/read/isApproved.ts index ac1fac7dd..f97a3089a 100644 --- a/src/server/routes/contract/extensions/erc1155/read/isApproved.ts +++ b/src/server/routes/contract/extensions/erc1155/read/isApproved.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc1155ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc1155/read/signatureGenerate.ts b/src/server/routes/contract/extensions/erc1155/read/signatureGenerate.ts index ab95c40e3..85e8b8d7b 100644 --- a/src/server/routes/contract/extensions/erc1155/read/signatureGenerate.ts +++ b/src/server/routes/contract/extensions/erc1155/read/signatureGenerate.ts @@ -4,11 +4,11 @@ import { StatusCodes } from "http-status-codes"; import { getContract, type Address, type Hex } from "thirdweb"; import type { NFTInput } from "thirdweb/dist/types/utils/nft/parseNft"; import { generateMintSignature } from "thirdweb/extensions/erc1155"; -import { getAccount } from "../../../../../../shared/utils/account"; -import { getContract as getContractV4 } from "../../../../../../shared/utils/cache/getContract"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { maybeBigInt } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; +import { getAccount } from "../../../../../../utils/account"; +import { getContract as getContractV4 } from "../../../../../../utils/cache/getContract"; +import { getChain } from "../../../../../../utils/chain"; +import { maybeBigInt } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; import { createCustomError } from "../../../../../middleware/error"; import { thirdwebSdkVersionSchema } from "../../../../../schemas/httpHeaders/thirdwebSdkVersion"; import { diff --git a/src/server/routes/contract/extensions/erc1155/read/totalCount.ts b/src/server/routes/contract/extensions/erc1155/read/totalCount.ts index 21b24ad92..ca225d4e9 100644 --- a/src/server/routes/contract/extensions/erc1155/read/totalCount.ts +++ b/src/server/routes/contract/extensions/erc1155/read/totalCount.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc1155ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc1155/read/totalSupply.ts b/src/server/routes/contract/extensions/erc1155/read/totalSupply.ts index e1dafd5cf..54de23b04 100644 --- a/src/server/routes/contract/extensions/erc1155/read/totalSupply.ts +++ b/src/server/routes/contract/extensions/erc1155/read/totalSupply.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc1155ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/airdrop.ts b/src/server/routes/contract/extensions/erc1155/write/airdrop.ts index 5164f0a83..d8e60a5ec 100644 --- a/src/server/routes/contract/extensions/erc1155/write/airdrop.ts +++ b/src/server/routes/contract/extensions/erc1155/write/airdrop.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc1155ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/burn.ts b/src/server/routes/contract/extensions/erc1155/write/burn.ts index d01ea058d..7c1a126df 100644 --- a/src/server/routes/contract/extensions/erc1155/write/burn.ts +++ b/src/server/routes/contract/extensions/erc1155/write/burn.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc1155ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/burnBatch.ts b/src/server/routes/contract/extensions/erc1155/write/burnBatch.ts index a78cb430c..d4dedc504 100644 --- a/src/server/routes/contract/extensions/erc1155/write/burnBatch.ts +++ b/src/server/routes/contract/extensions/erc1155/write/burnBatch.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc1155ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/claimTo.ts b/src/server/routes/contract/extensions/erc1155/write/claimTo.ts index c716b1f61..39bd1e4a4 100644 --- a/src/server/routes/contract/extensions/erc1155/write/claimTo.ts +++ b/src/server/routes/contract/extensions/erc1155/write/claimTo.ts @@ -1,10 +1,10 @@ -import { type Static, Type } from "@sinclair/typebox"; +import { Static, Type } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import type { Address } from "thirdweb"; import { claimTo } from "thirdweb/extensions/erc1155"; -import { getContractV5 } from "../../../../../../shared/utils/cache/getContractv5"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getContractV5 } from "../../../../../../utils/cache/getContractv5"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema } from "../../../../../schemas/address"; import { erc1155ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/lazyMint.ts b/src/server/routes/contract/extensions/erc1155/write/lazyMint.ts index b31c48bf1..015284d09 100644 --- a/src/server/routes/contract/extensions/erc1155/write/lazyMint.ts +++ b/src/server/routes/contract/extensions/erc1155/write/lazyMint.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { nftOrInputSchema } from "../../../../../schemas/nft"; import { erc1155ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/mintAdditionalSupplyTo.ts b/src/server/routes/contract/extensions/erc1155/write/mintAdditionalSupplyTo.ts index 58fa670ab..f48e90bea 100644 --- a/src/server/routes/contract/extensions/erc1155/write/mintAdditionalSupplyTo.ts +++ b/src/server/routes/contract/extensions/erc1155/write/mintAdditionalSupplyTo.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc1155ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/mintBatchTo.ts b/src/server/routes/contract/extensions/erc1155/write/mintBatchTo.ts index e8776756a..1d31b92aa 100644 --- a/src/server/routes/contract/extensions/erc1155/write/mintBatchTo.ts +++ b/src/server/routes/contract/extensions/erc1155/write/mintBatchTo.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { nftAndSupplySchema } from "../../../../../schemas/nft"; import { diff --git a/src/server/routes/contract/extensions/erc1155/write/mintTo.ts b/src/server/routes/contract/extensions/erc1155/write/mintTo.ts index 776156ca0..0f72457f8 100644 --- a/src/server/routes/contract/extensions/erc1155/write/mintTo.ts +++ b/src/server/routes/contract/extensions/erc1155/write/mintTo.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { nftAndSupplySchema } from "../../../../../schemas/nft"; import { diff --git a/src/server/routes/contract/extensions/erc1155/write/setApprovalForAll.ts b/src/server/routes/contract/extensions/erc1155/write/setApprovalForAll.ts index 510469914..db5a05f60 100644 --- a/src/server/routes/contract/extensions/erc1155/write/setApprovalForAll.ts +++ b/src/server/routes/contract/extensions/erc1155/write/setApprovalForAll.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc1155ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/setBatchClaimConditions.ts b/src/server/routes/contract/extensions/erc1155/write/setBatchClaimConditions.ts index 36e81475b..702c5ae4e 100644 --- a/src/server/routes/contract/extensions/erc1155/write/setBatchClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc1155/write/setBatchClaimConditions.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionInputSchema, type setBatchSantiziedClaimConditionsRequestSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/setClaimConditions.ts b/src/server/routes/contract/extensions/erc1155/write/setClaimConditions.ts index 6f3021397..cf014efaf 100644 --- a/src/server/routes/contract/extensions/erc1155/write/setClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc1155/write/setClaimConditions.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionInputSchema, type sanitizedClaimConditionInputSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/signatureMint.ts b/src/server/routes/contract/extensions/erc1155/write/signatureMint.ts index b1e12fb4b..adc3ed3e8 100644 --- a/src/server/routes/contract/extensions/erc1155/write/signatureMint.ts +++ b/src/server/routes/contract/extensions/erc1155/write/signatureMint.ts @@ -3,8 +3,8 @@ import type { SignedPayload1155 } from "@thirdweb-dev/sdk"; import { BigNumber } from "ethers"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { signature1155OutputSchema } from "../../../../../schemas/nft"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/transfer.ts b/src/server/routes/contract/extensions/erc1155/write/transfer.ts index 61d46227a..4db2395ec 100644 --- a/src/server/routes/contract/extensions/erc1155/write/transfer.ts +++ b/src/server/routes/contract/extensions/erc1155/write/transfer.ts @@ -3,10 +3,10 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract, type Hex } from "thirdweb"; import { safeTransferFrom } from "thirdweb/extensions/erc1155"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { getChecksumAddress } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getChain } from "../../../../../../utils/chain"; +import { getChecksumAddress } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema, HexSchema } from "../../../../../schemas/address"; import { NumberStringSchema } from "../../../../../schemas/number"; import { diff --git a/src/server/routes/contract/extensions/erc1155/write/transferFrom.ts b/src/server/routes/contract/extensions/erc1155/write/transferFrom.ts index 66229cc15..385857075 100644 --- a/src/server/routes/contract/extensions/erc1155/write/transferFrom.ts +++ b/src/server/routes/contract/extensions/erc1155/write/transferFrom.ts @@ -3,10 +3,10 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract, type Hex } from "thirdweb"; import { safeTransferFrom } from "thirdweb/extensions/erc1155"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { getChecksumAddress } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getChain } from "../../../../../../utils/chain"; +import { getChecksumAddress } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema, HexSchema } from "../../../../../schemas/address"; import { NumberStringSchema } from "../../../../../schemas/number"; import { diff --git a/src/server/routes/contract/extensions/erc1155/write/updateClaimConditions.ts b/src/server/routes/contract/extensions/erc1155/write/updateClaimConditions.ts index ce3e63e10..21bb87a40 100644 --- a/src/server/routes/contract/extensions/erc1155/write/updateClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc1155/write/updateClaimConditions.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionInputSchema, type sanitizedClaimConditionInputSchema, diff --git a/src/server/routes/contract/extensions/erc1155/write/updateTokenMetadata.ts b/src/server/routes/contract/extensions/erc1155/write/updateTokenMetadata.ts index 0689517fa..3c020ff24 100644 --- a/src/server/routes/contract/extensions/erc1155/write/updateTokenMetadata.ts +++ b/src/server/routes/contract/extensions/erc1155/write/updateTokenMetadata.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { nftMetadataInputSchema } from "../../../../../schemas/nft"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/read/allowanceOf.ts b/src/server/routes/contract/extensions/erc20/read/allowanceOf.ts index 8386bc054..128fd9f86 100644 --- a/src/server/routes/contract/extensions/erc20/read/allowanceOf.ts +++ b/src/server/routes/contract/extensions/erc20/read/allowanceOf.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc20MetadataSchema } from "../../../../../schemas/erc20"; import { erc20ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/read/balanceOf.ts b/src/server/routes/contract/extensions/erc20/read/balanceOf.ts index 167ec4cf4..edade3a9f 100644 --- a/src/server/routes/contract/extensions/erc20/read/balanceOf.ts +++ b/src/server/routes/contract/extensions/erc20/read/balanceOf.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc20MetadataSchema } from "../../../../../schemas/erc20"; import { diff --git a/src/server/routes/contract/extensions/erc20/read/canClaim.ts b/src/server/routes/contract/extensions/erc20/read/canClaim.ts index 078c8d7f2..b38495b17 100644 --- a/src/server/routes/contract/extensions/erc20/read/canClaim.ts +++ b/src/server/routes/contract/extensions/erc20/read/canClaim.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc20/read/get.ts b/src/server/routes/contract/extensions/erc20/read/get.ts index 88f532f0b..c89338d37 100644 --- a/src/server/routes/contract/extensions/erc20/read/get.ts +++ b/src/server/routes/contract/extensions/erc20/read/get.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc20ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc20/read/getActiveClaimConditions.ts b/src/server/routes/contract/extensions/erc20/read/getActiveClaimConditions.ts index 15a992342..8013f7cff 100644 --- a/src/server/routes/contract/extensions/erc20/read/getActiveClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc20/read/getActiveClaimConditions.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionOutputSchema } from "../../../../../schemas/claimConditions"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/read/getAllClaimConditions.ts b/src/server/routes/contract/extensions/erc20/read/getAllClaimConditions.ts index 841ebcda3..578466a13 100644 --- a/src/server/routes/contract/extensions/erc20/read/getAllClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc20/read/getAllClaimConditions.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionOutputSchema } from "../../../../../schemas/claimConditions"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/read/getClaimIneligibilityReasons.ts b/src/server/routes/contract/extensions/erc20/read/getClaimIneligibilityReasons.ts index 19b7a12de..832ce01ef 100644 --- a/src/server/routes/contract/extensions/erc20/read/getClaimIneligibilityReasons.ts +++ b/src/server/routes/contract/extensions/erc20/read/getClaimIneligibilityReasons.ts @@ -2,7 +2,7 @@ import { Type, type Static } from "@sinclair/typebox"; import { ClaimEligibility } from "@thirdweb-dev/sdk"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc20/read/getClaimerProofs.ts b/src/server/routes/contract/extensions/erc20/read/getClaimerProofs.ts index 0778a85ac..ad7659b05 100644 --- a/src/server/routes/contract/extensions/erc20/read/getClaimerProofs.ts +++ b/src/server/routes/contract/extensions/erc20/read/getClaimerProofs.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { claimerProofSchema } from "../../../../../schemas/claimConditions"; import { diff --git a/src/server/routes/contract/extensions/erc20/read/signatureGenerate.ts b/src/server/routes/contract/extensions/erc20/read/signatureGenerate.ts index ae6ccff36..341aabf9d 100644 --- a/src/server/routes/contract/extensions/erc20/read/signatureGenerate.ts +++ b/src/server/routes/contract/extensions/erc20/read/signatureGenerate.ts @@ -3,11 +3,11 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract, type Address, type Hex } from "thirdweb"; import { generateMintSignature } from "thirdweb/extensions/erc20"; -import { getAccount } from "../../../../../../shared/utils/account"; -import { getContract as getContractV4 } from "../../../../../../shared/utils/cache/getContract"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { maybeBigInt } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; +import { getAccount } from "../../../../../../utils/account"; +import { getContract as getContractV4 } from "../../../../../../utils/cache/getContract"; +import { getChain } from "../../../../../../utils/chain"; +import { maybeBigInt } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; import { createCustomError } from "../../../../../middleware/error"; import { signature20InputSchema, diff --git a/src/server/routes/contract/extensions/erc20/read/totalSupply.ts b/src/server/routes/contract/extensions/erc20/read/totalSupply.ts index 06ee4548b..fd3399e97 100644 --- a/src/server/routes/contract/extensions/erc20/read/totalSupply.ts +++ b/src/server/routes/contract/extensions/erc20/read/totalSupply.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc20MetadataSchema } from "../../../../../schemas/erc20"; import { erc20ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/burn.ts b/src/server/routes/contract/extensions/erc20/write/burn.ts index 7c9f093f7..54ad7e7ce 100644 --- a/src/server/routes/contract/extensions/erc20/write/burn.ts +++ b/src/server/routes/contract/extensions/erc20/write/burn.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { erc20ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/burnFrom.ts b/src/server/routes/contract/extensions/erc20/write/burnFrom.ts index ad5498414..956d9f9b3 100644 --- a/src/server/routes/contract/extensions/erc20/write/burnFrom.ts +++ b/src/server/routes/contract/extensions/erc20/write/burnFrom.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc20ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/claimTo.ts b/src/server/routes/contract/extensions/erc20/write/claimTo.ts index db7678729..fd5a70ffd 100644 --- a/src/server/routes/contract/extensions/erc20/write/claimTo.ts +++ b/src/server/routes/contract/extensions/erc20/write/claimTo.ts @@ -1,10 +1,10 @@ -import { type Static, Type } from "@sinclair/typebox"; +import { Static, Type } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import type { Address } from "thirdweb"; import { claimTo } from "thirdweb/extensions/erc20"; -import { getContractV5 } from "../../../../../../shared/utils/cache/getContractv5"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getContractV5 } from "../../../../../../utils/cache/getContractv5"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { erc20ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/mintBatchTo.ts b/src/server/routes/contract/extensions/erc20/write/mintBatchTo.ts index dd3e4b601..2fd89eb9c 100644 --- a/src/server/routes/contract/extensions/erc20/write/mintBatchTo.ts +++ b/src/server/routes/contract/extensions/erc20/write/mintBatchTo.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc20ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/mintTo.ts b/src/server/routes/contract/extensions/erc20/write/mintTo.ts index e78dfb90f..db3a9968e 100644 --- a/src/server/routes/contract/extensions/erc20/write/mintTo.ts +++ b/src/server/routes/contract/extensions/erc20/write/mintTo.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc20ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/setAllowance.ts b/src/server/routes/contract/extensions/erc20/write/setAllowance.ts index 7cad12a44..80fd18b02 100644 --- a/src/server/routes/contract/extensions/erc20/write/setAllowance.ts +++ b/src/server/routes/contract/extensions/erc20/write/setAllowance.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc20ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/setClaimConditions.ts b/src/server/routes/contract/extensions/erc20/write/setClaimConditions.ts index cc6ced02c..57ce2c8c8 100644 --- a/src/server/routes/contract/extensions/erc20/write/setClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc20/write/setClaimConditions.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionInputSchema, type sanitizedClaimConditionInputSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/signatureMint.ts b/src/server/routes/contract/extensions/erc20/write/signatureMint.ts index 182259b9b..38fd423ff 100644 --- a/src/server/routes/contract/extensions/erc20/write/signatureMint.ts +++ b/src/server/routes/contract/extensions/erc20/write/signatureMint.ts @@ -3,8 +3,8 @@ import type { SignedPayload20 } from "@thirdweb-dev/sdk"; import { BigNumber } from "ethers"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { signature20OutputSchema } from "../../../../../schemas/erc20"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc20/write/transfer.ts b/src/server/routes/contract/extensions/erc20/write/transfer.ts index 75a3c2d14..512903a44 100644 --- a/src/server/routes/contract/extensions/erc20/write/transfer.ts +++ b/src/server/routes/contract/extensions/erc20/write/transfer.ts @@ -3,10 +3,10 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract } from "thirdweb"; import { transfer } from "thirdweb/extensions/erc20"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { getChecksumAddress } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getChain } from "../../../../../../utils/chain"; +import { getChecksumAddress } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema } from "../../../../../schemas/address"; import { TokenAmountStringSchema } from "../../../../../schemas/number"; import { diff --git a/src/server/routes/contract/extensions/erc20/write/transferFrom.ts b/src/server/routes/contract/extensions/erc20/write/transferFrom.ts index ec1c46403..ce9ed134c 100644 --- a/src/server/routes/contract/extensions/erc20/write/transferFrom.ts +++ b/src/server/routes/contract/extensions/erc20/write/transferFrom.ts @@ -3,10 +3,10 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract } from "thirdweb"; import { transferFrom } from "thirdweb/extensions/erc20"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { getChecksumAddress } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getChain } from "../../../../../../utils/chain"; +import { getChecksumAddress } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema } from "../../../../../schemas/address"; import { TokenAmountStringSchema } from "../../../../../schemas/number"; import { diff --git a/src/server/routes/contract/extensions/erc20/write/updateClaimConditions.ts b/src/server/routes/contract/extensions/erc20/write/updateClaimConditions.ts index 96ec7578d..99cd79b48 100644 --- a/src/server/routes/contract/extensions/erc20/write/updateClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc20/write/updateClaimConditions.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionInputSchema, type sanitizedClaimConditionInputSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/balanceOf.ts b/src/server/routes/contract/extensions/erc721/read/balanceOf.ts index 1bad0235d..72b9e2aef 100644 --- a/src/server/routes/contract/extensions/erc721/read/balanceOf.ts +++ b/src/server/routes/contract/extensions/erc721/read/balanceOf.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { erc721ContractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/canClaim.ts b/src/server/routes/contract/extensions/erc721/read/canClaim.ts index 6aa53c54d..d80226ccd 100644 --- a/src/server/routes/contract/extensions/erc721/read/canClaim.ts +++ b/src/server/routes/contract/extensions/erc721/read/canClaim.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/get.ts b/src/server/routes/contract/extensions/erc721/read/get.ts index e5f332ab2..11faf6bdc 100644 --- a/src/server/routes/contract/extensions/erc721/read/get.ts +++ b/src/server/routes/contract/extensions/erc721/read/get.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { nftSchema } from "../../../../../schemas/nft"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/getActiveClaimConditions.ts b/src/server/routes/contract/extensions/erc721/read/getActiveClaimConditions.ts index f24521b3d..88164318d 100644 --- a/src/server/routes/contract/extensions/erc721/read/getActiveClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc721/read/getActiveClaimConditions.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionOutputSchema } from "../../../../../schemas/claimConditions"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/getAll.ts b/src/server/routes/contract/extensions/erc721/read/getAll.ts index 4eb8bacab..043db6f74 100644 --- a/src/server/routes/contract/extensions/erc721/read/getAll.ts +++ b/src/server/routes/contract/extensions/erc721/read/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { nftSchema } from "../../../../../schemas/nft"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/getAllClaimConditions.ts b/src/server/routes/contract/extensions/erc721/read/getAllClaimConditions.ts index 8d4a62f0e..9158456f5 100644 --- a/src/server/routes/contract/extensions/erc721/read/getAllClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc721/read/getAllClaimConditions.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionOutputSchema } from "../../../../../schemas/claimConditions"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/getClaimIneligibilityReasons.ts b/src/server/routes/contract/extensions/erc721/read/getClaimIneligibilityReasons.ts index 88d552910..c4b069987 100644 --- a/src/server/routes/contract/extensions/erc721/read/getClaimIneligibilityReasons.ts +++ b/src/server/routes/contract/extensions/erc721/read/getClaimIneligibilityReasons.ts @@ -2,7 +2,7 @@ import { Type, type Static } from "@sinclair/typebox"; import { ClaimEligibility } from "@thirdweb-dev/sdk"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/getClaimerProofs.ts b/src/server/routes/contract/extensions/erc721/read/getClaimerProofs.ts index d39672dac..eee8854cd 100644 --- a/src/server/routes/contract/extensions/erc721/read/getClaimerProofs.ts +++ b/src/server/routes/contract/extensions/erc721/read/getClaimerProofs.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { claimerProofSchema } from "../../../../../schemas/claimConditions"; import { diff --git a/src/server/routes/contract/extensions/erc721/read/getOwned.ts b/src/server/routes/contract/extensions/erc721/read/getOwned.ts index 311ef318c..847d69c36 100644 --- a/src/server/routes/contract/extensions/erc721/read/getOwned.ts +++ b/src/server/routes/contract/extensions/erc721/read/getOwned.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { nftSchema } from "../../../../../schemas/nft"; import { diff --git a/src/server/routes/contract/extensions/erc721/read/isApproved.ts b/src/server/routes/contract/extensions/erc721/read/isApproved.ts index 22d3cbecd..b8ecc6e8a 100644 --- a/src/server/routes/contract/extensions/erc721/read/isApproved.ts +++ b/src/server/routes/contract/extensions/erc721/read/isApproved.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/signatureGenerate.ts b/src/server/routes/contract/extensions/erc721/read/signatureGenerate.ts index 281399a7e..0fca0a1f2 100644 --- a/src/server/routes/contract/extensions/erc721/read/signatureGenerate.ts +++ b/src/server/routes/contract/extensions/erc721/read/signatureGenerate.ts @@ -3,11 +3,11 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract, type Address, type Hex } from "thirdweb"; import { generateMintSignature } from "thirdweb/extensions/erc721"; -import { getAccount } from "../../../../../../shared/utils/account"; -import { getContract as getContractV4 } from "../../../../../../shared/utils/cache/getContract"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { maybeBigInt } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; +import { getAccount } from "../../../../../../utils/account"; +import { getContract as getContractV4 } from "../../../../../../utils/cache/getContract"; +import { getChain } from "../../../../../../utils/chain"; +import { maybeBigInt } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; import { thirdwebSdkVersionSchema } from "../../../../../schemas/httpHeaders/thirdwebSdkVersion"; import { signature721InputSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/signaturePrepare.ts b/src/server/routes/contract/extensions/erc721/read/signaturePrepare.ts index 5cb0d632f..0636354a2 100644 --- a/src/server/routes/contract/extensions/erc721/read/signaturePrepare.ts +++ b/src/server/routes/contract/extensions/erc721/read/signaturePrepare.ts @@ -17,9 +17,9 @@ import { import { decimals } from "thirdweb/extensions/erc20"; import { upload } from "thirdweb/storage"; import { checksumAddress } from "thirdweb/utils"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { prettifyError } from "../../../../../../shared/utils/error"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; +import { getChain } from "../../../../../../utils/chain"; +import { prettifyError } from "../../../../../../utils/error"; +import { thirdwebClient } from "../../../../../../utils/sdk"; import { createCustomError } from "../../../../../middleware/error"; import { signature721InputSchemaV5, diff --git a/src/server/routes/contract/extensions/erc721/read/totalClaimedSupply.ts b/src/server/routes/contract/extensions/erc721/read/totalClaimedSupply.ts index 342f63448..94d6d91bb 100644 --- a/src/server/routes/contract/extensions/erc721/read/totalClaimedSupply.ts +++ b/src/server/routes/contract/extensions/erc721/read/totalClaimedSupply.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/totalCount.ts b/src/server/routes/contract/extensions/erc721/read/totalCount.ts index 5a6cd5809..7599028de 100644 --- a/src/server/routes/contract/extensions/erc721/read/totalCount.ts +++ b/src/server/routes/contract/extensions/erc721/read/totalCount.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc721/read/totalUnclaimedSupply.ts b/src/server/routes/contract/extensions/erc721/read/totalUnclaimedSupply.ts index 88c4b12f8..5eb39d2c7 100644 --- a/src/server/routes/contract/extensions/erc721/read/totalUnclaimedSupply.ts +++ b/src/server/routes/contract/extensions/erc721/read/totalUnclaimedSupply.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/erc721/write/burn.ts b/src/server/routes/contract/extensions/erc721/write/burn.ts index 259ba1af1..f0591eafa 100644 --- a/src/server/routes/contract/extensions/erc721/write/burn.ts +++ b/src/server/routes/contract/extensions/erc721/write/burn.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/erc721/write/claimTo.ts b/src/server/routes/contract/extensions/erc721/write/claimTo.ts index 1366bb9cb..a18780e08 100644 --- a/src/server/routes/contract/extensions/erc721/write/claimTo.ts +++ b/src/server/routes/contract/extensions/erc721/write/claimTo.ts @@ -1,10 +1,10 @@ -import { type Static, Type } from "@sinclair/typebox"; +import { Static, Type } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import type { Address } from "thirdweb"; import { claimTo } from "thirdweb/extensions/erc721"; -import { getContractV5 } from "../../../../../../shared/utils/cache/getContractv5"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getContractV5 } from "../../../../../../utils/cache/getContractv5"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema } from "../../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/write/lazyMint.ts b/src/server/routes/contract/extensions/erc721/write/lazyMint.ts index 7f22c2eae..c553454f8 100644 --- a/src/server/routes/contract/extensions/erc721/write/lazyMint.ts +++ b/src/server/routes/contract/extensions/erc721/write/lazyMint.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { nftOrInputSchema } from "../../../../../schemas/nft"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/write/mintBatchTo.ts b/src/server/routes/contract/extensions/erc721/write/mintBatchTo.ts index 38e5aa299..79c14a801 100644 --- a/src/server/routes/contract/extensions/erc721/write/mintBatchTo.ts +++ b/src/server/routes/contract/extensions/erc721/write/mintBatchTo.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { nftOrInputSchema } from "../../../../../schemas/nft"; import { diff --git a/src/server/routes/contract/extensions/erc721/write/mintTo.ts b/src/server/routes/contract/extensions/erc721/write/mintTo.ts index dc48f446a..8099991eb 100644 --- a/src/server/routes/contract/extensions/erc721/write/mintTo.ts +++ b/src/server/routes/contract/extensions/erc721/write/mintTo.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../schemas/address"; import { nftOrInputSchema } from "../../../../../schemas/nft"; import { diff --git a/src/server/routes/contract/extensions/erc721/write/setApprovalForAll.ts b/src/server/routes/contract/extensions/erc721/write/setApprovalForAll.ts index 3f3c29c8f..b521adf4d 100644 --- a/src/server/routes/contract/extensions/erc721/write/setApprovalForAll.ts +++ b/src/server/routes/contract/extensions/erc721/write/setApprovalForAll.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/erc721/write/setApprovalForToken.ts b/src/server/routes/contract/extensions/erc721/write/setApprovalForToken.ts index ad7fd5aa8..8b3f8e7b3 100644 --- a/src/server/routes/contract/extensions/erc721/write/setApprovalForToken.ts +++ b/src/server/routes/contract/extensions/erc721/write/setApprovalForToken.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { contractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/erc721/write/setClaimConditions.ts b/src/server/routes/contract/extensions/erc721/write/setClaimConditions.ts index 42afb844d..8e67bdaae 100644 --- a/src/server/routes/contract/extensions/erc721/write/setClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc721/write/setClaimConditions.ts @@ -1,11 +1,11 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionInputSchema, - type sanitizedClaimConditionInputSchema, + sanitizedClaimConditionInputSchema, } from "../../../../../schemas/claimConditions"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/write/signatureMint.ts b/src/server/routes/contract/extensions/erc721/write/signatureMint.ts index 808c14246..2a85bb169 100644 --- a/src/server/routes/contract/extensions/erc721/write/signatureMint.ts +++ b/src/server/routes/contract/extensions/erc721/write/signatureMint.ts @@ -1,16 +1,16 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { SignedPayload721WithQuantitySignature } from "@thirdweb-dev/sdk"; +import { Static, Type } from "@sinclair/typebox"; +import { SignedPayload721WithQuantitySignature } from "@thirdweb-dev/sdk"; import { BigNumber } from "ethers"; -import type { FastifyInstance } from "fastify"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address, Hex } from "thirdweb"; +import { Address, Hex } from "thirdweb"; import { mintWithSignature } from "thirdweb/extensions/erc721"; import { resolvePromisedValue } from "thirdweb/utils"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; -import { getContractV5 } from "../../../../../../shared/utils/cache/getContractv5"; -import { insertTransaction } from "../../../../../../shared/utils/transaction/insertTransaction"; -import type { thirdwebSdkVersionSchema } from "../../../../../schemas/httpHeaders/thirdwebSdkVersion"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; +import { getContractV5 } from "../../../../../../utils/cache/getContractv5"; +import { insertTransaction } from "../../../../../../utils/transaction/insertTransaction"; +import { thirdwebSdkVersionSchema } from "../../../../../schemas/httpHeaders/thirdwebSdkVersion"; import { signature721OutputSchema } from "../../../../../schemas/nft"; import { signature721OutputSchemaV5 } from "../../../../../schemas/nft/v5"; import { diff --git a/src/server/routes/contract/extensions/erc721/write/transfer.ts b/src/server/routes/contract/extensions/erc721/write/transfer.ts index 87835ca09..60f00d5bb 100644 --- a/src/server/routes/contract/extensions/erc721/write/transfer.ts +++ b/src/server/routes/contract/extensions/erc721/write/transfer.ts @@ -3,10 +3,10 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract } from "thirdweb"; import { transferFrom } from "thirdweb/extensions/erc721"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { getChecksumAddress } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getChain } from "../../../../../../utils/chain"; +import { getChecksumAddress } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema } from "../../../../../schemas/address"; import { NumberStringSchema } from "../../../../../schemas/number"; import { diff --git a/src/server/routes/contract/extensions/erc721/write/transferFrom.ts b/src/server/routes/contract/extensions/erc721/write/transferFrom.ts index e19e8cb9d..404086221 100644 --- a/src/server/routes/contract/extensions/erc721/write/transferFrom.ts +++ b/src/server/routes/contract/extensions/erc721/write/transferFrom.ts @@ -3,10 +3,10 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract } from "thirdweb"; import { transferFrom } from "thirdweb/extensions/erc721"; -import { getChain } from "../../../../../../shared/utils/chain"; -import { getChecksumAddress } from "../../../../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../../../../shared/utils/sdk"; -import { queueTransaction } from "../../../../../../shared/utils/transaction/queueTransation"; +import { getChain } from "../../../../../../utils/chain"; +import { getChecksumAddress } from "../../../../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../../../../utils/sdk"; +import { queueTransaction } from "../../../../../../utils/transaction/queueTransation"; import { AddressSchema } from "../../../../../schemas/address"; import { NumberStringSchema } from "../../../../../schemas/number"; import { diff --git a/src/server/routes/contract/extensions/erc721/write/updateClaimConditions.ts b/src/server/routes/contract/extensions/erc721/write/updateClaimConditions.ts index d9c9fb6f7..8b8faaa49 100644 --- a/src/server/routes/contract/extensions/erc721/write/updateClaimConditions.ts +++ b/src/server/routes/contract/extensions/erc721/write/updateClaimConditions.ts @@ -1,11 +1,11 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { claimConditionInputSchema, - type sanitizedClaimConditionInputSchema, + sanitizedClaimConditionInputSchema, } from "../../../../../schemas/claimConditions"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/erc721/write/updateTokenMetadata.ts b/src/server/routes/contract/extensions/erc721/write/updateTokenMetadata.ts index c8a610821..48ba8e64f 100644 --- a/src/server/routes/contract/extensions/erc721/write/updateTokenMetadata.ts +++ b/src/server/routes/contract/extensions/erc721/write/updateTokenMetadata.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../utils/cache/getContract"; import { nftMetadataInputSchema } from "../../../../../schemas/nft"; import { contractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getAll.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getAll.ts index 5debad7eb..500b976c6 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getAll.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { directListingV3OutputSchema } from "../../../../../../schemas/marketplaceV3/directListing"; import { marketplaceFilterSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getAllValid.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getAllValid.ts index a7e35ab5d..6b3182668 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getAllValid.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getAllValid.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { directListingV3OutputSchema } from "../../../../../../schemas/marketplaceV3/directListing"; import { marketplaceFilterSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getListing.ts index cd7b396bd..73397c27f 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getListing.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { directListingV3OutputSchema } from "../../../../../../schemas/marketplaceV3/directListing"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getTotalCount.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getTotalCount.ts index c46910f28..1d6228f9c 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getTotalCount.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/getTotalCount.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/isBuyerApprovedForListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/isBuyerApprovedForListing.ts index 4b261a5a3..05ff2336a 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/isBuyerApprovedForListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/isBuyerApprovedForListing.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../../schemas/address"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/isCurrencyApprovedForListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/isCurrencyApprovedForListing.ts index 3351dd6d7..02b353a97 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/read/isCurrencyApprovedForListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/read/isCurrencyApprovedForListing.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../../schemas/address"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/approveBuyerForReservedListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/approveBuyerForReservedListing.ts index f723caadc..c9b697a25 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/approveBuyerForReservedListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/approveBuyerForReservedListing.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/buyFromListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/buyFromListing.ts index 37ab99780..75ff756b8 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/buyFromListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/buyFromListing.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/cancelListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/cancelListing.ts index af6a96951..17222f50a 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/cancelListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/cancelListing.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/createListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/createListing.ts index 141feddad..74c7f63d8 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/createListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/createListing.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { directListingV3InputSchema } from "../../../../../../schemas/marketplaceV3/directListing"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/revokeBuyerApprovalForReservedListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/revokeBuyerApprovalForReservedListing.ts index 607afb958..79cd57d3d 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/revokeBuyerApprovalForReservedListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/revokeBuyerApprovalForReservedListing.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../../schemas/address"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/revokeCurrencyApprovalForListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/revokeCurrencyApprovalForListing.ts index 705463bf4..048a81b78 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/revokeCurrencyApprovalForListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/revokeCurrencyApprovalForListing.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../../../schemas/address"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/updateListing.ts b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/updateListing.ts index c58104607..63db76bd4 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/directListings/write/updateListing.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/directListings/write/updateListing.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { directListingV3InputSchema } from "../../../../../../schemas/marketplaceV3/directListing"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAll.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAll.ts index f7ebc52d2..674368c5b 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAll.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { englishAuctionOutputSchema } from "../../../../../../schemas/marketplaceV3/englishAuction"; import { marketplaceFilterSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAllValid.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAllValid.ts index 25a65fcc1..d99b58077 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAllValid.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAllValid.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { englishAuctionOutputSchema } from "../../../../../../schemas/marketplaceV3/englishAuction"; import { marketplaceFilterSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAuction.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAuction.ts index 53353271c..0b0ffc488 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAuction.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getAuction.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { englishAuctionOutputSchema } from "../../../../../../schemas/marketplaceV3/englishAuction"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getBidBufferBps.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getBidBufferBps.ts index de9247202..81193e015 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getBidBufferBps.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getBidBufferBps.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getMinimumNextBid.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getMinimumNextBid.ts index c02d495e9..f17418ec2 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getMinimumNextBid.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getMinimumNextBid.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { currencyValueSchema, marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getTotalCount.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getTotalCount.ts index 4813b190c..e44013962 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getTotalCount.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getTotalCount.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getWinner.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getWinner.ts index 95d4e19ed..6781ca0d1 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getWinner.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getWinner.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getWinningBid.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getWinningBid.ts index 6f839ff0c..9c117f18c 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getWinningBid.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/getWinningBid.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { bidSchema } from "../../../../../../schemas/marketplaceV3/englishAuction"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/isWinningBid.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/isWinningBid.ts index a70f469a6..08c3b6e20 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/isWinningBid.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/read/isWinningBid.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/buyoutAuction.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/buyoutAuction.ts index 142d5a6f3..64a931d47 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/buyoutAuction.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/buyoutAuction.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/cancelAuction.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/cancelAuction.ts index dbcd85bec..df6f44c71 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/cancelAuction.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/cancelAuction.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/closeAuctionForBidder.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/closeAuctionForBidder.ts index f0131cb06..1b5236a93 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/closeAuctionForBidder.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/closeAuctionForBidder.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/closeAuctionForSeller.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/closeAuctionForSeller.ts index 0485e4151..32ad9f01a 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/closeAuctionForSeller.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/closeAuctionForSeller.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/createAuction.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/createAuction.ts index f74f0ad23..b348b1b1d 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/createAuction.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/createAuction.ts @@ -1,8 +1,8 @@ import type { Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { englishAuctionInputSchema } from "../../../../../../schemas/marketplaceV3/englishAuction"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/executeSale.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/executeSale.ts index 9770164ef..19e591eeb 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/executeSale.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/executeSale.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/makeBid.ts b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/makeBid.ts index 8eabd7456..7545db42e 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/makeBid.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/englishAuctions/write/makeBid.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/offers/read/getAll.ts b/src/server/routes/contract/extensions/marketplaceV3/offers/read/getAll.ts index e4b9271c7..6497ed6d5 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/offers/read/getAll.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/offers/read/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { OfferV3OutputSchema } from "../../../../../../schemas/marketplaceV3/offer"; import { marketplaceFilterSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/offers/read/getAllValid.ts b/src/server/routes/contract/extensions/marketplaceV3/offers/read/getAllValid.ts index 01c1b6bcd..e913d2911 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/offers/read/getAllValid.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/offers/read/getAllValid.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { OfferV3OutputSchema } from "../../../../../../schemas/marketplaceV3/offer"; import { marketplaceFilterSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/offers/read/getOffer.ts b/src/server/routes/contract/extensions/marketplaceV3/offers/read/getOffer.ts index d752431fc..4eb1991cb 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/offers/read/getOffer.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/offers/read/getOffer.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { OfferV3OutputSchema } from "../../../../../../schemas/marketplaceV3/offer"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/offers/read/getTotalCount.ts b/src/server/routes/contract/extensions/marketplaceV3/offers/read/getTotalCount.ts index ada1fb3e6..86f476220 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/offers/read/getTotalCount.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/offers/read/getTotalCount.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/offers/write/acceptOffer.ts b/src/server/routes/contract/extensions/marketplaceV3/offers/write/acceptOffer.ts index 7eed54d24..f1614a731 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/offers/write/acceptOffer.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/offers/write/acceptOffer.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/offers/write/cancelOffer.ts b/src/server/routes/contract/extensions/marketplaceV3/offers/write/cancelOffer.ts index 0f81e3138..aa205c3ac 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/offers/write/cancelOffer.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/offers/write/cancelOffer.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { marketplaceV3ContractParamSchema, requestQuerystringSchema, diff --git a/src/server/routes/contract/extensions/marketplaceV3/offers/write/makeOffer.ts b/src/server/routes/contract/extensions/marketplaceV3/offers/write/makeOffer.ts index daa44c8c1..3cc4deb43 100644 --- a/src/server/routes/contract/extensions/marketplaceV3/offers/write/makeOffer.ts +++ b/src/server/routes/contract/extensions/marketplaceV3/offers/write/makeOffer.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../../../utils/cache/getContract"; import { OfferV3InputSchema } from "../../../../../../schemas/marketplaceV3/offer"; import { marketplaceV3ContractParamSchema, diff --git a/src/server/routes/contract/metadata/abi.ts b/src/server/routes/contract/metadata/abi.ts index f642809bf..56cbb5b10 100644 --- a/src/server/routes/contract/metadata/abi.ts +++ b/src/server/routes/contract/metadata/abi.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../utils/cache/getContract"; import { abiSchema } from "../../../schemas/contract"; import { contractParamSchema, diff --git a/src/server/routes/contract/metadata/events.ts b/src/server/routes/contract/metadata/events.ts index f16d65e2f..0d3e769fa 100644 --- a/src/server/routes/contract/metadata/events.ts +++ b/src/server/routes/contract/metadata/events.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../utils/cache/getContract"; import { abiEventSchema } from "../../../schemas/contract"; import { contractParamSchema, diff --git a/src/server/routes/contract/metadata/extensions.ts b/src/server/routes/contract/metadata/extensions.ts index d4d553173..79255c7f8 100644 --- a/src/server/routes/contract/metadata/extensions.ts +++ b/src/server/routes/contract/metadata/extensions.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; +import { Static, Type } from "@sinclair/typebox"; import { getAllDetectedExtensionNames } from "@thirdweb-dev/sdk"; -import type { FastifyInstance } from "fastify"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/metadata/functions.ts b/src/server/routes/contract/metadata/functions.ts index 3d45736ba..268254418 100644 --- a/src/server/routes/contract/metadata/functions.ts +++ b/src/server/routes/contract/metadata/functions.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../utils/cache/getContract"; import { abiFunctionSchema } from "../../../schemas/contract"; import { contractParamSchema, diff --git a/src/server/routes/contract/read/read.ts b/src/server/routes/contract/read/read.ts index 81721a098..89b0e115d 100644 --- a/src/server/routes/contract/read/read.ts +++ b/src/server/routes/contract/read/read.ts @@ -1,8 +1,8 @@ import { Type } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../shared/utils/cache/getContract"; -import { prettifyError } from "../../../../shared/utils/error"; +import { getContract } from "../../../../utils/cache/getContract"; +import { prettifyError } from "../../../../utils/error"; import { createCustomError } from "../../../middleware/error"; import { readRequestQuerySchema, diff --git a/src/server/routes/contract/roles/read/get.ts b/src/server/routes/contract/roles/read/get.ts index f07c1479f..a10b1e827 100644 --- a/src/server/routes/contract/roles/read/get.ts +++ b/src/server/routes/contract/roles/read/get.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../utils/cache/getContract"; import { contractParamSchema, standardResponseSchema, diff --git a/src/server/routes/contract/roles/read/getAll.ts b/src/server/routes/contract/roles/read/getAll.ts index ee4a8d920..175b626df 100644 --- a/src/server/routes/contract/roles/read/getAll.ts +++ b/src/server/routes/contract/roles/read/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../utils/cache/getContract"; import { rolesResponseSchema } from "../../../../schemas/contract"; import { contractParamSchema, diff --git a/src/server/routes/contract/roles/write/grant.ts b/src/server/routes/contract/roles/write/grant.ts index 538b2d869..c82ad2269 100644 --- a/src/server/routes/contract/roles/write/grant.ts +++ b/src/server/routes/contract/roles/write/grant.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/roles/write/revoke.ts b/src/server/routes/contract/roles/write/revoke.ts index 063f9c8e1..4b1173132 100644 --- a/src/server/routes/contract/roles/write/revoke.ts +++ b/src/server/routes/contract/roles/write/revoke.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../utils/cache/getContract"; import { AddressSchema } from "../../../../schemas/address"; import { contractParamSchema, diff --git a/src/server/routes/contract/royalties/read/getDefaultRoyaltyInfo.ts b/src/server/routes/contract/royalties/read/getDefaultRoyaltyInfo.ts index ed85d8712..c6282d135 100644 --- a/src/server/routes/contract/royalties/read/getDefaultRoyaltyInfo.ts +++ b/src/server/routes/contract/royalties/read/getDefaultRoyaltyInfo.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../utils/cache/getContract"; import { royaltySchema } from "../../../../schemas/contract"; import { contractParamSchema, diff --git a/src/server/routes/contract/royalties/read/getTokenRoyaltyInfo.ts b/src/server/routes/contract/royalties/read/getTokenRoyaltyInfo.ts index 163ae5fee..fec257ad5 100644 --- a/src/server/routes/contract/royalties/read/getTokenRoyaltyInfo.ts +++ b/src/server/routes/contract/royalties/read/getTokenRoyaltyInfo.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContract } from "../../../../../shared/utils/cache/getContract"; +import { getContract } from "../../../../../utils/cache/getContract"; import { royaltySchema } from "../../../../schemas/contract"; import { contractParamSchema, diff --git a/src/server/routes/contract/royalties/write/setDefaultRoyaltyInfo.ts b/src/server/routes/contract/royalties/write/setDefaultRoyaltyInfo.ts index 239c08778..acfb5c8fd 100644 --- a/src/server/routes/contract/royalties/write/setDefaultRoyaltyInfo.ts +++ b/src/server/routes/contract/royalties/write/setDefaultRoyaltyInfo.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../utils/cache/getContract"; import { royaltySchema } from "../../../../schemas/contract"; import { contractParamSchema, diff --git a/src/server/routes/contract/royalties/write/setTokenRoyaltyInfo.ts b/src/server/routes/contract/royalties/write/setTokenRoyaltyInfo.ts index 6ff5d09c2..4d12d72b0 100644 --- a/src/server/routes/contract/royalties/write/setTokenRoyaltyInfo.ts +++ b/src/server/routes/contract/royalties/write/setTokenRoyaltyInfo.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { queueTx } from "../../../../../shared/db/transactions/queueTx"; -import { getContract } from "../../../../../shared/utils/cache/getContract"; +import { queueTx } from "../../../../../db/transactions/queueTx"; +import { getContract } from "../../../../../utils/cache/getContract"; import { royaltySchema } from "../../../../schemas/contract"; import { contractParamSchema, diff --git a/src/server/routes/contract/subscriptions/addContractSubscription.ts b/src/server/routes/contract/subscriptions/addContractSubscription.ts index 05637d75f..bddd24fc1 100644 --- a/src/server/routes/contract/subscriptions/addContractSubscription.ts +++ b/src/server/routes/contract/subscriptions/addContractSubscription.ts @@ -1,16 +1,16 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { getContract } from "thirdweb"; import { isContractDeployed } from "thirdweb/utils"; -import { upsertChainIndexer } from "../../../../shared/db/chainIndexers/upsertChainIndexer"; -import { createContractSubscription } from "../../../../shared/db/contractSubscriptions/createContractSubscription"; -import { getContractSubscriptionsUniqueChainIds } from "../../../../shared/db/contractSubscriptions/getContractSubscriptions"; -import { insertWebhook } from "../../../../shared/db/webhooks/createWebhook"; -import { WebhooksEventTypes } from "../../../../shared/schemas/webhooks"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; -import { getChain } from "../../../../shared/utils/chain"; -import { thirdwebClient } from "../../../../shared/utils/sdk"; +import { upsertChainIndexer } from "../../../../db/chainIndexers/upsertChainIndexer"; +import { createContractSubscription } from "../../../../db/contractSubscriptions/createContractSubscription"; +import { getContractSubscriptionsUniqueChainIds } from "../../../../db/contractSubscriptions/getContractSubscriptions"; +import { insertWebhook } from "../../../../db/webhooks/createWebhook"; +import { WebhooksEventTypes } from "../../../../schema/webhooks"; +import { getSdk } from "../../../../utils/cache/getSdk"; +import { getChain } from "../../../../utils/chain"; +import { thirdwebClient } from "../../../../utils/sdk"; import { createCustomError } from "../../../middleware/error"; import { AddressSchema } from "../../../schemas/address"; import { chainIdOrSlugSchema } from "../../../schemas/chain"; diff --git a/src/server/routes/contract/subscriptions/getContractIndexedBlockRange.ts b/src/server/routes/contract/subscriptions/getContractIndexedBlockRange.ts index 66a5f0cb8..e708cd8b2 100644 --- a/src/server/routes/contract/subscriptions/getContractIndexedBlockRange.ts +++ b/src/server/routes/contract/subscriptions/getContractIndexedBlockRange.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getContractEventLogsIndexedBlockRange } from "../../../../shared/db/contractEventLogs/getContractEventLogs"; +import { getContractEventLogsIndexedBlockRange } from "../../../../db/contractEventLogs/getContractEventLogs"; import { createCustomError } from "../../../middleware/error"; import { AddressSchema } from "../../../schemas/address"; import { chainIdOrSlugSchema } from "../../../schemas/chain"; diff --git a/src/server/routes/contract/subscriptions/getContractSubscriptions.ts b/src/server/routes/contract/subscriptions/getContractSubscriptions.ts index d542ee9a2..81fb1ac2d 100644 --- a/src/server/routes/contract/subscriptions/getContractSubscriptions.ts +++ b/src/server/routes/contract/subscriptions/getContractSubscriptions.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getAllContractSubscriptions } from "../../../../shared/db/contractSubscriptions/getContractSubscriptions"; +import { getAllContractSubscriptions } from "../../../../db/contractSubscriptions/getContractSubscriptions"; import { contractSubscriptionSchema, toContractSubscriptionSchema, diff --git a/src/server/routes/contract/subscriptions/getLatestBlock.ts b/src/server/routes/contract/subscriptions/getLatestBlock.ts index 1cea5a453..49f81e09c 100644 --- a/src/server/routes/contract/subscriptions/getLatestBlock.ts +++ b/src/server/routes/contract/subscriptions/getLatestBlock.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getLastIndexedBlock } from "../../../../shared/db/chainIndexers/getChainIndexer"; +import { getLastIndexedBlock } from "../../../../db/chainIndexers/getChainIndexer"; import { chainRequestQuerystringSchema } from "../../../schemas/chain"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { getChainIdFromChain } from "../../../utils/chain"; diff --git a/src/server/routes/contract/subscriptions/removeContractSubscription.ts b/src/server/routes/contract/subscriptions/removeContractSubscription.ts index 488b2d68c..3b0711c75 100644 --- a/src/server/routes/contract/subscriptions/removeContractSubscription.ts +++ b/src/server/routes/contract/subscriptions/removeContractSubscription.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { deleteContractSubscription } from "../../../../shared/db/contractSubscriptions/deleteContractSubscription"; -import { deleteWebhook } from "../../../../shared/db/webhooks/revokeWebhook"; +import { deleteContractSubscription } from "../../../../db/contractSubscriptions/deleteContractSubscription"; +import { deleteWebhook } from "../../../../db/webhooks/revokeWebhook"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; const bodySchema = Type.Object({ diff --git a/src/server/routes/contract/transactions/getTransactionReceipts.ts b/src/server/routes/contract/transactions/getTransactionReceipts.ts index d0267226d..87b90a530 100644 --- a/src/server/routes/contract/transactions/getTransactionReceipts.ts +++ b/src/server/routes/contract/transactions/getTransactionReceipts.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { isContractSubscribed } from "../../../../shared/db/contractSubscriptions/getContractSubscriptions"; -import { getContractTransactionReceiptsByBlock } from "../../../../shared/db/contractTransactionReceipts/getContractTransactionReceipts"; +import { isContractSubscribed } from "../../../../db/contractSubscriptions/getContractSubscriptions"; +import { getContractTransactionReceiptsByBlock } from "../../../../db/contractTransactionReceipts/getContractTransactionReceipts"; import { createCustomError } from "../../../middleware/error"; import { contractParamSchema, diff --git a/src/server/routes/contract/transactions/getTransactionReceiptsByTimestamp.ts b/src/server/routes/contract/transactions/getTransactionReceiptsByTimestamp.ts index 5a9f55393..2c76ec6da 100644 --- a/src/server/routes/contract/transactions/getTransactionReceiptsByTimestamp.ts +++ b/src/server/routes/contract/transactions/getTransactionReceiptsByTimestamp.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getTransactionReceiptsByBlockTimestamp } from "../../../../shared/db/contractTransactionReceipts/getContractTransactionReceipts"; +import { getTransactionReceiptsByBlockTimestamp } from "../../../../db/contractTransactionReceipts/getContractTransactionReceipts"; import { AddressSchema } from "../../../schemas/address"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { transactionReceiptSchema } from "../../../schemas/transactionReceipt"; diff --git a/src/server/routes/contract/transactions/paginateTransactionReceipts.ts b/src/server/routes/contract/transactions/paginateTransactionReceipts.ts index 6aca2a842..0d13b9b1d 100644 --- a/src/server/routes/contract/transactions/paginateTransactionReceipts.ts +++ b/src/server/routes/contract/transactions/paginateTransactionReceipts.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getConfiguration } from "../../../../shared/db/configuration/getConfiguration"; -import { getTransactionReceiptsByCursor } from "../../../../shared/db/contractTransactionReceipts/getContractTransactionReceipts"; +import { getConfiguration } from "../../../../db/configuration/getConfiguration"; +import { getTransactionReceiptsByCursor } from "../../../../db/contractTransactionReceipts/getContractTransactionReceipts"; import { AddressSchema } from "../../../schemas/address"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { diff --git a/src/server/routes/contract/write/write.ts b/src/server/routes/contract/write/write.ts index 3f928832f..b47049786 100644 --- a/src/server/routes/contract/write/write.ts +++ b/src/server/routes/contract/write/write.ts @@ -3,9 +3,9 @@ import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { prepareContractCall, resolveMethod } from "thirdweb"; import { parseAbiParams, type AbiFunction } from "thirdweb/utils"; -import { getContractV5 } from "../../../../shared/utils/cache/getContractv5"; -import { prettifyError } from "../../../../shared/utils/error"; -import { queueTransaction } from "../../../../shared/utils/transaction/queueTransation"; +import { getContractV5 } from "../../../../utils/cache/getContractv5"; +import { prettifyError } from "../../../../utils/error"; +import { queueTransaction } from "../../../../utils/transaction/queueTransation"; import { createCustomError } from "../../../middleware/error"; import { abiArraySchema } from "../../../schemas/contract"; import { diff --git a/src/server/routes/deploy/prebuilt.ts b/src/server/routes/deploy/prebuilt.ts index 271d298b7..38815a755 100644 --- a/src/server/routes/deploy/prebuilt.ts +++ b/src/server/routes/deploy/prebuilt.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../db/transactions/queueTx"; +import { getSdk } from "../../../utils/cache/getSdk"; import { AddressSchema } from "../../schemas/address"; import { contractDeployBasicSchema } from "../../schemas/contract"; import { diff --git a/src/server/routes/deploy/prebuilts/edition.ts b/src/server/routes/deploy/prebuilts/edition.ts index 611437a7b..15b99b65b 100644 --- a/src/server/routes/deploy/prebuilts/edition.ts +++ b/src/server/routes/deploy/prebuilts/edition.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/editionDrop.ts b/src/server/routes/deploy/prebuilts/editionDrop.ts index 8ffa11299..9e2c11bbd 100644 --- a/src/server/routes/deploy/prebuilts/editionDrop.ts +++ b/src/server/routes/deploy/prebuilts/editionDrop.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/marketplaceV3.ts b/src/server/routes/deploy/prebuilts/marketplaceV3.ts index 8d70769a9..8635946c9 100644 --- a/src/server/routes/deploy/prebuilts/marketplaceV3.ts +++ b/src/server/routes/deploy/prebuilts/marketplaceV3.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/multiwrap.ts b/src/server/routes/deploy/prebuilts/multiwrap.ts index beb778bda..95df0dd8a 100644 --- a/src/server/routes/deploy/prebuilts/multiwrap.ts +++ b/src/server/routes/deploy/prebuilts/multiwrap.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/nftCollection.ts b/src/server/routes/deploy/prebuilts/nftCollection.ts index d12c2ec63..002f6e629 100644 --- a/src/server/routes/deploy/prebuilts/nftCollection.ts +++ b/src/server/routes/deploy/prebuilts/nftCollection.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/nftDrop.ts b/src/server/routes/deploy/prebuilts/nftDrop.ts index 19ca2a2f2..740df4fe8 100644 --- a/src/server/routes/deploy/prebuilts/nftDrop.ts +++ b/src/server/routes/deploy/prebuilts/nftDrop.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/pack.ts b/src/server/routes/deploy/prebuilts/pack.ts index 9e5eedbec..1c7c0e44f 100644 --- a/src/server/routes/deploy/prebuilts/pack.ts +++ b/src/server/routes/deploy/prebuilts/pack.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/signatureDrop.ts b/src/server/routes/deploy/prebuilts/signatureDrop.ts index f7a4a6290..f5f54d385 100644 --- a/src/server/routes/deploy/prebuilts/signatureDrop.ts +++ b/src/server/routes/deploy/prebuilts/signatureDrop.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/split.ts b/src/server/routes/deploy/prebuilts/split.ts index 8184c0699..8b9435a3e 100644 --- a/src/server/routes/deploy/prebuilts/split.ts +++ b/src/server/routes/deploy/prebuilts/split.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/token.ts b/src/server/routes/deploy/prebuilts/token.ts index 50fde94fb..13980f951 100644 --- a/src/server/routes/deploy/prebuilts/token.ts +++ b/src/server/routes/deploy/prebuilts/token.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/tokenDrop.ts b/src/server/routes/deploy/prebuilts/tokenDrop.ts index 73f55b682..6129ecfa7 100644 --- a/src/server/routes/deploy/prebuilts/tokenDrop.ts +++ b/src/server/routes/deploy/prebuilts/tokenDrop.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/prebuilts/vote.ts b/src/server/routes/deploy/prebuilts/vote.ts index fce36471f..2073993cd 100644 --- a/src/server/routes/deploy/prebuilts/vote.ts +++ b/src/server/routes/deploy/prebuilts/vote.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Address } from "thirdweb"; -import { queueTx } from "../../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../../shared/utils/cache/getSdk"; +import { Address } from "thirdweb"; +import { queueTx } from "../../../../db/transactions/queueTx"; +import { getSdk } from "../../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../../schemas/contract"; import { commonContractSchema, diff --git a/src/server/routes/deploy/published.ts b/src/server/routes/deploy/published.ts index 13a313541..96fd698bb 100644 --- a/src/server/routes/deploy/published.ts +++ b/src/server/routes/deploy/published.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { isAddress } from "thirdweb"; -import { queueTx } from "../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../shared/utils/cache/getSdk"; +import { queueTx } from "../../../db/transactions/queueTx"; +import { getSdk } from "../../../utils/cache/getSdk"; import { contractDeployBasicSchema } from "../../schemas/contract"; import { publishedDeployParamSchema, diff --git a/src/server/routes/relayer/create.ts b/src/server/routes/relayer/create.ts index f7b34d05f..1cda9f9b1 100644 --- a/src/server/routes/relayer/create.ts +++ b/src/server/routes/relayer/create.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { prisma } from "../../../shared/db/client"; +import { prisma } from "../../../db/client"; import { AddressSchema } from "../../schemas/address"; import { chainIdOrSlugSchema } from "../../schemas/chain"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/relayer/getAll.ts b/src/server/routes/relayer/getAll.ts index 3798b5e67..55fba56d8 100644 --- a/src/server/routes/relayer/getAll.ts +++ b/src/server/routes/relayer/getAll.ts @@ -1,7 +1,7 @@ import { Type } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { prisma } from "../../../shared/db/client"; +import { prisma } from "../../../db/client"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/relayer/index.ts b/src/server/routes/relayer/index.ts index 604a0774d..866f18ac8 100644 --- a/src/server/routes/relayer/index.ts +++ b/src/server/routes/relayer/index.ts @@ -8,10 +8,10 @@ import { ForwarderAbi, ForwarderAbiEIP712ChainlessDomain, NativeMetaTransaction, -} from "../../../shared/schemas/relayer"; -import { getRelayerById } from "../../../shared/db/relayer/getRelayerById"; -import { queueTx } from "../../../shared/db/transactions/queueTx"; -import { getSdk } from "../../../shared/utils/cache/getSdk"; +} from "../../../constants/relayer"; +import { getRelayerById } from "../../../db/relayer/getRelayerById"; +import { queueTx } from "../../../db/transactions/queueTx"; +import { getSdk } from "../../../utils/cache/getSdk"; import { AddressSchema } from "../../schemas/address"; import { standardResponseSchema, diff --git a/src/server/routes/relayer/revoke.ts b/src/server/routes/relayer/revoke.ts index aa84eb1ad..c69b8515d 100644 --- a/src/server/routes/relayer/revoke.ts +++ b/src/server/routes/relayer/revoke.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { prisma } from "../../../shared/db/client"; +import { prisma } from "../../../db/client"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; const requestBodySchema = Type.Object({ diff --git a/src/server/routes/relayer/update.ts b/src/server/routes/relayer/update.ts index 421ac46af..aca004e0f 100644 --- a/src/server/routes/relayer/update.ts +++ b/src/server/routes/relayer/update.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { prisma } from "../../../shared/db/client"; +import { prisma } from "../../../db/client"; import { AddressSchema } from "../../schemas/address"; import { chainIdOrSlugSchema } from "../../schemas/chain"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/system/health.ts b/src/server/routes/system/health.ts index 23672c92f..2106aecae 100644 --- a/src/server/routes/system/health.ts +++ b/src/server/routes/system/health.ts @@ -1,10 +1,10 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { isDatabaseReachable } from "../../../shared/db/client"; -import { env } from "../../../shared/utils/env"; -import { isRedisReachable } from "../../../shared/utils/redis/redis"; -import { thirdwebClientId } from "../../../shared/utils/sdk"; +import { isDatabaseReachable } from "../../../db/client"; +import { env } from "../../../utils/env"; +import { isRedisReachable } from "../../../utils/redis/redis"; +import { thirdwebClientId } from "../../../utils/sdk"; import { createCustomError } from "../../middleware/error"; type EngineFeature = diff --git a/src/server/routes/system/queue.ts b/src/server/routes/system/queue.ts index 8c01d2302..92763139e 100644 --- a/src/server/routes/system/queue.ts +++ b/src/server/routes/system/queue.ts @@ -1,9 +1,9 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { TransactionDB } from "../../../shared/db/transactions/db"; -import { getPercentile } from "../../../shared/utils/math"; -import type { MinedTransaction } from "../../../shared/utils/transaction/types"; +import { TransactionDB } from "../../../db/transactions/db"; +import { getPercentile } from "../../../utils/math"; +import type { MinedTransaction } from "../../../utils/transaction/types"; import { MineTransactionQueue } from "../../../worker/queues/mineTransactionQueue"; import { SendTransactionQueue } from "../../../worker/queues/sendTransactionQueue"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/transaction/blockchain/getLogs.ts b/src/server/routes/transaction/blockchain/getLogs.ts index 099dc246d..26a185dab 100644 --- a/src/server/routes/transaction/blockchain/getLogs.ts +++ b/src/server/routes/transaction/blockchain/getLogs.ts @@ -12,10 +12,10 @@ import { type Hex, } from "thirdweb"; import { resolveContractAbi } from "thirdweb/contract"; -import type { TransactionReceipt } from "thirdweb/transaction"; -import { TransactionDB } from "../../../../shared/db/transactions/db"; -import { getChain } from "../../../../shared/utils/chain"; -import { thirdwebClient } from "../../../../shared/utils/sdk"; +import { TransactionReceipt } from "thirdweb/transaction"; +import { TransactionDB } from "../../../../db/transactions/db"; +import { getChain } from "../../../../utils/chain"; +import { thirdwebClient } from "../../../../utils/sdk"; import { createCustomError } from "../../../middleware/error"; import { AddressSchema, TransactionHashSchema } from "../../../schemas/address"; import { chainIdOrSlugSchema } from "../../../schemas/chain"; diff --git a/src/server/routes/transaction/blockchain/getReceipt.ts b/src/server/routes/transaction/blockchain/getReceipt.ts index b5d3c4378..13cfd7786 100644 --- a/src/server/routes/transaction/blockchain/getReceipt.ts +++ b/src/server/routes/transaction/blockchain/getReceipt.ts @@ -9,12 +9,12 @@ import { } from "thirdweb"; import { stringify } from "thirdweb/utils"; import type { TransactionReceipt } from "viem"; -import { getChain } from "../../../../shared/utils/chain"; +import { getChain } from "../../../../utils/chain"; import { fromTransactionStatus, fromTransactionType, thirdwebClient, -} from "../../../../shared/utils/sdk"; +} from "../../../../utils/sdk"; import { createCustomError } from "../../../middleware/error"; import { AddressSchema, TransactionHashSchema } from "../../../schemas/address"; import { chainIdOrSlugSchema } from "../../../schemas/chain"; diff --git a/src/server/routes/transaction/blockchain/getUserOpReceipt.ts b/src/server/routes/transaction/blockchain/getUserOpReceipt.ts index 220add1ae..76c8c43a0 100644 --- a/src/server/routes/transaction/blockchain/getUserOpReceipt.ts +++ b/src/server/routes/transaction/blockchain/getUserOpReceipt.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { env } from "../../../../shared/utils/env"; +import { env } from "../../../../utils/env"; import { createCustomError } from "../../../middleware/error"; import { TransactionHashSchema } from "../../../schemas/address"; import { chainIdOrSlugSchema } from "../../../schemas/chain"; diff --git a/src/server/routes/transaction/blockchain/sendSignedTx.ts b/src/server/routes/transaction/blockchain/sendSignedTx.ts index fe7e1ac83..5fc53a188 100644 --- a/src/server/routes/transaction/blockchain/sendSignedTx.ts +++ b/src/server/routes/transaction/blockchain/sendSignedTx.ts @@ -2,8 +2,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { eth_sendRawTransaction, getRpcClient, isHex } from "thirdweb"; -import { getChain } from "../../../../shared/utils/chain"; -import { thirdwebClient } from "../../../../shared/utils/sdk"; +import { getChain } from "../../../../utils/chain"; +import { thirdwebClient } from "../../../../utils/sdk"; import { createCustomError } from "../../../middleware/error"; import { TransactionHashSchema } from "../../../schemas/address"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/transaction/blockchain/sendSignedUserOp.ts b/src/server/routes/transaction/blockchain/sendSignedUserOp.ts index 8db91f8e3..f5b3b28a6 100644 --- a/src/server/routes/transaction/blockchain/sendSignedUserOp.ts +++ b/src/server/routes/transaction/blockchain/sendSignedUserOp.ts @@ -2,8 +2,8 @@ import { Type, type Static } from "@sinclair/typebox"; import { Value } from "@sinclair/typebox/value"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { env } from "../../../../shared/utils/env"; -import { thirdwebClientId } from "../../../../shared/utils/sdk"; +import { env } from "../../../../utils/env"; +import { thirdwebClientId } from "../../../../utils/sdk"; import { TransactionHashSchema } from "../../../schemas/address"; import { standardResponseSchema } from "../../../schemas/sharedApiSchemas"; import { walletChainParamSchema } from "../../../schemas/wallet"; diff --git a/src/server/routes/transaction/cancel.ts b/src/server/routes/transaction/cancel.ts index cb49beb59..d9b704383 100644 --- a/src/server/routes/transaction/cancel.ts +++ b/src/server/routes/transaction/cancel.ts @@ -1,15 +1,15 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { TransactionDB } from "../../../shared/db/transactions/db"; -import { getBlockNumberish } from "../../../shared/utils/block"; -import { getConfig } from "../../../shared/utils/cache/getConfig"; -import { getChain } from "../../../shared/utils/chain"; -import { msSince } from "../../../shared/utils/date"; -import { sendCancellationTransaction } from "../../../shared/utils/transaction/cancelTransaction"; -import type { CancelledTransaction } from "../../../shared/utils/transaction/types"; -import { enqueueTransactionWebhook } from "../../../shared/utils/transaction/webhook"; -import { reportUsage } from "../../../shared/utils/usage"; +import { TransactionDB } from "../../../db/transactions/db"; +import { getBlockNumberish } from "../../../utils/block"; +import { getConfig } from "../../../utils/cache/getConfig"; +import { getChain } from "../../../utils/chain"; +import { msSince } from "../../../utils/date"; +import { sendCancellationTransaction } from "../../../utils/transaction/cancelTransaction"; +import type { CancelledTransaction } from "../../../utils/transaction/types"; +import { enqueueTransactionWebhook } from "../../../utils/transaction/webhook"; +import { reportUsage } from "../../../utils/usage"; import { SendTransactionQueue } from "../../../worker/queues/sendTransactionQueue"; import { createCustomError } from "../../middleware/error"; import { TransactionHashSchema } from "../../schemas/address"; diff --git a/src/server/routes/transaction/getAll.ts b/src/server/routes/transaction/getAll.ts index 6243e0fc7..5b58f5b3e 100644 --- a/src/server/routes/transaction/getAll.ts +++ b/src/server/routes/transaction/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { TransactionDB } from "../../../shared/db/transactions/db"; +import { TransactionDB } from "../../../db/transactions/db"; import { PaginationSchema } from "../../schemas/pagination"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { diff --git a/src/server/routes/transaction/getAllDeployedContracts.ts b/src/server/routes/transaction/getAllDeployedContracts.ts index d4745f9ad..4bcd88a61 100644 --- a/src/server/routes/transaction/getAllDeployedContracts.ts +++ b/src/server/routes/transaction/getAllDeployedContracts.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { TransactionDB } from "../../../shared/db/transactions/db"; +import { TransactionDB } from "../../../db/transactions/db"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { TransactionSchema, diff --git a/src/server/routes/transaction/retry-failed.ts b/src/server/routes/transaction/retry-failed.ts index 1550a97ca..5ac43c43b 100644 --- a/src/server/routes/transaction/retry-failed.ts +++ b/src/server/routes/transaction/retry-failed.ts @@ -1,12 +1,12 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { TransactionDB } from "../../../shared/db/transactions/db"; +import { TransactionDB } from "../../../db/transactions/db"; import { getReceiptForEOATransaction, getReceiptForUserOp, -} from "../../../shared/lib/transaction/get-transaction-receipt"; -import type { QueuedTransaction } from "../../../shared/utils/transaction/types"; +} from "../../../lib/transaction/get-transaction-receipt"; +import type { QueuedTransaction } from "../../../utils/transaction/types"; import { MineTransactionQueue } from "../../../worker/queues/mineTransactionQueue"; import { SendTransactionQueue } from "../../../worker/queues/sendTransactionQueue"; import { createCustomError } from "../../middleware/error"; diff --git a/src/server/routes/transaction/retry.ts b/src/server/routes/transaction/retry.ts index affd9a88c..c8716e2dd 100644 --- a/src/server/routes/transaction/retry.ts +++ b/src/server/routes/transaction/retry.ts @@ -1,9 +1,9 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { TransactionDB } from "../../../shared/db/transactions/db"; -import { maybeBigInt } from "../../../shared/utils/primitiveTypes"; -import type { SentTransaction } from "../../../shared/utils/transaction/types"; +import { TransactionDB } from "../../../db/transactions/db"; +import { maybeBigInt } from "../../../utils/primitiveTypes"; +import { SentTransaction } from "../../../utils/transaction/types"; import { SendTransactionQueue } from "../../../worker/queues/sendTransactionQueue"; import { createCustomError } from "../../middleware/error"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/transaction/status.ts b/src/server/routes/transaction/status.ts index 616009cbf..a5c9c1b95 100644 --- a/src/server/routes/transaction/status.ts +++ b/src/server/routes/transaction/status.ts @@ -1,9 +1,9 @@ -import type { SocketStream } from "@fastify/websocket"; -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { SocketStream } from "@fastify/websocket"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { TransactionDB } from "../../../shared/db/transactions/db"; -import { logger } from "../../../shared/utils/logger"; +import { TransactionDB } from "../../../db/transactions/db"; +import { logger } from "../../../utils/logger"; import { createCustomError } from "../../middleware/error"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { diff --git a/src/server/routes/transaction/sync-retry.ts b/src/server/routes/transaction/sync-retry.ts index e6ef887c4..3eabdbd1e 100644 --- a/src/server/routes/transaction/sync-retry.ts +++ b/src/server/routes/transaction/sync-retry.ts @@ -2,18 +2,15 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; import { toSerializableTransaction } from "thirdweb"; -import { TransactionDB } from "../../../shared/db/transactions/db"; -import { getReceiptForEOATransaction } from "../../../shared/lib/transaction/get-transaction-receipt"; -import { getAccount } from "../../../shared/utils/account"; -import { getBlockNumberish } from "../../../shared/utils/block"; -import { getChain } from "../../../shared/utils/chain"; -import { - getChecksumAddress, - maybeBigInt, -} from "../../../shared/utils/primitiveTypes"; -import { thirdwebClient } from "../../../shared/utils/sdk"; -import type { SentTransaction } from "../../../shared/utils/transaction/types"; -import { enqueueTransactionWebhook } from "../../../shared/utils/transaction/webhook"; +import { TransactionDB } from "../../../db/transactions/db"; +import { getReceiptForEOATransaction } from "../../../lib/transaction/get-transaction-receipt"; +import { getAccount } from "../../../utils/account"; +import { getBlockNumberish } from "../../../utils/block"; +import { getChain } from "../../../utils/chain"; +import { getChecksumAddress, maybeBigInt } from "../../../utils/primitiveTypes"; +import { thirdwebClient } from "../../../utils/sdk"; +import type { SentTransaction } from "../../../utils/transaction/types"; +import { enqueueTransactionWebhook } from "../../../utils/transaction/webhook"; import { MineTransactionQueue } from "../../../worker/queues/mineTransactionQueue"; import { createCustomError } from "../../middleware/error"; import { TransactionHashSchema } from "../../schemas/address"; diff --git a/src/server/routes/webhooks/create.ts b/src/server/routes/webhooks/create.ts index b9e71f2a9..a1cc44b32 100644 --- a/src/server/routes/webhooks/create.ts +++ b/src/server/routes/webhooks/create.ts @@ -1,8 +1,8 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { insertWebhook } from "../../../shared/db/webhooks/createWebhook"; -import { WebhooksEventTypes } from "../../../shared/schemas/webhooks"; +import { insertWebhook } from "../../../db/webhooks/createWebhook"; +import { WebhooksEventTypes } from "../../../schema/webhooks"; import { createCustomError } from "../../middleware/error"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { WebhookSchema, toWebhookSchema } from "../../schemas/webhook"; diff --git a/src/server/routes/webhooks/events.ts b/src/server/routes/webhooks/events.ts index 35f636d0b..1e621e771 100644 --- a/src/server/routes/webhooks/events.ts +++ b/src/server/routes/webhooks/events.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; -import type { FastifyInstance } from "fastify"; +import { Static, Type } from "@sinclair/typebox"; +import { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { WebhooksEventTypes } from "../../../shared/schemas/webhooks"; +import { WebhooksEventTypes } from "../../../schema/webhooks"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; export const responseBodySchema = Type.Object({ diff --git a/src/server/routes/webhooks/getAll.ts b/src/server/routes/webhooks/getAll.ts index 1c3c26149..9e22617f4 100644 --- a/src/server/routes/webhooks/getAll.ts +++ b/src/server/routes/webhooks/getAll.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getAllWebhooks } from "../../../shared/db/webhooks/getAllWebhooks"; +import { getAllWebhooks } from "../../../db/webhooks/getAllWebhooks"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; import { WebhookSchema, toWebhookSchema } from "../../schemas/webhook"; diff --git a/src/server/routes/webhooks/revoke.ts b/src/server/routes/webhooks/revoke.ts index e3b220442..d6725c6ba 100644 --- a/src/server/routes/webhooks/revoke.ts +++ b/src/server/routes/webhooks/revoke.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getWebhook } from "../../../shared/db/webhooks/getWebhook"; -import { deleteWebhook } from "../../../shared/db/webhooks/revokeWebhook"; +import { getWebhook } from "../../../db/webhooks/getWebhook"; +import { deleteWebhook } from "../../../db/webhooks/revokeWebhook"; import { createCustomError } from "../../middleware/error"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/server/routes/webhooks/test.ts b/src/server/routes/webhooks/test.ts index c70bbb5de..68bc341c6 100644 --- a/src/server/routes/webhooks/test.ts +++ b/src/server/routes/webhooks/test.ts @@ -1,8 +1,8 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import { getWebhook } from "../../../shared/db/webhooks/getWebhook"; -import { sendWebhookRequest } from "../../../shared/utils/webhook"; +import { getWebhook } from "../../../db/webhooks/getWebhook"; +import { sendWebhookRequest } from "../../../utils/webhook"; import { createCustomError } from "../../middleware/error"; import { NumberStringSchema } from "../../schemas/number"; import { standardResponseSchema } from "../../schemas/sharedApiSchemas"; diff --git a/src/shared/schemas/auth.ts b/src/server/schemas/auth/index.ts similarity index 100% rename from src/shared/schemas/auth.ts rename to src/server/schemas/auth/index.ts diff --git a/src/shared/schemas/keypair.ts b/src/server/schemas/keypairs.ts similarity index 93% rename from src/shared/schemas/keypair.ts rename to src/server/schemas/keypairs.ts index 5e0a85bc3..31a3a7bc7 100644 --- a/src/shared/schemas/keypair.ts +++ b/src/server/schemas/keypairs.ts @@ -1,5 +1,5 @@ -import type { Keypairs } from "@prisma/client"; -import { type Static, Type } from "@sinclair/typebox"; +import { Keypairs } from "@prisma/client"; +import { Static, Type } from "@sinclair/typebox"; // https://github.com/auth0/node-jsonwebtoken#algorithms-supported const _supportedAlgorithms = [ diff --git a/src/server/schemas/transaction/index.ts b/src/server/schemas/transaction/index.ts index c2ddb8825..c9dd5500c 100644 --- a/src/server/schemas/transaction/index.ts +++ b/src/server/schemas/transaction/index.ts @@ -1,7 +1,7 @@ import { Type, type Static } from "@sinclair/typebox"; import type { Hex } from "thirdweb"; import { stringify } from "thirdweb/utils"; -import type { AnyTransaction } from "../../../shared/utils/transaction/types"; +import type { AnyTransaction } from "../../../utils/transaction/types"; import { AddressSchema, TransactionHashSchema } from "../address"; export const TransactionSchema = Type.Object({ diff --git a/src/server/schemas/wallet/index.ts b/src/server/schemas/wallet/index.ts index 3f4d940f4..c4119fa61 100644 --- a/src/server/schemas/wallet/index.ts +++ b/src/server/schemas/wallet/index.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { getAddress, type Address } from "thirdweb"; -import { env } from "../../../shared/utils/env"; +import { env } from "../../../utils/env"; import { badAddressError } from "../../middleware/error"; import { AddressSchema } from "../address"; import { chainIdOrSlugSchema } from "../chain"; diff --git a/src/server/utils/chain.ts b/src/server/utils/chain.ts index b0e5c7d7b..5ea5741d6 100644 --- a/src/server/utils/chain.ts +++ b/src/server/utils/chain.ts @@ -1,5 +1,5 @@ import { getChainBySlugAsync } from "@thirdweb-dev/chains"; -import { getChain } from "../../shared/utils/chain"; +import { getChain } from "../../utils/chain"; import { badChainError } from "../middleware/error"; /** diff --git a/src/server/utils/storage/localStorage.ts b/src/server/utils/storage/localStorage.ts index 95665f675..8c5557faa 100644 --- a/src/server/utils/storage/localStorage.ts +++ b/src/server/utils/storage/localStorage.ts @@ -1,8 +1,8 @@ import type { AsyncStorage } from "@thirdweb-dev/wallets"; import fs from "node:fs"; -import { prisma } from "../../../shared/db/client"; -import { WalletType } from "../../../shared/schemas/wallet"; -import { logger } from "../../../shared/utils/logger"; +import { prisma } from "../../../db/client"; +import { WalletType } from "../../../schema/wallet"; +import { logger } from "../../../utils/logger"; /** * @deprecated @@ -38,7 +38,7 @@ export class LocalFileStorage implements AsyncStorage { logger({ service: "server", level: "error", - message: "No local wallet found!", + message: `No local wallet found!`, }); return null; } diff --git a/src/server/utils/transactionOverrides.ts b/src/server/utils/transactionOverrides.ts index 83f728024..a048504ed 100644 --- a/src/server/utils/transactionOverrides.ts +++ b/src/server/utils/transactionOverrides.ts @@ -1,6 +1,6 @@ import type { Static } from "@sinclair/typebox"; -import { maybeBigInt } from "../../shared/utils/primitiveTypes"; -import type { InsertedTransaction } from "../../shared/utils/transaction/types"; +import { maybeBigInt } from "../../utils/primitiveTypes"; +import type { InsertedTransaction } from "../../utils/transaction/types"; import type { txOverridesSchema, txOverridesWithValueSchema, diff --git a/src/server/utils/wallets/createGcpKmsWallet.ts b/src/server/utils/wallets/createGcpKmsWallet.ts index bf4a249a2..2b4b47201 100644 --- a/src/server/utils/wallets/createGcpKmsWallet.ts +++ b/src/server/utils/wallets/createGcpKmsWallet.ts @@ -1,7 +1,7 @@ import { KeyManagementServiceClient } from "@google-cloud/kms"; -import { createWalletDetails } from "../../../shared/db/wallets/createWalletDetails"; -import { WalletType } from "../../../shared/schemas/wallet"; -import { thirdwebClient } from "../../../shared/utils/sdk"; +import { createWalletDetails } from "../../../db/wallets/createWalletDetails"; +import { WalletType } from "../../../schema/wallet"; +import { thirdwebClient } from "../../../utils/sdk"; import { FetchGcpKmsWalletParamsError, fetchGcpKmsWalletParams, diff --git a/src/server/utils/wallets/createLocalWallet.ts b/src/server/utils/wallets/createLocalWallet.ts index c8b187171..03392c1a6 100644 --- a/src/server/utils/wallets/createLocalWallet.ts +++ b/src/server/utils/wallets/createLocalWallet.ts @@ -1,9 +1,9 @@ import { encryptKeystore } from "@ethersproject/json-wallets"; import { privateKeyToAccount } from "thirdweb/wallets"; import { generatePrivateKey } from "viem/accounts"; -import { createWalletDetails } from "../../../shared/db/wallets/createWalletDetails"; -import { env } from "../../../shared/utils/env"; -import { thirdwebClient } from "../../../shared/utils/sdk"; +import { createWalletDetails } from "../../../db/wallets/createWalletDetails"; +import { env } from "../../../utils/env"; +import { thirdwebClient } from "../../../utils/sdk"; interface CreateLocalWallet { label?: string; diff --git a/src/server/utils/wallets/createSmartWallet.ts b/src/server/utils/wallets/createSmartWallet.ts index 263c60f03..5859a430a 100644 --- a/src/server/utils/wallets/createSmartWallet.ts +++ b/src/server/utils/wallets/createSmartWallet.ts @@ -1,8 +1,8 @@ import { defineChain, type Address, type Chain } from "thirdweb"; import { smartWallet, type Account } from "thirdweb/wallets"; -import { createWalletDetails } from "../../../shared/db/wallets/createWalletDetails"; -import { WalletType } from "../../../shared/schemas/wallet"; -import { thirdwebClient } from "../../../shared/utils/sdk"; +import { createWalletDetails } from "../../../db/wallets/createWalletDetails"; +import { WalletType } from "../../../schema/wallet"; +import { thirdwebClient } from "../../../utils/sdk"; import { splitAwsKmsArn } from "./awsKmsArn"; import { createAwsKmsKey, diff --git a/src/server/utils/wallets/fetchAwsKmsWalletParams.ts b/src/server/utils/wallets/fetchAwsKmsWalletParams.ts index eea36e9ca..f94cd0f1f 100644 --- a/src/server/utils/wallets/fetchAwsKmsWalletParams.ts +++ b/src/server/utils/wallets/fetchAwsKmsWalletParams.ts @@ -1,4 +1,4 @@ -import { getConfig } from "../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../utils/cache/getConfig"; export type AwsKmsWalletParams = { awsAccessKeyId: string; diff --git a/src/server/utils/wallets/fetchGcpKmsWalletParams.ts b/src/server/utils/wallets/fetchGcpKmsWalletParams.ts index a5f6de90b..b0c468ebc 100644 --- a/src/server/utils/wallets/fetchGcpKmsWalletParams.ts +++ b/src/server/utils/wallets/fetchGcpKmsWalletParams.ts @@ -1,4 +1,4 @@ -import { getConfig } from "../../../shared/utils/cache/getConfig"; +import { getConfig } from "../../../utils/cache/getConfig"; export type GcpKmsWalletParams = { gcpApplicationCredentialEmail: string; diff --git a/src/server/utils/wallets/getAwsKmsAccount.ts b/src/server/utils/wallets/getAwsKmsAccount.ts index 33d828ec7..91e99104d 100644 --- a/src/server/utils/wallets/getAwsKmsAccount.ts +++ b/src/server/utils/wallets/getAwsKmsAccount.ts @@ -17,7 +17,7 @@ import type { TypedDataDefinition, } from "viem"; import { hashTypedData } from "viem"; -import { getChain } from "../../../shared/utils/chain"; +import { getChain } from "../../../utils/chain"; type SendTransactionResult = { transactionHash: Hex; diff --git a/src/server/utils/wallets/getGcpKmsAccount.ts b/src/server/utils/wallets/getGcpKmsAccount.ts index cf02625a7..b73135331 100644 --- a/src/server/utils/wallets/getGcpKmsAccount.ts +++ b/src/server/utils/wallets/getGcpKmsAccount.ts @@ -17,7 +17,7 @@ import type { TypedDataDefinition, } from "viem"; import { hashTypedData } from "viem"; -import { getChain } from "../../../shared/utils/chain"; // Adjust import path as needed +import { getChain } from "../../../utils/chain"; // Adjust import path as needed type SendTransactionResult = { transactionHash: Hex; diff --git a/src/server/utils/wallets/getLocalWallet.ts b/src/server/utils/wallets/getLocalWallet.ts index dd078f4e4..0f4456423 100644 --- a/src/server/utils/wallets/getLocalWallet.ts +++ b/src/server/utils/wallets/getLocalWallet.ts @@ -3,11 +3,11 @@ import { Wallet } from "ethers"; import type { Address } from "thirdweb"; import { getChainMetadata } from "thirdweb/chains"; import { privateKeyToAccount, type Account } from "thirdweb/wallets"; -import { getWalletDetails } from "../../../shared/db/wallets/getWalletDetails"; -import { getChain } from "../../../shared/utils/chain"; -import { env } from "../../../shared/utils/env"; -import { logger } from "../../../shared/utils/logger"; -import { thirdwebClient } from "../../../shared/utils/sdk"; +import { getWalletDetails } from "../../../db/wallets/getWalletDetails"; +import { getChain } from "../../../utils/chain"; +import { env } from "../../../utils/env"; +import { logger } from "../../../utils/logger"; +import { thirdwebClient } from "../../../utils/sdk"; import { badChainError } from "../../middleware/error"; import { LocalFileStorage } from "../storage/localStorage"; diff --git a/src/server/utils/wallets/getSmartWallet.ts b/src/server/utils/wallets/getSmartWallet.ts index 67db9f1d1..59ab4d885 100644 --- a/src/server/utils/wallets/getSmartWallet.ts +++ b/src/server/utils/wallets/getSmartWallet.ts @@ -1,7 +1,7 @@ import { SmartWallet, type EVMWallet } from "@thirdweb-dev/wallets"; -import { getContract } from "../../../shared/utils/cache/getContract"; -import { env } from "../../../shared/utils/env"; -import { redis } from "../../../shared/utils/redis/redis"; +import { getContract } from "../../../utils/cache/getContract"; +import { env } from "../../../utils/env"; +import { redis } from "../../../utils/redis/redis"; interface GetSmartWalletParams { chainId: number; diff --git a/src/server/utils/wallets/importAwsKmsWallet.ts b/src/server/utils/wallets/importAwsKmsWallet.ts index 82d3969b4..159db1a69 100644 --- a/src/server/utils/wallets/importAwsKmsWallet.ts +++ b/src/server/utils/wallets/importAwsKmsWallet.ts @@ -1,6 +1,6 @@ -import { createWalletDetails } from "../../../shared/db/wallets/createWalletDetails"; -import { WalletType } from "../../../shared/schemas/wallet"; -import { thirdwebClient } from "../../../shared/utils/sdk"; +import { createWalletDetails } from "../../../db/wallets/createWalletDetails"; +import { WalletType } from "../../../schema/wallet"; +import { thirdwebClient } from "../../../utils/sdk"; import { splitAwsKmsArn } from "./awsKmsArn"; import { getAwsKmsAccount } from "./getAwsKmsAccount"; diff --git a/src/server/utils/wallets/importGcpKmsWallet.ts b/src/server/utils/wallets/importGcpKmsWallet.ts index d34d1f865..5ac149b55 100644 --- a/src/server/utils/wallets/importGcpKmsWallet.ts +++ b/src/server/utils/wallets/importGcpKmsWallet.ts @@ -1,6 +1,6 @@ -import { createWalletDetails } from "../../../shared/db/wallets/createWalletDetails"; -import { WalletType } from "../../../shared/schemas/wallet"; -import { thirdwebClient } from "../../../shared/utils/sdk"; +import { createWalletDetails } from "../../../db/wallets/createWalletDetails"; +import { WalletType } from "../../../schema/wallet"; +import { thirdwebClient } from "../../../utils/sdk"; import { getGcpKmsAccount } from "./getGcpKmsAccount"; interface ImportGcpKmsWalletParams { diff --git a/src/server/utils/wallets/importLocalWallet.ts b/src/server/utils/wallets/importLocalWallet.ts index a917c484f..3ad1c7a6e 100644 --- a/src/server/utils/wallets/importLocalWallet.ts +++ b/src/server/utils/wallets/importLocalWallet.ts @@ -1,5 +1,5 @@ import { LocalWallet } from "@thirdweb-dev/wallets"; -import { env } from "../../../shared/utils/env"; +import { env } from "../../../utils/env"; import { LocalFileStorage } from "../storage/localStorage"; type ImportLocalWalletParams = diff --git a/src/server/utils/websocket.ts b/src/server/utils/websocket.ts index b18f1dd13..4e68a198d 100644 --- a/src/server/utils/websocket.ts +++ b/src/server/utils/websocket.ts @@ -1,9 +1,9 @@ -import type { SocketStream } from "@fastify/websocket"; -import type { Static } from "@sinclair/typebox"; -import type { FastifyRequest } from "fastify"; -import { logger } from "../../shared/utils/logger"; -import type { TransactionSchema } from "../schemas/transaction"; -import { type UserSubscription, subscriptionsData } from "../schemas/websocket"; +import { SocketStream } from "@fastify/websocket"; +import { Static } from "@sinclair/typebox"; +import { FastifyRequest } from "fastify"; +import { logger } from "../../utils/logger"; +import { TransactionSchema } from "../schemas/transaction"; +import { UserSubscription, subscriptionsData } from "../schemas/websocket"; // websocket timeout, i.e., ws connection closed after 10 seconds const timeoutDuration = 10 * 60 * 1000; diff --git a/tests/unit/auth.test.ts b/src/tests/auth.test.ts similarity index 96% rename from tests/unit/auth.test.ts rename to src/tests/auth.test.ts index 7ea7ab5f2..8e6e774e9 100644 --- a/tests/unit/auth.test.ts +++ b/src/tests/auth.test.ts @@ -1,22 +1,19 @@ import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { LocalWallet } from "@thirdweb-dev/wallets"; -import type { FastifyRequest } from "fastify/types/request"; +import { FastifyRequest } from "fastify/types/request"; import jsonwebtoken from "jsonwebtoken"; -import { getPermissions } from "../../src/shared/db/permissions/getPermissions"; -import { WebhooksEventTypes } from "../../src/shared/schemas/webhooks"; -import { onRequest } from "../../src/server/middleware/auth"; -import { - THIRDWEB_DASHBOARD_ISSUER, - handleSiwe, -} from "../../src/shared/utils/auth"; -import { getAccessToken } from "../../src/shared/utils/cache/accessToken"; -import { getAuthWallet } from "../../src/shared/utils/cache/authWallet"; -import { getConfig } from "../../src/shared/utils/cache/getConfig"; -import { getWebhooksByEventType } from "../../src/shared/utils/cache/getWebhook"; -import { getKeypair } from "../../src/shared/utils/cache/keypair"; -import { sendWebhookRequest } from "../../src/shared/utils/webhook"; -import { Permission } from "../../src/shared/schemas"; +import { getPermissions } from "../db/permissions/getPermissions"; +import { WebhooksEventTypes } from "../schema/webhooks"; +import { onRequest } from "../server/middleware/auth"; +import { Permission } from "../server/schemas/auth"; +import { THIRDWEB_DASHBOARD_ISSUER, handleSiwe } from "../utils/auth"; +import { getAccessToken } from "../utils/cache/accessToken"; +import { getAuthWallet } from "../utils/cache/authWallet"; +import { getConfig } from "../utils/cache/getConfig"; +import { getWebhooksByEventType } from "../utils/cache/getWebhook"; +import { getKeypair } from "../utils/cache/keypair"; +import { sendWebhookRequest } from "../utils/webhook"; vi.mock("../utils/cache/accessToken"); const mockGetAccessToken = vi.mocked(getAccessToken); diff --git a/tests/unit/aws-arn.test.ts b/src/tests/aws-arn.test.ts similarity index 97% rename from tests/unit/aws-arn.test.ts rename to src/tests/aws-arn.test.ts index 8b46025f3..cc885a4a9 100644 --- a/tests/unit/aws-arn.test.ts +++ b/src/tests/aws-arn.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest"; import { getAwsKmsArn, splitAwsKmsArn, -} from "../../src/server/utils/wallets/awsKmsArn"; +} from "../server/utils/wallets/awsKmsArn"; describe("splitAwsKmsArn", () => { it("should correctly split a valid AWS KMS ARN", () => { diff --git a/tests/unit/chain.test.ts b/src/tests/chain.test.ts similarity index 96% rename from tests/unit/chain.test.ts rename to src/tests/chain.test.ts index dff36db94..4a3684a6c 100644 --- a/tests/unit/chain.test.ts +++ b/src/tests/chain.test.ts @@ -3,8 +3,8 @@ import { getChainBySlugAsync, } from "@thirdweb-dev/chains"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { getChainIdFromChain } from "../../src/server/utils/chain"; -import { getConfig } from "../../src/shared/utils/cache/getConfig"; +import { getChainIdFromChain } from "../server/utils/chain"; +import { getConfig } from "../utils/cache/getConfig"; // Mock the external dependencies vi.mock("../utils/cache/getConfig"); diff --git a/tests/shared/aws-kms.ts b/src/tests/config/aws-kms.ts similarity index 100% rename from tests/shared/aws-kms.ts rename to src/tests/config/aws-kms.ts diff --git a/tests/shared/gcp-kms.ts b/src/tests/config/gcp-kms.ts similarity index 100% rename from tests/shared/gcp-kms.ts rename to src/tests/config/gcp-kms.ts diff --git a/tests/unit/gcp-resource-path.test.ts b/src/tests/gcp-resource-path.test.ts similarity index 97% rename from tests/unit/gcp-resource-path.test.ts rename to src/tests/gcp-resource-path.test.ts index 52a497d2a..ae6da618f 100644 --- a/tests/unit/gcp-resource-path.test.ts +++ b/src/tests/gcp-resource-path.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest"; import { getGcpKmsResourcePath, splitGcpKmsResourcePath, -} from "../../src/server/utils/wallets/gcpKmsResourcePath"; +} from "../server/utils/wallets/gcpKmsResourcePath"; describe("splitGcpKmsResourcePath", () => { it("should correctly split a valid GCP KMS resource path", () => { diff --git a/tests/unit/math.test.ts b/src/tests/math.test.ts similarity index 93% rename from tests/unit/math.test.ts rename to src/tests/math.test.ts index 725084dd1..6303d6bed 100644 --- a/tests/unit/math.test.ts +++ b/src/tests/math.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { getPercentile } from "../../src/shared/utils/math"; +import { getPercentile } from "../utils/math"; describe("getPercentile", () => { it("should correctly calculate the p50 (median) of a sorted array", () => { diff --git a/tests/unit/schema.test.ts b/src/tests/schema.test.ts similarity index 97% rename from tests/unit/schema.test.ts rename to src/tests/schema.test.ts index c1de80d36..17f4b167a 100644 --- a/tests/unit/schema.test.ts +++ b/src/tests/schema.test.ts @@ -4,8 +4,8 @@ import { AddressSchema, HexSchema, TransactionHashSchema, -} from "../../src/server/schemas/address"; -import { chainIdOrSlugSchema } from "../../src/server/schemas/chain"; +} from "../server/schemas/address"; +import { chainIdOrSlugSchema } from "../server/schemas/chain"; // Test cases describe("chainIdOrSlugSchema", () => { diff --git a/tests/shared/chain.ts b/src/tests/shared/chain.ts similarity index 100% rename from tests/shared/chain.ts rename to src/tests/shared/chain.ts diff --git a/tests/shared/client.ts b/src/tests/shared/client.ts similarity index 100% rename from tests/shared/client.ts rename to src/tests/shared/client.ts diff --git a/tests/shared/typed-data.ts b/src/tests/shared/typed-data.ts similarity index 100% rename from tests/shared/typed-data.ts rename to src/tests/shared/typed-data.ts diff --git a/tests/unit/swr.test.ts b/src/tests/swr.test.ts similarity index 98% rename from tests/unit/swr.test.ts rename to src/tests/swr.test.ts index 33fb485ef..ce709ddf3 100644 --- a/tests/unit/swr.test.ts +++ b/src/tests/swr.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; -import { createSWRCache, type SWRCache } from "../../src/shared/lib/cache/swr"; +import { createSWRCache, type SWRCache } from "../lib/cache/swr"; describe("SWRCache", () => { let cache: SWRCache; diff --git a/tests/unit/validator.test.ts b/src/tests/validator.test.ts similarity index 94% rename from tests/unit/validator.test.ts rename to src/tests/validator.test.ts index f15612258..31304c01d 100644 --- a/tests/unit/validator.test.ts +++ b/src/tests/validator.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { isValidWebhookUrl } from "../../src/server/utils/validator"; +import { isValidWebhookUrl } from "../server/utils/validator"; describe("isValidWebhookUrl", () => { it("should return true for a valid HTTPS URL", () => { diff --git a/tests/unit/aws-kms.test.ts b/src/tests/wallets/aws-kms.test.ts similarity index 95% rename from tests/unit/aws-kms.test.ts rename to src/tests/wallets/aws-kms.test.ts index b02c4e28a..4d0b7a129 100644 --- a/tests/unit/aws-kms.test.ts +++ b/src/tests/wallets/aws-kms.test.ts @@ -1,7 +1,11 @@ import { beforeAll, expect, test, vi } from "vitest"; import { ANVIL_CHAIN, anvilTestClient } from "../shared/chain.ts"; + +import { TEST_AWS_KMS_CONFIG } from "../config/aws-kms.ts"; + import { typedData } from "../shared/typed-data.ts"; + import { verifyTypedData } from "thirdweb"; import { verifyEOASignature } from "thirdweb/auth"; import { @@ -10,9 +14,8 @@ import { } from "thirdweb/transaction"; import { toUnits, toWei } from "thirdweb/utils"; import { getWalletBalance } from "thirdweb/wallets"; +import { getAwsKmsAccount } from "../../server/utils/wallets/getAwsKmsAccount.js"; import { TEST_CLIENT } from "../shared/client.ts"; -import { getAwsKmsAccount } from "../../src/server/utils/wallets/getAwsKmsAccount"; -import { TEST_AWS_KMS_CONFIG } from "../shared/aws-kms.ts"; let account: Awaited>; diff --git a/tests/unit/gcp-kms.test.ts b/src/tests/wallets/gcp-kms.test.ts similarity index 94% rename from tests/unit/gcp-kms.test.ts rename to src/tests/wallets/gcp-kms.test.ts index 1f2d183cc..afc4feffb 100644 --- a/tests/unit/gcp-kms.test.ts +++ b/src/tests/wallets/gcp-kms.test.ts @@ -1,7 +1,9 @@ import { beforeAll, expect, test, vi } from "vitest"; import { ANVIL_CHAIN, anvilTestClient } from "../shared/chain.ts"; + import { typedData } from "../shared/typed-data.ts"; + import { verifyTypedData } from "thirdweb"; import { verifyEOASignature } from "thirdweb/auth"; import { @@ -10,9 +12,9 @@ import { } from "thirdweb/transaction"; import { toUnits, toWei } from "thirdweb/utils"; import { getWalletBalance } from "thirdweb/wallets"; -import { getGcpKmsAccount } from "../../src/server/utils/wallets/getGcpKmsAccount"; -import { TEST_GCP_KMS_CONFIG } from "../shared/gcp-kms"; -import { TEST_CLIENT } from "../shared/client"; +import { getGcpKmsAccount } from "../../server/utils/wallets/getGcpKmsAccount.ts"; +import { TEST_GCP_KMS_CONFIG } from "../config/gcp-kms.ts"; +import { TEST_CLIENT } from "../shared/client.ts"; let account: Awaited>; diff --git a/src/shared/utils/account.ts b/src/utils/account.ts similarity index 93% rename from src/shared/utils/account.ts rename to src/utils/account.ts index ef3d83e68..0c8373f7d 100644 --- a/src/shared/utils/account.ts +++ b/src/utils/account.ts @@ -6,15 +6,15 @@ import { isSmartBackendWallet, type ParsedWalletDetails, } from "../db/wallets/getWalletDetails"; -import { WalletType } from "../schemas/wallet"; -import { splitAwsKmsArn } from "../../server/utils/wallets/awsKmsArn"; -import { getConnectedSmartWallet } from "../../server/utils/wallets/createSmartWallet"; -import { getAwsKmsAccount } from "../../server/utils/wallets/getAwsKmsAccount"; -import { getGcpKmsAccount } from "../../server/utils/wallets/getGcpKmsAccount"; +import { WalletType } from "../schema/wallet"; +import { splitAwsKmsArn } from "../server/utils/wallets/awsKmsArn"; +import { getConnectedSmartWallet } from "../server/utils/wallets/createSmartWallet"; +import { getAwsKmsAccount } from "../server/utils/wallets/getAwsKmsAccount"; +import { getGcpKmsAccount } from "../server/utils/wallets/getGcpKmsAccount"; import { encryptedJsonToAccount, getLocalWalletAccount, -} from "../../server/utils/wallets/getLocalWallet"; +} from "../server/utils/wallets/getLocalWallet"; import { getSmartWalletV5 } from "./cache/getSmartWalletV5"; import { getChain } from "./chain"; import { thirdwebClient } from "./sdk"; diff --git a/src/shared/utils/auth.ts b/src/utils/auth.ts similarity index 100% rename from src/shared/utils/auth.ts rename to src/utils/auth.ts diff --git a/src/shared/utils/block.ts b/src/utils/block.ts similarity index 100% rename from src/shared/utils/block.ts rename to src/utils/block.ts diff --git a/src/shared/utils/cache/accessToken.ts b/src/utils/cache/accessToken.ts similarity index 100% rename from src/shared/utils/cache/accessToken.ts rename to src/utils/cache/accessToken.ts diff --git a/src/shared/utils/cache/authWallet.ts b/src/utils/cache/authWallet.ts similarity index 100% rename from src/shared/utils/cache/authWallet.ts rename to src/utils/cache/authWallet.ts diff --git a/src/shared/utils/cache/clearCache.ts b/src/utils/cache/clearCache.ts similarity index 100% rename from src/shared/utils/cache/clearCache.ts rename to src/utils/cache/clearCache.ts diff --git a/src/shared/utils/cache/getConfig.ts b/src/utils/cache/getConfig.ts similarity index 86% rename from src/shared/utils/cache/getConfig.ts rename to src/utils/cache/getConfig.ts index f18937576..59b9850e9 100644 --- a/src/shared/utils/cache/getConfig.ts +++ b/src/utils/cache/getConfig.ts @@ -1,5 +1,5 @@ import { getConfiguration } from "../../db/configuration/getConfiguration"; -import type { ParsedConfig } from "../../schemas/config"; +import type { ParsedConfig } from "../../schema/config"; let _config: ParsedConfig | null = null; diff --git a/src/shared/utils/cache/getContract.ts b/src/utils/cache/getContract.ts similarity index 82% rename from src/shared/utils/cache/getContract.ts rename to src/utils/cache/getContract.ts index b9b4dcb51..4ace9a679 100644 --- a/src/shared/utils/cache/getContract.ts +++ b/src/utils/cache/getContract.ts @@ -1,7 +1,7 @@ -import { type Static, Type } from "@sinclair/typebox"; +import { Static, Type } from "@sinclair/typebox"; import { StatusCodes } from "http-status-codes"; -import { createCustomError } from "../../../server/middleware/error"; -import { abiSchema } from "../../../server/schemas/contract"; +import { createCustomError } from "../../server/middleware/error"; +import { abiSchema } from "../../server/schemas/contract"; import { getSdk } from "./getSdk"; const abiArraySchema = Type.Array(abiSchema); diff --git a/src/shared/utils/cache/getContractv5.ts b/src/utils/cache/getContractv5.ts similarity index 100% rename from src/shared/utils/cache/getContractv5.ts rename to src/utils/cache/getContractv5.ts diff --git a/src/shared/utils/cache/getSdk.ts b/src/utils/cache/getSdk.ts similarity index 97% rename from src/shared/utils/cache/getSdk.ts rename to src/utils/cache/getSdk.ts index f15781715..42c754610 100644 --- a/src/shared/utils/cache/getSdk.ts +++ b/src/utils/cache/getSdk.ts @@ -2,7 +2,7 @@ import { Type } from "@sinclair/typebox"; import { ThirdwebSDK } from "@thirdweb-dev/sdk"; import LRUMap from "mnemonist/lru-map"; import { getChainMetadata } from "thirdweb/chains"; -import { badChainError } from "../../../server/middleware/error"; +import { badChainError } from "../../server/middleware/error"; import { getChain } from "../chain"; import { env } from "../env"; import { getWallet } from "./getWallet"; diff --git a/src/shared/utils/cache/getSmartWalletV5.ts b/src/utils/cache/getSmartWalletV5.ts similarity index 100% rename from src/shared/utils/cache/getSmartWalletV5.ts rename to src/utils/cache/getSmartWalletV5.ts diff --git a/src/shared/utils/cache/getWallet.ts b/src/utils/cache/getWallet.ts similarity index 91% rename from src/shared/utils/cache/getWallet.ts rename to src/utils/cache/getWallet.ts index 520cf924f..6b078594b 100644 --- a/src/shared/utils/cache/getWallet.ts +++ b/src/utils/cache/getWallet.ts @@ -7,13 +7,13 @@ import { getWalletDetails, type ParsedWalletDetails, } from "../../db/wallets/getWalletDetails"; -import type { PrismaTransaction } from "../../schemas/prisma"; -import { WalletType } from "../../schemas/wallet"; -import { createCustomError } from "../../../server/middleware/error"; -import { splitAwsKmsArn } from "../../../server/utils/wallets/awsKmsArn"; -import { splitGcpKmsResourcePath } from "../../../server/utils/wallets/gcpKmsResourcePath"; -import { getLocalWallet } from "../../../server/utils/wallets/getLocalWallet"; -import { getSmartWallet } from "../../../server/utils/wallets/getSmartWallet"; +import type { PrismaTransaction } from "../../schema/prisma"; +import { WalletType } from "../../schema/wallet"; +import { createCustomError } from "../../server/middleware/error"; +import { splitAwsKmsArn } from "../../server/utils/wallets/awsKmsArn"; +import { splitGcpKmsResourcePath } from "../../server/utils/wallets/gcpKmsResourcePath"; +import { getLocalWallet } from "../../server/utils/wallets/getLocalWallet"; +import { getSmartWallet } from "../../server/utils/wallets/getSmartWallet"; export const walletsCache = new LRUMap(2048); diff --git a/src/shared/utils/cache/getWebhook.ts b/src/utils/cache/getWebhook.ts similarity index 91% rename from src/shared/utils/cache/getWebhook.ts rename to src/utils/cache/getWebhook.ts index 1ed9df187..ded5543df 100644 --- a/src/shared/utils/cache/getWebhook.ts +++ b/src/utils/cache/getWebhook.ts @@ -1,7 +1,7 @@ import type { Webhooks } from "@prisma/client"; import LRUMap from "mnemonist/lru-map"; import { getAllWebhooks } from "../../db/webhooks/getAllWebhooks"; -import type { WebhooksEventTypes } from "../../schemas/webhooks"; +import type { WebhooksEventTypes } from "../../schema/webhooks"; export const webhookCache = new LRUMap(2048); diff --git a/src/shared/utils/cache/keypair.ts b/src/utils/cache/keypair.ts similarity index 100% rename from src/shared/utils/cache/keypair.ts rename to src/utils/cache/keypair.ts diff --git a/src/shared/utils/chain.ts b/src/utils/chain.ts similarity index 100% rename from src/shared/utils/chain.ts rename to src/utils/chain.ts diff --git a/src/shared/utils/cron/clearCacheCron.ts b/src/utils/cron/clearCacheCron.ts similarity index 100% rename from src/shared/utils/cron/clearCacheCron.ts rename to src/utils/cron/clearCacheCron.ts diff --git a/src/shared/utils/cron/isValidCron.ts b/src/utils/cron/isValidCron.ts similarity index 96% rename from src/shared/utils/cron/isValidCron.ts rename to src/utils/cron/isValidCron.ts index abfdc5715..f0ea16ccf 100644 --- a/src/shared/utils/cron/isValidCron.ts +++ b/src/utils/cron/isValidCron.ts @@ -1,6 +1,6 @@ import cronParser from "cron-parser"; import { StatusCodes } from "http-status-codes"; -import { createCustomError } from "../../../server/middleware/error"; +import { createCustomError } from "../../server/middleware/error"; export const isValidCron = (input: string): boolean => { try { diff --git a/src/shared/utils/crypto.ts b/src/utils/crypto.ts similarity index 100% rename from src/shared/utils/crypto.ts rename to src/utils/crypto.ts diff --git a/src/shared/utils/date.ts b/src/utils/date.ts similarity index 100% rename from src/shared/utils/date.ts rename to src/utils/date.ts diff --git a/src/shared/utils/env.ts b/src/utils/env.ts similarity index 100% rename from src/shared/utils/env.ts rename to src/utils/env.ts diff --git a/src/shared/utils/error.ts b/src/utils/error.ts similarity index 100% rename from src/shared/utils/error.ts rename to src/utils/error.ts diff --git a/src/shared/utils/ethers.ts b/src/utils/ethers.ts similarity index 100% rename from src/shared/utils/ethers.ts rename to src/utils/ethers.ts diff --git a/src/shared/utils/indexer/getBlockTime.ts b/src/utils/indexer/getBlockTime.ts similarity index 100% rename from src/shared/utils/indexer/getBlockTime.ts rename to src/utils/indexer/getBlockTime.ts diff --git a/src/shared/utils/logger.ts b/src/utils/logger.ts similarity index 100% rename from src/shared/utils/logger.ts rename to src/utils/logger.ts diff --git a/src/shared/utils/math.ts b/src/utils/math.ts similarity index 100% rename from src/shared/utils/math.ts rename to src/utils/math.ts diff --git a/src/shared/utils/primitiveTypes.ts b/src/utils/primitiveTypes.ts similarity index 100% rename from src/shared/utils/primitiveTypes.ts rename to src/utils/primitiveTypes.ts diff --git a/src/shared/utils/prometheus.ts b/src/utils/prometheus.ts similarity index 98% rename from src/shared/utils/prometheus.ts rename to src/utils/prometheus.ts index dbada9ad4..abfb9b8e0 100644 --- a/src/shared/utils/prometheus.ts +++ b/src/utils/prometheus.ts @@ -1,7 +1,7 @@ import fastify from "fastify"; import { Counter, Gauge, Histogram, Registry } from "prom-client"; import { getUsedBackendWallets, inspectNonce } from "../db/wallets/walletNonce"; -import { getLastUsedOnchainNonce } from "../../server/routes/admin/nonces"; +import { getLastUsedOnchainNonce } from "../server/routes/admin/nonces"; const nonceMetrics = new Gauge({ name: "engine_nonces", diff --git a/src/shared/utils/redis/lock.ts b/src/utils/redis/lock.ts similarity index 100% rename from src/shared/utils/redis/lock.ts rename to src/utils/redis/lock.ts diff --git a/src/shared/utils/redis/redis.ts b/src/utils/redis/redis.ts similarity index 100% rename from src/shared/utils/redis/redis.ts rename to src/utils/redis/redis.ts diff --git a/src/shared/utils/sdk.ts b/src/utils/sdk.ts similarity index 100% rename from src/shared/utils/sdk.ts rename to src/utils/sdk.ts diff --git a/src/tracer.ts b/src/utils/tracer.ts similarity index 79% rename from src/tracer.ts rename to src/utils/tracer.ts index 4aae137e3..c07e15c1a 100644 --- a/src/tracer.ts +++ b/src/utils/tracer.ts @@ -1,5 +1,5 @@ import tracer from "dd-trace"; -import { env } from "./shared/utils/env"; +import { env } from "./env"; if (env.DD_TRACER_ACTIVATED) { tracer.init(); // initialized in a different file to avoid hoisting. diff --git a/src/shared/utils/transaction/cancelTransaction.ts b/src/utils/transaction/cancelTransaction.ts similarity index 100% rename from src/shared/utils/transaction/cancelTransaction.ts rename to src/utils/transaction/cancelTransaction.ts diff --git a/src/shared/utils/transaction/insertTransaction.ts b/src/utils/transaction/insertTransaction.ts similarity index 95% rename from src/shared/utils/transaction/insertTransaction.ts rename to src/utils/transaction/insertTransaction.ts index 5d4f33da4..fe79018fb 100644 --- a/src/shared/utils/transaction/insertTransaction.ts +++ b/src/utils/transaction/insertTransaction.ts @@ -1,14 +1,14 @@ import { StatusCodes } from "http-status-codes"; import { randomUUID } from "node:crypto"; -import { TransactionDB } from "../../../shared/db/transactions/db"; +import { TransactionDB } from "../../db/transactions/db"; import { getWalletDetails, isSmartBackendWallet, type ParsedWalletDetails, -} from "../../../shared/db/wallets/getWalletDetails"; +} from "../../db/wallets/getWalletDetails"; import { doesChainSupportService } from "../../lib/chain/chain-capabilities"; -import { createCustomError } from "../../../server/middleware/error"; -import { SendTransactionQueue } from "../../../worker/queues/sendTransactionQueue"; +import { createCustomError } from "../../server/middleware/error"; +import { SendTransactionQueue } from "../../worker/queues/sendTransactionQueue"; import { getChecksumAddress } from "../primitiveTypes"; import { recordMetrics } from "../prometheus"; import { reportUsage } from "../usage"; diff --git a/src/shared/utils/transaction/queueTransation.ts b/src/utils/transaction/queueTransation.ts similarity index 90% rename from src/shared/utils/transaction/queueTransation.ts rename to src/utils/transaction/queueTransation.ts index e883a83aa..cdaf2245d 100644 --- a/src/shared/utils/transaction/queueTransation.ts +++ b/src/utils/transaction/queueTransation.ts @@ -7,9 +7,9 @@ import { type PreparedTransaction, } from "thirdweb"; import { resolvePromisedValue } from "thirdweb/utils"; -import { createCustomError } from "../../../server/middleware/error"; -import type { txOverridesWithValueSchema } from "../../../server/schemas/txOverrides"; -import { parseTransactionOverrides } from "../../../server/utils/transactionOverrides"; +import { createCustomError } from "../../server/middleware/error"; +import type { txOverridesWithValueSchema } from "../../server/schemas/txOverrides"; +import { parseTransactionOverrides } from "../../server/utils/transactionOverrides"; import { prettifyError } from "../error"; import { insertTransaction } from "./insertTransaction"; import type { InsertedTransaction } from "./types"; diff --git a/src/shared/utils/transaction/simulateQueuedTransaction.ts b/src/utils/transaction/simulateQueuedTransaction.ts similarity index 100% rename from src/shared/utils/transaction/simulateQueuedTransaction.ts rename to src/utils/transaction/simulateQueuedTransaction.ts diff --git a/src/shared/utils/transaction/types.ts b/src/utils/transaction/types.ts similarity index 100% rename from src/shared/utils/transaction/types.ts rename to src/utils/transaction/types.ts diff --git a/src/shared/utils/transaction/webhook.ts b/src/utils/transaction/webhook.ts similarity index 80% rename from src/shared/utils/transaction/webhook.ts rename to src/utils/transaction/webhook.ts index 159844a9d..40cb71ed0 100644 --- a/src/shared/utils/transaction/webhook.ts +++ b/src/utils/transaction/webhook.ts @@ -1,5 +1,5 @@ -import { WebhooksEventTypes } from "../../schemas/webhooks"; -import { SendWebhookQueue } from "../../../worker/queues/sendWebhookQueue"; +import { WebhooksEventTypes } from "../../schema/webhooks"; +import { SendWebhookQueue } from "../../worker/queues/sendWebhookQueue"; import type { AnyTransaction } from "./types"; export const enqueueTransactionWebhook = async ( diff --git a/src/shared/utils/usage.ts b/src/utils/usage.ts similarity index 86% rename from src/shared/utils/usage.ts rename to src/utils/usage.ts index 97de003e3..002c437c8 100644 --- a/src/shared/utils/usage.ts +++ b/src/utils/usage.ts @@ -1,12 +1,12 @@ -import type { Static } from "@sinclair/typebox"; -import type { UsageEvent } from "@thirdweb-dev/service-utils/cf-worker"; -import type { FastifyInstance } from "fastify"; -import type { Address, Hex } from "thirdweb"; -import { ADMIN_QUEUES_BASEPATH } from "../../server/middleware/adminRoutes"; -import { OPENAPI_ROUTES } from "../../server/middleware/openApi"; -import type { contractParamSchema } from "../../server/schemas/sharedApiSchemas"; -import type { walletWithAddressParamSchema } from "../../server/schemas/wallet"; -import { getChainIdFromChain } from "../../server/utils/chain"; +import { Static } from "@sinclair/typebox"; +import { UsageEvent } from "@thirdweb-dev/service-utils/cf-worker"; +import { FastifyInstance } from "fastify"; +import { Address, Hex } from "thirdweb"; +import { ADMIN_QUEUES_BASEPATH } from "../server/middleware/adminRoutes"; +import { OPENAPI_ROUTES } from "../server/middleware/openApi"; +import { contractParamSchema } from "../server/schemas/sharedApiSchemas"; +import { walletWithAddressParamSchema } from "../server/schemas/wallet"; +import { getChainIdFromChain } from "../server/utils/chain"; import { env } from "./env"; import { logger } from "./logger"; import { thirdwebClientId } from "./sdk"; diff --git a/src/shared/utils/webhook.ts b/src/utils/webhook.ts similarity index 100% rename from src/shared/utils/webhook.ts rename to src/utils/webhook.ts diff --git a/src/worker/indexers/chainIndexerRegistry.ts b/src/worker/indexers/chainIndexerRegistry.ts index 760b556f1..df37adde8 100644 --- a/src/worker/indexers/chainIndexerRegistry.ts +++ b/src/worker/indexers/chainIndexerRegistry.ts @@ -1,6 +1,6 @@ import cron from "node-cron"; -import { getBlockTimeSeconds } from "../../shared/utils/indexer/getBlockTime"; -import { logger } from "../../shared/utils/logger"; +import { getBlockTimeSeconds } from "../../utils/indexer/getBlockTime"; +import { logger } from "../../utils/logger"; import { handleContractSubscriptions } from "../tasks/chainIndexer"; // @TODO: Move all worker logic to Bullmq to better handle multiple hosts. diff --git a/src/worker/listeners/chainIndexerListener.ts b/src/worker/listeners/chainIndexerListener.ts index 186aee895..e7be532dc 100644 --- a/src/worker/listeners/chainIndexerListener.ts +++ b/src/worker/listeners/chainIndexerListener.ts @@ -1,6 +1,6 @@ import cron from "node-cron"; -import { getConfig } from "../../shared/utils/cache/getConfig"; -import { logger } from "../../shared/utils/logger"; +import { getConfig } from "../../utils/cache/getConfig"; +import { logger } from "../../utils/logger"; import { manageChainIndexers } from "../tasks/manageChainIndexers"; let processChainIndexerStarted = false; diff --git a/src/worker/listeners/configListener.ts b/src/worker/listeners/configListener.ts index 62594280d..48213c731 100644 --- a/src/worker/listeners/configListener.ts +++ b/src/worker/listeners/configListener.ts @@ -1,7 +1,7 @@ -import { knex } from "../../shared/db/client"; -import { getConfig } from "../../shared/utils/cache/getConfig"; -import { clearCacheCron } from "../../shared/utils/cron/clearCacheCron"; -import { logger } from "../../shared/utils/logger"; +import { knex } from "../../db/client"; +import { getConfig } from "../../utils/cache/getConfig"; +import { clearCacheCron } from "../../utils/cron/clearCacheCron"; +import { logger } from "../../utils/logger"; import { chainIndexerListener } from "./chainIndexerListener"; export const newConfigurationListener = async (): Promise => { diff --git a/src/worker/listeners/webhookListener.ts b/src/worker/listeners/webhookListener.ts index d1ab64e18..2ab19ba2f 100644 --- a/src/worker/listeners/webhookListener.ts +++ b/src/worker/listeners/webhookListener.ts @@ -1,6 +1,6 @@ -import { knex } from "../../shared/db/client"; -import { webhookCache } from "../../shared/utils/cache/getWebhook"; -import { logger } from "../../shared/utils/logger"; +import { knex } from "../../db/client"; +import { webhookCache } from "../../utils/cache/getWebhook"; +import { logger } from "../../utils/logger"; export const newWebhooksListener = async (): Promise => { logger({ diff --git a/src/worker/queues/cancelRecycledNoncesQueue.ts b/src/worker/queues/cancelRecycledNoncesQueue.ts index 28bc4fde9..ff2991d52 100644 --- a/src/worker/queues/cancelRecycledNoncesQueue.ts +++ b/src/worker/queues/cancelRecycledNoncesQueue.ts @@ -1,5 +1,5 @@ import { Queue } from "bullmq"; -import { redis } from "../../shared/utils/redis/redis"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; export class CancelRecycledNoncesQueue { diff --git a/src/worker/queues/migratePostgresTransactionsQueue.ts b/src/worker/queues/migratePostgresTransactionsQueue.ts index b24498c6d..5e3100080 100644 --- a/src/worker/queues/migratePostgresTransactionsQueue.ts +++ b/src/worker/queues/migratePostgresTransactionsQueue.ts @@ -1,5 +1,5 @@ import { Queue } from "bullmq"; -import { redis } from "../../shared/utils/redis/redis"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; export class MigratePostgresTransactionsQueue { diff --git a/src/worker/queues/mineTransactionQueue.ts b/src/worker/queues/mineTransactionQueue.ts index f3a0f09ba..e35627272 100644 --- a/src/worker/queues/mineTransactionQueue.ts +++ b/src/worker/queues/mineTransactionQueue.ts @@ -1,6 +1,6 @@ import { Queue } from "bullmq"; import superjson from "superjson"; -import { redis } from "../../shared/utils/redis/redis"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; export type MineTransactionData = { diff --git a/src/worker/queues/nonceHealthCheckQueue.ts b/src/worker/queues/nonceHealthCheckQueue.ts index 80ddf5453..31795e7ec 100644 --- a/src/worker/queues/nonceHealthCheckQueue.ts +++ b/src/worker/queues/nonceHealthCheckQueue.ts @@ -1,5 +1,5 @@ import { Queue } from "bullmq"; -import { redis } from "../../shared/utils/redis/redis"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; export class NonceHealthCheckQueue { diff --git a/src/worker/queues/nonceResyncQueue.ts b/src/worker/queues/nonceResyncQueue.ts index 59ca44b65..23fbf22bc 100644 --- a/src/worker/queues/nonceResyncQueue.ts +++ b/src/worker/queues/nonceResyncQueue.ts @@ -1,5 +1,5 @@ import { Queue } from "bullmq"; -import { redis } from "../../shared/utils/redis/redis"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; export class NonceResyncQueue { diff --git a/src/worker/queues/processEventLogsQueue.ts b/src/worker/queues/processEventLogsQueue.ts index de3c97a0d..1c32ad36f 100644 --- a/src/worker/queues/processEventLogsQueue.ts +++ b/src/worker/queues/processEventLogsQueue.ts @@ -1,8 +1,8 @@ import { Queue } from "bullmq"; import SuperJSON from "superjson"; -import type { Address } from "thirdweb"; -import { getConfig } from "../../shared/utils/cache/getConfig"; -import { redis } from "../../shared/utils/redis/redis"; +import { Address } from "thirdweb"; +import { getConfig } from "../../utils/cache/getConfig"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; // Each job handles a block range for a given chain, filtered by addresses + events. diff --git a/src/worker/queues/processTransactionReceiptsQueue.ts b/src/worker/queues/processTransactionReceiptsQueue.ts index 6ee7c7557..0f595e73f 100644 --- a/src/worker/queues/processTransactionReceiptsQueue.ts +++ b/src/worker/queues/processTransactionReceiptsQueue.ts @@ -1,8 +1,8 @@ import { Queue } from "bullmq"; import superjson from "superjson"; -import type { Address } from "thirdweb"; -import { getConfig } from "../../shared/utils/cache/getConfig"; -import { redis } from "../../shared/utils/redis/redis"; +import { Address } from "thirdweb"; +import { getConfig } from "../../utils/cache/getConfig"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; // Each job handles a block range for a given chain, filtered by addresses + events. diff --git a/src/worker/queues/pruneTransactionsQueue.ts b/src/worker/queues/pruneTransactionsQueue.ts index 5786346cd..717162f77 100644 --- a/src/worker/queues/pruneTransactionsQueue.ts +++ b/src/worker/queues/pruneTransactionsQueue.ts @@ -1,5 +1,5 @@ import { Queue } from "bullmq"; -import { redis } from "../../shared/utils/redis/redis"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; export class PruneTransactionsQueue { diff --git a/src/worker/queues/queues.ts b/src/worker/queues/queues.ts index 6331d3a8d..d22534c37 100644 --- a/src/worker/queues/queues.ts +++ b/src/worker/queues/queues.ts @@ -1,6 +1,6 @@ import type { Job, JobsOptions, Worker } from "bullmq"; -import { env } from "../../shared/utils/env"; -import { logger } from "../../shared/utils/logger"; +import { env } from "../../utils/env"; +import { logger } from "../../utils/logger"; export const defaultJobOptions: JobsOptions = { // Does not retry by default. Queues must explicitly define their own retry count and backoff behavior. diff --git a/src/worker/queues/sendTransactionQueue.ts b/src/worker/queues/sendTransactionQueue.ts index 4f4db261b..ba93068b8 100644 --- a/src/worker/queues/sendTransactionQueue.ts +++ b/src/worker/queues/sendTransactionQueue.ts @@ -1,6 +1,6 @@ import { Queue } from "bullmq"; import superjson from "superjson"; -import { redis } from "../../shared/utils/redis/redis"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; export type SendTransactionData = { diff --git a/src/worker/queues/sendWebhookQueue.ts b/src/worker/queues/sendWebhookQueue.ts index a39bb7468..1861e4375 100644 --- a/src/worker/queues/sendWebhookQueue.ts +++ b/src/worker/queues/sendWebhookQueue.ts @@ -8,10 +8,10 @@ import SuperJSON from "superjson"; import { WebhooksEventTypes, type BackendWalletBalanceWebhookParams, -} from "../../shared/schemas/webhooks"; -import { getWebhooksByEventType } from "../../shared/utils/cache/getWebhook"; -import { logger } from "../../shared/utils/logger"; -import { redis } from "../../shared/utils/redis/redis"; +} from "../../schema/webhooks"; +import { getWebhooksByEventType } from "../../utils/cache/getWebhook"; +import { logger } from "../../utils/logger"; +import { redis } from "../../utils/redis/redis"; import { defaultJobOptions } from "./queues"; export type EnqueueContractSubscriptionWebhookData = { diff --git a/src/worker/tasks/cancelRecycledNoncesWorker.ts b/src/worker/tasks/cancelRecycledNoncesWorker.ts index 2fa58212a..6b8b6a125 100644 --- a/src/worker/tasks/cancelRecycledNoncesWorker.ts +++ b/src/worker/tasks/cancelRecycledNoncesWorker.ts @@ -1,10 +1,10 @@ -import { type Job, type Processor, Worker } from "bullmq"; -import type { Address } from "thirdweb"; -import { recycleNonce } from "../../shared/db/wallets/walletNonce"; -import { isNonceAlreadyUsedError } from "../../shared/utils/error"; -import { logger } from "../../shared/utils/logger"; -import { redis } from "../../shared/utils/redis/redis"; -import { sendCancellationTransaction } from "../../shared/utils/transaction/cancelTransaction"; +import { Job, Processor, Worker } from "bullmq"; +import { Address } from "thirdweb"; +import { recycleNonce } from "../../db/wallets/walletNonce"; +import { isNonceAlreadyUsedError } from "../../utils/error"; +import { logger } from "../../utils/logger"; +import { redis } from "../../utils/redis/redis"; +import { sendCancellationTransaction } from "../../utils/transaction/cancelTransaction"; import { CancelRecycledNoncesQueue } from "../queues/cancelRecycledNoncesQueue"; import { logWorkerExceptions } from "../queues/queues"; diff --git a/src/worker/tasks/chainIndexer.ts b/src/worker/tasks/chainIndexer.ts index 41bf92288..a7fbcc304 100644 --- a/src/worker/tasks/chainIndexer.ts +++ b/src/worker/tasks/chainIndexer.ts @@ -4,13 +4,13 @@ import { getRpcClient, type Address, } from "thirdweb"; -import { getBlockForIndexing } from "../../shared/db/chainIndexers/getChainIndexer"; -import { upsertChainIndexer } from "../../shared/db/chainIndexers/upsertChainIndexer"; -import { prisma } from "../../shared/db/client"; -import { getContractSubscriptionsByChainId } from "../../shared/db/contractSubscriptions/getContractSubscriptions"; -import { getChain } from "../../shared/utils/chain"; -import { logger } from "../../shared/utils/logger"; -import { thirdwebClient } from "../../shared/utils/sdk"; +import { getBlockForIndexing } from "../../db/chainIndexers/getChainIndexer"; +import { upsertChainIndexer } from "../../db/chainIndexers/upsertChainIndexer"; +import { prisma } from "../../db/client"; +import { getContractSubscriptionsByChainId } from "../../db/contractSubscriptions/getContractSubscriptions"; +import { getChain } from "../../utils/chain"; +import { logger } from "../../utils/logger"; +import { thirdwebClient } from "../../utils/sdk"; import { ProcessEventsLogQueue } from "../queues/processEventLogsQueue"; import { ProcessTransactionReceiptsQueue } from "../queues/processTransactionReceiptsQueue"; diff --git a/src/worker/tasks/manageChainIndexers.ts b/src/worker/tasks/manageChainIndexers.ts index 787f88116..741562ee7 100644 --- a/src/worker/tasks/manageChainIndexers.ts +++ b/src/worker/tasks/manageChainIndexers.ts @@ -1,4 +1,4 @@ -import { getContractSubscriptionsUniqueChainIds } from "../../shared/db/contractSubscriptions/getContractSubscriptions"; +import { getContractSubscriptionsUniqueChainIds } from "../../db/contractSubscriptions/getContractSubscriptions"; import { INDEXER_REGISTRY, addChainIndexer, diff --git a/src/worker/tasks/migratePostgresTransactionsWorker.ts b/src/worker/tasks/migratePostgresTransactionsWorker.ts index fb3b3c4e2..7547d9b75 100644 --- a/src/worker/tasks/migratePostgresTransactionsWorker.ts +++ b/src/worker/tasks/migratePostgresTransactionsWorker.ts @@ -2,20 +2,17 @@ import type { Transactions } from "@prisma/client"; import { Worker, type Job, type Processor } from "bullmq"; import assert from "node:assert"; import type { Hex } from "thirdweb"; -import { getPrismaWithPostgresTx, prisma } from "../../shared/db/client"; -import { TransactionDB } from "../../shared/db/transactions/db"; -import type { PrismaTransaction } from "../../shared/schemas/prisma"; -import { getConfig } from "../../shared/utils/cache/getConfig"; -import { logger } from "../../shared/utils/logger"; -import { - maybeBigInt, - normalizeAddress, -} from "../../shared/utils/primitiveTypes"; -import { redis } from "../../shared/utils/redis/redis"; +import { getPrismaWithPostgresTx, prisma } from "../../db/client"; +import { TransactionDB } from "../../db/transactions/db"; +import type { PrismaTransaction } from "../../schema/prisma"; +import { getConfig } from "../../utils/cache/getConfig"; +import { logger } from "../../utils/logger"; +import { maybeBigInt, normalizeAddress } from "../../utils/primitiveTypes"; +import { redis } from "../../utils/redis/redis"; import type { QueuedTransaction, SentTransaction, -} from "../../shared/utils/transaction/types"; +} from "../../utils/transaction/types"; import { MigratePostgresTransactionsQueue } from "../queues/migratePostgresTransactionsQueue"; import { MineTransactionQueue } from "../queues/mineTransactionQueue"; import { logWorkerExceptions } from "../queues/queues"; diff --git a/src/worker/tasks/mineTransactionWorker.ts b/src/worker/tasks/mineTransactionWorker.ts index b8facc1fa..1d3ce45f9 100644 --- a/src/worker/tasks/mineTransactionWorker.ts +++ b/src/worker/tasks/mineTransactionWorker.ts @@ -10,34 +10,31 @@ import { } from "thirdweb"; import { stringify } from "thirdweb/utils"; import { getUserOpReceipt } from "thirdweb/wallets/smart"; -import { TransactionDB } from "../../shared/db/transactions/db"; -import { - recycleNonce, - removeSentNonce, -} from "../../shared/db/wallets/walletNonce"; +import { TransactionDB } from "../../db/transactions/db"; +import { recycleNonce, removeSentNonce } from "../../db/wallets/walletNonce"; import { getReceiptForEOATransaction, getReceiptForUserOp, -} from "../../shared/lib/transaction/get-transaction-receipt"; -import { WebhooksEventTypes } from "../../shared/schemas/webhooks"; -import { getBlockNumberish } from "../../shared/utils/block"; -import { getConfig } from "../../shared/utils/cache/getConfig"; -import { getWebhooksByEventType } from "../../shared/utils/cache/getWebhook"; -import { getChain } from "../../shared/utils/chain"; -import { msSince } from "../../shared/utils/date"; -import { env } from "../../shared/utils/env"; -import { prettifyError } from "../../shared/utils/error"; -import { logger } from "../../shared/utils/logger"; -import { recordMetrics } from "../../shared/utils/prometheus"; -import { redis } from "../../shared/utils/redis/redis"; -import { thirdwebClient } from "../../shared/utils/sdk"; +} from "../../lib/transaction/get-transaction-receipt"; +import { WebhooksEventTypes } from "../../schema/webhooks"; +import { getBlockNumberish } from "../../utils/block"; +import { getConfig } from "../../utils/cache/getConfig"; +import { getWebhooksByEventType } from "../../utils/cache/getWebhook"; +import { getChain } from "../../utils/chain"; +import { msSince } from "../../utils/date"; +import { env } from "../../utils/env"; +import { prettifyError } from "../../utils/error"; +import { logger } from "../../utils/logger"; +import { recordMetrics } from "../../utils/prometheus"; +import { redis } from "../../utils/redis/redis"; +import { thirdwebClient } from "../../utils/sdk"; import type { ErroredTransaction, MinedTransaction, SentTransaction, -} from "../../shared/utils/transaction/types"; -import { enqueueTransactionWebhook } from "../../shared/utils/transaction/webhook"; -import { reportUsage } from "../../shared/utils/usage"; +} from "../../utils/transaction/types"; +import { enqueueTransactionWebhook } from "../../utils/transaction/webhook"; +import { reportUsage } from "../../utils/usage"; import { MineTransactionQueue, type MineTransactionData, diff --git a/src/worker/tasks/nonceHealthCheckWorker.ts b/src/worker/tasks/nonceHealthCheckWorker.ts index 2c2ab63a3..4d528c0c8 100644 --- a/src/worker/tasks/nonceHealthCheckWorker.ts +++ b/src/worker/tasks/nonceHealthCheckWorker.ts @@ -3,10 +3,10 @@ import { getAddress, type Address } from "thirdweb"; import { getUsedBackendWallets, inspectNonce, -} from "../../shared/db/wallets/walletNonce"; +} from "../../db/wallets/walletNonce"; import { getLastUsedOnchainNonce } from "../../server/routes/admin/nonces"; -import { logger } from "../../shared/utils/logger"; -import { redis } from "../../shared/utils/redis/redis"; +import { logger } from "../../utils/logger"; +import { redis } from "../../utils/redis/redis"; import { NonceHealthCheckQueue } from "../queues/nonceHealthCheckQueue"; import { logWorkerExceptions } from "../queues/queues"; diff --git a/src/worker/tasks/nonceResyncWorker.ts b/src/worker/tasks/nonceResyncWorker.ts index 144390076..8f5cb0c65 100644 --- a/src/worker/tasks/nonceResyncWorker.ts +++ b/src/worker/tasks/nonceResyncWorker.ts @@ -5,13 +5,13 @@ import { isSentNonce, recycleNonce, splitSentNoncesKey, -} from "../../shared/db/wallets/walletNonce"; -import { getConfig } from "../../shared/utils/cache/getConfig"; -import { getChain } from "../../shared/utils/chain"; -import { prettifyError } from "../../shared/utils/error"; -import { logger } from "../../shared/utils/logger"; -import { redis } from "../../shared/utils/redis/redis"; -import { thirdwebClient } from "../../shared/utils/sdk"; +} from "../../db/wallets/walletNonce"; +import { getConfig } from "../../utils/cache/getConfig"; +import { getChain } from "../../utils/chain"; +import { prettifyError } from "../../utils/error"; +import { logger } from "../../utils/logger"; +import { redis } from "../../utils/redis/redis"; +import { thirdwebClient } from "../../utils/sdk"; import { NonceResyncQueue } from "../queues/nonceResyncQueue"; import { logWorkerExceptions } from "../queues/queues"; diff --git a/src/worker/tasks/processEventLogsWorker.ts b/src/worker/tasks/processEventLogsWorker.ts index b1fd0c357..b3ad7c5fa 100644 --- a/src/worker/tasks/processEventLogsWorker.ts +++ b/src/worker/tasks/processEventLogsWorker.ts @@ -15,16 +15,16 @@ import { type ThirdwebContract, } from "thirdweb"; import { resolveContractAbi } from "thirdweb/contract"; -import { bulkInsertContractEventLogs } from "../../shared/db/contractEventLogs/createContractEventLogs"; -import { getContractSubscriptionsByChainId } from "../../shared/db/contractSubscriptions/getContractSubscriptions"; -import { WebhooksEventTypes } from "../../shared/schemas/webhooks"; -import { getChain } from "../../shared/utils/chain"; -import { logger } from "../../shared/utils/logger"; -import { normalizeAddress } from "../../shared/utils/primitiveTypes"; -import { redis } from "../../shared/utils/redis/redis"; -import { thirdwebClient } from "../../shared/utils/sdk"; +import { bulkInsertContractEventLogs } from "../../db/contractEventLogs/createContractEventLogs"; +import { getContractSubscriptionsByChainId } from "../../db/contractSubscriptions/getContractSubscriptions"; +import { WebhooksEventTypes } from "../../schema/webhooks"; +import { getChain } from "../../utils/chain"; +import { logger } from "../../utils/logger"; +import { normalizeAddress } from "../../utils/primitiveTypes"; +import { redis } from "../../utils/redis/redis"; +import { thirdwebClient } from "../../utils/sdk"; import { - type EnqueueProcessEventLogsData, + EnqueueProcessEventLogsData, ProcessEventsLogQueue, } from "../queues/processEventLogsQueue"; import { logWorkerExceptions } from "../queues/queues"; diff --git a/src/worker/tasks/processTransactionReceiptsWorker.ts b/src/worker/tasks/processTransactionReceiptsWorker.ts index 5bfb4e5a0..d8cdb23ae 100644 --- a/src/worker/tasks/processTransactionReceiptsWorker.ts +++ b/src/worker/tasks/processTransactionReceiptsWorker.ts @@ -12,19 +12,20 @@ import { } from "thirdweb"; import { resolveContractAbi } from "thirdweb/contract"; import { decodeFunctionData, type Abi, type Hash } from "viem"; -import { bulkInsertContractTransactionReceipts } from "../../shared/db/contractTransactionReceipts/createContractTransactionReceipts"; -import { WebhooksEventTypes } from "../../shared/schemas/webhooks"; -import { getChain } from "../../shared/utils/chain"; -import { logger } from "../../shared/utils/logger"; -import { normalizeAddress } from "../../shared/utils/primitiveTypes"; -import { redis } from "../../shared/utils/redis/redis"; -import { thirdwebClient } from "../../shared/utils/sdk"; +import { bulkInsertContractTransactionReceipts } from "../../db/contractTransactionReceipts/createContractTransactionReceipts"; +import { WebhooksEventTypes } from "../../schema/webhooks"; +import { getChain } from "../../utils/chain"; +import { logger } from "../../utils/logger"; +import { normalizeAddress } from "../../utils/primitiveTypes"; +import { redis } from "../../utils/redis/redis"; +import { thirdwebClient } from "../../utils/sdk"; import { ProcessTransactionReceiptsQueue, type EnqueueProcessTransactionReceiptsData, } from "../queues/processTransactionReceiptsQueue"; import { logWorkerExceptions } from "../queues/queues"; import { SendWebhookQueue } from "../queues/sendWebhookQueue"; +import { getContractId } from "../utils/contractId"; import { getWebhooksByContractAddresses } from "./processEventLogsWorker"; const handler: Processor = async (job: Job) => { @@ -227,6 +228,3 @@ export const initProcessTransactionReceiptsWorker = () => { }); logWorkerExceptions(_worker); }; - -const getContractId = (chainId: number, contractAddress: string) => - `${chainId}:${contractAddress}`; diff --git a/src/worker/tasks/pruneTransactionsWorker.ts b/src/worker/tasks/pruneTransactionsWorker.ts index d736c23f3..9ba8a361a 100644 --- a/src/worker/tasks/pruneTransactionsWorker.ts +++ b/src/worker/tasks/pruneTransactionsWorker.ts @@ -1,8 +1,8 @@ import { Worker, type Job, type Processor } from "bullmq"; -import { TransactionDB } from "../../shared/db/transactions/db"; -import { pruneNonceMaps } from "../../shared/db/wallets/nonceMap"; -import { env } from "../../shared/utils/env"; -import { redis } from "../../shared/utils/redis/redis"; +import { TransactionDB } from "../../db/transactions/db"; +import { pruneNonceMaps } from "../../db/wallets/nonceMap"; +import { env } from "../../utils/env"; +import { redis } from "../../utils/redis/redis"; import { PruneTransactionsQueue } from "../queues/pruneTransactionsQueue"; import { logWorkerExceptions } from "../queues/queues"; diff --git a/src/worker/tasks/sendTransactionWorker.ts b/src/worker/tasks/sendTransactionWorker.ts index 65c810733..783530ba0 100644 --- a/src/worker/tasks/sendTransactionWorker.ts +++ b/src/worker/tasks/sendTransactionWorker.ts @@ -18,39 +18,39 @@ import { type UserOperation, } from "thirdweb/wallets/smart"; import { getContractAddress } from "viem"; -import { TransactionDB } from "../../shared/db/transactions/db"; +import { TransactionDB } from "../../db/transactions/db"; import { acquireNonce, addSentNonce, recycleNonce, syncLatestNonceFromOnchainIfHigher, -} from "../../shared/db/wallets/walletNonce"; +} from "../../db/wallets/walletNonce"; import { getAccount, getSmartBackendWalletAdminAccount, -} from "../../shared/utils/account"; -import { getBlockNumberish } from "../../shared/utils/block"; -import { getChain } from "../../shared/utils/chain"; -import { msSince } from "../../shared/utils/date"; -import { env } from "../../shared/utils/env"; +} from "../../utils/account"; +import { getBlockNumberish } from "../../utils/block"; +import { getChain } from "../../utils/chain"; +import { msSince } from "../../utils/date"; +import { env } from "../../utils/env"; import { isInsufficientFundsError, isNonceAlreadyUsedError, isReplacementGasFeeTooLow, wrapError, -} from "../../shared/utils/error"; -import { getChecksumAddress } from "../../shared/utils/primitiveTypes"; -import { recordMetrics } from "../../shared/utils/prometheus"; -import { redis } from "../../shared/utils/redis/redis"; -import { thirdwebClient } from "../../shared/utils/sdk"; +} from "../../utils/error"; +import { getChecksumAddress } from "../../utils/primitiveTypes"; +import { recordMetrics } from "../../utils/prometheus"; +import { redis } from "../../utils/redis/redis"; +import { thirdwebClient } from "../../utils/sdk"; import type { ErroredTransaction, PopulatedTransaction, QueuedTransaction, SentTransaction, -} from "../../shared/utils/transaction/types"; -import { enqueueTransactionWebhook } from "../../shared/utils/transaction/webhook"; -import { reportUsage } from "../../shared/utils/usage"; +} from "../../utils/transaction/types"; +import { enqueueTransactionWebhook } from "../../utils/transaction/webhook"; +import { reportUsage } from "../../utils/usage"; import { MineTransactionQueue } from "../queues/mineTransactionQueue"; import { logWorkerExceptions } from "../queues/queues"; import { diff --git a/src/worker/tasks/sendWebhookWorker.ts b/src/worker/tasks/sendWebhookWorker.ts index bd62edc40..a8cf60c23 100644 --- a/src/worker/tasks/sendWebhookWorker.ts +++ b/src/worker/tasks/sendWebhookWorker.ts @@ -1,23 +1,20 @@ import type { Static } from "@sinclair/typebox"; import { Worker, type Job, type Processor } from "bullmq"; import superjson from "superjson"; -import { TransactionDB } from "../../shared/db/transactions/db"; +import { TransactionDB } from "../../db/transactions/db"; import { WebhooksEventTypes, type BackendWalletBalanceWebhookParams, -} from "../../shared/schemas/webhooks"; +} from "../../schema/webhooks"; import { toEventLogSchema } from "../../server/schemas/eventLog"; import { toTransactionSchema, type TransactionSchema, } from "../../server/schemas/transaction"; import { toTransactionReceiptSchema } from "../../server/schemas/transactionReceipt"; -import { logger } from "../../shared/utils/logger"; -import { redis } from "../../shared/utils/redis/redis"; -import { - sendWebhookRequest, - type WebhookResponse, -} from "../../shared/utils/webhook"; +import { logger } from "../../utils/logger"; +import { redis } from "../../utils/redis/redis"; +import { sendWebhookRequest, type WebhookResponse } from "../../utils/webhook"; import { SendWebhookQueue, type WebhookJob } from "../queues/sendWebhookQueue"; const handler: Processor = async (job: Job) => { diff --git a/src/worker/utils/contractId.ts b/src/worker/utils/contractId.ts new file mode 100644 index 000000000..6cf991fca --- /dev/null +++ b/src/worker/utils/contractId.ts @@ -0,0 +1,2 @@ +export const getContractId = (chainId: number, contractAddress: string) => + `${chainId}:${contractAddress}`; diff --git a/src/worker/utils/nonce.ts b/src/worker/utils/nonce.ts new file mode 100644 index 000000000..d225ae87b --- /dev/null +++ b/src/worker/utils/nonce.ts @@ -0,0 +1,25 @@ +import { BigNumber } from "ethers"; +import { concat, toHex } from "viem"; + +const generateRandomUint192 = (): bigint => { + const rand1 = BigInt(Math.floor(Math.random() * 0x100000000)); + const rand2 = BigInt(Math.floor(Math.random() * 0x100000000)); + const rand3 = BigInt(Math.floor(Math.random() * 0x100000000)); + const rand4 = BigInt(Math.floor(Math.random() * 0x100000000)); + const rand5 = BigInt(Math.floor(Math.random() * 0x100000000)); + const rand6 = BigInt(Math.floor(Math.random() * 0x100000000)); + return ( + (rand1 << 160n) | + (rand2 << 128n) | + (rand3 << 96n) | + (rand4 << 64n) | + (rand5 << 32n) | + rand6 + ); +}; + +export const randomNonce = () => { + return BigNumber.from( + concat([toHex(generateRandomUint192()), "0x0000000000000000"]), + ); +}; diff --git a/tests/e2e/.env.test.example b/test/e2e/.env.test.example similarity index 100% rename from tests/e2e/.env.test.example rename to test/e2e/.env.test.example diff --git a/tests/e2e/.gitignore b/test/e2e/.gitignore similarity index 100% rename from tests/e2e/.gitignore rename to test/e2e/.gitignore diff --git a/tests/e2e/README.md b/test/e2e/README.md similarity index 100% rename from tests/e2e/README.md rename to test/e2e/README.md diff --git a/tests/e2e/bun.lockb b/test/e2e/bun.lockb similarity index 100% rename from tests/e2e/bun.lockb rename to test/e2e/bun.lockb diff --git a/tests/e2e/config.ts b/test/e2e/config.ts similarity index 100% rename from tests/e2e/config.ts rename to test/e2e/config.ts diff --git a/tests/e2e/package.json b/test/e2e/package.json similarity index 100% rename from tests/e2e/package.json rename to test/e2e/package.json diff --git a/tests/e2e/scripts/counter.ts b/test/e2e/scripts/counter.ts similarity index 90% rename from tests/e2e/scripts/counter.ts rename to test/e2e/scripts/counter.ts index b0c40f50e..ccb9bd8de 100644 --- a/tests/e2e/scripts/counter.ts +++ b/test/e2e/scripts/counter.ts @@ -2,8 +2,8 @@ // You can save the output to a file and then use this script to count the number of times a specific RPC call is made. import { argv } from "bun"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; +import { readFile } from "fs/promises"; +import { join } from "path"; const file = join(__dirname, argv[2]); diff --git a/tests/e2e/tests/extensions.test.ts b/test/e2e/tests/extensions.test.ts similarity index 98% rename from tests/e2e/tests/extensions.test.ts rename to test/e2e/tests/extensions.test.ts index ed0674da8..1126f2877 100644 --- a/tests/e2e/tests/extensions.test.ts +++ b/test/e2e/tests/extensions.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import assert from "assert"; import { sleep } from "bun"; import { beforeAll, describe, expect, test } from "bun:test"; import { getAddress, type Address } from "viem"; diff --git a/tests/e2e/tests/load.test.ts b/test/e2e/tests/load.test.ts similarity index 98% rename from tests/e2e/tests/load.test.ts rename to test/e2e/tests/load.test.ts index 0cdea6317..1e31a2e4b 100644 --- a/tests/e2e/tests/load.test.ts +++ b/test/e2e/tests/load.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import assert from "assert"; import { sleep } from "bun"; import { describe, expect, test } from "bun:test"; import { getAddress } from "viem"; diff --git a/tests/e2e/tests/read.test.ts b/test/e2e/tests/read.test.ts similarity index 99% rename from tests/e2e/tests/read.test.ts rename to test/e2e/tests/read.test.ts index 25acbc951..7be048956 100644 --- a/tests/e2e/tests/read.test.ts +++ b/test/e2e/tests/read.test.ts @@ -1,6 +1,6 @@ import { beforeAll, describe, expect, test } from "bun:test"; import { sepolia } from "thirdweb/chains"; -import type { ApiError } from "../../../sdk/dist/thirdweb-dev-engine.cjs.js"; +import type { ApiError } from "../../../sdk/dist/thirdweb-dev-engine.cjs"; import type { setupEngine } from "../utils/engine"; import { setup } from "./setup"; diff --git a/tests/e2e/tests/routes/erc1155-transfer.test.ts b/test/e2e/tests/routes/erc1155-transfer.test.ts similarity index 100% rename from tests/e2e/tests/routes/erc1155-transfer.test.ts rename to test/e2e/tests/routes/erc1155-transfer.test.ts diff --git a/tests/e2e/tests/routes/erc20-transfer.test.ts b/test/e2e/tests/routes/erc20-transfer.test.ts similarity index 99% rename from tests/e2e/tests/routes/erc20-transfer.test.ts rename to test/e2e/tests/routes/erc20-transfer.test.ts index 867e1d43b..7a22c149e 100644 --- a/tests/e2e/tests/routes/erc20-transfer.test.ts +++ b/test/e2e/tests/routes/erc20-transfer.test.ts @@ -4,7 +4,7 @@ import { ZERO_ADDRESS, toWei, type Address } from "thirdweb"; import { CONFIG } from "../../config"; import { getEngineBackendWalletB, type setupEngine } from "../../utils/engine"; import { pollTransactionStatus } from "../../utils/transactions"; -import { setup } from "../setup"; +import { setup } from "./../setup"; describe("ERC20 transfer", () => { let tokenContractAddress: string; diff --git a/tests/e2e/tests/routes/erc721-transfer.test.ts b/test/e2e/tests/routes/erc721-transfer.test.ts similarity index 100% rename from tests/e2e/tests/routes/erc721-transfer.test.ts rename to test/e2e/tests/routes/erc721-transfer.test.ts diff --git a/tests/e2e/tests/routes/signMessage.test.ts b/test/e2e/tests/routes/signMessage.test.ts similarity index 100% rename from tests/e2e/tests/routes/signMessage.test.ts rename to test/e2e/tests/routes/signMessage.test.ts diff --git a/tests/e2e/tests/routes/signaturePrepare.test.ts b/test/e2e/tests/routes/signaturePrepare.test.ts similarity index 100% rename from tests/e2e/tests/routes/signaturePrepare.test.ts rename to test/e2e/tests/routes/signaturePrepare.test.ts diff --git a/tests/e2e/tests/routes/write.test.ts b/test/e2e/tests/routes/write.test.ts similarity index 97% rename from tests/e2e/tests/routes/write.test.ts rename to test/e2e/tests/routes/write.test.ts index 68e9db9de..d891055d6 100644 --- a/tests/e2e/tests/routes/write.test.ts +++ b/test/e2e/tests/routes/write.test.ts @@ -3,10 +3,10 @@ import assert from "node:assert"; import { stringToHex, type Address } from "thirdweb"; import { zeroAddress } from "viem"; import type { ApiError } from "../../../../sdk/dist/thirdweb-dev-engine.cjs.js"; -import { CONFIG } from "../../config.js"; -import type { setupEngine } from "../../utils/engine.js"; -import { pollTransactionStatus } from "../../utils/transactions.js"; -import { setup } from "../setup.js"; +import { CONFIG } from "../../config"; +import type { setupEngine } from "../../utils/engine"; +import { pollTransactionStatus } from "../../utils/transactions"; +import { setup } from "../setup"; describe("/contract/write route", () => { let tokenContractAddress: string; diff --git a/tests/e2e/tests/setup.ts b/test/e2e/tests/setup.ts similarity index 96% rename from tests/e2e/tests/setup.ts rename to test/e2e/tests/setup.ts index 0be24b7f7..c65b07e06 100644 --- a/tests/e2e/tests/setup.ts +++ b/test/e2e/tests/setup.ts @@ -25,7 +25,7 @@ export const setup = async (): Promise => { const engine = setupEngine(); const backendWallet = await getEngineBackendWallet(engine); - await engine.backendWallet.resetNonces({}); + await engine.backendWallet.resetNonces(); if (!env.THIRDWEB_API_SECRET_KEY) throw new Error("THIRDWEB_API_SECRET_KEY is not set"); diff --git a/tests/e2e/tests/sign-transaction.test.ts b/test/e2e/tests/sign-transaction.test.ts similarity index 100% rename from tests/e2e/tests/sign-transaction.test.ts rename to test/e2e/tests/sign-transaction.test.ts diff --git a/tests/e2e/tests/smart-backend-wallet/smart-aws-wallet.test.ts b/test/e2e/tests/smart-backend-wallet/smart-aws-wallet.test.ts similarity index 100% rename from tests/e2e/tests/smart-backend-wallet/smart-aws-wallet.test.ts rename to test/e2e/tests/smart-backend-wallet/smart-aws-wallet.test.ts diff --git a/tests/e2e/tests/smart-backend-wallet/smart-gcp-wallet.test.ts b/test/e2e/tests/smart-backend-wallet/smart-gcp-wallet.test.ts similarity index 100% rename from tests/e2e/tests/smart-backend-wallet/smart-gcp-wallet.test.ts rename to test/e2e/tests/smart-backend-wallet/smart-gcp-wallet.test.ts diff --git a/tests/e2e/tests/smart-backend-wallet/smart-local-wallet-sdk-v4.test.ts b/test/e2e/tests/smart-backend-wallet/smart-local-wallet-sdk-v4.test.ts similarity index 100% rename from tests/e2e/tests/smart-backend-wallet/smart-local-wallet-sdk-v4.test.ts rename to test/e2e/tests/smart-backend-wallet/smart-local-wallet-sdk-v4.test.ts diff --git a/tests/e2e/tests/smart-backend-wallet/smart-local-wallet.test.ts b/test/e2e/tests/smart-backend-wallet/smart-local-wallet.test.ts similarity index 100% rename from tests/e2e/tests/smart-backend-wallet/smart-local-wallet.test.ts rename to test/e2e/tests/smart-backend-wallet/smart-local-wallet.test.ts diff --git a/tests/e2e/tests/smoke.test.ts b/test/e2e/tests/smoke.test.ts similarity index 100% rename from tests/e2e/tests/smoke.test.ts rename to test/e2e/tests/smoke.test.ts diff --git a/tests/e2e/tests/userop.test.ts b/test/e2e/tests/userop.test.ts similarity index 98% rename from tests/e2e/tests/userop.test.ts rename to test/e2e/tests/userop.test.ts index 875231e67..18c5cba6d 100644 --- a/tests/e2e/tests/userop.test.ts +++ b/test/e2e/tests/userop.test.ts @@ -1,5 +1,5 @@ import { beforeAll, describe, expect, test } from "bun:test"; -import { randomBytes } from "node:crypto"; +import { randomBytes } from "crypto"; import { getAddress, type Address } from "thirdweb"; import { sepolia } from "thirdweb/chains"; import { DEFAULT_ACCOUNT_FACTORY_V0_6 } from "thirdweb/wallets/smart"; diff --git a/tests/e2e/tests/utils/getBlockTime.test.ts b/test/e2e/tests/utils/getBlockTime.test.ts similarity index 100% rename from tests/e2e/tests/utils/getBlockTime.test.ts rename to test/e2e/tests/utils/getBlockTime.test.ts diff --git a/tests/e2e/tsconfig.json b/test/e2e/tsconfig.json similarity index 100% rename from tests/e2e/tsconfig.json rename to test/e2e/tsconfig.json diff --git a/tests/e2e/utils/anvil.ts b/test/e2e/utils/anvil.ts similarity index 100% rename from tests/e2e/utils/anvil.ts rename to test/e2e/utils/anvil.ts diff --git a/tests/e2e/utils/engine.ts b/test/e2e/utils/engine.ts similarity index 95% rename from tests/e2e/utils/engine.ts rename to test/e2e/utils/engine.ts index b4bdede4f..53cb57be0 100644 --- a/tests/e2e/utils/engine.ts +++ b/test/e2e/utils/engine.ts @@ -1,5 +1,5 @@ import { checksumAddress } from "thirdweb/utils"; -import { Engine } from "../../../sdk/dist/thirdweb-dev-engine.cjs"; +import { Engine } from "../../../sdk"; import { CONFIG } from "../config"; import { ANVIL_PKEY_A, ANVIL_PKEY_B } from "./wallets"; diff --git a/tests/e2e/utils/statistics.ts b/test/e2e/utils/statistics.ts similarity index 100% rename from tests/e2e/utils/statistics.ts rename to test/e2e/utils/statistics.ts diff --git a/tests/e2e/utils/transactions.ts b/test/e2e/utils/transactions.ts similarity index 95% rename from tests/e2e/utils/transactions.ts rename to test/e2e/utils/transactions.ts index 4f889d3a9..7e51b5a6c 100644 --- a/tests/e2e/utils/transactions.ts +++ b/test/e2e/utils/transactions.ts @@ -1,6 +1,6 @@ import { sleep } from "bun"; -import type { Address } from "viem"; -import type { Engine } from "../../../sdk/dist/thirdweb-dev-engine.cjs"; +import { type Address } from "viem"; +import { Engine } from "../../../sdk"; import { CONFIG } from "../config"; type Timing = { diff --git a/tests/e2e/utils/wallets.ts b/test/e2e/utils/wallets.ts similarity index 100% rename from tests/e2e/utils/wallets.ts rename to test/e2e/utils/wallets.ts diff --git a/tsconfig.json b/tsconfig.json index 6fb9b351a..e708959bb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,5 +25,5 @@ "src/**/*.js", "src/**/*.d.ts" ], - "exclude": ["node_modules", "tests/tests/**/*.ts"] + "exclude": ["node_modules", "src/tests/**/*.ts"] } diff --git a/vitest.config.ts b/vitest.config.ts index d2f6a0cda..cfcdaf467 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,8 +2,9 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - include: ["tests/unit/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], + include: ["src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], exclude: ["tests/e2e/**/*"], + // setupFiles: ["./vitest.setup.ts"], globalSetup: ["./vitest.global-setup.ts"], mockReset: true, }, diff --git a/vitest.global-setup.ts b/vitest.global-setup.ts index c09752690..53f215c91 100644 --- a/vitest.global-setup.ts +++ b/vitest.global-setup.ts @@ -5,19 +5,17 @@ config({ path: [path.resolve(".env.test.local"), path.resolve(".env.test")], }); -// import { createServer } from "prool"; -// import { anvil } from "prool/instances"; +import { createServer } from "prool"; +import { anvil } from "prool/instances"; -// export async function setup() { -// const server = createServer({ -// instance: anvil(), -// port: 8645, // Choose an appropriate port -// }); -// await server.start(); -// // Return a teardown function that will be called after all tests are complete -// return async () => { -// await server.stop(); -// }; -// } - -export async function setup() {} +export async function setup() { + const server = createServer({ + instance: anvil(), + port: 8645, // Choose an appropriate port + }); + await server.start(); + // Return a teardown function that will be called after all tests are complete + return async () => { + await server.stop(); + }; +}