Commit df0c3adf authored by Jü's avatar

use monero lib v0.13

parent 0a1d0075
......@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.7</string>
<string>1.8</string>
<key>CFBundleVersion</key>
<string>1.7.0.0</string>
<string>1.8.0.0</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
......
......@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.7</string>
<string>1.8</string>
<key>CFBundleVersion</key>
<string>1.7.0.0</string>
<string>1.8.0.0</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
......
......@@ -62,14 +62,9 @@
EE5D01541F3CE10200E41AED /* WalletBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE5D01531F3CE10200E41AED /* WalletBuilder.swift */; };
EE5D016D1F3DE06100E41AED /* UInt64-ExtensionsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE5D016C1F3DE06100E41AED /* UInt64-ExtensionsTest.swift */; };
EE5D01AB1F436FCC00E41AED /* moneroWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EE5D01A91F436FCC00E41AED /* moneroWrapper.cpp */; };
EE5F244A2072B28B00B4F565 /* libwallet_merged.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8BD9C420723589004A7A11 /* libwallet_merged.a */; };
EE5F244B2072B2B700B4F565 /* libboost.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8DEBCA1FAA6012008C3560 /* libboost.a */; };
EE5F244C2072B2D500B4F565 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8DEB901FAA5BEF008C3560 /* libcrypto.a */; };
EE5F244D2072B2D500B4F565 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8DEB911FAA5BEF008C3560 /* libssl.a */; };
EE5F244E2072B30000B4F565 /* libepee.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8BD9C6207236AE004A7A11 /* libepee.a */; };
EE5F244F2072B32E00B4F565 /* libeasylogging.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8BD9C8207236E8004A7A11 /* libeasylogging.a */; };
EE5F24502072B35000B4F565 /* libunbound.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE8BD9CA20723738004A7A11 /* libunbound.a */; };
EE5F24522072B93200B4F565 /* liblmdb.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE5F243020724B9700B4F565 /* liblmdb.a */; };
EE6729141FF6ED6C0064951D /* ActivityIndicatorHUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE6729131FF6ED6C0064951D /* ActivityIndicatorHUD.swift */; };
EE6D88632064F758003B9149 /* Fiat.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE6D88622064F758003B9149 /* Fiat.swift */; };
EE6D88652064F7D7003B9149 /* FiatProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE6D88642064F7D7003B9149 /* FiatProvider.swift */; };
......@@ -109,6 +104,12 @@
EE9356EC210F78E600DFDD07 /* AppleWatch2FAVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE9356EB210F78E600DFDD07 /* AppleWatch2FAVC.swift */; };
EE947FD42111BA9D00D6F1D0 /* TwoFactorAuthenticationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE947FD32111BA9D00D6F1D0 /* TwoFactorAuthenticationService.swift */; };
EE947FD621120CC000D6F1D0 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE947FD521120CC000D6F1D0 /* NotificationService.swift */; };
EEB6FF732171FA1A00FE953D /* libunbound.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB6FF6E2171FA1A00FE953D /* libunbound.a */; };
EEB6FF742171FA1A00FE953D /* libepee.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB6FF6F2171FA1A00FE953D /* libepee.a */; };
EEB6FF752171FA1A00FE953D /* libwallet_merged.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB6FF702171FA1A00FE953D /* libwallet_merged.a */; };
EEB6FF762171FA1A00FE953D /* liblmdb.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB6FF712171FA1A00FE953D /* liblmdb.a */; };
EEB6FF772171FA1A00FE953D /* libeasylogging.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB6FF722171FA1A00FE953D /* libeasylogging.a */; };
EEB6FF79217228B900FE953D /* libsodium.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB6FF78217228B900FE953D /* libsodium.a */; };
EEC7720820CD131100EE22BC /* MoneroUriParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC7720720CD131100EE22BC /* MoneroUriParser.swift */; };
EEC7720B20CD16D800EE22BC /* MoneroUriParserTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC7720A20CD16D800EE22BC /* MoneroUriParserTest.swift */; };
EEC9D6B820FB9D410057B9C4 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EEC9D6B620FB9D410057B9C4 /* Interface.storyboard */; };
......@@ -375,6 +376,12 @@
EE9356EB210F78E600DFDD07 /* AppleWatch2FAVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleWatch2FAVC.swift; sourceTree = "<group>"; };
EE947FD32111BA9D00D6F1D0 /* TwoFactorAuthenticationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwoFactorAuthenticationService.swift; sourceTree = "<group>"; };
EE947FD521120CC000D6F1D0 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
EEB6FF6E2171FA1A00FE953D /* libunbound.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libunbound.a; path = "XWallet/external-libs/monero_v0.13/libunbound.a"; sourceTree = "<group>"; };
EEB6FF6F2171FA1A00FE953D /* libepee.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libepee.a; path = "XWallet/external-libs/monero_v0.13/libepee.a"; sourceTree = "<group>"; };
EEB6FF702171FA1A00FE953D /* libwallet_merged.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwallet_merged.a; path = "XWallet/external-libs/monero_v0.13/libwallet_merged.a"; sourceTree = "<group>"; };
EEB6FF712171FA1A00FE953D /* liblmdb.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblmdb.a; path = "XWallet/external-libs/monero_v0.13/liblmdb.a"; sourceTree = "<group>"; };
EEB6FF722171FA1A00FE953D /* libeasylogging.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libeasylogging.a; path = "XWallet/external-libs/monero_v0.13/libeasylogging.a"; sourceTree = "<group>"; };
EEB6FF78217228B900FE953D /* libsodium.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsodium.a; path = "XWallet/external-libs/libsodium/libsodium.a"; sourceTree = "<group>"; };
EEC7720720CD131100EE22BC /* MoneroUriParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoneroUriParser.swift; sourceTree = "<group>"; };
EEC7720A20CD16D800EE22BC /* MoneroUriParserTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoneroUriParserTest.swift; sourceTree = "<group>"; };
EEC9D6B420FB9D400057B9C4 /* XWallet Watchkit App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "XWallet Watchkit App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -427,14 +434,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
EE5F24522072B93200B4F565 /* liblmdb.a in Frameworks */,
EE5F24502072B35000B4F565 /* libunbound.a in Frameworks */,
EE5F244F2072B32E00B4F565 /* libeasylogging.a in Frameworks */,
EE5F244E2072B30000B4F565 /* libepee.a in Frameworks */,
EEB6FF79217228B900FE953D /* libsodium.a in Frameworks */,
EEB6FF732171FA1A00FE953D /* libunbound.a in Frameworks */,
EEB6FF742171FA1A00FE953D /* libepee.a in Frameworks */,
EEB6FF752171FA1A00FE953D /* libwallet_merged.a in Frameworks */,
EEB6FF762171FA1A00FE953D /* liblmdb.a in Frameworks */,
EEB6FF772171FA1A00FE953D /* libeasylogging.a in Frameworks */,
EE5F244C2072B2D500B4F565 /* libcrypto.a in Frameworks */,
EE5F244D2072B2D500B4F565 /* libssl.a in Frameworks */,
EE5F244B2072B2B700B4F565 /* libboost.a in Frameworks */,
EE5F244A2072B28B00B4F565 /* libwallet_merged.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -639,6 +647,12 @@
EE47C0981FAA354C000DCC39 /* Frameworks */ = {
isa = PBXGroup;
children = (
EEB6FF78217228B900FE953D /* libsodium.a */,
EEB6FF722171FA1A00FE953D /* libeasylogging.a */,
EEB6FF6F2171FA1A00FE953D /* libepee.a */,
EEB6FF712171FA1A00FE953D /* liblmdb.a */,
EEB6FF6E2171FA1A00FE953D /* libunbound.a */,
EEB6FF702171FA1A00FE953D /* libwallet_merged.a */,
EE5F243220724B9700B4F565 /* libblockchain_db.a */,
EE5F242720724B9700B4F565 /* libblocks.a */,
EE5F242E20724B9700B4F565 /* libcheckpoints.a */,
......@@ -1517,7 +1531,7 @@
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 4.3;
WATCHOS_DEPLOYMENT_TARGET = 5.0;
};
name = Debug;
};
......@@ -1540,7 +1554,7 @@
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 4.3;
WATCHOS_DEPLOYMENT_TARGET = 5.0;
};
name = Release;
};
......@@ -1562,7 +1576,7 @@
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 4.3;
WATCHOS_DEPLOYMENT_TARGET = 5.0;
};
name = Debug;
};
......@@ -1584,7 +1598,7 @@
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 4.3;
WATCHOS_DEPLOYMENT_TARGET = 5.0;
};
name = Release;
};
......@@ -1637,7 +1651,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
......@@ -1690,7 +1704,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
......@@ -1708,13 +1722,14 @@
ENABLE_BITCODE = NO;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
INFOPLIST_FILE = XWallet/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/XWallet/external-libs/monero_v0.12",
"$(PROJECT_DIR)/XWallet/external-libs/monero_v0.13",
"$(PROJECT_DIR)/XWallet/external-libs/openssl",
"$(PROJECT_DIR)/XWallet/external-libs/boost",
"$(PROJECT_DIR)/XWallet/external-libs/libsodium",
);
OTHER_CFLAGS = (
"-IXWallet/MoneroLib/",
......@@ -1739,13 +1754,14 @@
ENABLE_BITCODE = NO;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
INFOPLIST_FILE = XWallet/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/XWallet/external-libs/monero_v0.12",
"$(PROJECT_DIR)/XWallet/external-libs/monero_v0.13",
"$(PROJECT_DIR)/XWallet/external-libs/openssl",
"$(PROJECT_DIR)/XWallet/external-libs/boost",
"$(PROJECT_DIR)/XWallet/external-libs/libsodium",
);
OTHER_CFLAGS = (
"-IXWallet/MoneroLib/",
......
......@@ -24,7 +24,7 @@ public class Constants {
public static let numberOfFractionDigits: Int = 12
public static let prettyPrintNumberOfFractionDigits = 7
public static let mixinCount: UInt32 = 7
public static let mixinCount: UInt32 = 11
public static let defaultTransactionPriority = PendingTransactionPriority_Low
public static let numberOfRequiredConfirmations: UInt64 = 10
......
......@@ -20,11 +20,11 @@ extension String {
}
public subscript(r: Range<Int>) -> String {
let start = index(startIndex, offsetBy: r.lowerBound)
let end = index(startIndex, offsetBy: r.upperBound)
return String(self[Range(start ..< end)])
}
// public subscript(r: Range<Int>) -> String {
// let start = index(startIndex, offsetBy: r.lowerBound)
// let end = index(startIndex, offsetBy: r.upperBound)
// return String(self[Range(start ..< end)])
// }
public subscript(r: ClosedRange<Int>) -> String {
......
......@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.7</string>
<string>1.8</string>
<key>CFBundleVersion</key>
<string>1.7.0.0</string>
<string>1.8.0.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
......
......@@ -42,18 +42,18 @@
// Public interface for libwallet library
namespace Monero {
enum NetworkType : uint8_t {
MAINNET = 0,
TESTNET,
STAGENET
};
namespace Utils {
bool isAddressLocal(const std::string &hostaddr);
void onStartup();
}
template<typename T>
class optional {
public:
......@@ -66,7 +66,7 @@ namespace Monero {
T t;
bool set;
};
/**
* @brief Transaction-like interface for sending money
*/
......@@ -77,7 +77,7 @@ namespace Monero {
Status_Error,
Status_Critical
};
enum Priority {
Priority_Default = 0,
Priority_Low = 1,
......@@ -85,7 +85,7 @@ namespace Monero {
Priority_High = 3,
Priority_Last
};
virtual ~PendingTransaction() = 0;
virtual int status() const = 0;
virtual std::string errorString() const = 0;
......@@ -102,8 +102,32 @@ namespace Monero {
virtual uint64_t txCount() const = 0;
virtual std::vector<uint32_t> subaddrAccount() const = 0;
virtual std::vector<std::set<uint32_t>> subaddrIndices() const = 0;
/**
* @brief multisigSignData
* @return encoded multisig transaction with signers' keys.
* Transfer this data to another wallet participant to sign it.
* Assumed use case is:
* 1. Initiator:
* auto data = pendingTransaction->multisigSignData();
* 2. Signer1:
* pendingTransaction = wallet->restoreMultisigTransaction(data);
* pendingTransaction->signMultisigTx();
* auto signed = pendingTransaction->multisigSignData();
* 3. Signer2:
* pendingTransaction = wallet->restoreMultisigTransaction(signed);
* pendingTransaction->signMultisigTx();
* pendingTransaction->commit();
*/
virtual std::string multisigSignData() = 0;
virtual void signMultisigTx() = 0;
/**
* @brief signersKeys
* @return vector of base58-encoded signers' public keys
*/
virtual std::vector<std::string> signersKeys() const = 0;
};
/**
* @brief Transaction-like interface for sending money
*/
......@@ -114,7 +138,7 @@ namespace Monero {
Status_Error,
Status_Critical
};
virtual ~UnsignedTransaction() = 0;
virtual int status() const = 0;
virtual std::string errorString() const = 0;
......@@ -138,7 +162,7 @@ namespace Monero {
*/
virtual bool sign(const std::string &signedFileName) = 0;
};
/**
* @brief The TransactionInfo - interface for displaying transaction information
*/
......@@ -148,13 +172,13 @@ namespace Monero {
Direction_In,
Direction_Out
};
struct Transfer {
Transfer(uint64_t _amount, const std::string &address);
const uint64_t amount;
const std::string address;
};
virtual ~TransactionInfo() = 0;
virtual int direction() const = 0;
virtual bool isPending() const = 0;
......@@ -186,7 +210,7 @@ namespace Monero {
virtual std::vector<TransactionInfo*> getAll() const = 0;
virtual void refresh() = 0;
};
/**
* @brief AddressBookRow - provides functions to manage address book
*/
......@@ -197,7 +221,7 @@ namespace Monero {
m_address(_address),
m_paymentId(_paymentId),
m_description(_description) {}
private:
std::size_t m_rowId;
std::string m_address;
......@@ -210,7 +234,7 @@ namespace Monero {
std::string getPaymentId() const {return m_paymentId;}
std::size_t getRowId() const {return m_rowId;}
};
/**
* @brief The AddressBook - interface for
Book
......@@ -232,14 +256,14 @@ namespace Monero {
virtual int errorCode() const = 0;
virtual int lookupPaymentID(const std::string &payment_id) const = 0;
};
struct SubaddressRow {
public:
SubaddressRow(std::size_t _rowId, const std::string &_address, const std::string &_label):
m_rowId(_rowId),
m_address(_address),
m_label(_label) {}
private:
std::size_t m_rowId;
std::string m_address;
......@@ -250,7 +274,7 @@ namespace Monero {
std::string getLabel() const {return m_label;}
std::size_t getRowId() const {return m_rowId;}
};
struct Subaddress
{
virtual ~Subaddress() = 0;
......@@ -259,7 +283,7 @@ namespace Monero {
virtual void setLabel(uint32_t accountIndex, uint32_t addressIndex, const std::string &label) = 0;
virtual void refresh(uint32_t accountIndex) = 0;
};
struct SubaddressAccountRow {
public:
SubaddressAccountRow(std::size_t _rowId, const std::string &_address, const std::string &_label, const std::string &_balance, const std::string &_unlockedBalance):
......@@ -268,7 +292,7 @@ namespace Monero {
m_label(_label),
m_balance(_balance),
m_unlockedBalance(_unlockedBalance) {}
private:
std::size_t m_rowId;
std::string m_address;
......@@ -283,7 +307,7 @@ namespace Monero {
std::string getUnlockedBalance() const {return m_unlockedBalance;}
std::size_t getRowId() const {return m_rowId;}
};
struct SubaddressAccount
{
virtual ~SubaddressAccount() = 0;
......@@ -292,7 +316,16 @@ namespace Monero {
virtual void setLabel(uint32_t accountIndex, const std::string &label) = 0;
virtual void refresh() = 0;
};
struct MultisigState {
MultisigState() : isMultisig(false), isReady(false), threshold(0), total(0) {}
bool isMultisig;
bool isReady;
uint32_t threshold;
uint32_t total;
};
struct WalletListener
{
virtual ~WalletListener() = 0;
......@@ -302,67 +335,73 @@ namespace Monero {
* @param amount - amount
*/
virtual void moneySpent(const std::string &txId, uint64_t amount) = 0;
/**
* @brief moneyReceived - called when money received
* @param txId - transaction id
* @param amount - amount
*/
virtual void moneyReceived(const std::string &txId, uint64_t amount) = 0;
/**
* @brief unconfirmedMoneyReceived - called when payment arrived in tx pool
* @param txId - transaction id
* @param amount - amount
*/
virtual void unconfirmedMoneyReceived(const std::string &txId, uint64_t amount) = 0;
/**
* @brief newBlock - called when new block received
* @param height - block height
*/
virtual void newBlock(uint64_t height) = 0;
/**
* @brief updated - generic callback, called when any event (sent/received/block reveived/etc) happened with the wallet;
*/
virtual void updated() = 0;
/**
* @brief refreshed - called when wallet refreshed by background thread or explicitly refreshed by calling "refresh" synchronously
*/
virtual void refreshed() = 0;
};
/**
* @brief Interface for wallet operations.
* TODO: check if /include/IWallet.h is still actual
*/
struct Wallet
{
enum Device {
Device_Software = 0,
Device_Ledger = 1
};
enum Status {
Status_Ok,
Status_Error,
Status_Critical
};
enum ConnectionStatus {
ConnectionStatus_Disconnected,
ConnectionStatus_Connected,
ConnectionStatus_WrongVersion
};
virtual ~Wallet() = 0;
virtual std::string seed() const = 0;
virtual std::string getSeedLanguage() const = 0;
virtual void setSeedLanguage(const std::string &arg) = 0;
//! returns wallet status (Status_Ok | Status_Error)
virtual int status() const = 0;
virtual int status() const = 0; //deprecated: use safe alternative statusWithErrorString
//! in case error status, returns error string
virtual std::string errorString() const = 0;
virtual std::string errorString() const = 0; //deprecated: use safe alternative statusWithErrorString
//! returns both error and error string atomically. suggested to use in instead of status() and errorString()
virtual void statusWithErrorString(int& status, std::string& errorString) const = 0;
virtual bool setPassword(const std::string &password) = 0;
virtual std::string address(uint32_t accountIndex = 0, uint32_t addressIndex = 0) const = 0;
std::string mainAddress() const { return address(0, 0); }
......@@ -385,31 +424,37 @@ namespace Monero {
* \return - 106 characters string representing integrated address
*/
virtual std::string integratedAddress(const std::string &payment_id) const = 0;
/*!
* \brief secretViewKey - returns secret view key
* \return - secret view key
*/
virtual std::string secretViewKey() const = 0;
/*!
* \brief publicViewKey - returns public view key
* \return - public view key
*/
virtual std::string publicViewKey() const = 0;
/*!
* \brief secretSpendKey - returns secret spend key
* \return - secret spend key
*/
virtual std::string secretSpendKey() const = 0;
/*!
* \brief publicSpendKey - returns public spend key
* \return - public spend key
*/
virtual std::string publicSpendKey() const = 0;
/*!
* \brief publicMultisigSignerKey - returns public signer key
* \return - public multisignature signer key or empty string if wallet is not multisig
*/
virtual std::string publicMultisigSignerKey() const = 0;
/*!
* \brief store - stores wallet to file.
* \param path - main filename to store wallet to. additionally stores address file and keys file.
......@@ -440,7 +485,7 @@ namespace Monero {
* \return - true on success
*/
virtual bool init(const std::string &daemon_address, uint64_t upper_transaction_size_limit = 0, const std::string &daemon_username = "", const std::string &daemon_password = "", bool use_ssl = false, bool lightWallet = false) = 0;
/*!
* \brief createWatchOnly - Creates a watch only wallet
* \param path - where to store the wallet
......@@ -449,33 +494,48 @@ namespace Monero {
* \return - true if created successfully
*/
virtual bool createWatchOnly(const std::string &path, const std::string &password, const std::string &language) const = 0;
/*!
* \brief setRefreshFromBlockHeight - start refresh from block height on recover
*
* \param refresh_from_block_height - blockchain start height
*/
virtual void setRefreshFromBlockHeight(uint64_t refresh_from_block_height) = 0;
/*!
* \brief getRestoreHeight - get wallet creation height
*
*/
virtual uint64_t getRefreshFromBlockHeight() const = 0;
/*!
* \brief setRecoveringFromSeed - set state recover form seed
*
* \param recoveringFromSeed - true/false
*/
virtual void setRecoveringFromSeed(bool recoveringFromSeed) = 0;
/*!
* \brief setRecoveringFromDevice - set state to recovering from device
*
* \param recoveringFromDevice - true/false
*/
virtual void setRecoveringFromDevice(bool recoveringFromDevice) = 0;
/*!
* \brief setSubaddressLookahead - set size of subaddress lookahead
*
* \param major - size fot the major index
* \param minor - size fot the minor index
*/
virtual void setSubaddressLookahead(uint32_t major, uint32_t minor) = 0;
/**
* @brief connectToDaemon - connects to the daemon. TODO: check if it can be removed
* @return
*/
virtual bool connectToDaemon() = 0;
/**
* @brief connected - checks if the wallet connected to the daemon
* @return - true if connected
......@@ -497,45 +557,45 @@ namespace Monero {
result += unlockedBalance(i);
return result;
}
/**
* @brief watchOnly - checks if wallet is watch only
* @return - true if watch only
*/
virtual bool watchOnly() const = 0;
/**
* @brief blockChainHeight - returns current blockchain height
* @return
*/
virtual uint64_t blockChainHeight() const = 0;
/**
* @brief approximateBlockChainHeight - returns approximate blockchain height calculated from date/time
* @return
*/
virtual uint64_t approximateBlockChainHeight() const = 0;
/**
* @brief daemonBlockChainHeight - returns daemon blockchain height
* @return 0 - in case error communicating with the daemon.
* status() will return Status_Error and errorString() will return verbose error description
*/
virtual uint64_t daemonBlockChainHeight() const = 0;
/**
* @brief daemonBlockChainTargetHeight - returns daemon blockchain target height
* @return 0 - in case error communicating with the daemon.
* status() will return Status_Error and errorString() will return verbose error description
*/
virtual uint64_t daemonBlockChainTargetHeight() const = 0;
/**