|
| 1 | +use std::sync::LazyLock; |
| 2 | + |
1 | 3 | pub const JSON_RPC_URL: &str = "http://api.devnet.solana.com";
|
2 | 4 |
|
3 |
| -lazy_static! { |
4 |
| - pub static ref CONFIG_FILE: Option<String> = { |
5 |
| - dirs_next::home_dir().map(|mut path| { |
6 |
| - path.extend([".config", "solana", "install", "config.yml"]); |
7 |
| - path.to_str().unwrap().to_string() |
8 |
| - }) |
9 |
| - }; |
10 |
| - pub static ref USER_KEYPAIR: Option<String> = { |
11 |
| - dirs_next::home_dir().map(|mut path| { |
12 |
| - path.extend([".config", "solana", "id.json"]); |
13 |
| - path.to_str().unwrap().to_string() |
14 |
| - }) |
15 |
| - }; |
16 |
| - pub static ref DATA_DIR: Option<String> = { |
17 |
| - dirs_next::home_dir().map(|mut path| { |
18 |
| - path.extend([".local", "share", "solana", "install"]); |
19 |
| - path.to_str().unwrap().to_string() |
20 |
| - }) |
21 |
| - }; |
22 |
| -} |
| 5 | +pub static CONFIG_FILE: LazyLock<Option<String>> = LazyLock::new(|| { |
| 6 | + dirs_next::home_dir().map(|mut path| { |
| 7 | + path.extend([".config", "solana", "install", "config.yml"]); |
| 8 | + path.to_str().unwrap().to_string() |
| 9 | + }) |
| 10 | +}); |
| 11 | + |
| 12 | +pub static USER_KEYPAIR: LazyLock<Option<String>> = LazyLock::new(|| { |
| 13 | + dirs_next::home_dir().map(|mut path| { |
| 14 | + path.extend([".config", "solana", "id.json"]); |
| 15 | + path.to_str().unwrap().to_string() |
| 16 | + }) |
| 17 | +}); |
| 18 | + |
| 19 | +pub static DATA_DIR: LazyLock<Option<String>> = LazyLock::new(|| { |
| 20 | + dirs_next::home_dir().map(|mut path| { |
| 21 | + path.extend([".local", "share", "solana", "install"]); |
| 22 | + path.to_str().unwrap().to_string() |
| 23 | + }) |
| 24 | +}); |
0 commit comments