Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
use providerProxy instead of actual provider
  • Loading branch information
jiexi committed Nov 21, 2025
commit 3db0e50c7e7e83d0923848bbaa1926d812c4d8cd
12 changes: 0 additions & 12 deletions packages/connect-multichain/src/multichain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export { getInfuraRpcUrls } from '../domain/multichain/api/infura';
const logger = createLogger('metamask-sdk:core');

export class MultichainSDK extends MultichainCore {
private __provider: MultichainApiClient<RPCAPI> | undefined = undefined;
private __providerProxy = createProviderProxy(this);

private __transport: ExtendedTransport | undefined = undefined;
Expand All @@ -103,15 +102,6 @@ export class MultichainSDK extends MultichainCore {
}

get provider(): MultichainApiClient<RPCAPI> {
if (this.__provider) {
return this.__provider;
}

if (this.__transport) {
this.__provider = getMultichainClient({ transport: this.__transport });
return this.__provider;
}

return this.__providerProxy;
}

Expand Down Expand Up @@ -595,14 +585,12 @@ export class MultichainSDK extends MultichainCore {
this.listener = undefined;
this.__beforeUnloadListener = undefined;
this.__transport = undefined;
this.__provider = undefined;
this.__dappClient = undefined;
}

async invokeMethod(request: InvokeMethodOptions): Promise<Json> {
const { sdkInfo, transport, options } = this;

this.__provider ??= getMultichainClient({ transport });

const rpcClient = new RpcClient(options, sdkInfo);
const requestRouter = new RequestRouter(transport, rpcClient, options);
Expand Down