Skip to content

Commit

Permalink
Merge branch 'release_v0.5.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
heropan committed Feb 3, 2021
2 parents fb398d2 + 2b77a78 commit b588e5c
Show file tree
Hide file tree
Showing 221 changed files with 15,131 additions and 3,811 deletions.
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ execute_process(
OUTPUT_VARIABLE SPVSDK_VERSION
)

execute_process(
COMMAND git describe --dirty --always --tags --exclude "*-pre"
COMMAND tr -d "\n"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE SPVSDK_VERSION_MESSAGE
)
if(SPVSDK_VERSION MATCHES "^[0-9]*\\.[0-9]*\\.[0-9]*$")
project(Elastos-spvsdk VERSION ${SPVSDK_VERSION})
else()
project(Elastos-spvsdk)
endif()

project(Elastos-spvsdk VERSION ${SPVSDK_VERSION})

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 11)
Expand Down Expand Up @@ -58,6 +56,13 @@ option(SPV_CONSOLE_LOG "Enable console log" OFF)
option(SPV_BUILD_TEST_CASES "Build test cases" OFF)
option(SPV_BUILD_APPS "Build command line elawallet" ON)

execute_process(
COMMAND git describe --dirty --always --tags --exclude "*-pre"
COMMAND tr -d "\n"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE SPVSDK_VERSION_MESSAGE
)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CMakeConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/CMakeConfig.h
Expand Down
59 changes: 59 additions & 0 deletions Interface/IEthSidechainSubWallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,69 @@
namespace Elastos {
namespace ElaWallet {

enum EthereumAmountUnit {
TOKEN_DECIMAL = 0,
TOKEN_INTEGER = 1,

ETHER_WEI = 0,
ETHER_GWEI = 3,
ETHER_ETHER = 6,
};

class IEthSidechainSubWallet : public virtual ISubWallet {
public:
virtual ~IEthSidechainSubWallet() noexcept {}

/**
*
* @param targetAddress
* @param amount Decimal string in unit. The `number` must be either an integer or have
* a single decimal point with at least one preceeding characters. Thus: 0.001, 1.0000, 12
* and 12.100 are all valid. But .1 is invalid (required 0.1).
* @param amountUnit
* @return
*/
virtual nlohmann::json CreateTransfer(const std::string &targetAddress,
const std::string &amount,
EthereumAmountUnit amountUnit) const = 0;

/**
*
* @param targetAddress "" is different from "0x0000000000000000000000000000000000000000". "" means
* address is null.
* @param amount Decimal string in unit. The `number` must be either an integer or have
* a single decimal point with at least one preceeding characters. Thus: 0.001, 1.0000, 12
* and 12.100 are all valid. But .1 is invalid (required 0.1).
* @param amountUnit
* @param gasPrice Decimal string in unit. The `number` must be either an integer or have
* a single decimal point with at least one preceeding characters. Thus: 0.001, 1.0000, 12
* and 12.100 are all valid. But .1 is invalid (required 0.1).
* @param gasPriceUnit
* @param gasLimit
* @param data
* @return
*/
virtual nlohmann::json CreateTransferGeneric(const std::string &targetAddress,
const std::string &amount,
EthereumAmountUnit amountUnit,
const std::string &gasPrice,
EthereumAmountUnit gasPriceUnit,
const std::string &gasLimit,
const std::string &data) const = 0;

/**
*
* @param tx
*/
virtual void DeleteTransfer(const nlohmann::json &tx) = 0;

/**
* @param tokenSymbol
* @return
*/
virtual nlohmann::json GetTokenTransactions(uint32_t start, uint32_t count, const std::string &txid,
const std::string &tokenSymbol) const = 0;

};

}
Expand Down
4 changes: 3 additions & 1 deletion Interface/IIDChainSubWallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ namespace Elastos {
* Create a id transaction and return the content of transaction in json format, this is a special transaction to register id related information on id chain.
* @param payloadJson is payload for register id related information in json format, the content of payload should have Id, Path, DataHash, Proof, and Sign.
* @param memo input memo attribute for describing.
* @param fee transaction fee set by user.
* @return If success return the content of transaction in json format.
*/
virtual nlohmann::json CreateIDTransaction(
const nlohmann::json &payloadJson,
const std::string &memo = "") = 0;
const std::string &memo = "",
const std::string &fee = "10000") = 0;

/**
* Get all DID derived of current subwallet.
Expand Down
Loading

0 comments on commit b588e5c

Please sign in to comment.