import { CashuMint } from './CashuMint.js'; import { MintKeys, PayLnInvoiceResponse, PaymentPayload, Proof, ReceiveResponse, ReceiveTokenEntryResponse, SendResponse, TokenEntry } from './model/types/index.js'; /** * Class that represents a Cashu wallet. * This class should act as the entry point for this library */ declare class CashuWallet { private _keys; private _keysetId; mint: CashuMint; /** * * @param keys public keys from the mint * @param mint Cashu mint instance is used to make api calls */ constructor(mint: CashuMint, keys?: MintKeys); get keys(): MintKeys; set keys(keys: MintKeys); get keysetId(): string; /** * returns proofs that are already spent (use for keeping wallet state clean) * @param proofs (only the 'secret' field is required) * @returns */ checkProofsSpent(proofs: Array): Promise>; /** * Starts a minting process by requesting an invoice from the mint * @param amount Amount requesting for mint. * @returns the mint will create and return a Lightning invoice for the specified amount */ requestMint(amount: number): Promise; /** * Executes a payment of an invoice on the Lightning network. * The combined amount of Proofs has to match the payment amount including fees. * @param invoice * @param proofsToSend the exact amount to send including fees * @param feeReserve? optionally set LN routing fee reserve. If not set, fee reserve will get fetched at mint */ payLnInvoice(invoice: string, proofsToSend: Array, feeReserve?: number): Promise; /** * Estimate fees for a given LN invoice * @param invoice LN invoice that needs to get a fee estimate * @returns estimated Fee */ getFee(invoice: string): Promise; createPaymentPayload(invoice: string, proofs: Array): PaymentPayload; /** * Use a cashu token to pay an ln invoice * @param invoice Lightning invoice * @param token cashu token */ payLnInvoiceWithToken(invoice: string, token: string): Promise; /** * Receive an encoded Cashu token * @param encodedToken Cashu token * @returns New token with newly created proofs, token entries that had errors, and newKeys if they have changed */ receive(encodedToken: string): Promise; /** * Receive a single cashu token entry * @param tokenEntry a single entry of a cashu token * @returns New token entry with newly created proofs, proofs that had errors, and newKeys if they have changed */ receiveTokenEntry(tokenEntry: TokenEntry): Promise; /** * Splits and creates sendable tokens * @param amount amount to send * @param proofs proofs matching that amount * @returns promise of the change- and send-proofs */ send(amount: number, proofs: Array): Promise; requestTokens(amount: number, hash: string): Promise<{ proofs: Array; newKeys?: MintKeys; }>; private initKeys; private changedKeys; private getKeys; private createSplitPayload; private splitReceive; private createRandomBlindedMessages; private createBlankOutputs; } export { CashuWallet };