You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

core_io.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2009-2016 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_CORE_IO_H
  5. #define STARWELS_CORE_IO_H
  6. #include "amount.h"
  7. #include <string>
  8. #include <vector>
  9. class CBlock;
  10. class CScript;
  11. class CTransaction;
  12. struct CMutableTransaction;
  13. class uint256;
  14. class UniValue;
  15. // core_read.cpp
  16. CScript ParseScript(const std::string& s);
  17. std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
  18. bool DecodeHexTx(CMutableTransaction& tx, const std::string& strHexTx, bool fTryNoWitness = false);
  19. bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
  20. uint256 ParseHashUV(const UniValue& v, const std::string& strName);
  21. uint256 ParseHashStr(const std::string&, const std::string& strName);
  22. std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
  23. // core_write.cpp
  24. UniValue ValueFromAmount(const CAmount& amount);
  25. std::string FormatScript(const CScript& script);
  26. std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
  27. void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
  28. void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0);
  29. #endif // STARWELS_CORE_IO_H