Skip to content
Open
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/extension/src/providers/ethereum/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import coredao from './coredao';
import appLayerTestnet from './applayer-testnet';
import nibiru from './nibiru';
import nibiruTestnet from './nibiru-testnet';
import shark from './shark';
// import tac from './tac'; waiting for RPC fix

export default {
Expand Down Expand Up @@ -146,5 +147,6 @@ export default {
nibiru: nibiru,
nibiruTestnet: nibiruTestnet,
appLayerTestnet: appLayerTestnet,
shark: shark,
// tac: tac, waiting for RPC fix
};
25 changes: 25 additions & 0 deletions packages/extension/src/providers/ethereum/networks/shark.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import icon from './icons/shark.webp';
import { EvmNetwork, EvmNetworkOptions } from '../types/evm-network';
import NFTHandler from '@/libs/nft-handlers/goldrush';
import wrapActivityHandler from '@/libs/activity-state/wrap-activity-handler';
import { EtherscanActivity } from '../libs/activity-handlers';

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

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.

name_long: 'Shark Network',
homePage: 'https://swapshark.net',
blockExplorerTX: 'https://sharkscan.app/tx/[[txHash]]',
blockExplorerAddr: 'https://sharkscan.app/address/[[address]]',
chainID: '0x15836',
isTestNetwork: false,
currencyName: 'SHARK',
currencyNameLong: 'Shark',
node: 'https://rpc.rpcshark.com',
icon,
NFTHandler,
Comment on lines +17 to +19

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.

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.

};

const shark = new EvmNetwork(sharkOptions);

export default shark;