The network to get endpoints for.
The type of endpoint to retrieve.
A promise that resolves to an array of endpoint addresses.
import { NETWORK_TYPE, ENDPOINT_TYPE, getEndpoints } from "@akashnetwork/akashjs/build/network";
async function fetchEndpoints() {
try {
const endpoints = await getEndpoints(NETWORK_TYPE.MAINNET, ENDPOINT_TYPE.REST);
console.log("Endpoints:", JSON.stringify(endpoints, null, 2));
} catch (error) {
console.error("Error fetching endpoints:", error);
}
}
fetchEndpoints();
Retrieves endpoints for a specific network and type.