Assert BrowserProvider receives an EIP-1193 provider to fail early when passing undefined ethereum object.
This commit is contained in:
parent
095de51e60
commit
b69f43bc6f
@ -49,6 +49,8 @@ export class BrowserProvider extends JsonRpcApiPollingProvider {
|
||||
* %%network%%.
|
||||
*/
|
||||
constructor(ethereum: Eip1193Provider, network?: Networkish) {
|
||||
assertArgument(ethereum && ethereum.request, "invalid EIP-1193 provider", "ethereum", ethereum);
|
||||
|
||||
super(network, { batchMaxCount: 1 });
|
||||
|
||||
this.#request = async (method: string, params: Array<any> | Record<string, any>) => {
|
||||
|
Loading…
Reference in New Issue
Block a user