-
Notifications
You must be signed in to change notification settings - Fork 252
fix: normalize token address casing in market data retrieval #809
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -60,11 +60,15 @@ const decodeTx = async ( | |||||
| tokenTo = decodedInfo.tokenTo!; | ||||||
| } | ||||||
| await marketData | ||||||
| .getMarketInfoByContracts([tx.to!], network.coingeckoPlatform!) | ||||||
| .getMarketInfoByContracts( | ||||||
| [tx.to!.toLowerCase()], | ||||||
| network.coingeckoPlatform!, | ||||||
| ) | ||||||
| .then(marketInfo => { | ||||||
| if (marketInfo[tx.to!]) { | ||||||
| currentPriceUSD = marketInfo[tx.to!]!.current_price ?? 0; | ||||||
| CGToken = marketInfo[tx.to!]!.id; | ||||||
| if (marketInfo[tx.to!.toLowerCase()]) { | ||||||
| currentPriceUSD = | ||||||
| marketInfo[tx.to!.toLowerCase()]!.current_price ?? 0; | ||||||
| CGToken = marketInfo[tx.to!.toLowerCase()]!.id; | ||||||
| } | ||||||
| }); | ||||||
| } else { | ||||||
|
|
@@ -82,7 +86,7 @@ const decodeTx = async ( | |||||
| return { | ||||||
| isContractCreation, | ||||||
| dataHex: bufferToHex(dataDecoder.data), | ||||||
| toAddress: tx.to!, | ||||||
| toAddress: tx.to!.toLowerCase(), | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win Crash on contract-creation transactions.
🐛 Proposed fix- toAddress: tx.to!.toLowerCase(),
+ toAddress: tx.to?.toLowerCase(),📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| decodedHex: dataDecoder.decode().values, | ||||||
| decoded: dataDecoder.decode().decoded, | ||||||
| tokenDecimals, | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,22 +35,22 @@ | |
| "bip39": "^3.1.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^22.19.19", | ||
| "@typescript-eslint/eslint-plugin": "^8.59.4", | ||
| "@typescript-eslint/parser": "^8.59.4", | ||
| "eslint": "^9.39.4", | ||
| "@types/node": "^22.20.1", | ||
| "@typescript-eslint/eslint-plugin": "^8.65.0", | ||
| "@typescript-eslint/parser": "^8.65.0", | ||
| "eslint": "^9.39.5", | ||
| "eslint-config-airbnb-base": "^15.0.0", | ||
|
Comment on lines
+41
to
42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
fd -t f '^package\.json$' packages -x jq -r '
select(
.devDependencies.eslint == "^9.39.5" and
.devDependencies["eslint-config-airbnb-base"] == "^15.0.0"
) | input_filename
'
npm view eslint-config-airbnb-base@15.0.0 peerDependencies --json
npm install --dry-run --ignore-scripts --strict-peer-deps --package-lock=falseRepository: enkryptcom/enKrypt Length of output: 1535 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf 'Root package manager/workspaces config:\n'
if [ -f package.json ]; then jq '{packageManager, workspaces, dependencies, devDependencies, npmConfig}' package.json; fi
printf '\nManifest entries for affected ESLint/Airbnb pairs:\n'
fd -t f '^package\.json$' packages -x sh -c '
j="$1"
name=$(jq -r ".name // empty" "$j")
if jq -e ".devDependencies.eslint == \"^9.39.5\" and .devDependencies[\"eslint-config-airbnb-base\"] == \"^15.0.0\"" "$j" >/dev/null; then
jq -r ".name as \$n | \"\($n)\$j\"\ndevDependencies.eslint=\(.devDependencies.eslint), devDependencies[\`eslint-config-airbnb-base\`]=\(.devDependencies[\"eslint-config-airbnb-base\"])" "$j"
fi
' sh {}
printf '\nAll eslint-config-airbnb-base versions in packages manifests:\n'
fd -t f '^package\.json$' packages -x jq -r '
select(.devDependencies["eslint-config-airbnb-base"]? and .devDependencies.eslint? and (
.devDependencies.eslint == "^9.39.5" or .devDependencies["eslint-config-airbnb-base"] == "^15.0.0"
)) |
"name=\(.name) eslint=\(.devDependencies.eslint) airbnb-base=\(.devDependencies[\"eslint-config-airbnb-base\"]) scripts=\(.scripts // {} | tostring | gsub("\n"; " "))"
'
printf '\nWorkspace/lint scripts mentioning eslint:\n'
fd -t f '^package\.json$' . -x sh -c '
j="$1"
if jq -e ".scripts | .[keys[] | select(test(\"eslint\"))] != null" "$j" >/dev/null; then
echo "--- $j"
jq -r ".scripts | .[keys[] | select(test(\"eslint\"))]" "$j"
fi
' sh {}Repository: enkryptcom/enKrypt Length of output: 5289 🌐 Web query:
💡 Result: The Citations:
🌐 Web query:
💡 Result: The command npm install --strict-peer-deps relates to how npm handles conflicting peer dependencies, while the --workspace (or -w) flag allows you to operate within the context of specific packages in a workspace-based project [1][2]. These are separate configuration options that can be used together, but they serve different purposes [1]. Strict Peer Dependencies (--strict-peer-deps) When set to true, the --strict-peer-deps flag forces npm to treat any conflicting peerDependencies as an installation failure, halting the process with an ERESOLVE error [1][3]. By default (when this flag is false), npm attempts to resolve peer dependency conflicts automatically using heuristics, such as using the nearest non-peer dependency specification, even if that results in a version outside the range defined in a package's peerDependencies object [1][3]. This flag is useful for CI/CD pipelines or strict development environments where you want to ensure the dependency tree strictly adheres to all specified peer dependency ranges [3]. Workspaces (--workspace) The --workspace (or -w) flag restricts the npm command to run only within the context of a specified workspace package [1][2]. When running npm install --workspace , npm will install dependencies for that specific workspace, while still respecting the overall dependency graph of your workspace project [1][4]. You can combine these options (e.g., npm install --workspace=my-app --strict-peer-deps) to enforce strict peer dependency checking specifically when installing dependencies for that workspace [1]. If you are experiencing issues where peer dependencies do not seem to respect version ranges within workspaces, ensure that your workspace definitions are correctly nested within the root project's structure, as npm expects workspaces to be part of the defined root configuration [5]. If a conflict arises that you cannot resolve, npm provides --legacy-peer-deps as an alternative to ignore peer dependency requirements entirely, though this is generally discouraged for long-term project stability [1][3]. Citations:
🌐 Web query:
💡 Result: The command you provided combines several npm configuration flags and concepts, but it is important to understand how they interact, especially when used in the context of a Yarn 4 workspace project. Command Analysis: npm install --lockfile-version 1 --strict-peer-deps 1. --lockfile-version 1: This flag instructs npm to generate a package-lock.json file compatible with npm versions 5 and 6 [1][2]. While supported, this is generally not recommended for modern projects as it lacks the detailed metadata used by newer npm versions to ensure faster, more deterministic installs [1]. Note that npm v7 and above default to newer versions (v2 or v3) and will auto-convert v1 files [1][2]. 2. --strict-peer-deps: This flag forces npm to halt the installation process if it encounters any conflicting peer dependencies [3][4][5]. By default, npm v7+ attempts to resolve peer dependency conflicts automatically using heuristics; enabling this flag disables that behavior, treating any warning as an install failure [4][6]. Using npm with Yarn 4 Workspaces: You should exercise caution when using npm to install dependencies in a project managed by Yarn workspaces. - Package Manager Incompatibility: Yarn and npm are not interchangeable [7]. They manage lockfiles (yarn.lock vs. package-lock.json), dependency resolution strategies, and workspace implementation details differently [8][7]. - Workspace Conflicts: While npm v7+ supports its own workspace implementation [9][10], it may not correctly interpret the specific workspace configuration or protocols (such as the workspace: protocol) used by Yarn [11]. Running npm install in a Yarn-managed monorepo can lead to inconsistent node_modules structures, corrupted lockfiles, and errors during build or runtime [7]. Recommendation: If your project is configured as a Yarn 4 workspace, it is highly recommended to use the yarn command (e.g., yarn install) exclusively [7]. Mixing package managers often leads to unpredictable behavior and is strongly discouraged by the maintainers of both tools [7]. Citations:
🌐 Web query:
💡 Result: ESLint version 9.39.5 is a valid, released version of the ESLint library, published on July 10, 2026 [1][2][3]. Regarding the use of ESLint 9 in your package.json, there are several key points to consider based on the current standards for ESLint v9.x: 1. Installation: You can install this specific version as a development dependency using npm: npm install --save-dev eslint@9.39.5 Citations:
🌐 Web query:
💡 Result: As of August 5, 2026, the official eslint-config-airbnb-base package has not been updated to formally support ESLint 9 [1][2]. The package continues to list ESLint 7 and 8 as peer dependencies [3], and it does not natively support the ESLint flat configuration system [2][4]. While there are open pull requests to add flat config support [2], they have not been merged [2]. Consequently, users attempting to use the official Airbnb configuration with ESLint 9 face compatibility challenges, including peer dependency conflicts [5]. Community workarounds and alternative approaches include: 1. Compatibility Layers: Developers often use the Citations:
Align
📍 Affects 8 files
🤖 Prompt for AI AgentsSource: MCP tools |
||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-import-resolver-alias": "^1.1.2", | ||
| "eslint-plugin-import": "^2.32.0", | ||
| "eslint-plugin-module-resolver": "^1.5.0", | ||
| "prettier": "^3.8.3", | ||
| "prettier": "^3.9.6", | ||
| "ts-node": "^10.9.2", | ||
| "tsconfig-paths": "^4.2.0", | ||
| "tsup": "^8.5.1", | ||
| "typescript": "^5.9.3", | ||
| "typescript-eslint": "8.59.4", | ||
| "vitest": "^4.1.7" | ||
| "typescript-eslint": "8.65.0", | ||
| "vitest": "^4.1.10" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
|
|
||
There was a problem hiding this comment.
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:
Repository: enkryptcom/enKrypt
Length of output: 208
🏁 Script executed:
Repository: enkryptcom/enKrypt
Length of output: 238
🏁 Script executed:
Repository: enkryptcom/enKrypt
Length of output: 35272
🏁 Script executed:
Repository: enkryptcom/enKrypt
Length of output: 287
🏁 Script executed:
Repository: enkryptcom/enKrypt
Length of output: 3035
🏁 Script executed:
Repository: enkryptcom/enKrypt
Length of output: 878
Align ESLint with
eslint-config-airbnb-basein every workspace using this pair.Every
package.jsonthat useseslint-config-airbnb-base@^15.0.0also pinseslint@^9.39.5, buteslint-config-airbnb-base@15.0.0only peers witheslint^7.32.0 || ^8.2.0. Use an ESLint 8.x range, or remove/migrate this config if ESLint 9 is required.📍 Affects 6 files
packages/extension-bridge/package.json#L52-L53(this comment)packages/hw-wallets/package.json#L28-L29packages/storage/package.json#L33-L34packages/types/package.json#L31-L32packages/utils/package.json#L36-L37packages/swap/package.json#L47-L48🤖 Prompt for AI Agents
Source: MCP tools