spark_sdk/
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 = 10;
6
7    /// InitialTimeLock is the initial time lock for the wallet.
8    pub const INITIAL_TIME_LOCK: u32 = 200;
9
10    /// Local Regtest Threshold for the number of signatures required to sign a transaction.
11    pub const SPARK_LOCAL_SIGNING_THRESHOLD: u32 = 3;
12
13    /// Regtest Threshold for the number of signatures required to sign a transaction.
14    pub const SPARK_REGTEST_SIGNING_THRESHOLD: u32 = 2;
15
16    /// MAX_USER_SPLIT_LEVEL is the maximum split level for a user split operation. This is defined by the SDK implementation until a global variable is defined by the Spark protocol.
17    pub const MAX_USER_SPLIT_LEVEL: u32 = 8;
18
19    /// Dust amount is the minimum amount that can be spent on a transaction.
20    pub const DUST_AMOUNT: u64 = 546;
21
22    /// Transfer expiry, the relative time to the future in seconds that a transfer will be claimable for.
23    pub const DEFAULT_TRANSFER_EXPIRY: u64 = 60 * 60 * 24 * 30; // 30 days
24
25    /// Lightspark SSP endpoint
26    pub const LIGHTSPARK_SSP_ENDPOINT: &str = "https://api.dev.dev.sparkinfra.net/graphql/spark/rc";
27    // "dns:///0.spark.dev.dev.sparkinfra.net";
28
29    /// Lightspark SSP identity public key
30    pub const LIGHTSPARK_SSP_IDENTITY_PUBLIC_KEY: &str =
31        "028c094a432d46a0ac95349d792c2e3730bd60c29188db716f56a99e39b95338b4";
32
33    /// SSP ping success status code
34    pub const SSP_PING_SUCCESS_STATUS_CODE: u16 = 415;
35
36    /// Identity keypair index
37    #[cfg(feature = "self-signing")]
38    pub const IDENTITY_KEYPAIR_INDEX: u32 = 0;
39
40    /// Bitcoin token public key
41    pub const ZERO_PUBLIC_KEY_BYTES: &[u8; 33] = &[0x02; 33];
42
43    pub const BITCOIN_TOKEN_PUBLIC_KEY: &[u8; 33] = ZERO_PUBLIC_KEY_BYTES;
44
45    pub mod connection {
46        /// Default coordinator index
47        pub const DEFAULT_COORDINATOR_INDEX: u32 = 0;
48
49        /// List of Spark Operators for the local Regtest network.
50        pub const SPARK_LOCAL_OPERATORS: &[(&str, &str)] = &[
51            (
52                "https://127.0.0.1:8535",
53                "0322ca18fc489ae25418a0e768273c2c61cabb823edfb14feb891e9bec62016510",
54            ),
55            (
56                "https://127.0.0.1:8536",
57                "0341727a6c41b168f07eb50865ab8c397a53c7eef628ac1020956b705e43b6cb27",
58            ),
59            (
60                "https://127.0.0.1:8537",
61                "0305ab8d485cc752394de4981f8a5ae004f2becfea6f432c9a59d5022d8764f0a6",
62            ),
63            (
64                "https://127.0.0.1:8538",
65                "0305ab8d485cc752394de4981f8a5ae004f2becfea6f432c9a59d5022d8764f0a6",
66            ),
67            (
68                "https://127.0.0.1:8539",
69                "0305ab8d485cc752394de4981f8a5ae004f2becfea6f432c9a59d5022d8764f0a6",
70            ),
71        ];
72
73        /// List of Spark Operators for the Regtest network.
74        pub const SPARK_REGTEST_OPERATORS: &[(&str, &str)] = &[
75            (
76                "https://0.spark.dev.dev.sparkinfra.net",
77                "03acd9a5a88db102730ff83dee69d69088cc4c9d93bbee893e90fd5051b7da9651",
78            ),
79            (
80                "https://1.spark.dev.dev.sparkinfra.net",
81                "02d2d103cacb1d6355efeab27637c74484e2a7459e49110c3fe885210369782e23",
82            ),
83            (
84                "https://2.spark.dev.dev.sparkinfra.net",
85                "0350f07ffc21bfd59d31e0a7a600e2995273938444447cb9bc4c75b8a895dbb853",
86            ),
87        ];
88    }
89
90    /// FROST constants
91    pub mod frost {
92        use spark_protos::frost::SigningRole;
93
94        pub const FROST_USER_IDENTIFIER: &str =
95            "0000000000000000000000000000000000000000000000000000000000000063";
96
97        pub const FROST_USER_SIGNING_ROLE: i32 = SigningRole::User as i32;
98
99        pub const FROST_USER_KEY_PACKAGE_MIN_SIGNERS: u32 = 1;
100    }
101
102    pub mod bitcoin {
103        pub const LIGHTSPARK_REGTEST_RPC_URL: &str =
104            "https://regtest-mempool.dev.dev.sparkinfra.net/";
105        pub const LOCAL_REGTEST_RPC_URL: &str = "http://127.0.0.1:18443";
106
107        pub const LOCAL_REGTEST_RPC_AUTH_USERNAME: &str = "admin1";
108        pub const LOCAL_REGTEST_RPC_AUTH_PASSWORD: &str = "123";
109
110        pub const POLARITY_REGTEST_RPC_AUTH_USERNAME: &str = "polarity";
111        pub const POLARITY_REGTEST_RPC_AUTH_PASSWORD: &str = "hN7kD3wY6cF9sA2e";
112    }
113}