availproject / light-client-web

Avail's Web Light Client (WIP)
https://light.avail.tools
45 stars 42 forks source link

[refactor] Switch from using polkadot-js to avail-js-sdk #32

Open abheektripathy opened 9 months ago

abheektripathy commented 9 months ago

instead of using the polkadot js for getting the block headers, we can use avail-js-sdk

// example code which fetches the latest headers

import { initialize } from "avail-js-sdk"
const api = await initialize()
let lastHeader = (await api.rpc.chain.getHeader()).toJSON();
    console.log((lastHeader.extension));
console.log("subscribed headers", lastHeader) 
cpp-phoenix commented 9 months ago

I can pick this right away @abheektripathy until design is ready for the other issue

abheektripathy commented 9 months ago

@cpp-phoenix thanks, go for it!

AryanGodara commented 9 months ago

@abheektripathy are there going to be any new issues, with the ODHack week beginning today? This past week I've been contributing in rollkit, and was getting onboarded with light-client-lib(rust) repo; and so I've been looking for a chance to contribute here. I'd really be grateful if you could point me in the right direction :D