feat: add Shark Network (88118)#813
Conversation
WalkthroughAdds a Shark EVM network provider with metadata, RPC and explorer settings, registers it in the Ethereum network map, and adds its icon. ChangesShark network integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
packages/extension/src/providers/ethereum/networks/icons/shark.webppackages/extension/src/providers/ethereum/networks/index.tspackages/extension/src/providers/ethereum/networks/shark.ts
| const sharkOptions: EvmNetworkOptions = { | ||
| name: 'shark', |
There was a problem hiding this comment.
🗄️ 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 || trueRepository: 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 -400Repository: 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:
- 1: https://github.com/enkryptcom/enKrypt/blob/60941485/packages/types/src/networks.ts
- 2: https://github.com/enkryptcom/enKrypt/
🌐 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 || trueRepository: 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"]))
PYRepository: 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-L19packages/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.
| node: 'https://rpc.rpcshark.com', | ||
| icon, | ||
| NFTHandler, |
There was a problem hiding this comment.
🩺 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 2Repository: 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), |
There was a problem hiding this comment.
🩺 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 -SRepository: 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])
PYRepository: 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.
Summary by CodeRabbit