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

update metamask sdk to 0.28.2 #4249

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/connectors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"@coinbase/wallet-sdk": "4.0.4",
"@metamask/sdk": "0.27.0",
"@metamask/sdk": "0.28.2",
"@safe-global/safe-apps-provider": "0.18.3",
"@safe-global/safe-apps-sdk": "9.1.0",
"@walletconnect/ethereum-provider": "2.15.3",
Expand Down
12 changes: 4 additions & 8 deletions packages/connectors/src/metaMask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ export function metaMask(parameters: MetaMaskParameters = {}) {
// See: https://github.com/vitejs/vite/issues/9703
const MetaMaskSDK = await (async () => {
const { default: SDK } = await import('@metamask/sdk')
// @ts-ignore
if (typeof SDK !== 'function' && typeof SDK.default === 'function')
return SDK.default
return SDK as unknown as typeof SDK.default
// @ts-ignore
return SDK.default // @ts-ignore
return SDK as unknown as typeof SDK.default // @ts-ignore
})()

sdk = new MetaMaskSDK({
Expand Down Expand Up @@ -357,12 +359,6 @@ export function metaMask(parameters: MetaMaskParameters = {}) {
if (provider && !!(await this.getAccounts()).length) return
}

// Remove cached SDK properties.
if (typeof localStorage !== 'undefined') {
localStorage.removeItem('MMSDK_cached_address')
localStorage.removeItem('MMSDK_cached_chainId')
}

config.emitter.emit('disconnect')

// Manage EIP-1193 event listeners
Expand Down
32 changes: 19 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.