Skip to content

feat: add Shark Network (88118)#813

Open
fomina7 wants to merge 1 commit into
enkryptcom:mainfrom
fomina7:main
Open

feat: add Shark Network (88118)#813
fomina7 wants to merge 1 commit into
enkryptcom:mainfrom
fomina7:main

Conversation

@fomina7

@fomina7 fomina7 commented Jul 25, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features
    • Added support for the Shark network.
    • Included Shark network details, RPC connectivity, block explorer links, activity tracking, NFT support, and its network icon.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds a Shark EVM network provider with metadata, RPC and explorer settings, registers it in the Ethereum network map, and adds its icon.

Changes

Shark network integration

Layer / File(s) Summary
Shark network provider
packages/extension/src/providers/ethereum/networks/shark.ts
Defines and exports the Shark EvmNetwork with chain metadata, RPC and explorer URLs, currency settings, NFT handling, and activity handling.
Registry and icon integration
packages/extension/src/providers/ethereum/networks/index.ts, packages/extension/src/providers/ethereum/networks/icons/shark.webp
Imports and registers the Shark network and adds its WebP icon asset.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the Shark Network.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/extension/src/providers/ethereum/networks/shark.ts`:
- Around line 17-19: Remove or replace the default Goldrush NFTHandler
assignment in the Shark network configuration until Goldrush provides verified
Shark support; alternatively, add a confirmed Shark network mapping before
wiring it. Keep the existing node and icon configuration unchanged.
- Line 20: Update the Shark network configuration’s activityHandler to use a
verified SharkScan/Etherscan-compatible endpoint registered in NetworkEndpoints
for shark, or replace it with a dedicated Shark activity handler. Ensure
activity history no longer resolves an undefined endpoint while preserving the
existing wrapped-handler behavior where applicable.
- Around line 7-8: Complete Shark’s shared network integration across
packages/extension/src/providers/ethereum/networks/shark.ts: add a Shark member
to the shared NetworkNames enum, configure its Ethereum activity endpoint, and
update the Goldrush NFT handler’s network mapping to support Shark. Apply these
changes to the network definition, activity configuration, and NFT handler
references at the three cited sites; alternatively replace those shared handlers
with Shark-specific implementations that preserve activity and NFT lookup
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 116a91f9-c319-48f4-bbde-51334781093e

📥 Commits

Reviewing files that changed from the base of the PR and between b9ba802 and 24a89d7.

📒 Files selected for processing (3)
  • packages/extension/src/providers/ethereum/networks/icons/shark.webp
  • packages/extension/src/providers/ethereum/networks/index.ts
  • packages/extension/src/providers/ethereum/networks/shark.ts

Comment on lines +7 to +8
const sharkOptions: EvmNetworkOptions = {
name: 'shark',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Files:"
git ls-files | rg 'packages/extension/src/providers/ethereum/networks/shark\.ts|packages/types/src/networks\.ts|packages' | head -200

echo
echo "shark.ts:"
if [ -f packages/extension/src/providers/ethereum/networks/shark.ts ]; then
  cat -n packages/extension/src/providers/ethereum/networks/shark.ts
else
  echo "missing"
fi

echo
echo "Search for NetworkNames.Shark and Shark:"
rg -n "NetworkNames\.Shark|'shark'|\"shark\"|Shark" packages 2>/dev/null | head -200 || true

echo
echo "Network maps around raw.githubusercontent.com link is outside; inspect local imports/usages:"
rg -n "NetworkNames|NFTHandler|activityHandler|EvmNetworkOptions|networks" packages/extension src 2>/dev/null | head -300 || true

Repository: enkryptcom/enKrypt

Length of output: 10780


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Inspect package names:"
fd -a 'Network\w*(\.ts)?$|NetworkNames|networks' . | head -80

echo
echo "Find likely Networks symbols:"
rg -n "enum NetworkNames|NetworkNames|const.*Network|NFTHandler|Goldrush|activityHandler|GoldrushNFT|Goldrush" . --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' | head -400

Repository: enkryptcom/enKrypt

Length of output: 41405


🌐 Web query:

raw.githubusercontent.com enkryptcom enKrypt main packages/types/src/networks.ts NetworkNames.Shark

💡 Result:

In the Enkrypt wallet codebase, NetworkNames.Shark refers to the SharkyFi network [1][2]. The file packages/types/src/networks.ts in the enkryptcom/enKrypt repository contains the NetworkNames enum, which defines the supported blockchain networks within the wallet's architecture [1]. SharkyFi is a protocol built on the Solana blockchain, and within the Enkrypt ecosystem, it is categorized among the supported chains [2].

Citations:


🌐 Web query:

site:enkryptcom/enKrypt packages/types/src/networks.ts NetworkNames.Shark

💡 Result:

I checked packages/types/src/networks.ts in enkryptcom/enKrypt. The file exists, but it does not contain NetworkNames.Shark or any Shark text. [1][2]


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "networks.ts header:"
sed -n '1,220p' packages/types/src/networks.ts

echo
echo "shark provider file (if present):"
if [ -f packages/extension/src/providers/ethereum/networks/shark.ts ]; then
  cat -n packages/extension/src/providers/ethereum/networks/shark.ts
else
  echo "missing"
fi

echo
echo "ethereum networks index/shark references:"
fd -a 'index\.ts|shark\.ts' packages/extension/src/providers/ethereum/networks packages/extension/src | xargs -r rg -n "shark|Shark|NetworkNames|getNetwork" 2>/dev/null || true

echo
echo "Goldrush handler supported networks:"
sed -n '1,80p' packages/extension/src/libs/nft-handlers/goldrush.ts

echo
echo "activity handlers maps that may use shared network enum:"
fd -a 'index\.ts' packages/extension/src/providers packages/extension/src/libs | xargs -r rg -n "NetworkEndpoints|activityHandler:|NetworkNames\.|EtherscanActivity|getActivity" | head -300 || true

Repository: enkryptcom/enKrypt

Length of output: 29809


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "NFTHandler definition/type and usage:"
sed -n '1,200p' packages/extension/src/types/provider.ts | rg -n "EvmNetworkOptions|NFTHandler|networkName|name" -C 3

echo
echo "Etherscan activity endpoint/config:"
sed -n '1,130p' packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/index.ts
sed -n '1,120p' packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts

echo
echo "NetworkName enum tail:"
sed -n '220,340p' packages/types/src/networks.ts

echo
echo "Python structural probe for Shark registration and handler coverage:"
python3 - <<'PY'
from pathlib import Path
import re
types = Path('packages/types/src/networks.ts').read_text()
shark = Path('packages/extension/src/providers/ethereum/networks/shark.ts').read_text()
gr = Path('packages/extension/src/libs/nft-handlers/goldrush.ts').read_text()
eth_configs = Path('packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts')
eth_cfg = eth_configs.read_text() if eth_configs.exists() else ''

print("NetworkNames declaration includes Shark (text/partial):", bool(re.search(r'NetworkNames\s*\{', types)) and 'Shark' in types)
print("shark.ts name property:", re.search(r"name:\s*['\"]([^'\"]+)['\"]", shark).group(1))
print("goldrush supported keys:", re.findall(r"NetworkNames\.(\w+)\s*:", gr))
print("goldrush supports exact network name:", 'Shark' in gr)
print("etherscan config contains URL for rpcshark.com or sharkscan.app:", any(x in eth_cfg for x in ["rpcshark.com", "sharkscan.app"]))
PY

Repository: enkryptcom/enKrypt

Length of output: 9449


Complete Shark’s shared network integrations before merging.

shark.ts uses its own name: 'shark', but NetworkNames has no Shark entry and the shared Ethereum activity config lacks a matching endpoint. This also breaks NFT lookups: the attached Goldrush handler only supports enumerated Ethereum networks and will throw on non-mapped network names, including Shark. Add the shared enum/config entries or replace the handlers with Shark-specific implementations.

📍 Affects 1 file
  • packages/extension/src/providers/ethereum/networks/shark.ts#L7-L8 (this comment)
  • packages/extension/src/providers/ethereum/networks/shark.ts#L17-L19
  • packages/extension/src/providers/ethereum/networks/shark.ts#L20-L20
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/extension/src/providers/ethereum/networks/shark.ts` around lines 7 -
8, Complete Shark’s shared network integration across
packages/extension/src/providers/ethereum/networks/shark.ts: add a Shark member
to the shared NetworkNames enum, configure its Ethereum activity endpoint, and
update the Goldrush NFT handler’s network mapping to support Shark. Apply these
changes to the network definition, activity configuration, and NFT handler
references at the three cited sites; alternatively replace those shared handlers
with Shark-specific implementations that preserve activity and NFT lookup
behavior.

Comment on lines +17 to +19
node: 'https://rpc.rpcshark.com',
icon,
NFTHandler,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Repository files around relevant paths:"
git ls-files | rg 'packages/extension/src/(providers/ethereum/networks/shark|libs/nft-handlers/goldrush|.*nft.*|.*network.*)' | sed -n '1,200p'

echo
echo "shark.ts excerpt:"
cat -n packages/extension/src/providers/ethereum/networks/shark.ts 2>/dev/null || true

echo
echo "goldrush.ts excerpt outline + network handling:"
if [ -f packages/extension/src/libs/nft-handlers/goldrush.ts ]; then
  ast-grep outline packages/extension/src/libs/nft-handlers/goldrush.ts --view expanded | sed -n '1,220p' || true
  echo "--- relevant sections ---"
  rg -n "supported|network|Goldrush|NFTHandler|chain|rpc" packages/extension/src/libs/nft-handlers/goldrush.ts -C 3
fi

echo
echo "Search for NFT usage/shark references:"
rg -n "NFTHandler|goldrush|shark|rpcshark|GOLD" packages/extension/src -C 2

Repository: enkryptcom/enKrypt

Length of output: 47081


Do not wire Goldrush NFT support until Shark is supported by Goldrush.

shark.ts assigns the default Goldrush NFTHandler, but Goldrush only supports a fixed network set and throws Goldrush: network not supported for Shark (network.name === 'shark'). Opening NFT collection loading will therefore fail at runtime; add a verified Goldrush Shark mapping, or remove/replace this handler.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/extension/src/providers/ethereum/networks/shark.ts` around lines 17
- 19, Remove or replace the default Goldrush NFTHandler assignment in the Shark
network configuration until Goldrush provides verified Shark support;
alternatively, add a confirmed Shark network mapping before wiring it. Keep the
existing node and icon configuration unchanged.

node: 'https://rpc.rpcshark.com',
icon,
NFTHandler,
activityHandler: wrapActivityHandler(EtherscanActivity),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Repo files for shark.ts and activity handlers:"
fd -a 'shark\.ts|activity-handlers|etherscan' packages/extension/src | sed 's#^\./##' | head -200

echo
echo "shark.ts:"
cat -n packages/extension/src/providers/ethereum/networks/shark.ts

echo
echo "Activity handler files:"
fd -a 'index\.ts|types\.ts|networks.*\.ts' packages/extension/src/providers/ethereum/libs/activity-handlers | sed 's#^\./##'

echo
echo "Search for NetworkEndpoints/EtherscanActivity/SharkActivity activity usages:"
rg -n "NetworkEndpoints|EtherscanActivity|SharkScan|Shark|activityHandler|network\.name" packages/extension/src/providers/ethereum -S

Repository: enkryptcom/enKrypt

Length of output: 27717


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "etherscan configs:"
cat -n packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts | sed -n '1,90p'

echo
echo "etherscan activity handler:"
cat -n packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/index.ts | sed -n '1,120p'

echo
echo "etherscan types:"
cat -n packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/types.ts | sed -n '1,220p'

echo
echo "All network name occurrences mentioning shark:"
rg -n "\"shark\"|'shark'|name:\s*['\"]shark" packages/extension/src/providers/ethereum/networks packages/extension/src -S

echo
echo "Programmatic check for 'shark' in Etherscan endpoints:"
python3 - <<'PY'
from pathlib import Path
import re

paths = [
    Path('packages/extension/src/providers/ethereum/networks/shark.ts'),
    Path('packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts'),
]
for path in paths:
    text = path.read_text()
    print(path, 'has shark literal:', bool(re.search(r"['\"]shark['\"]|shark:", text, re.I)))
    print(text[:2000])
PY

Repository: enkryptcom/enKrypt

Length of output: 13189


Register a Shark activity endpoint.

EtherscanActivity resolves NetworkEndpoints[network.name], and shark is not present in that map, so activity history for Shark builds a request with undefined as the endpoint. Add a verified Etherscan-compatible SharkScan endpoint, or use a dedicated activity handler for Shark.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/extension/src/providers/ethereum/networks/shark.ts` at line 20,
Update the Shark network configuration’s activityHandler to use a verified
SharkScan/Etherscan-compatible endpoint registered in NetworkEndpoints for
shark, or replace it with a dedicated Shark activity handler. Ensure activity
history no longer resolves an undefined endpoint while preserving the existing
wrapped-handler behavior where applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants