spark_rust/
constants.rs

1//! Constants for the Spark Wallet SDK.
2
3pub mod spark {
4    /// TimeLockInterval is the interval between time locks.
5    pub const TIME_LOCK_INTERVAL: u32 = 100;
6
7    /// InitialTimeLock is the initial time lock for the wallet.
8    pub const INITIAL_TIME_LOCK: u32 = 2000;
9
10    /// Regtest Threshold for the number of signatures required to sign a transaction.
11    pub const SPARK_REGTEST_SIGNING_THRESHOLD: u32 = 2;
12
13    /// Transfer expiry, the relative time to the future in seconds that a transfer will be claimable for.
14    pub const DEFAULT_TRANSFER_EXPIRY: u64 = 60 * 60 * 24 * 30; // 30 days
15
16    /// Default cooperative exit expiry time
17    pub const DEFAULT_COOPERATIVE_EXIT_EXPIRY: u64 = 60 * 60 * 3; // 3 hours
18
19    /// Lightspark SSP endpoint
20    pub const LIGHTSPARK_SSP_ENDPOINT: &str = "https://api.lightspark.com/graphql/spark/rc";
21    // "dns:///0.spark.dev.dev.sparkinfra.net";
22
23    /// Lightspark SSP identity public key
24    pub const LIGHTSPARK_SSP_IDENTITY_PUBLIC_KEY: &str =
25        "022bf283544b16c0622daecb79422007d167eca6ce9f0c98c0c49833b1f7170bfe";
26
27    /// Spark derivation path purpose
28    pub const SPARK_DERIVATION_PATH_PURPOSE: u32 = 8797555;
29
30    pub mod connection {
31        /// Default coordinator index
32        pub const DEFAULT_COORDINATOR_INDEX: u32 = 0;
33
34        /// List of Spark Operators for the Regtest network.
35        pub const SPARK_REGTEST_OPERATORS: &[(&str, &str)] = &[
36            (
37                "https://0.spark.us-west-2.sparkinfra.net",
38                "03dfbdff4b6332c220f8fa2ba8ed496c698ceada563fa01b67d9983bfc5c95e763",
39            ),
40            (
41                "https://1.spark.us-west-2.sparkinfra.net",
42                "03e625e9768651c9be268e287245cc33f96a68ce9141b0b4769205db027ee8ed77",
43            ),
44            (
45                "https://2.spark.us-west-2.sparkinfra.net",
46                "022eda13465a59205413086130a65dc0ed1b8f8e51937043161f8be0c369b1a410",
47            ),
48        ];
49    }
50
51    /// FROST constants
52    pub mod frost {
53        use spark_protos::frost::SigningRole;
54
55        pub const FROST_USER_IDENTIFIER: &str =
56            "0000000000000000000000000000000000000000000000000000000000000063";
57
58        pub const FROST_USER_SIGNING_ROLE: i32 = SigningRole::User as i32;
59
60        pub const FROST_USER_KEY_PACKAGE_MIN_SIGNERS: u32 = 1;
61    }
62}