Skip to content

Commit d594c19

Browse files
fix(web): chain-types
1 parent 9e9d62e commit d594c19

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"@tanstack/react-query": "^5.62.2",
9898
"@types/react-modal": "^3.16.3",
9999
"@wagmi/connectors": "^5.5.0",
100-
"@wagmi/core": "^2.15.0",
100+
"@wagmi/core": "^2.16.3",
101101
"@yornaath/batshit": "^0.9.0",
102102
"chart.js": "^3.9.1",
103103
"chartjs-adapter-moment": "^1.0.1",

web/src/context/Web3Provider.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ const alchemyToViemChain: Record<number, string> = {
4040
type AlchemyProtocol = "https" | "wss";
4141

4242
// https://github.com/alchemyplatform/alchemy-sdk-js/blob/c4440cb/src/util/const.ts#L16-L18
43-
function alchemyURL(protocol: AlchemyProtocol, chainId: number): string {
43+
function alchemyURL(protocol: AlchemyProtocol, chainId: number | string): string {
4444
const network = alchemyToViemChain[chainId];
4545
if (!network) {
4646
throw new Error(`Unsupported chain ID: ${chainId}`);
4747
}
4848
return `${protocol}://${network}.g.alchemy.com/v2/${alchemyApiKey}`;
4949
}
5050

51-
export const getChainRpcUrl = (protocol: AlchemyProtocol, chainId: number) => {
51+
export const getChainRpcUrl = (protocol: AlchemyProtocol, chainId: number | string) => {
5252
return alchemyURL(protocol, chainId);
5353
};
5454

@@ -57,9 +57,9 @@ export const getDefaultChainRpcUrl = (protocol: AlchemyProtocol) => {
5757
};
5858

5959
export const getTransports = () => {
60-
const alchemyTransport = (chain: Chain) =>
60+
const alchemyTransport = (chain: AppKitNetwork) =>
6161
fallback([http(alchemyURL("https", chain.id)), webSocket(alchemyURL("wss", chain.id))]);
62-
const defaultTransport = (chain: Chain) =>
62+
const defaultTransport = (chain: AppKitNetwork) =>
6363
fallback([http(chain.rpcUrls.default?.http?.[0]), webSocket(chain.rpcUrls.default?.webSocket?.[0])]);
6464

6565
return {

yarn.lock

+1-21
Original file line numberDiff line numberDiff line change
@@ -5635,7 +5635,7 @@ __metadata:
56355635
"@typescript-eslint/utils": "npm:^8.15.0"
56365636
"@wagmi/cli": "npm:^2.1.18"
56375637
"@wagmi/connectors": "npm:^5.5.0"
5638-
"@wagmi/core": "npm:^2.15.0"
5638+
"@wagmi/core": "npm:^2.16.3"
56395639
"@yornaath/batshit": "npm:^0.9.0"
56405640
chart.js: "npm:^3.9.1"
56415641
chartjs-adapter-moment: "npm:^1.0.1"
@@ -10747,26 +10747,6 @@ __metadata:
1074710747
languageName: node
1074810748
linkType: hard
1074910749

10750-
"@wagmi/core@npm:^2.15.0":
10751-
version: 2.15.0
10752-
resolution: "@wagmi/core@npm:2.15.0"
10753-
dependencies:
10754-
eventemitter3: "npm:5.0.1"
10755-
mipd: "npm:0.0.7"
10756-
zustand: "npm:5.0.0"
10757-
peerDependencies:
10758-
"@tanstack/query-core": ">=5.0.0"
10759-
typescript: ">=5.0.4"
10760-
viem: 2.x
10761-
peerDependenciesMeta:
10762-
"@tanstack/query-core":
10763-
optional: true
10764-
typescript:
10765-
optional: true
10766-
checksum: 10/b40ed089ddb23f7573e682105e41fe510f375e88612591dd841eefba06e2ffd0d2b2fdd8b1603d2c7e6aa4f70aa2bd94d12b6b578b3fe2c7abcb545ef24ff822
10767-
languageName: node
10768-
linkType: hard
10769-
1077010750
"@wallet-standard/app@npm:^1.1.0":
1077110751
version: 1.1.0
1077210752
resolution: "@wallet-standard/app@npm:1.1.0"

0 commit comments

Comments
 (0)