blockchain , sdchain cpp sdk and demo

Dependencies:   EthernetInterface mbed-rtos mbed uniqueCPUID

Fork of bcsdk by SDchain C Plus Plus Team

Committer:
webmaster
Date:
Wed Aug 08 09:51:32 2018 +0800
Revision:
18:ec6cd7cfe3f8
Parent:
12:1b24ea479a59
rm demo files

Who changed what in which revision?

UserRevisionLine numberNew contents of line
webmaster 8:f2a567ee3a46 1 /***********************************************************************
webmaster 8:f2a567ee3a46 2 * Module: Account.h
webmaster 8:f2a567ee3a46 3 * Author: Administrator
webmaster 8:f2a567ee3a46 4 * Modified: 2017Äê8ÔÂ18ÈÕ 11:06:20
webmaster 8:f2a567ee3a46 5 * Purpose: Declaration of the class Account
webmaster 8:f2a567ee3a46 6 * Comment: ÕË»§
webmaster 8:f2a567ee3a46 7 ***********************************************************************/
webmaster 8:f2a567ee3a46 8
webmaster 8:f2a567ee3a46 9 #if !defined(__Account_Account_h)
webmaster 8:f2a567ee3a46 10 #define __Account_Account_h
webmaster 10:aabd720e632c 11 #include <string>
webmaster 10:aabd720e632c 12 #include <map>
webmaster 10:aabd720e632c 13 #include "Key.h"
webmaster 10:aabd720e632c 14 #include "Object.h"
MrAI 12:1b24ea479a59 15 #include "MbedJSONValue.h"
webmaster 10:aabd720e632c 16 using namespace std;
webmaster 8:f2a567ee3a46 17
webmaster 8:f2a567ee3a46 18 class Account
webmaster 8:f2a567ee3a46 19 {
webmaster 8:f2a567ee3a46 20 public:
webmaster 10:aabd720e632c 21 Account();
webmaster 10:aabd720e632c 22 Account(Key &key);
webmaster 10:aabd720e632c 23 ~Account();
webmaster 10:aabd720e632c 24
webmaster 10:aabd720e632c 25 std::string id;
webmaster 10:aabd720e632c 26 std::string alias;
webmaster 10:aabd720e632c 27 //Key* keys;
webmaster 10:aabd720e632c 28 int quorum;
webmaster 10:aabd720e632c 29 map<std::string,Object> tags;
webmaster 10:aabd720e632c 30
webmaster 10:aabd720e632c 31 void setId(const string newId){this->id = newId;};
webmaster 10:aabd720e632c 32 string getId(){return this->id;};
webmaster 10:aabd720e632c 33
webmaster 10:aabd720e632c 34 void setAlias(const string newAlias){this->alias = newAlias;};
webmaster 10:aabd720e632c 35 string getAlias(){return this->alias;};
webmaster 10:aabd720e632c 36
webmaster 10:aabd720e632c 37 void setQuorum(int newQuorum){this->quorum = newQuorum;};
webmaster 10:aabd720e632c 38 int getQuorum(){return this->quorum;};
webmaster 10:aabd720e632c 39
MrAI 12:1b24ea479a59 40 string getBalance();
MrAI 12:1b24ea479a59 41 string getWallet();
MrAI 12:1b24ea479a59 42
webmaster 10:aabd720e632c 43 string createAccount();
webmaster 10:aabd720e632c 44 string listAccounts();
MrAI 12:1b24ea479a59 45 string getParseMbedJson(MbedJSONValue& out, const char * pos);//ת»»³ÉMbedjson¸ñʽ
MrAI 12:1b24ea479a59 46 bool getRequestRet(MbedJSONValue& in);//»ñÈ¡½»Ò׳ɹ¦±êÖ¾
MrAI 12:1b24ea479a59 47 string getKeyValue(MbedJSONValue& in, string Key1, string Key2);//»ñÈ¡¼üÖµ
MrAI 12:1b24ea479a59 48 string getKeyValue(MbedJSONValue& in, string Key1);
MrAI 12:1b24ea479a59 49 bool getKeyValueBool(MbedJSONValue& in, string Key1, string Key2);
MrAI 12:1b24ea479a59 50 bool getKeyValueBool(MbedJSONValue& in, string Key1);
MrAI 12:1b24ea479a59 51 int getKeyValueInt(MbedJSONValue& in, string Key1, string Key2);
MrAI 12:1b24ea479a59 52 double getKeyValuedouble(MbedJSONValue& in, string Key1, string Key2);
MrAI 12:1b24ea479a59 53 int getLedger(MbedJSONValue& in);//»ñÈ¡Ledger³¤¶È
MrAI 12:1b24ea479a59 54 int getBalanceSize(MbedJSONValue& in,string Key1);//»ñÈ¡Óà¶î¶ÔÏóÊý×é´óС
MrAI 12:1b24ea479a59 55 int getBalanceSize(MbedJSONValue& in, string Key1,string Key2);
MrAI 12:1b24ea479a59 56 string getBalanceArray(MbedJSONValue& in, string Key1, int i, string Key2);//»ñÈ¡Óà¶îÊý¾Ý
MrAI 12:1b24ea479a59 57 string getBalanceArray(MbedJSONValue& in, string Key1, string Key2, int i, string Key3);
MrAI 12:1b24ea479a59 58 string getBalanceArray(MbedJSONValue& in, string Key1, string Key2, string Key3, int i, string Key4);
webmaster 8:f2a567ee3a46 59 protected:
webmaster 8:f2a567ee3a46 60 private:
webmaster 10:aabd720e632c 61 Client client;
webmaster 10:aabd720e632c 62 MbedJSONValue m_valTags;
webmaster 10:aabd720e632c 63 Key m_Keys;
webmaster 8:f2a567ee3a46 64
webmaster 8:f2a567ee3a46 65 };
webmaster 8:f2a567ee3a46 66
MrAI 12:1b24ea479a59 67 #endif