From 629bdadabfdaaf79ad9cdfd461dcf167176f0b66 Mon Sep 17 00:00:00 2001 From: abtestingalpha Date: Thu, 3 Oct 2024 13:18:20 -0400 Subject: [PATCH] Renames synapse-constants to @synapsecns/synapse-constants --- docs/bridge/src/components/Routes.tsx | 2 +- docs/bridge/src/components/USDC.tsx | 2 +- packages/explorer-ui/components/misc/AssetImage.tsx | 2 +- packages/explorer-ui/components/misc/ChainImage.tsx | 2 +- packages/explorer-ui/components/misc/ChainInfo.tsx | 2 +- packages/explorer-ui/components/misc/MostActive.tsx | 2 +- packages/explorer-ui/components/misc/TokenOnChain.tsx | 2 +- packages/explorer-ui/components/misc/ToolTip.tsx | 2 +- .../components/pages/Home/UniversalSearch/index.tsx | 2 +- packages/explorer-ui/components/pages/Home/index.tsx | 2 +- packages/explorer-ui/pages/chain/[chainId].tsx | 2 +- packages/explorer-ui/pages/token/[tokenAddress].tsx | 2 +- packages/explorer-ui/pages/tx/[kappa].tsx | 9 ++++----- packages/explorer-ui/pages/txs/index.tsx | 2 +- packages/explorer-ui/utils/addressToDecimals.ts | 2 +- packages/explorer-ui/utils/addressToSymbol.ts | 2 +- packages/explorer-ui/utils/classes/Token.ts | 2 +- packages/explorer-ui/utils/styles/coins.ts | 2 +- packages/explorer-ui/utils/styles/networks.ts | 2 +- packages/explorer-ui/utils/urls/index.ts | 2 +- packages/synapse-constants/rollup.config.js | 2 +- 21 files changed, 24 insertions(+), 25 deletions(-) diff --git a/docs/bridge/src/components/Routes.tsx b/docs/bridge/src/components/Routes.tsx index 46d0cacdb0..02af8a2312 100644 --- a/docs/bridge/src/components/Routes.tsx +++ b/docs/bridge/src/components/Routes.tsx @@ -1,4 +1,4 @@ -import { BRIDGABLE_TOKENS, CHAINS } from 'synapse-constants' +import { BRIDGABLE_TOKENS, CHAINS } from '@synapsecns/synapse-constants' const CHAINS_BY_ID = {} diff --git a/docs/bridge/src/components/USDC.tsx b/docs/bridge/src/components/USDC.tsx index 671a85c162..1e4e7144b0 100644 --- a/docs/bridge/src/components/USDC.tsx +++ b/docs/bridge/src/components/USDC.tsx @@ -1,4 +1,4 @@ -import { USDC } from 'synapse-constants' +import { USDC } from '@synapsecns/synapse-constants' console.log(0, USDC) export const Test = () => { diff --git a/packages/explorer-ui/components/misc/AssetImage.tsx b/packages/explorer-ui/components/misc/AssetImage.tsx index 5206152f11..574b032bb5 100644 --- a/packages/explorer-ui/components/misc/AssetImage.tsx +++ b/packages/explorer-ui/components/misc/AssetImage.tsx @@ -1,5 +1,5 @@ import Image from 'next/image' -import { TOKEN_HASH_MAP, AVWETH, USDC } from 'synapse-constants' +import { TOKEN_HASH_MAP, AVWETH, USDC } from '@synapsecns/synapse-constants' import { getTokenAddressUrl } from '@urls' export const AssetImage = ({ tokenAddress, chainId, className }) => { diff --git a/packages/explorer-ui/components/misc/ChainImage.tsx b/packages/explorer-ui/components/misc/ChainImage.tsx index 70385a6ff0..b1298c0670 100644 --- a/packages/explorer-ui/components/misc/ChainImage.tsx +++ b/packages/explorer-ui/components/misc/ChainImage.tsx @@ -1,5 +1,5 @@ import Image from 'next/image' -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' import { QuestionMarkCircleIcon } from '@heroicons/react/outline' const CHAINS_BY_ID = CHAINS.CHAINS_BY_ID diff --git a/packages/explorer-ui/components/misc/ChainInfo.tsx b/packages/explorer-ui/components/misc/ChainInfo.tsx index 06a40e0980..c604a2dbc4 100644 --- a/packages/explorer-ui/components/misc/ChainInfo.tsx +++ b/packages/explorer-ui/components/misc/ChainInfo.tsx @@ -1,6 +1,6 @@ import Link from 'next/link' import Image from 'next/image' -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' import { QuestionMarkCircleIcon } from '@heroicons/react/outline' import { getChainUrl, getExplorerTxUrl } from '@urls' diff --git a/packages/explorer-ui/components/misc/MostActive.tsx b/packages/explorer-ui/components/misc/MostActive.tsx index 71f7bd911e..165a50daee 100644 --- a/packages/explorer-ui/components/misc/MostActive.tsx +++ b/packages/explorer-ui/components/misc/MostActive.tsx @@ -1,4 +1,4 @@ -import { TOKEN_HASH_MAP, CHAINS } from 'synapse-constants' +import { TOKEN_HASH_MAP, CHAINS } from '@synapsecns/synapse-constants' import { getCoinTextColor } from '@utils/styles/coins' import { getNetworkTextColor } from '@utils/styles/networks' import { Grid } from '@components/tailwind/Grid' diff --git a/packages/explorer-ui/components/misc/TokenOnChain.tsx b/packages/explorer-ui/components/misc/TokenOnChain.tsx index b93f56cb1a..481387e721 100644 --- a/packages/explorer-ui/components/misc/TokenOnChain.tsx +++ b/packages/explorer-ui/components/misc/TokenOnChain.tsx @@ -1,4 +1,4 @@ -import { TOKEN_HASH_MAP, CHAINS } from 'synapse-constants' +import { TOKEN_HASH_MAP, CHAINS } from '@synapsecns/synapse-constants' import { getCoinTextColor } from '@utils/styles/coins' import { getNetworkTextColor } from '@utils/styles/networks' import { getChainUrl } from '@urls' diff --git a/packages/explorer-ui/components/misc/ToolTip.tsx b/packages/explorer-ui/components/misc/ToolTip.tsx index cc93dbcbbc..bd597f034c 100644 --- a/packages/explorer-ui/components/misc/ToolTip.tsx +++ b/packages/explorer-ui/components/misc/ToolTip.tsx @@ -1,5 +1,5 @@ import ReactDOM from 'react-dom' -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' import { TableHeader } from '@components/TransactionTable/TableHeader' import { ChainInfo } from '@components/misc/ChainInfo' import { formatUSD } from '@utils/formatUSD' diff --git a/packages/explorer-ui/components/pages/Home/UniversalSearch/index.tsx b/packages/explorer-ui/components/pages/Home/UniversalSearch/index.tsx index aa763501c0..1950de223a 100644 --- a/packages/explorer-ui/components/pages/Home/UniversalSearch/index.tsx +++ b/packages/explorer-ui/components/pages/Home/UniversalSearch/index.tsx @@ -1,5 +1,5 @@ import { useState } from 'react' -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' import TextField from '@mui/material/TextField' import { inputStyle, diff --git a/packages/explorer-ui/components/pages/Home/index.tsx b/packages/explorer-ui/components/pages/Home/index.tsx index 681a58f6a9..935eee2862 100644 --- a/packages/explorer-ui/components/pages/Home/index.tsx +++ b/packages/explorer-ui/components/pages/Home/index.tsx @@ -8,7 +8,7 @@ import { StandardPageContainer } from '@components/layouts/StandardPageContainer import { BridgeTransactionTable } from '@components/BridgeTransaction/BridgeTransactionTable' import { useLazyQuery, useQuery } from '@apollo/client' import { SynapseLogoSvg } from '@components/layouts/MainLayout/SynapseLogoSvg' -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' import { GET_BRIDGE_TRANSACTIONS_QUERY, DAILY_STATISTICS_BY_CHAIN, diff --git a/packages/explorer-ui/pages/chain/[chainId].tsx b/packages/explorer-ui/pages/chain/[chainId].tsx index 46c537aea2..444ba72652 100644 --- a/packages/explorer-ui/pages/chain/[chainId].tsx +++ b/packages/explorer-ui/pages/chain/[chainId].tsx @@ -1,7 +1,7 @@ import _ from 'lodash' import { useState, useEffect } from 'react' import { useRouter } from 'next/router' -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' import { useLazyQuery, useQuery } from '@apollo/client' import { GET_BRIDGE_TRANSACTIONS_QUERY, diff --git a/packages/explorer-ui/pages/token/[tokenAddress].tsx b/packages/explorer-ui/pages/token/[tokenAddress].tsx index 9d54ad6b0d..c5d1cd7b97 100644 --- a/packages/explorer-ui/pages/token/[tokenAddress].tsx +++ b/packages/explorer-ui/pages/token/[tokenAddress].tsx @@ -2,7 +2,7 @@ import _ from 'lodash' import { useRouter } from 'next/router' import { useState, useEffect } from 'react' import { useSearchParams } from 'next/navigation' -import { TOKEN_HASH_MAP } from 'synapse-constants' +import { TOKEN_HASH_MAP } from '@synapsecns/synapse-constants' import { useQuery } from '@apollo/client' import { GET_BRIDGE_TRANSACTIONS_QUERY } from '@graphql/queries' import { TRANSACTIONS_PATH, getChainUrl } from '@urls' diff --git a/packages/explorer-ui/pages/tx/[kappa].tsx b/packages/explorer-ui/pages/tx/[kappa].tsx index 75bfb80b9a..0492af02cc 100644 --- a/packages/explorer-ui/pages/tx/[kappa].tsx +++ b/packages/explorer-ui/pages/tx/[kappa].tsx @@ -4,7 +4,7 @@ import { ChainInfo } from '@components/misc/ChainInfo' import { Error } from '@components/Error' import { StandardPageContainer } from '@components/layouts/StandardPageContainer' import { useRouter } from 'next/router' -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' import { GET_BRIDGE_TRANSACTIONS_QUERY } from '@graphql/queries' import { API_URL } from '@graphql' import { HorizontalDivider } from '@components/misc/HorizontalDivider' @@ -39,12 +39,11 @@ export const BridgeTransaction = ({ queryResult }) => { // Get time taken to complete tx w/ appropriate units. const getTimeElapsedStr = (start, end) => { - const diff = end - start; + const diff = end - start if (diff <= 0) { - return '1 second'; + return '1 second' } - return diff === 1 ? '1 second' : `${diff} seconds`; - + return diff === 1 ? '1 second' : `${diff} seconds` } let content diff --git a/packages/explorer-ui/pages/txs/index.tsx b/packages/explorer-ui/pages/txs/index.tsx index 53eab068db..3645d30193 100644 --- a/packages/explorer-ui/pages/txs/index.tsx +++ b/packages/explorer-ui/pages/txs/index.tsx @@ -1,4 +1,4 @@ -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' import { useState, useEffect } from 'react' import { useLazyQuery } from '@apollo/client' import { GET_BRIDGE_TRANSACTIONS_QUERY } from '@graphql/queries' diff --git a/packages/explorer-ui/utils/addressToDecimals.ts b/packages/explorer-ui/utils/addressToDecimals.ts index d2f193feb5..b498bb6e6d 100644 --- a/packages/explorer-ui/utils/addressToDecimals.ts +++ b/packages/explorer-ui/utils/addressToDecimals.ts @@ -1,4 +1,4 @@ -import { TOKEN_HASH_MAP } from 'synapse-constants' +import { TOKEN_HASH_MAP } from '@synapsecns/synapse-constants' export const addressToDecimals = ({ tokenAddress, chainId }) => { let decimals = diff --git a/packages/explorer-ui/utils/addressToSymbol.ts b/packages/explorer-ui/utils/addressToSymbol.ts index 2c9ffe9efc..7352f6ac7c 100644 --- a/packages/explorer-ui/utils/addressToSymbol.ts +++ b/packages/explorer-ui/utils/addressToSymbol.ts @@ -1,4 +1,4 @@ -import { TOKEN_HASH_MAP } from 'synapse-constants' +import { TOKEN_HASH_MAP } from '@synapsecns/synapse-constants' export const addressToSymbol = ({ tokenAddress, chainId }) => { if ( diff --git a/packages/explorer-ui/utils/classes/Token.ts b/packages/explorer-ui/utils/classes/Token.ts index d5c28f8053..b3055eb42c 100644 --- a/packages/explorer-ui/utils/classes/Token.ts +++ b/packages/explorer-ui/utils/classes/Token.ts @@ -1,5 +1,5 @@ import _ from 'lodash' -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' const ChainId = CHAINS.ChainId diff --git a/packages/explorer-ui/utils/styles/coins.ts b/packages/explorer-ui/utils/styles/coins.ts index 4077aa6d39..daa09067d7 100644 --- a/packages/explorer-ui/utils/styles/coins.ts +++ b/packages/explorer-ui/utils/styles/coins.ts @@ -38,7 +38,7 @@ import { NOTE, MIM, AVWETH, -} from 'synapse-constants' +} from '@synapsecns/synapse-constants' const COLOR_COIN_MAP = { gray: [FRAX, GOHM, SDT, VSTA], diff --git a/packages/explorer-ui/utils/styles/networks.ts b/packages/explorer-ui/utils/styles/networks.ts index 5a5f5da8cb..795e151ea7 100644 --- a/packages/explorer-ui/utils/styles/networks.ts +++ b/packages/explorer-ui/utils/styles/networks.ts @@ -1,4 +1,4 @@ -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' const ChainId = CHAINS.ChainId diff --git a/packages/explorer-ui/utils/urls/index.ts b/packages/explorer-ui/utils/urls/index.ts index 59e1a11805..fc6bf70fdb 100644 --- a/packages/explorer-ui/utils/urls/index.ts +++ b/packages/explorer-ui/utils/urls/index.ts @@ -1,4 +1,4 @@ -import { CHAINS } from 'synapse-constants' +import { CHAINS } from '@synapsecns/synapse-constants' const CHAINS_BY_ID = CHAINS.CHAINS_BY_ID diff --git a/packages/synapse-constants/rollup.config.js b/packages/synapse-constants/rollup.config.js index 45444b7f2c..cff3839500 100644 --- a/packages/synapse-constants/rollup.config.js +++ b/packages/synapse-constants/rollup.config.js @@ -41,7 +41,7 @@ export default [ }), codecovRollupPlugin({ enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, - bundleName: 'synapse-constants', + bundleName: '@synapsecns/synapse-constants', uploadToken: process.env.CODECOV_TOKEN, uploadOverrides: { sha: process.env.GH_COMMIT_SHA,