diff --git a/package.json b/package.json index 96bbf7e183..d7123e7aba 100644 --- a/package.json +++ b/package.json @@ -112,10 +112,10 @@ "default": "./esm/index.js" }, "./api": { - "types": "./esm/api/index.d.ts", - "module": "./esm/api/index.js", - "import": "./esm/api/index.js", - "default": "./esm/api/index.js" + "types": "./esm/core/api/index.d.ts", + "module": "./esm/core/api/index.js", + "import": "./esm/core/api/index.js", + "default": "./esm/core/api/index.js" }, "./checkout": { "types": "./esm/checkout/index.d.ts", diff --git a/src/checkout/types.ts b/src/checkout/types.ts index aefebc28fa..1a60904b16 100644 --- a/src/checkout/types.ts +++ b/src/checkout/types.ts @@ -1,7 +1,7 @@ import type { ContractFunctionParameters, TransactionReceipt } from 'viem'; import type { Address } from 'viem'; import type { Config } from 'wagmi'; -import type { PayTransaction } from '../api/types'; +import type { PayTransaction } from '../core/api/types'; import type { TransactionError } from '../transaction'; /** diff --git a/src/checkout/utils/handlePayRequest.test.ts b/src/checkout/utils/handlePayRequest.test.ts index e2c670fe86..0e877e8e29 100644 --- a/src/checkout/utils/handlePayRequest.test.ts +++ b/src/checkout/utils/handlePayRequest.test.ts @@ -1,9 +1,10 @@ import type { Address } from 'viem'; import { type Mock, describe, expect, it, vi } from 'vitest'; -import { buildPayTransaction } from '../../api'; + +import { buildPayTransaction } from '../../core/api'; import { handlePayRequest } from './handlePayRequest'; -vi.mock('../../api', () => ({ +vi.mock('../../core/api', () => ({ buildPayTransaction: vi.fn(), })); diff --git a/src/checkout/utils/handlePayRequest.ts b/src/checkout/utils/handlePayRequest.ts index 485785a918..db7890aec8 100644 --- a/src/checkout/utils/handlePayRequest.ts +++ b/src/checkout/utils/handlePayRequest.ts @@ -1,5 +1,5 @@ -import { buildPayTransaction } from '../../api'; -import type { BuildPayTransactionParams } from '../../api'; +import { buildPayTransaction } from '../../core/api'; +import type { BuildPayTransactionParams } from '../../core/api'; import type { HandlePayRequestParams } from '../types'; export const handlePayRequest = async ({ diff --git a/src/api/buildMintTransaction.test.ts b/src/core/api/buildMintTransaction.test.ts similarity index 92% rename from src/api/buildMintTransaction.test.ts rename to src/core/api/buildMintTransaction.test.ts index f600d774c1..9c2053a980 100644 --- a/src/api/buildMintTransaction.test.ts +++ b/src/core/api/buildMintTransaction.test.ts @@ -1,10 +1,10 @@ import { type Mock, describe, expect, it, vi } from 'vitest'; -import { CDP_MINT_TOKEN } from '../network/definitions/nft'; -import { sendRequest } from '../network/request'; +import { CDP_MINT_TOKEN } from '../../network/definitions/nft'; +import { sendRequest } from '../../network/request'; import { buildMintTransaction } from './buildMintTransaction'; import type { BuildMintTransactionParams } from './types'; -vi.mock('../network/request', () => ({ +vi.mock('../../network/request', () => ({ sendRequest: vi.fn(), })); diff --git a/src/api/buildMintTransaction.ts b/src/core/api/buildMintTransaction.ts similarity index 88% rename from src/api/buildMintTransaction.ts rename to src/core/api/buildMintTransaction.ts index ded0f96cff..fff4e69723 100644 --- a/src/api/buildMintTransaction.ts +++ b/src/core/api/buildMintTransaction.ts @@ -1,5 +1,5 @@ -import { CDP_MINT_TOKEN } from '../network/definitions/nft'; -import { sendRequest } from '../network/request'; +import { CDP_MINT_TOKEN } from '../../network/definitions/nft'; +import { sendRequest } from '../../network/request'; import type { BuildMintTransactionParams, BuildMintTransactionResponse, diff --git a/src/api/buildPayTransaction.test.ts b/src/core/api/buildPayTransaction.test.ts similarity index 96% rename from src/api/buildPayTransaction.test.ts rename to src/core/api/buildPayTransaction.test.ts index 066b558435..cb45205bd0 100644 --- a/src/api/buildPayTransaction.test.ts +++ b/src/core/api/buildPayTransaction.test.ts @@ -3,12 +3,12 @@ import type { Mock } from 'vitest'; import { CHECKOUT_INVALID_CHARGE_ERROR_MESSAGE, UNCAUGHT_CHECKOUT_ERROR_MESSAGE, -} from '../checkout/constants'; +} from '../../checkout/constants'; import { CDP_CREATE_PRODUCT_CHARGE, CDP_HYDRATE_CHARGE, -} from '../network/definitions/pay'; -import { sendRequest } from '../network/request'; +} from '../../network/definitions/pay'; +import { sendRequest } from '../../network/request'; /** * @vitest-environment node */ @@ -28,7 +28,7 @@ import type { HydrateChargeAPIParams, } from './types'; -vi.mock('../network/request'); +vi.mock('../../network/request'); describe('buildPayTransaction', () => { afterEach(() => { diff --git a/src/api/buildPayTransaction.ts b/src/core/api/buildPayTransaction.ts similarity index 93% rename from src/api/buildPayTransaction.ts rename to src/core/api/buildPayTransaction.ts index 1111ba6de3..a5aade3d91 100644 --- a/src/api/buildPayTransaction.ts +++ b/src/core/api/buildPayTransaction.ts @@ -1,8 +1,8 @@ import { CDP_CREATE_PRODUCT_CHARGE, CDP_HYDRATE_CHARGE, -} from '../network/definitions/pay'; -import { type JSONRPCResult, sendRequest } from '../network/request'; +} from '../../network/definitions/pay'; +import { type JSONRPCResult, sendRequest } from '../../network/request'; import type { BuildPayTransactionParams, BuildPayTransactionResponse, diff --git a/src/api/buildSwapTransaction.test.ts b/src/core/api/buildSwapTransaction.test.ts similarity index 97% rename from src/api/buildSwapTransaction.test.ts rename to src/core/api/buildSwapTransaction.test.ts index 61388b5629..3f115b2be3 100644 --- a/src/api/buildSwapTransaction.test.ts +++ b/src/core/api/buildSwapTransaction.test.ts @@ -1,16 +1,16 @@ import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest'; -import { CDP_GET_SWAP_TRADE } from '../network/definitions/swap'; -import { sendRequest } from '../network/request'; -import { DEGEN_TOKEN, ETH_TOKEN } from '../swap/mocks'; -import type { BuildSwapTransaction } from '../swap/types'; +import { CDP_GET_SWAP_TRADE } from '../../network/definitions/swap'; +import { sendRequest } from '../../network/request'; +import { DEGEN_TOKEN, ETH_TOKEN } from '../../swap/mocks'; import { buildSwapTransaction } from './buildSwapTransaction'; +import type { BuildSwapTransaction } from './types'; /** * @vitest-environment node */ import { getAPIParamsForToken } from './utils/getAPIParamsForToken'; import { getSwapTransaction } from './utils/getSwapTransaction'; -vi.mock('../network/request'); +vi.mock('../../network/request'); const testFromAddress = '0x6Cd01c0F55ce9E0Bf78f5E90f72b4345b16d515d'; const testAmount = '3305894409732200'; diff --git a/src/api/buildSwapTransaction.ts b/src/core/api/buildSwapTransaction.ts similarity index 89% rename from src/api/buildSwapTransaction.ts rename to src/core/api/buildSwapTransaction.ts index e7e33ac9ad..01f60311e2 100644 --- a/src/api/buildSwapTransaction.ts +++ b/src/core/api/buildSwapTransaction.ts @@ -1,7 +1,7 @@ -import { CDP_GET_SWAP_TRADE } from '../network/definitions/swap'; -import { sendRequest } from '../network/request'; -import type { SwapAPIResponse } from '../swap/types'; -import { getSwapErrorCode } from '../swap/utils/getSwapErrorCode'; +import { CDP_GET_SWAP_TRADE } from '../../network/definitions/swap'; +import { sendRequest } from '../../network/request'; +import type { SwapAPIResponse } from '../../swap/types'; +import { getSwapErrorCode } from '../../swap/utils/getSwapErrorCode'; import type { APIError, BuildSwapTransactionParams, diff --git a/src/api/getMintDetails.test.ts b/src/core/api/getMintDetails.test.ts similarity index 92% rename from src/api/getMintDetails.test.ts rename to src/core/api/getMintDetails.test.ts index 6e763b2e2b..69acb91392 100644 --- a/src/api/getMintDetails.test.ts +++ b/src/core/api/getMintDetails.test.ts @@ -1,10 +1,10 @@ import { type Mock, describe, expect, it, vi } from 'vitest'; -import { CDP_GET_MINT_DETAILS } from '../network/definitions/nft'; -import { sendRequest } from '../network/request'; +import { CDP_GET_MINT_DETAILS } from '../../network/definitions/nft'; +import { sendRequest } from '../../network/request'; import { getMintDetails } from './getMintDetails'; import type { GetMintDetailsParams } from './types'; -vi.mock('../network/request', () => ({ +vi.mock('../../network/request', () => ({ sendRequest: vi.fn(), })); diff --git a/src/api/getMintDetails.ts b/src/core/api/getMintDetails.ts similarity index 87% rename from src/api/getMintDetails.ts rename to src/core/api/getMintDetails.ts index b382eeef51..9e651bfe33 100644 --- a/src/api/getMintDetails.ts +++ b/src/core/api/getMintDetails.ts @@ -1,5 +1,5 @@ -import { CDP_GET_MINT_DETAILS } from '../network/definitions/nft'; -import { sendRequest } from '../network/request'; +import { CDP_GET_MINT_DETAILS } from '../../network/definitions/nft'; +import { sendRequest } from '../../network/request'; import type { GetMintDetailsParams, GetMintDetailsResponse } from './types'; /** diff --git a/src/api/getSwapQuote.test.ts b/src/core/api/getSwapQuote.test.ts similarity index 96% rename from src/api/getSwapQuote.test.ts rename to src/core/api/getSwapQuote.test.ts index 07281d4789..be2dfbf218 100644 --- a/src/api/getSwapQuote.test.ts +++ b/src/core/api/getSwapQuote.test.ts @@ -1,14 +1,14 @@ import { type Mock, afterEach, describe, expect, it, vi } from 'vitest'; -import { CDP_GET_SWAP_QUOTE } from '../network/definitions/swap'; -import { sendRequest } from '../network/request'; -import { DEGEN_TOKEN, ETH_TOKEN } from '../swap/mocks'; +import { CDP_GET_SWAP_QUOTE } from '../../network/definitions/swap'; +import { sendRequest } from '../../network/request'; +import { DEGEN_TOKEN, ETH_TOKEN } from '../../swap/mocks'; /** * @vitest-environment node */ import { getSwapQuote } from './getSwapQuote'; import { getAPIParamsForToken } from './utils/getAPIParamsForToken'; -vi.mock('../network/request'); +vi.mock('../../network/request'); const testAmount = '3305894409732200'; const testAmountReference = 'from'; diff --git a/src/api/getSwapQuote.ts b/src/core/api/getSwapQuote.ts similarity index 87% rename from src/api/getSwapQuote.ts rename to src/core/api/getSwapQuote.ts index 98c6b5a06b..38d2d5d0b6 100644 --- a/src/api/getSwapQuote.ts +++ b/src/core/api/getSwapQuote.ts @@ -1,7 +1,7 @@ -import { CDP_GET_SWAP_QUOTE } from '../network/definitions/swap'; -import { sendRequest } from '../network/request'; -import type { SwapQuote } from '../swap/types'; -import { getSwapErrorCode } from '../swap/utils/getSwapErrorCode'; +import { CDP_GET_SWAP_QUOTE } from '../../network/definitions/swap'; +import { sendRequest } from '../../network/request'; +import type { SwapQuote } from '../../swap/types'; +import { getSwapErrorCode } from '../../swap/utils/getSwapErrorCode'; import type { APIError, GetSwapQuoteParams, diff --git a/src/api/getTokenDetails.test.ts b/src/core/api/getTokenDetails.test.ts similarity index 92% rename from src/api/getTokenDetails.test.ts rename to src/core/api/getTokenDetails.test.ts index 5036bf5162..efb171dfa8 100644 --- a/src/api/getTokenDetails.test.ts +++ b/src/core/api/getTokenDetails.test.ts @@ -1,10 +1,10 @@ import { type Mock, describe, expect, it, vi } from 'vitest'; -import { CDP_GET_TOKEN_DETAILS } from '../network/definitions/nft'; -import { sendRequest } from '../network/request'; +import { CDP_GET_TOKEN_DETAILS } from '../../network/definitions/nft'; +import { sendRequest } from '../../network/request'; import { getTokenDetails } from './getTokenDetails'; import type { GetTokenDetailsParams } from './types'; -vi.mock('../network/request', () => ({ +vi.mock('../../network/request', () => ({ sendRequest: vi.fn(), })); diff --git a/src/api/getTokenDetails.ts b/src/core/api/getTokenDetails.ts similarity index 87% rename from src/api/getTokenDetails.ts rename to src/core/api/getTokenDetails.ts index 06bd446177..c1a0af3d73 100644 --- a/src/api/getTokenDetails.ts +++ b/src/core/api/getTokenDetails.ts @@ -1,5 +1,5 @@ -import { CDP_GET_TOKEN_DETAILS } from '../network/definitions/nft'; -import { sendRequest } from '../network/request'; +import { CDP_GET_TOKEN_DETAILS } from '../../network/definitions/nft'; +import { sendRequest } from '../../network/request'; import type { GetTokenDetailsParams, GetTokenDetailsResponse } from './types'; /** diff --git a/src/api/getTokens.test.ts b/src/core/api/getTokens.test.ts similarity index 95% rename from src/api/getTokens.test.ts rename to src/core/api/getTokens.test.ts index ebb3d56bac..a1cfc4938a 100644 --- a/src/api/getTokens.test.ts +++ b/src/core/api/getTokens.test.ts @@ -1,12 +1,12 @@ import { type Mock, afterEach, describe, expect, it, vi } from 'vitest'; -import { CDP_LIST_SWAP_ASSETS } from '../network/definitions/swap'; -import { sendRequest } from '../network/request'; +import { CDP_LIST_SWAP_ASSETS } from '../../network/definitions/swap'; +import { sendRequest } from '../../network/request'; /** * @vitest-environment node */ import { getTokens } from './getTokens'; -vi.mock('../network/request'); +vi.mock('../../network/request'); describe('getTokens', () => { afterEach(() => { diff --git a/src/api/getTokens.ts b/src/core/api/getTokens.ts similarity index 83% rename from src/api/getTokens.ts rename to src/core/api/getTokens.ts index db0f5c0c36..37c3fd5c98 100644 --- a/src/api/getTokens.ts +++ b/src/core/api/getTokens.ts @@ -1,6 +1,6 @@ -import { CDP_LIST_SWAP_ASSETS } from '../network/definitions/swap'; -import { sendRequest } from '../network/request'; -import type { Token } from '../token/types'; +import { CDP_LIST_SWAP_ASSETS } from '../../network/definitions/swap'; +import { sendRequest } from '../../network/request'; +import type { Token } from '../../token/types'; import type { GetTokensOptions, GetTokensResponse } from './types'; /** diff --git a/src/api/index.ts b/src/core/api/index.ts similarity index 100% rename from src/api/index.ts rename to src/core/api/index.ts diff --git a/src/api/mocks.ts b/src/core/api/mocks.ts similarity index 100% rename from src/api/mocks.ts rename to src/core/api/mocks.ts diff --git a/src/api/types.ts b/src/core/api/types.ts similarity index 97% rename from src/api/types.ts rename to src/core/api/types.ts index 5bf4839d3d..59277133dc 100644 --- a/src/api/types.ts +++ b/src/core/api/types.ts @@ -1,7 +1,12 @@ import type { Address } from 'viem'; -import type { ContractType, NFTPrice } from '../nft/types'; -import type { Fee, QuoteWarning, SwapQuote, Transaction } from '../swap/types'; -import type { Token } from '../token/types'; +import type { ContractType, NFTPrice } from '../../nft/types'; +import type { + Fee, + QuoteWarning, + SwapQuote, + Transaction, +} from '../../swap/types'; +import type { Token } from '../../token/types'; export type AddressOrETH = Address | 'ETH'; diff --git a/src/api/utils/getAPIParamsForToken.test.ts b/src/core/api/utils/getAPIParamsForToken.test.ts similarity index 98% rename from src/api/utils/getAPIParamsForToken.test.ts rename to src/core/api/utils/getAPIParamsForToken.test.ts index 05fb0258f6..4af9b7fb24 100644 --- a/src/api/utils/getAPIParamsForToken.test.ts +++ b/src/core/api/utils/getAPIParamsForToken.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'; /** * @vitest-environment node */ -import { DEGEN_TOKEN, ETH_TOKEN } from '../../swap/mocks'; +import { DEGEN_TOKEN, ETH_TOKEN } from '../../../swap/mocks'; import { getAPIParamsForToken } from './getAPIParamsForToken'; describe('getAPIParamsForToken', () => { diff --git a/src/api/utils/getAPIParamsForToken.ts b/src/core/api/utils/getAPIParamsForToken.ts similarity index 95% rename from src/api/utils/getAPIParamsForToken.ts rename to src/core/api/utils/getAPIParamsForToken.ts index d21996a377..1a202fffa9 100644 --- a/src/api/utils/getAPIParamsForToken.ts +++ b/src/core/api/utils/getAPIParamsForToken.ts @@ -1,4 +1,4 @@ -import { formatDecimals } from '../../swap/utils/formatDecimals'; +import { formatDecimals } from '../../../swap/utils/formatDecimals'; import type { APIError, BuildSwapTransactionParams, diff --git a/src/api/utils/getPayErrorMessage.test.ts b/src/core/api/utils/getPayErrorMessage.test.ts similarity index 97% rename from src/api/utils/getPayErrorMessage.test.ts rename to src/core/api/utils/getPayErrorMessage.test.ts index b79482783c..3fb390dea6 100644 --- a/src/api/utils/getPayErrorMessage.test.ts +++ b/src/core/api/utils/getPayErrorMessage.test.ts @@ -5,7 +5,7 @@ import { CHECKOUT_TOO_MANY_REQUESTS_ERROR_MESSAGE, GENERAL_CHECKOUT_ERROR_MESSAGE, UNCAUGHT_CHECKOUT_ERROR_MESSAGE, -} from '../../checkout/constants'; +} from '../../../checkout/constants'; import { getPayErrorMessage } from './getPayErrorMessage'; describe('getPayErrorMessage', () => { diff --git a/src/api/utils/getPayErrorMessage.ts b/src/core/api/utils/getPayErrorMessage.ts similarity index 94% rename from src/api/utils/getPayErrorMessage.ts rename to src/core/api/utils/getPayErrorMessage.ts index 65de9b1895..2da3619db3 100644 --- a/src/api/utils/getPayErrorMessage.ts +++ b/src/core/api/utils/getPayErrorMessage.ts @@ -4,7 +4,7 @@ import { CHECKOUT_TOO_MANY_REQUESTS_ERROR_MESSAGE, GENERAL_CHECKOUT_ERROR_MESSAGE, UNCAUGHT_CHECKOUT_ERROR_MESSAGE, -} from '../../checkout/constants'; +} from '../../../checkout/constants'; export function getPayErrorMessage(errorCode?: number) { if (!errorCode) { diff --git a/src/api/utils/getSwapTransaction.test.ts b/src/core/api/utils/getSwapTransaction.test.ts similarity index 100% rename from src/api/utils/getSwapTransaction.test.ts rename to src/core/api/utils/getSwapTransaction.test.ts diff --git a/src/api/utils/getSwapTransaction.ts b/src/core/api/utils/getSwapTransaction.ts similarity index 92% rename from src/api/utils/getSwapTransaction.ts rename to src/core/api/utils/getSwapTransaction.ts index dcf5630f79..a3781ff1d6 100644 --- a/src/api/utils/getSwapTransaction.ts +++ b/src/core/api/utils/getSwapTransaction.ts @@ -1,5 +1,5 @@ import type { Address, Hex } from 'viem'; -import type { Transaction } from '../../swap/types'; +import type { Transaction } from '../../../swap/types'; import type { RawTransactionData } from '../types'; /** diff --git a/src/nft/hooks/useMintDetails.test.ts b/src/nft/hooks/useMintDetails.test.ts index e80b63a0a1..1497a6f228 100644 --- a/src/nft/hooks/useMintDetails.test.ts +++ b/src/nft/hooks/useMintDetails.test.ts @@ -1,10 +1,10 @@ import { renderHook, waitFor } from '@testing-library/react'; import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest'; -import { getMintDetails } from '../../api/getMintDetails'; +import { getMintDetails } from '../../core/api/getMintDetails'; import { getNewReactQueryTestProvider } from '../../identity/hooks/getNewReactQueryTestProvider'; import { useMintDetails } from './useMintDetails'; -vi.mock('../../api/getMintDetails'); +vi.mock('../../core/api/getMintDetails'); describe('useMintDetails', () => { beforeEach(() => { diff --git a/src/nft/hooks/useMintDetails.ts b/src/nft/hooks/useMintDetails.ts index 85ba07e9f4..9bbc48f594 100644 --- a/src/nft/hooks/useMintDetails.ts +++ b/src/nft/hooks/useMintDetails.ts @@ -1,6 +1,6 @@ import { type UseQueryResult, useQuery } from '@tanstack/react-query'; -import { getMintDetails } from '../../api/getMintDetails'; -import type { GetMintDetailsParams, MintDetails } from '../../api/types'; +import { getMintDetails } from '../../core/api/getMintDetails'; +import type { GetMintDetailsParams, MintDetails } from '../../core/api/types'; import { isNFTError } from '../utils/isNFTError'; export function useMintDetails({ diff --git a/src/nft/hooks/useTokenDetails.test.ts b/src/nft/hooks/useTokenDetails.test.ts index c231880d8f..d5c93d8204 100644 --- a/src/nft/hooks/useTokenDetails.test.ts +++ b/src/nft/hooks/useTokenDetails.test.ts @@ -1,10 +1,10 @@ import { renderHook, waitFor } from '@testing-library/react'; import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest'; -import { getTokenDetails } from '../../api/getTokenDetails'; +import { getTokenDetails } from '../../core/api/getTokenDetails'; import { getNewReactQueryTestProvider } from '../../identity/hooks/getNewReactQueryTestProvider'; import { useTokenDetails } from './useTokenDetails'; -vi.mock('../../api/getTokenDetails'); +vi.mock('../../core/api/getTokenDetails'); describe('useTokenDetails', () => { beforeEach(() => { diff --git a/src/nft/hooks/useTokenDetails.ts b/src/nft/hooks/useTokenDetails.ts index c309e69a0d..383ad10c8c 100644 --- a/src/nft/hooks/useTokenDetails.ts +++ b/src/nft/hooks/useTokenDetails.ts @@ -1,6 +1,6 @@ import { type UseQueryResult, useQuery } from '@tanstack/react-query'; -import { getTokenDetails } from '../../api/getTokenDetails'; -import type { GetTokenDetailsParams, TokenDetails } from '../../api/types'; +import { getTokenDetails } from '../../core/api/getTokenDetails'; +import type { GetTokenDetailsParams, TokenDetails } from '../../core/api/types'; import { isNFTError } from '../utils/isNFTError'; export function useTokenDetails({ diff --git a/src/nft/utils/buildMintTransactionData.test.ts b/src/nft/utils/buildMintTransactionData.test.ts index 662220f841..0917712945 100644 --- a/src/nft/utils/buildMintTransactionData.test.ts +++ b/src/nft/utils/buildMintTransactionData.test.ts @@ -1,9 +1,9 @@ import type { Address } from 'viem'; import { type Mock, describe, expect, it, vi } from 'vitest'; -import { buildMintTransaction as buildMintTransationApi } from '../../api/buildMintTransaction'; +import { buildMintTransaction as buildMintTransationApi } from '../../core/api/buildMintTransaction'; import { buildMintTransactionData } from './buildMintTransactionData'; -vi.mock('../../api/buildMintTransaction'); +vi.mock('../../core/api/buildMintTransaction'); describe('buildMintTransactionData', () => { const mockBuildMintTransaction = buildMintTransationApi as Mock; diff --git a/src/nft/utils/buildMintTransactionData.ts b/src/nft/utils/buildMintTransactionData.ts index 9b3b8f1b03..20409d42a0 100644 --- a/src/nft/utils/buildMintTransactionData.ts +++ b/src/nft/utils/buildMintTransactionData.ts @@ -1,6 +1,6 @@ import type { Address } from 'viem'; -import { buildMintTransaction as buildMintTransactionApi } from '../../api/buildMintTransaction'; -import type { BuildMintTransactionParams } from '../../api/types'; +import { buildMintTransaction as buildMintTransactionApi } from '../../core/api/buildMintTransaction'; +import type { BuildMintTransactionParams } from '../../core/api/types'; import type { Call } from '../../transaction/types'; async function getMintTransaction({ diff --git a/src/swap/components/SwapProvider.test.tsx b/src/swap/components/SwapProvider.test.tsx index e76e821510..c08cc97e6b 100644 --- a/src/swap/components/SwapProvider.test.tsx +++ b/src/swap/components/SwapProvider.test.tsx @@ -20,8 +20,8 @@ import { waitForTransactionReceipt } from 'wagmi/actions'; import { base } from 'wagmi/chains'; import { mock } from 'wagmi/connectors'; import { useSendCalls } from 'wagmi/experimental'; -import { buildSwapTransaction } from '../../api/buildSwapTransaction'; -import { getSwapQuote } from '../../api/getSwapQuote'; +import { buildSwapTransaction } from '../../core/api/buildSwapTransaction'; +import { getSwapQuote } from '../../core/api/getSwapQuote'; import { useCapabilitiesSafe } from '../../internal/hooks/useCapabilitiesSafe'; import { DEGEN_TOKEN, ETH_TOKEN } from '../mocks'; import { getSwapErrorCode } from '../utils/getSwapErrorCode'; @@ -32,11 +32,11 @@ vi.mock('../hooks/useResetInputs', () => ({ useResetInputs: () => useCallback(mockResetFunction, []), })); -vi.mock('../../api/getSwapQuote', () => ({ +vi.mock('../../core/api/getSwapQuote', () => ({ getSwapQuote: vi.fn(), })); -vi.mock('../../api/buildSwapTransaction', () => ({ +vi.mock('../../core/api/buildSwapTransaction', () => ({ buildSwapTransaction: vi .fn() .mockRejectedValue(new Error('buildSwapTransaction')), diff --git a/src/swap/components/SwapProvider.tsx b/src/swap/components/SwapProvider.tsx index 078e6118a6..4f3c057bd9 100644 --- a/src/swap/components/SwapProvider.tsx +++ b/src/swap/components/SwapProvider.tsx @@ -9,8 +9,8 @@ import { base } from 'viem/chains'; import { useAccount, useConfig, useSendTransaction } from 'wagmi'; import { useSwitchChain } from 'wagmi'; import { useSendCalls } from 'wagmi/experimental'; -import { buildSwapTransaction } from '../../api/buildSwapTransaction'; -import { getSwapQuote } from '../../api/getSwapQuote'; +import { buildSwapTransaction } from '../../core/api/buildSwapTransaction'; +import { getSwapQuote } from '../../core/api/getSwapQuote'; import { useCapabilitiesSafe } from '../../internal/hooks/useCapabilitiesSafe'; import { useValue } from '../../internal/hooks/useValue'; import { formatTokenAmount } from '../../internal/utils/formatTokenAmount'; diff --git a/src/swap/index.ts b/src/swap/index.ts index 56f645247b..984438fa9d 100644 --- a/src/swap/index.ts +++ b/src/swap/index.ts @@ -15,7 +15,7 @@ export type { BuildSwapTransaction, /** @deprecated Prefer import from `api` module */ BuildSwapTransactionResponse, -} from '../api/types'; +} from '../core/api/types'; export type { Fee, LifecycleStatus, diff --git a/src/swap/types.ts b/src/swap/types.ts index f3254d4ab8..de617e9994 100644 --- a/src/swap/types.ts +++ b/src/swap/types.ts @@ -14,7 +14,10 @@ import type { SendTransactionMutateAsync, SwitchChainMutateAsync, } from 'wagmi/query'; -import type { BuildSwapTransaction, RawTransactionData } from '../api/types'; +import type { + BuildSwapTransaction, + RawTransactionData, +} from '../core/api/types'; import type { Token } from '../token/types'; import type { Call } from '../transaction/types'; diff --git a/src/token/components/TokenSearch.stories.tsx b/src/token/components/TokenSearch.stories.tsx index 10742c9ddf..92207f55e1 100644 --- a/src/token/components/TokenSearch.stories.tsx +++ b/src/token/components/TokenSearch.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { expect, fn, userEvent, within } from '@storybook/test'; import React from 'react'; -import { getTokens } from '../../api/getTokens'; +import { getTokens } from '../../core/api/getTokens'; import { TokenSearch } from './TokenSearch'; const meta = {