Skip to content

Conversation

Halleys123
Copy link
Contributor

useSDK is now modified and connect, terminate options have moved to sdk object inside useSDK function

Description

This PR updates the usage of useSDK from @metamask/sdk-react to reflect the recent API change where connect and terminate methods have moved inside the sdk object returned by useSDK.

Changes made:

Updated destructuring from:
const { connect, terminate, account, chainId, ethereum } = useSDK()

to:

const { account, chainId, ethereum, sdk } = useSDK()
  • Updated wallet connection logic from await connect() to await sdk?.connect().
  • Updated wallet disconnection logic from await terminate() to await sdk?.terminate().

useSDK is now modified and connect, terminate options have moved to sdk object inside useSDK function
@Halleys123 Halleys123 requested review from a team as code owners August 12, 2025 18:55
Copy link

vercel bot commented Aug 12, 2025

@Halleys123 is attempting to deploy a commit to the Consensys Team on Vercel.

A member of the Team first needs to authorize it.

@shahbaz17 shahbaz17 requested review from a team as code owners September 9, 2025 10:20
Copy link

vercel bot commented Sep 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
metamask-docs Ready Ready Preview Comment Sep 9, 2025 10:33am

Copy link
Member

@shahbaz17 shahbaz17 left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you for your contribution, @Halleys123

@shahbaz17 shahbaz17 merged commit 1486f6d into MetaMask:main Sep 9, 2025
19 checks passed
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.

2 participants