Skip to content

Commit 347358f

Browse files
committed
clean up, fixes
1 parent f8a31ed commit 347358f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/App.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ import { Porto } from "porto";
88

99
import type { EIP6963ProviderInfo, EIP1193, AnnounceEvent } from "./types.ts";
1010

11-
const ALL_CHAINS: Chain[] = Object.values(chains).filter(
12-
(c: any) =>
13-
typeof c === "object" &&
14-
c !== null &&
15-
"id" in c &&
16-
typeof (c as any).id === "number"
17-
);
11+
const ALL_CHAINS: Chain[] = Object.values(chains) as Chain[];
1812
const byId = (id: number) => ALL_CHAINS.find((c) => c.id === id);
1913

2014
export function App() {

src/types.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ export type EIP6963ProviderInfo = {
66
};
77

88
export type EIP1193 = {
9-
request: (args: { method: string; params?: any[] | object }) => Promise<any>;
10-
on?: (event: string, listener: (...args: any[]) => void) => void;
11-
removeListener?: (event: string, listener: (...args: any[]) => void) => void;
9+
request: (args: {
10+
method: string;
11+
params?: unknown[] | object;
12+
}) => Promise<unknown>;
13+
on?: (event: string, listener: (...args: unknown[]) => void) => void;
14+
removeListener?: (
15+
event: string,
16+
listener: (...args: unknown[]) => void
17+
) => void;
1218
};
1319

1420
export type AnnounceEvent = CustomEvent<{

0 commit comments

Comments
 (0)