1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use cw_orch::daemon::Fetchable;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(default)]
pub struct Explorers {
    pub explorers: Vec<Explorer>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(default)]
pub struct Explorer {
    pub kind: String,
    pub url: String,
    pub tx_page: Option<String>,
    pub account_page: Option<String>,
}

impl Fetchable for Explorers {
    fn path(resource: &str) -> PathBuf {
        [resource, "chain.json"].iter().collect()
    }
}