Electroneum
Utils Struct Reference

Static Public Member Functions

static void deleteWallet (const std::string &walletname)
 
static void deleteDir (const std::string &path)
 
static void print_transaction (Electroneum::TransactionInfo *t)
 
static std::string get_wallet_address (const std::string &filename, const std::string &password)
 

Detailed Description

Definition at line 101 of file main.cpp.

Member Function Documentation

◆ deleteDir()

static void Utils::deleteDir ( const std::string &  path)
inlinestatic

Definition at line 111 of file main.cpp.

112  {
113  std::cout << "** removing dir recursively: " << path << std::endl;
114  boost::filesystem::remove_all(path);
115  }
Here is the caller graph for this function:

◆ deleteWallet()

static void Utils::deleteWallet ( const std::string &  walletname)
inlinestatic

Definition at line 103 of file main.cpp.

104  {
105  std::cout << "** deleting wallet: " << walletname << std::endl;
106  boost::filesystem::remove(walletname);
107  boost::filesystem::remove(walletname + ".address.txt");
108  boost::filesystem::remove(walletname + ".keys");
109  }
Here is the caller graph for this function:

◆ get_wallet_address()

static std::string Utils::get_wallet_address ( const std::string &  filename,
const std::string &  password 
)
inlinestatic

Definition at line 131 of file main.cpp.

132  {
134  Electroneum::Wallet * w = wmgr->openWallet(filename, password, Electroneum::NetworkType::TESTNET);
135  std::string result = w->mainAddress();
136  wmgr->closeWallet(w);
137  return result;
138  }
virtual bool closeWallet(Wallet *wallet, bool store=true)=0
Closes wallet. In case operation succeeded, wallet object deleted. in case operation failed...
::std::string string
Definition: gtest-port.h:1097
virtual Wallet * openWallet(const std::string &path, const std::string &password, NetworkType nettype, uint64_t kdf_rounds=1, WalletListener *listener=nullptr)=0
Opens existing wallet.
WalletManager - provides functions to manage wallets.
Definition: wallet2_api.h:1017
static WalletManager * getWalletManager()
std::string mainAddress() const
Definition: wallet2_api.h:464
Interface for wallet operations. TODO: check if /include/IWallet.h is still actual.
Definition: wallet2_api.h:430
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_transaction()

static void Utils::print_transaction ( Electroneum::TransactionInfo t)
inlinestatic

Definition at line 117 of file main.cpp.

118  {
119 
120  std::cout << "d: "
121  << (t->direction() == Electroneum::TransactionInfo::Direction_In ? "in" : "out")
122  << ", pe: " << (t->isPending() ? "true" : "false")
123  << ", bh: " << t->blockHeight()
124  << ", a: " << Electroneum::Wallet::displayAmount(t->amount())
125  << ", f: " << Electroneum::Wallet::displayAmount(t->fee())
126  << ", h: " << t->hash()
127  << ", pid: " << t->paymentId()
128  << std::endl;
129  }
virtual std::string hash() const =0
transaction_id
virtual uint64_t amount() const =0
virtual uint64_t fee() const =0
virtual int direction() const =0
virtual bool isPending() const =0
static std::string displayAmount(uint64_t amount)
Definition: wallet.cpp:299
virtual uint64_t blockHeight() const =0
virtual std::string paymentId() const =0
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this struct was generated from the following file: