File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,10 @@ function App() {
160160 const handleWalletAnnounce = useCallback (
161161 ( ev : Event ) => {
162162 const customEvent = ev as CustomEvent ;
163- const { extensionId : announcedId , rdns } = customEvent . detail . params ;
163+ const { targets, rdns } = customEvent . detail . params ;
164+ const announcedId = targets ?. find (
165+ ( target : { type : string ; value : string } ) => target . type === 'caip-348' ,
166+ ) ?. value ;
164167 const newExtensionId =
165168 rdns === 'io.metamask.flask' && ! announcedId
166169 ? WINDOW_POST_MESSAGE_ID
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ class MetaMaskMultichainExternallyConnectableProvider extends MetaMaskMultichain
4242
4343 this . #port. onMessage . addListener ( ( message ) => {
4444 const { type, data } = message ;
45- if ( type !== 'caip-x ' ) {
45+ if ( type !== 'caip-348 ' ) {
4646 return ;
4747 }
4848 this . _handleMessage ( data ) ;
@@ -72,7 +72,7 @@ class MetaMaskMultichainExternallyConnectableProvider extends MetaMaskMultichain
7272 }
7373
7474 _sendRequest ( request : JsonRpcRequest ) {
75- this . #port?. postMessage ( { type : 'caip-x ' , data : request } ) ;
75+ this . #port?. postMessage ( { type : 'caip-348 ' , data : request } ) ;
7676 }
7777}
7878
You can’t perform that action at this time.
0 commit comments