From 5496a306795fa3b7d0a35407fc078bcba501e06d Mon Sep 17 00:00:00 2001 From: rileystephens28 Date: Wed, 11 Sep 2024 15:29:54 -0500 Subject: [PATCH] Fix issue where browser provider never resolves `initPromise` --- src/providers/provider-browser.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/providers/provider-browser.ts b/src/providers/provider-browser.ts index 80e7da99..87a96b0e 100644 --- a/src/providers/provider-browser.ts +++ b/src/providers/provider-browser.ts @@ -70,6 +70,8 @@ export class BrowserProvider extends JsonRpcApiProvider { constructor(ethereum: Eip1193Provider, network?: Networkish) { super(network, { batchMaxCount: 1 }); + if (this.initResolvePromise) this.initResolvePromise(); + this.#request = async (method: string, params: Array | Record) => { const payload = { method, params }; this.emit('debug', undefined, { action: 'sendEip1193Request', payload }); @@ -116,6 +118,7 @@ export class BrowserProvider extends JsonRpcApiProvider { * @returns {Promise} The result of the request. */ async send(method: string, params: Array | Record): Promise { + console.log('BrowserProvider.send', method, params); await this._start(); return await super.send(method, params);