Skip to content

Commit

Permalink
Read from registrar (#68)
Browse files Browse the repository at this point in the history
* bump polkadot/api

* bump types

* format

* Read paras from registrar
  • Loading branch information
Szegoo authored Apr 17, 2024
1 parent 8757167 commit 3db7303
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 3db7303

Please sign in to comment.