Skip to content

Latest commit

 

History

History
1094 lines (683 loc) · 50.2 KB

File metadata and controls

1094 lines (683 loc) · 50.2 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Fixed

  • Detect and recover missing permissions for preinstalled Snaps (#3775)

Fixed

  • Improve registry verification speed (#3770)
  • Increase default ping timeout (#3773)

Added

  • Add support for DateTimePicker component (#3698)

Changed

  • Bump @metamask/permission-controller from 12.1.0 to 12.1.1 (#3746)

Fixed

  • Use no-cache for fetching registry (#3760)

Added

  • BREAKING: Ensure user has onboarded before allowing usage of SnapController (#3731)
    • This is breaking as it adds a new required constructor argument to SnapController called ensureOnboardingComplete.
  • BREAKING: Support specified clientVersions in the registry (#3737)
    • This is breaking as it adds a new required constructor argument to JsonSnapsRegistry called clientConfig.

Fixed

  • Override disableSnapInstallation feature flag when using automatic updates (#3735)

Added

  • Add NPM proxy support (#3695)

Changed

  • Bump @metamask/permission-controller from 12.0.0 to 12.1.0 (#3714)
  • Bump @metamask/phishing-controller from 13.1.0 to 15.0.0 (#3707)

Removed

  • Remove logic for granting CAIP-25 permissions (#3723)

Fixed

  • Prevent initial connections from being revoked as unused on update (#3729)
  • Keep dynamic permissions on update (#3726)

Changed

  • BREAKING: Use new Messenger from @metamask/messenger (#3611)
    • Previously, SnapController, CronjobController, SnapInsightsController, SnapInterfaceController, MultichainRouter, ExecutionService and WebSocketService accepted a RestrictedMessenger instance from @metamask/base-controller.
  • BREAKING: Metadata property anonymous renamed to includeInDebugSnapshot (#3611)
  • Bump @metamask/approval-controller from ^7.2.0 to ^8.0.0((#3611)
  • Bump @metamask/base-controller from ^8.4.1 to ^9.0.0((#3611)
  • Bump @metamask/permission-controller from ^11.0.6 to ^12.0.0((#3611)

Fixed

  • Throw if Snap not installed (#3666)

Fixed

  • Stop creating errors before needing to throw (#3664)

Added

  • BREAKING: Allow updating preinstalled Snaps via the registry (#3616)
    • SnapController:updateBlockedSnaps has been renamed to SnapController:updateRegistry.
  • Add two new controller state metadata properties: includeInStateLogs and usedInUi (#3632)

Changed

  • BREAKING: Make SnapInterfaceController:createInterface and SnapInterfaceController:updateInterface actions synchronous (#3361)
  • BREAKING: Remove useCaip25Permission feature flag and enable behaviour by default (#3413)
  • BREAKING: Use hash private functions for updating internals (#3601)
    • updateSnap, processRequestedSnap and authorize are no longer publicly available functions.
  • Move JSON-RPC request inspection outside of the executor (#3356)
  • Simplify JSON-RPC failure validation (#3661)
  • Bump MetaMask dependencies (#3651, #3638, #3648, #3630, #3628, #3629, #3607, #3623, #3612)

Fixed

  • Properly roll back initialConnections (#3618)
  • Display a warning instead of an error when Snaps fail to terminate (#3621)

Fixed

  • Throw a different error when the NPM registry returns 404 while fetching tarballs (#3602)
  • Prevent logging multiple errors as the cause when a Snap crashes due to an unhandled error (#3569)

Fixed

  • Prevent double scheduling events and ensure long-running events work correctly (#3561)
  • Emit event when destroying execution environment streams (#3074)
  • Ignore terminate calls to not executing Snaps (#3559)
  • Properly stop Snaps when clearing state (#3552)

Added

  • Add support for onActive and onInactive lifecycle hooks (#3542)

Changed

  • Bump @metamask/phishing-controller from 12.6.0 to 13.1.0 (#3538)

Fixed

  • Use custom state manager for cronjob controller (#3539)

Added

  • Add support for non-fungible assets to endowment:assets (#3527)
  • Add feature flag to treat local Snaps as preinstalled (#3523)

Fixed

  • Clear cronjobs properly for local Snaps (#3514)
  • Improve error message for cancelled requests when a Snap is stopped (#3518)
  • Improve execution service error messages (#3521)
  • Ensure Snap gets half of allocated initialization time (#3522)

Fixed

  • Handle scheduled events close to current time gracefully (#3510)

Added

  • Add support for onAssetsMarketData handler (#3496)

Changed

  • BREAKING: Move CronjobController init to separate function (#3507)

Fixed

  • Always delete socket when close is emitted (#3465)
  • Add missing boilerplate to WebSocketService (#3464)

Added

  • Add WebSocketService for WebSockets support (#3450)
    • This service must be instantiated to invoke onWebSocketEvent when WebSocket messages are received.
  • Add SnapController:init to support onStart handler (#3455)
    • This function should be called when the client has been fully started.

Changed

  • BREAKING: Drop support for Node.js 18 and 21 (#3447)
  • BREAKING: Refactor cronjob controller to reduce duplication (#3421)
    • The jobs state property was removed in favour of the events property, which now contains all background events and cronjobs.
    • CronjobController:schedule now expects a schedule field instead of date.
    • Some actions were renamed to remove the BackgroundEvent suffix:
      • CronjobController:scheduleBackgroundEvent -> CronjobController:schedule.
      • CronjobController:cancelBackgroundEvent -> CronjobController:cancel.
      • CronjobController:getBackgroundEvents -> CronjobController:get.

Fixed

  • Log errors that cause a crash (#3443)
  • Recover from a crash more gracefully (#3440)
    • This resolves possible race conditions when sending requests to a Snap that is in the process of being stopped.

Fixed

  • Support lifecycle hooks for preinstalled Snaps (#3426)

Added

  • Add support for AccountSelector component (#3088)

Changed

  • Fetch registry files in parallel (#3416)

Fixed

  • Prevent scheduling background events less than 1 second in the future (#3414)

Added

  • Add isMinimumPlatformVersion action (#3405)

Changed

  • Pass origin to SnapKeyring via MultichainRouter (#3403)

Added

  • Add support for wallet_switchEthereumChain (#2634)
  • Add support for SIP-31 onClientRequest handler (#3394)

Fixed

  • Fix wrong event name for Snap Export Used (#3389)
  • Remove undefined parameters in MultichainRouter (#3388)

Added

  • Add Snap export usage metrics (#3281)

Changed

  • Bump @metamask/post-message-stream from 9.0.0 to 10.0.0 (#3322)
  • Bump @metamask/base-controller from 8.0.0 to 8.0.1 (#3365)

Removed

  • BREAKING: Remove web worker execution service (#3371)

Fixed

  • Catch cronjob errors during initialization (#3373)
  • Clear unencrypted Snap state when resetting the client (#3382)

Fixed

  • Use more performant function to determine if message is a notification (#3352)
  • Stop unnecessarily encoding messages in web view executor (#3347)

Fixed

  • Increase size of request queue when Snap is starting up (#3340)

Fixed

  • Make comparison case sensitive in MultichainRouter (#3310)

Added

  • Add support for market data to onAssetsConversion handler (#3299)
  • Add support for onAssetHistoricalPrice handler (#3282)

Changed

  • Debounce persistence of state updates (#3258)

Fixed

  • Inject context into onUserInput request (#3298)
  • Consider protocol Snaps when determining isSupportedScope (#3284)
  • Validate origin in handleRequest (#3292)
  • Update name and symbol to be optional in a fungible asset type (#3300)
  • Stop refreshing phishing list when updating interfaces (#3272)

Added

  • Add support for the AddressInput component (#3129)
  • Add support for the AssetSelector component (#3166)
  • Add mutex to getSnapState to prevent concurrent decryption (#3234)

Changed

  • Increase Snap interface context size limit slightly (#3246)
  • Bump @metamask/key-tree from 10.1.0 to 10.1.1 (#3254)
  • Bump nanoid from 3.1.31 to 3.3.10 (#3228, #3255)

Fixed

  • Handle withKeyring breaking change in MultichainRouter (#3238)

Changed

  • BREAKING: Use mnemonic seed for state encryption key derivation (#3217)
    • SnapController now expects a getMnemonicSeed hook that must return the BIP-39 seed for the user's primary mnemonic.

Changed

  • Log unhandled Snap errors (#3157)
  • Bump @metamask/phishing-controller from 12.3.2 to 12.4.0 (#3171)

Fixed

  • Improve error messaging (#3142)

Changed

  • BREAKING: Use a WebView per Snap on mobile (#3085)
    • WebViewExecutionService now requires createWebView and removeWebView constructor arguments, getWebView is no longer supported.
  • BREAKING: Encode messages in WebViewMessageStream as byte arrays (#3077)
    • A version of the Snaps execution environment that supports this encoding is required.
  • Bump MetaMask dependencies (#3091, #3092, #3084, #3083, #3082, #3050)

Fixed

  • Recreate JSON-RPC request in MultichainRouter (#3086)
  • Properly pass down execution service constructor args (#3110)

Fixed

  • Add name and state to ExecutionService and MultichainRouter (#3058)
  • Allow null in the endowment:assets handlers return value (#3056)
  • Rename ControllerMessenger to Messenger (#3053)

Added

  • Add MultichainRouter for SIP-26 (#2875)
  • Add onProtocolRequest support for SIP-26 (#2875)
  • Add getRunnableSnaps action to SnapController (#3049)

Fixed

  • Set name correctly for SnapController (#3052, #3054)

Added

  • Add support for onAssetsLookup and onAssetsConversion handlers (#3028)

Added

  • Added support for non-recurring cronjobs via snap_scheduleBackgroundEvent (#2941)

Changed

Fixed

  • Stop storing messenger manually in CronjobController (#3006)

Added

  • Add support for onSettingsPage export (#2911)

Fixed

  • Use BigInt for processing insight chain IDs (#2935)

Added

  • Add clientCryptography property for specifying custom cryptography functions (#2909)

Added

  • Emit snapInstalled and snapUpdated events for preinstalled Snaps (#2900)
    • This indirectly makes preinstalled Snaps trigger cronjobs and lifecycle hooks more reliably.

Added

  • Add interface persistence (#2856)

Changed

  • Use arrayBuffer for fetching local Snaps (#2884)
    • This fixes some incompatiblities with React Native.

Added

  • Add platform version field to manifest (#2803)

Changed

  • Bump MetaMask dependencies (#2853)

Fixed

  • Stop unnecesarily validating JSON for stored state (#2845)
  • Reduce unnecessary JSON validation (#2844)

Fixed

  • Pass full URLs to PhishingController (#2835)
  • Ignore Snap insight response if transaction or signature has already been signed (#2825)

Changed

  • Allow updating interface context (#2809)
    • snap_updateInterface now accepts a context parameter to update the context of an interface.

Removed

  • Remove AccountSelector component (#2794)
    • This is technically a breaking change, but the AccountSelector component was never actually implemented, so it should not affect any existing code.

Changed

  • Add AccountSelector component (#2764, #2768, #2766)
  • Convert createWindow parameters to options bag (#2765)

Added

  • Add support for metamask: schemed URLs (#2719)

Added

  • Export WebViewMessageStream and related types (#2746)

Fixed

  • Fix invalid exports field (#2740)

Added

  • Add hideSnapBranding flag for preinstalled Snaps (#2713, #2717)

Fixed

  • Fix invalid types in type declaration in some cases (#2714)

Added

  • Add stopAllSnaps function to SnapController (#2674)

Fixed

  • Fix ESM version of the package (#2682)
    • This fixes the ESM version of the package to be fully compliant with the ESM standard.
  • Bump @metamask/utils from ^9.1.0 to ^9.2.1 (#2680)
  • Bump other MetaMask dependencies (#2703)

Added

  • Add Selector component (#2645)
  • Add missing types for getState action & stateChange event (#2655, #2659)

Fixed

  • Fix fetch binding under LavaMoat (#2642)

Added

  • Add RadioGroup component (#2592)

Changed

  • Persist severity property in SnapInsightsController (#2612)

Changed

  • Bump @metamask/approval-controller from ^7.0.0 to ^7.0.2 (#2593)
  • Bump @metamask/base-controller from ^6.0.1 to ^6.0.2 (#2593)
  • Bump @metamask/json-rpc-engine from ^9.0.0 to ^9.0.2 (#2593)
  • Bump @metamask/json-rpc-middleware-stream from ^8.0.0 to ^8.0.2 (#2593)
  • Bump @metamask/permission-controller from ^10.0.1 to ^11.0.0 (#2593)
  • Bump @metamask/phishing-controller from ^10.0.0 to ^10.1.1 (#2593)
  • Bump @metamask/snaps-utils from ^7.8.0 to ^7.8.1 (#2595)

Added

  • Add snap_resolveInterface RPC method to the SnapInterfaceController (#2509)
  • Add SnapInsightsController (#2555)

Changed

  • Bump @metamask/base-controller from ^6.0.0 to ^6.0.1 (#2445)
  • Bump @metamask/permission-controller from ^10.0.0 to ^10.0.1 (#2445)
  • Bump @metamask/rpc-errors from ^6.2.1 to ^6.3.1 (#2445)
  • Bump @metamask/snaps-registry from ^3.1.0 to ^3.2.1 (#2445)
  • Bump @metamask/snaps-rpc-methods to ^10.0.0 (#2589)
  • Bump @metamask/snaps-sdk to ^6.1.0 (#2589)
  • Bump @metamask/snaps-utils to ^7.8.0 (#2589)
  • Bump @metamask/utils from ^8.3.0 to ^9.1.0 (#2445)
  • Bump peer dependency @metamask/snaps-execution-environments to ^6.6.1 (#2589)

Fixed

  • Handle initial connections for preinstalled Snaps (#2591)
  • Account for revoked origins when calculating the difference in initialConnections (#2535)
    • Fixes issue of revoking permissions that are already revoked.
    • Enables revoked connections to be highlighted as being re-added in the UI.
  • Enforce stricter size limits for source code, static auxiliary files, and snap_getFile return values (#2527)
    • Prevent communication failures by enabling compliance with JSON-RPC extension message requirements.

Added

  • Add feature flag to disable Snap installation (#2521)

Added

  • Add Checkbox component (#2501)
  • Add FileInput component (#2469)
  • Support additional components inside forms (#2497)

Changed

  • BREAKING: Defer creation of offscreen document in OffscreenExecutionService (#2473)
  • Update onNameLookup response to include domainName (#2484)
  • Bump MetaMask dependencies (#2460)

Fixed

  • Properly decrypt legacy state blobs (#2472)

Added

  • Add hidden flag for preinstalled Snaps (#2463)

Fixed

  • Use first Dropdown option as the default value (#2465)

Fixed

  • Fix react-native export for tools that don't support package.json exports (#2451)

Added

  • Add origin to lifecycle hooks (#2441)
    • Lifecycle hooks can now use the origin parameter to determine the origin of the installation or update.

Added

  • Add context field to snap_createInterface (#2413)
  • Add feature flag to disable platform (#2434)
  • Add support for Dropdown component (#2420)
  • Add initialConnections diff calculations needed for Snap update (#2424)

Fixed

  • Correctly merge caveats when using initial connections (#2419)

Fixed

  • Re-instantiate preinstalled Snaps after clearing state (#2393)

Added

  • Add JSX support for custom UI (#2258)

Changed

  • Bump @metamask/approval-controller from 6.0.1 to 6.0.2 (#2380)
  • Bump @metamask/base-controller from 5.0.1 to 5.0.2 (#2375)

Fixed

  • Fix an issue where certain types of executors would be timed out too quickly (#2389)

Changed

  • BREAKING: Move maxInitTime constructor argument from SnapController to ExecutionService (#2348)

Fixed

  • Increase max UI size limit from 250 KB to 10 MB (#2342)
  • Consider caveats in permissions difference calculation (#2345)
    • This fixes a bug where certain caveats would not be correctly applied when updating Snaps.
  • Gracefully handle errors for multiple simultaneous failing requests (#2346)
  • Properly handle termination of Snaps that are currently executing (#2304)
  • Properly tear down partially initialized executors and improve stability when executor initialization fails (#2348)

Fixed

  • Fix encryption key caching issues (#2326)

Changed

  • BREAKING: Refactor encryption to enable caching (#2316)
    • New required constructor arguments encryptor and getMnemonic have been added.
  • Include initialConnections in approval requestState (#2322)

Fixed

  • Delete unencrypted state when uninstalling a Snap (#2311)

Changed

  • Bump MetaMask dependencies (#2270)

Changed

  • Handle unavailable registry more gracefully (#2256)
  • Bump @metamask/snaps-registry to ^3.0.1 (#2255)
  • Bump @metamask/json-rpc-engine to ^7.3.3 (#2247)

Changed

  • Improve timeout handling when the execution environment fails to load (#2242)

Fixed

  • Fix minor build configuration problems (#2220)

Changed

  • BREAKING: Update ESM build to be fully compliant with the ESM standard (#2210)
  • BREAKING: Move Node.js exports to separate export (#2210)
    • The default export is now browser-compatible.
    • Node.js APIs can be imported from <package>/node.
  • Bump @metamask/rpc-errors to ^6.2.1 (#2209)

Fixed

  • Add sizing limits for custom UI (#2199)

Fixed

  • Fix issue installing non-allowlisted Snaps in allowlist mode (#2196)

Added

  • Add support for dynamic user interfaces (#1465, #2126, #2144, #2152, #2143)
  • Add support for Snap defined execution timeouts (#2098)
    • A Snap can now define maxRequestTime to extend or shorten its execution timeout.
  • Add WebViewExecutionService for mobile execution (#2005)

Changed

  • Loosen allowlist requirements (#1672)
    • Snaps with certain permissions can now be installed without being allowlisted.
  • Reintroduce DecompressionStream for improved installation performance (#2110)
  • Bump tar-stream (#2116)
    • This fixes a problem where Snaps would sometimes fail to download from NPM.
  • Bump several MetaMask dependencies (#2129, #2132, #2130, #2139, #2142)
  • Pass localized snap name to SubjectMetadataController (#2157)

Removed

  • BREAKING: Remove endowment permission specifications from this package (#2155)
    • They can now be found in snaps-rpc-methods.

Added

  • Add support for signature insights (#2074)
  • Add support for initial connections (#2048)
  • Add support for preinstalled snaps (#2008)
  • Add additional install events (#2087)

Changed

  • Bump several MetaMask dependencies (#2086, #2100)

Changed

  • BREAKING: Remove :snapAdded event (#2073)
  • BREAKING: Remove :snapRemoved event (#2076)
  • Populate subject metadata when snaps are added to state (#2069)

Changed

  • Revert usage of DecompressionStream (#2052)
  • Refactor NpmLocation class (#2038)
    • Most logic is now located in BaseNpmLocation, making it easier to extend without duplication.
  • Bump several MetaMask dependencies (#2053, #2061, #2064, #2065, #2067)

Removed

  • Remove support for object-like syntax for cronjobs (#2057)
    • Since this never worked in the first place we aren't marking it as breaking.

Changed

  • Improve SnapController constructor types (#2023)
  • Bump snaps-registry (#2020)

Changed

  • Reduce memory usage by removing source code and state from runtime (#2009)
  • Improve base64 encoding/decoding speeds (#1985)
  • Use DecompressionStream for NPM fetching when available (#1971)
  • Bump several MetaMask dependencies (#1989, #1993, #1987, #1983)

Fixed

  • Fix idle snap timeout for unused snap (#2010)

Changed

  • Bump several MetaMask dependencies (#1964, #1961)

Fixed

  • Fix a few issues with passing non-JSON-serializable values (#1974)

Changed

  • Use SubtleCrypto for checksum calculation if available (#1953)
    • This reduces the time of the checksum calculation by up to 95% in some environments.
  • Use @metamask/snaps-sdk package (#1930, #1949)
    • This package replaces the @metamask/snaps-types and
    • @metamask/snaps-ui packages.

Fixed

  • Fix support for transaction insight Snaps returning null (#1952)

Added

  • Add manifest localization functionality (#1889)
  • Add support for unencrypted storage using snap_manageState (#1902)
  • Add OnHomePage export (#1896)

Added

  • Add support for links in custom UI and notifications (#1814)

Fixed

  • Fix an issue where snaps throwing a SnapError would be allowed to run for longer than expected (#1897)

Fixed

  • Fix a few issues with allowlist version resolving (#1888)

Added

  • Add static file API (#1836)
    • This adds a snap_getFile method, which Snaps can use to load files.
  • Add origin parameter to snapInstalled and snapUpdated events (#1867)

Changed

  • Improve error handling (#1841)
    • Snaps can now throw a SnapError, without causing the Snap to crash.
  • Bump tar-stream from ^2.2.0 to ^3.1.6 (#1853)
  • Make snaps-execution-environments an optional peer dependency (#1845)
  • Remove snap errors from state (#1837)

Fixed

  • Try to match requested versions with an allowlisted version (#1877)
  • Improve performance when installing snaps with a static version (#1878)
  • Stop persisting snaps in the installing state (#1876)

Added

  • Add keyring export and endowment (#1787)
  • Add optional allowedOrigins field to endowment:rpc (#1822)
    • This can be used to only accept certain origins in your Snap.

Changed

  • BREAKING: Bump minimum Node.js version to ^18.16.0 (#1741)

Added

  • Add SnapController:snapUninstalled event (#1800)

Fixed

  • Fix some issues with SnapController events (#1800)
  • Fix an issue where cronjobs would continually be executed on init (#1790)

Changed

  • Remove deprecated endowment:long-running (#1751)

Changed

  • Initial stable release from main branch (#1757)

Added

  • Add onNameLookup export (#1394)

Changed

  • Remove pump (#1730)
  • Bump metamask/utils and metamask/snaps-registry (#1738)

Fixed

  • Fix cronjob running on disabled snaps (#1743)

Changed

  • Bump @metamask/post-message-stream from 6.1.2 to 7.0.0 (#1707, #1724)
  • Bump @metamask/utils and @metamask/snaps-registry (#1694)

Fixed

  • Fix unpacking zero byte files from NPM (#1708)

Fixed

  • Remove unused dependencies (#1680)

Fixed

  • Fix parallel usage of registry (#1669)

Added

  • Add onInstall and onUpdate lifecycle hooks (#1643)

Changed

  • Make updateBlockedSnaps update the registry (#1625)
  • Move source code and snap state back to controller state (#1634)

Changed

  • Release package independently (#1600)
    • The version of the package no longer needs to match the version of all other MetaMask Snaps packages.