libmonero/blocks/
nodes.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * This file is part of Monume's library libmonero
 *
 * Copyright (c) 2023-2024, Monume (monume.xyz)
 * All Rights Reserved
 * The code is distributed under MIT license, see LICENSE file for details.
 * Generated by Monume
 *
 */

/// DaemonNode struct contains all necessary and additional information about a daemon node
pub struct DaemonNode {
    pub url: String,
    pub port: u16,
    pub tls: bool,
}

/// DaemonNode functions etc.
impl DaemonNode {
    /// Returns Cake Wallet's default node
    pub fn cake_wallet_default() -> DaemonNode {
        DaemonNode {
            url: "xmr-node.cakewallet.com".to_string(),
            port: 18081,
            tls: false
        }
    }

    /// Returns Stack Wallet's default node
    pub fn stack_wallet_default() -> DaemonNode {
        DaemonNode {
            url: "monero.stackwallet.com".to_string(),
            port: 18081,
            tls: false
        }
    }

    /// Creates a new DaemonNode from a given URL, port and tls flag
    pub fn new(url: String, port: u16, tls: bool) -> DaemonNode {
        DaemonNode {
            url,
            port,
            tls
        }
    }
}