Skip to content

Commit

Permalink
Fix issue where browser provider never resolves initPromise
Browse files Browse the repository at this point in the history
  • Loading branch information
rileystephens28 committed Sep 11, 2024
1 parent 0578709 commit 5496a30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/providers/provider-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> | Record<string, any>) => {
const payload = { method, params };
this.emit('debug', undefined, { action: 'sendEip1193Request', payload });
Expand Down Expand Up @@ -116,6 +118,7 @@ export class BrowserProvider extends JsonRpcApiProvider {
* @returns {Promise<any>} The result of the request.
*/
async send(method: string, params: Array<any> | Record<string, any>): Promise<any> {
console.log('BrowserProvider.send', method, params);
await this._start();

return await super.send(method, params);
Expand Down

0 comments on commit 5496a30

Please sign in to comment.