@@ -7,7 +7,7 @@ import type {
77import { providerErrors } from '@metamask/rpc-errors' ;
88import type { CaipAccountId } from '@metamask/utils' ;
99import type { InvokeMethodOptions , RPCAPI , Scope } from 'src/domain' ;
10- import type { MultichainSDK } from 'src/multichain' ;
10+ import type { MetaMaskConnectMultichain } from 'src/multichain' ;
1111
1212// uint32 (two's complement) max
1313// more conservative than Number.MAX_SAFE_INTEGER
@@ -26,11 +26,11 @@ export class MultichainApiClientWrapperTransport implements Transport {
2626
2727 private readonly notificationCallbacks = new Set < ( data : unknown ) => void > ( ) ;
2828
29- constructor ( private readonly multichainSDK : MultichainSDK ) { }
29+ constructor ( private readonly metamaskConnectMultichain : MetaMaskConnectMultichain ) { }
3030
3131 isTransportDefined ( ) : boolean {
3232 try {
33- return Boolean ( this . multichainSDK . transport ) ;
33+ return Boolean ( this . metamaskConnectMultichain . transport ) ;
3434 } catch ( error ) {
3535 return false ;
3636 }
@@ -47,7 +47,7 @@ export class MultichainApiClientWrapperTransport implements Transport {
4747 }
4848
4949 setupNotifcationListener ( ) {
50- this . multichainSDK . transport . onNotification (
50+ this . metamaskConnectMultichain . transport . onNotification (
5151 this . notifyCallbacks . bind ( this ) ,
5252 ) ;
5353 }
@@ -104,7 +104,7 @@ export class MultichainApiClientWrapperTransport implements Transport {
104104 } ;
105105 }
106106
107- return this . multichainSDK . transport . onNotification ( callback ) ;
107+ return this . metamaskConnectMultichain . transport . onNotification ( callback ) ;
108108 }
109109
110110 async #walletCreateSession( request : TransportRequestWithId ) {
@@ -130,13 +130,13 @@ export class MultichainApiClientWrapperTransport implements Transport {
130130 const accounts = [ ...new Set ( scopeAccounts ) ] ;
131131
132132 console . log ( '📚 SDK connect' ) ;
133- await this . multichainSDK . connect (
133+ await this . metamaskConnectMultichain . connect (
134134 scopes ,
135135 accounts ,
136136 createSessionParams . sessionProperties ,
137137 ) ;
138138 console . log ( '📚 SDK connected' ) ;
139- return this . multichainSDK . transport . request ( {
139+ return this . metamaskConnectMultichain . transport . request ( {
140140 method : 'wallet_getSession' ,
141141 } ) ;
142142 }
@@ -151,7 +151,7 @@ export class MultichainApiClientWrapperTransport implements Transport {
151151 } ,
152152 } ;
153153 }
154- return this . multichainSDK . transport . request ( {
154+ return this . metamaskConnectMultichain . transport . request ( {
155155 method : 'wallet_getSession' ,
156156 } ) ;
157157 }
@@ -162,7 +162,7 @@ export class MultichainApiClientWrapperTransport implements Transport {
162162 }
163163
164164 try {
165- this . multichainSDK . disconnect ( ) ;
165+ this . metamaskConnectMultichain . disconnect ( ) ;
166166 return { jsonrpc : '2.0' , id : request . id , result : true } ;
167167 } catch ( error ) {
168168 return { jsonrpc : '2.0' , id : request . id , result : false } ;
@@ -173,7 +173,7 @@ export class MultichainApiClientWrapperTransport implements Transport {
173173 if ( ! this . isTransportDefined ( ) ) {
174174 return { error : providerErrors . unauthorized ( ) } ;
175175 }
176- const result = this . multichainSDK . invokeMethod (
176+ const result = this . metamaskConnectMultichain . invokeMethod (
177177 request . params as InvokeMethodOptions ,
178178 ) ;
179179
0 commit comments