mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Raw account class (address + public key) Account State class (account + balance + ledgers valid) Raw Hanko class Low-level tranasaction class Small wallet and key bits Misc updates to the protocol. Protocol addition to allow code to wait for replies, but that may not be a good idea.
55 lines
1.1 KiB
C++
55 lines
1.1 KiB
C++
#ifndef __WALLET__
|
|
#define __WALLET__
|
|
|
|
#include "keystore.h"
|
|
#include "newcoin.pb.h"
|
|
#include "Transaction.h"
|
|
#include <list>
|
|
#include <vector>
|
|
|
|
class NewcoinAddress;
|
|
|
|
/*
|
|
Keeps track of all the public/private keys you have created
|
|
*/
|
|
class LocalAccount
|
|
{
|
|
public:
|
|
//CKey mKey;
|
|
//std::string mHumanAddress;
|
|
uint160 mAddress;
|
|
CKey mPublicKey, mPrivateKey;
|
|
int64 mAmount;
|
|
uint32 mSeqNum;
|
|
|
|
bool SignRaw(const std::vector<unsigned char> &toSign, std::vector<unsigned char> &signature);
|
|
bool CheckSignRaw(const std::vector<unsigned char> &toSign, const std::vector<unsigned char> &signature);
|
|
};
|
|
|
|
class Wallet : public CBasicKeyStore
|
|
{
|
|
std::list<LocalAccount> mYourAccounts;
|
|
|
|
|
|
|
|
TransactionPtr createTransaction(LocalAccount& fromAccount, uint160& destAddr, int64 amount);
|
|
bool commitTransaction(TransactionPtr trans);
|
|
|
|
LocalAccount* consolidateAccountOfSize(int64 amount);
|
|
|
|
public:
|
|
Wallet();
|
|
void refreshAccounts();
|
|
void load();
|
|
|
|
int64 getBalance();
|
|
|
|
// returns some human error str?
|
|
std::string sendMoneyToAddress(uint160& destAddress, int64 amount);
|
|
|
|
// you may need to update your balances
|
|
void transactionChanged(TransactionPtr trans);
|
|
|
|
};
|
|
|
|
#endif |