Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const NetworkEndpoints: Record<string, string> = {
[NetworkNames.Scroll]: 'https://api.scrollscan.com/',
[NetworkNames.Fraxtal]: 'https://api.fraxscan.com/',
[NetworkNames.Coti]: 'https://mainnet.cotiscan.io/',
[NetworkNames.Hemi]: 'https://explorer.hemi.xyz/api',
[NetworkNames.CytonicTestnet]: 'https://explorer-api.evm.testnet.cytonic.com/api/',
[NetworkNames.Derive]: 'https://explorer.derive.xyz/',
[NetworkNames.Conflux]: 'https://evmapi.confluxscan.org/',
Expand Down
21 changes: 21 additions & 0 deletions packages/extension/src/providers/ethereum/networks/hemi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";

Comment on lines +1 to +2
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Add missing import statements.

Several variables used in this file are not imported:

  • NetworkNames (used on line 4)
  • icon (used on line 14)
  • wrapActivityHandler and EtherscanActivity (used on line 16)
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
+import { NetworkNames } from "@enkryptcom/types";
+import { wrapActivityHandler } from "../libs/activity-handlers";
+import { EtherscanActivity } from "../libs/activity-handlers";
+import icon from "@/providers/icons/hemi.svg";

🏁 Script executed:

#!/bin/bash
# Description: Verify if required icons and utilities are available

# Check if the NetworkNames import is available
echo "Checking NetworkNames import location:"
find packages -name "*.ts" -exec grep -l "export enum NetworkNames" {} \;

# Check if hemi icon exists
echo -e "\nChecking for hemi icon:"
find packages -path "*/providers/icons/hemi.svg" 2>/dev/null || echo "Icon not found"

# Check for wrapActivityHandler and EtherscanActivity
echo -e "\nChecking for activity handlers:"
find packages -name "*.ts" -exec grep -l "export.*wrapActivityHandler" {} \;
find packages -name "*.ts" -exec grep -l "export.*EtherscanActivity" {} \;

Length of output: 551


🏁 Script executed:

#!/bin/bash
# Inspect hemi.ts imports and usage
echo "===== packages/extension/src/providers/ethereum/networks/hemi.ts (first 80 lines) ====="
sed -n '1,80p' packages/extension/src/providers/ethereum/networks/hemi.ts

# Inspect a similar network file (mainnet.ts) for import patterns
MAINNET=$(find packages/extension/src/providers/ethereum/networks -maxdepth 1 -type f -name "*mainnet*.ts" | head -n1)
if [ -n "$MAINNET" ]; then
  echo "===== $MAINNET (first 80 lines) ====="
  sed -n '1,80p' "$MAINNET"
else
  echo "No mainnet.ts file found under the networks directory"
fi

Length of output: 1148


🏁 Script executed:

#!/bin/bash
# List all network files
echo "=== Network definition files ==="
find packages/extension/src/providers/ethereum/networks -maxdepth 1 -type f -name "*.ts"

# Search for icon imports in these files
echo -e "\n=== Icon imports in network files ==="
rg --color=never "icon" -N packages/extension/src/providers/ethereum/networks

Length of output: 19205


🏁 Script executed:

#!/bin/bash
# Locate activity-handlers.ts and inspect definitions
echo "=== Searching for activity-handlers.ts ==="
find packages -type f -name "activity-handlers.ts" -print -exec sed -n '1,50p' {} \;

echo -e "\n=== Searching for wrapActivityHandler and EtherscanActivity usages ==="
rg -n "wrapActivityHandler" -N packages
rg -n "EtherscanActivity" -N packages

echo -e "\n=== Searching for hemi icon files ==="
find packages/extension/src/providers/ethereum/networks -type f | grep -i "hemi"

Length of output: 39004


Add missing imports and icon asset

The following identifiers are used but not imported in packages/extension/src/providers/ethereum/networks/hemi.ts:

  • NetworkNames
  • icon
  • wrapActivityHandler
  • EtherscanActivity

Update the top of the file accordingly:

 import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
+import { NetworkNames } from "@enkryptcom/types";
+import icon from "./icons/hemi.webp";
+import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler";
+import { EtherscanActivity } from "../libs/activity-handlers";

• Ensure the icon asset exists at
packages/extension/src/providers/ethereum/networks/icons/hemi.webp

Committable suggestion skipped: line range outside the PR's diff.

const netOptions: EvmNetworkOptions = {
name: NetworkNames.Hemi,
name_long: 'Hemi',
homePage: 'https://hemi.xyz/',
blockExplorerTX: 'https://explorer.hemi.xyz/tx/[[txHash]]',
blockExplorerAddr: 'https://explorer.hemi.xyz/address/[[address]]',
chainID: '0xa867',
isTestNetwork: false,
currencyName: 'ETH',
currencyNameLong: 'Ethereum',
node: 'wss://rpc.hemi.network/wsrpc',
icon,

activityHandler: wrapActivityHandler(EtherscanActivity),
};

const net = new EvmNetwork(netOptions);

export default net;
3 changes: 3 additions & 0 deletions packages/extension/src/providers/ethereum/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import abstractNode from './abstract';
import inkNode from './inkonchain';
import taraxa from './taraxa';
import coti from './coti';
import hemi from './hemi';
import cytonicTestnetNode from './cytonic-testnet';
import unitZero from './unitzero';
import unitZeroTestnet from './unitzero-testnet';
Expand Down Expand Up @@ -159,6 +160,8 @@ export default {
unichain: unichainNode,
abstract: abstractNode,
ink: inkNode,
coti: coti
hemi: hemiNode
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Fix the missing comma in the default export object.

There's a syntax error due to a missing comma after the previous property.

  ink: inkNode,
  coti: coti,
+ hemi: hemi

🏁 Script executed:

#!/bin/bash
# Description: Verify that the imported module name matches the export name

# Check the import statement
echo "Import statement:"
grep -n "import hemi" packages/extension/src/providers/ethereum/networks/index.ts

# Check the export statement
echo -e "\nExport statement:"
grep -n "hemi: " packages/extension/src/providers/ethereum/networks/index.ts

Length of output: 309


Mismatch in import/export names for hemi

The export object is referencing hemiNode (line 159) but you’ve imported it as hemi on line 74. This will throw a ReferenceError at runtime. Please align the import and export names. For example:

• Option 1 (follow the existing *Node naming convention):

-import hemi from './hemi';
+import hemiNode from './hemi';

• Option 2 (keep the default import name):

-  hemi: hemiNode
+  hemi: hemi

Also, if you’re adding more properties after hemi, don’t forget to include a trailing comma:

  coti: coti,
+ hemi: hemiNode,

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 159-159: expected , but instead found hemi

Remove hemi

(parse)

coti: coti,
cytonicTestnet: cytonicTestnetNode,
derive: deriveNode,
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export enum NetworkNames {
Bera = "Bera",
Taraxa = "Taraxa",
Coti = "Coti",
Hemi = "Hemi",
CytonicTestnet = "CytonicTestnet",
Derive = "derive",
UnitZero = "UnitZero",
Expand Down