useApi
import { useApi } from 'useink';
export const Api = ({ children }) => {
const { api } = useApi(); // Get the api instance for the default chain set in UseInkProvider
const alephApi = useApi('aleph'); // This assumes that 'aleph' config is added to UseInkProvider
console.log('default chain api', api)
console.log('aleph chain api', alephApi.api)
return <h1>Check the console logs...</h1>
}Return Type
{
api: ApiPromise;
provider: WsProvider;
} | undefinedLast updated