fedimint_lnv2_client/
db.rs1use fedimint_core::encoding::{Decodable, Encodable};
2use fedimint_core::impl_db_record;
3use fedimint_core::secp256k1::PublicKey;
4use fedimint_core::util::SafeUrl;
5use strum::EnumIter;
6
7#[repr(u8)]
8#[derive(Clone, EnumIter, Debug)]
9pub enum DbKeyPrefix {
10 Gateway = 0x41,
11 IncomingContractStreamIndex = 0x42,
12 #[allow(dead_code)]
13 ExternalReservedStart = 0xb0,
16 #[allow(dead_code)]
17 CoreInternalReservedStart = 0xd0,
20 #[allow(dead_code)]
21 CoreInternalReservedEnd = 0xff,
22}
23
24#[derive(Debug, Encodable, Decodable)]
25pub struct GatewayKey(pub PublicKey);
26
27impl_db_record!(
28 key = GatewayKey,
29 value = SafeUrl,
30 db_prefix = DbKeyPrefix::Gateway,
31);
32
33#[derive(Debug, Encodable, Decodable)]
34pub struct IncomingContractStreamIndexKey;
35
36impl_db_record!(
37 key = IncomingContractStreamIndexKey,
38 value = u64,
39 db_prefix = DbKeyPrefix::IncomingContractStreamIndex
40);