@celo/network-utils
Version:
Utilities for fetching static information about the Celo network
30 lines (29 loc) • 1.56 kB
TypeScript
export declare class StaticNodeUtils {
static getStaticNodesGoogleStorageBucketName(): string;
/**
* Resolves the best region to use for static node connections.
* @param networkName Name of the network to get a region for.
* @remarks This method currently uses the interpreter's timezone and the
* IANA timezone database to establish what region of the world the client is
* in, then map that to a static list of static node clusters run by cLabs.
* If the timezone is not set according to the user's location, this method
* may route them to suboptimal set of static nodes. The resolution method
* may be replaced in the future.
*/
static getStaticNodeRegion(networkName: string, tz?: string): string;
/**
* Fetches the static nodes (as JSON data) from Google Storage corresponding
* to the best available region for this caller.
* If the network is not working, the method will reject the returned promise
* along with the response data from Google API.
* @param networkName Name of the network to fetch config for
*/
static getRegionalStaticNodesAsync(networkName: string, region?: string): Promise<string>;
/**
* Fetches the static nodes (as JSON data) from Google Storage.
* If the network is not working, the method will reject the returned promise
* along with the response data from Google API.
* @param networkName Name of the network to fetch config for
*/
static getStaticNodesAsync(networkName: string): Promise<string>;
}