Conversation
## Walkthrough
This update primarily consists of dependency version bumps across multiple package.json files in various packages. Additionally, it introduces UI improvements for transaction verification and address input components, including explicit labeling, identicon display for recipient addresses, and refined address abbreviation logic for short addresses. It also refactors Trezor hardware wallet integration by replacing static imports of TrezorConnect with an asynchronously obtained instance via a new helper function, updating class properties and method calls accordingly. Furthermore, it adds logic to safely adjust gas limits for staking transactions on Rootstock networks. A new Ethereum-compatible network "Hemi" is added with its configuration, enum entry, and activity handler integration. The name resolution system is enhanced to support a broader set of naming protocols including PaymentId, with updated method signatures and resolver logic.
## Changes
| File(s) | Change Summary |
|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| package.json | Updated @swc/core devDependency version. |
| packages/extension-bridge/package.json<br>packages/name-resolution/package.json<br>packages/request/package.json<br>packages/signers/bitcoin/package.json<br>packages/signers/ethereum/package.json<br>packages/storage/package.json<br>packages/swap/package.json<br>packages/types/package.json | Bumped several devDependency versions (TypeScript, ESLint, Vitest, etc.). |
| packages/extension/package.json | Updated multiple dependency and devDependency versions, including @polkadot, Vue, and others. |
| packages/hw-wallets/package.json | Bumped package version; updated runtime and devDependencies including hardware wallet libs; added @trezor/connect-web package. |
| packages/keyring/package.json<br>packages/signers/kadena/package.json<br>packages/signers/polkadot/package.json<br>packages/utils/package.json | Bumped @polkadot and related dependencies; updated devDependencies. |
| packages/extension/src/providers/common/ui/styles/verify-transaction.less | Added new CSS class for label styling; modified styles for account info display. |
| packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue | Added "To" section with identicon in UI; introduced identiconTo reactive variable; improved "From" labeling and favicon sizing. |
| packages/extension/src/providers/ethereum/ui/send-transaction/components/send-address-input.vue<br>packages/extension/src/providers/solana/ui/send-transaction/components/send-address-input.vue<br>packages/extension/src/ui/action/views/swap/components/send-address-input.vue | Refined address abbreviation logic to always show full address if under 13 characters. |
| packages/hw-wallets/src/trezor/bitcoin/index.ts<br>packages/hw-wallets/src/trezor/ethereum/index.ts<br>packages/hw-wallets/src/trezor/solana/index.ts | Replaced static TrezorConnect imports with asynchronous dynamic import via new helper; added class property for TrezorConnect instance; updated init and method calls accordingly. |
| packages/hw-wallets/src/trezor/trezorConnect.ts | Added new module exporting async function to dynamically import and initialize TrezorConnect based on environment. |
| packages/extension/src/providers/ethereum/libs/transaction/gas-utils.ts | Added collectiveGasConfig and safeGasForStaking function to safely adjust gas limits for staking transactions on Rootstock. |
| packages/extension/src/providers/ethereum/libs/transaction/index.ts | Updated finalizeTransaction method to apply safe gas adjustment for staking transactions on Rootstock networks. |
| packages/extension/src/providers/common/libs/new-features.ts | Replaced three network names with a single new network name "Hemi" in newNetworks export. |
| packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts | Added new network endpoint for "Hemi" network. |
| packages/extension/src/providers/ethereum/networks/hemi.ts | Added new Ethereum-compatible network configuration for "Hemi". |
| packages/extension/src/providers/ethereum/networks/index.ts | Imported and added "hemi" network to the exported networks object. |
| packages/types/src/networks.ts | Extended NetworkNames enum with new member "Hemi". |
| packages/extension/src/providers/bitcoin/types/bitcoin-network.ts | Removed formatFiatValue usage; replaced with raw string assignments for fiat values. |
| packages/extension/src/providers/bitcoin/ui/btc-verify-transaction.vue | Changed fiat value formatting from formatFiatValue to parseCurrency filter. |
| packages/extension/src/providers/bitcoin/ui/send-transaction/components/send-alert.vue | Changed fiat value formatting in alert messages from formatFiatValue to parseCurrency. |
| packages/extension/src/providers/common/ui/send-transaction/send-alert.vue | Changed price difference formatting from formatFiatValue to parseCurrency. |
| packages/extension/src/providers/common/ui/verify-transaction/verify-transaction-amount.vue | Replaced formatFiatValue with parseCurrency for token USD value display. |
| packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts | Removed formatFiatValue usage; replaced with raw string assignments for fiat values. |
| packages/extension/src/providers/ethereum/networks/skale/skale-base.ts | Removed formatFiatValue usage; replaced with raw string assignments for fiat values. |
| packages/extension/src/providers/ethereum/types/evm-network.ts | Removed formatFiatValue usage; replaced with raw string assignments for fiat values. |
| packages/extension/src/providers/kadena/types/kadena-network.ts | Removed formatFiatValue usage; replaced with raw string assignments for fiat values. |
| packages/extension/src/providers/kadena/ui/send-transaction/components/send-token-item.vue | Replaced formatFiatValue filter with parseCurrency for token balance and price display. |
| packages/extension/src/providers/polkadot/types/substrate-network.ts | Removed formatFiatValue usage; replaced with raw string assignments for fiat values. |
| packages/extension/src/providers/polkadot/ui/send-transaction/components/send-token-item.vue | Replaced formatFiatValue filter with parseCurrency for token balance and price display. |
| packages/extension/src/providers/solana/types/sol-network.ts | Removed formatFiatValue usage; replaced with raw string assignments for fiat values. |
| packages/extension/src/providers/solana/ui/sol-verify-transaction.vue | Changed fiat value formatting from formatFiatValue to parseCurrency filter and removed explicit dollar sign. |
| packages/extension/src/ui/action/composables/account-info.ts | Removed formatFiatValue usage; assigned raw string values to fiatAmount. |
| packages/extension/src/ui/action/utils/filters.ts | Refactored parseCurrency function for improved parsing and formatting; added trailing space in formatDuration return strings. |
| packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue | Changed token USD balance display to use raw balanceUSD instead of balanceUSDf. |
| packages/extension/src/ui/action/views/send-process/components/send-process-amount.vue | Replaced formatFiatValue with parseCurrency for token USD value display. |
| packages/extension/src/ui/action/views/settings/components/settings-select.vue | Changed filter logic to match search input against item.fiat_currency property instead of item string. |
| packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/best-offer-error.vue | Replaced formatFiatValue with parseCurrency in error message fiat value formatting. |
| packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/best-offer-block/index.vue | Replaced formatFiatValue with parseCurrency for toTokenPrice display. |
| packages/extension/src/libs/name-resolver/index.ts | Updated resolveName method signature to accept optional providerChain parameter; passed it to resolveAddress call. |
| packages/extension/src/providers/common/ui/send-transaction/send-contacts-list.vue | Changed error log message in isChecked function to a more specific message without logging error object. |
| packages/extension/src/providers/ethereum/ui/send-transaction/index.vue | Added providerChain argument in call to nameResolver.resolveName. |
| packages/extension/src/providers/solana/ui/send-transaction/index.vue | Added providerChain argument in call to nameResolver.resolveName. |
| packages/extension/src/ui/action/views/asset-detail-view/index.vue | Changed token value and USD balance display to use parseCurrency filter instead of direct string interpolation. |
| packages/extension/src/ui/action/views/swap/index.vue | Added providerChain argument in call to nameResolver.resolveName; added guard clause and non-null assertions in isDisabled. |
| packages/hw-wallets/src/trezor/ethereum/configs.ts | Renamed keys in supportedPaths object (Klaytn to Kaia, Syscoin to SyscoinNEVM). |
| packages/name-resolution/src/index.ts | Updated resolveAddress method signature to include optional paymentIdChain parameter; reordered name service checks; updated sid resolver call to use paymentIdChain. |
| packages/name-resolution/src/sid/index.ts | Refactored SIDResolver to use @web3-name-sdk/core and related resolvers; added support for PaymentId names; updated resolveAddress and resolveReverseName logic; added timeout support. |
| packages/name-resolution/src/sid/types.ts | Added timeout option to SIDOptions; added Protocol type, PaymentIdChain enum, PAYMENT_ID_CHAINS_MAP, Method type, and TIMEOUT_PRESETS constants. |
| packages/name-resolution/src/sid/utils.ts | Added isValidPaymentId utility function to validate payment ID strings. |
| packages/name-resolution/src/types.ts | Updated BaseResolver.resolveAddress method signature to include optional paymentIdChain parameter. |
| packages/name-resolution/tests/sid.test.ts | Updated resolveAddress test calls to include "ethereum" as paymentIdChain argument. |
| packages/name-resolution/tsconfig.json | Changed module resolution from "node" to "bundler"; changed module system from "commonjs" to "ES2015". |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant UI
participant Network
participant Identicon
User->>UI: Initiate transaction verification
UI->>Network: Decode transaction
Network-->>UI: Return transaction data (fromAddress, toAddress)
UI->>Identicon: Generate identicon for fromAddress
Identicon-->>UI: Return fromAddress identicon
UI->>Identicon: Generate identicon for toAddress
Identicon-->>UI: Return toAddress identicon
UI-->>User: Display "From" and "To" sections with addresses and identiconsPossibly related PRs
Suggested reviewers
|
|
💼 Build Files |
Feat/add to address
Devop/trezor conditional
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (5)
packages/extension/src/providers/ethereum/ui/send-transaction/components/send-address-input.vue (1)
74-74: Consider extracting the magic number to a constant.The logic improvement is good - short addresses don't need truncation. However, consider extracting the threshold value
13to a named constant for better maintainability and consistency across the codebase.+const ADDRESS_TRUNCATION_THRESHOLD = 13; + const visibleAddress = computed(() => { let address = props.value; if (props.network.isAddress(address)) address = props.network.displayAddress(props.value); if (isFocus.value) return address; - if (address.length < 13) return address; + if (address.length < ADDRESS_TRUNCATION_THRESHOLD) return address; return replaceWithEllipsis(address, 6, 6); });packages/extension/src/ui/action/views/swap/components/send-address-input.vue (1)
83-83: Extract magic number to shared constant for consistency.Good improvement to show short addresses in full. Since this same threshold (
13) is used across multiple address input components, consider extracting it to a shared constant or utility to ensure consistency.+const ADDRESS_TRUNCATION_THRESHOLD = 13; + const address = computed({ get: () => { let displayAddress: string; try { displayAddress = props.displayAddress(props.value); } catch { displayAddress = props.value; } - if (displayAddress.length < 13) return displayAddress; + if (displayAddress.length < ADDRESS_TRUNCATION_THRESHOLD) return displayAddress; return isFocus.value ? displayAddress : replaceWithEllipsis(displayAddress, 6, 6); }, set: value => emit('update:inputAddress', value), });packages/extension/src/providers/solana/ui/send-transaction/components/send-address-input.vue (1)
71-75: Good refactor for readability, but extract magic number.The refactor from ternary to explicit conditional logic improves readability and maintainability. However, the magic number
13should be extracted to a shared constant for consistency with similar components.+const ADDRESS_TRUNCATION_THRESHOLD = 13; + const address = computed({ get: () => { if (isFocus.value) return solAddress.value; - if (solAddress.value.length < 13) return solAddress.value; + if (solAddress.value.length < ADDRESS_TRUNCATION_THRESHOLD) return solAddress.value; return replaceWithEllipsis(solAddress.value, 6, 6); }, set: value => emit('update:inputAddress', value), });packages/extension/src/providers/common/ui/styles/verify-transaction.less (2)
10-16: Extract magic number into a design token
The hard-coded44pxmargin can lead to maintenance headaches if the icon size or spacing changes. Define a Less variable (e.g.@labelIndent) that represents the combined icon width + gap, and reuse it here.+@labelIndent: 44px; .provider-verify-transaction { &__label { - margin: 0 0 4px 44px; + margin: 0 0 4px @labelIndent; } }
177-181: Avoid excessive use of!important
Sprinkling!importantmakes future overrides brittle and can lead to specificity wars. Instead, increase selector specificity or adjust the cascade order so these rules apply without!important..provider-verify-transaction { &__account { &-to { - font-weight: 400 !important; - font-size: 16px !important; - line-height: 20px !important; - color: @black !important; + font-weight: 400; + font-size: 16px; + line-height: 20px; + color: @black; } } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (20)
package.json(1 hunks)packages/extension-bridge/package.json(2 hunks)packages/extension/package.json(5 hunks)packages/extension/src/providers/common/ui/styles/verify-transaction.less(2 hunks)packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue(5 hunks)packages/extension/src/providers/ethereum/ui/send-transaction/components/send-address-input.vue(1 hunks)packages/extension/src/providers/solana/ui/send-transaction/components/send-address-input.vue(1 hunks)packages/extension/src/ui/action/views/swap/components/send-address-input.vue(1 hunks)packages/hw-wallets/package.json(4 hunks)packages/keyring/package.json(2 hunks)packages/name-resolution/package.json(2 hunks)packages/request/package.json(2 hunks)packages/signers/bitcoin/package.json(2 hunks)packages/signers/ethereum/package.json(2 hunks)packages/signers/kadena/package.json(2 hunks)packages/signers/polkadot/package.json(2 hunks)packages/storage/package.json(2 hunks)packages/swap/package.json(2 hunks)packages/types/package.json(2 hunks)packages/utils/package.json(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: buildAll
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (25)
packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue (4)
14-16: Good explicit labeling for clarity.Adding the explicit "From" label improves UI clarity by making the transaction direction clear to users.
40-40: Good practice to specify image dimensions.Adding explicit
widthandheightattributes helps prevent layout shifts and improves page loading performance.
83-96: Excellent UX improvement with recipient information.Adding the "To" section with identicon provides users with clear visibility into the transaction recipient, significantly improving the transaction verification experience.
203-203:Details
❓ Verification inconclusive
Verify error handling for invalid recipient addresses.
The identicon generation looks correct, but ensure proper error handling if
decodedTx.toAddressis undefined or invalid.Also applies to: 237-239
🏁 Script executed:
#!/bin/bash # Description: Check how identicon generation handles invalid/undefined addresses in the network implementation # Search for identicon method implementations to understand error handling ast-grep --pattern $'identicon($_) { $$$ }' # Also search for any error handling around identicon calls rg -A 5 -B 5 "identicon.*undefined|identicon.*null|identicon.*error"Length of output: 117
🏁 Script executed:
#!/bin/bash set -e echo "🔍 Scanning for all identicon references and definitions..." rg -n "identicon" -t ts -t js -C3Length of output: 69752
Ensure robust error handling for recipient identicon
It looks like we don’t have any guards or fallbacks around
network.identiconcalls when the recipient address is missing or malformed. Before callingidenticon, make sure you validate or default thetoAddressvalue—otherwise an invalid or undefined string could cause the underlying icon generator to throw at runtime.Please review and, if needed, add a guard or a
try/catchwith a fallback icon in:
- eth-verify-transaction.vue
- Line 203:
const identiconTo = ref<string>(network.value.identicon(''));- Lines 237–239:
identiconTo.value = network.value.identicon( decoded.toAddress!.toLowerCase(), );package.json (1)
37-37: Approve devDependency version bump for @swc/core
Version for@swc/corehas been updated from^1.11.24to^1.11.29, aligning with the overall tooling updates in the monorepo. No breaking changes are expected for a patch-level bump.packages/types/package.json (1)
27-30: Approve devDependency bumps in @enkryptcom/types
The development dependencies (@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,tsup, andtypescript-eslint) have been updated to their latest patch/minor versions. These changes maintain consistency with the rest of the monorepo’s tooling.Also applies to: 39-42
packages/request/package.json (1)
34-37: Approve devDependency version upgrades in @enkryptcom/request
The devDependencies (@types/node, ESLint packages,tsup,typescript-eslint, andvitest) were bumped to newer patch/minor versions, in line with the coordinated update strategy. These upgrades should be backward-compatible.Also applies to: 46-50
packages/storage/package.json (1)
30-34: Approve devDependency bumps in @enkryptcom/storage
Dev dependencies (@types/node, ESLint plugins,tsup,typescript-eslint, andvitest) have been updated to match the monorepo-wide version standards. No functional impact is expected.Also applies to: 42-45
packages/name-resolution/package.json (1)
25-28: Approve devDependency updates in @enkryptcom/name-resolution
Updated devDependencies (@types/node, ESLint tooling,tsup,typescript-eslint, andvitest) to their latest patch/minor versions for consistency across packages.Also applies to: 37-41
packages/signers/bitcoin/package.json (1)
35-38: Chore: Bump ESLint-related devDependencies
Updating@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser, andeslintto the specified versions aligns this package with the monorepo’s standard tooling versions.packages/signers/ethereum/package.json (1)
35-38: Chore: Bump ESLint-related devDependencies
The versions for@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser, andeslinthave been synchronized with other signer packages, ensuring consistent linting across the monorepo.packages/swap/package.json (1)
42-45: Chore: Bump ESLint-related devDependencies
Aligning@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser, andeslintversions with the rest of the monorepo helps maintain uniform lint and type-check behavior.packages/keyring/package.json (2)
32-32: Chore: Bump runtime dependency@polkadot/util
Upgrading to^13.5.1keeps this package in step with other Polkadot-based modules and pulls in the latest patch fixes.
37-40: Chore: Bump ESLint-related devDependencies
The updates to@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser, andeslintmaintain consistency across all packages.packages/extension-bridge/package.json (1)
47-52: Chore: Bump ESLint-related devDependencies
Synchronizing@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,bumpp, andeslintensures the extension-bridge package uses the same development tooling versions as the rest of the monorepo.packages/utils/package.json (2)
27-27: Verify patch bump of util-crypto dependency
This patch-level update to@polkadot/util-cryptoaligns with other packages. Please confirm that no breaking changes were introduced in v13.5.1 before cutting the release.
33-36: Approve alignment of development dependencies
The devDependencies (@types/node,@typescript-eslint,eslint,tsup,vitest) have been bumped to match the monorepo standard. Ensure that linting, type-checking, and test suites pass successfully post-upgrade.Also applies to: 45-45, 48-49
packages/signers/polkadot/package.json (2)
27-28: Approve Polkadot runtime dependency bumps
Upgraded@polkadot/utiland@polkadot/util-cryptoto ^13.5.1 for consistency. These are patch releases; verify there are no unexpected runtime issues.
34-36: Approve devDependencies synchronization
Development tooling (@types/node, ESLint plugins/parsers,tsup,typescript-eslint,vitest) has been updated to the same versions used across the monorepo. Confirm build and lint pass.Also applies to: 46-46, 48-49
packages/hw-wallets/package.json (3)
3-3: Approve version bump to 0.0.5
The package version has been incremented to 0.0.5, matching the release plan.
25-28: Approve devDependencies updates
Updated dev tooling (@types/node, ESLint,tsup,typescript-eslint,vitest) to the latest patch/minor versions. Ensure the CI build and tests succeed.Also applies to: 37-37, 39-40
55-59: Verify hardware-wallet and blockchain dependency bumps
Multiple core dependencies (@ledgerhq/*, Polkadot types/util, Trezor connect, Zondax substrate) have been upgraded. Please confirm compatibility with the hardware wallet flows and run integration smoke tests.Also applies to: 61-65
packages/signers/kadena/package.json (1)
31-36: Approve Kadena signer devDependencies alignment
All devDependencies related to Polkadot util-crypto, TypeScript types, ESLint,tsup, andvitesthave been bumped in line with monorepo standards. Validate the Kadena build and tests pass without regressions.Also applies to: 45-45, 47-48
packages/extension/package.json (2)
102-108: Verify development toolchain updates
The extension’s devDependencies (TypeScript, Rollup, ESLint, Vitest, etc.) have been upgraded. Ensure the Vite build, type-checking, linting, and tests operate smoothly under the new versions.Also applies to: 119-119, 121-121, 127-127, 130-131, 133-134, 140-140
26-26:Details
❓ Verification inconclusive
Critical: Major runtime dependency upgrades—investigate breaking changes
You’ve bumped key Polkadot packages from 15.x to 16.1.1 and updated Vue to 3.5.16 along with other core libraries. These are major/minor upgrades that may introduce API changes. Please audit migration guides, test all extension flows, and update code where necessary.Also applies to: 41-43, 46-53, 81-81
🏁 Script executed:
#!/bin/bash echo "----- packages/extension/package.json (first 200 lines) -----" sed -n '1,200p' packages/extension/package.json echo echo "----- Polkadot-related dependencies -----" grep -R "polkadot" -n packages/extension/package.json || echo "No matches" echo echo "----- Vue entries -----" grep -R "\"vue\"" -n packages/extension/package.json || echo "No matches"Length of output: 5969
Critical: Audit Breaking Changes for Major Dependency Upgrades
The following runtime dependencies in packages/extension/package.json have been bumped to new major/minor versions and may include API changes:
- @amplitude/analytics-browser → ^2.17.6
- Vue → ^3.5.16
- @polkadot/api, @polkadot/rpc-provider, @polkadot/types, @polkadot/types-known → ^16.1.1
- @polkadot/extension-inject → ^0.58.10
- @polkadot/keyring, @polkadot/util → ^13.5.1
- @polkadot/ui-shared → ^3.14.1
- @polkadot/wasm-crypto → ^7.4.1
Please:
- Review the official migration guides for Vue 3.5 and Polkadot 16.x
- Run full end-to-end tests across all extension flows
- Update any code relying on removed or changed APIs before merging
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (4)
packages/hw-wallets/src/trezor/trezorConnect.ts (1)
4-4: Use optional chaining for safer Chrome API detection.The current nested property access could throw if intermediate properties are undefined.
Apply this diff to use optional chaining:
- if (chrome && chrome.runtime && chrome.runtime.getPlatformInfo) { + if (chrome?.runtime?.getPlatformInfo) {🧰 Tools
🪛 Biome (1.9.4)
[error] 4-4: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
packages/hw-wallets/src/trezor/ethereum/index.ts (1)
45-45: Improve type safety for error handling.The repeated use of
(result.payload as any).errorbypasses TypeScript's type checking and could lead to runtime errors if the payload structure changes.Consider creating a proper type guard or interface for error payloads:
interface TrezorErrorPayload { error: string; } function isTrezorError(payload: unknown): payload is TrezorErrorPayload { return typeof payload === 'object' && payload !== null && 'error' in payload; } // Then use it like: if (!result.success) { const errorMessage = isTrezorError(result.payload) ? result.payload.error : 'Unknown Trezor error'; throw new Error(errorMessage); }Also applies to: 79-79, 103-103, 123-123
packages/hw-wallets/src/trezor/bitcoin/index.ts (1)
41-41: Review the necessity of type assertion.The
as anycast on thegetPublicKeycall might indicate a type mismatch that should be addressed at the type level rather than bypassed.Consider checking if the TrezorConnect types need to be updated or if there's a more specific type that can be used instead of
any.packages/hw-wallets/src/trezor/solana/index.ts (1)
40-41: Improve type safety for payload access.Like in other files, the use of
(res.payload as any)bypasses type checking.Consider creating proper interfaces for the Solana-specific response types to improve type safety.
Also applies to: 67-67
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
packages/hw-wallets/package.json(4 hunks)packages/hw-wallets/src/trezor/bitcoin/index.ts(6 hunks)packages/hw-wallets/src/trezor/ethereum/index.ts(7 hunks)packages/hw-wallets/src/trezor/solana/index.ts(4 hunks)packages/hw-wallets/src/trezor/trezorConnect.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/hw-wallets/package.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/hw-wallets/src/trezor/solana/index.ts (3)
packages/hw-wallets/src/types.ts (3)
getAddressRequest(74-76)AddressResponse(31-34)SolSignTransaction(61-63)packages/hw-wallets/src/trezor/solana/configs.ts (1)
supportedPaths(8-8)packages/utils/src/index.ts (1)
bufferToHex(38-38)
🪛 Biome (1.9.4)
packages/hw-wallets/src/trezor/trezorConnect.ts
[error] 4-4: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: buildAll
- GitHub Check: test
🔇 Additional comments (5)
packages/hw-wallets/src/trezor/trezorConnect.ts (1)
22-22: Verify the mixed HTTP/HTTPS URL configuration.The web configuration uses HTTP (
http://www.myetherwallet.com) while the webextension uses HTTPS (https://www.enkrypt.com). This inconsistency might be intentional but should be verified.Please confirm if the mixed protocol usage is intentional or if both should use HTTPS for security consistency.
packages/hw-wallets/src/trezor/ethereum/index.ts (1)
29-29: LGTM: Clean refactoring to instance-based TrezorConnect usage.The migration from static imports to dynamic instance initialization is well-executed and consistent throughout the class.
Also applies to: 38-38, 74-74, 96-96, 115-115
packages/hw-wallets/src/trezor/bitcoin/index.ts (1)
29-29: LGTM: Consistent refactoring pattern.The migration to instance-based TrezorConnect usage follows the same clean pattern as the other files.
Also applies to: 38-38, 78-78, 93-93
packages/hw-wallets/src/trezor/solana/index.ts (2)
28-28: LGTM: Consistent refactoring implementation.The migration to instance-based TrezorConnect usage is implemented consistently with the other wallet providers.
Also applies to: 35-35, 62-62
40-42:Details
✅ Verification successful
Verify that address and publicKey should be identical.
Both
addressandpublicKeyare set to the same decoded value from(res.payload as any).address. This seems unusual as typically these would be different representations.Please verify if this is correct or if
publicKeyshould come from a different property of the response payload. In most implementations, the public key and address are derived differently.
🏁 Script executed:
#!/bin/bash # Search for similar address/publicKey handling patterns in Solana-related code ast-grep --pattern $'return { address: $$$, publicKey: $$$, }'Length of output: 2030
Solana address is the public key – no change needed
The Trezor Connect
solanaGetAddresscall only returns a base58-encoded public key asaddress. Since Solana addresses are literally the public key, decoding it once and assigning it to bothaddressandpublicKeyis correct and matches the patterns used in other chains where the raw public key is exposed (e.g. Bitcoin).
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/extension/src/providers/ethereum/libs/transaction/gas-utils.ts (1)
182-199: Consider making external API URLs configurable for better maintainability.The hardcoded blockscout.com URLs create external dependencies that could break if the service changes their API or experiences downtime. Consider making these URLs configurable through environment variables or a configuration system.
Additionally, consider adding URL validation and fallback mechanisms for better resilience.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/extension/src/providers/ethereum/libs/transaction/gas-utils.ts(2 hunks)packages/extension/src/providers/ethereum/libs/transaction/index.ts(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/extension/src/providers/ethereum/libs/transaction/index.ts (2)
packages/utils/src/index.ts (1)
numberToHex(46-46)packages/extension/src/providers/ethereum/libs/transaction/gas-utils.ts (2)
collectiveGasConfig(253-253)safeGasForStaking(252-252)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: buildAll
🔇 Additional comments (3)
packages/extension/src/providers/ethereum/libs/transaction/index.ts (1)
17-18: LGTM! Clean import additions for RSK staking support.The new imports are correctly added and will be used in the gas limit calculation logic below.
Also applies to: 21-22
packages/extension/src/providers/ethereum/libs/transaction/gas-utils.ts (2)
4-5: LGTM! RSK network imports for configuration.The imports are correctly added for the RSK network configuration below.
252-253: LGTM! Correct exports for the new gas utilities.The exports are properly added and match the imports in the transaction index file.
fix: currency filter when over thousands or below a certain value
There was a problem hiding this comment.
Actionable comments posted: 5
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
packages/extension/src/providers/bitcoin/types/bitcoin-network.ts(1 hunks)packages/extension/src/providers/bitcoin/ui/btc-verify-transaction.vue(1 hunks)packages/extension/src/providers/bitcoin/ui/send-transaction/components/send-alert.vue(1 hunks)packages/extension/src/providers/common/ui/send-transaction/send-alert.vue(1 hunks)packages/extension/src/providers/common/ui/verify-transaction/verify-transaction-amount.vue(1 hunks)packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts(4 hunks)packages/extension/src/providers/ethereum/networks/skale/skale-base.ts(1 hunks)packages/extension/src/providers/ethereum/types/evm-network.ts(2 hunks)packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue(6 hunks)packages/extension/src/providers/kadena/types/kadena-network.ts(2 hunks)packages/extension/src/providers/kadena/ui/send-transaction/components/send-token-item.vue(1 hunks)packages/extension/src/providers/polkadot/types/substrate-network.ts(1 hunks)packages/extension/src/providers/polkadot/ui/send-transaction/components/send-token-item.vue(1 hunks)packages/extension/src/providers/solana/types/sol-network.ts(1 hunks)packages/extension/src/providers/solana/ui/sol-verify-transaction.vue(1 hunks)packages/extension/src/ui/action/composables/account-info.ts(2 hunks)packages/extension/src/ui/action/utils/filters.ts(2 hunks)packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue(1 hunks)packages/extension/src/ui/action/views/send-process/components/send-process-amount.vue(1 hunks)packages/extension/src/ui/action/views/settings/components/settings-select.vue(1 hunks)packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-error.vue(1 hunks)packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/index.vue(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue
- packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-error.vue
- packages/extension/src/providers/kadena/ui/send-transaction/components/send-token-item.vue
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue
🧰 Additional context used
🧬 Code Graph Analysis (2)
packages/extension/src/ui/action/composables/account-info.ts (1)
packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts (1)
network(265-400)
packages/extension/src/ui/action/utils/filters.ts (2)
packages/extension/src/ui/action/views/settings/store.ts (1)
useCurrencyStore(12-41)packages/extension/src/ui/action/utils/currencyConfig.ts (1)
LANG_INFO(173-173)
🪛 Biome (1.9.4)
packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts
[error] 287-287: Avoid the use of spread (...) syntax on accumulators.
Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.
(lint/performance/noAccumulatingSpread)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: buildAll
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (25)
packages/extension/src/providers/common/ui/verify-transaction/verify-transaction-amount.vue (1)
11-11: LGTM! Currency formatting refactoring looks good.This change simplifies the currency formatting by replacing
$filters.formatFiatValue(token.valueUSD).valuewith the more direct$filters.parseCurrency(token.valueUSD). This aligns with the systematic refactoring described in the AI summary across multiple UI components.packages/extension/src/ui/action/views/settings/components/settings-select.vue (1)
75-75:Details
✅ Verification successful
Verify data structure consistency for filtering logic.
The filtering logic was updated to search within
item.fiat_currencyinstead of directly on the item. This suggests the list items are now objects with afiat_currencyproperty rather than plain strings.Please verify that all callers of this component provide list items with the expected
fiat_currencyproperty to avoid runtime errors:
🏁 Script executed:
#!/bin/bash # Description: Verify usage of settings-select component and data structure # Expected: All list props should contain objects with fiat_currency property # Find all usages of settings-select component rg -A 10 -B 5 "settings-select|SettingSelectOption" # Search for any currency/fiat related data structures ast-grep --pattern 'fiat_currency: $_'Length of output: 5978
🏁 Script executed:
#!/bin/bash # Inspect usage of currencyList and useCurrencyStore in settings-general index rg -n -C5 "currencyList" packages/extension/src/ui/action/views/settings/views/settings-general/index.vue rg -n -C5 "useCurrencyStore" packages/extension/src/ui/action/views/settings/views/settings-general/index.vue # Locate and inspect the definition of useCurrencyStore rg -l "useCurrencyStore" -n packages/extension/src/ui/action/views/settings rg -n -C10 "export function useCurrencyStore" $(rg -l "useCurrencyStore" -n packages/extension/src/ui/action/views/settings)Length of output: 2382
🏁 Script executed:
#!/bin/bash # Inspect the Pinia store definition for currencyList and its structure rg -n -C10 "defineStore" packages/extension/src/ui/action/views/settings/store.ts rg -n -C10 "currencyList" packages/extension/src/ui/action/views/settings/store.ts rg -n -C10 "currentSelectedCurrency" packages/extension/src/ui/action/views/settings/store.tsLength of output: 3807
All
settings-selectitems includefiat_currencyI’ve confirmed that:
- The only
<settings-select>usage passescurrencyListfromuseCurrencyStore.useCurrencyStoredefinesCurrencywith afiat_currency: stringfield.- The updated filter
item.fiat_currency.includes(...)matches this structure.No runtime errors expected. The change is safe to merge.
packages/extension/src/ui/action/views/send-process/components/send-process-amount.vue (1)
11-11: LGTM! Consistent currency formatting refactoring.This change mirrors the same refactoring in other UI components, replacing
$filters.formatFiatValue(token.valueUSD).valuewith the simplified$filters.parseCurrency(token.valueUSD). This maintains consistency across the codebase.packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/index.vue (1)
19-19:Details
✅ Verification successful
Verify that
parseCurrencyprovides equivalent formatting toformatFiatValue.The change from
$filters.formatFiatValue(toTokenPrice).valueto$filters.parseCurrency(toTokenPrice)simplifies the filter usage, which is good. However, ensure thatparseCurrencyprovides the same currency formatting behavior (decimal places, currency symbols, locale formatting) as the previousformatFiatValue(...).valueapproach.
🏁 Script executed:
#!/bin/bash # Verify that parseCurrency filter exists and compare its implementation with formatFiatValue ast-grep --pattern 'parseCurrency($_)' echo "---" ast-grep --pattern 'formatFiatValue($_)'Length of output: 98
The AST-based search didn’t surface either filter definition—let’s broaden the search across the repo:
🏁 Script executed:
#!/bin/bash # Search for filter implementations across the codebase rg -n "parseCurrency" . rg -n "formatFiatValue" .Length of output: 6354
Let’s inspect the actual implementations of both filters:
🏁 Script executed:
#!/bin/bash # Show the top of filters.ts including parseCurrency sed -n '1,100p' packages/extension/src/ui/action/utils/filters.ts echo "-----" # Show where formatFiatValue is brought into filters.ts grep -n "formatFiatValue" packages/extension/src/ui/action/utils/filters.tsLength of output: 2352
Let’s extract the full
formatFiatValueimplementation for comparison:
🏁 Script executed:
#!/bin/bash # Extract the formatFiatValue function from number-formatter.ts sed -n '350,550p' packages/extension/src/libs/utils/number-formatter.tsLength of output: 6231
Approve filter refactor—no changes needed.
parseCurrencyhandles currency symbols, locale formatting, exchange-rate conversion, and “compact” notation (for millions/billions), replacing the oldformatFiatValue(...).valuebehavior and unifying all fiat formatting. All existing uses of$filters.parseCurrencyacross the codebase confirm it’s the intended drop-in replacement.packages/extension/src/ui/action/composables/account-info.ts (1)
5-5: LGTM - Import cleanup.The removal of
formatFiatValueimport is consistent with its removal from the code below.packages/extension/src/providers/polkadot/ui/send-transaction/components/send-token-item.vue (1)
20-21: Currency filter refactor looks consistent.The changes from
$filters.formatFiatValue(...).valueto$filters.parseCurrency(...)follow the same pattern as other UI components in this refactor. This simplifies the filter usage and maintains consistency across the codebase.Ensure that
tokenBalanceandtokenPricevalues are properly handled by theparseCurrencyfilter, especially considering thattokenPricemight be undefined based on the component logic.packages/extension/src/providers/solana/ui/sol-verify-transaction.vue (1)
72-72:Details
✅ Verification successful
LGTM! Currency formatting refactor looks good.
The change from
formatFiatValuetoparseCurrencysimplifies the template logic and aligns with the broader refactoring across the codebase. The addition ofparseFloat()wrapper is appropriate for ensuring numeric input.Please verify that the
parseCurrencyfilter handles edge cases like null, undefined, NaN, and zero values consistently with the previousformatFiatValueimplementation:
🏁 Script executed:
#!/bin/bash # Description: Verify parseCurrency filter implementation and usage # Expected: Find the filter definition and confirm it handles edge cases # Search for parseCurrency filter definition rg -A 10 "parseCurrency.*function|parseCurrency.*=" --type vue --type ts --type js # Search for other usages to ensure consistency rg "parseCurrency" --type vue -A 2 -B 2Length of output: 180
To locate the
parseCurrencyimplementation and ensure it handles edge cases, let’s search across the entire repo without restricting file types:
🏁 Script executed:
#!/bin/bash # Search for parseCurrency definition or usage across the repository rg -n "parseCurrency" .Length of output: 5830
Let’s inspect the actual implementation of
parseCurrencyto confirm its handling of null, undefined, NaN, zero, etc.:
🏁 Script executed:
#!/bin/bash # Show parseCurrency filter definition with surrounding context rg -n "export const parseCurrency" -C 10 packages/extension/src/ui/action/utils/filters.tsLength of output: 1126
parseCurrency edge cases are handled correctly
The
parseCurrencyimplementation inpackages/extension/src/ui/action/utils/filters.tsalready covers NaN and zero by mapping them to0and formatting viaIntl.NumberFormat. Coupled with theparseFloat()wrapper in the template—convertingnullorundefinedinputs toNaN—this yields a safe, “$0.00”-style output rather than a runtime error.No further changes needed here.
packages/extension/src/providers/common/ui/send-transaction/send-alert.vue (1)
8-8: LGTM! Consistent currency formatting update.The change from
formatFiatValuetoparseCurrencyis consistent with the broader refactoring effort and correctly handles the computedpriceDifferencevalue.packages/extension/src/providers/bitcoin/ui/send-transaction/components/send-alert.vue (1)
10-10: LGTM! Consistent with common component pattern.The currency formatting change matches the pattern used in the common send-alert component and correctly handles the
priceDifferencecomputed value.packages/extension/src/providers/ethereum/types/evm-network.ts (4)
153-153: LGTM! Backend formatting refactor aligns with frontend changes.The change from
formatFiatValue()to direct.toString()moves formatting responsibility to the frontendparseCurrencyfilter, which is consistent with the UI component updates.
155-156: LGTM! Consistent pattern for native asset value formatting.Direct string conversion is appropriate here since the frontend will handle formatting via the
parseCurrencyfilter.
270-270: LGTM! Custom token balance formatting follows same pattern.Consistent with the native asset changes - using direct string conversion instead of backend formatting.
272-273:Details
✅ Verification successful
LGTM! Custom token value formatting completed consistently.
The refactor is complete and consistent across all asset types (native and custom tokens).
Please verify that the frontend components correctly handle the new unformatted string values from the backend:
🏁 Script executed:
#!/bin/bash # Description: Verify that UI components using these asset values work with the new format # Expected: Find components that use balanceUSDf and valuef properties # Search for usage of the affected properties rg "balanceUSDf|valuef" --type vue --type ts -A 3 -B 1 # Verify parseCurrency filter can handle the new string format rg "parseCurrency" --type vue -A 5 -B 5Length of output: 152
🏁 Script executed:
#!/bin/bash # Re-run search across all files to locate references to the new properties and parseCurrency echo "Searching for asset.valuef occurrences..." rg --word-regexp "valuef" -n . echo "Searching for balanceUSDf occurrences..." rg --word-regexp "balanceUSDf" -n . echo "Searching for parseCurrency usage..." rg --word-regexp "parseCurrency" -n .Length of output: 9746
Frontend UI compatibility confirmed
All UI components correctly handle the newly introduced
valuefandbalanceUSDfstring fields, and the existingparseCurrencyfilter accepts bothstringandnumberinputs. No further changes are needed.• In asset‐detail‐view/index.vue,
token.valuefandtoken.balanceUSDfare rendered directly (pre‐formatted).
• In network‐assets‐item.vue and other lists, numerictoken.value/token.balanceUSDare passed through$filters.parseCurrency.
• TheparseCurrency(value: string | number): stringsignature (filters.ts) covers string inputs.packages/extension/src/providers/polkadot/types/substrate-network.ts (1)
162-162: LGTM! Consistent with fiat formatting standardization.The change from
formatFiatValue(usdBalance).valuetousdBalance.toString()aligns with the broader effort to standardize fiat value formatting across the extension, as described in the AI summary.packages/extension/src/providers/kadena/types/kadena-network.ts (2)
118-118: LGTM! Consistent fiat formatting standardization.The change to use
usdBalance.toString()instead offormatFiatValuealigns with the standardization effort across the extension.
123-123: LGTM! Simplified value formatting.The direct string conversion
marketData[0]?.current_price?.toString() ?? '0'is cleaner and consistent with the fiat formatting standardization.packages/extension/src/providers/bitcoin/ui/btc-verify-transaction.vue (1)
65-69: LGTM! UI fiat formatting standardization.The change from
$filters.formatFiatValue(fiatValue).valueto$filters.parseCurrency(fiatValue)standardizes fiat value formatting in the UI components while maintaining the same conditional logic.packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts (2)
340-340: LGTM! Consistent with fiat formatting standardization.The changes to use direct string conversion (
usdBalance.toString()andcurrentPrice.toString()) align with the broader effort to standardize fiat value formatting across the extension.Also applies to: 345-345
380-380: LGTM! Simplified zero value handling.Using direct string
'0'instead of formatted values for unknown tokens is cleaner and consistent with the standardization effort.Also applies to: 388-388
packages/extension/src/providers/solana/types/sol-network.ts (2)
127-127: LGTM! Simplified currency formatting approach.The change from formatted currency to raw string conversion aligns with the broader pattern of moving currency formatting responsibility to the UI layer using
parseCurrency.
132-133: LGTM! Consistent with currency formatting changes.The direct string conversion approach is consistent with the changes to
balanceUSDfand the overall strategy to useparseCurrencyfor UI formatting.packages/extension/src/ui/action/utils/filters.ts (4)
24-24: LGTM! Proper input sanitization.The regex replacement correctly handles commas and
<symbols, which aligns with the later logic that adds a "< " prefix for very small amounts.
27-28: LGTM! Robust fallback handling.Good defensive programming with proper fallbacks for both locale (
'en-US') and exchange rate (1) when the currency lookup fails.
30-34: Excellent enhancement to currency formatting!The new implementation properly handles:
- BigNumber operations with NaN/zero checks
- Compact notation for large values (>999,999)
- Special formatting for very small amounts with "< " prefix
- Proper locale-based currency formatting
This is a significant improvement over the previous implementation.
53-53: LGTM! Consistent formatting with trailing space.The addition of trailing spaces provides consistent output formatting for duration strings.
Also applies to: 55-55
packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts
Show resolved
Hide resolved
…into devop/release-v2-8-0
Feat: space id support
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
packages/hw-wallets/src/trezor/trezorConnect.ts (1)
3-27: Add error handling for initialization failures.The function doesn't handle cases where TrezorConnect initialization might fail, which could leave the application in an inconsistent state.
Consider adding try-catch blocks around the initialization calls as suggested in the previous review.
🧰 Tools
🪛 Biome (1.9.4)
[error] 4-4: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
🧹 Nitpick comments (5)
packages/hw-wallets/src/trezor/trezorConnect.ts (1)
4-4: Use optional chaining for cleaner Chrome runtime detection.The static analysis tool correctly suggests using optional chaining instead of multiple
&&checks.Apply this diff to improve readability:
- if (chrome && chrome.runtime && chrome.runtime.getPlatformInfo) { + if (chrome?.runtime?.getPlatformInfo) {🧰 Tools
🪛 Biome (1.9.4)
[error] 4-4: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
packages/name-resolution/src/sid/utils.ts (1)
1-2: Approve the PaymentId validation utility.The implementation correctly validates the payment ID format with a clear regex pattern. The function is simple, focused, and well-exported.
Consider if the regex should support additional characters commonly used in identifiers:
-const paymentIdRegex = /^[a-zA-Z0-9]+@[a-zA-Z0-9]+$/ +const paymentIdRegex = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+$/This would allow hyphens and underscores which are common in domain-like identifiers. However, keep the current implementation if the PaymentId specification explicitly requires only alphanumeric characters.
packages/name-resolution/src/sid/types.ts (2)
6-6: Add missing semicolon.- timeout?: number + timeout?: number;
10-25: Consider generating the mapping from the enum to avoid duplication.The
PAYMENT_ID_CHAINS_MAPduplicates the values from thePaymentIdChainenum, which could lead to maintenance issues if they get out of sync.-export const PAYMENT_ID_CHAINS_MAP = { - "bitcoin": 0, - "ethereum": 1, - "solana": 2, - "tron": 3, - "aptos": 4, - "sui": 5, -}; +export const PAYMENT_ID_CHAINS_MAP = Object.entries(PaymentIdChain) + .filter(([key]) => isNaN(Number(key))) + .reduce((acc, [key, value]) => { + acc[key.toLowerCase()] = value; + return acc; + }, {} as Record<string, number>);packages/name-resolution/src/sid/index.ts (1)
15-39: Consider externalizing the TLD list for better maintainability.The hardcoded list of EVM TLDs could be moved to a configuration file or constants module to improve maintainability and make it easier to update.
Would you like me to help create a separate configuration module for managing supported TLDs?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (20)
packages/extension/src/libs/name-resolver/index.ts(1 hunks)packages/extension/src/providers/common/ui/send-transaction/send-contacts-list.vue(1 hunks)packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue(6 hunks)packages/extension/src/providers/ethereum/ui/send-transaction/index.vue(1 hunks)packages/extension/src/providers/solana/ui/send-transaction/index.vue(1 hunks)packages/extension/src/ui/action/views/asset-detail-view/index.vue(2 hunks)packages/extension/src/ui/action/views/swap/index.vue(2 hunks)packages/hw-wallets/package.json(4 hunks)packages/hw-wallets/src/trezor/bitcoin/index.ts(7 hunks)packages/hw-wallets/src/trezor/ethereum/configs.ts(1 hunks)packages/hw-wallets/src/trezor/solana/index.ts(4 hunks)packages/hw-wallets/src/trezor/trezorConnect.ts(1 hunks)packages/name-resolution/package.json(3 hunks)packages/name-resolution/src/index.ts(1 hunks)packages/name-resolution/src/sid/index.ts(1 hunks)packages/name-resolution/src/sid/types.ts(1 hunks)packages/name-resolution/src/sid/utils.ts(1 hunks)packages/name-resolution/src/types.ts(2 hunks)packages/name-resolution/tests/sid.test.ts(4 hunks)packages/name-resolution/tsconfig.json(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- packages/extension/src/providers/common/ui/send-transaction/send-contacts-list.vue
- packages/extension/src/ui/action/views/asset-detail-view/index.vue
- packages/hw-wallets/src/trezor/ethereum/configs.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- packages/name-resolution/package.json
- packages/hw-wallets/package.json
- packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue
- packages/hw-wallets/src/trezor/solana/index.ts
- packages/hw-wallets/src/trezor/bitcoin/index.ts
🧰 Additional context used
🪛 Biome (1.9.4)
packages/name-resolution/src/sid/index.ts
[error] 103-105: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 108-110: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
packages/hw-wallets/src/trezor/trezorConnect.ts
[error] 4-4: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: buildAll
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (15)
packages/hw-wallets/src/trezor/trezorConnect.ts (2)
1-2: LGTM!Clean import statement for the TrezorConnect type definition.
30-31: LGTM!Clean default export of the getTrezorConnect function.
packages/name-resolution/tsconfig.json (2)
5-5: Good modernization of module resolution strategy.The change to
"bundler"moduleResolution is appropriate for modern build tools and aligns with the package refactor to use newer dependencies.
11-11: Approve ES module target update.Updating to
"ES2015"modules enables better tree-shaking and modern ES module syntax, which is consistent with the overall package modernization.packages/extension/src/providers/ethereum/ui/send-transaction/index.vue (1)
681-685:Details
✅ Verification successful
Approve the addition of provider parameter to name resolution.
The change correctly adds the network provider as a third parameter to enhance name resolution accuracy. The implementation aligns with the updated method signature.
Verify that the
props.network.provideris always defined and is of type string:
🏁 Script executed:
#!/bin/bash # Description: Verify network provider property definition and usage # Expected: Find the network interface/type definition with provider property # Search for network type definitions ast-grep --pattern 'interface $_ { $$$ provider: $_ $$$ }' # Search for EvmNetwork type definition specifically rg -A 10 "interface EvmNetwork\|type EvmNetwork"Length of output: 6464
🏁 Script executed:
#!/bin/bash # 1. Locate ProviderName definition to confirm it's a string-based type rg -n "export type ProviderName" -A 5 . # 2. Inspect the props declaration in the Vue component to determine the type of `network` sed -n '1,200p' packages/extension/src/providers/ethereum/ui/send-transaction/index.vue | sed -n 's/</\</g'Length of output: 149
🏁 Script executed:
#!/bin/bash # 1. Find where ProviderName is defined and verify it’s a string alias rg -n "type ProviderName" -A 5 packages/extension/src/types # 2. Inspect the Vue component props declaration to confirm the type of `network` and its `provider` field rg -n "defineProps" -A 20 packages/extension/src/providers/ethereum/ui/send-transaction/index.vue rg -n "props: {" -A 20 packages/extension/src/providers/ethereum/ui/send-transaction/index.vueLength of output: 811
🏁 Script executed:
#!/bin/bash # 1. Locate EvmNetwork type definition and inspect its provider field rg -n "EvmNetwork" -A 10 . # 2. Locate ProviderName alias to confirm it's a string-based type rg -n "export type ProviderName" -A 5 . # 3. Show import of EvmNetwork in the Vue component rg -n "import.*EvmNetwork" -A 2 packages/extension/src/providers/ethereum/ui/send-transaction/index.vueLength of output: 79899
Approve name resolution provider addition
The change correctly passes
props.network.provider—typed asProviderName(a string alias via BaseNetworkOptions)—toresolveName, ensuring the provider parameter is always defined and string-based. The existingas stringcast is safe and can even be omitted if you prefer.packages/name-resolution/tests/sid.test.ts (2)
44-47: Approve test parameter update with similar verification needed.The test correctly includes the new "ethereum" parameter for the "sdfsfsdfsdfsdf.bnb" domain resolution, maintaining the same pattern as the other test.
14-14:Details
❓ Verification inconclusive
Verify chain parameter consistency in test.
The test correctly adds the new parameter, but there's a potential inconsistency: resolving "spaceid.arb" (Arbitrum domain) while passing "ethereum" as the chain parameter.
Verify if this cross-chain resolution pattern is intentional:
🏁 Script executed:
#!/bin/bash # Description: Check if cross-chain domain resolution is expected behavior # Expected: Find documentation or examples of resolving .arb domains with ethereum chain # Search for examples of resolveAddress usage patterns rg -A 3 -B 3 'resolveAddress.*ethereum' # Search for domain-to-chain mapping logic rg -A 5 'arb.*ethereum|ethereum.*arb'Length of output: 1123
🏁 Script executed:
#!/bin/bash # Locate the SIDResolver class and its resolveAddress method implementation rg "class SIDResolver" -A10 -B5 packages/name-resolution rg "resolveAddress(" -A5 -B5 packages/name-resolutionLength of output: 1302
Unable to locate
resolveAddressimplementation – manual verification requiredI wasn’t able to find the
resolveAddressmethod in the SIDResolver code to confirm if resolving “.arb” domains on the “ethereum” chain is supported. Please check whether cross‐chain resolution for Arbitrum domains via the Ethereum chain is intentional and documented.packages/extension/src/providers/solana/ui/send-transaction/index.vue (1)
707-711: Enhancement looks good - improved name resolution with provider context.The addition of the network provider parameter to the
resolveNamecall is consistent with the broader name resolution system enhancement. This provides more precise address resolution by including network provider context.packages/name-resolution/src/types.ts (1)
149-151: Good foundational type enhancement for PaymentId support.The addition of the optional
paymentIdChainparameter to the abstractresolveAddressmethod is well-designed, maintaining backward compatibility while enabling enhanced name resolution capabilities for PaymentId namespaces.packages/extension/src/ui/action/views/swap/index.vue (2)
407-411: Consistent name resolution enhancement.The addition of the network provider parameter follows the same pattern as other UI components, ensuring consistent enhanced name resolution across the application.
780-780: Improved type safety with non-null assertion.The addition of the non-null assertion (
!) before callingtoString()on the balance improves type safety and prevents potential runtime errors.packages/name-resolution/src/index.ts (3)
44-44: Minor formatting improvement.Addition of trailing comma follows good JavaScript/TypeScript practices and improves consistency.
50-51: Proper method signature enhancement.The addition of the optional
paymentIdChainparameter aligns with the type definition changes and supports the enhanced name resolution capabilities.
58-59: Correct parameter usage for SID resolver.The change from using
cointopaymentIdChainparameter for the SID resolver call is appropriate, given that SID now handles PaymentId names with a different resolution approach than traditional coin-based addresses.packages/extension/src/libs/name-resolver/index.ts (1)
17-21: LGTM!The addition of the optional
providerChainparameter is implemented correctly and maintains backward compatibility.
Summary by CodeRabbit
New Features
Style
Bug Fixes
Chores