Skip to content

use findNetworkClientIdByChainId hook to get the networkClientId for caip-27 handler#25582

Merged
jiexi merged 3 commits intojl/mmp-2360/caip-25-pocfrom
sj/caip-25-poc-findNetworkClientIdByChainId
Jun 28, 2024
Merged

use findNetworkClientIdByChainId hook to get the networkClientId for caip-27 handler#25582
jiexi merged 3 commits intojl/mmp-2360/caip-25-pocfrom
sj/caip-25-poc-findNetworkClientIdByChainId

Conversation

@shanejonas
Copy link
Copy Markdown
Contributor

@shanejonas shanejonas commented Jun 28, 2024

Description

this uses the findNetworkClientIdByChainId hook to get the networkClientId for caip-27 handler

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@shanejonas shanejonas requested a review from a team as a code owner June 28, 2024 14:39
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead label Jun 28, 2024
return end(new Error('missing CAIP-25 endowment'));
}

const chainId = scope.split(':')[1];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should try to use our CAIP type helpers

https://github.com/MetaMask/utils/blob/main/src/caip-types.ts#L114

const chainId = scope.split(':')[1];

if (!chainId) {
return end(new Error('missing chainId'));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if we use the helper, we can throw the parsing error from the helper back

Copy link
Copy Markdown
Member

@jiexi jiexi left a comment

Choose a reason for hiding this comment

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

looks legit!

@jiexi jiexi merged commit e855f07 into jl/mmp-2360/caip-25-poc Jun 28, 2024
@jiexi jiexi deleted the sj/caip-25-poc-findNetworkClientIdByChainId branch June 28, 2024 17:37
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants