Skip to main content

helium_api/models/transactions/
poc_receipts_v2.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Clone, Serialize, Deserialize, Debug)]
4pub struct PocReceiptsV2 {
5    pub hash: String,
6    pub challenger: String,
7    pub fee: u64,
8    pub onion_key_hash: String,
9    pub path: Vec<PathElement>,
10    pub challenger_owner: String,
11    pub secret: String,
12    pub time: u64,
13    pub height: u64,
14    pub block_hash: String,
15}
16
17#[derive(Clone, Serialize, Deserialize, Debug)]
18pub struct PathElement {
19    pub challengee: String,
20    pub challengee_owner: String,
21    pub challengee_lat: f64,
22    pub challengee_lon: f64,
23    pub challengee_location_hex: String,
24    pub challengee_location: String,
25    pub receipt: Option<Receipt>,
26    pub geocode: Option<Geocode>,
27    pub witnesses: Vec<Witness>,
28}
29
30#[derive(Clone, Serialize, Deserialize, Debug)]
31pub struct Geocode {
32    pub short_street: String,
33    pub short_state: String,
34    pub short_country: String,
35    pub short_city: String,
36    pub long_street: String,
37    pub long_state: String,
38    pub long_country: String,
39    pub long_city: String,
40    pub city_id: String,
41}
42
43#[derive(Clone, Serialize, Deserialize, Debug)]
44pub struct Receipt {
45    pub channel: u8,
46    pub data: String,
47    pub datarate: Option<String>,
48    pub frequency: f64,
49    pub gateway: String,
50    pub origin: String,
51    pub signal: i64,
52    pub snr: f64,
53    pub timestamp: u64,
54}
55
56#[derive(Clone, Serialize, Deserialize, Debug)]
57pub struct Witness {
58    pub channel: u8,
59    pub datarate: String,
60    pub frequency: f64,
61    pub gateway: String,
62    pub is_valid: Option<bool>,
63    pub packet_hash: String,
64    pub signal: i64,
65    pub snr: f64,
66    pub timestamp: u64,
67}