Skip to content

Conversation

@ffmcgee725
Copy link
Member

@ffmcgee725 ffmcgee725 commented Mar 5, 2025

Explanation

  • Updates the @metamask/multichain package to use new hooks provided by the Snaps MultichainRouter to enable non-evm support on the Multichain API. (#5191)
  • Migrates wallet permission handlers from extension repo. (#5420)

References

Changelog

  • BREAKING: getSessionScopes() now expects an additional hooks object as its last param. The hooks object should have a getNonEvmSupportedMethods property whose value should be a function that accepts a CaipChainId and returns an array of supported methods. (#5191)
  • BREAKING: caip25CaveatBuilder() now expects two additional properties it's singular param object. The param object should now also have a isNonEvmScopeSupported property whose value should be a function that accepts a CaipChainId and returns a boolean, and a getNonEvmAccountAddresses property whose value should be a function that accepts a CaipChainId and returns an array of CAIP-10 account addresses. (#5191)
    • The CAIP-25 caveat specification now also validates if non-evm scopes and accounts are supported
  • BREAKING: The wallet_getSession handler now expects getNonEvmSupportedMethods to be provided in it's hooks. (#5191)
    • The handler now resolves methods for non-evm scopes in the returned sessionScopes result
  • BREAKING: The wallet_invokeMethod handler now expects getNonEvmSupportedMethods and handleNonEvmRequestForOrigin to be provided in it's hooks. handleNonEvmRequestForOrigin should be a function with the following signature:
    •  handleNonEvmRequestForOrigin: (params: {
         connectedAddresses: CaipAccountId[];
         scope: CaipChainId;
         request: JsonRpcRequest;
       }) => Promise<Json>;
      
    • The handler now supports handling non-evm requests
  • BREAKING: assertScopeSupported() now expects the following hooks params object as it's last param:
    •   {
         isChainIdSupported: (chainId: Hex) => boolean;
         isEvmChainIdSupported: (chainId: Hex) => boolean;
         isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
         getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
       }
      
  • BREAKING: assertScopesSupported() now expects the following hooks params object as it's last param:
    •   {
         isChainIdSupported: (chainId: Hex) => boolean;
         isEvmChainIdSupported: (chainId: Hex) => boolean;
         isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
         getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
       }
      
  • BREAKING: bucketScopes() now expects the following hooks params object as it's last param:
    •   {
           isEvmChainIdSupported: (chainId: Hex) => boolean;
           isEvmChainIdSupportable: (chainId: Hex) => boolean;
           isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
           getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
       }
      
  • BREAKING: bucketScopesBySupport() now expects the following hooks params object as it's last param:
    •   {
           isEvmChainIdSupported: (chainId: Hex) => boolean;
           isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
           getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
       }
      
  • BREAKING: getSessionScopes() now expects a hooks object as its last param. The hooks object should have a getNonEvmSupportedMethods property whose value should be a function that accepts a CaipChainId and returns an array of supported methods.
  • BREAKING: isSupportedScopeString() now expects the a hooks params object as it's last param with the following properties:
    •   {
           isEvmChainIdSupported: (chainId: Hex) => boolean;
           isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
       }
      
  • BREAKING: isSupportedAccount() now expects the a hooks params object as it's last param with the following properties:
    •   {
           getEvmInternalAccounts: () => { type: string; address: Hex }[];
           getNonEvmAccountAddresses: (scope: CaipChainId) => string[];
       }
      
  • BREAKING: isSupportedMethod() now expects the a hooks params object as it's last param with the following properties:
    •   {
           getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
       }
      
  • Added wallet_getPermissions handler (originally migrated from extension repo) (#5420)
  • Added wallet_requestPermissions handler (originally migrated from extension repo) (#5420)
  • Added wallet_revokePermissions handler (originally migrated from extension repo) (#5420)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@ffmcgee725 ffmcgee725 marked this pull request as ready for review March 5, 2025 22:45
@ffmcgee725 ffmcgee725 requested review from a team as code owners March 5, 2025 22:45
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Left some formatting-related comments, but all of the entries recorded here make sense and I didn't see anything missing.

@ffmcgee725 ffmcgee725 requested a review from mcmire March 6, 2025 11:40
Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

One small suggestion, but looks good regardless

Comment on lines +12 to +96
### Added

- **BREAKING**: `getSessionScopes()` now expects an additional hooks object as its last param. The hooks object should have a `getNonEvmSupportedMethods` property whose value should be a function that accepts a `CaipChainId` and returns an array of supported methods. ([#5191](https://github.com/MetaMask/core/pull/5191))
- **BREAKING**: `caip25CaveatBuilder()` now expects two additional properties it's singular param object. The param object should now also have a `isNonEvmScopeSupported` property whose value should be a function that accepts a `CaipChainId` and returns a boolean, and a `getNonEvmAccountAddresses` property whose value should be a function that accepts a `CaipChainId` and returns an array of CAIP-10 account addresses. ([#5191](https://github.com/MetaMask/core/pull/5191))
- The CAIP-25 caveat specification now also validates if non-evm scopes and accounts are supported
- **BREAKING**: The `wallet_getSession` handler now expects `getNonEvmSupportedMethods` to be provided in it's hooks. ([#5191](https://github.com/MetaMask/core/pull/5191))
- The handler now resolves methods for non-evm scopes in the returned `sessionScopes` result
- **BREAKING**: The `wallet_invokeMethod` handler now expects `getNonEvmSupportedMethods` and `handleNonEvmRequestForOrigin` to be provided in it's hooks. ([#5191](https://github.com/MetaMask/core/pull/5191))

- `handleNonEvmRequestForOrigin` should be a function with the following signature:
```
handleNonEvmRequestForOrigin: (params: {
connectedAddresses: CaipAccountId[];
scope: CaipChainId;
request: JsonRpcRequest;
}) => Promise<Json>;
```
- **BREAKING**: `assertScopeSupported()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `assertScopesSupported()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `bucketScopes()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupportable: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `bucketScopesBySupport()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `getSessionScopes()` now expects a hooks object as its last param. The hooks object should have a `getNonEvmSupportedMethods` property whose value should be a function that accepts a `CaipChainId` and returns an array of supported methods. ([#5191](https://github.com/MetaMask/core/pull/5191))
- **BREAKING**: `isSupportedScopeString()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
}
```
- **BREAKING**: `isSupportedAccount()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
getEvmInternalAccounts: () => { type: string; address: Hex }[];
getNonEvmAccountAddresses: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `isSupportedMethod()` now expects a new hooks object as its last param:
- The new hooks object is:
```
{
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- Added `wallet_invokeMethod` handler now supports non-EVM requests ([#5191](https://github.com/MetaMask/core/pull/5191))
- Added `wallet_getPermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
- Added `wallet_requestPermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
- Added `wallet_revokePermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
Copy link
Member

@mikesposito mikesposito Mar 6, 2025

Choose a reason for hiding this comment

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

nit: Should the last entries be grouped under ### Added, and the rest under Changed instead? I'm leaving the one related to wallet_invokeMethod under Changed since it looks like it was already there

Suggested change
### Added
- **BREAKING**: `getSessionScopes()` now expects an additional hooks object as its last param. The hooks object should have a `getNonEvmSupportedMethods` property whose value should be a function that accepts a `CaipChainId` and returns an array of supported methods. ([#5191](https://github.com/MetaMask/core/pull/5191))
- **BREAKING**: `caip25CaveatBuilder()` now expects two additional properties it's singular param object. The param object should now also have a `isNonEvmScopeSupported` property whose value should be a function that accepts a `CaipChainId` and returns a boolean, and a `getNonEvmAccountAddresses` property whose value should be a function that accepts a `CaipChainId` and returns an array of CAIP-10 account addresses. ([#5191](https://github.com/MetaMask/core/pull/5191))
- The CAIP-25 caveat specification now also validates if non-evm scopes and accounts are supported
- **BREAKING**: The `wallet_getSession` handler now expects `getNonEvmSupportedMethods` to be provided in it's hooks. ([#5191](https://github.com/MetaMask/core/pull/5191))
- The handler now resolves methods for non-evm scopes in the returned `sessionScopes` result
- **BREAKING**: The `wallet_invokeMethod` handler now expects `getNonEvmSupportedMethods` and `handleNonEvmRequestForOrigin` to be provided in it's hooks. ([#5191](https://github.com/MetaMask/core/pull/5191))
- `handleNonEvmRequestForOrigin` should be a function with the following signature:
```
handleNonEvmRequestForOrigin: (params: {
connectedAddresses: CaipAccountId[];
scope: CaipChainId;
request: JsonRpcRequest;
}) => Promise<Json>;
```
- **BREAKING**: `assertScopeSupported()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `assertScopesSupported()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `bucketScopes()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupportable: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `bucketScopesBySupport()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `getSessionScopes()` now expects a hooks object as its last param. The hooks object should have a `getNonEvmSupportedMethods` property whose value should be a function that accepts a `CaipChainId` and returns an array of supported methods. ([#5191](https://github.com/MetaMask/core/pull/5191))
- **BREAKING**: `isSupportedScopeString()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
}
```
- **BREAKING**: `isSupportedAccount()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
getEvmInternalAccounts: () => { type: string; address: Hex }[];
getNonEvmAccountAddresses: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `isSupportedMethod()` now expects a new hooks object as its last param:
- The new hooks object is:
```
{
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- Added `wallet_invokeMethod` handler now supports non-EVM requests ([#5191](https://github.com/MetaMask/core/pull/5191))
- Added `wallet_getPermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
- Added `wallet_requestPermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
- Added `wallet_revokePermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
### Added
- Added `wallet_getPermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
- Added `wallet_requestPermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
- Added `wallet_revokePermissions` handler (originally migrated from extension repo) ([#5420](https://github.com/MetaMask/core/pull/5420))
### Changed
- **BREAKING**: `getSessionScopes()` now expects an additional hooks object as its last param. The hooks object should have a `getNonEvmSupportedMethods` property whose value should be a function that accepts a `CaipChainId` and returns an array of supported methods. ([#5191](https://github.com/MetaMask/core/pull/5191))
- **BREAKING**: `caip25CaveatBuilder()` now expects two additional properties it's singular param object. The param object should now also have a `isNonEvmScopeSupported` property whose value should be a function that accepts a `CaipChainId` and returns a boolean, and a `getNonEvmAccountAddresses` property whose value should be a function that accepts a `CaipChainId` and returns an array of CAIP-10 account addresses. ([#5191](https://github.com/MetaMask/core/pull/5191))
- The CAIP-25 caveat specification now also validates if non-evm scopes and accounts are supported
- **BREAKING**: The `wallet_getSession` handler now expects `getNonEvmSupportedMethods` to be provided in it's hooks. ([#5191](https://github.com/MetaMask/core/pull/5191))
- The handler now resolves methods for non-evm scopes in the returned `sessionScopes` result
- **BREAKING**: The `wallet_invokeMethod` handler now expects `getNonEvmSupportedMethods` and `handleNonEvmRequestForOrigin` to be provided in it's hooks. ([#5191](https://github.com/MetaMask/core/pull/5191))
- `handleNonEvmRequestForOrigin` should be a function with the following signature:
```
handleNonEvmRequestForOrigin: (params: {
connectedAddresses: CaipAccountId[];
scope: CaipChainId;
request: JsonRpcRequest;
}) => Promise<Json>;
```
- **BREAKING**: `assertScopeSupported()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `assertScopesSupported()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `bucketScopes()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isEvmChainIdSupportable: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `bucketScopesBySupport()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `getSessionScopes()` now expects a hooks object as its last param. The hooks object should have a `getNonEvmSupportedMethods` property whose value should be a function that accepts a `CaipChainId` and returns an array of supported methods. ([#5191](https://github.com/MetaMask/core/pull/5191))
- **BREAKING**: `isSupportedScopeString()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
isEvmChainIdSupported: (chainId: Hex) => boolean;
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
}
```
- **BREAKING**: `isSupportedAccount()` now expects a new hooks object as its last param ([#5191](https://github.com/MetaMask/core/pull/5191))
- The new hooks object is:
```
{
getEvmInternalAccounts: () => { type: string; address: Hex }[];
getNonEvmAccountAddresses: (scope: CaipChainId) => string[];
}
```
- **BREAKING**: `isSupportedMethod()` now expects a new hooks object as its last param:
- The new hooks object is:
```
{
getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
}
```
- The `wallet_invokeMethod` handler now supports non-EVM requests ([#5191](https://github.com/MetaMask/core/pull/5191))

@ffmcgee725 ffmcgee725 merged commit 13784c5 into main Mar 6, 2025
136 checks passed
@ffmcgee725 ffmcgee725 deleted the release/318.0.0 branch March 6, 2025 12:09
matthewwalsh0 pushed a commit that referenced this pull request Mar 6, 2025
## Explanation

- Updates the @metamask/multichain package to use new hooks provided by
the Snaps MultichainRouter to enable non-evm support on the Multichain
API. ([#5191](#5191))
- Migrates wallet permission handlers from `extension` repo.
([#5420](#5420))

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Changelog

- **BREAKING**: `getSessionScopes()` now expects an additional hooks
object as its last param. The hooks object should have a
`getNonEvmSupportedMethods` property whose value should be a function
that accepts a `CaipChainId` and returns an array of supported methods.
([#5191](#5191))
- **BREAKING**: `caip25CaveatBuilder()` now expects two additional
properties it's singular param object. The param object should now also
have a `isNonEvmScopeSupported` property whose value should be a
function that accepts a `CaipChainId` and returns a boolean, and a
`getNonEvmAccountAddresses` property whose value should be a function
that accepts a `CaipChainId` and returns an array of CAIP-10 account
addresses. ([#5191](#5191))
- The CAIP-25 caveat specification now also validates if non-evm scopes
and accounts are supported
- **BREAKING**: The `wallet_getSession` handler now expects
`getNonEvmSupportedMethods` to be provided in it's hooks.
([#5191](#5191))
- The handler now resolves methods for non-evm scopes in the returned
`sessionScopes` result
- **BREAKING**: The `wallet_invokeMethod` handler now expects
`getNonEvmSupportedMethods` and `handleNonEvmRequestForOrigin` to be
provided in it's hooks. `handleNonEvmRequestForOrigin` should be a
function with the following signature:
  - ```
     handleNonEvmRequestForOrigin: (params: {
       connectedAddresses: CaipAccountId[];
       scope: CaipChainId;
       request: JsonRpcRequest;
     }) => Promise<Json>;
    ```
  - The handler now supports handling non-evm requests
- **BREAKING**: `assertScopeSupported()` now expects the following hooks
params object as it's last param:
  - ```
      {
       isChainIdSupported: (chainId: Hex) => boolean;
       isEvmChainIdSupported: (chainId: Hex) => boolean;
       isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
       getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
     }
    ```
- **BREAKING**: `assertScopesSupported()` now expects the following
hooks params object as it's last param:
  - ```
      {
       isChainIdSupported: (chainId: Hex) => boolean;
       isEvmChainIdSupported: (chainId: Hex) => boolean;
       isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
       getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
     }
    ```
- **BREAKING**: `bucketScopes()` now expects the following hooks params
object as it's last param:
  - ```
      {
         isEvmChainIdSupported: (chainId: Hex) => boolean;
         isEvmChainIdSupportable: (chainId: Hex) => boolean;
         isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
         getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
     }
    ```
- **BREAKING**: `bucketScopesBySupport()` now expects the following
hooks params object as it's last param:
  - ```
      {
         isEvmChainIdSupported: (chainId: Hex) => boolean;
         isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
         getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
     }
    ```
- **BREAKING**: `getSessionScopes()` now expects a hooks object as its
last param. The hooks object should have a `getNonEvmSupportedMethods`
property whose value should be a function that accepts a `CaipChainId`
and returns an array of supported methods.
- **BREAKING**: `isSupportedScopeString()` now expects the a hooks
params object as it's last param with the following properties:
  - ```
      {
         isEvmChainIdSupported: (chainId: Hex) => boolean;
         isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
     }
    ```
- **BREAKING**: `isSupportedAccount()` now expects the a hooks params
object as it's last param with the following properties:
  - ```
      {
         getEvmInternalAccounts: () => { type: string; address: Hex }[];
         getNonEvmAccountAddresses: (scope: CaipChainId) => string[];
     }
    ```
- **BREAKING**: `isSupportedMethod()` now expects the a hooks params
object as it's last param with the following properties:
  - ```
      {
         getNonEvmSupportedMethods: (scope: CaipChainId) => string[];
     }
    ```
- Added `wallet_getPermissions` handler (originally migrated from
extension repo) ([#5420](#5420))
- Added `wallet_requestPermissions` handler (originally migrated from
extension repo) ([#5420](#5420))
- Added `wallet_revokePermissions` handler (originally migrated from
extension repo) ([#5420](#5420))

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
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.

5 participants