Class JsonRpc
java.lang.Object
com.codename1.crypto.rpc.JsonRpc
JSON-RPC 2.0 over an
RpcTransport: what Ethereum and Solana nodes speak. Parameters and
results are the values Json reads and writes: Map, List, String, Boolean, Long,
UInt256 and Double.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static List<?> A result that must be a JSON array.protected static longA result that must be a JSON integer withinlongrange.protected static Map<?, ?> A result that must be a JSON object.protected static StringA result that must be a JSON string.Calls a method and answers itsresult, which may benull.Calls a method with a parameter list, or a parameter object whenparamsis aMap.The transport.getUrl()The endpoint.
-
Constructor Details
-
JsonRpc
A client for an endpoint.
-
-
Method Details
-
getUrl
The endpoint. -
getTransport
The transport. -
call
Calls a method and answers its
result, which may benull.Throws
RpcException: for anerrorreply or an HTTP failureIOException: when the endpoint could not be reached, or answered something that is not a JSON-RPC response
- Throws:
IOException
-
callWith
Calls a method with a parameter list, or a parameter object whenparamsis aMap. It is not an overload ofcall(String, Object...), which would take a single parameter for the whole list.- Throws:
IOException
-
asMap
A result that must be a JSON object.- Throws:
IOException
-
asList
A result that must be a JSON array.- Throws:
IOException
-
asString
A result that must be a JSON string.- Throws:
IOException
-
asLong
A result that must be a JSON integer withinlongrange.- Throws:
IOException
-