![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
#include "rpcserver.h"#include "util.h"#include "init.h"#include "wallet.h"#include "clientversion.h"#include <stdint.h>#include <string.h>#include <map>#include <fstream>#include <vector>#include <string>#include <boost/algorithm/string.hpp>#include <boost/algorithm/string/find.hpp>#include <boost/lexical_cast.hpp>#include <boost/format.hpp>#include "json/json_spirit_utils.h"#include "json/json_spirit_value.h"#include "leveldb/db.h"#include "leveldb/write_batch.h"#include <openssl/sha.h>#include "mastercore.h"#include "mastercore_convert.h"#include "mastercore_dex.h"#include "mastercore_parse_string.h"#include "mastercore_tx.h"#include "mastercore_sp.h"#include "mastercore_rpc.h"#include "mastercore_errors.h"#include "mastercore_version.h"
Include dependency graph for mastercore_rpc.cpp:Go to the source code of this file.
Functions | |
| void | PropertyToJSON (const CMPSPInfo::Entry &sProperty, Object &property_obj) |
| void | MetaDexObjectToJSON (const CMPMetaDEx &obj, Object &metadex_obj) |
| void | MetaDexObjectsToJSON (std::vector< CMPMetaDEx > &vMetaDexObjs, Array &response) |
| void | BalanceToJSON (const std::string &address, uint32_t property, Object &balance_obj) |
| Value | mscrpc (const Array ¶ms, bool fHelp) |
| Value | getbalance_MP (const Array ¶ms, bool fHelp) |
| Value | send_MP (const Array ¶ms, bool fHelp) |
| Value | sendtoowners_MP (const Array ¶ms, bool fHelp) |
| Value | sendrawtx_MP (const Array ¶ms, bool fHelp) |
| Value | getallbalancesforid_MP (const Array ¶ms, bool fHelp) |
| Value | getallbalancesforaddress_MP (const Array ¶ms, bool fHelp) |
| Value | getproperty_MP (const Array ¶ms, bool fHelp) |
| Value | listproperties_MP (const Array ¶ms, bool fHelp) |
| Value | getcrowdsale_MP (const Array ¶ms, bool fHelp) |
| Value | getactivecrowdsales_MP (const Array ¶ms, bool fHelp) |
| Value | getgrants_MP (const Array ¶ms, bool fHelp) |
| int | check_prop_valid (int64_t tmpPropId, string error, string exist_error) |
| Value | getactivedexsells_MP (const Array ¶ms, bool fHelp) |
| Value | listblocktransactions_MP (const Array ¶ms, bool fHelp) |
| int | populateRPCTransactionObject (uint256 txid, Object *txobj, string filterAddress="") |
| Value | gettransaction_MP (const Array ¶ms, bool fHelp) |
| Value | listtransactions_MP (const Array ¶ms, bool fHelp) |
| Value | getinfo_MP (const Array ¶ms, bool fHelp) |
| Value | getsto_MP (const Array ¶ms, bool fHelp) |
| Value | gettrade_MP (const Array ¶ms, bool fHelp) |
| void BalanceToJSON | ( | const std::string & | address, |
| uint32_t | property, | ||
| Object & | balance_obj | ||
| ) |
Definition at line 99 of file mastercore_rpc.cpp.
References ACCEPT_RESERVE, FormatMP(), getMPbalance(), getUserAvailableMPbalance(), METADEX_RESERVE, and SELLOFFER_RESERVE.
Referenced by getallbalancesforaddress_MP(), getallbalancesforid_MP(), and getbalance_MP().
Here is the call graph for this function:
Here is the caller graph for this function:| int check_prop_valid | ( | int64_t | tmpPropId, |
| string | error, | ||
| string | exist_error | ||
| ) |
Definition at line 925 of file mastercore_rpc.cpp.
References mastercore::_my_sps, CMPSPInfo::getSP(), JSONRPCError(), and RPC_INVALID_PARAMETER.
Here is the call graph for this function:| Value getactivecrowdsales_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 765 of file mastercore_rpc.cpp.
References mastercore::_my_sps, CMPSPInfo::Entry::deadline, CMPSPInfo::Entry::early_bird, FormatMP(), CMPCrowd::getPropertyId(), CMPSPInfo::getSP(), GetTransaction(), HelpExampleCli(), HelpExampleRpc(), CMPSPInfo::Entry::issuer, JSONRPCError(), mapBlockIndex, mastercore::my_crowds, CMPSPInfo::Entry::name, CMPSPInfo::Entry::num_tokens, CMPSPInfo::Entry::percentage, CMPSPInfo::Entry::property_desired, RPC_INVALID_ADDRESS_OR_KEY, and CMPSPInfo::Entry::txid.
Here is the call graph for this function:| Value getactivedexsells_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 1210 of file mastercore_rpc.cpp.
References ACCEPT_RESERVE, COIN, FormatDivisibleMP(), CMPAccept::getAcceptAmountRemaining(), CMPAccept::getAcceptBlock(), CMPOffer::getBlockTimeLimit(), CMPOffer::getBTCDesiredOriginal(), CMPOffer::getHash(), CMPAccept::getHash(), base_uint< BITS >::GetHex(), CMPOffer::getMinFee(), getMPbalance(), CMPOffer::getOfferAmountOriginal(), CMPOffer::getProperty(), HelpExampleCli(), HelpExampleRpc(), mastercore::my_accepts, mastercore::my_offers, mastercore::rounduint64(), and SELLOFFER_RESERVE.
Here is the call graph for this function:| Value getallbalancesforaddress_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 462 of file mastercore_rpc.cpp.
References BalanceToJSON(), mastercore::getTally(), HelpExampleCli(), HelpExampleRpc(), CMPTally::init(), JSONRPCError(), CMPTally::next(), and RPC_INVALID_PARAMETER.
Here is the call graph for this function:| Value getallbalancesforid_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 408 of file mastercore_rpc.cpp.
References mastercore::_my_sps, BalanceToJSON(), CMPSPInfo::getSP(), HelpExampleCli(), HelpExampleRpc(), JSONRPCError(), mastercore::mp_tally_map, and RPC_INVALID_PARAMETER.
Here is the call graph for this function:| Value getbalance_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 221 of file mastercore_rpc.cpp.
References mastercore::_my_sps, BalanceToJSON(), CMPSPInfo::getSP(), JSONRPCError(), and RPC_INVALID_PARAMETER.
Here is the call graph for this function:| Value getcrowdsale_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 615 of file mastercore_rpc.cpp.
References mastercore::_my_sps, CMPSPInfo::Entry::close_early, CMPSPInfo::Entry::deadline, CMPSPInfo::Entry::early_bird, CMPSPInfo::Entry::fixed, FormatMP(), CMPCrowd::getDatabase(), base_uint< BITS >::GetHex(), CMPCrowd::getPropertyId(), CMPSPInfo::getSP(), mastercore::getTotalTokens(), GetTransaction(), HelpExampleCli(), HelpExampleRpc(), CMPSPInfo::Entry::historicalData, mastercore::isCrowdsaleActive(), CMPSPInfo::Entry::issuer, JSONRPCError(), CMPSPInfo::Entry::manual, mapBlockIndex, CMPSPInfo::Entry::max_tokens, CMPSPInfo::Entry::missedTokens, mastercore::my_crowds, CMPSPInfo::Entry::name, CMPSPInfo::Entry::num_tokens, CMPSPInfo::Entry::percentage, CMPSPInfo::Entry::property_desired, RPC_INTERNAL_ERROR, RPC_INVALID_ADDRESS_OR_KEY, RPC_INVALID_PARAMETER, CMPSPInfo::Entry::timeclosed, CMPSPInfo::Entry::txid, and CMPSPInfo::Entry::txid_close.
Here is the call graph for this function:| Value getgrants_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 837 of file mastercore_rpc.cpp.
References mastercore::_my_sps, CMPSPInfo::Entry::fixed, FormatMP(), base_uint< BITS >::GetHex(), CMPSPInfo::getSP(), mastercore::getTotalTokens(), HelpExampleCli(), HelpExampleRpc(), CMPSPInfo::Entry::historicalData, CMPSPInfo::Entry::issuer, JSONRPCError(), CMPSPInfo::Entry::manual, CMPSPInfo::Entry::name, RPC_INVALID_PARAMETER, and CMPSPInfo::Entry::txid.
Here is the call graph for this function:| Value getinfo_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 1905 of file mastercore_rpc.cpp.
References chainActive, CLIENT_VERSION, COMMIT_INFO, mastercore::FormatIndivisibleMP(), mastercore::getMasterCoreAlertString(), CMPTradeList::getMPTradeCountTotal(), CMPTxList::getMPTransactionCountBlock(), CMPTxList::getMPTransactionCountTotal(), global_alert_message, CChain::Height(), JSONRPCError(), OMNICORE_VERSION_BASE, OMNICORE_VERSION_TYPE, mastercore::p_txlistdb, RPC_INVALID_PARAMETER, and mastercore::t_tradelistdb.
Here is the call graph for this function:| Value getproperty_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 510 of file mastercore_rpc.cpp.
References mastercore::_my_sps, CMPSPInfo::Entry::fixed, FormatMP(), base_uint< BITS >::GetHex(), CMPSPInfo::getSP(), mastercore::getTotalTokens(), HelpExampleCli(), HelpExampleRpc(), CMPSPInfo::Entry::issuer, JSONRPCError(), PropertyToJSON(), RPC_INVALID_PARAMETER, and CMPSPInfo::Entry::txid.
Here is the call graph for this function:| Value getsto_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 1985 of file mastercore_rpc.cpp.
References FormatDivisibleMP(), CMPTransaction::getProperty(), CMPSTOList::getRecipients(), GetTransaction(), HelpExampleCli(), HelpExampleRpc(), JSONRPCError(), MP_BLOCK_NOT_IN_CHAIN, MP_CROWDSALE_WITHOUT_PROPERTY, MP_INVALID_TX_IN_DB_FOUND, MP_TX_IS_NOT_MASTER_PROTOCOL, MP_TX_NOT_FOUND, MP_TX_UNCONFIRMED, parseTransaction(), populateRPCTransactionObject(), RPC_INTERNAL_ERROR, RPC_INVALID_ADDRESS_OR_KEY, mastercore::s_stolistdb, base_uint< BITS >::SetHex(), CMPTransaction::step1(), and CMPTransaction::step2_Value().
Here is the call graph for this function:| Value gettrade_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 2060 of file mastercore_rpc.cpp.
References CMPTxList::findMetaDExCancel(), FormatMP(), CMPMetaDEx::getAction(), CMPTransaction::getAmount(), base_uint< BITS >::GetHex(), CMPTxList::getKeyValue(), CMPTradeList::getMatchingTrades(), CMPTxList::getNumberOfMetaDExCancels(), CMPTransaction::getProperty(), CMPTransaction::getSender(), GetTransaction(), HelpExampleCli(), HelpExampleRpc(), CMPTransaction::interpretPacket(), mastercore::isMetaDExOfferActive(), JSONRPCError(), MP_BLOCK_NOT_IN_CHAIN, MP_CROWDSALE_WITHOUT_PROPERTY, MP_INVALID_TX_IN_DB_FOUND, MP_TX_IS_NOT_MASTER_PROTOCOL, MP_TX_NOT_FOUND, MP_TX_UNCONFIRMED, mastercore::p_txlistdb, parseTransaction(), populateRPCTransactionObject(), RPC_INTERNAL_ERROR, RPC_INVALID_ADDRESS_OR_KEY, base_uint< BITS >::SetHex(), CMPTransaction::step1(), CMPTransaction::step2_Value(), mastercore::t_tradelistdb, and base_uint< BITS >::ToString().
Here is the call graph for this function:| Value gettransaction_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 1698 of file mastercore_rpc.cpp.
References HelpExampleCli(), HelpExampleRpc(), JSONRPCError(), MP_BLOCK_NOT_IN_CHAIN, MP_CROWDSALE_WITHOUT_PROPERTY, MP_INVALID_TX_IN_DB_FOUND, MP_TX_IS_NOT_MASTER_PROTOCOL, MP_TX_NOT_FOUND, MP_TX_UNCONFIRMED, populateRPCTransactionObject(), RPC_INTERNAL_ERROR, RPC_INVALID_ADDRESS_OR_KEY, and base_uint< BITS >::SetHex().
Here is the call graph for this function:| Value listblocktransactions_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 1305 of file mastercore_rpc.cpp.
References chainActive, CMPTxList::exists(), CTransaction::GetHash(), mastercore::GetHeight(), base_uint< BITS >::GetHex(), HelpExampleCli(), HelpExampleRpc(), JSONRPCError(), mastercore::p_txlistdb, ReadBlockFromDisk(), RPC_INTERNAL_ERROR, RPC_INVALID_PARAMETER, and CBlock::vtx.
Here is the call graph for this function:| Value listproperties_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 561 of file mastercore_rpc.cpp.
References mastercore::_my_sps, CMPSPInfo::getSP(), HelpExampleCli(), HelpExampleRpc(), CMPSPInfo::peekNextSPID(), PropertyToJSON(), and TEST_ECO_PROPERTY_1.
Here is the call graph for this function:| Value listtransactions_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 1764 of file mastercore_rpc.cpp.
References atoi(), CWallet::cs_wallet, FormatDivisibleMP(), CTransaction::GetHash(), CMPSTOList::getMySTOReceipts(), CMPSTOList::getRecipients(), CMerkleTx::hashBlock, HelpExampleCli(), HelpExampleRpc(), JSONRPCError(), LOCK, mapBlockIndex, CBlockIndex::nHeight, CWallet::OrderedTxItems(), populateRPCTransactionObject(), pwalletMain, RPC_INVALID_PARAMETER, mastercore::s_stolistdb, and base_uint< BITS >::SetHex().
Here is the call graph for this function:| void MetaDexObjectsToJSON | ( | std::vector< CMPMetaDEx > & | vMetaDexObjs, |
| Array & | response | ||
| ) |
Definition at line 84 of file mastercore_rpc.cpp.
References MetaDexObjectToJSON().
Here is the call graph for this function:| void MetaDexObjectToJSON | ( | const CMPMetaDEx & | obj, |
| Object & | metadex_obj | ||
| ) |
Definition at line 57 of file mastercore_rpc.cpp.
References mastercore::_my_sps, FormatMP(), CMPMetaDEx::getAction(), CMPMetaDEx::getAddr(), CMPMetaDEx::getAmountDesired(), CMPMetaDEx::getAmountForSale(), CMPMetaDEx::getBlock(), CMPMetaDEx::getBlockTime(), CMPMetaDEx::getDesProperty(), CMPMetaDEx::getHash(), base_uint< BITS >::GetHex(), CMPMetaDEx::getProperty(), CMPSPInfo::getSP(), CMPSPInfo::Entry::isDivisible(), and mastercore::isTestEcosystemProperty().
Referenced by MetaDexObjectsToJSON().
Here is the call graph for this function:
Here is the caller graph for this function:| Value mscrpc | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 114 of file mastercore_rpc.cpp.
References mastercore::_my_sps, atoi(), FormatDivisibleMP(), mastercore::GetHeight(), HelpExampleCli(), HelpExampleRpc(), mastercore::isMPinBlockRange(), mastercore::isPropertyDivisible(), mastercore::MetaDEx_debug_print(), mastercore::mp_tally_map, mastercore::my_crowds, mastercore::p_txlistdb, CMPSTOList::printAll(), CMPSPInfo::printAll(), CMPTradeList::printAll(), CMPTxList::printAll(), CMPSTOList::printStats(), CMPTradeList::printStats(), CMPTxList::printStats(), mastercore::s_stolistdb, and mastercore::t_tradelistdb.
Here is the call graph for this function:Definition at line 1356 of file mastercore_rpc.cpp.
References mastercore::_my_sps, CMPTxList::exists(), CMPSPInfo::findSPByTX(), FormatDivisibleMP(), FormatMP(), CMPMetaDEx::getAction(), CMPTransaction::getAmount(), CMPMetaDEx::getAmountDesired(), CMPOffer::getBlockTimeLimit(), CMPOffer::getBTCDesiredOriginal(), CMPMetaDEx::getDesProperty(), CMPTransaction::getFeePaid(), mastercore::GetHeight(), base_uint< BITS >::GetHex(), CMPOffer::getMinFee(), CMPTxList::getNumberOfPurchases(), CMPTransaction::getProperty(), CMPTxList::getPurchaseDetails(), CMPTransaction::getReceiver(), CMPTransaction::getSender(), CMPSPInfo::getSP(), CMPTransaction::getSPName(), CMPOffer::getSubaction(), mastercore::getTotalTokens(), GetTransaction(), CMPTransaction::getType(), CMPTransaction::getTypeString(), mastercore::getValidMPTX(), CMPTransaction::getVersion(), CMPTransaction::interpretPacket(), mastercore::isCrowdsalePurchase(), CMPSPInfo::Entry::isDivisible(), IsMyAddress(), mastercore::isPropertyDivisible(), mapBlockIndex, MP_BLOCK_NOT_IN_CHAIN, MP_CROWDSALE_WITHOUT_PROPERTY, MP_INVALID_TX_IN_DB_FOUND, MP_TX_IS_NOT_MASTER_PROTOCOL, MP_TX_NOT_FOUND, MP_TX_UNCONFIRMED, MSC_TYPE_ACCEPT_OFFER_BTC, MSC_TYPE_CLOSE_CROWDSALE, MSC_TYPE_CREATE_PROPERTY_FIXED, MSC_TYPE_CREATE_PROPERTY_MANUAL, MSC_TYPE_CREATE_PROPERTY_VARIABLE, MSC_TYPE_GRANT_PROPERTY_TOKENS, MSC_TYPE_METADEX, MSC_TYPE_REVOKE_PROPERTY_TOKENS, MSC_TYPE_SEND_TO_OWNERS, MSC_TYPE_SIMPLE_SEND, MSC_TYPE_TRADE_OFFER, CMPSPInfo::Entry::name, CBlockIndex::nHeight, mastercore::p_txlistdb, parseTransaction(), CMPTransaction::SetNull(), CMPTransaction::step1(), CMPTransaction::step2_SmartProperty(), CMPTransaction::step2_Value(), ValueFromAmount(), and CTransaction::vout.
Referenced by getsto_MP(), gettrade_MP(), gettransaction_MP(), and listtransactions_MP().
Here is the call graph for this function:
Here is the caller graph for this function:| void PropertyToJSON | ( | const CMPSPInfo::Entry & | sProperty, |
| Object & | property_obj | ||
| ) |
Definition at line 47 of file mastercore_rpc.cpp.
References CMPSPInfo::Entry::category, CMPSPInfo::Entry::data, CMPSPInfo::Entry::isDivisible(), CMPSPInfo::Entry::name, CMPSPInfo::Entry::subcategory, and CMPSPInfo::Entry::url.
Referenced by getproperty_MP(), and listproperties_MP().
Here is the call graph for this function:
Here is the caller graph for this function:| Value send_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 250 of file mastercore_rpc.cpp.
References mastercore::_my_sps, COIN, error_str(), base_uint< BITS >::GetHex(), CMPSPInfo::getSP(), CMPSPInfo::Entry::isDivisible(), JSONRPCError(), MSC_TYPE_SIMPLE_SEND, RPC_INVALID_PARAMETER, RPC_TYPE_ERROR, mastercore::send_INTERNAL_1packet(), and mastercore::StrToInt64().
Here is the call graph for this function:| Value sendrawtx_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 367 of file mastercore_rpc.cpp.
References mastercore::ClassB_send(), Checkpoints::data, base_uint< BITS >::GetHex(), JSONRPCError(), ParseHex(), RPC_INVALID_PARAMETER, strprintf, and mastercore::StrToInt64().
Here is the call graph for this function:| Value sendtoowners_MP | ( | const Array & | params, |
| bool | fHelp | ||
| ) |
Definition at line 312 of file mastercore_rpc.cpp.
References mastercore::_my_sps, error_str(), base_uint< BITS >::GetHex(), CMPSPInfo::getSP(), CMPSPInfo::Entry::isDivisible(), JSONRPCError(), MSC_TYPE_SEND_TO_OWNERS, RPC_INVALID_PARAMETER, RPC_TYPE_ERROR, mastercore::send_INTERNAL_1packet(), and mastercore::StrToInt64().
Here is the call graph for this function:
1.8.8