From 3f4eb0935fd6ea3b92d2cbcab85016c26fdb4303 Mon Sep 17 00:00:00 2001 From: yuche Date: Wed, 18 Sep 2024 17:17:50 +0800 Subject: [PATCH] fix: linter --- packages/ethereum-provider/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ethereum-provider/src/index.ts b/packages/ethereum-provider/src/index.ts index 3e09bf2..074cc58 100644 --- a/packages/ethereum-provider/src/index.ts +++ b/packages/ethereum-provider/src/index.ts @@ -149,8 +149,8 @@ export class EthereumProvider extends EventEmitter { throw new Error('eth_sign is not supported, use personal_sign instead') } case 'wallet_switchEthereumChain': { - const chainId = args.params?.[0]?.chainId as string - this.switchChain(parseInt(chainId)) + const [chainId] = args.params as [chainId: string] + this.switchChain(Number.parseInt(chainId, 10)) this.emit('chainChanged', chainId) return undefined }