mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-18 23:58:59 +02:00
implement createAccount(label)
This commit is contained in:
@@ -531,12 +531,20 @@ namespace monero {
|
||||
return account;
|
||||
}
|
||||
|
||||
MoneroAccount MoneroWallet::createAccount() {
|
||||
throw runtime_error("Not implemented");
|
||||
}
|
||||
|
||||
MoneroAccount MoneroWallet::createAccount(const string& label) {
|
||||
throw runtime_error("Not implemented");
|
||||
cout << "createAccount(" << label << ")" << endl;
|
||||
|
||||
// create account
|
||||
wallet2->add_subaddress_account(label);
|
||||
|
||||
// initialize and return result
|
||||
MoneroAccount account;
|
||||
account.index = wallet2->get_num_subaddress_accounts() - 1;
|
||||
account.primaryAddress = wallet2->get_subaddress_as_str({account.index.get(), 0});
|
||||
account.label = label;
|
||||
account.balance = 0;
|
||||
account.unlockedBalance = 0;
|
||||
return account;
|
||||
}
|
||||
|
||||
vector<MoneroSubaddress> MoneroWallet::getSubaddresses(const uint32_t accountIdx) const { // TODO: this should call one below
|
||||
|
||||
Reference in New Issue
Block a user