Transaction list
This commit is contained in:
@@ -8,24 +8,12 @@
|
||||
NS_BEGIN(Sia)
|
||||
NS_BEGIN(Api)
|
||||
|
||||
class SIADRIVE_EXPORTABLE CSiaTransaction
|
||||
{
|
||||
public:
|
||||
CSiaTransaction();
|
||||
|
||||
~CSiaTransaction();
|
||||
|
||||
Property(SString, Date, public, private)
|
||||
Property(SString, Amount, public, private)
|
||||
Property(SString, Address, public, private)
|
||||
Property(SString, TransactionId, public, private)
|
||||
};
|
||||
|
||||
class CSiaTransaction;
|
||||
typedef std::shared_ptr<CSiaTransaction> CSiaTransactionPtr;
|
||||
typedef std::vector<CSiaTransactionPtr> CSiaTransactionList;
|
||||
typedef std::shared_ptr<CSiaTransactionList> CSiaTransactionListPtr;
|
||||
|
||||
class CSiaDriveConfig;
|
||||
|
||||
class SIADRIVE_EXPORTABLE CSiaBase
|
||||
{
|
||||
public:
|
||||
@@ -151,7 +139,7 @@ public:
|
||||
CSiaError<_SiaApiErrorCode> Lock();
|
||||
CSiaError<_SiaApiErrorCode> Unlock(const SString& password);
|
||||
CSiaError<_SiaApiErrorCode> Send(const SString& address, const SiaCurrency& amount);
|
||||
CSiaTransactionListPtr GetTransactionHistory();
|
||||
CSiaTransactionListPtr GetTransactionHistory() const;
|
||||
};
|
||||
|
||||
class SIADRIVE_EXPORTABLE _CSiaRenter :
|
||||
|
@@ -113,7 +113,15 @@ get_access:\
|
||||
set_access:\
|
||||
type Set##name(const type& value) { json_doc[#name] = value; return value; }\
|
||||
protected:\
|
||||
bool Check##name() { return json_doc.find(#name) != json_doc.end(); }
|
||||
bool Check##name() { return json_doc.find(#name) != json_doc.end(); }
|
||||
|
||||
#define JProperty2(type, name, json_name, get_access, set_access, json_doc) \
|
||||
get_access:\
|
||||
type Get##name() const { return json_doc[#json_name].get<type>();}\
|
||||
set_access:\
|
||||
type Set##name(const type& value) { json_doc[#json_name] = value; return value; }\
|
||||
protected:\
|
||||
bool Check##name() { return json_doc.find(#json_name) != json_doc.end(); }
|
||||
|
||||
#define JPropertyCb(type, name, get_access, set_access, json_doc, cb) \
|
||||
get_access:\
|
||||
|
60
include/siadrive_api/siatransaction.h
Normal file
60
include/siadrive_api/siatransaction.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#ifndef _SIATRANSACTION_H
|
||||
#define _SIATRANSACTION_H
|
||||
|
||||
#include <siacommon.h>
|
||||
|
||||
NS_BEGIN(Sia)
|
||||
NS_BEGIN(Api)
|
||||
|
||||
class SIADRIVE_EXPORTABLE CSiaTransaction
|
||||
{
|
||||
public:
|
||||
class CSiaInput
|
||||
{
|
||||
public:
|
||||
CSiaInput(const json& json);
|
||||
|
||||
private:
|
||||
json _json;
|
||||
|
||||
JProperty2(std::string, FundType, fundtype, public, private, _json)
|
||||
JProperty2(bool, WalletAddress, walletaddress, public, private, _json)
|
||||
JProperty2(std::string, RelatedAddress, relatedaddress, public, private, _json)
|
||||
JProperty2(std::string, Value, value, public, private, _json)
|
||||
|
||||
};
|
||||
typedef std::shared_ptr<CSiaInput> CSiaInputPtr;
|
||||
|
||||
public:
|
||||
class CSiaOutput
|
||||
{
|
||||
public:
|
||||
CSiaOutput(const json& txData);
|
||||
|
||||
private:
|
||||
json _json;
|
||||
|
||||
JProperty2(std::string, FundType, fundtype, public, private, _json)
|
||||
JProperty2(std::uint64_t, MaturityHeight, maturityheight, public, private, _json)
|
||||
JProperty2(bool, WalletAddress, walletaddress, public, private, _json)
|
||||
JProperty2(std::string, RelatedAddress, relatedaddress, public, private, _json)
|
||||
JProperty2(std::string, Value, value, public, private, _json)
|
||||
};
|
||||
typedef std::shared_ptr<CSiaOutput> CSiaOutputPtr;
|
||||
|
||||
public:
|
||||
CSiaTransaction(const json& txData);
|
||||
|
||||
private:
|
||||
json _json;
|
||||
|
||||
JProperty2(std::uint64_t, ConfirmationTimeStamp, confirmationtimestamp, public, private, _json)
|
||||
JProperty2(std::uint64_t, ConfirmationHeight, confirmationheight, public, private, _json)
|
||||
JProperty2(std::string, Transaction, transaction, public, private, _json)
|
||||
JProperty2(std::string, TransactionId, transactionid, public, private, _json)
|
||||
Property(std::vector<CSiaInputPtr>, Inputs, public, private)
|
||||
Property(std::vector<CSiaOutputPtr>, Outputs, public, private)
|
||||
};
|
||||
|
||||
NS_END(2)
|
||||
#endif
|
Reference in New Issue
Block a user