UNPKG

lightningdevkit

Version:
67 lines (66 loc) 3.4 kB
import { DNSSECQuery } from '../structs/DNSSECQuery.mjs'; import { DNSSECProof } from '../structs/DNSSECProof.mjs'; import { Option_C2Tuple_DNSResolverMessageResponseInstructionZZ } from '../structs/Option_C2Tuple_DNSResolverMessageResponseInstructionZZ.mjs'; import { DNSResolverContext } from '../structs/DNSResolverContext.mjs'; import { TwoTuple_DNSResolverMessageMessageSendInstructionsZ } from '../structs/TwoTuple_DNSResolverMessageMessageSendInstructionsZ.mjs'; import { Responder } from '../structs/Responder.mjs'; import { NodeFeatures } from '../structs/NodeFeatures.mjs'; import { CommonBase } from './CommonBase.mjs'; /** An implementation of DNSResolverMessageHandler */ export interface DNSResolverMessageHandlerInterface { /**Handle a [`DNSSECQuery`] message. * * If we provide DNS resolution services to third parties, we should respond with a * [`DNSSECProof`] message. * * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ handle_dnssec_query(message: DNSSECQuery, responder: Responder): Option_C2Tuple_DNSResolverMessageResponseInstructionZZ; /**Handle a [`DNSSECProof`] message (in response to a [`DNSSECQuery`] we presumably sent). * * With this, we should be able to validate the DNS record we requested. */ handle_dnssec_proof(message: DNSSECProof, context: DNSResolverContext): void; /**Gets the node feature flags which this handler itself supports. Useful for setting the * `dns_resolver` flag if this handler supports returning [`DNSSECProof`] messages in response * to [`DNSSECQuery`] messages. */ provided_node_features(): NodeFeatures; /**Release any [`DNSResolverMessage`]s that need to be sent. */ release_pending_messages(): TwoTuple_DNSResolverMessageMessageSendInstructionsZ[]; } /** * A handler for an [`OnionMessage`] containing a DNS(SEC) query or a DNSSEC proof * * [`OnionMessage`]: crate::ln::msgs::OnionMessage */ export declare class DNSResolverMessageHandler extends CommonBase { /** Creates a new instance of DNSResolverMessageHandler from a given implementation */ static new_impl(arg: DNSResolverMessageHandlerInterface): DNSResolverMessageHandler; /** * Handle a [`DNSSECQuery`] message. * * If we provide DNS resolution services to third parties, we should respond with a * [`DNSSECProof`] message. * * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None */ handle_dnssec_query(message: DNSSECQuery, responder: Responder | null): Option_C2Tuple_DNSResolverMessageResponseInstructionZZ; /** * Handle a [`DNSSECProof`] message (in response to a [`DNSSECQuery`] we presumably sent). * * With this, we should be able to validate the DNS record we requested. */ handle_dnssec_proof(message: DNSSECProof, context: DNSResolverContext): void; /** * Gets the node feature flags which this handler itself supports. Useful for setting the * `dns_resolver` flag if this handler supports returning [`DNSSECProof`] messages in response * to [`DNSSECQuery`] messages. */ provided_node_features(): NodeFeatures; /** * Release any [`DNSResolverMessage`]s that need to be sent. */ release_pending_messages(): TwoTuple_DNSResolverMessageMessageSendInstructionsZ[]; }