Skip to content

Commit 79e1742

Browse files
authored
chore(api-reference) Update chainlist (#2050)
* chore(api-reference) Update chainlist * fixed lint * pnpm lock file * fix
1 parent cd2ad61 commit 79e1742

File tree

5 files changed

+913
-552
lines changed

5 files changed

+913
-552
lines changed

apps/api-reference/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"react-dom": "^18.3.1",
4141
"react-markdown": "^9.0.1",
4242
"shiki": "^1.7.0",
43-
"viem": "^2.15.1",
43+
"viem": "^2.21.32",
4444
"wagmi": "^2.10.4",
4545
"zod": "^3.23.8"
4646
},

apps/api-reference/src/components/EvmProvider/index.tsx

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ReactNode } from "react";
77
import * as chains from "viem/chains";
88
import { WagmiProvider, createConfig, http, useChainId } from "wagmi";
99

10-
import { NETWORK_IDS /*, getRpcUrl */ } from "../../evm-networks";
10+
import { NETWORK_IDS, getRpcUrl } from "../../evm-networks";
1111
import { metadata } from "../../metadata";
1212

1313
const CHAINS = NETWORK_IDS.map((id) =>
@@ -18,27 +18,16 @@ const CHAINS = NETWORK_IDS.map((id) =>
1818
];
1919

2020
const TRANSPORTS = Object.fromEntries(
21-
CHAINS.map((chain) => [chain.id, http()]),
21+
CHAINS.map((chain) => {
22+
const url = getRpcUrl(chain.id);
23+
if (url) {
24+
return [chain.id, http(url)];
25+
} else {
26+
throw new Error(`No rpc url found for ${chain.name}`);
27+
}
28+
}),
2229
);
2330

24-
// TODO figure out if we should use the rpc urls from contract-manager, which
25-
// assume use of ronin & blast and require API keys, or the ones from viem which
26-
// require no keys.
27-
//
28-
// If we should use contract-manager's, uncomment this code and remove the prior
29-
// implementation of `TRANSPORTS`.
30-
//
31-
// const TRANSPORTS = Object.fromEntries(
32-
// CHAINS.map((chain) => {
33-
// const url = getRpcUrl(chain.id);
34-
// if (url) {
35-
// return [chain.id, http(url)];
36-
// } else {
37-
// throw new Error(`No rpc url found for ${chain.name}`);
38-
// }
39-
// }),
40-
// );
41-
4231
type EvmProviderProps = {
4332
children: ReactNode;
4433
walletConnectProjectId?: string | undefined;

apps/api-reference/src/evm-networks.ts

Lines changed: 144 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { BLAST_API_KEY, RONIN_API_KEY } from "./isomorphic-config";
2-
31
export const getContractAddress = (networkId: number) =>
42
isSupportedNetwork(networkId)
53
? NETWORK_INFO[networkId].contractAddress
@@ -27,7 +25,7 @@ type NetworkInfo = {
2725
export const NETWORK_INFO = {
2826
[1]: {
2927
name: "ethereum",
30-
rpcUrl: `https://eth-mainnet.blastapi.io/${BLAST_API_KEY}`,
28+
rpcUrl: `https://eth.llamarpc.com `,
3129
isMainnet: true,
3230
contractAddress: "0x4305FB66699C3B2702D4d05CF36551390A4c69C6",
3331
},
@@ -297,13 +295,13 @@ export const NETWORK_INFO = {
297295
},
298296
[2020]: {
299297
name: "ronin",
300-
rpcUrl: `https://api-gateway.skymavis.com/rpc?apikey=${RONIN_API_KEY}`,
298+
rpcUrl: `https://api.roninchain.com/rpc`,
301299
isMainnet: true,
302300
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
303301
},
304302
[2021]: {
305303
name: "saigon",
306-
rpcUrl: `https://api-gateway.skymavis.com/rpc/testnet?apikey=${RONIN_API_KEY}`,
304+
rpcUrl: `https://edgeware-evm0.jelliedowl.net`,
307305
isMainnet: false,
308306
contractAddress: "0xEbe57e8045F2F230872523bbff7374986E45C486",
309307
},
@@ -357,7 +355,7 @@ export const NETWORK_INFO = {
357355
},
358356
[4002]: {
359357
name: "fantom_testnet",
360-
rpcUrl: `https://fantom-testnet.blastapi.io/${BLAST_API_KEY}`,
358+
rpcUrl: `https://rpc.ankr.com/fantom_testnet`,
361359
isMainnet: false,
362360
contractAddress: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
363361
},
@@ -537,7 +535,7 @@ export const NETWORK_INFO = {
537535
},
538536
[59_140]: {
539537
name: "linea_goerli",
540-
rpcUrl: `https://linea-goerli.blastapi.io/${BLAST_API_KEY}`,
538+
rpcUrl: `https://rpc.goerli.linea.build`,
541539
isMainnet: false,
542540
contractAddress: "0xdF21D137Aadc95588205586636710ca2890538d5",
543541
},
@@ -559,18 +557,6 @@ export const NETWORK_INFO = {
559557
isMainnet: false,
560558
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
561559
},
562-
[64_165]: {
563-
name: "fantom_sonic_testnet",
564-
rpcUrl: "https://rpc.sonic.fantom.network/",
565-
isMainnet: false,
566-
contractAddress: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
567-
},
568-
[80_001]: {
569-
name: "mumbai",
570-
rpcUrl: `https://polygon-testnet.blastapi.io/${BLAST_API_KEY}`,
571-
isMainnet: false,
572-
contractAddress: "0xFC6bd9F9f0c6481c6Af3A7Eb46b296A5B85ed379",
573-
},
574560
[80_002]: {
575561
name: "polygon_amoy",
576562
rpcUrl: "https://polygon-amoy-bor-rpc.publicnode.com",
@@ -699,7 +685,7 @@ export const NETWORK_INFO = {
699685
},
700686
[11_155_111]: {
701687
name: "sepolia",
702-
rpcUrl: `https://eth-sepolia.blastapi.io/${BLAST_API_KEY}`,
688+
rpcUrl: `https://ethereum-sepolia-rpc.publicnode.com`,
703689
isMainnet: false,
704690
contractAddress: "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",
705691
},
@@ -763,6 +749,144 @@ export const NETWORK_INFO = {
763749
isMainnet: false,
764750
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
765751
},
752+
[89]: {
753+
name: "viction_testnet",
754+
rpcUrl: "https://rpc-testnet.viction.xyz",
755+
isMainnet: false,
756+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
757+
},
758+
[1663]: {
759+
name: "horizen_gobi",
760+
rpcUrl: "https://rpc.ankr.com/horizen_gobi_testnet",
761+
isMainnet: false,
762+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
763+
},
764+
[6_038_361]: {
765+
name: "astar_zkyoto_testnet",
766+
rpcUrl: "https://rpc.startale.com/zkyoto",
767+
isMainnet: false,
768+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
769+
},
770+
[8822]: {
771+
name: "iota",
772+
rpcUrl: "https://json-rpc.evm.iotaledger.net",
773+
isMainnet: true,
774+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
775+
},
776+
[9789]: {
777+
name: "tabi_testnet",
778+
rpcUrl: "https://rpc-internal.testnet.tabichain.com/",
779+
isMainnet: false,
780+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
781+
},
782+
[1993]: {
783+
name: "b3_testnet",
784+
rpcUrl: "https://sepolia.b3.fun/http/",
785+
isMainnet: false,
786+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
787+
},
788+
[7887]: {
789+
name: "kinto",
790+
rpcUrl: "https://rpc.kinto-rpc.com",
791+
isMainnet: true,
792+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
793+
},
794+
[282]: {
795+
name: "cronos_zkevm_testnet",
796+
rpcUrl: "https://testnet.zkevm.cronos.org",
797+
isMainnet: false,
798+
contractAddress: "0x67DFF3D12dFDCeC9f85fd86f4cBDb0a111fF721A",
799+
},
800+
[89_346_162]: {
801+
name: "reya_testnet",
802+
rpcUrl: "https://rpc.reya-cronos.gelato.digital",
803+
isMainnet: false,
804+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
805+
},
806+
[8333]: {
807+
name: "b3_mainnet",
808+
rpcUrl: "https://mainnet-rpc.b3.fun/http",
809+
isMainnet: true,
810+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
811+
},
812+
[388]: {
813+
name: "cronos_zkevm_mainnet",
814+
rpcUrl: "https://mainnet.zkevm.cronos.org",
815+
isMainnet: true,
816+
contractAddress: "0x056f829183Ec806A78c26C98961678c24faB71af",
817+
},
818+
[30_732]: {
819+
name: "movement_evm_devnet_imola",
820+
rpcUrl: "https://mevm.devnet.imola.movementlabs.xyz",
821+
isMainnet: false,
822+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
823+
},
824+
[545]: {
825+
name: "flow_testnet",
826+
rpcUrl: "https://testnet.evm.nodes.onflow.org",
827+
isMainnet: false,
828+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
829+
},
830+
[94_524]: {
831+
name: "idex_xchain_mainnet",
832+
rpcUrl: "https://xchain-rpc.idex.io/",
833+
isMainnet: true,
834+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
835+
},
836+
[33_111]: {
837+
name: "apechain_testnet",
838+
rpcUrl: "https://curtis.rpc.caldera.xyz/http",
839+
isMainnet: false,
840+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
841+
},
842+
[1946]: {
843+
name: "soneium_minato_testnet",
844+
rpcUrl: "https://rpc.minato.soneium.org/",
845+
isMainnet: false,
846+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
847+
},
848+
[33_139]: {
849+
name: "apechain_mainnet",
850+
rpcUrl: "https://apechain.calderachain.xyz/http",
851+
isMainnet: true,
852+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
853+
},
854+
[747]: {
855+
name: "flow_mainnet",
856+
rpcUrl: "https://mainnet.evm.nodes.onflow.org",
857+
isMainnet: true,
858+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
859+
},
860+
[11_124]: {
861+
name: "abstract_testnet",
862+
rpcUrl: "https://api.testnet.abs.xyz",
863+
isMainnet: false,
864+
contractAddress: "0x47F2A9BDAd52d65b66287253cf5ca0D2b763b486",
865+
},
866+
[1996]: {
867+
name: "sanko",
868+
rpcUrl: "https://mainnet.sanko.xyz",
869+
isMainnet: true,
870+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
871+
},
872+
[1992]: {
873+
name: "sanko_testnet",
874+
rpcUrl: "https://sanko-arb-sepolia.rpc.caldera.xyz",
875+
isMainnet: false,
876+
contractAddress: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
877+
},
878+
[1301]: {
879+
name: "unichain_sepolia",
880+
rpcUrl: "https://sepolia.unichain.org",
881+
isMainnet: false,
882+
contractAddress: "0x2880aB155794e7179c9eE2e38200202908C17B43",
883+
},
884+
[64_165]: {
885+
name: "fantom_sonic_testnet",
886+
rpcUrl: "https://rpc.testnet.soniclabs.com",
887+
isMainnet: false,
888+
contractAddress: "0x96124d1F6E44FfDf1fb5D6d74BB2DE1B7Fbe7376",
889+
},
766890
} satisfies Record<number, NetworkInfo>;
767891

768892
export const NETWORK_IDS = Object.keys(NETWORK_INFO).map((key) =>

apps/api-reference/src/isomorphic-config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@
1111
* with the optimized React build, etc.
1212
*/
1313
export const IS_PRODUCTION_BUILD = process.env.NODE_ENV === "production";
14-
15-
export const BLAST_API_KEY = process.env.NEXT_PUBLIC_BLAST_API_KEY ?? "";
16-
export const RONIN_API_KEY = process.env.NEXT_PUBLIC_RONIN_API_KEY ?? "";

0 commit comments

Comments
 (0)