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 ExternalReservedStart = 0xb0,
15 CoreInternalReservedStart = 0xd0,
18 CoreInternalReservedEnd = 0xff,
19}
20
21#[derive(Debug, Encodable, Decodable)]
22pub struct GatewayKey(pub PublicKey);
23
24impl_db_record!(
25 key = GatewayKey,
26 value = SafeUrl,
27 db_prefix = DbKeyPrefix::Gateway,
28);
29
30#[derive(Debug, Encodable, Decodable)]
31pub struct IncomingContractStreamIndexKey;
32
33impl_db_record!(
34 key = IncomingContractStreamIndexKey,
35 value = u64,
36 db_prefix = DbKeyPrefix::IncomingContractStreamIndex
37);