Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proof/dispute active & other tweaks/suggs [SLT-314] #3232

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }} # Optional
filesizelimit: 15MB

- name: Add 'fe-release' label
if: github.event.pull_request.base.ref == 'fe-release'
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: 'fe-release'
7 changes: 7 additions & 0 deletions .github/workflows/ui-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- 'packages/explorer-ui/**'
- 'docs/bridge/**'
- 'packages/synapse-interface/**'
- 'packages/synapse-constants/**'
jobs:
changes:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -62,6 +63,12 @@ jobs:
cache: 'npm'
install_dependencies: 'false'
cache-path: ''
- name: Build synapse-constants
run: |
cd packages/synapse-constants
yarn install
yarn build
working-directory: ${{ github.workspace }}
- name: Get Project ID
id: project_id
# see: https://stackoverflow.com/a/75231888 for details
Expand Down
40 changes: 40 additions & 0 deletions docs/bridge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,46 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.3.7](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-05)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.3.6](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-05)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.3.5](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-04)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.3.4](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-04)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.3.3](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-04)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.3.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-03)

**Note:** Version bump only for package @synapsecns/bridge-docs
Expand Down
11 changes: 11 additions & 0 deletions docs/bridge/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { themes as prismThemes } from 'prism-react-renderer'
import type { Config } from '@docusaurus/types'
import type * as Preset from '@docusaurus/preset-classic'
import { codecovWebpackPlugin } from '@codecov/webpack-plugin'
import searchPlugin from '@easyops-cn/docusaurus-search-local'

const options = {
id: 'api', // plugin id
Expand Down Expand Up @@ -73,6 +74,9 @@ const config: Config = {
],

themeConfig: {
colorMode: {
respectPrefersColorScheme: true,
},
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
announcementBar: {
Expand Down Expand Up @@ -143,6 +147,13 @@ const config: Config = {
themes: ['docusaurus-theme-openapi-docs'], // export theme components
plugins: [
['docusaurus-plugin-openapi-docs', options],
[
searchPlugin,
{
hashed: true,
language: ['en'],
},
],
// please see: https://github.com/facebook/docusaurus/issues/8091#issuecomment-1269112001 for an explanation.
function () {
return {
Expand Down
8 changes: 5 additions & 3 deletions docs/bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synapsecns/bridge-docs",
"version": "0.3.2",
"version": "0.3.7",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -24,21 +24,23 @@
"@docusaurus/logger": "3.5.2",
"@docusaurus/module-type-aliases": "3.5.2",
"@docusaurus/plugin-content-docs": "3.5.2",
"@docusaurus/plugin-google-gtag": "^3.5.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Google Analytics trackingID Not Found

The trackingID for Google Analytics is not configured in docs/bridge/docusaurus.config.ts. Please ensure that the trackingID is properly set up to enable analytics functionality.

🔗 Analysis chain

Google Analytics plugin added successfully.

The addition of @docusaurus/plugin-google-gtag for Google Analytics integration is appropriate. The version "^3.5.2" aligns with other Docusaurus packages.

Please ensure that necessary privacy measures (such as user consent mechanisms) are in place before enabling Google Analytics. You may want to update your privacy policy accordingly.

To verify the integration, please run the following script:


It seems the previous verification script encountered errors. Please run the following corrected script to verify the Google Analytics configuration:


It appears that docusaurus.config.js does not exist. Please run the following script to locate the Docusaurus configuration file:


Please run the following script to verify that the Google Analytics trackingID is properly configured in docs/bridge/docusaurus.config.ts:


It appears there was a syntax error in the previous script. Please run the following corrected script to verify that the Google Analytics trackingID is properly configured in docs/bridge/docusaurus.config.ts:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if Google Analytics is properly configured in the Docusaurus configuration

# Look for Google Analytics configuration in docusaurus.config.js
rg --type js 'gtag:.*trackingID' ./docusaurus.config.js

Length of output: 312


Script:

#!/bin/bash
# Check if Google Analytics tracking ID is properly configured in docusaurus.config.js

rg --type js 'trackingID\s*:\s*".+"' ./docusaurus.config.js

Length of output: 124


Script:

#!/bin/bash
# Search for Docusaurus configuration files with .js or .ts extensions

fd 'docusaurus\.config\.(js|ts)$' . --type f

Length of output: 81


Script:

#!/bin/bash
# Check if Google Analytics tracking ID is properly configured in docs/bridge/docusaurus.config.ts

rg --type ts 'trackingID\s*[:=]\s*["\']\w+["\']' ./docs/bridge/docusaurus.config.ts

Length of output: 93


Script:

#!/bin/bash
# Check if Google Analytics tracking ID is properly configured in docs/bridge/docusaurus.config.ts

rg --type ts 'trackingID\s*[:=]\s*["'\'']\w+["'\'']' ./docs/bridge/docusaurus.config.ts

Length of output: 89

"@docusaurus/preset-classic": "3.5.2",
"@docusaurus/theme-common": "3.5.2",
"@docusaurus/tsconfig": "3.5.2",
"@docusaurus/types": "3.5.2",
"@docusaurus/utils": "3.5.2",
"@docusaurus/utils-common": "3.5.2",
"@docusaurus/utils-validation": "3.5.2",
"@easyops-cn/docusaurus-search-local": "^0.44.5",
"@mdx-js/react": "^3.0.0",
"@synapsecns/synapse-constants": "^1.6.0",
"clsx": "^2.0.0",
"docusaurus-plugin-openapi-docs": "^4.0.1",
"docusaurus-theme-openapi-docs": "^4.0.1",
"prism-react-renderer": "^2.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"synapse-constants": "1.3.22"
"react-dom": "^18.2.0"
},
"devDependencies": {
"typescript": "~5.2.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/bridge/src/components/Routes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BRIDGABLE_TOKENS, CHAINS } from 'synapse-constants'
import { BRIDGABLE_TOKENS, CHAINS } from '@synapsecns/synapse-constants'

const CHAINS_BY_ID = {}

Expand Down
2 changes: 1 addition & 1 deletion docs/bridge/src/components/USDC.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { USDC } from 'synapse-constants'
import { USDC } from '@synapsecns/synapse-constants'
console.log(0, USDC)

export const Test = () => {
Expand Down
6 changes: 1 addition & 5 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*",
"packages/rfq-indexer/*",
"docs/*"
],
"packages": ["packages/*", "packages/rfq-indexer/*", "docs/*"],
"version": "independent"
}
16 changes: 16 additions & 0 deletions packages/explorer-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.3.10](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-05)

**Note:** Version bump only for package @synapsecns/explorer-ui





## [0.3.9](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-05)

**Note:** Version bump only for package @synapsecns/explorer-ui





## [0.3.8](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-10-01)

**Note:** Version bump only for package @synapsecns/explorer-ui
Expand Down
3 changes: 2 additions & 1 deletion packages/explorer-ui/components/misc/AssetImage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Image from 'next/image'
import { TOKEN_HASH_MAP, AVWETH, USDC } from 'synapse-constants'

import { TOKEN_HASH_MAP, AVWETH, USDC } from '@synapsecns/synapse-constants'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Missing Dependency: @synapsecns/synapse-constants

The dependency @synapsecns/synapse-constants is not listed in package.json. Please add it to ensure the scoped package is available.

🔗 Analysis chain

LGTM! Verify project dependencies.

The update to use the scoped package @synapsecns/synapse-constants is a good practice for better organization. This change doesn't affect the usage of the imported constants within the file.

Please ensure that the project's package.json has been updated to include this new scoped package. Run the following script to verify:

If the output is null, update the package.json to include this dependency.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the presence of @synapsecns/synapse-constants in package.json

# Test: Search for @synapsecns/synapse-constants in package.json
jq '.dependencies["@synapsecns/synapse-constants"]' package.json

Length of output: 71

import { getTokenAddressUrl } from '@urls'

export const AssetImage = ({ tokenAddress, chainId, className }) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/explorer-ui/components/misc/ChainImage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Image from 'next/image'
import { CHAINS } from 'synapse-constants'
import { QuestionMarkCircleIcon } from '@heroicons/react/outline'

import { CHAINS } from '@synapsecns/synapse-constants'

const CHAINS_BY_ID = CHAINS.CHAINS_BY_ID

export const ChainImage = ({ chainId, imgSize = 'w-4 h-4', className }) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/explorer-ui/components/misc/ChainInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Link from 'next/link'
import Image from 'next/image'
import { CHAINS } from 'synapse-constants'
import { QuestionMarkCircleIcon } from '@heroicons/react/outline'

import { CHAINS } from '@synapsecns/synapse-constants'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

The new package @synapsecns/synapse-constants is not found in package.json or yarn.lock.

This import change will fail because the package is not installed. Please add @synapsecns/synapse-constants to your project's dependencies and run the package manager to install it.

  • Add @synapsecns/synapse-constants to package.json.
  • Run yarn install or the equivalent command to update yarn.lock.
  • Verify that the CHAINS object has the expected structure after installation.
🔗 Analysis chain

Approve the import change and verify package installation.

The update to the import statement from 'synapse-constants' to '@synapsecns/synapse-constants' looks good. This change likely reflects a move to a scoped package or a package name update.

To ensure the change is correctly implemented:

  1. Verify that the '@synapsecns/synapse-constants' package is correctly installed in the project.
  2. Check that the CHAINS object from the new package has the same structure as before.
  3. Update any other files in the project that might still be using the old import statement.

Run the following script to find other files that might need updating:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find other files still using the old import statement

# Search for files still using the old import
echo "Files still using the old import:"
rg --type typescript "from 'synapse-constants'" -l

# Check if the new package is in package.json
echo "Checking package.json for @synapsecns/synapse-constants:"
jq '.dependencies["@synapsecns/synapse-constants"] // .devDependencies["@synapsecns/synapse-constants"] // "Not found"' package.json

Length of output: 294


Script:

#!/bin/bash
# Description: Find other files still using the old import statement and verify the new package installation

# Search for files still using the old import
echo "Files still using the old import:"
rg --type typescript "from 'synapse-constants'" -l

# Check if the new package is in package.json
echo "Checking package.json for @synapsecns/synapse-constants:"
jq '.dependencies["@synapsecns/synapse-constants"] // .devDependencies["@synapsecns/synapse-constants"] // "Not found"' package.json

Length of output: 440


Script:

#!/bin/bash
# Description: Find other files still using the old import statement and verify the new package installation

# Search for files still using the old import
echo "Files still using the old import:"
rg "from 'synapse-constants'" --glob '*.ts' --glob '*.tsx' -l

# Check if the new package is in package.json
echo "Checking package.json for @synapsecns/synapse-constants:"
jq '.dependencies["@synapsecns/synapse-constants"] // .devDependencies["@synapsecns/synapse-constants"] // "Not found"' package.json

# Additionally, check package-lock.json or yarn.lock for the package
if [ -f package-lock.json ]; then
  echo "Checking package-lock.json for @synapsecns/synapse-constants:"
  grep '"@synapsecns/synapse-constants":' package-lock.json || echo "Not found in package-lock.json"
elif [ -f yarn.lock ]; then
  echo "Checking yarn.lock for @synapsecns/synapse-constants:"
  grep '"@synapsecns/synapse-constants":' yarn.lock || echo "Not found in yarn.lock"
else
  echo "No lock file found to check for @synapsecns/synapse-constants."
fi

Length of output: 694

import { getChainUrl, getExplorerTxUrl } from '@urls'

const CHAINS_BY_ID = CHAINS.CHAINS_BY_ID
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/components/misc/MostActive.tsx
Original file line number Diff line number Diff line change
@@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Issue Detected: Missing Dependency for @synapsecns/synapse-constants

The package @synapsecns/synapse-constants is being imported in multiple files but is not listed in your project's dependencies or devDependencies. Additionally, it is not installed in node_modules. This will lead to runtime errors due to unresolved modules.

Recommended Actions:

  • Add the Missing Dependency: Ensure that @synapsecns/synapse-constants is added to your package.json under dependencies and install it using your package manager.
    npm install @synapsecns/synapse-constants
    # or
    yarn add @synapsecns/synapse-constants
  • Verify Import Paths: Double-check the import statements to confirm that the package name is correct and consistent across all files.
🔗 Analysis chain

LGTM! Verify consistency across the project.

The import path change from 'synapse-constants' to '@synapsecns/synapse-constants' looks correct. This change likely reflects a move to a scoped package, which is a good practice for better organization and avoiding naming conflicts.

To ensure consistency across the project, please run the following script:

Also, please verify that the '@synapsecns/synapse-constants' package is properly installed in your project's dependencies. You can check this by running:

If you need any assistance with updating other files or installing the package, please let me know.


Issues Detected: Import Path Change May Be Incomplete or Incorrect

The package @synapsecns/synapse-constants is not listed in your project's dependencies and is not installed in node_modules. Additionally, the previous script to verify import statements failed due to unsupported file types.

Please execute the above scripts and provide the outputs to further assess the situation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining imports from 'synapse-constants'

# Test: Search for imports from 'synapse-constants'. Expect: No results.
rg --type typescript --type javascript "from 'synapse-constants'" -g '!node_modules'

# Test: Search for imports from '@synapsecns/synapse-constants'. Expect: Multiple results.
rg --type typescript --type javascript "from '@synapsecns/synapse-constants'" -g '!node_modules'

Length of output: 267


Script:

#!/bin/bash
# Description: Check if @synapsecns/synapse-constants is installed

# Test: Look for @synapsecns/synapse-constants in package.json. Expect: The package to be listed.
jq '.dependencies["@synapsecns/synapse-constants"]' package.json

# Test: Check if the package is installed in node_modules. Expect: Directory to exist.
if [ -d "node_modules/@synapsecns/synapse-constants" ]; then
    echo "Package is installed in node_modules"
else
    echo "Package is not installed in node_modules"
fi

Length of output: 218


Script:

#!/bin/bash
# Description: Check for any remaining imports from 'synapse-constants' and '@synapsecns/synapse-constants' without specifying file types.

# Test: Search for imports from 'synapse-constants'. Expect: No results.
rg "from ['\"]synapse-constants['\"]" -g '!node_modules'

# Test: Search for imports from '@synapsecns/synapse-constants'. Expect: Multiple results.
rg "from ['\"]@synapsecns/synapse-constants['\"]" -g '!node_modules'

Length of output: 2271


Script:

#!/bin/bash
# Description: Check if @synapsecns/synapse-constants is listed in dependencies or devDependencies.

# Test: Look for @synapsecns/synapse-constants in dependencies and devDependencies.
jq '.dependencies["@synapsecns/synapse-constants"] // .devDependencies["@synapsecns/synapse-constants"]' package.json

Length of output: 124

import { getNetworkTextColor } from '@utils/styles/networks'
import { Grid } from '@components/tailwind/Grid'
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/components/misc/TokenOnChain.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
3 changes: 2 additions & 1 deletion packages/explorer-ui/components/misc/ToolTip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -303,7 +303,7 @@ export const UniversalSearch = ({
onChange: (e) => handleChains(e),
}}
>
{Object.values(CHAIN_ENUM_BY_ID).map((chain) => (
{Object.values(CHAIN_ENUM_BY_ID).map((chain: string) => (
<MenuItem key={chain} value={chain}>
{chain.charAt(0).toUpperCase() + chain.slice(1)}
</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/components/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions packages/explorer-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synapsecns/explorer-ui",
"version": "0.3.8",
"version": "0.3.10",
"private": true,
"engines": {
"node": ">=18.17.0"
Expand All @@ -15,7 +15,9 @@
"@heroicons/react": "^1.0.6",
"@mui/material": "^5.11.8",
"@mui/x-date-pickers": "^5.0.17",
"@next/third-parties": "^14.2.14",
"@popperjs/core": "^2.11.5",
"@synapsecns/synapse-constants": "^1.6.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -38,7 +40,6 @@
"recharts": "^2.3.2",
"sharp": "^0.31.3",
"swr": "^1.3.0",
"synapse-constants": "^1.5.6",
"tailwind-merge": "^1.3.0",
"tiny-warning": "^1.0.3",
"web-vitals": "^2.1.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/explorer-ui/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from 'next/head'
import { ApolloProvider } from '@apollo/client'
import { PageWrapper } from '@components/layouts//MainLayout'
import { GoogleAnalytics } from 'nextjs-google-analytics'
import { GoogleAnalytics } from '@next/third-parties/google'
import { Analytics } from '@vercel/analytics/react'

import client from '../apollo-client'
Expand All @@ -13,7 +13,7 @@ const App = ({ Component, pageProps }) => {
<Head>
<title>Synapse Explorer</title>
</Head>
<GoogleAnalytics trackPageViews />
<GoogleAnalytics gaId={'G-BBC13LQXBD'} />
<ApolloProvider client={client}>
<PageWrapper>
<Component {...pageProps} />
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/pages/chain/[chainId].tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/pages/token/[tokenAddress].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

@synapsecns/synapse-constants is missing from package.json

The import statement for TOKEN_HASH_MAP uses '@synapsecns/synapse-constants', but this package is not listed in package.json. Please add '@synapsecns/synapse-constants' to your dependencies to ensure the module is available and avoid potential import errors.

🔗 Analysis chain

Verify the updated import path for TOKEN_HASH_MAP

The import path for TOKEN_HASH_MAP has been changed from a relative path to an absolute path. While this change can improve code maintainability, please ensure that:

  1. The new import path '@synapsecns/synapse-constants' is correct and the package is properly installed.
  2. This change is consistent with the project's import style guidelines.
  3. Similar imports across the project are updated accordingly to maintain consistency.

To verify the import, run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the import statement and its usage

# Check if the package is installed
if ! grep -q "@synapsecns/synapse-constants" package.json; then
  echo "Warning: @synapsecns/synapse-constants is not listed in package.json"
fi

# Check for other occurrences of the old import
rg "from 'synapse-constants'" --type tsx --type ts

# Check for other occurrences of the new import
rg "from '@synapsecns/synapse-constants'" --type tsx --type ts

# Check the usage of TOKEN_HASH_MAP in this file
rg "TOKEN_HASH_MAP" packages/explorer-ui/pages/token/[tokenAddress].tsx

Length of output: 587

import { useQuery } from '@apollo/client'
import { GET_BRIDGE_TRANSACTIONS_QUERY } from '@graphql/queries'
import { TRANSACTIONS_PATH, getChainUrl } from '@urls'
Expand Down
9 changes: 4 additions & 5 deletions packages/explorer-ui/pages/tx/[kappa].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/pages/txs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CHAINS } from 'synapse-constants'
import { CHAINS } from '@synapsecns/synapse-constants'
import { useState, useEffect } from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

@synapsecns/synapse-constants package is not listed in package.json

The import statement references @synapsecns/synapse-constants, but it's not listed in the project's dependencies. Please add @synapsecns/synapse-constants to package.json to ensure it's installed and available.

🔗 Analysis chain

Verify the new package import and its contents.

The import statement has been updated to use a scoped package @synapsecns/synapse-constants. This change looks good, but please ensure that:

  1. The new package is correctly installed and available in the project.
  2. The CHAINS object in the new package contains all the necessary properties, especially CHAIN_ID_NAMES_REVERSE which is used in this file.

Run the following script to verify the package and its contents:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and contents of the @synapsecns/synapse-constants package

# Test 1: Check if the package is installed
if npm list @synapsecns/synapse-constants | grep -q "@synapsecns/synapse-constants"; then
    echo "Package @synapsecns/synapse-constants is installed."
else
    echo "Package @synapsecns/synapse-constants is not installed."
fi

# Test 2: Check if CHAINS and CHAIN_ID_NAMES_REVERSE are exported
cat << EOF > temp_test.js
const { CHAINS } = require('@synapsecns/synapse-constants');
console.log(CHAINS && CHAINS.CHAIN_ID_NAMES_REVERSE ? 'CHAINS.CHAIN_ID_NAMES_REVERSE exists' : 'CHAINS.CHAIN_ID_NAMES_REVERSE does not exist');
EOF

node temp_test.js
rm temp_test.js

Length of output: 389


Script:

#!/bin/bash
# Description: Verify if @synapsecns/synapse-constants is listed in package.json

# Check if jq is available
if command -v jq > /dev/null 2>&1; then
    PACKAGE_EXISTS=$(jq '.dependencies["@synapsecns/synapse-constants"] // .devDependencies["@synapsecns/synapse-constants"]' package.json)
    if [ "$PACKAGE_EXISTS" != "null" ]; then
        echo "@synapsecns/synapse-constants is listed in package.json."
    else
        echo "@synapsecns/synapse-constants is not listed in package.json."
    fi
else
    # Fallback to grep if jq is not available
    if grep -q '"@synapsecns/synapse-constants"' package.json; then
        echo "@synapsecns/synapse-constants is listed in package.json."
    else
        echo "@synapsecns/synapse-constants is not listed in package.json."
    fi
fi

Length of output: 314

import { useLazyQuery } from '@apollo/client'
import { GET_BRIDGE_TRANSACTIONS_QUERY } from '@graphql/queries'
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/utils/addressToDecimals.ts
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/utils/addressToSymbol.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TOKEN_HASH_MAP } from 'synapse-constants'
import { TOKEN_HASH_MAP } from '@synapsecns/synapse-constants'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

@synapsecns/synapse-constants is not listed in package.json dependencies.

Please add @synapsecns/synapse-constants to the dependencies or devDependencies in package.json to ensure the import statement resolves correctly.

🔗 Analysis chain

Approve import statement update and verify project-wide consistency.

The import statement has been updated to use a scoped package name @synapsecns/synapse-constants. This change is likely part of a larger effort to organize and potentially publish npm packages.

To ensure consistency across the project, please run the following script:

This script will help identify any inconsistencies in import statements and verify the package.json entry.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of @synapsecns/synapse-constants across the project

# Search for any remaining non-scoped 'synapse-constants' imports
echo "Checking for non-scoped 'synapse-constants' imports:"
rg --type typescript --type javascript "from\s+'synapse-constants'" -g '!node_modules'

# Search for the new scoped package imports
echo "Checking for new scoped '@synapsecns/synapse-constants' imports:"
rg --type typescript --type javascript "from\s+'@synapsecns/synapse-constants'" -g '!node_modules'

# Check package.json for the dependency
echo "Checking package.json for @synapsecns/synapse-constants:"
jq '.dependencies["@synapsecns/synapse-constants"] // .devDependencies["@synapsecns/synapse-constants"] // "Not found"' package.json

Length of output: 807

export const addressToSymbol = ({ tokenAddress, chainId }) => {
if (
Expand Down
4 changes: 2 additions & 2 deletions packages/explorer-ui/utils/classes/Token.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash'
import { CHAINS } from 'synapse-constants'
import { CHAINS } from '@synapsecns/synapse-constants'

const ChainId = CHAINS.ChainId

Expand Down Expand Up @@ -155,7 +155,7 @@ const makeMultiChainObj = (valOrObj) => {
} else {
const obj = {}
for (const [chainName, chainId] of _.entries(ChainId)) {
obj[chainId] = valOrObj
obj[chainId as number] = valOrObj
}
return obj
}
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/utils/styles/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
NOTE,
MIM,
AVWETH,
} from 'synapse-constants'
} from '@synapsecns/synapse-constants'

const COLOR_COIN_MAP = {
gray: [FRAX, GOHM, SDT, VSTA],
Expand Down
Loading
Loading