Electroneum
Loading...
Searching...
No Matches
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()

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()

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()

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

Definition at line 131 of file main.cpp.

132 {
133 Electroneum::WalletManager *wmgr = Electroneum::WalletManagerFactory::getWalletManager();
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 }
std::string mainAddress() const
static WalletManager * getWalletManager()
virtual bool closeWallet(Wallet *wallet, bool store=true)=0
Closes wallet. In case operation succeeded, wallet object deleted. in case operation failed,...
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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_transaction()

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()
125 << ", f: " << Electroneum::Wallet::displayAmount(t->fee())
126 << ", h: " << t->hash()
127 << ", pid: " << t->paymentId()
128 << std::endl;
129 }
virtual bool isPending() const =0
virtual std::string paymentId() const =0
virtual uint64_t fee() const =0
virtual std::string hash() const =0
transaction_id
virtual uint64_t blockHeight() const =0
virtual int direction() const =0
virtual uint64_t amount() const =0
static std::string displayAmount(uint64_t amount)
Definition wallet.cpp:299
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:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/tests/libwallet_api_tests/main.cpp