/* * This file is part of the Flowee project * Copyright (C) 2025 Tom Zander * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SEEDSBACKUP_H #define SEEDSBACKUP_H #include "Wallet.h" #include #include class SeedsBackup { public: explicit SeedsBackup(const std::shared_ptr &wallet); static SeedsBackup *fromData(const Streaming::ConstBuffer &data); struct Path { QString path; QString name; int startingHeight = 0; }; /** * Generates the actual seed words again from the data. * Notice that this requires the used dictionary to be * installed. This method throws if it is not found. */ QString generateSeedPhrase() const; /** * Serialize the seeds to the standard format of CHIP-2023-wallet offline backup */ Streaming::ConstBuffer toBuffer() const; const QList& paths() const; QString name() const; protected: SeedsBackup(); QString m_name; QList m_paths; std::vector m_seed; int m_language = 0; }; #endif