Conversation
Feat/add to address
Devop/trezor conditional
fix: currency filter when over thousands or below a certain value
…into devop/release-v2-8-0
Feat: space id support
prep: release v2.8.0
WalkthroughThis update introduces support for the Hemi network across the Ethereum provider, including a new network configuration, enum entry, and integration into the networks index. It also refactors and extends the SID name resolution logic to support more chains and payment IDs, modifies the formatting of fiat values throughout the UI, and updates development dependencies across multiple packages. Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant NameResolver
participant SIDResolver
participant Web3NameResolver
participant SolanaNameResolver
participant PaymentIdNameResolver
UI->>NameResolver: resolveName(name, coins, providerChain?)
NameResolver->>SIDResolver: resolveAddress(name, coin, providerChain)
alt Payment ID
SIDResolver->>PaymentIdNameResolver: handlePaymentIdGetAddress(name, providerChain)
PaymentIdNameResolver-->>SIDResolver: address or null
else TLD == "sol"
SIDResolver->>SolanaNameResolver: resolveAddress(name)
SolanaNameResolver-->>SIDResolver: address or null
else EVM TLD
SIDResolver->>Web3NameResolver: resolveAddress(name)
Web3NameResolver-->>SIDResolver: address or null
end
SIDResolver-->>NameResolver: address or null
NameResolver-->>UI: address or null
sequenceDiagram
participant User
participant UI
participant Network
participant Etherscan
participant GasUtils
User->>UI: Initiate staking transaction (RSK/RSK Testnet)
UI->>Network: finalizeTransaction(tx)
Network->>GasUtils: safeGasForStaking(chainID, estimatedGas)
GasUtils->>Etherscan: Fetch recent staking transactions
Etherscan-->>GasUtils: Return transaction list
GasUtils->>Etherscan: Fetch transaction details
Etherscan-->>GasUtils: Return transaction details
GasUtils-->>Network: Adjusted gas limit
Network-->>UI: Signed transaction
Possibly related PRs
Suggested reviewers
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
💼 Build Files |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (5)
packages/extension/src/providers/common/ui/send-transaction/send-contacts-list.vue (1)
128-130: Improved error message specificity.The more specific error message "Error checking if address is checked, probably name resolver" provides better context for debugging. However, consider retaining some error details in development environments to aid troubleshooting when the error isn't related to name resolution.
Consider preserving error details for debugging:
} catch (err) { console.error( - 'Error checking if address is checked, probably name resolver', + 'Error checking if address is checked, probably name resolver', + process.env.NODE_ENV === 'development' ? err : '' ); return false; }packages/extension/src/ui/action/views/swap/components/send-address-input.vue (1)
83-83: Consider making the address length threshold configurable.The hardcoded threshold of 13 characters may not be optimal for all address types across different blockchain networks. Consider making this configurable via props or documenting why 13 was chosen.
props: { // ... existing props + truncationThreshold: { + type: Number, + default: 13, + }, }, - if (displayAddress.length < 13) return displayAddress; + if (displayAddress.length < props.truncationThreshold) return displayAddress;packages/extension/src/providers/common/ui/styles/verify-transaction.less (1)
177-182: Enhanced "to" address styling with increased prominence.The updated styling for the "to" address section increases its visual prominence with larger font size and black color. The use of
!importantdeclarations suggests these styles need to override existing styles - ensure this is necessary rather than addressing specificity issues through better selector targeting.packages/name-resolution/src/types.ts (1)
2-2: Fix formatting in import statement.There's extra whitespace in the import statement.
-import { SIDOptions } from "./sid/types"; +import { SIDOptions } from "./sid/types";packages/hw-wallets/src/trezor/trezorConnect.ts (1)
4-4: Apply optional chaining for safer property access.The static analysis correctly identifies that this can be simplified using 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)
📜 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 (66)
package.json(1 hunks)packages/extension-bridge/package.json(2 hunks)packages/extension/package.json(6 hunks)packages/extension/src/libs/name-resolver/index.ts(1 hunks)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/libs/new-features.ts(1 hunks)packages/extension/src/providers/common/ui/send-transaction/send-alert.vue(1 hunks)packages/extension/src/providers/common/ui/send-transaction/send-contacts-list.vue(1 hunks)packages/extension/src/providers/common/ui/styles/verify-transaction.less(2 hunks)packages/extension/src/providers/common/ui/verify-transaction/verify-transaction-amount.vue(1 hunks)packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts(1 hunks)packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts(4 hunks)packages/extension/src/providers/ethereum/libs/transaction/gas-utils.ts(2 hunks)packages/extension/src/providers/ethereum/libs/transaction/index.ts(2 hunks)packages/extension/src/providers/ethereum/networks/hemi.ts(1 hunks)packages/extension/src/providers/ethereum/networks/index.ts(2 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/ethereum/ui/send-transaction/components/send-address-input.vue(1 hunks)packages/extension/src/providers/ethereum/ui/send-transaction/index.vue(1 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/send-transaction/components/send-address-input.vue(1 hunks)packages/extension/src/providers/solana/ui/send-transaction/index.vue(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/asset-detail-view/index.vue(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/components/send-address-input.vue(1 hunks)packages/extension/src/ui/action/views/swap/index.vue(2 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)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/ethereum/index.ts(7 hunks)packages/hw-wallets/src/trezor/solana/index.ts(4 hunks)packages/hw-wallets/src/trezor/trezorConnect.ts(1 hunks)packages/keyring/package.json(2 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)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/types/src/networks.ts(1 hunks)packages/utils/package.json(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (6)
packages/extension/src/providers/ethereum/networks/hemi.ts (1)
packages/extension/src/providers/ethereum/types/evm-network.ts (2)
EvmNetworkOptions(24-55)EvmNetwork(57-290)
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/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)
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)
packages/name-resolution/src/sid/index.ts (2)
packages/name-resolution/src/sid/types.ts (3)
SIDOptions(1-7)TIMEOUT_PRESETS(34-38)PAYMENT_ID_CHAINS_MAP(18-25)packages/name-resolution/src/sid/utils.ts (1)
isValidPaymentId(2-2)
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/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)
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)
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)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: buildAll
- GitHub Check: test
🔇 Additional comments (126)
package.json (1)
37-37: Bump @swc/core to ^1.11.29
Updated the development dependency to the latest patch version, consistent with other monorepo packages.packages/types/src/networks.ts (1)
114-114: Add Hemi to NetworkNames enum
The new entry follows the existing enum pattern. Verify that downstream logic (e.g., feature flags or RPC mappings) correctly handlesNetworkNames.Hemi.packages/types/package.json (1)
27-30: Upgrade devDependencies to match monorepo standards
Bumped TypeScript, ESLint plugins, and tsup versions for consistency and maintenance.Also applies to: 39-41
packages/signers/bitcoin/package.json (1)
35-40: Synchronize devDependencies across signers
Updated Node types, ESLint plugins, tsup, and Vitest to align with other signer packages.Also applies to: 47-50
packages/request/package.json (1)
34-37: Align devDependencies with monorepo updates
Bumped TypeScript, ESLint toolchain, tsup, and Vitest versions to the new patch/minor releases.Also applies to: 46-50
packages/keyring/package.json (3)
32-32: Approve bump of @polkadot/util.
The upgrade to^13.5.1is a minor release and aligns with sibling packages.
37-39: Approve devDependencies update for Node types and ESLint.
Updating to the latest patch versions keeps tooling consistent across the monorepo.
49-52: Approve bump of tsup, typescript-eslint, and vitest.
These upgrades match other packages’ devDependency versions and should be verified by the CI pipeline.packages/storage/package.json (2)
30-33: Approve devDependencies update for Node types and ESLint.
These patch bumps align with the monorepo standard and refresh the lint/test toolchain.
42-45: Approve bump of tsup, typescript-eslint, and vitest.
Versions are consistent with other packages; CI will validate compatibility.packages/extension-bridge/package.json (4)
47-47: Approve update of @types/node.
Keeping Node type definitions up-to-date across packages.
49-52: Approve devDependencies bump for ESLint plugins and bumpp.
These minor version bumps maintain consistency in linting and release tooling.
61-61: Approve upgrade of tsup.
Matches the build tool version used in sibling packages.
64-64: Approve bump of typescript-eslint.
Aligns parser/plugin versions across the monorepo.packages/swap/package.json (2)
42-45: Approve devDependencies update for Node types and ESLint.
Patch-level upgrades keep the dev toolchain uniform across packages.
54-57: Approve bump of tsup, typescript-eslint, and vitest.
Consistent with other packages’ tooling versions; CI tests will confirm.packages/signers/ethereum/package.json (2)
35-38: Approve devDependencies update for Node types and ESLint.
These version bumps align with the monorepo’s standard dev toolchain.
47-50: Approve bump of tsup, typescript-eslint, and vitest.
Matches devDependency versions in related packages; CI pipeline will verify.packages/utils/package.json (4)
27-27: Dependency bump approved.
Upgrading@polkadot/util-cryptoto^13.5.1is a minor patch bump and matches the rest of the monorepo.
33-36: DevDependencies upgrade approved.
Bumping@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser, andeslintto the latest patch versions keeps linting in sync.
45-45: Build tool update approved.
Updatingtsupto^8.5.0aligns with other packages in the workspace.
48-49: Test tooling upgrades approved.
Bumpingtypescript-eslintandvitestensures consistent test and type-checking across packages.packages/signers/polkadot/package.json (4)
27-28: Polkadot util libraries updated.
Upgrading@polkadot/utiland@polkadot/util-cryptoto^13.5.1is a safe patch release consistent with peers.
34-36: DevDependencies lint tooling bumped.
Updating@types/node,@typescript-eslint/eslint-plugin, and@typescript-eslint/parsermaintains alignment with the monorepo baseline.
46-46: tsup version bump approved.
Aligns with the rest of the packages.
48-49: Testing dependencies upgraded.
Bumpingtypescript-eslintandvitestkeeps test configurations consistent.packages/signers/kadena/package.json (4)
31-31: DevDependency added: util-crypto.
Upgraded@polkadot/util-cryptoto^13.5.1for consistency with other signers.
33-36: DevDependencies lint tooling bumped.
Syncing@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser, andeslintversions with the monorepo.
45-45: tsup version bump approved.
Matches the upgrade in sibling packages.
47-48: Test tooling upgrades approved.
Bumpingtypescript-eslintandvitestensures uniform test runner behavior.packages/extension/package.json (9)
3-3: Package version bumped.
Updating extension from2.7.0to2.8.0per the release plan.
26-26: Dependency bump approved.
Upgrading@amplitude/analytics-browserto^2.17.6aligns with telemetry requirements.
41-41: Hardware transport update approved.
Bumping@ledgerhq/hw-transport-webusbto^6.29.5keeps Ledger integration current.
43-43: Metaplex Bubblegum upgrade approved.
Moving to^5.0.1matches on-chain program updates.
46-53: Polkadot packages upgraded.
All@polkadot/*dependencies have been bumped to align with the new^16.xand^13.xversions across the monorepo.
81-81: Vue framework update approved.
Updating Vue to^3.5.16ensures compatibility with the latest features and fixes.
102-102: Type definitions bumped.
Upgrading@types/chrome,@types/lodash, and@types/nodeto keep TypeScript support up to date.Also applies to: 107-108
119-119: Dev tooling upgrades approved.
Bumping@vueuse/core,eslint, andnpm-run-all2to match the rest of the repo.Also applies to: 121-121, 127-127
130-131: Build and test tooling updated.
Updatingrollup,rollup-plugin-visualizer,systeminformation,tsup, andvitestkeeps build/test pipelines consistent.Also applies to: 133-134, 140-140
packages/hw-wallets/src/trezor/ethereum/configs.ts (2)
24-24: NewKaiapath support.
AddingNetworkNames.KaiatosupportedPathswithDEFAULT_PATHSmatches the updated network enum.
27-27:SyscoinNEVMmapping updated.
Switching toNetworkNames.SyscoinNEVMcorrectly aligns with the renamed network identifier.packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue (1)
48-48: LGTM! Currency formatting refactor correctly implemented.The change from
token.balanceUSDftotoken.balanceUSDwith$filters.parseCurrencyaligns with the broader currency formatting standardization described in the PR summary. This approach provides better separation of concerns by using raw values with consistent filter-based formatting.packages/extension/src/providers/ethereum/ui/send-transaction/components/send-address-input.vue (1)
74-74: Good UX improvement for short address display.Adding the condition to display addresses shorter than 13 characters in full eliminates unnecessary ellipsis truncation for short addresses, improving readability and user experience.
packages/name-resolution/tsconfig.json (1)
5-5: LGTM! Modernized TypeScript configuration.The changes to use
"bundler"module resolution and"ES2015"module target align with modern build tooling and support the enhanced functionality mentioned in the summary, including new dependencies for blockchain network support.Also applies to: 11-11
packages/extension/src/ui/action/views/settings/components/settings-select.vue (1)
75-75: Excellent fix! Corrected filtering logic.The change from filtering on the entire
itemto filtering onitem.fiat_currencyis logically correct and aligns with how the template uses this property. This ensures the search functionality works properly for fiat currency selection.packages/extension/src/ui/action/views/send-process/components/send-process-amount.vue (1)
11-11: LGTM! Standardized currency formatting.The change from
formatFiatValue(token.valueUSD).valuetoparseCurrency(token.valueUSD)aligns with the broader currency formatting standardization across the codebase mentioned in the summary.packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-error.vue (1)
14-14: LGTM! Consistent currency formatting updates.Both instances correctly update from
$filters.formatFiatValue(price).valueto$filters.parseCurrency(price), maintaining consistency with the currency formatting standardization effort across the extension.Also applies to: 21-21
packages/name-resolution/tests/sid.test.ts (1)
14-14: Test updates correctly reflect the new method signature.The addition of the
"ethereum"parameter toresolveAddresscalls properly aligns with the updated method signature that now includes an optionalpaymentIdChainparameter.Also applies to: 44-47
packages/extension/src/providers/ethereum/networks/index.ts (1)
79-79: Hemi network integration follows established patterns.The addition of the Hemi network configuration properly follows the existing import/export structure used for other Ethereum-compatible networks.
Also applies to: 169-169
packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/index.vue (1)
19-19: Currency formatting update aligns with codebase standardization.The replacement of
formatFiatValue(toTokenPrice).valuewithparseCurrency(toTokenPrice)is consistent with the broader refactor to standardize currency formatting across the extension.packages/extension/src/providers/common/ui/send-transaction/send-alert.vue (1)
8-8: LGTM! Formatting update aligns with UI standardization.The transition from
formatFiatValuetoparseCurrencyfollows the consistent pattern across the codebase for currency formatting standardization.packages/extension/src/providers/common/ui/verify-transaction/verify-transaction-amount.vue (1)
11-11: LGTM! Consistent with currency formatting standardization.The change maintains functionality while adopting the standardized
parseCurrencyfilter approach.packages/extension/src/providers/bitcoin/ui/send-transaction/components/send-alert.vue (1)
10-10: LGTM! Consistent formatting update.The change follows the same pattern as other UI components, standardizing currency formatting across the application.
packages/extension/src/providers/bitcoin/types/bitcoin-network.ts (2)
133-133: Verify BigNumber.toString() formatting behavior.The change from
formatFiatValuetousdBalance.toString()may produce different formatting results. Ensure the output format meets UI requirements and maintains consistency with other currency displays.
138-138: Verify number formatting consistency.The direct use of
toString()on the current price may format differently than the previousformatFiatValueapproach. Ensure this aligns with the expected display format in the UI components.packages/extension/src/providers/ethereum/types/evm-network.ts (2)
155-156:Details
❌ Incorrect review comment
Verify price value formatting consistency.
Similar to the balance formatting,
valuefnow uses rawtoString()values instead of formatted ones. This change should be consistent across all network providers.Also applies to: 272-273
🏁 Script executed:
#!/bin/bash # Description: Verify similar changes were made across all network providers # Expected: Find consistent removal of formatFiatValue in other network files echo "Checking for formatFiatValue usage in other network providers..." rg -A 2 -B 2 "formatFiatValue" packages/extension/src/providers/ echo "Checking valuef assignments in network files..." rg -A 2 -B 2 "valuef.*=" packages/extension/src/providers/Length of output: 921
No other network providers define or use
valuef/formatFiatValue, so no cross-provider changes are needed.
- A recursive search under
packages/extension/src/providers/shows that onlyethereum/types/evm-network.tsdeclares and assignsvaluef.- No other
*network.tsfiles referenceformatFiatValueorvaluef.You can safely ignore the suggestion to apply this change elsewhere—there are no other occurrences to update.
Likely an incorrect or invalid review comment.
153-153:Details
✅ Verification successful
Verify consistent formatting is handled downstream.
The removal of
formatFiatValueforbalanceUSDfmeans raw string values are now used. Ensure that currency formatting is properly handled in the UI components that consume these values to maintain consistent display.
🏁 Script executed:
#!/bin/bash # Description: Check if balanceUSDf is formatted elsewhere in the UI # Expected: Find formatting logic in UI components that consume these values echo "Searching for balanceUSDf usage in UI components..." rg -A 3 -B 3 "balanceUSDf" --type vue --type ts --type js echo "Searching for any currency formatting utilities..." rg -A 5 "formatFiat|formatCurrency|currency.*format" --type vue --type ts --type jsLength of output: 423
Let's widen the search and drop unsupported types:
🏁 Script executed:
#!/bin/bash # Search for any usage of balanceUSDf across all .ts, .js, .vue files echo "Searching for balanceUSDf usage across codebase..." rg -A3 -B3 "balanceUSDf" -g '*.ts' -g '*.js' -g '*.vue' # Search for any fiat/currency formatting utilities in the same set of files echo "Searching for fiat and currency formatting utilities..." rg -A3 -B3 -e "formatFiatValue" -e "formatCurrency" -e "new Intl.NumberFormat" -g '*.ts' -g '*.js' -g '*.vue'Length of output: 16883
Formatting Verified: Downstream UI Handles
balanceUSDfviaparseCurrencyThe change to emit raw USD values as strings is safe because currency formatting is applied in the UI:
• In
packages/extension/src/ui/action/views/asset-detail-view/index.vuethe template uses
<p>{{ $filters.parseCurrency(token.balanceUSDf) }}</p>
to renderbalanceUSDfwith proper locale-aware currency formatting.
• TheparseCurrencyfilter is defined in
packages/extension/src/ui/action/utils/filters.ts(exported alongsideformatFiatValue), which delegates to the shared number-formatter utilities.No further action is required—the UI consistently formats all
balanceUSDfvalues downstream.packages/extension/src/providers/common/libs/new-features.ts (1)
3-3: LGTM: Clean feature flag update.The update to include
NetworkNames.Hemiin the new networks array aligns well with the Hemi network addition mentioned in the PR objectives.packages/name-resolution/src/sid/utils.ts (1)
1-2: LGTM: Clean utility function implementation.The regex pattern correctly validates the payment ID format (alphanumeric@alphanumeric) and the function is simple and testable. Good separation of concerns by extracting this validation logic.
packages/extension/src/providers/polkadot/ui/send-transaction/components/send-token-item.vue (1)
20-21: LGTM! Currency formatting refactoring is consistent.The change from
formatFiatValue().valuetoparseCurrency()aligns with the broader currency formatting standardization across the codebase. The implementation correctly handles both token balance and price formatting.packages/extension/src/providers/bitcoin/ui/btc-verify-transaction.vue (1)
65-68: LGTM! Consistent currency formatting update.The refactoring from
formatFiatValue().valuetoparseCurrency()is correctly implemented while preserving the conditional logic for handling unavailable fiat values ('~').packages/extension/src/providers/polkadot/types/substrate-network.ts (1)
162-162:Details
✅ Verification successful
LGTM! Provider-level formatting removal is correct.
Removing
formatFiatValueformatting at the provider level and providing raw string values is consistent with the refactoring strategy. This delegates formatting responsibility to the UI layer viaparseCurrency.Verify that all UI components consuming
balanceUSDfcan properly handle unformatted string values:
🏁 Script executed:
#!/bin/bash # Description: Verify UI components handle unformatted balanceUSDf values correctly # Find components that use balanceUSDf and check if they apply parseCurrency formatting rg -A 3 -B 3 "balanceUSDf" --type vue --type tsLength of output: 75
🏁 Script executed:
#!/bin/bash # Search for any occurrences of balanceUSDf in UI components echo "=== Searching for balanceUSDf usage ===" rg -C3 "balanceUSDf" -g '*.{vue,ts,tsx}' || true # Search for parseCurrency usage to confirm formatting is applied echo "=== Searching for parseCurrency usage ===" rg -C3 "parseCurrency" -g '*.{vue,ts,tsx}' || trueLength of output: 44299
Formatting Removal Confirmed Safe
Our search shows that all UI components consuming raw USD values now consistently wrap them with
$filters.parseCurrency, for example in:
src/ui/action/views/asset-detail-view/index.vuesrc/ui/action/views/network-assets/components/network-assets-item.vue- Numerous send-transaction and verify-transaction components across networks
No instances were found where
balanceUSDfis rendered without theparseCurrencyfilter. Provider-level formatting removal is safe.packages/extension/src/providers/ethereum/networks/skale/skale-base.ts (1)
157-160: LGTM! Consistent removal of formatFiatValue formatting.The changes correctly remove
formatFiatValueformatting and provide raw string values forbalanceUSDfandvaluef. This follows the same pattern as other provider files in delegating formatting to the UI layer.packages/extension/src/ui/action/views/asset-detail-view/index.vue (1)
26-26: LGTM: Currency formatting standardizationThe replacement of manual string interpolation with the
parseCurrencyfilter is a good improvement that centralizes currency formatting logic and ensures consistency across the UI.Also applies to: 49-49
packages/extension/src/providers/solana/ui/sol-verify-transaction.vue (1)
72-72: LGTM: Simplified currency formattingThe replacement of
formatFiatValuewithparseCurrencysimplifies the code by removing the need for manual dollar sign prepending and.valueproperty access, while maintaining the same functionality.packages/extension/src/providers/solana/ui/send-transaction/index.vue (1)
707-711: LGTM: Enhanced name resolution with provider contextThe addition of the
props.network.providerparameter to theresolveNamemethod call provides better network context for name resolution, which should improve accuracy and specificity.packages/extension/src/providers/solana/ui/send-transaction/components/send-address-input.vue (1)
70-77: LGTM: Improved address display logicThe modification to show full addresses when they're shorter than 13 characters prevents unnecessary truncation and improves user experience. The logic appropriately balances readability with space constraints.
packages/extension/src/providers/ethereum/ui/send-transaction/index.vue (1)
681-685: LGTM! Enhanced name resolution with provider-specific support.The addition of the network provider parameter to the
resolveNamemethod call aligns with the updated interface and enables more precise name resolution based on the specific network provider. This is a clean enhancement that maintains backward compatibility.packages/extension/src/providers/kadena/types/kadena-network.ts (2)
118-118: Consistent formatting refactor: removing formatFiatValue.The change from formatted fiat values to raw string representations is part of a coordinated refactoring effort across multiple network providers. This moves formatting responsibility to the UI layer using the
parseCurrencyfilter.
123-123: Consistent with the formatting refactor pattern.Using the raw string representation of the current price aligns with the broader change to handle currency formatting at the UI layer rather than the data layer.
packages/extension/src/providers/common/ui/styles/verify-transaction.less (1)
10-16: Good addition of label styling for better visual hierarchy.The new
&__labelstyle block provides consistent styling for labels with appropriate typography and spacing. This enhances the visual structure of the verify transaction UI.packages/extension/src/providers/solana/types/sol-network.ts (2)
127-127: Consistent with the formatting refactor across providers.Using
usdBalance.toString()instead of the formatted fiat value aligns with the coordinated effort to move currency formatting to the UI layer. This maintains data integrity while simplifying the data layer.
132-133: Proper implementation of the formatting refactor.The change to use raw string representation of the current price is consistent with the broader refactoring effort across network providers. This approach centralizes formatting logic in the UI layer.
packages/extension/src/ui/action/composables/account-info.ts (2)
5-5: LGTM: Import cleanup aligns with formatting refactor.The removal of
formatFiatValueimport is consistent with the broader refactoring across the codebase to simplify fiat value formatting.
34-38: LGTM: Simplified fiat value assignment.The direct template literal assignment is cleaner than the previous
formatFiatValue(...).valuepattern. This assumesmarketData.getTokenValue()returns a properly formatted numeric value that can be directly stringified.packages/extension/src/providers/ethereum/networks/hemi.ts (3)
1-6: LGTM: Standard imports for EVM network configuration.All necessary imports are present and follow the established pattern for Ethereum-compatible networks.
23-25: LGTM: Standard network instantiation and export.The network is properly instantiated using the EvmNetwork class and exported for consumption by other modules.
7-21:Details
✅ Verification successful
Verify the chain ID and block explorer URL format.
The network configuration looks comprehensive and follows the standard pattern. Please verify:
- Chain ID
0xa867(43111 in decimal) is correct for Hemi network- Block explorer URLs support the
[[txHash]]and[[address]]placeholder format
🏁 Script executed:
#!/bin/bash # Verify chain ID and block explorer functionality echo "Chain ID 0xa867 converts to decimal: $((0xa867))" echo "Testing if block explorer supports the placeholder format..." curl -s -I "https://explorer.hemi.xyz/" | head -1Length of output: 287
Approve Hemi network configuration
Chain ID
0xa867correctly converts to decimal 43111, and the block explorer endpoints return HTTP 200 and use the standard[[txHash]]/[[address]]placeholder pattern. No further changes required.packages/name-resolution/package.json (1)
25-42: LGTM: Routine development dependency updates.The updates to TypeScript, ESLint, and related tooling dependencies appear to be routine maintenance. The addition of
viemas a dev dependency aligns with the enhanced name resolution capabilities.packages/name-resolution/src/types.ts (1)
147-151: LGTM: Method signature enhancement for payment ID support.The addition of the optional
paymentIdChainparameter enables payment ID resolution across different chains, which aligns with the enhanced SID resolution capabilities mentioned in the summary.Note that this is a breaking change to the abstract method signature, so all implementations of
BaseResolvermust be updated to handle this new parameter.packages/hw-wallets/src/trezor/trezorConnect.ts (2)
8-9: Verify the different appUrl values are intentional.The web extension uses
https://www.enkrypt.comwhile the web version useshttp://www.myetherwallet.com. Ensure this difference is intentional and both URLs are correct.Please confirm that:
- The Enkrypt URL for web extensions is correct
- The MyEtherWallet URL for web is intentional (note: it's HTTP not HTTPS)
- Both applications are properly configured to accept these URLs
Also applies to: 22-23
3-28: LGTM! Well-structured dynamic import pattern.The implementation correctly handles environment detection and provides appropriate initialization for both web extension and web environments. The async/await pattern and type casting are properly implemented.
🧰 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/index.ts (2)
48-65: LGTM! Proper integration of payment ID chain support.The method signature update correctly adds the optional
paymentIdChainparameter, and the implementation properly passes it to the SID resolver while maintaining backward compatibility. The reordering of resolution checks (RNS/UD before SID) is also appropriate.
44-44: Minor formatting improvement.Good addition of the trailing comma for consistency.
packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts (1)
340-340: LGTM! Consistent fiat value formatting refactor.The removal of
formatFiatValueand direct string assignment aligns with the broader formatting standardization across the extension.Also applies to: 345-345, 380-380, 388-388
packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue (4)
203-203: LGTM! Proper implementation of recipient identicon.The
identiconToreactive variable is correctly initialized and updated with the decoded transaction's recipient address.Also applies to: 237-239
84-96: Excellent UI enhancement with recipient address display.The new "To" section provides valuable context for users by displaying the recipient address with its identicon, improving transaction verification UX.
65-69: LGTM! Consistent fiat formatting update.The change from
$filters.formatFiatValueto$filters.parseCurrencyaligns with the broader formatting standardization across the extension.
40-40: Good explicit sizing for favicon.Setting explicit width and height prevents layout shifts and ensures consistent display.
packages/extension/src/libs/name-resolver/index.ts (1)
17-21: LGTM: Clean API enhancement for provider-specific name resolution.The addition of the optional
providerChainparameter maintains backward compatibility while enabling network-specific name resolution capabilities. The implementation correctly passes the parameter through to the underlying resolver.packages/extension/src/ui/action/views/swap/index.vue (2)
407-411: LGTM: Correct integration with updated name resolution API.The addition of
props.network.provideras the third argument correctly utilizes the enhanced name resolution functionality for provider-specific resolution.
776-781: Good UX improvement with balance validation.The early return for falsy balance improves user experience by preventing invalid states. The non-null assertion on
balanceappears safe given the surrounding guards, but ensure thatfromToken.valuealways has a defined balance when this code path is reached.packages/extension/src/providers/ethereum/libs/transaction/index.ts (2)
17-18: LGTM: Proper imports for RSK staking gas optimization.The imports correctly bring in the necessary RSK network configurations and gas utility functions for the staking-specific gas calculations.
Also applies to: 21-22
112-123: Well-implemented RSK staking gas optimization.The conditional logic correctly targets RSK networks and staking transactions by checking both chain ID and method ID prefix. The gas recalculation using
safeGasForStakingand proper hex conversion maintains consistency with the existing codebase structure.packages/hw-wallets/package.json (3)
3-3: Version bump looks appropriate for the scope of changes.The version increase from 0.0.4 to 0.0.12 reflects the significant dependency updates and new Trezor web support functionality.
25-28: Good maintenance: Development tooling updates.The updates to TypeScript, ESLint, and testing dependencies keep the development environment current and secure.
Also applies to: 37-40
55-66: Hardware wallet library updates with new Trezor web support.The dependency updates for Ledger, Polkadot, and Trezor packages are appropriate. The addition of
@trezor/connect-webaligns with the Trezor environment adaptability improvements mentioned in the summary.packages/hw-wallets/src/trezor/bitcoin/index.ts (5)
5-5: LGTM: Import refactor for dynamic loadingThe change from direct import to type import supports the new dynamic initialization pattern. This aligns with the broader refactor mentioned in the AI summary.
16-16: LGTM: Helper function importThe import of
getTrezorConnecthelper function centralizes the initialization logic across different Trezor adapters.
18-26: LGTM: Class property additionAdding the
TrezorConnectproperty to store the dynamically initialized instance is the correct approach for this refactor.
28-31: LGTM: Async initialization patternThe async initialization in the
init()method is a clean way to handle dynamic imports. The method properly returns a boolean to indicate success.
38-41: LGTM: Consistent instance usageAll TrezorConnect method calls correctly use the instance property (
this.TrezorConnect) instead of the static import. The pattern is consistently applied acrossgetPublicKey,signMessage, andsignTransactionmethods.Also applies to: 78-82, 93-115
packages/extension/src/ui/action/utils/filters.ts (1)
52-56: Verify intentional trailing spaces in formatDurationThe trailing spaces added to the return statements appear intentional but should be documented or verified as required by the UI components that consume this function.
Are the trailing spaces in the returned duration strings intentionally required by the consuming UI components?
packages/extension/src/providers/ethereum/libs/transaction/gas-utils.ts (3)
4-6: LGTM: Network imports for configurationThe imports of RSK network configurations are necessary for the new gas optimization feature.
182-199: LGTM: RSK staking configurationThe configuration object properly defines the necessary endpoints and method identifiers for both RSK mainnet and testnet. The structure is clear and maintainable.
252-254: LGTM: Export additionsThe new exports properly expose the gas optimization functionality for use in transaction processing.
packages/hw-wallets/src/trezor/ethereum/index.ts (4)
6-6: LGTM: Consistent import refactorThe type import change matches the pattern used in the Bitcoin adapter, maintaining consistency across Trezor implementations.
16-16: LGTM: Consistent helper import and property additionThe import of
getTrezorConnectand addition of theTrezorConnectproperty follows the same pattern as the Bitcoin adapter refactor.Also applies to: 20-20
28-31: LGTM: Async initialization implementationThe async initialization pattern is consistently implemented across both Bitcoin and Ethereum adapters.
38-38: LGTM: Consistent method call updates and improved error handlingAll TrezorConnect method calls correctly use the instance property, and the error handling has been improved by casting the payload as
anybefore accessing the error property. This addresses potential TypeScript strict mode issues.Also applies to: 45-45, 74-74, 79-79, 96-96, 103-103, 115-115, 123-123
packages/name-resolution/src/sid/types.ts (5)
6-6: LGTM: Clean addition of optional timeout property.The optional timeout property follows TypeScript conventions and integrates well with the existing interface structure.
9-17: Well-structured protocol and chain definitions.The Protocol union type and PaymentIdChain enum provide clear, type-safe representations for multi-protocol support. The numeric values follow a logical sequence starting from 0.
18-25: Verify consistency between enum and mapping.The PAYMENT_ID_CHAINS_MAP correctly maps lowercase chain names to their corresponding enum values, maintaining consistency with the PaymentIdChain enum.
26-31: Comprehensive method type definition.The Method union type covers all necessary SID operations and provides good type safety for method dispatch.
34-38: Reasonable timeout preset values.The timeout presets provide sensible defaults with clear naming. The very short timeout (100ms) is appropriately documented as being for testing purposes.
packages/hw-wallets/src/trezor/solana/index.ts (5)
1-1: Good refactor to type-only import.The change from direct import to type-only import helps reduce bundle size and supports the dynamic loading pattern.
15-15: Consistent with dynamic loading pattern.The import of
getTrezorConnecthelper aligns with the refactor mentioned for other Trezor implementations and promotes code reuse.
19-19: Proper async initialization pattern.The TrezorConnect property and its initialization in the
init()method follows the established pattern for dynamic imports and ensures the instance is available before use.Also applies to: 28-28
34-34: Good correction of error message.Updating the error message from "trezor-bitcoin" to "trezor-solana" improves accuracy and debugging experience.
40-41: Type assertions are necessary here.The type assertions
(res.payload as any)and(result.payload as any)are required due to the generic nature of TrezorConnect response types. While not ideal, this is a common pattern when working with hardware wallet SDKs.Also applies to: 67-67
packages/name-resolution/src/sid/index.ts (6)
1-12: Clean refactor to modular SDK.The import changes from
ethersand@siddomains/sidjsto@web3-name-sdk/corerepresent a good architectural improvement, introducing specialized resolvers for different protocols.
15-39: Comprehensive TLD support.The expanded list of EVM-compatible TLDs significantly broadens network support. The list appears comprehensive and well-organized.
43-58: Well-structured modular resolver initialization.The constructor properly initializes three specialized resolvers with appropriate configuration, including timeout handling. The timeout default from TIMEOUT_PRESETS.normal is sensible.
63-73: Good payment ID resolution implementation.The
handlePaymentIdGetAddressmethod provides clean payment ID support with proper fallback to Ethereum when no specific chain is provided.
75-90: Improved reverse name resolution with fallback.The refactored
resolveReverseNamemethod implements a sensible fallback strategy: try web3 names first, then Solana names if that fails.
115-117: Enhanced name validation with payment ID support.The updated
isSupportedNamemethod properly handles both TLD-based names and payment IDs using the imported validation utility.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores