UNPKG

lightningdevkit

Version:
31 lines (30 loc) 1.44 kB
import { Nonce } from '../structs/Nonce.mjs'; import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs'; import { ExpandedKey } from '../structs/ExpandedKey.mjs'; import { CommonBase } from './CommonBase.mjs'; /** An implementation of Verification */ export interface VerificationInterface { /**Constructs an HMAC to include in [`OffersContext`] for the data along with the given * [`Nonce`]. */ hmac_for_offer_payment(nonce: Nonce, expanded_key: ExpandedKey): Uint8Array; /**Authenticates the data using an HMAC and a [`Nonce`] taken from an [`OffersContext`]. */ verify_for_offer_payment(hmac: Uint8Array, nonce: Nonce, expanded_key: ExpandedKey): Result_NoneNoneZ; } /** * A trait defining behavior for creating and verifing the HMAC for authenticating a given data. */ export declare class Verification extends CommonBase { /** Creates a new instance of Verification from a given implementation */ static new_impl(arg: VerificationInterface): Verification; /** * Constructs an HMAC to include in [`OffersContext`] for the data along with the given * [`Nonce`]. */ hmac_for_offer_payment(nonce: Nonce, expanded_key: ExpandedKey): Uint8Array; /** * Authenticates the data using an HMAC and a [`Nonce`] taken from an [`OffersContext`]. */ verify_for_offer_payment(hmac: Uint8Array, nonce: Nonce, expanded_key: ExpandedKey): Result_NoneNoneZ; }