pub trait LnFederationApi {
Show 14 methods
// Required methods
fn module_consensus_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FederationResult<ModuleConsensusVersion>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_consensus_block_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FederationResult<Option<u64>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_contract<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = FederationResult<Option<ContractAccount>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn await_contract<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = ContractAccount> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn wait_block_height<'life0, 'async_trait>(
&'life0 self,
block_height: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn wait_outgoing_contract_cancelled<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = FederationResult<ContractAccount>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_decrypted_preimage_status<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = FederationResult<(IncomingContractAccount, DecryptedPreimageStatus)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn wait_preimage_decrypted<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = FederationResult<(IncomingContractAccount, Option<Preimage>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_offer<'life0, 'async_trait>(
&'life0 self,
payment_hash: Sha256Hash,
) -> Pin<Box<dyn Future<Output = FederationResult<IncomingContractOffer>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_gateways<'life0, 'async_trait>(
&'life0 self,
federation_public_key: FederationPublicKey,
) -> Pin<Box<dyn Future<Output = FederationResult<Vec<LightningGatewayAnnouncement>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn register_gateway<'life0, 'life1, 'async_trait>(
&'life0 self,
gateway: &'life1 LightningGatewayAnnouncement,
) -> Pin<Box<dyn Future<Output = FederationResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_remove_gateway_challenge<'life0, 'async_trait>(
&'life0 self,
gateway_id: PublicKey,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, Option<Hash>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_gateway<'life0, 'async_trait>(
&'life0 self,
remove_gateway_request: RemoveGatewayRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn offer_exists<'life0, 'async_trait>(
&'life0 self,
payment_hash: Sha256Hash,
) -> Pin<Box<dyn Future<Output = FederationResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn module_consensus_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FederationResult<ModuleConsensusVersion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn module_consensus_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FederationResult<ModuleConsensusVersion>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The module consensus version the federation currently runs on, which is the version its peers have voted in, not the one their binaries support.
Federations predating the endpoint report MODULE_CONSENSUS_VERSION
2.0, the version before voting existed.
fn fetch_consensus_block_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = FederationResult<Option<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_contract<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = FederationResult<Option<ContractAccount>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn await_contract<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = ContractAccount> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_block_height<'life0, 'async_trait>(
&'life0 self,
block_height: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_outgoing_contract_cancelled<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = FederationResult<ContractAccount>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_decrypted_preimage_status<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = FederationResult<(IncomingContractAccount, DecryptedPreimageStatus)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_preimage_decrypted<'life0, 'async_trait>(
&'life0 self,
contract: ContractId,
) -> Pin<Box<dyn Future<Output = FederationResult<(IncomingContractAccount, Option<Preimage>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_offer<'life0, 'async_trait>(
&'life0 self,
payment_hash: Sha256Hash,
) -> Pin<Box<dyn Future<Output = FederationResult<IncomingContractOffer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn fetch_gateways<'life0, 'async_trait>(
&'life0 self,
federation_public_key: FederationPublicKey,
) -> Pin<Box<dyn Future<Output = FederationResult<Vec<LightningGatewayAnnouncement>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_gateways<'life0, 'async_trait>(
&'life0 self,
federation_public_key: FederationPublicKey,
) -> Pin<Box<dyn Future<Output = FederationResult<Vec<LightningGatewayAnnouncement>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
federation_public_key is needed to check registration proofs, which
has to happen before signed announcements are preferred over unsigned
ones — see
LightningGatewayAnnouncement::registration_proof_is_valid.
fn register_gateway<'life0, 'life1, 'async_trait>(
&'life0 self,
gateway: &'life1 LightningGatewayAnnouncement,
) -> Pin<Box<dyn Future<Output = FederationResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_remove_gateway_challenge<'life0, 'async_trait>(
&'life0 self,
gateway_id: PublicKey,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, Option<Hash>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_remove_gateway_challenge<'life0, 'async_trait>(
&'life0 self,
gateway_id: PublicKey,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, Option<Hash>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the map of gateway remove challenges from the server. Each challenge needs to be signed by the gateway’s private key in order for the registration record to be removed.
Sourcefn remove_gateway<'life0, 'async_trait>(
&'life0 self,
remove_gateway_request: RemoveGatewayRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_gateway<'life0, 'async_trait>(
&'life0 self,
remove_gateway_request: RemoveGatewayRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes the gateway’s registration record. First checks the provided signature to verify the gateway authorized the removal of the registration.