aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2014-11-11 04:32:13 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2014-11-11 04:32:13 +0800
commit96292f9199e605c729d2197ccae5ec7127825852 (patch)
treef477c67631f7c9a960886ad1b3acf071b407266e
parent16007bd191a65ecbd0635244f87f9def09aa8036 (diff)
downloaddexon-solidity-96292f9199e605c729d2197ccae5ec7127825852.tar.gz
dexon-solidity-96292f9199e605c729d2197ccae5ec7127825852.tar.zst
dexon-solidity-96292f9199e605c729d2197ccae5ec7127825852.zip
js abi connection
-rw-r--r--webthreestubclient.h70
1 files changed, 56 insertions, 14 deletions
diff --git a/webthreestubclient.h b/webthreestubclient.h
index 6beee5bb..c494c1ba 100644
--- a/webthreestubclient.h
+++ b/webthreestubclient.h
@@ -19,18 +19,6 @@ class WebThreeStubClient
delete this->client;
}
- std::string account() throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p = Json::nullValue;
- Json::Value result = this->client->CallMethod("account",p);
- if (result.isString())
- return result.asString();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
-
- }
-
Json::Value accounts() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
@@ -147,12 +135,40 @@ p.append(param2);
}
- std::string compile(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ Json::Value compilers() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("compilers",p);
+ if (result.isArray())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string contractCall(const std::string& param1, const std::string& param2, const Json::Value& param3) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+p.append(param3);
+
+ Json::Value result = this->client->CallMethod("contractCall",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string contractCreate(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
+p.append(param2);
- Json::Value result = this->client->CallMethod("compile",p);
+ Json::Value result = this->client->CallMethod("contractCreate",p);
if (result.isString())
return result.asString();
else
@@ -263,6 +279,19 @@ p.append(param2);
}
+ std::string lll(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("lll",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
bool mining() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
@@ -485,6 +514,19 @@ p.append(param3);
}
+ std::string solidity(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("solidity",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
std::string stateAt(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
{
Json::Value p;