Skip to content

Commit

Permalink
add to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAlec committed Oct 1, 2024
1 parent 6ba57af commit 59ef452
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/api/buildPayTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Mock } from 'vitest';
import {
CDP_CREATE_PRODUCT_CHARGE,
CDP_HYDRATE_CHARGE,
} from '../network/definitions/pay';
} from '../network/constants';
import { sendRequest } from '../network/request';
import {
PAY_INVALID_CHARGE_ERROR_MESSAGE,
Expand Down
2 changes: 1 addition & 1 deletion src/api/buildPayTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
CDP_CREATE_PRODUCT_CHARGE,
CDP_HYDRATE_CHARGE,
} from '../network/definitions/pay';
} from '../network/constants';
import { type JSONRPCResult, sendRequest } from '../network/request';
import type {
BuildPayTransactionParams,
Expand Down
2 changes: 1 addition & 1 deletion src/api/buildSwapTransaction.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Mock, beforeEach, describe, expect, it, vi } from 'vitest';
import { CDP_GET_SWAP_TRADE } from '../network/definitions/swap';
import { CDP_GET_SWAP_TRADE } from '../network/constants';
import { sendRequest } from '../network/request';
import { DEGEN_TOKEN, ETH_TOKEN } from '../swap/mocks';
import type { BuildSwapTransaction } from '../swap/types';
Expand Down
2 changes: 1 addition & 1 deletion src/api/buildSwapTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CDP_GET_SWAP_TRADE } from '../network/definitions/swap';
import { CDP_GET_SWAP_TRADE } from '../network/constants';
import { sendRequest } from '../network/request';
import type { SwapAPIResponse } from '../swap/types';
import { getSwapErrorCode } from '../swap/utils/getSwapErrorCode';
Expand Down
6 changes: 6 additions & 0 deletions src/network/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
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',
Expand Down
2 changes: 0 additions & 2 deletions src/network/definitions/pay.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/network/definitions/swap.ts

This file was deleted.

0 comments on commit 59ef452

Please sign in to comment.