hopr_db_api/
resolver.rs

1use async_trait::async_trait;
2use hopr_crypto_types::types::OffchainPublicKey;
3use hopr_primitive_types::primitives::Address;
4
5use crate::errors::Result;
6
7/// Trait for linking and resolving the corresponding `OffchainPublicKey` and on-chain `Address`.
8#[async_trait]
9pub trait HoprDbResolverOperations {
10    /// Tries to resolve off-chain public key given the on-chain address
11    async fn resolve_packet_key(&self, onchain_key: &Address) -> Result<Option<OffchainPublicKey>>;
12
13    /// Tries to resolve on-chain public key given the off-chain public key
14    async fn resolve_chain_key(&self, offchain_key: &OffchainPublicKey) -> Result<Option<Address>>;
15}