From a510b19a6e849d56faa0cc9a2553abf522ed1bd3 Mon Sep 17 00:00:00 2001 From: Simone Date: Fri, 23 Dec 2022 01:08:16 +0100 Subject: [PATCH] feat(chains): added IoTeX (#32) * Added IoTeX chains * Added changeset * Fixed explorers and ChainIds --- .changeset/nasty-boats-invent.md | 5 +++++ packages/chains/src/index.ts | 2 ++ packages/chains/src/iotex.ts | 21 +++++++++++++++++++++ packages/chains/src/iotexTestnet.ts | 21 +++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 .changeset/nasty-boats-invent.md create mode 100644 packages/chains/src/iotex.ts create mode 100644 packages/chains/src/iotexTestnet.ts diff --git a/.changeset/nasty-boats-invent.md b/.changeset/nasty-boats-invent.md new file mode 100644 index 00000000..7977a6f7 --- /dev/null +++ b/.changeset/nasty-boats-invent.md @@ -0,0 +1,5 @@ +--- +'@wagmi/chains': minor +--- + +Added IoTeX Chains. diff --git a/packages/chains/src/index.ts b/packages/chains/src/index.ts index b240b6f5..77eb0dd6 100644 --- a/packages/chains/src/index.ts +++ b/packages/chains/src/index.ts @@ -23,3 +23,5 @@ export { polygonMumbai } from './polygonMumbai' export { sepolia } from './sepolia' export { taraxa } from './taraxa' export { taraxaTestnet } from './taraxaTestnet' +export { iotex } from './iotex' +export { iotexTestnet } from './iotexTestnet' \ No newline at end of file diff --git a/packages/chains/src/iotex.ts b/packages/chains/src/iotex.ts new file mode 100644 index 00000000..95e46866 --- /dev/null +++ b/packages/chains/src/iotex.ts @@ -0,0 +1,21 @@ +import { Chain } from './types' + +export const iotex: Chain = { + id: 4689, + name: 'IoTeX', + network: 'iotex', + nativeCurrency: { + decimals: 18, + name: 'IoTeX', + symbol: 'IOTX', + }, + rpcUrls: { + default: { + http: ['https://babel-api.mainnet.iotex.io'], + webSocket: ['wss://babel-api.mainnet.iotex.io'], + }, + }, + blockExplorers: { + default: { name: 'IoTeXScan', url: 'https://iotexscan.io' }, + }, +} diff --git a/packages/chains/src/iotexTestnet.ts b/packages/chains/src/iotexTestnet.ts new file mode 100644 index 00000000..ada11dd2 --- /dev/null +++ b/packages/chains/src/iotexTestnet.ts @@ -0,0 +1,21 @@ +import { Chain } from './types' + +export const iotexTestnet: Chain = { + id: 4690, + name: 'IoTeX Testnet', + network: 'iotex-testnet', + nativeCurrency: { + decimals: 18, + name: 'IoTeX', + symbol: 'IOTX', + }, + rpcUrls: { + default: { + http: ['https://babel-api.testnet.iotex.io'], + webSocket: ['wss://babel-api.testnet.iotex.io'], + }, + }, + blockExplorers: { + default: { name: 'IoTeXScan', url: 'https://testnet.iotexscan.io' }, + }, +}