diff --git a/src/chain.state.ts b/src/chain.state.ts index 2bde10c..8da67ea 100644 --- a/src/chain.state.ts +++ b/src/chain.state.ts @@ -31,7 +31,8 @@ import { switchMap, tap, } from "rxjs" -import polkadotRawNetworks from "./pages/Network/polkadot.json" +import polkadotRawNetworks from "./networks/polkadot.json" +import ksmRawNetworks from "./networks/kusama.json" import { createSignal } from "@react-rxjs/utils" import { chainSpec } from "polkadot-api/chains/polkadot" import { chainSpec as ksmChainSpec } from "polkadot-api/chains/ksmcc3" @@ -57,6 +58,7 @@ export type Network = { display: string endpoints: Record lightclient: boolean + relayChain?: string } export type NetworkCategory = { @@ -74,6 +76,17 @@ const polkadot = polkadotRawNetworks.map( lightclient: x.hasChainSpecs, id: x.id, display: x.display, + relayChain: "polkadot", + }), +) + +const kusama = ksmRawNetworks.map( + (x): Network => ({ + endpoints: x.rpcs as any, + lightclient: x.hasChainSpecs, + id: x.id, + display: x.display, + relayChain: "kusama", }), ) @@ -82,6 +95,10 @@ export const networkCategories: NetworkCategory[] = [ name: "Polkadot", networks: polkadot, }, + { + name: "Kusama", + networks: kusama, + }, ] export const [selectedChainChanged$, onChangeChain] = @@ -114,7 +131,8 @@ const selectedSource$ = selectedChain$.pipe( type: "chainSpec", value: { chainSpec, - relayChain: parsed.relayChain || parsed.relay_chain, + relayChain: + network.relayChain || parsed.relayChain || parsed.relay_chain, }, } as ChainSource }) diff --git a/src/chainspecs/kusama_asset_hub.ts b/src/chainspecs/kusama_asset_hub.ts new file mode 100644 index 0000000..4d52897 --- /dev/null +++ b/src/chainspecs/kusama_asset_hub.ts @@ -0,0 +1 @@ +export { chainSpec } from "polkadot-api/chains/ksmcc3_asset_hub" diff --git a/src/chainspecs/kusama_encointer.ts b/src/chainspecs/kusama_encointer.ts new file mode 100644 index 0000000..c70cc04 --- /dev/null +++ b/src/chainspecs/kusama_encointer.ts @@ -0,0 +1 @@ +export { chainSpec } from "polkadot-api/chains/ksmcc3_encointer" diff --git a/src/chainspecs/kusama_people.ts b/src/chainspecs/kusama_people.ts new file mode 100644 index 0000000..9cda110 --- /dev/null +++ b/src/chainspecs/kusama_people.ts @@ -0,0 +1 @@ +export { chainSpec } from "polkadot-api/chains/ksmcc3_people" diff --git a/src/networks/kusama.json b/src/networks/kusama.json new file mode 100644 index 0000000..8fa2315 --- /dev/null +++ b/src/networks/kusama.json @@ -0,0 +1,434 @@ +[ + { + "id": "kusama", + "display": "Kusama Relay Chain", + "hasChainSpecs": true, + "rpcs": { + "Allnodes": "wss://kusama-rpc.publicnode.com", + "Dwellir": "wss://kusama-rpc.dwellir.com", + "Dwellir Tunisia": "wss://kusama-rpc-tn.dwellir.com", + "IBP1": "wss://rpc.ibp.network/kusama", + "IBP2": "wss://kusama.dotters.network", + "LuckyFriday": "wss://rpc-kusama.luckyfriday.io", + "OnFinality": "wss://kusama.api.onfinality.io/public-ws", + "RockX": "wss://rockx-ksm.w3node.com/polka-public-ksm/ws", + "Stakeworld": "wss://ksm-rpc.stakeworld.io", + "SubQuery": "wss://kusama.rpc.subquery.network/public/ws" + }, + "nativeToken": { + "symbol": "KSM", + "decimals": 12 + } + }, + { + "id": "kusama_asset_hub", + "display": "Kusama AssetHub", + "rpcs": { + "Dwellir": "wss://asset-hub-kusama-rpc.dwellir.com", + "Dwellir Tunisia": "wss://statemine-rpc-tn.dwellir.com", + "IBP1": "wss://sys.ibp.network/statemine", + "IBP2": "wss://asset-hub-kusama.dotters.network", + "LuckyFriday": "wss://rpc-asset-hub-kusama.luckyfriday.io", + "Parity": "wss://kusama-asset-hub-rpc.polkadot.io", + "RadiumBlock": "wss://statemine.public.curie.radiumblock.co/ws", + "Stakeworld": "wss://ksm-rpc.stakeworld.io/assethub" + }, + "relayChainInfo": { + "id": "kusama", + "isSystem": true, + "parachain": 1000 + }, + "nativeToken": { + "symbol": "KSM", + "decimals": 12 + }, + "hasChainSpecs": true + }, + { + "id": "kusama_bridge_hub", + "display": "Kusama BridgeHub", + "rpcs": { + "Dwellir": "wss://bridge-hub-kusama-rpc.dwellir.com", + "Dwellir Tunisia": "wss://kusama-bridge-hub-rpc-tn.dwellir.com", + "IBP1": "wss://sys.ibp.network/bridgehub-kusama", + "IBP2": "wss://bridge-hub-kusama.dotters.network", + "LuckyFriday": "wss://rpc-bridge-hub-kusama.luckyfriday.io", + "Parity": "wss://kusama-bridge-hub-rpc.polkadot.io", + "RadiumBlock": "wss://bridgehub-kusama.public.curie.radiumblock.co/ws", + "Stakeworld": "wss://ksm-rpc.stakeworld.io/bridgehub" + }, + "relayChainInfo": { + "id": "kusama", + "isSystem": true, + "parachain": 1002 + }, + "nativeToken": { + "symbol": "KSM", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "kusama_core_time", + "display": "Kusama Coretime", + "rpcs": { + "Dwellir": "wss://coretime-kusama-rpc.dwellir.com", + "IBP1": "wss://sys.ibp.network/coretime-kusama", + "IBP2": "wss://coretime-kusama.dotters.network", + "LuckyFriday": "wss://rpc-coretime-kusama.luckyfriday.io", + "Parity": "wss://kusama-coretime-rpc.polkadot.io", + "Stakeworld": "wss://ksm-rpc.stakeworld.io/coretime" + }, + "relayChainInfo": { + "id": "kusama", + "isSystem": true, + "parachain": 1005 + }, + "nativeToken": { + "symbol": "KSM", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "kusama_people", + "display": "People", + "rpcs": { + "Dwellir": "wss://people-kusama-rpc.dwellir.com", + "IBP1": "wss://sys.ibp.network/people-kusama", + "IBP2": "wss://people-kusama.dotters.network", + "LuckyFriday": "wss://rpc-people-kusama.luckyfriday.io", + "Parity": "wss://kusama-people-rpc.polkadot.io", + "Stakeworld": "wss://ksm-rpc.stakeworld.io/people" + }, + "relayChainInfo": { + "id": "kusama", + "isSystem": true, + "parachain": 1004 + }, + "nativeToken": { + "symbol": "KSM", + "decimals": 12 + }, + "hasChainSpecs": true + }, + { + "id": "kusama_encointer", + "display": "Encointer Network", + "rpcs": { + "Dwellir": "wss://encointer-kusama-rpc.dwellir.com", + "Encointer Association": "wss://kusama.api.encointer.org", + "IBP1": "wss://sys.ibp.network/encointer-kusama", + "IBP2": "wss://encointer-kusama.dotters.network" + }, + "relayChainInfo": { + "id": "kusama", + "isSystem": true, + "parachain": 1001 + }, + "nativeToken": { + "symbol": "KSM", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "altair", + "display": "Altair", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2088 + }, + "rpcs": { + "Centrifuge": "wss://fullnode.altair.centrifuge.io", + "OnFinality": "wss://altair.api.onfinality.io/public-ws" + }, + "nativeToken": { + "symbol": "AIR", + "decimals": 18 + }, + "hasChainSpecs": false + }, + { + "id": "amplitude", + "display": "Amplitude", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2124 + }, + "rpcs": { + "Dwellir": "wss://amplitude-rpc.dwellir.com", + "PendulumChain": "wss://rpc-amplitude.pendulumchain.tech" + }, + "nativeToken": { + "symbol": "AMPE", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "bajun", + "display": "Bajun Network", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2119 + }, + "rpcs": { + "AjunaNetwork": "wss://rpc-parachain.bajun.network", + "OnFinality": "wss://bajun.api.onfinality.io/public-ws", + "RadiumBlock": "wss://bajun.public.curie.radiumblock.co/ws" + }, + "nativeToken": { + "symbol": "BAJU", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "basilisk", + "display": "Basilisk", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2090 + }, + "rpcs": { + "Basilisk": "wss://rpc.basilisk.cloud", + "Dwellir": "wss://basilisk-rpc.dwellir.com" + }, + "nativeToken": { + "symbol": "BSX", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "bifrost", + "display": "Bifrost", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2001 + }, + "rpcs": { + "Dwellir": "wss://bifrost-rpc.dwellir.com", + "Liebi": "wss://bifrost-rpc.liebi.com/ws", + "LiebiUS": "wss://us.bifrost-rpc.liebi.com/ws" + }, + "nativeToken": { + "symbol": "BNC", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "calamari", + "display": "Calamari", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2084 + }, + "rpcs": { + "Manta Network": "wss://calamari.systems" + }, + "nativeToken": { + "symbol": "KMA", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "crab", + "display": "Crab", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2105 + }, + "rpcs": { + "Darwinia": "wss://crab-rpc.darwinia.network/", + "Dcdao": "wss://crab-rpc.dcdao.box", + "Dwellir": "wss://darwiniacrab-rpc.dwellir.com" + }, + "nativeToken": { + "symbol": "CRAB", + "decimals": 18 + }, + "hasChainSpecs": false + }, + { + "id": "imbue", + "display": "Imbue Network", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2121 + }, + "rpcs": { + "Imbue Network 0": "wss://kusama.imbuenetwork.com" + }, + "nativeToken": { + "symbol": "IMBU", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "integritee", + "display": "Integritee Network", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2015 + }, + "rpcs": { + "Integritee": "wss://kusama.api.integritee.network", + "OnFinality": "wss://integritee-kusama.api.onfinality.io/public-ws" + }, + "nativeToken": { + "symbol": "TEER", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "tinker", + "display": "InvArch Tinkernet", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2125 + }, + "rpcs": { + "Dwellir": "wss://tinkernet-rpc.dwellir.com" + }, + "nativeToken": { + "symbol": "TNKR", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "karura", + "display": "Karura", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2000 + }, + "rpcs": { + "Dwellir": "wss://karura-rpc.dwellir.com", + "OnFinality": "wss://karura.api.onfinality.io/public-ws" + }, + "nativeToken": { + "symbol": "KAR", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "khala", + "display": "Khala Network", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2004 + }, + "rpcs": { + "Dwellir": "wss://khala-rpc.dwellir.com", + "Helikon": "wss://rpc.helikon.io/khala", + "OnFinality": "wss://khala.api.onfinality.io/public-ws", + "Phala": "wss://khala-api.phala.network/ws", + "RadiumBlock": "wss://khala.public.curie.radiumblock.co/ws" + }, + "nativeToken": { + "symbol": "PHA", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "kreivo", + "display": "Kreivo - By Virto", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2281 + }, + "rpcs": { + "Virto": "wss://kreivo.io/" + }, + "nativeToken": { + "symbol": "KSM", + "decimals": 12 + }, + "hasChainSpecs": false + }, + { + "id": "moonriver", + "display": "Moonriver", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2023 + }, + "rpcs": { + "Moonbeam Foundation": "wss://wss.api.moonriver.moonbeam.network", + "Allnodes": "wss://moonriver-rpc.publicnode.com", + "Dwellir": "wss://moonriver-rpc.dwellir.com", + "OnFinality": "wss://moonriver.api.onfinality.io/public-ws", + "RadiumBlock": "wss://moonriver.public.curie.radiumblock.co/ws", + "UnitedBloc": "wss://moonriver.unitedbloc.com" + }, + "nativeToken": { + "symbol": "MOVR", + "decimals": 18 + }, + "hasChainSpecs": false + }, + { + "id": "quartz", + "display": "QUARTZ by UNIQUE", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2095 + }, + "rpcs": { + "Dwellir": "wss://quartz-rpc.dwellir.com", + "Geo Load Balancer": "wss://ws-quartz.unique.network", + "Unique America": "wss://us-ws-quartz.unique.network", + "Unique Asia": "wss://asia-ws-quartz.unique.network", + "Unique Europe": "wss://eu-ws-quartz.unique.network" + }, + "nativeToken": { + "symbol": "QTZ", + "decimals": 18 + }, + "hasChainSpecs": false + }, + { + "id": "shiden", + "display": "Shiden", + "relayChainInfo": { + "id": "kusama", + "isSystem": false, + "parachain": 2007 + }, + "rpcs": { + "Astar": "wss://rpc.shiden.astar.network", + "Dwellir": "wss://shiden-rpc.dwellir.com", + "OnFinality": "wss://shiden.api.onfinality.io/public-ws", + "RadiumBlock": "wss://shiden.public.curie.radiumblock.co/ws" + }, + "nativeToken": { + "symbol": "SDN", + "decimals": 18 + }, + "hasChainSpecs": false + } +] diff --git a/src/pages/Network/polkadot.json b/src/networks/polkadot.json similarity index 99% rename from src/pages/Network/polkadot.json rename to src/networks/polkadot.json index 4197e6f..445c380 100644 --- a/src/pages/Network/polkadot.json +++ b/src/networks/polkadot.json @@ -70,7 +70,7 @@ "symbol": "DOT", "decimals": 10 }, - "hasChainSpecs": true + "hasChainSpecs": false }, { "id": "polkadot_collectives",