• Retrieves endpoints for a specific network and type.

    Parameters

    Returns Promise<{ address: string }[]>

    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();