Skip to content

Commit

Permalink
refactor(frontend): move ERC20 tokens files to specific folder (#3764)
Browse files Browse the repository at this point in the history
# Motivation

Moving the ERC20 data files to specific folder `env/tokens`
  • Loading branch information
AntonioVentilii authored Nov 26, 2024
1 parent aab1e0f commit 93b47ba
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion scripts/add.tokens.erc20.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (isNullish(ETHERSCAN_API_KEY)) {
process.exit(1);
}

const DATA_DIR = 'src/frontend/src/env';
const DATA_DIR = 'src/frontend/src/env/tokens';
const DATA_DIR_PATH = resolve(process.cwd(), DATA_DIR);

const ERC20_DATA_DIR = `${DATA_DIR}/tokens-erc20`;
Expand Down
22 changes: 11 additions & 11 deletions src/frontend/src/env/networks.icrc.env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import {
CKETH_EXPLORER_URL,
CKETH_SEPOLIA_EXPLORER_URL
} from '$env/explorers.env';
import { EURC_TOKEN } from '$env/tokens-erc20/tokens.eurc.env';
import { LINK_TOKEN, SEPOLIA_LINK_TOKEN } from '$env/tokens-erc20/tokens.link.env';
import { OCT_TOKEN } from '$env/tokens-erc20/tokens.oct.env';
import { PEPE_TOKEN, SEPOLIA_PEPE_TOKEN } from '$env/tokens-erc20/tokens.pepe.env';
import { SHIB_TOKEN } from '$env/tokens-erc20/tokens.shib.env';
import { UNI_TOKEN } from '$env/tokens-erc20/tokens.uni.env';
import { SEPOLIA_USDC_TOKEN, USDC_TOKEN } from '$env/tokens-erc20/tokens.usdc.env';
import { USDT_TOKEN } from '$env/tokens-erc20/tokens.usdt.env';
import { WBTC_TOKEN } from '$env/tokens-erc20/tokens.wbtc.env';
import { WSTETH_TOKEN } from '$env/tokens-erc20/tokens.wsteth.env';
import { XAUT_TOKEN } from '$env/tokens-erc20/tokens.xaut.env';
import { EURC_TOKEN } from '$env/tokens/tokens-erc20/tokens.eurc.env';
import { LINK_TOKEN, SEPOLIA_LINK_TOKEN } from '$env/tokens/tokens-erc20/tokens.link.env';
import { OCT_TOKEN } from '$env/tokens/tokens-erc20/tokens.oct.env';
import { PEPE_TOKEN, SEPOLIA_PEPE_TOKEN } from '$env/tokens/tokens-erc20/tokens.pepe.env';
import { SHIB_TOKEN } from '$env/tokens/tokens-erc20/tokens.shib.env';
import { UNI_TOKEN } from '$env/tokens/tokens-erc20/tokens.uni.env';
import { SEPOLIA_USDC_TOKEN, USDC_TOKEN } from '$env/tokens/tokens-erc20/tokens.usdc.env';
import { USDT_TOKEN } from '$env/tokens/tokens-erc20/tokens.usdt.env';
import { WBTC_TOKEN } from '$env/tokens/tokens-erc20/tokens.wbtc.env';
import { WSTETH_TOKEN } from '$env/tokens/tokens-erc20/tokens.wsteth.env';
import { XAUT_TOKEN } from '$env/tokens/tokens-erc20/tokens.xaut.env';
import { BTC_MAINNET_TOKEN, BTC_TESTNET_TOKEN } from '$env/tokens/tokens.btc.env';
import { ckErc20Production, ckErc20Staging } from '$env/tokens/tokens.ckerc20.env';
import { ETHEREUM_TOKEN, SEPOLIA_TOKEN } from '$env/tokens/tokens.eth.env';
Expand Down
22 changes: 11 additions & 11 deletions src/frontend/src/env/tokens/tokens.erc20.env.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { ETHEREUM_NETWORK, SEPOLIA_NETWORK } from '$env/networks.env';
import { ETH_MAINNET_ENABLED } from '$env/networks.eth.env';
import { EURC_TOKEN } from '$env/tokens-erc20/tokens.eurc.env';
import { LINK_TOKEN, SEPOLIA_LINK_TOKEN } from '$env/tokens-erc20/tokens.link.env';
import { OCT_TOKEN } from '$env/tokens-erc20/tokens.oct.env';
import { PEPE_TOKEN, SEPOLIA_PEPE_TOKEN } from '$env/tokens-erc20/tokens.pepe.env';
import { SHIB_TOKEN } from '$env/tokens-erc20/tokens.shib.env';
import { UNI_TOKEN } from '$env/tokens-erc20/tokens.uni.env';
import { SEPOLIA_USDC_TOKEN, USDC_TOKEN } from '$env/tokens-erc20/tokens.usdc.env';
import { USDT_TOKEN } from '$env/tokens-erc20/tokens.usdt.env';
import { WBTC_TOKEN } from '$env/tokens-erc20/tokens.wbtc.env';
import { WSTETH_TOKEN } from '$env/tokens-erc20/tokens.wsteth.env';
import { XAUT_TOKEN } from '$env/tokens-erc20/tokens.xaut.env';
import { EURC_TOKEN } from '$env/tokens/tokens-erc20/tokens.eurc.env';
import { LINK_TOKEN, SEPOLIA_LINK_TOKEN } from '$env/tokens/tokens-erc20/tokens.link.env';
import { OCT_TOKEN } from '$env/tokens/tokens-erc20/tokens.oct.env';
import { PEPE_TOKEN, SEPOLIA_PEPE_TOKEN } from '$env/tokens/tokens-erc20/tokens.pepe.env';
import { SHIB_TOKEN } from '$env/tokens/tokens-erc20/tokens.shib.env';
import { UNI_TOKEN } from '$env/tokens/tokens-erc20/tokens.uni.env';
import { SEPOLIA_USDC_TOKEN, USDC_TOKEN } from '$env/tokens/tokens-erc20/tokens.usdc.env';
import { USDT_TOKEN } from '$env/tokens/tokens-erc20/tokens.usdt.env';
import { WBTC_TOKEN } from '$env/tokens/tokens-erc20/tokens.wbtc.env';
import { WSTETH_TOKEN } from '$env/tokens/tokens-erc20/tokens.wsteth.env';
import { XAUT_TOKEN } from '$env/tokens/tokens-erc20/tokens.xaut.env';
import type { Erc20Contract, RequiredErc20Token } from '$eth/types/erc20';
import type { EthereumNetwork } from '$eth/types/network';
import { mapAddressStartsWith0x } from '$icp-eth/utils/eth.utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SEPOLIA_NETWORK_ID } from '$env/networks.env';
import { SEPOLIA_PEPE_TOKEN } from '$env/tokens-erc20/tokens.pepe.env';
import { SEPOLIA_PEPE_TOKEN } from '$env/tokens/tokens-erc20/tokens.pepe.env';
import { SEPOLIA_TOKEN, SEPOLIA_TOKEN_ID } from '$env/tokens/tokens.eth.env';
import { ICP_TOKEN } from '$env/tokens/tokens.icp.env';
import LoaderEthTransactions from '$eth/components/loaders/LoaderEthTransactions.svelte';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ETHERSCAN_MAX_CALLS_PER_SECOND } from '$env/rest/etherscan.env';
import { USDC_TOKEN } from '$env/tokens-erc20/tokens.usdc.env';
import { USDC_TOKEN } from '$env/tokens/tokens-erc20/tokens.usdc.env';
import { ETHEREUM_TOKEN, SEPOLIA_TOKEN } from '$env/tokens/tokens.eth.env';
import {
batchLoadTransactions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ETHEREUM_NETWORK_ID } from '$env/networks.env';
import { LINK_TOKEN } from '$env/tokens-erc20/tokens.link.env';
import { PEPE_TOKEN } from '$env/tokens-erc20/tokens.pepe.env';
import { USDC_TOKEN } from '$env/tokens-erc20/tokens.usdc.env';
import { USDT_TOKEN_ID } from '$env/tokens-erc20/tokens.usdt.env';
import { LINK_TOKEN } from '$env/tokens/tokens-erc20/tokens.link.env';
import { PEPE_TOKEN } from '$env/tokens/tokens-erc20/tokens.pepe.env';
import { USDC_TOKEN } from '$env/tokens/tokens-erc20/tokens.usdc.env';
import { USDT_TOKEN_ID } from '$env/tokens/tokens-erc20/tokens.usdt.env';
import * as foo from '$eth/rest/etherscan.rest';
import { EtherscanRest } from '$eth/rest/etherscan.rest';
import { loadEthereumTransactions } from '$eth/services/eth-transactions.services';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
SEPOLIA_NETWORK
} from '$env/networks.env';
import * as ethEnv from '$env/networks.eth.env';
import { PEPE_TOKEN } from '$env/tokens-erc20/tokens.pepe.env';
import { PEPE_TOKEN } from '$env/tokens/tokens-erc20/tokens.pepe.env';
import { BTC_MAINNET_TOKEN } from '$env/tokens/tokens.btc.env';
import { ETHEREUM_TOKEN, SEPOLIA_TOKEN } from '$env/tokens/tokens.eth.env';
import { ICP_TOKEN } from '$env/tokens/tokens.icp.env';
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/tests/lib/utils/token-toggle.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EURC_TOKEN } from '$env/tokens-erc20/tokens.eurc.env';
import { WBTC_TOKEN } from '$env/tokens-erc20/tokens.wbtc.env';
import { EURC_TOKEN } from '$env/tokens/tokens-erc20/tokens.eurc.env';
import { WBTC_TOKEN } from '$env/tokens/tokens-erc20/tokens.wbtc.env';
import { ETHEREUM_TOKEN } from '$env/tokens/tokens.eth.env';
import { ICP_TOKEN } from '$env/tokens/tokens.icp.env';
import type { EthereumUserToken } from '$eth/types/erc20-user-token';
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/tests/lib/utils/token.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as NetworksModule from '$env/networks.icrc.env';
import { IC_CKBTC_LEDGER_CANISTER_ID, IC_CKETH_LEDGER_CANISTER_ID } from '$env/networks.icrc.env';
import { LINK_TOKEN } from '$env/tokens-erc20/tokens.link.env';
import { USDC_TOKEN } from '$env/tokens-erc20/tokens.usdc.env';
import { USDT_TOKEN } from '$env/tokens-erc20/tokens.usdt.env';
import { LINK_TOKEN } from '$env/tokens/tokens-erc20/tokens.link.env';
import { USDC_TOKEN } from '$env/tokens/tokens-erc20/tokens.usdc.env';
import { USDT_TOKEN } from '$env/tokens/tokens-erc20/tokens.usdt.env';
import { BTC_MAINNET_TOKEN } from '$env/tokens/tokens.btc.env';
import { ckErc20Production } from '$env/tokens/tokens.ckerc20.env';
import { ETHEREUM_TOKEN } from '$env/tokens/tokens.eth.env';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BtcTransaction from '$btc/components/transactions/BtcTransaction.svelte';
import type { BtcTransactionUi } from '$btc/types/btc';
import * as networkEnv from '$env/networks.env';
import { ETHEREUM_NETWORK_ID, SEPOLIA_NETWORK_ID } from '$env/networks.env';
import { PEPE_TOKEN, PEPE_TOKEN_ID } from '$env/tokens-erc20/tokens.pepe.env';
import { PEPE_TOKEN, PEPE_TOKEN_ID } from '$env/tokens/tokens-erc20/tokens.pepe.env';
import {
BTC_MAINNET_TOKEN,
BTC_MAINNET_TOKEN_ID,
Expand Down

0 comments on commit 93b47ba

Please sign in to comment.