diff --git a/src/api/buildPayTransaction.test.ts b/src/api/buildPayTransaction.test.ts index 8df0e70625..964f59a59d 100644 --- a/src/api/buildPayTransaction.test.ts +++ b/src/api/buildPayTransaction.test.ts @@ -3,7 +3,7 @@ import type { Mock } from 'vitest'; import { CDP_CREATE_PRODUCT_CHARGE, CDP_HYDRATE_CHARGE, -} from '../network/constants'; +} from '../network/definitions/pay'; import { sendRequest } from '../network/request'; import { PAY_INVALID_CHARGE_ERROR_MESSAGE, diff --git a/src/api/buildPayTransaction.ts b/src/api/buildPayTransaction.ts index 5bd7da86f7..1111ba6de3 100644 --- a/src/api/buildPayTransaction.ts +++ b/src/api/buildPayTransaction.ts @@ -1,7 +1,7 @@ import { CDP_CREATE_PRODUCT_CHARGE, CDP_HYDRATE_CHARGE, -} from '../network/constants'; +} from '../network/definitions/pay'; import { type JSONRPCResult, sendRequest } from '../network/request'; import type { BuildPayTransactionParams, diff --git a/src/api/buildSwapTransaction.test.ts b/src/api/buildSwapTransaction.test.ts index dda3ec8bfe..61388b5629 100644 --- a/src/api/buildSwapTransaction.test.ts +++ b/src/api/buildSwapTransaction.test.ts @@ -1,5 +1,5 @@ import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest'; -import { CDP_GET_SWAP_TRADE } from '../network/constants'; +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'; diff --git a/src/api/buildSwapTransaction.ts b/src/api/buildSwapTransaction.ts index 54ed57db22..e7e33ac9ad 100644 --- a/src/api/buildSwapTransaction.ts +++ b/src/api/buildSwapTransaction.ts @@ -1,4 +1,4 @@ -import { CDP_GET_SWAP_TRADE } from '../network/constants'; +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'; diff --git a/src/network/constants.ts b/src/network/constants.ts index a992351633..78deb5b7a9 100644 --- a/src/network/constants.ts +++ b/src/network/constants.ts @@ -1,11 +1,5 @@ import { version } from '../version'; -export const CDP_LIST_SWAP_ASSETS = 'cdp_listSwapAssets'; -export const CDP_GET_SWAP_QUOTE = 'cdp_getSwapQuote'; -export const CDP_GET_SWAP_TRADE = 'cdp_getSwapTrade'; -export const CDP_HYDRATE_CHARGE = 'cdp_hydrateCharge'; -export const CDP_CREATE_PRODUCT_CHARGE = 'cdp_createProductCharge'; - export const POST_METHOD = 'POST'; export const JSON_HEADERS = { 'Content-Type': 'application/json', diff --git a/src/network/definitions/pay.ts b/src/network/definitions/pay.ts new file mode 100644 index 0000000000..1aa979f08c --- /dev/null +++ b/src/network/definitions/pay.ts @@ -0,0 +1,2 @@ +export const CDP_HYDRATE_CHARGE = 'cdp_hydrateCharge'; +export const CDP_CREATE_PRODUCT_CHARGE = 'cdp_createProductCharge'; diff --git a/src/network/definitions/swap.ts b/src/network/definitions/swap.ts new file mode 100644 index 0000000000..c9a9edda5c --- /dev/null +++ b/src/network/definitions/swap.ts @@ -0,0 +1,3 @@ +export const CDP_LIST_SWAP_ASSETS = 'cdp_listSwapAssets'; +export const CDP_GET_SWAP_QUOTE = 'cdp_getSwapQuote'; +export const CDP_GET_SWAP_TRADE = 'cdp_getSwapTrade';