Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/paste window #619

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Fix/paste window #619

merged 1 commit into from
Feb 18, 2025

Conversation

gamalielhere
Copy link
Contributor

@gamalielhere gamalielhere commented Feb 13, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved address selection reliability with enhanced error handling.
    • Updated clipboard paste behavior to automatically close dropdowns, streamlining transaction flows.
  • Enhancements

    • Refined wallet import flows for simpler and more consistent address generation.
    • Adjusted configuration settings for improved compatibility and stability.
  • Chores

    • Performed extensive dependency and configuration updates to boost overall performance and maintainability.

Copy link

coderabbitai bot commented Feb 13, 2025

Walkthrough

This pull request introduces extensive dependency version updates across multiple package JSON files along with minor refactors in source and configuration files. Several packages now use newer versions of tools and libraries, and the changes include syntactical improvements, such as added semicolons and updated module imports. In the UI components, address checking logic is refactored into a dedicated method with error handling, and event handlers are modified to properly toggle UI elements. Some configuration files are updated for enhanced module resolution and polyfill handling.

Changes

File(s) Change Summary
Root package.json and multiple packages (packages/extension-bridge, packages/extension, packages/hw-wallets, packages/keyring, packages/name-resolution, packages/request, packages/signers/*, packages/storage, packages/swap, packages/types, packages/utils) Updated dependency & devDependency versions (e.g. commitlint, swc, eslint, typescript, prettier, etc.) across the codebase.
packages/extension/.../empty.js
packages/extension/.../transform-manifest.ts
Added empty readFileSync and writeFileSync functions; added semicolons for consistent statement termination in manifest transformation.
packages/extension/.../send-address-item.vue
packages/extension/.../send-contacts-list.vue
Added an import for EnkryptAccount; introduced a new isChecked method with error handling to encapsulate address checking logic in the contacts list component.
packages/extension/.../send-transaction/index.vue Replaced the single-line event handler for @update:paste-from-clipboard with a multi-line arrow function that calls pasteFromClipboard() and subsequently toggleSelectContactTo(false) to close the dropdown.
packages/extension/.../main.ts Added a semicolon to correctly terminate the assignment of a global debug log configuration variable.
packages/extension/.../import-account-password.vue
packages/extension/.../import-account-private-key.vue
Updated Wallet import to use named exports from @ethereumjs/wallet and replaced getAddress().toString('hex') with getAddressString() for obtaining wallet addresses.
packages/extension/tsconfig.node.json
packages/extension/vite.config.ts
Expanded file inclusion patterns; added path aliases in TypeScript configuration and modified Vite configuration by introducing legacy settings, node polyfills adjustments, removing CSS relative URLs, and adding a custom alias for fs.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SendTxComponent
    participant Clipboard

    User->>SendTxComponent: Trigger @update:paste-from-clipboard event
    SendTxComponent->>Clipboard: Execute pasteFromClipboard()
    SendTxComponent->>SendTxComponent: Call toggleSelectContactTo(false)
Loading
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Feb 13, 2025

💼 Build Files
chrome: enkrypt-chrome-9b4efbf9.zip
firefox: enkrypt-firefox-9b4efbf9.zip

💉 Virus total analysis
chrome: 9b4efbf9
firefox: 9b4efbf9

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/extension/vite.config.ts (1)

104-104: Consider the implications of bundling all dependencies.

Setting external: [] means all dependencies will be bundled, which could lead to larger bundle sizes. Consider explicitly marking certain dependencies as external if they don't need to be bundled.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bee132 and 9b4efbf.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (25)
  • package.json (1 hunks)
  • packages/extension-bridge/package.json (1 hunks)
  • packages/extension/configs/vite/empty.js (1 hunks)
  • packages/extension/configs/vite/transform-manifest.ts (3 hunks)
  • packages/extension/package.json (3 hunks)
  • packages/extension/src/providers/common/ui/send-transaction/send-address-item.vue (1 hunks)
  • packages/extension/src/providers/common/ui/send-transaction/send-contacts-list.vue (4 hunks)
  • packages/extension/src/providers/ethereum/ui/send-transaction/index.vue (1 hunks)
  • packages/extension/src/ui/action/main.ts (1 hunks)
  • packages/extension/src/ui/action/views/import-account/views/import-account-password.vue (2 hunks)
  • packages/extension/src/ui/action/views/import-account/views/import-account-private-key.vue (2 hunks)
  • packages/extension/tsconfig.node.json (1 hunks)
  • packages/extension/vite.config.ts (4 hunks)
  • packages/hw-wallets/package.json (2 hunks)
  • packages/keyring/package.json (1 hunks)
  • packages/name-resolution/package.json (2 hunks)
  • packages/request/package.json (1 hunks)
  • packages/signers/bitcoin/package.json (1 hunks)
  • packages/signers/ethereum/package.json (1 hunks)
  • packages/signers/kadena/package.json (1 hunks)
  • packages/signers/polkadot/package.json (1 hunks)
  • packages/storage/package.json (1 hunks)
  • packages/swap/package.json (1 hunks)
  • packages/types/package.json (1 hunks)
  • packages/utils/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • packages/extension/src/ui/action/main.ts
  • packages/extension/configs/vite/empty.js
  • packages/extension/src/providers/common/ui/send-transaction/send-address-item.vue
  • packages/extension/configs/vite/transform-manifest.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: buildAll
  • GitHub Check: test
🔇 Additional comments (30)
packages/extension/src/providers/common/ui/send-transaction/send-contacts-list.vue (2)

42-42: LGTM! Improved code maintainability.

The changes centralize the address checking logic by using a dedicated method consistently across all instances of send-address-item.

Also applies to: 54-54, 72-72


120-131: LGTM! Robust error handling implementation.

The isChecked method is well-implemented with:

  • Proper error handling using try-catch
  • Safe fallback to false on error
  • Error logging for debugging
  • Type safety with TypeScript
packages/extension/src/providers/ethereum/ui/send-transaction/index.vue (1)

45-50: LGTM! Enhanced user experience.

The changes improve UX by ensuring the contact selection dropdown closes automatically after pasting an address from the clipboard.

packages/extension/src/ui/action/views/import-account/views/import-account-password.vue (2)

40-40:

❓ Verification inconclusive

Package migration from ethereumjs-wallet to @ethereumjs/wallet

The import statement has been updated to use the newer @ethereumjs/wallet package. This is a breaking change that requires verification of the package version and its compatibility.

Let's verify the package version and check for any breaking changes:


🏁 Script executed:

#!/bin/bash
# Check package.json for the version of @ethereumjs/wallet
cat package.json | jq '.dependencies["@ethereumjs/wallet"]'

# Check for any migration guides or breaking changes
curl -s https://raw.githubusercontent.com/ethereumjs/ethereumjs-monorepo/master/packages/wallet/CHANGELOG.md

Length of output: 18696


Action Required: Verify Breaking Changes in Wallet Imports & Address Retrieval

  • The import statement has been updated from using a default export (import Wallet, { thirdparty } ...) to using explicit named exports (import { Wallet, thirdparty } ...) as required by the migration to the new @ethereumjs/wallet package. This change follows the migration guide noted in the changelog (see version 2.0.0-rc.1).
  • The update to retrieve the wallet address—from using wallet.getAddress().toString('hex') to the new wallet.getAddressString() method—is consistent with the updated API.
  • Since the package version check couldn’t be performed via the repository root’s package.json (file not found), please ensure that the dependency is correctly declared (possibly in a sub-package) and that your project is using a version of @ethereumjs/wallet that supports these changes.

116-116:

✅ Verification successful

Method change from getAddress().toString('hex') to getAddressString()

The method for retrieving the wallet address has been updated to use getAddressString(). This change aligns with the new API from @ethereumjs/wallet.

Let's verify if this method is part of the public API:


🌐 Web query:

What is the recommended method to get address string in @ethereumjs/wallet?

💡 Result:

To retrieve an Ethereum address string using @ethereumjs/wallet, there are two primary methods depending on whether you need a checksummed address:

  1. Standard Address (Lowercase)
    Use getAddressString() to obtain a "0x"-prefixed hex string:

    const address = wallet.getAddressString(); // Returns "0x..." lowercase
  2. Checksum Address (EIP-55)
    For an EIP-55 compliant checksum address that helps prevent typos/errors:

    const checksumAddress = wallet.getChecksumAddressString(); // Returns mixed-case like "0x5aAeb..."

Key Implementation Details

  • Both methods internally convert raw byte data to hexadecimal strings[2][6]
  • Checksum addresses use capitalization patterns to encode validity (via keccak256 hash of lowercase address)[4][8]
  • Underlying address generation uses ECDSA public key derivation from private keys[1][4]

For most applications requiring user-facing addresses or interoperability with tools like Ethers.js/Web3.js, getChecksumAddressString() is recommended due to its built-in error detection[4][8]. Use getAddressString() only when lowercase representation is explicitly required[6][8].

Citations:


Address Retrieval API Update Verified

The use of wallet.getAddressString() to obtain the lowercase, 0x-prefixed Ethereum address is confirmed to align with the public API of @ethereumjs/wallet. Note that if a checksummed (EIP-55 compliant) address is required for user-facing contexts, consider using getChecksumAddressString() instead.

  • File: packages/extension/src/ui/action/views/import-account/views/import-account-password.vue (Line 116)
packages/extension/src/ui/action/views/import-account/views/import-account-private-key.vue (2)

39-39: Consistent package migration across components

The import statement has been updated to use @ethereumjs/wallet, maintaining consistency with the changes in import-account-password.vue.


96-96: Consistent method usage for address retrieval

The address retrieval method has been updated to use getAddressString(), maintaining consistency with the changes in import-account-password.vue.

packages/extension/vite.config.ts (1)

73-73:

❓ Verification inconclusive

Verify the necessity of the 'os' module polyfill.

The addition of the 'os' module to polyfills suggests browser-side usage of Node.js OS functionality. Let's verify where this is needed.


🏁 Script executed:

#!/bin/bash
# Search for usage of the 'os' module in the codebase
rg -l "require\(['\"]os['\"]\)|from ['\"]os['\"]\||import.*['\"]os['\"]\||window\.os"

Length of output: 99


Action: Manually Verify the ‘os’ Polyfill Necessity

The automated search did not return any clear usage of the Node.js built-in ‘os’ module across the codebase. Please manually verify whether browser-side features rely on this polyfilled functionality. If no such usage exists, consider removing the polyfill from packages/extension/vite.config.ts (line 73) to avoid unnecessary overhead.

packages/extension/tsconfig.node.json (2)

13-16: LGTM! Comprehensive include patterns added.

The additional include patterns ensure proper TypeScript compilation for source files and Vue components.


24-28: LGTM! Well-structured path aliases.

The path mappings follow TypeScript best practices and will improve module imports readability.

packages/types/package.json (1)

27-41:

❓ Verification inconclusive

Verify compatibility of major version updates.

Several dependencies have significant version updates. Please ensure compatibility, particularly:

  • eslint ^9.20.0 (major version update)
  • typescript ^5.7.3
  • typescript-eslint 8.23.0

🌐 Web query:

What are the breaking changes in ESLint 9.x compared to 8.x?

💡 Result:

ESLint v9.x introduces several significant breaking changes compared to v8.x, primarily focused on modernizing configurations, improving performance, and aligning with ecosystem standards. Here's a structured breakdown:


Configuration System Overhaul

  • Flat config as default: Replaces .eslintrc.* files with eslint.config.js (array-based structure), improving modularity and performance[4][5].
  • Legacy config deprecation: Support for .eslintrc.* files will be fully removed in ESLint v10[4].
  • Stricter rule schemas: Rules without explicit meta.schema now assume no options by default ([]), causing validation failures if options are provided[1][3].

Environment & Compatibility

  • Node.js version requirements: Dropped support for Node.js < v18.18.0 and v19[3][5].
  • Removed formatters: Legacy formatters like checkstyle, junit, and unix are removed; use standalone packages instead[3][5].
  • Deprecated rules:
    • Removed: valid-jsdoc, require-jsdoc (use eslint-plugin-jsdoc)[3][5].
    • Updated: no-inner-declarations, no-unused-vars, and others with stricter defaults[3][5].

CLI & Performance Changes

Change v8 Behavior v9 Behavior
--quiet Ran all rules but hid warnings Skips executing rules set to "warn", improving speed[1][3][5]
--output-file Skipped writing if output empty Always writes file (even empty)[3][5]
Configuration comments Multiple comments allowed (last one applied) First comment applied; others trigger errors[3][5]

Rule-Specific Breaking Changes

  1. Inline configuration adjustments:

    • Comments like /* eslint semi: "warn" */ now retain options from config files (previously overrode them)[3][5].
    • Stricter parsing of /* exported */: Invalid syntax (e.g., colons) triggers errors[3].
  2. Schema updates:

    • no-implicit-coercion: Flags new cases (e.g., foo - 0) by default[3].
    • no-restricted-imports: Accepts multiple entries with same name[3][5].
  3. Scope analysis fixes:

    • Improved strict mode directive detection[5].

Plugin/Integration Impact

  • Removed API methods: Deprecated functions like sourceCode.getComments() and legacy rule formats are dropped[3][6].
  • Code path analysis: Precalculated code paths replace dynamic evaluation; removed CodePath#currentSegments[1][3][6].

Migration Steps

  1. Upgrade Node.js to ≥v18.18.0 or ≥v20.x.
  2. Replace .eslintrc.* with eslint.config.js[4].
  3. Use npm-check-updates to update dependencies[4].

For detailed guidance, refer to ESLint’s official migration guide[3][5].

Citations:


Action: Confirm Dependency Compatibility with ESLint 9.x and TypeScript 5.7.3

Please verify that the updated dependency versions have been fully evaluated for breaking changes. In particular:

  • ESLint v9.x:

    • Review your ESLint configuration to ensure compatibility with the new flat configuration approach (i.e., the migration from legacy .eslintrc.* files to eslint.config.js if applicable).
    • Confirm that our Node.js version meets the minimum requirements (≥ v18.18.0).
    • Check that any stricter rule validations (e.g., updated rule schemas) introduced in v9.x do not disrupt our setup.
  • TypeScript & Typescript-ESLint:

    • Verify that TypeScript 5.7.3 works seamlessly with our current configuration.
    • Ensure that using both the scoped packages (@typescript-eslint/eslint-plugin and @typescript-eslint/parser at ^5.62.0) alongside the standalone typescript-eslint at 8.23.0 does not lead to conflicts.

Please double-check these points to ensure that all major version updates integrate smoothly with our codebase.

packages/storage/package.json (1)

30-45:

❓ Verification inconclusive

Verify Vitest major version upgrade impact.

The update from Vitest 2.x to 3.x (^3.0.5) is a major version change that may include breaking changes.


🌐 Web query:

What are the breaking changes in Vitest 3.0?

💡 Result:

Vitest 3.0 introduces several breaking changes that developers should be aware of when upgrading from previous versions. Here are the key breaking changes:

API and Behavior Changes

  • spy.mockReset now restores original implementations
    Previously resetting mocks left implementations as no-op functions[7]. Now mockReset() reverts to the original method implementation[1][7].

  • vi.spyOn reuses existing mocks
    Subsequent calls to spy on already-mocked methods now reuse existing spies instead of creating new ones[1][3][7]. This prevents unexpected behavior when restoring mocks.

  • Stricter error comparisons
    Error equality checks (toEqual/toThrowError) now compare:

    • Error prototypes (e.g., TypeError vs Error)[7]
    • name, message, cause, and AggregateError.errors properties[3][7]
    • Asymmetric cause property checks[7]

Configuration Changes

  • Browser testing configuration
    Deprecated browser.name and browser.providerOptions in favor of new browser.instances array for multi-browser testing[4][7].

  • Coverage defaults
    Test files are now excluded from coverage reports by default via coverage.exclude[1][3].

  • Vite 6 compatibility
    Requires Vite 6+ with updated module resolution behavior (no longer resolves module condition by default)[1][7].

Type System Changes

  • Deprecated Custom type
    The Custom type alias has been replaced with standard Test type[7]. Use new RunnerCustomCase/RunnerTestCase types instead[7].

Other Notable Changes

  • Fake timers upgrade
    Updated to @sinonjs/fake-timers@14 with potential behavior changes[1][3].

  • Test context inheritance
    Hooks now receive full context object rather than partial data[1][3].

  • Workspace configuration
    New inline workspace configuration format replaces some legacy patterns[4][7].

For a smooth migration:

  1. Review test cases using spies/mocks
  2. Update browser testing configurations
  3. Verify error comparisons
  4. Check coverage report configurations
  5. Consult the official migration guide[7] for detailed code examples

Most projects should be minimally affected if not using advanced mocking patterns or custom browser configurations[4][7]. The Vitest team provides codemods for common migration scenarios[4].

Citations:


Action Required: Verify Impact of Vitest 3.0 Upgrade

The dependency update to Vitest 3.0 (^3.0.5) introduces several breaking changes that could affect how tests run, especially if advanced mocking or browser testing configurations are in use. Please review the following points:

  • Mocking Behavior:

    • spy.mockReset now restores the original implementation, which may change the expected behavior of your mocks.
    • vi.spyOn will reuse existing mocks. Verify that this new behavior does not impact tests that assume fresh spies.
  • Error Comparisons:

    • Stricter comparison rules now check error prototypes and key properties (name, message, cause, etc.). Ensure that tests using toEqual or toThrowError reflect these changes.
  • Configuration Adjustments:

    • Browser testing configuration has changed (e.g., deprecated options replaced by new browser.instances array).
    • Default coverage exclusions now omit test files.
    • Compatibility with Vite 6+ is required, which might impact module resolution.
  • Other Changes:

    • Updated fake timers and modifications to test context inheritance may require adjustments if these features are in use.

Please consult the official migration guide for detailed information and adjust your tests and configurations as necessary.

Relevant file change: packages/storage/package.json (lines 30-45)

packages/name-resolution/package.json (1)

52-52:

✅ Verification successful

Verify compatibility with updated UnstoppableDomains resolution package.

The @unstoppabledomains/resolution package has been updated to ^9.3.3.


🌐 Web query:

Are there any breaking changes in @unstoppabledomains/resolution 9.3.3?

💡 Result:

The provided search results do not mention any breaking changes specifically for version 9.3.3 of @unstoppabledomains/resolution. However, several major breaking changes are documented in earlier versions:

Key Breaking Changes in Earlier Versions

  1. Version 5.0.0 ([source][7]):

    • Configuration Renaming: The cns configuration parameter was renamed to uns (e.g., new Resolution({ sourceConfig: { uns: {...} } })).
    • Method Renaming:
      • Resolution#fromEip1193ProviderResolution#fromEthereumEip1193Provider.
    • Factory Method Changes: All factory methods now require uns instead of cns configurations.
    • Async Updates: Resolution#isSupportedDomain became asynchronous.
  2. Java SDK Version 3.0.0 ([source][10]):

    • Replaced NamingServiceType.CNS with NamingServiceType.UNS.
    • Removed deprecated methods like getUsdt, addr, and namehash, replacing them with newer equivalents (e.g., getMultiChainAddress, getAddress, getNamehash).

Missing Information for 9.3.3

No search results explicitly reference version 9.3.3. For details on this specific version, consult:

Citations:


Dependency Check: @unstoppabledomains/resolution 9.3.3 – No Breaking Changes Detected

The web query results indicate that there are no reported breaking changes for version 9.3.3. Although earlier versions introduced some breaking changes (e.g., configuration renaming and method updates), none of these affect the 9.3.3 update.

  • The dependency update to version 9.3.3 appears safe.
  • For full assurance, please verify against the official CHANGELOG and NPM release notes.
packages/signers/kadena/package.json (1)

31-31:

✅ Verification successful

Verify Polkadot util-crypto compatibility.

The @polkadot/util-crypto package has been updated to ^13.3.1.


🌐 Web query:

What are the latest changes in @polkadot/util-crypto 13.3.1?

💡 Result:

The latest changes in @polkadot/util-crypto v13.3.1 include:

Compatibility Updates

  • Node.js v22 support: Added compatibility adjustments for Node.js v22 environments[2][5][7].

Fixes

  • getSeparator function: Fixed an issue related to toLocaleString formatting inconsistencies[2][5].

Dependency Upgrades

  • Internal package alignment: Updated dependencies across the Polkadot-js ecosystem for consistency[5][7], including upgrades to @polkadot/common[5].

These updates focus on maintaining compatibility with modern Node.js versions and resolving minor functional inconsistencies in utility functions[2][5][7].

Citations:


Polkadot util-crypto Compatibility Confirmed

The update to version 13.3.1 primarily adds Node.js v22 support, fixes minor issues (e.g., in getSeparator), and aligns internal dependencies. There’s no indication of breaking changes that affect our usage in the Kadena signer package, so no additional modifications are required.

packages/request/package.json (1)

30-30:

❓ Verification inconclusive

Verify breaking changes in uuid v11.

The uuid package has been upgraded from v10 to v11, which is a major version bump and may include breaking changes.


🌐 Web query:

What are the breaking changes in uuid v11 compared to v10?

💡 Result:

The transition from uuid v10 to v11 introduced several breaking changes primarily focused on modernization and improved type safety. Here are the key differences:

Major Breaking Changes

1. TypeScript Integration

  • The library was rewritten in TypeScript[1][3][7][10], requiring adjustments for users previously relying on @types/uuid (now obsolete)[5][10].
  • Deep imports like require('uuid/v4') are fully deprecated[7][10].

2. Node.js Version Requirements

  • Dropped support for Node.js versions below 16.x[7][10].
  • New minimum: Only Node 16-20 supported[1][3][7].

3. Internal State Handling Changes

Version Behavior Without Options Behavior With Options
≤v10 Uses internal state Modifies internal state
v11 Uses internal state Ignores internal state[5][7]

This affects timestamp-based UUIDs (v1/v6/v7) when passing custom options[5][7].

4. Browser Support Changes

  • Dropped IE11/Safari 10 compatibility[10].
  • Removed fallback to msCrypto[10].

5. Build Artifacts

  • UMD/minified builds removed from package[7][10].
  • ECMAScript Module (ESM) becomes primary format[7].

Additional Breaking Changes

  • v4() no longer defaults options parameter[1][3]
  • Binary UUIDs now use Uint8Array instead of Buffer[5][7]
  • Removed deprecated default export[7][10]

These changes aim to improve type safety and align with modern JavaScript practices while maintaining RFC 9562 compliance[4][6]. Developers should test UUID generation patterns involving custom options or legacy browser environments.

Sources: [1][3][5][7][10]

Citations:


Action Required: Verify Implementation of uuid v11 Breaking Changes

The dependency upgrade to uuid v11 introduces several breaking changes that require careful verification in your code:

  • TypeScript Integration & Deep Imports:
    Ensure that any deep imports (e.g., require('uuid/v4')) have been removed and that any reliance on @types/uuid is discontinued since the package is now fully written in TypeScript.

  • Node.js Version Requirement:
    Confirm that the runtime environment meets the new minimum requirement (Node 16+).

  • API & Internal State Handling:
    Audit calls to functions like v4() to verify that they correctly handle the new behavior—such as the absence of default options—and check for any impacts on custom options for timestamp-based UUIDs (v1/v6/v7).

  • Browser and Build Considerations:
    If applicable, ensure that your client-side code or build configuration complies with the removal of UMD/minified builds and the shift to ESM, as well as dropped support for older browsers (IE11/Safari 10).

The dependency declaration in packages/request/package.json at line 30 remains:

    "uuid": "^11.0.5",

Please verify that the rest of the codebase addresses these changes appropriately.

packages/utils/package.json (1)

27-27:

❓ Verification inconclusive

Coordinated update of Polkadot ecosystem packages.

The @polkadot/util-crypto package has been updated to ^13.3.1. This version aligns with other Polkadot ecosystem package updates across the project, maintaining compatibility.

Verify Node.js compatibility.

The package requires Node.js >= 14.15.0, but @types/node is being updated to ^22.13.1. This suggests the minimum Node.js version requirement might need to be updated.

Also applies to: 33-33


🏁 Script executed:

#!/bin/bash
# Check the Node.js version requirements in package.json files
rg -A 1 '"node":\s*">=.*"' --type json

Length of output: 1215


Update Review: Coordinated Package Update & Node.js Compatibility Check

  • The coordinated update of @polkadot/util-crypto to ^13.3.1 is in line with the other Polkadot ecosystem package updates.
  • Verification confirms that all package.json files (including packages/utils/package.json) still specify a Node.js runtime of >=14.15.0.
  • Since @types/node is now updated to ^22.13.1, please double‑check that the current minimum Node.js version is adequate for the new type definitions. This review comment applies both to line 27 and line 33 of packages/utils/package.json.
packages/signers/polkadot/package.json (1)

27-28: Coordinated update of Polkadot ecosystem packages.

Both @polkadot/util and @polkadot/util-crypto have been updated to ^13.3.1, maintaining version parity between these interdependent packages.

packages/extension-bridge/package.json (1)

42-42:

❓ Verification inconclusive

Verify breaking changes in serialize-error v12.0.0.

The update from serialize-error v11.0.3 to v12.0.0 is a major version change that might include breaking changes.


🌐 Web query:

What are the breaking changes in serialize-error v12.0.0?

💡 Result:

The serialize-error package version 12.0.0 introduced several key changes:

Breaking Changes

  1. Custom Error Constructors Requirement

    • When using addKnownErrorConstructor, custom error classes must have a parameterless constructor or adding them will throw an error[4].
    • Previously supported custom errors requiring constructor arguments became incompatible.
  2. .toJSON() Handling

    • deserializeError now invokes .toJSON() by default when present (useToJSON: true)[4]. This alters behavior for objects with custom serialization logic:
      // In v12+, this returns {custom: 'data'} instead of original properties
      deserializeError({ 
        message: 'test', 
        toJSON: () => ({custom: 'data'}) 
      });

Other Notable Changes

  • Added isErrorLike() helper to check for error-like objects[4]
  • Improved circular reference handling during (de)serialization[1][4]
  • Buffer properties now serialize as [object Buffer][1][4]

These changes improve consistency but require updates for codebases using parameterized custom errors or relying on previous .toJSON() behavior during deserialization[1][4].

Citations:


Action Required: Confirm Compatibility with Breaking Changes in serialize-error v12.0.0

The update to version 12.0.0 introduces two notable breaking changes:

  • Custom Error Constructors Requirement:
    If you’re using addKnownErrorConstructor, ensure that your custom error classes have parameterless constructors. Custom errors that previously required constructor arguments will now throw an error.

  • .toJSON() Handling in deserializeError:
    The deserializeError function now invokes .toJSON() by default (with useToJSON: true). This change may modify the serialized output for errors with custom serialization logic.

Please verify that your error handling and any custom error implementations in the codebase accommodate these changes.

File Reference:

  • packages/extension-bridge/package.json (Line 42)
packages/swap/package.json (1)

27-28:

❓ Verification inconclusive

Verify compatibility of updated Solana dependencies.

Several Solana-related packages have been updated:

  • @solana/spl-token: ^0.4.9 -> ^0.4.12
  • @solana/web3.js: ^1.95.4 -> ^1.98.0
  • rango-sdk-basic: ^0.1.58 -> ^0.1.62
  • uuid: ^10.0.0 -> ^11.0.5

The uuid update is a major version change that might include breaking changes.

Also applies to: 34-34, 36-36


🌐 Web query:

What are the breaking changes in uuid v11.0.0?

💡 Result:

The UUID library version 11.0.0 introduced several breaking changes, primarily focused on modernization and internal refactoring:

Core Breaking Changes

  • Refactored v1/v7 internals
    Internal state management for UUID versions 1 (time-based) and 7 (time-ordered) was overhauled[1][4][7][10]. Existing code relying on these implementations may require updates.

  • TypeScript port
    The library was rewritten in TypeScript[1][4][7][10], potentially affecting type declarations in JavaScript projects.

  • Node.js version support
    Dropped support for Node.js <16.x (now requires Node.js 16–20)[1][4][7][10].

Build & Browser Changes

  • UMD build removed
    The minified browser build (dist/umd/uuid.min.js) was eliminated[1][10]. Users must switch to ESM/CommonJS or modern bundlers.

  • Legacy browser support dropped
    IE11 and Safari <10 are no longer supported[1][10]. Modern browsers with ES2015+ compliance are required.

API Changes

// Before (deprecated)
const uuid = require('uuid/v4');

// After (recommended)
import { v4 as uuidv4 } from 'uuid';
  • Deep requires deprecated
    Pattern require('uuid/v4') is unsupported[1][10]. Use named imports instead.

  • Default export removed
    import uuid from 'uuid' no longer works[1][10]. Use version-specific imports like import {v4}.

Security Changes

  • Insecure browser RNG removed
    Fallback random number generators for insecure browser environments were eliminated[1][10]. Users must explicitly provide an RNG if needed.

Miscellaneous

  • V3/V5 UUID generation
    Support removed for Node.js <4.x[1][10]
  • ECMAScript Modules
    Primary distribution now uses ESM with a CommonJS fallback[1][10].

Projects upgrading should test UUID generation paths thoroughly and update import statements/Node.js versions first[2][4]. The TypeScript migration may require adjustments to build pipelines or type definitions[7][10].

Citations:


Dependency Compatibility Check: Updated Solana and uuid Packages

  • Solana Packages:

    • @solana/spl-token: Updated from ^0.4.9 to ^0.4.12
    • @solana/web3.js: Updated from ^1.95.4 to ^1.98.0
      Please confirm that there are no breaking changes affecting your use of these libraries.
  • uuid Package:

    • Updated from ^10.0.0 to ^11.0.5, which is a major version change.
    • Breaking Changes in uuid v11.x include:
      • Removal of the default export; if you previously used import uuid from 'uuid' or require('uuid/v4'), update to named imports (e.g., import { v4 as uuidv4 } from 'uuid').
      • Internal API refactors for UUID versions 1 and 7.
      • Dropped support for Node.js below v16 and removal of legacy UMD/browser builds.
        Verify that every instance where uuid is used in the codebase is compliant with these changes.
  • Additional References:

    • Ensure that similar compatibility checks are performed for the updated rango-sdk-basic (from ^0.1.58 to ^0.1.62).
    • Note that the changes at lines 34 and 36 also need to be confirmed for consistency.

Please verify that these dependency updates have been fully tested and that any necessary code adjustments (such as updating import statements for uuid) are in place.

packages/hw-wallets/package.json (2)

55-57:

✅ Verification successful

Verify compatibility of Ledger ecosystem updates.

Multiple Ledger-related packages have been updated:

  • @ledgerhq/hw-app-btc: ^10.4.3 -> ^10.5.0
  • @ledgerhq/hw-app-eth: ^6.40.3 -> ^6.42.5
  • @ledgerhq/live-common: ^34.13.1 -> ^34.20.0

Let's verify there are no known issues with these versions.

Also applies to: 60-60


🏁 Script executed:

#!/bin/bash
# Check for security advisories in Ledger packages
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: NPM, package: "@ledgerhq/hw-app-btc") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 353


Ledger package updates verified: No immediate issues detected

The security query for @ledgerhq/hw-app-btc (^10.5.0) returned no vulnerabilities, and the version bumps for @ledgerhq/hw-app-eth and @ledgerhq/live-common also appear consistent with current Ledger ecosystem updates. Please ensure that standard integration and device-specific tests are executed to further confirm compatibility.

  • packages/hw-wallets/package.json (lines 55-57 & 60):
    • @ledgerhq/hw-app-btc: ^10.4.3 → ^10.5.0 — verified with no known security advisories.
    • @ledgerhq/hw-app-eth: ^6.40.3 → ^6.42.5 — recommend routine testing.
    • @ledgerhq/live-common: ^34.13.1 → ^34.20.0 — recommend routine testing.

61-62:

❓ Verification inconclusive

Verify compatibility of Polkadot ecosystem updates.

The Polkadot-related packages have significant version changes:

  • @polkadot/types: ^14.3.1 -> ^15.5.2 (major version update)
  • @polkadot/util: ^13.2.3 -> ^13.3.1

🌐 Web query:

What are the breaking changes in @polkadot/types v15.0.0?

💡 Result:

The @polkadot/types v15.0.0 release introduced several breaking changes impacting developers:


1. TypeScript Augmentation Changes

  • Explicit Augmentation Required: Substrate-specific type augmentation is no longer applied by default for TypeScript users. Developers must add:
    import '@polkadot/api-augment';
    at their codebase entry point to restore Substrate type definitions[4][7].

2. Contract Interface Adjustments

  • Mandatory Options Objects: All api-contract construction and query methods now require an options object[1].
  • Storage Deposit Detection: Contract interfaces won't decorate methods if storageDepositLimit isn't detected in runtime parameters[1].

3. Signer Payload Modifications

  • HexString Conversion: SignerPayloadJSON now returns values as HexString instead of raw bytes to simplify cross-tool compatibility[1][7].
  • Payload Alteration Flag: Added allowCallDataAlteration to SignatureOptions/SignerOptions, defaulting to true. This allows external signers (e.g., hardware wallets) to modify payloads[1][7].

4. Metadata V15 Compatibility

  • Structural Changes: Metadata V15 removes redundant pallet-specific metadata types (PalletCallMetadata, PalletEventMetadata, etc.), consolidating them into outer enums like RuntimeCall and RuntimeEvent[6].
  • Type Overrides Required: Chains using non-default metadata formats may need explicit type overrides for compatibility[6][8].

5. Deprecated Method Removals

  • RxJS Methods: Removed deprecated RxJS-based methods (e.g., api.rx.call.*) in favor of Promise-based alternatives[1].
  • Legacy Derive Functions: Methods like api.derive.staking.nextElected were updated to use newer substrate APIs[1].

6. Runtime API & Codec Updates

  • Type Decoding Fixes: Adjusted decoding logic for nested types (e.g., Vec<Option<X>>) and fixed issues with compact decoding in byte streams[1].
  • Error Handling: Dispatch errors now use raw byte arrays ([u8; 4]) instead of mapped types[1].

Key Upgrade Recommendations:

  • Add explicit type imports (@polkadot/api-augment) for TS projects.
  • Audit contract interactions for mandatory options objects.
  • Test signer integrations with the new payload alteration flag.
  • Review metadata handling for chains targeting V15[6][7].

Citations:


Action Required: Confirm Compatibility with Breaking Changes in @polkadot/types

The update from ^14.3.1 to ^15.5.2 for @polkadot/types introduces several breaking changes that may affect your implementation:

  • TypeScript Augmentation: If your project relies on substrate-specific types, ensure you include import '@polkadot/api-augment'; in your entry point.
  • Contract Interface Adjustments: Verify that any calls to contract methods now correctly supply the mandatory options objects.
  • Signer Payload & Metadata Updates: Review usage of signer payloads and metadata handling, as these areas have undergone changes that could impact behavior.

Although the update to @polkadot/util is minor (^13.2.3 to ^13.3.1), please perform a similar review to ensure no side effects.

package.json (1)

35-42: LGTM! Development tooling updates look good.

The updates to development dependencies (@commitlint/cli, @commitlint/config-conventional, @swc/core, concurrently, husky, nodemon) are minor version changes and should not introduce breaking changes.

packages/keyring/package.json (1)

32-32: LGTM! Minor version update for @polkadot/util.

The update from ^13.2.3 to ^13.3.1 is a minor version change and should maintain backward compatibility.

packages/extension/package.json (4)

119-119:

✅ Verification successful

Review specified versions for accuracy.

Some development dependency versions appear to be incorrect or ahead of their latest stable releases:

  • eslint: ^9.20.0 (latest stable is 8.x)
  • typescript: ~5.7.3 (latest stable is 5.3.x)
  • vite: ^6.1.0 (very recent major version)

Also applies to: 133-133, 135-135


🌐 Web query:

What are the latest stable versions of ESLint, TypeScript, and Vite?

💡 Result:

As of February 13, 2025:

ESLint

  • Latest stable version: v9.20.1
    Released on February 11, 2025[9][5]. This minor update includes bug fixes and new features like enhanced configuration system improvements[1][5].

TypeScript

  • Latest stable version: v5.7.3
    Released as a patch update with critical fixes[10]. The TypeScript team continues focusing on type-checking precision and ECMAScript standard support[2][6].

Vite

  • Latest stable version: v6.x
    Vite 6 launched on November 26, 2024[3][7], featuring ecosystem growth (Vitest adoption) and compatibility with modern frameworks like TanStack Start and Ember[3]. Weekly npm downloads doubled from 7.5M to 17M since Vite 5’s release[3].

Key updates:

  • ESLint v9.x now supports language plugins for Markdown/JSON/CSS[1][4].
  • TypeScript v5.x series emphasizes stability after major features in earlier releases[2][6].
  • Vite’s support policy ensures backported fixes for versions like v4.x/v5.x alongside v6.x[7].

Upgrade paths are documented for all tools via official migration guides[1][3][7].

Citations:


Dependency versions are confirmed as current and accurate.

Based on the latest stable releases as of February 2025:

  • ESLint: The project uses ^9.20.0, which aligns with the current stable release (v9.20.1).
  • TypeScript: The specified version ~5.7.3 matches the latest stable version.
  • Vite: The ^6.1.0 version is consistent with the stable v6.x series.

All versions have been verified against the latest stable releases, and no discrepancies were found. Please continue monitoring for any post-release updates specific to Vite, though current stability is well supported.

  • Affected file: packages/extension/package.json (Lines: 119, 133, 135)

80-82:

❌ Incorrect review comment

Check Vue ecosystem version compatibility.

There appear to be inconsistencies in Vue-related package versions:

  • vue: ^3.5.13 (this version doesn't exist - latest Vue 3 is 3.4.x)
  • vue-router: ^4.5.0
  • vue-tsc: ^2.2.0

Also applies to: 139-139


🌐 Web query:

What is the latest stable version of Vue.js 3?

💡 Result:

The latest stable version of Vue.js 3 is 3.5.13, released on November 15, 2024[4][7][10]. This version includes performance optimizations to the reactivity system and resolves memory issues from previous releases[8].

Key details about Vue.js versions:

  • Active Support: Version 3.5.x currently receives active maintenance[4][6]
  • LTS Policy: Each major release's last minor version becomes LTS for 18 months[4]
  • Installation: npm install vue automatically fetches the latest stable version (3.5.x)[1][7]

The framework follows a flexible release cycle with minor updates typically every 3-6 months and major versions announced well in advance[4][6]. Commercial support remains available for Vue 2.x through third-party providers[4].

Citations:


Vue Ecosystem Versions Checked

After verification, note the following:

  • "vue": "^3.5.13" is correct—Vue 3.5.13 is indeed the latest stable release.
  • Please ensure that "vue-router": "^4.5.0" and "vue-echarts": "7.0.3" remain compatible with Vue 3.5.13.
  • If "vue-tsc": "^2.2.0" is used elsewhere, double-check that its version aligns with Vue 3.5.13.

Also applies to line 139.

Likely an incorrect or invalid review comment.


26-58:

❓ Verification inconclusive

Verify the scope of dependency updates.

The extensive updates to blockchain-related packages (@kadena, @PolkaDot, @Solana) seem broader than necessary for a paste window fix. Some updates involve major version changes that could introduce breaking changes.

Please confirm:

  1. Are these updates related to the paste window fix?
  2. Have you tested the application with these new versions?
  3. Are there any breaking changes in the major version updates?

Run this script to check for breaking changes in the updated packages:


🏁 Script executed:

#!/bin/bash
# Description: Check for breaking changes in updated packages

# Check npm for release notes and breaking changes
for pkg in "@polkadot/api" "@solana/web3.js" "@kadena/client"; do
  echo "Checking $pkg..."
  npm view $pkg changes --json | jq '.'
done

Length of output: 524


Dependency Updates Scope Verification

  • The updated packages (especially @kadena, @PolkaDot, and @Solana) have major version changes that could potentially introduce breaking changes.
  • The npm changelog checks did not explicitly report breaking changes; however, please confirm that these upgrades are intentional and tied to the paste window fix.
  • Ensure you have performed thorough testing with these new versions and that they do not affect unrelated functionality.

35-38:

❓ Verification inconclusive

Review security implications of crypto-related package updates.

Several security-sensitive packages are being updated. Please ensure:

  1. All versions are stable releases
  2. No known security vulnerabilities exist
  3. Changes are backward compatible

Also applies to: 42-42, 63-63


🏁 Script executed:

#!/bin/bash
# Description: Check for security advisories in crypto-related packages

# Check for known vulnerabilities
npm audit --json | jq '.advisories[] | select(.module_name | test("@ethereumjs|@metamask|bitcoinjs-lib"))'

# Check specific package versions for audit info
for pkg in "@ethereumjs/wallet" "@metamask/eth-sig-util" "bitcoinjs-lib"; do
  echo "Checking $pkg..."
  npm view $pkg time --json | jq '.'
done

Length of output: 5904


Security Implications of Crypto-related Package Updates

Several security-sensitive packages are updated in this change. Based on the npm metadata:

  • @ethereumjs/wallet: Version 2.0.4 (released 2024-08-15) appears to be a stable release.
  • @metamask/eth-sig-util: Recent versions (up to 8.2.0) indicate active maintenance.
  • bitcoinjs-lib: Although this package has older version metadata, please verify that the current version remains secure.

Action items:

  • Stability & Audit: Confirm that each updated package is a stable release and that no known security vulnerabilities exist.
  • npm Audit Note: The npm audit command failed because no lockfile was present. Please run npm i --package-lock-only and re-run the audit to thoroughly check for advisory issues.
  • Backwards Compatibility: Ensure that the updated versions maintain backward compatibility with the rest of the codebase.
  • Additional Locations: This review applies similarly to changes at lines 42 and 63.
packages/signers/bitcoin/package.json (2)

44-50:

✅ Verification successful

Verify compatibility of updated dev dependencies.

Please ensure these version updates are compatible with your Node.js version (>=14.15.0):

  • prettier: ^3.4.2
  • tsup: ^8.3.6
  • typescript: ^5.7.3
  • typescript-eslint: 8.23.0
  • vitest: ^3.0.5

Let's verify the latest versions and compatibility:


🏁 Script executed:

#!/bin/bash
# Description: Check latest versions of dev dependencies

for pkg in prettier tsup typescript typescript-eslint vitest; do
  echo "Checking $pkg..."
  npm view $pkg versions --json | jq -r '.[-1]'
done

Length of output: 895


Action Required: Confirm Dev Dependency Compatibility with Node.js (>=14.15.0)

We verified that the versions specified in packages/signers/bitcoin/package.json are purposefully set to stable releases where intended:

  • prettier: Using "^3.4.2" secures a stable release even though the npm registry shows a pre-release (4.0.0-alpha.10).
  • tsup: "^8.3.6" matches the current stable version.
  • typescript: "^5.7.3" remains on the stable track (the npm latest is 5.8.1-rc).
  • typescript-eslint: The package is locked at "8.23.0" to avoid unintentionally pulling in the alpha (8.24.1-alpha.1).
  • vitest: "^3.0.5" is confirmed as current.

Please ensure these dependency constraints continue to prevent accidental updates to pre-release versions and are tested for full compatibility with Node.js (>=14.15.0).


38-38: ⚠️ Potential issue

❌ Incorrect review comment

Fix incorrect eslint version.

The specified version ^9.20.0 is invalid as ESLint's current stable version is 8.x.

Let's verify the latest version:


🌐 Web query:

What is the latest version of eslint?

💡 Result:

The latest version of ESLint is v9.20.1, released on February 11, 2025[3][4]. This minor update includes bug fixes related to type synchronization, clearer error messages for invalid configurations, and improvements to rules like consistent-this and arrow-body-style[4].

For context:

  • The @typescript-eslint/eslint-plugin (a related but separate package) is on v8.24.0 as of February 10, 2025[1][8]
  • The VS Code ESLint extension currently supports ESLint v8.x+ configurations[2]

ESLint follows semantic versioning with regular updates addressing bugs, new JavaScript/TypeScript language features, and rule improvements[3][6]. When upgrading, review release notes for potential linting behavior changes[5][7].

Citations:


Subject: ESLint Version Validity Confirmed

The specified ESLint version (^9.20.0) in packages/signers/bitcoin/package.json is in line with the current stable release (v9.20.1). The original comment’s assertion—that ESLint’s stable version is 8.x—is outdated. No changes are needed.

  • Verified that ESLint’s latest stable version is v9.20.1.
  • The caret operator (^) in ^9.20.0 allows for patch updates, so the current specification is appropriate.

Likely an incorrect or invalid review comment.

packages/signers/ethereum/package.json (1)

35-35: Same version issues as in bitcoin package.

The version issues identified in the bitcoin package also apply here:

  1. Invalid @types/node version
  2. Invalid eslint version
  3. Version verification needed for other dependencies

Also applies to: 38-38, 44-50

@kvhnuke kvhnuke changed the base branch from develop to devop/upgrade-packages February 14, 2025 18:47
@gamalielhere gamalielhere changed the base branch from devop/upgrade-packages to devop/release-2.2.2 February 18, 2025 19:04
@gamalielhere gamalielhere merged commit ef4c89e into devop/release-2.2.2 Feb 18, 2025
3 of 4 checks passed
@gamalielhere gamalielhere deleted the fix/past-window branch February 18, 2025 19:23
@coderabbitai coderabbitai bot mentioned this pull request Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants