Browse Source
This basically pulls in libjson-rpc-cpp 0.3.2, updated from previous 0.2.1. v0.3.2 completely changes its own setup, hence such a massive change builds fine on Ubuntu, needs check on OS X Conflicts: CMakeLists.txt cmake/EthDependenciesDeprecated.cmake eth/CMakeLists.txt libqethereum/CMakeLists.txt libweb3jsonrpc/CMakeLists.txt neth/CMakeLists.txt test/CMakeLists.txtcl-refactor
sveneh
10 years ago
58 changed files with 2720 additions and 1572 deletions
@ -1,44 +1,54 @@ |
|||||
# Find json-rcp-cpp |
# Find json-rcp-cpp |
||||
# |
# |
||||
# Find the JSONCpp includes and library |
# Find the json-rpc-cpp includes and library |
||||
# |
# |
||||
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH |
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH |
||||
# |
# |
||||
# This module defines |
# This module defines |
||||
# JSON_RCP_CPP_INCLUDE_DIRS, where to find json.h, etc. |
# JSON_RCP_CPP_INCLUDE_DIRS, where to find header, etc. |
||||
# JSON_RCP_CPP_LIBRARIES, the libraries needed to use jsoncpp. |
# JSON_RCP_CPP_LIBRARIES, the libraries needed to use json-rpc-cpp. |
||||
# JSON_RCP_CPP_FOUND, If false, do not try to use jsoncpp. |
# JSON_RCP_CPP_FOUND, If false, do not try to use json-rpc-cpp. |
||||
|
|
||||
# only look in default directories |
# only look in default directories |
||||
find_path( |
find_path( |
||||
JSON_RPC_CPP_INCLUDE_DIR |
JSON_RPC_CPP_INCLUDE_DIR |
||||
NAMES jsonrpc/rpc.h |
NAMES jsonrpccpp/server.h |
||||
PATH_SUFFIXES jsonrpc |
PATH_SUFFIXES jsonrpc |
||||
DOC "json-rpc-cpp include dir" |
DOC "json-rpc-cpp include dir" |
||||
) |
) |
||||
|
|
||||
find_library( |
find_library( |
||||
JSON_RPC_CPP_LIBRARY |
JSON_RPC_CPP_COMMON_LIBRARY |
||||
NAMES jsonrpc |
NAMES jsonrpccpp-common |
||||
DOC "json-rpc-cpp library" |
DOC "json-rpc-cpp common library" |
||||
) |
) |
||||
|
|
||||
set (JSON_RPC_CPP_INCLUDE_DIRS ${JSON_RPC_CPP_INCLUDE_DIR}) |
find_library( |
||||
set (JSON_RPC_CPP_LIBRARIES ${JSON_RPC_CPP_LIBRARY}) |
JSON_RPC_CPP_SERVER_LIBRARY |
||||
|
NAMES jsonrpccpp-server |
||||
|
DOC "json-rpc-cpp server library" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
JSON_RPC_CPP_CLIENT_LIBRARY |
||||
|
NAMES jsonrpccpp-client |
||||
|
DOC "json-rpc-cpp client library" |
||||
|
) |
||||
|
|
||||
# message (" - json-rcp-cpp header : ${JSON_RPC_CPP_INCLUDE_DIRS}") |
# message (" - json-rcp-cpp header : ${JSON_RPC_CPP_INCLUDE_DIRS}") |
||||
# message (" - json-rcp-cpp lib : ${JSON_RPC_CPP_LIBRARIES}") |
# message (" - json-rcp-cpp lib : ${JSON_RPC_CPP_LIBRARIES}") |
||||
|
|
||||
|
|
||||
include(FindPackageHandleStandardArgs) |
|
||||
# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE |
# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE |
||||
# if all listed variables are TRUE |
# if all listed variables are TRUE, hide their existence from configuration view |
||||
|
include(FindPackageHandleStandardArgs) |
||||
find_package_handle_standard_args(json_rpc_cpp DEFAULT_MSG |
find_package_handle_standard_args(json_rpc_cpp DEFAULT_MSG |
||||
JSON_RPC_CPP_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) |
JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) |
||||
|
mark_as_advanced (JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) |
||||
|
|
||||
# include(FindPackageMessage) |
|
||||
# find_package_message ("json-rpc-cpp" "found" "bla") |
|
||||
|
|
||||
|
# these are the variables to be uses by the calling script |
||||
|
set (JSON_RPC_CPP_INCLUDE_DIRS ${JSON_RPC_CPP_INCLUDE_DIR}) |
||||
|
set (JSON_RPC_CPP_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_SERVER_LIBRARY} ${JSON_RPC_CPP_CLIENT_LIBRARY}) |
||||
|
|
||||
mark_as_advanced (JSON_RPC_CPP_INCLUDE_DIR JSON_RPC_CPP_LIBRARY) |
# message (" - json-rcp-cpp header : ${JSON_RPC_CPP_INCLUDE_DIRS}") |
||||
|
# message (" - json-rcp-cpp lib : ${JSON_RPC_CPP_LIBRARIES}") |
||||
|
@ -0,0 +1,103 @@ |
|||||
|
# - try to find JSONCPP library |
||||
|
# |
||||
|
# Cache Variables: (probably not for direct use in your scripts) |
||||
|
# JSONCPP_INCLUDE_DIR |
||||
|
# JSONCPP_LIBRARY |
||||
|
# |
||||
|
# Non-cache variables you might use in your CMakeLists.txt: |
||||
|
# JSONCPP_FOUND |
||||
|
# JSONCPP_INCLUDE_DIRS |
||||
|
# JSONCPP_LIBRARIES |
||||
|
# |
||||
|
# Requires these CMake modules: |
||||
|
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) |
||||
|
# |
||||
|
# Author: |
||||
|
# 2011 Philippe Crassous (ENSAM ParisTech / Institut Image) p.crassous _at_ free.fr |
||||
|
# |
||||
|
# Adapted from the Virtual Reality Peripheral Network library. |
||||
|
# https://github.com/rpavlik/vrpn/blob/master/README.Legal |
||||
|
# |
||||
|
|
||||
|
set(JSONCPP_ROOT_DIR |
||||
|
"${JSONCPP_ROOT_DIR}" |
||||
|
CACHE |
||||
|
PATH |
||||
|
"Directory to search for JSONCPP") |
||||
|
set(_jsoncppnames) |
||||
|
set(_pathsuffixes |
||||
|
suncc |
||||
|
vacpp |
||||
|
mingw |
||||
|
msvc6 |
||||
|
msvc7 |
||||
|
msvc71 |
||||
|
msvc80 |
||||
|
msvc90 |
||||
|
linux-gcc) |
||||
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
||||
|
execute_process(COMMAND |
||||
|
${CMAKE_CXX_COMPILER} |
||||
|
-dumpversion |
||||
|
OUTPUT_VARIABLE |
||||
|
_gnucxx_ver |
||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE) |
||||
|
list(APPEND |
||||
|
_jsoncppnames |
||||
|
json_linux-gcc-${_gnucxx_ver}_libmt |
||||
|
json_linux-gcc_libmt) |
||||
|
list(APPEND _pathsuffixes linux-gcc-${_gnucxx_ver}) |
||||
|
elseif(MSVC) |
||||
|
if(MSVC_VERSION EQUAL 1200) |
||||
|
list(APPEND _jsoncppnames json_vc6_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1300) |
||||
|
list(APPEND _jsoncppnames json_vc7_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1310) |
||||
|
list(APPEND _jsoncppnames json_vc71_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1400) |
||||
|
list(APPEND _jsoncppnames json_vc8_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1500) |
||||
|
list(APPEND _jsoncppnames json_vc9_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1600) |
||||
|
list(APPEND _jsoncppnames json_vc10_libmt) |
||||
|
endif() |
||||
|
else() |
||||
|
list(APPEND _jsoncppnames |
||||
|
json_suncc_libmt |
||||
|
json_vacpp_libmt) |
||||
|
endif() |
||||
|
|
||||
|
list(APPEND _jsoncppnames |
||||
|
json_mingw_libmt |
||||
|
jsoncpp) |
||||
|
|
||||
|
find_library(JSONCPP_LIBRARY |
||||
|
NAMES |
||||
|
${_jsoncppnames} |
||||
|
PATHS |
||||
|
"${JSONCPP_ROOT_DIR}/libs" |
||||
|
PATH_SUFFIXES |
||||
|
${_pathsuffixes}) |
||||
|
|
||||
|
find_path(JSONCPP_INCLUDE_DIR |
||||
|
NAMES |
||||
|
json/json.h |
||||
|
PATHS |
||||
|
"${JSONCPP_ROOT_DIR}" |
||||
|
PATH_SUFFIXES jsoncpp |
||||
|
include) |
||||
|
|
||||
|
include(FindPackageHandleStandardArgs) |
||||
|
find_package_handle_standard_args(JSONCPP |
||||
|
DEFAULT_MSG |
||||
|
JSONCPP_LIBRARY |
||||
|
JSONCPP_INCLUDE_DIR) |
||||
|
|
||||
|
if(JSONCPP_FOUND) |
||||
|
set(JSONCPP_LIBRARIES "${JSONCPP_LIBRARY}") |
||||
|
set(JSONCPP_INCLUDE_DIRS "${JSONCPP_INCLUDE_DIR}") |
||||
|
mark_as_advanced(JSONCPP_ROOT_DIR) |
||||
|
endif() |
||||
|
|
||||
|
mark_as_advanced(JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY) |
||||
|
|
File diff suppressed because it is too large
@ -1,467 +0,0 @@ |
|||||
/* |
|
||||
This file is part of ethereum.js. |
|
||||
|
|
||||
ethereum.js is free software: you can redistribute it and/or modify |
|
||||
it under the terms of the GNU Lesser General Public License as published by |
|
||||
the Free Software Foundation, either version 3 of the License, or |
|
||||
(at your option) any later version. |
|
||||
|
|
||||
ethereum.js is distributed in the hope that it will be useful, |
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
GNU Lesser General Public License for more details. |
|
||||
|
|
||||
You should have received a copy of the GNU Lesser General Public License |
|
||||
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
|
|
||||
*/ |
|
||||
/** @file main.js |
|
||||
* @authors: |
|
||||
* Marek Kotewicz <marek@ethdev.com> |
|
||||
* @date 2014 |
|
||||
*/ |
|
||||
|
|
||||
(function(window) { |
|
||||
function isPromise(o) { |
|
||||
return o instanceof Promise |
|
||||
} |
|
||||
|
|
||||
function flattenPromise (obj) { |
|
||||
if (obj instanceof Promise) { |
|
||||
return Promise.resolve(obj); |
|
||||
} |
|
||||
|
|
||||
if (obj instanceof Array) { |
|
||||
return new Promise(function (resolve) { |
|
||||
var promises = obj.map(function (o) { |
|
||||
return flattenPromise(o); |
|
||||
}); |
|
||||
|
|
||||
return Promise.all(promises).then(function (res) { |
|
||||
for (var i = 0; i < obj.length; i++) { |
|
||||
obj[i] = res[i]; |
|
||||
} |
|
||||
resolve(obj); |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
if (obj instanceof Object) { |
|
||||
return new Promise(function (resolve) { |
|
||||
var keys = Object.keys(obj); |
|
||||
var promises = keys.map(function (key) { |
|
||||
return flattenPromise(obj[key]); |
|
||||
}); |
|
||||
|
|
||||
return Promise.all(promises).then(function (res) { |
|
||||
for (var i = 0; i < keys.length; i++) { |
|
||||
obj[keys[i]] = res[i]; |
|
||||
} |
|
||||
resolve(obj); |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
return Promise.resolve(obj); |
|
||||
}; |
|
||||
|
|
||||
var ethMethods = function () { |
|
||||
var blockCall = function (args) { |
|
||||
return typeof args[0] === "string" ? "eth_blockByHash" : "eth_blockByNumber"; |
|
||||
}; |
|
||||
|
|
||||
var transactionCall = function (args) { |
|
||||
return typeof args[0] === "string" ? 'eth_transactionByHash' : 'eth_transactionByNumber'; |
|
||||
}; |
|
||||
|
|
||||
var uncleCall = function (args) { |
|
||||
return typeof args[0] === "string" ? 'eth_uncleByHash' : 'eth_uncleByNumber'; |
|
||||
}; |
|
||||
|
|
||||
var methods = [ |
|
||||
{ name: 'balanceAt', call: 'eth_balanceAt' }, |
|
||||
{ name: 'stateAt', call: 'eth_stateAt' }, |
|
||||
{ name: 'countAt', call: 'eth_countAt'}, |
|
||||
{ name: 'codeAt', call: 'eth_codeAt' }, |
|
||||
{ name: 'transact', call: 'eth_transact' }, |
|
||||
{ name: 'call', call: 'eth_call' }, |
|
||||
{ name: 'block', call: blockCall }, |
|
||||
{ name: 'transaction', call: transactionCall }, |
|
||||
{ name: 'uncle', call: uncleCall }, |
|
||||
{ name: 'compile', call: 'eth_compile' }, |
|
||||
{ name: 'lll', call: 'eth_lll' } |
|
||||
]; |
|
||||
return methods; |
|
||||
}; |
|
||||
|
|
||||
var ethProperties = function () { |
|
||||
return [ |
|
||||
{ name: 'coinbase', getter: 'eth_coinbase', setter: 'eth_setCoinbase' }, |
|
||||
{ name: 'listening', getter: 'eth_listening', setter: 'eth_setListening' }, |
|
||||
{ name: 'mining', getter: 'eth_mining', setter: 'eth_setMining' }, |
|
||||
{ name: 'gasPrice', getter: 'eth_gasPrice' }, |
|
||||
{ name: 'account', getter: 'eth_account' }, |
|
||||
{ name: 'accounts', getter: 'eth_accounts' }, |
|
||||
{ name: 'peerCount', getter: 'eth_peerCount' }, |
|
||||
{ name: 'defaultBlock', getter: 'eth_defaultBlock', setter: 'eth_setDefaultBlock' }, |
|
||||
{ name: 'number', getter: 'eth_number'} |
|
||||
]; |
|
||||
}; |
|
||||
|
|
||||
var dbMethods = function () { |
|
||||
return [ |
|
||||
{ name: 'put', call: 'db_put' }, |
|
||||
{ name: 'get', call: 'db_get' }, |
|
||||
{ name: 'putString', call: 'db_putString' }, |
|
||||
{ name: 'getString', call: 'db_getString' } |
|
||||
]; |
|
||||
}; |
|
||||
|
|
||||
var shhMethods = function () { |
|
||||
return [ |
|
||||
{ name: 'post', call: 'shh_post' }, |
|
||||
{ name: 'newIdentity', call: 'shh_newIdentity' }, |
|
||||
{ name: 'haveIdentity', call: 'shh_haveIdentity' }, |
|
||||
{ name: 'newGroup', call: 'shh_newGroup' }, |
|
||||
{ name: 'addToGroup', call: 'shh_addToGroup' } |
|
||||
]; |
|
||||
}; |
|
||||
|
|
||||
var ethWatchMethods = function () { |
|
||||
var newFilter = function (args) { |
|
||||
return typeof args[0] === 'string' ? 'eth_newFilterString' : 'eth_newFilter'; |
|
||||
}; |
|
||||
|
|
||||
return [ |
|
||||
{ name: 'newFilter', call: newFilter }, |
|
||||
{ name: 'uninstallFilter', call: 'eth_uninstallFilter' }, |
|
||||
{ name: 'getMessages', call: 'eth_getMessages' } |
|
||||
]; |
|
||||
}; |
|
||||
|
|
||||
var shhWatchMethods = function () { |
|
||||
return [ |
|
||||
{ name: 'newFilter', call: 'shh_newFilter' }, |
|
||||
{ name: 'uninstallFilter', call: 'shh_uninstallFilter' }, |
|
||||
{ name: 'getMessage', call: 'shh_getMessages' } |
|
||||
]; |
|
||||
}; |
|
||||
|
|
||||
var setupMethods = function (obj, methods) { |
|
||||
methods.forEach(function (method) { |
|
||||
obj[method.name] = function () { |
|
||||
return flattenPromise(Array.prototype.slice.call(arguments)).then(function (args) { |
|
||||
var call = typeof method.call === "function" ? method.call(args) : method.call; |
|
||||
return {call: call, args: args}; |
|
||||
}).then(function (request) { |
|
||||
return new Promise(function (resolve, reject) { |
|
||||
web3.provider.send(request, function (err, result) { |
|
||||
if (!err) { |
|
||||
resolve(result); |
|
||||
return; |
|
||||
} |
|
||||
reject(err); |
|
||||
}); |
|
||||
}); |
|
||||
}).catch(function(err) { |
|
||||
console.error(err); |
|
||||
}); |
|
||||
}; |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
var setupProperties = function (obj, properties) { |
|
||||
properties.forEach(function (property) { |
|
||||
var proto = {}; |
|
||||
proto.get = function () { |
|
||||
return new Promise(function(resolve, reject) { |
|
||||
web3.provider.send({call: property.getter}, function(err, result) { |
|
||||
if (!err) { |
|
||||
resolve(result); |
|
||||
return; |
|
||||
} |
|
||||
reject(err); |
|
||||
}); |
|
||||
}); |
|
||||
}; |
|
||||
if (property.setter) { |
|
||||
proto.set = function (val) { |
|
||||
return flattenPromise([val]).then(function (args) { |
|
||||
return new Promise(function (resolve) { |
|
||||
web3.provider.send({call: property.setter, args: args}, function (err, result) { |
|
||||
if (!err) { |
|
||||
resolve(result); |
|
||||
return; |
|
||||
} |
|
||||
reject(err); |
|
||||
}); |
|
||||
}); |
|
||||
}).catch(function (err) { |
|
||||
console.error(err); |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
Object.defineProperty(obj, property.name, proto); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
var web3 = { |
|
||||
_callbacks: {}, |
|
||||
_events: {}, |
|
||||
providers: {}, |
|
||||
toHex: function(str) { |
|
||||
var hex = ""; |
|
||||
for(var i = 0; i < str.length; i++) { |
|
||||
var n = str.charCodeAt(i).toString(16); |
|
||||
hex += n.length < 2 ? '0' + n : n; |
|
||||
} |
|
||||
|
|
||||
return hex; |
|
||||
}, |
|
||||
|
|
||||
toAscii: function(hex) { |
|
||||
// Find termination
|
|
||||
var str = ""; |
|
||||
var i = 0, l = hex.length; |
|
||||
if (hex.substring(0, 2) == '0x') |
|
||||
i = 2; |
|
||||
for(; i < l; i+=2) { |
|
||||
var code = hex.charCodeAt(i) |
|
||||
if(code == 0) { |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); |
|
||||
} |
|
||||
|
|
||||
return str; |
|
||||
}, |
|
||||
|
|
||||
toDecimal: function (val) { |
|
||||
return parseInt(val, 16); |
|
||||
}, |
|
||||
|
|
||||
fromAscii: function(str, pad) { |
|
||||
pad = pad === undefined ? 32 : pad; |
|
||||
var hex = this.toHex(str); |
|
||||
while(hex.length < pad*2) |
|
||||
hex += "00"; |
|
||||
return "0x" + hex; |
|
||||
}, |
|
||||
|
|
||||
eth: { |
|
||||
prototype: Object(), |
|
||||
watch: function (params) { |
|
||||
return new Filter(params, ethWatch); |
|
||||
}, |
|
||||
}, |
|
||||
|
|
||||
db: { |
|
||||
prototype: Object() |
|
||||
}, |
|
||||
|
|
||||
shh: { |
|
||||
prototype: Object(), |
|
||||
watch: function (params) { |
|
||||
return new Filter(params, shhWatch); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
on: function(event, id, cb) { |
|
||||
if(web3._events[event] === undefined) { |
|
||||
web3._events[event] = {}; |
|
||||
} |
|
||||
|
|
||||
web3._events[event][id] = cb; |
|
||||
return this |
|
||||
}, |
|
||||
|
|
||||
off: function(event, id) { |
|
||||
if(web3._events[event] !== undefined) { |
|
||||
delete web3._events[event][id]; |
|
||||
} |
|
||||
|
|
||||
return this |
|
||||
}, |
|
||||
|
|
||||
trigger: function(event, id, data) { |
|
||||
var callbacks = web3._events[event]; |
|
||||
if (!callbacks || !callbacks[id]) { |
|
||||
return; |
|
||||
} |
|
||||
var cb = callbacks[id]; |
|
||||
cb(data); |
|
||||
}, |
|
||||
}; |
|
||||
|
|
||||
var eth = web3.eth; |
|
||||
setupMethods(eth, ethMethods()); |
|
||||
setupProperties(eth, ethProperties()); |
|
||||
setupMethods(web3.db, dbMethods()); |
|
||||
setupMethods(web3.shh, shhMethods()); |
|
||||
|
|
||||
var ethWatch = { |
|
||||
changed: 'eth_changed' |
|
||||
}; |
|
||||
setupMethods(ethWatch, ethWatchMethods()); |
|
||||
var shhWatch = { |
|
||||
changed: 'shh_changed' |
|
||||
}; |
|
||||
setupMethods(shhWatch, shhWatchMethods()); |
|
||||
|
|
||||
var ProviderManager = function() { |
|
||||
this.queued = []; |
|
||||
this.polls = []; |
|
||||
this.ready = false; |
|
||||
this.provider = undefined; |
|
||||
this.id = 1; |
|
||||
|
|
||||
var self = this; |
|
||||
var poll = function () { |
|
||||
if (self.provider && self.provider.poll) { |
|
||||
self.polls.forEach(function (data) { |
|
||||
data.data._id = self.id; |
|
||||
self.id++; |
|
||||
self.provider.poll(data.data, data.id); |
|
||||
}); |
|
||||
} |
|
||||
setTimeout(poll, 12000); |
|
||||
}; |
|
||||
poll(); |
|
||||
}; |
|
||||
|
|
||||
ProviderManager.prototype.send = function(data, cb) { |
|
||||
data._id = this.id; |
|
||||
if (cb) { |
|
||||
web3._callbacks[data._id] = cb; |
|
||||
} |
|
||||
|
|
||||
data.args = data.args || []; |
|
||||
this.id++; |
|
||||
|
|
||||
if(this.provider !== undefined) { |
|
||||
this.provider.send(data); |
|
||||
} else { |
|
||||
console.warn("provider is not set"); |
|
||||
this.queued.push(data); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
ProviderManager.prototype.set = function(provider) { |
|
||||
if(this.provider !== undefined && this.provider.unload !== undefined) { |
|
||||
this.provider.unload(); |
|
||||
} |
|
||||
|
|
||||
this.provider = provider; |
|
||||
this.ready = true; |
|
||||
}; |
|
||||
|
|
||||
ProviderManager.prototype.sendQueued = function() { |
|
||||
for(var i = 0; this.queued.length; i++) { |
|
||||
// Resend
|
|
||||
this.send(this.queued[i]); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
ProviderManager.prototype.installed = function() { |
|
||||
return this.provider !== undefined; |
|
||||
}; |
|
||||
|
|
||||
ProviderManager.prototype.startPolling = function (data, pollId) { |
|
||||
if (!this.provider || !this.provider.poll) { |
|
||||
return; |
|
||||
} |
|
||||
this.polls.push({data: data, id: pollId}); |
|
||||
}; |
|
||||
|
|
||||
ProviderManager.prototype.stopPolling = function (pollId) { |
|
||||
for (var i = this.polls.length; i--;) { |
|
||||
var poll = this.polls[i]; |
|
||||
if (poll.id === pollId) { |
|
||||
this.polls.splice(i, 1); |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
web3.provider = new ProviderManager(); |
|
||||
|
|
||||
web3.setProvider = function(provider) { |
|
||||
provider.onmessage = messageHandler; |
|
||||
web3.provider.set(provider); |
|
||||
web3.provider.sendQueued(); |
|
||||
}; |
|
||||
|
|
||||
var Filter = function(options, impl) { |
|
||||
this.impl = impl; |
|
||||
this.callbacks = []; |
|
||||
|
|
||||
var self = this; |
|
||||
this.promise = impl.newFilter(options); |
|
||||
this.promise.then(function (id) { |
|
||||
self.id = id; |
|
||||
web3.on(impl.changed, id, self.trigger.bind(self)); |
|
||||
web3.provider.startPolling({call: impl.changed, args: [id]}, id); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
Filter.prototype.arrived = function(callback) { |
|
||||
this.changed(callback); |
|
||||
} |
|
||||
|
|
||||
Filter.prototype.changed = function(callback) { |
|
||||
var self = this; |
|
||||
this.promise.then(function(id) { |
|
||||
self.callbacks.push(callback); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
Filter.prototype.trigger = function(messages) { |
|
||||
if (!(messages instanceof Array) || messages.length) { |
|
||||
for(var i = 0; i < this.callbacks.length; i++) { |
|
||||
this.callbacks[i].call(this, messages); |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
Filter.prototype.uninstall = function() { |
|
||||
var self = this; |
|
||||
this.promise.then(function (id) { |
|
||||
self.impl.uninstallFilter(id); |
|
||||
web3.provider.stopPolling(id); |
|
||||
web3.off(impl.changed, id); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
Filter.prototype.messages = function() { |
|
||||
var self = this; |
|
||||
return this.promise.then(function (id) { |
|
||||
return self.impl.getMessages(id); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function messageHandler(data) { |
|
||||
if(data._event !== undefined) { |
|
||||
web3.trigger(data._event, data._id, data.data); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
if(data._id) { |
|
||||
var cb = web3._callbacks[data._id]; |
|
||||
if (cb) { |
|
||||
cb.call(this, data.error, data.data); |
|
||||
delete web3._callbacks[data._id]; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/* |
|
||||
// Install default provider
|
|
||||
if(!web3.provider.installed()) { |
|
||||
var sock = new web3.WebSocket("ws://localhost:40404/eth"); |
|
||||
|
|
||||
web3.setProvider(sock); |
|
||||
} |
|
||||
*/ |
|
||||
|
|
||||
window.web3 = web3; |
|
||||
|
|
||||
})(this); |
|
@ -1,49 +0,0 @@ |
|||||
/* |
|
||||
This file is part of ethereum.js. |
|
||||
|
|
||||
ethereum.js is free software: you can redistribute it and/or modify |
|
||||
it under the terms of the GNU Lesser General Public License as published by |
|
||||
the Free Software Foundation, either version 3 of the License, or |
|
||||
(at your option) any later version. |
|
||||
|
|
||||
ethereum.js is distributed in the hope that it will be useful, |
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
GNU Lesser General Public License for more details. |
|
||||
|
|
||||
You should have received a copy of the GNU Lesser General Public License |
|
||||
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
|
|
||||
*/ |
|
||||
/** @file qt.js |
|
||||
* @authors: |
|
||||
* Marek Kotewicz <marek@ethdev.com> |
|
||||
* @date 2014 |
|
||||
*/ |
|
||||
|
|
||||
(function() { |
|
||||
var QtProvider = function() { |
|
||||
this.handlers = []; |
|
||||
|
|
||||
var self = this; |
|
||||
navigator.qt.onmessage = function (message) { |
|
||||
self.handlers.forEach(function (handler) { |
|
||||
handler.call(self, JSON.parse(message.data)); |
|
||||
}); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
QtProvider.prototype.send = function(payload) { |
|
||||
navigator.qt.postMessage(JSON.stringify(payload)); |
|
||||
}; |
|
||||
|
|
||||
Object.defineProperty(QtProvider.prototype, "onmessage", { |
|
||||
set: function(handler) { |
|
||||
this.handlers.push(handler); |
|
||||
}, |
|
||||
}); |
|
||||
|
|
||||
if(typeof(web3) !== "undefined" && web3.providers !== undefined) { |
|
||||
web3.providers.QtProvider = QtProvider; |
|
||||
} |
|
||||
})(); |
|
||||
|
|
@ -1,323 +1,311 @@ |
|||||
/**
|
/**
|
||||
* THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!! |
* This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY! |
||||
*/ |
*/ |
||||
|
|
||||
#ifndef _ABSTRACTWEBTHREESTUBSERVER_H_ |
#ifndef JSONRPC_CPP_STUB_ABSTRACTWEBTHREESTUBSERVER_H_ |
||||
#define _ABSTRACTWEBTHREESTUBSERVER_H_ |
#define JSONRPC_CPP_STUB_ABSTRACTWEBTHREESTUBSERVER_H_ |
||||
|
|
||||
#include <jsonrpc/rpc.h> |
#include <jsonrpccpp/server.h> |
||||
|
|
||||
class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThreeStubServer> |
class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThreeStubServer> |
||||
{ |
{ |
||||
public: |
public: |
||||
AbstractWebThreeStubServer(jsonrpc::AbstractServerConnector* conn) : |
AbstractWebThreeStubServer(jsonrpc::AbstractServerConnector &conn) : jsonrpc::AbstractServer<AbstractWebThreeStubServer>(conn) |
||||
jsonrpc::AbstractServer<AbstractWebThreeStubServer>(conn) |
|
||||
{ |
{ |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("db_get", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("db_getString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getStringI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("db_put", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("db_putString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putStringI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_accountsI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_balanceAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_balanceAtI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_blockByHashI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_blockByNumberI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_callI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_changedI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_codeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_codeAtI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_coinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_coinbaseI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_coinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_coinbaseI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_compile", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_compileI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setCoinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_setCoinbaseI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_countAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_REAL, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_countAtI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_defaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_defaultBlockI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_gasPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_gasPriceI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_getMessages", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_getMessagesI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_listening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_listeningI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_listening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_listeningI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_lll", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_lllI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setListening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setListeningI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_mining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_miningI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_mining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_miningI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setMining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setMiningI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilterString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newFilterStringI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_gasPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_gasPriceI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_number", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_numberI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_accountsI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_peerCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_peerCountI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_peerCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_peerCountI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setCoinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_setCoinbaseI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_defaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_defaultBlockI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setDefaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_setDefaultBlockI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setDefaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_setDefaultBlockI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setListening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setListeningI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_number", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_numberI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setMining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setMiningI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_balanceAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_balanceAtI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_stateAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_stateAtI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_stateAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_stateAtI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_storageAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_storageAtI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_countAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_REAL, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_countAtI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_codeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_codeAtI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transact", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_transactI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transact", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_transactI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_callI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_blockByHashI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_blockByNumberI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByHashI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByHashI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByNumberI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByNumberI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByHashI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByHashI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByNumberI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByNumberI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_compilers", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_compilersI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_lll", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_lllI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_solidity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_solidityI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_serpent", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_serpentI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilterString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newFilterStringI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uninstallFilterI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uninstallFilterI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_addToGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_addToGroupI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_changedI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_changedI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_filterLogs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_filterLogsI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_logs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_logsI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("db_put", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("db_get", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("db_putString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putStringI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("db_getString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getStringI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("shh_post", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_postI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newIdentityI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_haveIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_haveIdentityI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_haveIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_haveIdentityI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_newFilterI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newGroupI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newGroupI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newIdentityI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_addToGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_addToGroupI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_post", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_postI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_newFilterI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_uninstallFilterI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_uninstallFilterI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("shh_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_changedI); |
||||
|
} |
||||
|
|
||||
|
inline virtual void eth_coinbaseI(const Json::Value &request, Json::Value &response) |
||||
|
{ |
||||
|
(void)request; |
||||
|
response = this->eth_coinbase(); |
||||
} |
} |
||||
|
inline virtual void eth_setCoinbaseI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void db_getI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->db_get(request[0u].asString(), request[1u].asString()); |
response = this->eth_setCoinbase(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_listeningI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void db_getStringI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->db_getString(request[0u].asString(), request[1u].asString()); |
(void)request; |
||||
|
response = this->eth_listening(); |
||||
} |
} |
||||
|
inline virtual void eth_setListeningI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void db_putI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->db_put(request[0u].asString(), request[1u].asString(), request[2u].asString()); |
response = this->eth_setListening(request[0u].asBool()); |
||||
} |
} |
||||
|
inline virtual void eth_miningI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void db_putStringI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->db_putString(request[0u].asString(), request[1u].asString(), request[2u].asString()); |
(void)request; |
||||
|
response = this->eth_mining(); |
||||
} |
} |
||||
|
inline virtual void eth_setMiningI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_accountsI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_accounts(); |
response = this->eth_setMining(request[0u].asBool()); |
||||
} |
} |
||||
|
inline virtual void eth_gasPriceI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_balanceAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_balanceAt(request[0u].asString()); |
(void)request; |
||||
|
response = this->eth_gasPrice(); |
||||
} |
} |
||||
|
inline virtual void eth_accountsI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_blockByHashI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_blockByHash(request[0u].asString()); |
(void)request; |
||||
|
response = this->eth_accounts(); |
||||
} |
} |
||||
|
inline virtual void eth_peerCountI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_blockByNumberI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_blockByNumber(request[0u].asInt()); |
(void)request; |
||||
|
response = this->eth_peerCount(); |
||||
} |
} |
||||
|
inline virtual void eth_defaultBlockI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_callI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_call(request[0u]); |
(void)request; |
||||
|
response = this->eth_defaultBlock(); |
||||
} |
} |
||||
|
inline virtual void eth_setDefaultBlockI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_changedI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_changed(request[0u].asInt()); |
response = this->eth_setDefaultBlock(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_numberI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_codeAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_codeAt(request[0u].asString()); |
(void)request; |
||||
|
response = this->eth_number(); |
||||
} |
} |
||||
|
inline virtual void eth_balanceAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_coinbaseI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_coinbase(); |
response = this->eth_balanceAt(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_stateAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_compileI(const Json::Value& request, Json::Value& response) |
{ |
||||
|
response = this->eth_stateAt(request[0u].asString(), request[1u].asString()); |
||||
|
} |
||||
|
inline virtual void eth_storageAtI(const Json::Value &request, Json::Value &response) |
||||
{ |
{ |
||||
response = this->eth_compile(request[0u].asString()); |
response = this->eth_storageAt(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_countAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_countAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_countAt(request[0u].asString()); |
response = this->eth_countAt(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_codeAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_defaultBlockI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_defaultBlock(); |
response = this->eth_codeAt(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_transactI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_gasPriceI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_gasPrice(); |
response = this->eth_transact(request[0u]); |
||||
} |
} |
||||
|
inline virtual void eth_callI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_getMessagesI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_getMessages(request[0u].asInt()); |
response = this->eth_call(request[0u]); |
||||
} |
} |
||||
|
inline virtual void eth_blockByHashI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_listeningI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_listening(); |
response = this->eth_blockByHash(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_blockByNumberI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_lllI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_lll(request[0u].asString()); |
response = this->eth_blockByNumber(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_transactionByHashI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_miningI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_mining(); |
response = this->eth_transactionByHash(request[0u].asString(), request[1u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_transactionByNumberI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_newFilterI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_newFilter(request[0u]); |
response = this->eth_transactionByNumber(request[0u].asInt(), request[1u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_uncleByHashI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_newFilterStringI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_newFilterString(request[0u].asString()); |
response = this->eth_uncleByHash(request[0u].asString(), request[1u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_uncleByNumberI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_numberI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_number(); |
response = this->eth_uncleByNumber(request[0u].asInt(), request[1u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_compilersI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_peerCountI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_peerCount(); |
(void)request; |
||||
|
response = this->eth_compilers(); |
||||
} |
} |
||||
|
inline virtual void eth_lllI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_setCoinbaseI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_setCoinbase(request[0u].asString()); |
response = this->eth_lll(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_solidityI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_setDefaultBlockI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_setDefaultBlock(request[0u].asInt()); |
response = this->eth_solidity(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_serpentI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_setListeningI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_setListening(request[0u].asBool()); |
response = this->eth_serpent(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_newFilterI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_setMiningI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_setMining(request[0u].asBool()); |
response = this->eth_newFilter(request[0u]); |
||||
} |
} |
||||
|
inline virtual void eth_newFilterStringI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_stateAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_stateAt(request[0u].asString(), request[1u].asString()); |
response = this->eth_newFilterString(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_uninstallFilterI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_transactI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_transact(request[0u]); |
response = this->eth_uninstallFilter(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_changedI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_transactionByHashI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_transactionByHash(request[0u].asString(), request[1u].asInt()); |
response = this->eth_changed(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_filterLogsI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_transactionByNumberI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_transactionByNumber(request[0u].asInt(), request[1u].asInt()); |
response = this->eth_filterLogs(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_logsI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_uncleByHashI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_uncleByHash(request[0u].asString(), request[1u].asInt()); |
response = this->eth_logs(request[0u]); |
||||
} |
} |
||||
|
inline virtual void db_putI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_uncleByNumberI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_uncleByNumber(request[0u].asInt(), request[1u].asInt()); |
response = this->db_put(request[0u].asString(), request[1u].asString(), request[2u].asString()); |
||||
} |
} |
||||
|
inline virtual void db_getI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_uninstallFilterI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_uninstallFilter(request[0u].asInt()); |
response = this->db_get(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void db_putStringI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_addToGroupI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_addToGroup(request[0u].asString(), request[1u].asString()); |
response = this->db_putString(request[0u].asString(), request[1u].asString(), request[2u].asString()); |
||||
} |
} |
||||
|
inline virtual void db_getStringI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_changedI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_changed(request[0u].asInt()); |
response = this->db_getString(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void shh_postI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_haveIdentityI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_haveIdentity(request[0u].asString()); |
response = this->shh_post(request[0u]); |
||||
} |
} |
||||
|
inline virtual void shh_newIdentityI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_newFilterI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_newFilter(request[0u]); |
(void)request; |
||||
|
response = this->shh_newIdentity(); |
||||
} |
} |
||||
|
inline virtual void shh_haveIdentityI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_newGroupI(const Json::Value& request, Json::Value& response) |
{ |
||||
|
response = this->shh_haveIdentity(request[0u].asString()); |
||||
|
} |
||||
|
inline virtual void shh_newGroupI(const Json::Value &request, Json::Value &response) |
||||
{ |
{ |
||||
response = this->shh_newGroup(request[0u].asString(), request[1u].asString()); |
response = this->shh_newGroup(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void shh_addToGroupI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_newIdentityI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_newIdentity(); |
response = this->shh_addToGroup(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void shh_newFilterI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_postI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_post(request[0u]); |
response = this->shh_newFilter(request[0u]); |
||||
} |
} |
||||
|
inline virtual void shh_uninstallFilterI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_uninstallFilterI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_uninstallFilter(request[0u].asInt()); |
response = this->shh_uninstallFilter(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void shh_changedI(const Json::Value &request, Json::Value &response) |
||||
|
{ |
||||
virtual std::string db_get(const std::string& param1, const std::string& param2) = 0; |
response = this->shh_changed(request[0u].asInt()); |
||||
virtual std::string db_getString(const std::string& param1, const std::string& param2) = 0; |
} |
||||
virtual bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) = 0; |
|
||||
virtual bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) = 0; |
|
||||
virtual Json::Value eth_accounts() = 0; |
|
||||
virtual std::string eth_balanceAt(const std::string& param1) = 0; |
|
||||
virtual Json::Value eth_blockByHash(const std::string& param1) = 0; |
|
||||
virtual Json::Value eth_blockByNumber(const int& param1) = 0; |
|
||||
virtual std::string eth_call(const Json::Value& param1) = 0; |
|
||||
virtual bool eth_changed(const int& param1) = 0; |
|
||||
virtual std::string eth_codeAt(const std::string& param1) = 0; |
|
||||
virtual std::string eth_coinbase() = 0; |
virtual std::string eth_coinbase() = 0; |
||||
virtual std::string eth_compile(const std::string& param1) = 0; |
virtual bool eth_setCoinbase(const std::string& param1) = 0; |
||||
virtual double eth_countAt(const std::string& param1) = 0; |
|
||||
virtual int eth_defaultBlock() = 0; |
|
||||
virtual std::string eth_gasPrice() = 0; |
|
||||
virtual Json::Value eth_getMessages(const int& param1) = 0; |
|
||||
virtual bool eth_listening() = 0; |
virtual bool eth_listening() = 0; |
||||
virtual std::string eth_lll(const std::string& param1) = 0; |
virtual bool eth_setListening(const bool& param1) = 0; |
||||
virtual bool eth_mining() = 0; |
virtual bool eth_mining() = 0; |
||||
virtual int eth_newFilter(const Json::Value& param1) = 0; |
virtual bool eth_setMining(const bool& param1) = 0; |
||||
virtual int eth_newFilterString(const std::string& param1) = 0; |
virtual std::string eth_gasPrice() = 0; |
||||
virtual int eth_number() = 0; |
virtual Json::Value eth_accounts() = 0; |
||||
virtual int eth_peerCount() = 0; |
virtual int eth_peerCount() = 0; |
||||
virtual bool eth_setCoinbase(const std::string& param1) = 0; |
virtual int eth_defaultBlock() = 0; |
||||
virtual bool eth_setDefaultBlock(const int& param1) = 0; |
virtual bool eth_setDefaultBlock(const int& param1) = 0; |
||||
virtual bool eth_setListening(const bool& param1) = 0; |
virtual int eth_number() = 0; |
||||
virtual bool eth_setMining(const bool& param1) = 0; |
virtual std::string eth_balanceAt(const std::string& param1) = 0; |
||||
virtual std::string eth_stateAt(const std::string& param1, const std::string& param2) = 0; |
virtual std::string eth_stateAt(const std::string& param1, const std::string& param2) = 0; |
||||
|
virtual Json::Value eth_storageAt(const std::string& param1) = 0; |
||||
|
virtual double eth_countAt(const std::string& param1) = 0; |
||||
|
virtual std::string eth_codeAt(const std::string& param1) = 0; |
||||
virtual std::string eth_transact(const Json::Value& param1) = 0; |
virtual std::string eth_transact(const Json::Value& param1) = 0; |
||||
|
virtual std::string eth_call(const Json::Value& param1) = 0; |
||||
|
virtual Json::Value eth_blockByHash(const std::string& param1) = 0; |
||||
|
virtual Json::Value eth_blockByNumber(const int& param1) = 0; |
||||
virtual Json::Value eth_transactionByHash(const std::string& param1, const int& param2) = 0; |
virtual Json::Value eth_transactionByHash(const std::string& param1, const int& param2) = 0; |
||||
virtual Json::Value eth_transactionByNumber(const int& param1, const int& param2) = 0; |
virtual Json::Value eth_transactionByNumber(const int& param1, const int& param2) = 0; |
||||
virtual Json::Value eth_uncleByHash(const std::string& param1, const int& param2) = 0; |
virtual Json::Value eth_uncleByHash(const std::string& param1, const int& param2) = 0; |
||||
virtual Json::Value eth_uncleByNumber(const int& param1, const int& param2) = 0; |
virtual Json::Value eth_uncleByNumber(const int& param1, const int& param2) = 0; |
||||
|
virtual Json::Value eth_compilers() = 0; |
||||
|
virtual std::string eth_lll(const std::string& param1) = 0; |
||||
|
virtual std::string eth_solidity(const std::string& param1) = 0; |
||||
|
virtual std::string eth_serpent(const std::string& param1) = 0; |
||||
|
virtual int eth_newFilter(const Json::Value& param1) = 0; |
||||
|
virtual int eth_newFilterString(const std::string& param1) = 0; |
||||
virtual bool eth_uninstallFilter(const int& param1) = 0; |
virtual bool eth_uninstallFilter(const int& param1) = 0; |
||||
virtual std::string shh_addToGroup(const std::string& param1, const std::string& param2) = 0; |
virtual bool eth_changed(const int& param1) = 0; |
||||
virtual Json::Value shh_changed(const int& param1) = 0; |
virtual Json::Value eth_filterLogs(const int& param1) = 0; |
||||
|
virtual Json::Value eth_logs(const Json::Value& param1) = 0; |
||||
|
virtual bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) = 0; |
||||
|
virtual std::string db_get(const std::string& param1, const std::string& param2) = 0; |
||||
|
virtual bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) = 0; |
||||
|
virtual std::string db_getString(const std::string& param1, const std::string& param2) = 0; |
||||
|
virtual bool shh_post(const Json::Value& param1) = 0; |
||||
|
virtual std::string shh_newIdentity() = 0; |
||||
virtual bool shh_haveIdentity(const std::string& param1) = 0; |
virtual bool shh_haveIdentity(const std::string& param1) = 0; |
||||
virtual int shh_newFilter(const Json::Value& param1) = 0; |
|
||||
virtual std::string shh_newGroup(const std::string& param1, const std::string& param2) = 0; |
virtual std::string shh_newGroup(const std::string& param1, const std::string& param2) = 0; |
||||
virtual std::string shh_newIdentity() = 0; |
virtual std::string shh_addToGroup(const std::string& param1, const std::string& param2) = 0; |
||||
virtual bool shh_post(const Json::Value& param1) = 0; |
virtual int shh_newFilter(const Json::Value& param1) = 0; |
||||
virtual bool shh_uninstallFilter(const int& param1) = 0; |
virtual bool shh_uninstallFilter(const int& param1) = 0; |
||||
|
virtual Json::Value shh_changed(const int& param1) = 0; |
||||
}; |
}; |
||||
#endif //_ABSTRACTWEBTHREESTUBSERVER_H_
|
|
||||
|
#endif //JSONRPC_CPP_ABSTRACTWEBTHREESTUBSERVER_H_
|
||||
|
@ -1,55 +1,59 @@ |
|||||
[ |
[ |
||||
{ "method": "eth_coinbase", "params": [], "order": [], "returns" : "" }, |
{ "name": "eth_coinbase", "params": [], "order": [], "returns" : "" }, |
||||
{ "method": "eth_setCoinbase", "params": [""], "order": [], "returns" : true }, |
{ "name": "eth_setCoinbase", "params": [""], "order": [], "returns" : true }, |
||||
{ "method": "eth_listening", "params": [], "order": [], "returns" : false }, |
{ "name": "eth_listening", "params": [], "order": [], "returns" : false }, |
||||
{ "method": "eth_setListening", "params": [false], "order" : [], "returns" : true }, |
{ "name": "eth_setListening", "params": [false], "order" : [], "returns" : true }, |
||||
{ "method": "eth_mining", "params": [], "order": [], "returns" : false }, |
{ "name": "eth_mining", "params": [], "order": [], "returns" : false }, |
||||
{ "method": "eth_setMining", "params": [false], "order" : [], "returns" : true }, |
{ "name": "eth_setMining", "params": [false], "order" : [], "returns" : true }, |
||||
{ "method": "eth_gasPrice", "params": [], "order": [], "returns" : "" }, |
{ "name": "eth_gasPrice", "params": [], "order": [], "returns" : "" }, |
||||
{ "method": "eth_accounts", "params": [], "order": [], "returns" : [] }, |
{ "name": "eth_accounts", "params": [], "order": [], "returns" : [] }, |
||||
{ "method": "eth_peerCount", "params": [], "order": [], "returns" : 0 }, |
{ "name": "eth_peerCount", "params": [], "order": [], "returns" : 0 }, |
||||
{ "method": "eth_defaultBlock", "params": [], "order": [], "returns" : 0}, |
{ "name": "eth_defaultBlock", "params": [], "order": [], "returns" : 0}, |
||||
{ "method": "eth_setDefaultBlock", "params": [0], "order": [], "returns" : true}, |
{ "name": "eth_setDefaultBlock", "params": [0], "order": [], "returns" : true}, |
||||
{ "method": "eth_number", "params": [], "order": [], "returns" : 0}, |
{ "name": "eth_number", "params": [], "order": [], "returns" : 0}, |
||||
|
|
||||
{ "method": "eth_balanceAt", "params": [""], "order": [], "returns" : ""}, |
{ "name": "eth_balanceAt", "params": [""], "order": [], "returns" : ""}, |
||||
{ "method": "eth_stateAt", "params": ["", ""], "order": [], "returns": ""}, |
{ "name": "eth_stateAt", "params": ["", ""], "order": [], "returns": ""}, |
||||
{ "method": "eth_countAt", "params": [""], "order": [], "returns" : 0.0}, |
{ "name": "eth_storageAt", "params": [""], "order": [], "returns": {}}, |
||||
{ "method": "eth_codeAt", "params": [""], "order": [], "returns": ""}, |
{ "name": "eth_countAt", "params": [""], "order": [], "returns" : 0.0}, |
||||
|
{ "name": "eth_codeAt", "params": [""], "order": [], "returns": ""}, |
||||
{ "method": "eth_transact", "params": [{}], "order": [], "returns": ""}, |
|
||||
{ "method": "eth_call", "params": [{}], "order": [], "returns": ""}, |
{ "name": "eth_transact", "params": [{}], "order": [], "returns": ""}, |
||||
|
{ "name": "eth_call", "params": [{}], "order": [], "returns": ""}, |
||||
{ "method": "eth_blockByHash", "params": [""],"order": [], "returns": {}}, |
|
||||
{ "method": "eth_blockByNumber", "params": [0],"order": [], "returns": {}}, |
{ "name": "eth_blockByHash", "params": [""],"order": [], "returns": {}}, |
||||
{ "method": "eth_transactionByHash", "params": ["", 0], "order": [], "returns": {}}, |
{ "name": "eth_blockByNumber", "params": [0],"order": [], "returns": {}}, |
||||
{ "method": "eth_transactionByNumber", "params": [0, 0], "order": [], "returns": {}}, |
{ "name": "eth_transactionByHash", "params": ["", 0], "order": [], "returns": {}}, |
||||
{ "method": "eth_uncleByHash", "params": ["", 0], "order": [], "returns": {}}, |
{ "name": "eth_transactionByNumber", "params": [0, 0], "order": [], "returns": {}}, |
||||
{ "method": "eth_uncleByNumber", "params": [0, 0], "order": [], "returns": {}}, |
{ "name": "eth_uncleByHash", "params": ["", 0], "order": [], "returns": {}}, |
||||
|
{ "name": "eth_uncleByNumber", "params": [0, 0], "order": [], "returns": {}}, |
||||
{ "method": "eth_lll", "params": [""], "order": [], "returns": ""}, |
|
||||
{ "method": "eth_compile", "params": [""], "order": [], "returns": ""}, |
{ "name": "eth_compilers", "params": [], "order": [], "returns": []}, |
||||
|
{ "name": "eth_lll", "params": [""], "order": [], "returns": ""}, |
||||
{ "method": "eth_newFilter", "params": [{}], "order": [], "returns": 0}, |
{ "name": "eth_solidity", "params": [""], "order": [], "returns": ""}, |
||||
{ "method": "eth_newFilterString", "params": [""], "order": [], "returns": 0}, |
{ "name": "eth_serpent", "params": [""], "order": [], "returns": ""}, |
||||
{ "method": "eth_uninstallFilter", "params": [0], "order": [], "returns": true}, |
|
||||
{ "method": "eth_changed", "params": [0], "order": [], "returns": false}, |
|
||||
{ "method": "eth_getMessages", "params": [0], "order": [], "returns": []}, |
{ "name": "eth_newFilter", "params": [{}], "order": [], "returns": 0}, |
||||
|
{ "name": "eth_newFilterString", "params": [""], "order": [], "returns": 0}, |
||||
{ "method": "db_put", "params": ["", "", ""], "order": [], "returns": true}, |
{ "name": "eth_uninstallFilter", "params": [0], "order": [], "returns": true}, |
||||
{ "method": "db_get", "params": ["", ""], "order": [], "returns": ""}, |
{ "name": "eth_changed", "params": [0], "order": [], "returns": false}, |
||||
{ "method": "db_putString", "params": ["", "", ""], "order": [], "returns": true}, |
{ "name": "eth_filterLogs", "params": [0], "order": [], "returns": []}, |
||||
{ "method": "db_getString", "params": ["", ""], "order": [], "returns": ""}, |
{ "name": "eth_logs", "params": [{}], "order": [], "returns": []}, |
||||
|
|
||||
{ "method": "shh_post", "params": [{}], "order": [], "returns": true}, |
{ "name": "db_put", "params": ["", "", ""], "order": [], "returns": true}, |
||||
{ "method": "shh_newIdentity", "params": [], "order": [], "returns": ""}, |
{ "name": "db_get", "params": ["", ""], "order": [], "returns": ""}, |
||||
{ "method": "shh_haveIdentity", "params": [""], "order": [], "returns": false}, |
{ "name": "db_putString", "params": ["", "", ""], "order": [], "returns": true}, |
||||
{ "method": "shh_newGroup", "params": ["", ""], "order": [], "returns": ""}, |
{ "name": "db_getString", "params": ["", ""], "order": [], "returns": ""}, |
||||
{ "method": "shh_addToGroup", "params": ["", ""], "order": [], "returns": ""}, |
|
||||
|
{ "name": "shh_post", "params": [{}], "order": [], "returns": true}, |
||||
{ "method": "shh_newFilter", "params": [{}], "order": [], "returns": 0}, |
{ "name": "shh_newIdentity", "params": [], "order": [], "returns": ""}, |
||||
{ "method": "shh_uninstallFilter", "params": [0], "order": [], "returns": true}, |
{ "name": "shh_haveIdentity", "params": [""], "order": [], "returns": false}, |
||||
{ "method": "shh_changed", "params": [0], "order": [], "returns": []} |
{ "name": "shh_newGroup", "params": ["", ""], "order": [], "returns": ""}, |
||||
|
{ "name": "shh_addToGroup", "params": ["", ""], "order": [], "returns": ""}, |
||||
|
|
||||
|
{ "name": "shh_newFilter", "params": [{}], "order": [], "returns": 0}, |
||||
|
{ "name": "shh_uninstallFilter", "params": [0], "order": [], "returns": true}, |
||||
|
{ "name": "shh_changed", "params": [0], "order": [], "returns": []} |
||||
] |
] |
||||
|
|
||||
|
@ -1,588 +1,500 @@ |
|||||
/**
|
/**
|
||||
* THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!! |
* This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY! |
||||
*/ |
*/ |
||||
|
|
||||
#ifndef _WEBTHREESTUBCLIENT_H_ |
#ifndef JSONRPC_CPP_STUB_WEBTHREESTUBCLIENT_H_ |
||||
#define _WEBTHREESTUBCLIENT_H_ |
#define JSONRPC_CPP_STUB_WEBTHREESTUBCLIENT_H_ |
||||
|
|
||||
#include <jsonrpc/rpc.h> |
#include <jsonrpccpp/client.h> |
||||
|
|
||||
class WebThreeStubClient |
class WebThreeStubClient : public jsonrpc::Client |
||||
{ |
{ |
||||
public: |
public: |
||||
WebThreeStubClient(jsonrpc::AbstractClientConnector* conn) |
WebThreeStubClient(jsonrpc::IClientConnector &conn) : jsonrpc::Client(conn) {} |
||||
|
|
||||
|
std::string eth_coinbase() throw (jsonrpc::JsonRpcException) |
||||
{ |
{ |
||||
this->client = new jsonrpc::Client(conn); |
Json::Value p; |
||||
|
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("eth_coinbase",p); |
||||
|
if (result.isString()) |
||||
|
return result.asString(); |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
} |
} |
||||
~WebThreeStubClient() |
bool eth_setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
{ |
{ |
||||
delete this->client; |
Json::Value p; |
||||
|
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_setCoinbase",p); |
||||
|
if (result.isBool()) |
||||
|
return result.asBool(); |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
} |
} |
||||
|
bool eth_listening() throw (jsonrpc::JsonRpcException) |
||||
std::string db_get(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p = Json::nullValue; |
||||
p.append(param2); |
Json::Value result = this->CallMethod("eth_listening",p); |
||||
|
if (result.isBool()) |
||||
Json::Value result = this->client->CallMethod("db_get",p); |
return result.asBool(); |
||||
if (result.isString()) |
else |
||||
return result.asString(); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
bool eth_setListening(const bool& param1) throw (jsonrpc::JsonRpcException) |
||||
std::string db_getString(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
Json::Value result = this->CallMethod("eth_setListening",p); |
||||
|
if (result.isBool()) |
||||
Json::Value result = this->client->CallMethod("db_getString",p); |
return result.asBool(); |
||||
if (result.isString()) |
else |
||||
return result.asString(); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
bool eth_mining() throw (jsonrpc::JsonRpcException) |
||||
bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p = Json::nullValue; |
||||
p.append(param2); |
Json::Value result = this->CallMethod("eth_mining",p); |
||||
p.append(param3); |
if (result.isBool()) |
||||
|
return result.asBool(); |
||||
Json::Value result = this->client->CallMethod("db_put",p); |
else |
||||
if (result.isBool()) |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
return result.asBool(); |
|
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
bool eth_setMining(const bool& param1) throw (jsonrpc::JsonRpcException) |
||||
bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
Json::Value result = this->CallMethod("eth_setMining",p); |
||||
p.append(param3); |
if (result.isBool()) |
||||
|
return result.asBool(); |
||||
Json::Value result = this->client->CallMethod("db_putString",p); |
else |
||||
if (result.isBool()) |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
return result.asBool(); |
|
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
std::string eth_gasPrice() throw (jsonrpc::JsonRpcException) |
||||
Json::Value eth_accounts() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p = Json::nullValue; |
||||
Json::Value result = this->client->CallMethod("eth_accounts",p); |
Json::Value result = this->CallMethod("eth_gasPrice",p); |
||||
if (result.isArray()) |
if (result.isString()) |
||||
return result; |
return result.asString(); |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
Json::Value eth_accounts() throw (jsonrpc::JsonRpcException) |
||||
std::string eth_balanceAt(const std::string& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("eth_accounts",p); |
||||
Json::Value result = this->client->CallMethod("eth_balanceAt",p); |
if (result.isArray()) |
||||
if (result.isString()) |
return result; |
||||
return result.asString(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
int eth_peerCount() throw (jsonrpc::JsonRpcException) |
||||
Json::Value eth_blockByHash(const std::string& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("eth_peerCount",p); |
||||
Json::Value result = this->client->CallMethod("eth_blockByHash",p); |
if (result.isInt()) |
||||
if (result.isObject()) |
return result.asInt(); |
||||
return result; |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
int eth_defaultBlock() throw (jsonrpc::JsonRpcException) |
||||
Json::Value eth_blockByNumber(const int& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("eth_defaultBlock",p); |
||||
Json::Value result = this->client->CallMethod("eth_blockByNumber",p); |
if (result.isInt()) |
||||
if (result.isObject()) |
return result.asInt(); |
||||
return result; |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
bool eth_setDefaultBlock(const int& param1) throw (jsonrpc::JsonRpcException) |
||||
std::string eth_call(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_setDefaultBlock",p); |
||||
Json::Value result = this->client->CallMethod("eth_call",p); |
if (result.isBool()) |
||||
if (result.isString()) |
return result.asBool(); |
||||
return result.asString(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
int eth_number() throw (jsonrpc::JsonRpcException) |
||||
bool eth_changed(const int& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("eth_number",p); |
||||
Json::Value result = this->client->CallMethod("eth_changed",p); |
if (result.isInt()) |
||||
if (result.isBool()) |
return result.asInt(); |
||||
return result.asBool(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
std::string eth_balanceAt(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
std::string eth_codeAt(const std::string& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_balanceAt",p); |
||||
Json::Value result = this->client->CallMethod("eth_codeAt",p); |
if (result.isString()) |
||||
if (result.isString()) |
return result.asString(); |
||||
return result.asString(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
std::string eth_stateAt(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
||||
std::string eth_coinbase() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p.append(param1); |
||||
Json::Value result = this->client->CallMethod("eth_coinbase",p); |
p.append(param2); |
||||
if (result.isString()) |
Json::Value result = this->CallMethod("eth_stateAt",p); |
||||
return result.asString(); |
if (result.isString()) |
||||
else |
return result.asString(); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
} |
} |
||||
|
Json::Value eth_storageAt(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
std::string eth_compile(const std::string& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_storageAt",p); |
||||
Json::Value result = this->client->CallMethod("eth_compile",p); |
if (result.isObject()) |
||||
if (result.isString()) |
return result; |
||||
return result.asString(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
|
||||
double eth_countAt(const std::string& param1) throw (jsonrpc::JsonRpcException) |
double eth_countAt(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_countAt",p); |
||||
Json::Value result = this->client->CallMethod("eth_countAt",p); |
if (result.isDouble()) |
||||
if (result.isDouble()) |
return result.asDouble(); |
||||
return result.asDouble(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
std::string eth_codeAt(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
int eth_defaultBlock() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p.append(param1); |
||||
Json::Value result = this->client->CallMethod("eth_defaultBlock",p); |
Json::Value result = this->CallMethod("eth_codeAt",p); |
||||
if (result.isInt()) |
if (result.isString()) |
||||
return result.asInt(); |
return result.asString(); |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
std::string eth_transact(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
||||
std::string eth_gasPrice() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p.append(param1); |
||||
Json::Value result = this->client->CallMethod("eth_gasPrice",p); |
Json::Value result = this->CallMethod("eth_transact",p); |
||||
if (result.isString()) |
if (result.isString()) |
||||
return result.asString(); |
return result.asString(); |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
std::string eth_call(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
||||
Json::Value eth_getMessages(const int& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_call",p); |
||||
Json::Value result = this->client->CallMethod("eth_getMessages",p); |
if (result.isString()) |
||||
if (result.isArray()) |
return result.asString(); |
||||
return result; |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
Json::Value eth_blockByHash(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
bool eth_listening() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p.append(param1); |
||||
Json::Value result = this->client->CallMethod("eth_listening",p); |
Json::Value result = this->CallMethod("eth_blockByHash",p); |
||||
if (result.isBool()) |
if (result.isObject()) |
||||
return result.asBool(); |
return result; |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
Json::Value eth_blockByNumber(const int& param1) throw (jsonrpc::JsonRpcException) |
||||
std::string eth_lll(const std::string& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_blockByNumber",p); |
||||
Json::Value result = this->client->CallMethod("eth_lll",p); |
if (result.isObject()) |
||||
if (result.isString()) |
return result; |
||||
return result.asString(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
Json::Value eth_transactionByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException) |
||||
bool eth_mining() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p.append(param1); |
||||
Json::Value result = this->client->CallMethod("eth_mining",p); |
p.append(param2); |
||||
if (result.isBool()) |
Json::Value result = this->CallMethod("eth_transactionByHash",p); |
||||
return result.asBool(); |
if (result.isObject()) |
||||
else |
return result; |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
} |
} |
||||
|
Json::Value eth_transactionByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException) |
||||
int eth_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
p.append(param2); |
||||
Json::Value result = this->client->CallMethod("eth_newFilter",p); |
Json::Value result = this->CallMethod("eth_transactionByNumber",p); |
||||
if (result.isInt()) |
if (result.isObject()) |
||||
return result.asInt(); |
return result; |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
Json::Value eth_uncleByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException) |
||||
int eth_newFilterString(const std::string& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
p.append(param2); |
||||
Json::Value result = this->client->CallMethod("eth_newFilterString",p); |
Json::Value result = this->CallMethod("eth_uncleByHash",p); |
||||
if (result.isInt()) |
if (result.isObject()) |
||||
return result.asInt(); |
return result; |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
Json::Value eth_uncleByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException) |
||||
int eth_number() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p.append(param1); |
||||
Json::Value result = this->client->CallMethod("eth_number",p); |
p.append(param2); |
||||
if (result.isInt()) |
Json::Value result = this->CallMethod("eth_uncleByNumber",p); |
||||
return result.asInt(); |
if (result.isObject()) |
||||
else |
return result; |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
} |
} |
||||
|
Json::Value eth_compilers() throw (jsonrpc::JsonRpcException) |
||||
int eth_peerCount() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p = Json::nullValue; |
||||
Json::Value result = this->client->CallMethod("eth_peerCount",p); |
Json::Value result = this->CallMethod("eth_compilers",p); |
||||
if (result.isInt()) |
if (result.isArray()) |
||||
return result.asInt(); |
return result; |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
std::string eth_lll(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
bool eth_setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_lll",p); |
||||
Json::Value result = this->client->CallMethod("eth_setCoinbase",p); |
if (result.isString()) |
||||
if (result.isBool()) |
return result.asString(); |
||||
return result.asBool(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
std::string eth_solidity(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
bool eth_setDefaultBlock(const int& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_solidity",p); |
||||
Json::Value result = this->client->CallMethod("eth_setDefaultBlock",p); |
if (result.isString()) |
||||
if (result.isBool()) |
return result.asString(); |
||||
return result.asBool(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
std::string eth_serpent(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
bool eth_setListening(const bool& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_serpent",p); |
||||
Json::Value result = this->client->CallMethod("eth_setListening",p); |
if (result.isString()) |
||||
if (result.isBool()) |
return result.asString(); |
||||
return result.asBool(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
int eth_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
||||
bool eth_setMining(const bool& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_newFilter",p); |
||||
Json::Value result = this->client->CallMethod("eth_setMining",p); |
if (result.isInt()) |
||||
if (result.isBool()) |
return result.asInt(); |
||||
return result.asBool(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
int eth_newFilterString(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
std::string eth_stateAt(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
Json::Value result = this->CallMethod("eth_newFilterString",p); |
||||
|
if (result.isInt()) |
||||
Json::Value result = this->client->CallMethod("eth_stateAt",p); |
return result.asInt(); |
||||
if (result.isString()) |
else |
||||
return result.asString(); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
bool eth_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException) |
||||
std::string eth_transact(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("eth_uninstallFilter",p); |
||||
Json::Value result = this->client->CallMethod("eth_transact",p); |
if (result.isBool()) |
||||
if (result.isString()) |
return result.asBool(); |
||||
return result.asString(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
bool eth_changed(const int& param1) throw (jsonrpc::JsonRpcException) |
||||
Json::Value eth_transactionByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
Json::Value result = this->CallMethod("eth_changed",p); |
||||
|
if (result.isBool()) |
||||
Json::Value result = this->client->CallMethod("eth_transactionByHash",p); |
return result.asBool(); |
||||
if (result.isObject()) |
else |
||||
return result; |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
Json::Value eth_filterLogs(const int& param1) throw (jsonrpc::JsonRpcException) |
||||
Json::Value eth_transactionByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
Json::Value result = this->CallMethod("eth_filterLogs",p); |
||||
|
if (result.isArray()) |
||||
Json::Value result = this->client->CallMethod("eth_transactionByNumber",p); |
return result; |
||||
if (result.isObject()) |
else |
||||
return result; |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
Json::Value eth_logs(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
||||
Json::Value eth_uncleByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
Json::Value result = this->CallMethod("eth_logs",p); |
||||
|
if (result.isArray()) |
||||
Json::Value result = this->client->CallMethod("eth_uncleByHash",p); |
return result; |
||||
if (result.isObject()) |
else |
||||
return result; |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) |
||||
Json::Value eth_uncleByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
p.append(param2); |
||||
|
p.append(param3); |
||||
Json::Value result = this->client->CallMethod("eth_uncleByNumber",p); |
Json::Value result = this->CallMethod("db_put",p); |
||||
if (result.isObject()) |
if (result.isBool()) |
||||
return result; |
return result.asBool(); |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
std::string db_get(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
||||
bool eth_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
p.append(param2); |
||||
Json::Value result = this->client->CallMethod("eth_uninstallFilter",p); |
Json::Value result = this->CallMethod("db_get",p); |
||||
if (result.isBool()) |
if (result.isString()) |
||||
return result.asBool(); |
return result.asString(); |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) |
||||
std::string shh_addToGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
p.append(param2); |
||||
|
p.append(param3); |
||||
Json::Value result = this->client->CallMethod("shh_addToGroup",p); |
Json::Value result = this->CallMethod("db_putString",p); |
||||
if (result.isString()) |
if (result.isBool()) |
||||
return result.asString(); |
return result.asBool(); |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
std::string db_getString(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
||||
Json::Value shh_changed(const int& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
p.append(param2); |
||||
Json::Value result = this->client->CallMethod("shh_changed",p); |
Json::Value result = this->CallMethod("db_getString",p); |
||||
if (result.isArray()) |
if (result.isString()) |
||||
return result; |
return result.asString(); |
||||
else |
else |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
|
||||
} |
} |
||||
|
bool shh_post(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
||||
bool shh_haveIdentity(const std::string& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("shh_post",p); |
||||
Json::Value result = this->client->CallMethod("shh_haveIdentity",p); |
if (result.isBool()) |
||||
if (result.isBool()) |
return result.asBool(); |
||||
return result.asBool(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
std::string shh_newIdentity() throw (jsonrpc::JsonRpcException) |
||||
int shh_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
{ |
||||
|
Json::Value p; |
||||
|
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("shh_newIdentity",p); |
||||
|
if (result.isString()) |
||||
|
return result.asString(); |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
} |
||||
|
bool shh_haveIdentity(const std::string& param1) throw (jsonrpc::JsonRpcException) |
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("shh_haveIdentity",p); |
||||
Json::Value result = this->client->CallMethod("shh_newFilter",p); |
if (result.isBool()) |
||||
if (result.isInt()) |
return result.asBool(); |
||||
return result.asInt(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
|
||||
std::string shh_newGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
std::string shh_newGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
p.append(param2); |
p.append(param2); |
||||
|
Json::Value result = this->CallMethod("shh_newGroup",p); |
||||
Json::Value result = this->client->CallMethod("shh_newGroup",p); |
if (result.isString()) |
||||
if (result.isString()) |
return result.asString(); |
||||
return result.asString(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
std::string shh_addToGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
||||
std::string shh_newIdentity() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p = Json::nullValue; |
p.append(param1); |
||||
Json::Value result = this->client->CallMethod("shh_newIdentity",p); |
p.append(param2); |
||||
if (result.isString()) |
Json::Value result = this->CallMethod("shh_addToGroup",p); |
||||
return result.asString(); |
if (result.isString()) |
||||
else |
return result.asString(); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
} |
} |
||||
|
int shh_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
||||
bool shh_post(const Json::Value& param1) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("shh_newFilter",p); |
||||
Json::Value result = this->client->CallMethod("shh_post",p); |
if (result.isInt()) |
||||
if (result.isBool()) |
return result.asInt(); |
||||
return result.asBool(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
|
|
||||
} |
} |
||||
|
|
||||
bool shh_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException) |
bool shh_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException) |
||||
{ |
{ |
||||
Json::Value p; |
Json::Value p; |
||||
p.append(param1); |
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("shh_uninstallFilter",p); |
||||
Json::Value result = this->client->CallMethod("shh_uninstallFilter",p); |
if (result.isBool()) |
||||
if (result.isBool()) |
return result.asBool(); |
||||
return result.asBool(); |
else |
||||
else |
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
} |
||||
|
Json::Value shh_changed(const int& param1) throw (jsonrpc::JsonRpcException) |
||||
|
{ |
||||
|
Json::Value p; |
||||
|
p.append(param1); |
||||
|
Json::Value result = this->CallMethod("shh_changed",p); |
||||
|
if (result.isArray()) |
||||
|
return result; |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
} |
} |
||||
|
|
||||
private: |
|
||||
jsonrpc::Client* client; |
|
||||
}; |
}; |
||||
#endif //_WEBTHREESTUBCLIENT_H_
|
|
||||
|
#endif //JSONRPC_CPP_WEBTHREESTUBCLIENT_H_
|
||||
|
Loading…
Reference in new issue