@helium/http
Version:
HTTP library for interacting with the Helium blockchain API
102 lines • 2.66 kB
TypeScript
import type Client from '../Client';
import Transactions from '../resources/Transactions';
import DataModel from './DataModel';
import Witnesses from '../resources/Witnesses';
import Rewards from '../resources/Rewards';
import Challenges from '../resources/Challenges';
import Roles from '../resources/Roles';
export type HotspotData = Omit<Hotspot, 'client'>;
export type Bucket = 'hour' | 'day' | 'week';
export type NaturalDate = string;
export interface HTTPHotspotObject {
score_update_height?: number;
score?: number;
reward_scale?: number;
owner?: string;
payer?: string;
name?: string;
location?: string;
location_hex?: string;
lng?: number;
lat?: number;
block?: number;
block_added?: number;
geocode?: HTTPGeocodeObject;
address: string;
status?: {
timestamp?: string;
height: number;
online: string;
listen_addrs: string[];
};
nonce?: number;
speculative_nonce?: number;
timestamp_added?: string;
last_poc_challenge?: number;
last_change_block?: number;
gain?: number;
elevation?: number;
mode?: string;
}
export interface HTTPGeocodeObject {
short_street: string;
short_state: string;
short_country: string;
short_city: string;
long_street: string;
long_state: string;
long_country: string;
long_city: string;
city_id: string;
}
export interface Geocode {
shortStreet: string;
shortState: string;
shortCountry: string;
shortCity: string;
longStreet: string;
longState: string;
longCountry: string;
longCity: string;
}
export interface Status {
timestamp?: string;
height: number;
online: string;
listenAddrs: string[];
}
export default class Hotspot extends DataModel {
private client;
scoreUpdateHeight?: number;
score?: number;
rewardScale?: number;
owner?: string;
payer?: string;
name?: string;
location?: string;
locationHex?: string;
lng?: number;
lat?: number;
block?: number;
geocode?: Geocode;
address: string;
status?: Status;
nonce?: number;
speculativeNonce?: number;
blockAdded?: number;
timestampAdded?: string;
lastPocChallenge?: number;
lastChangeBlock?: number;
gain?: number;
elevation?: number;
mode?: string;
constructor(client: Client, hotspot: HTTPHotspotObject);
get activity(): Transactions;
get roles(): Roles;
get witnesses(): Witnesses;
get witnessed(): Witnesses;
get rewards(): Rewards;
get challenges(): Challenges;
get data(): HotspotData;
}
//# sourceMappingURL=Hotspot.d.ts.map