@helium/http
Version:
HTTP library for interacting with the Helium blockchain API
141 lines • 3.35 kB
TypeScript
import DataModel from './DataModel';
export interface HTTPChallengeObject {
type: string;
time: number;
secret: string;
request_block_hash: string;
path: HTTPPathObject[];
onion_key_hash: string;
height: number;
hash: string;
fee: number;
challenger_owner: string;
challenger_lon: number;
challenger_location: string;
challenger_location_hex: string;
challenger_lat: number;
challenger: string;
}
export interface HTTPPathObject {
witnesses: HTTPWitnessesObject[];
receipt: HTTPReceiptObject;
geocode: HTTPGeocodeObject;
challengee_owner: string;
challengee_lon: number;
challengee_location: string;
challengee_location_hex: string;
challengee_lat: number;
challengee: 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 HTTPWitnessesObject {
timestamp: number;
snr: number;
signal: number;
packet_hash: string;
owner: string;
location: string;
location_hex: string;
is_valid: boolean;
invalid_reason?: string;
gateway: string;
frequency: number;
datarate: number[];
channel: number;
}
export interface HTTPReceiptObject {
timestamp: number;
snr: number;
signal: number;
origin: string;
gateway: string;
frequency: number;
datarate: number[];
data: string;
channel: number;
}
export interface Geocode {
shortStreet: string;
shortState: string;
shortCountry: string;
shortCity: string;
longStreet: string;
longState: string;
longCountry: string;
longCity: string;
cityId: string;
}
export declare enum PathResult {
SUCCESS = "success",
FAILURE = "failure",
UNTESTED = "untested"
}
export interface Path {
witnesses: Witness[];
receipt: Receipt;
geocode: Geocode;
challengeeOwner: string;
challengeeLon: number;
challengeeLocation: string;
challengeeLocationHex: string;
challengeeLat: number;
challengee: string;
result: PathResult;
}
export interface Witness {
timestamp: number;
snr: number;
signal: number;
packetHash: string;
owner: string;
location: string;
locationHex: string;
isValid: boolean;
invalidReason?: string;
gateway: string;
frequency: number;
datarate: number[];
channel: number;
}
export interface Receipt {
timestamp: number;
snr: number;
signal: number;
origin: string;
gateway: string;
frequency: number;
datarate: number[];
data: string;
channel: number;
}
export type ChallengeData = Challenge;
export default class Challenge extends DataModel {
type: string;
time: number;
secret: string;
requestBlockHash: string;
path: Path[];
onionKeyHash: string;
height: number;
hash: string;
fee: number;
challengerOwner: string;
challengerLon: number;
challengerLocation: string;
challengerLocationHex: string;
challengerLat: number;
challenger: string;
constructor(challenge: HTTPChallengeObject);
get data(): ChallengeData;
}
//# sourceMappingURL=Challenge.d.ts.map