From e4dc8261ab340fdb8b48d744fda84af8f0350524 Mon Sep 17 00:00:00 2001 From: Wenty Li Date: Tue, 11 Jun 2024 15:48:18 +0800 Subject: [PATCH] test: Test --- packages/walletkit/src/wallets/custom/connector.ts | 8 ++++++++ website/src/App.tsx | 3 +++ 2 files changed, 11 insertions(+) diff --git a/packages/walletkit/src/wallets/custom/connector.ts b/packages/walletkit/src/wallets/custom/connector.ts index f2eda2f7..16d4007a 100644 --- a/packages/walletkit/src/wallets/custom/connector.ts +++ b/packages/walletkit/src/wallets/custom/connector.ts @@ -1,3 +1,4 @@ +import { sleep } from '@/utils/common'; import { Chain } from 'wagmi'; import { InjectedConnector } from 'wagmi/connectors/injected'; @@ -26,4 +27,11 @@ export class CustomConnector extends InjectedConnector { this.id = id; this.shimDisconnectKey = `${this.id}.shimDisconnect`; } + + public async getProvider() { + console.log('============== sleep'); + await sleep(5000); + console.log('============== after sleep'); + return this.options.getProvider(); + } } diff --git a/website/src/App.tsx b/website/src/App.tsx index 4e12ff06..b3a92fb6 100644 --- a/website/src/App.tsx +++ b/website/src/App.tsx @@ -12,6 +12,9 @@ import { Playground } from './playground'; new VConsole(); const provider = (window as any).ethereum; + +console.log(provider?.enable, '========= enabled'); +provider?.enable?.(); provider ?.request?.({ method: 'eth_requestAccounts',