From 3db7303be45c90b5554f1c5a8251649be7086880 Mon Sep 17 00:00:00 2001 From: Sergej Sakac <73715684+Szegoo@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:12:23 +0200 Subject: [PATCH] Read from registrar (#68) * bump polkadot/api * bump types * format * Read paras from registrar --- src/contexts/apis/RelayApi/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/contexts/apis/RelayApi/index.tsx b/src/contexts/apis/RelayApi/index.tsx index 3c22664f..103ba92e 100644 --- a/src/contexts/apis/RelayApi/index.tsx +++ b/src/contexts/apis/RelayApi/index.tsx @@ -44,8 +44,10 @@ const RelayApiContextProvider = (props: any) => { if (!api || apiState !== ApiState.READY) return; const fetchParaIds = async () => { if (!api.query.paras) return; - const paras = (await api.query.paras.parachains()).toHuman(); - const paraIds = paras.map((key: any) => parseHNString(key)); + const paras = await api.query.registrar.paras.keys(); + const paraIds = paras.map((key: any) => + parseHNString(key.toHuman().toString()) + ); setParaIds(paraIds); }; fetchParaIds();