Skip to content

Commit

Permalink
Read paras from registrar
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Apr 17, 2024
1 parent eaa906e commit febeb8b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/contexts/apis/RelayApi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit febeb8b

Please sign in to comment.