public class JsonRpc2_0Web3j extends java.lang.Object implements Web3j
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BLOCK_TIME |
protected Web3jService |
web3jService |
Constructor and Description |
---|
JsonRpc2_0Web3j(Web3jService web3jService) |
JsonRpc2_0Web3j(Web3jService web3jService,
long pollingInterval,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService) |
Modifier and Type | Method and Description |
---|---|
rx.Observable<EthBlock> |
blockObservable(boolean fullTransactionObjects)
Create an Observable that emits newly created blocks on the blockchain.
|
rx.Observable<EthBlock> |
catchUpToLatestAndSubscribeToNewBlocksObservable(DefaultBlockParameter startBlock,
boolean fullTransactionObjects)
Creates an Observable that emits all blocks from the requested block number to the most
current.
|
rx.Observable<Transaction> |
catchUpToLatestAndSubscribeToNewTransactionsObservable(DefaultBlockParameter startBlock)
As per
Web3jRx.catchUpToLatestAndSubscribeToNewBlocksObservable(DefaultBlockParameter, boolean) ,
except that all transactions contained within the blocks are emitted. |
rx.Observable<EthBlock> |
catchUpToLatestBlockObservable(DefaultBlockParameter startBlock,
boolean fullTransactionObjects)
Creates an Observable that emits all blocks from the requested block number to the most
current.
|
rx.Observable<EthBlock> |
catchUpToLatestBlockObservable(DefaultBlockParameter startBlock,
boolean fullTransactionObjects,
rx.Observable<EthBlock> onCompleteObservable)
Create an Observable that emits all transactions from the blockchain starting with a
provided block number.
|
rx.Observable<Transaction> |
catchUpToLatestTransactionObservable(DefaultBlockParameter startBlock)
Creates an Observable that emits all transactions from the requested block number to the most
current.
|
Request<?,DbGetHex> |
dbGetHex(java.lang.String databaseName,
java.lang.String keyName) |
Request<?,DbGetString> |
dbGetString(java.lang.String databaseName,
java.lang.String keyName) |
Request<?,DbPutHex> |
dbPutHex(java.lang.String databaseName,
java.lang.String keyName,
java.lang.String dataToStore) |
Request<?,DbPutString> |
dbPutString(java.lang.String databaseName,
java.lang.String keyName,
java.lang.String stringToStore) |
Request<?,EthAccounts> |
ethAccounts() |
rx.Observable<java.lang.String> |
ethBlockHashObservable()
Create an Observable to emit block hashes.
|
Request<?,EthBlockNumber> |
ethBlockNumber() |
Request<?,EthCall> |
ethCall(Transaction transaction,
DefaultBlockParameter defaultBlockParameter) |
Request<?,EthCoinbase> |
ethCoinbase() |
Request<?,EthCompileLLL> |
ethCompileLLL(java.lang.String sourceCode) |
Request<?,EthCompileSerpent> |
ethCompileSerpent(java.lang.String sourceCode) |
Request<?,EthCompileSolidity> |
ethCompileSolidity(java.lang.String sourceCode) |
Request<?,EthEstimateGas> |
ethEstimateGas(Transaction transaction) |
Request<?,EthGasPrice> |
ethGasPrice() |
Request<?,EthGetBalance> |
ethGetBalance(java.lang.String address,
DefaultBlockParameter defaultBlockParameter) |
Request<?,EthBlock> |
ethGetBlockByHash(java.lang.String blockHash,
boolean returnFullTransactionObjects) |
Request<?,EthBlock> |
ethGetBlockByNumber(DefaultBlockParameter defaultBlockParameter,
boolean returnFullTransactionObjects) |
Request<?,EthGetBlockTransactionCountByHash> |
ethGetBlockTransactionCountByHash(java.lang.String blockHash) |
Request<?,EthGetBlockTransactionCountByNumber> |
ethGetBlockTransactionCountByNumber(DefaultBlockParameter defaultBlockParameter) |
Request<?,EthGetCode> |
ethGetCode(java.lang.String address,
DefaultBlockParameter defaultBlockParameter) |
Request<?,EthGetCompilers> |
ethGetCompilers() |
Request<?,EthLog> |
ethGetFilterChanges(java.math.BigInteger filterId) |
Request<?,EthLog> |
ethGetFilterLogs(java.math.BigInteger filterId) |
Request<?,EthLog> |
ethGetLogs(EthFilter ethFilter) |
Request<?,EthGetStorageAt> |
ethGetStorageAt(java.lang.String address,
java.math.BigInteger position,
DefaultBlockParameter defaultBlockParameter) |
Request<?,EthTransaction> |
ethGetTransactionByBlockHashAndIndex(java.lang.String blockHash,
java.math.BigInteger transactionIndex) |
Request<?,EthTransaction> |
ethGetTransactionByBlockNumberAndIndex(DefaultBlockParameter defaultBlockParameter,
java.math.BigInteger transactionIndex) |
Request<?,EthTransaction> |
ethGetTransactionByHash(java.lang.String transactionHash) |
Request<?,EthGetTransactionCount> |
ethGetTransactionCount(java.lang.String address,
DefaultBlockParameter defaultBlockParameter) |
Request<?,EthGetTransactionReceipt> |
ethGetTransactionReceipt(java.lang.String transactionHash) |
Request<?,EthBlock> |
ethGetUncleByBlockHashAndIndex(java.lang.String blockHash,
java.math.BigInteger transactionIndex) |
Request<?,EthBlock> |
ethGetUncleByBlockNumberAndIndex(DefaultBlockParameter defaultBlockParameter,
java.math.BigInteger uncleIndex) |
Request<?,EthGetUncleCountByBlockHash> |
ethGetUncleCountByBlockHash(java.lang.String blockHash) |
Request<?,EthGetUncleCountByBlockNumber> |
ethGetUncleCountByBlockNumber(DefaultBlockParameter defaultBlockParameter) |
Request<?,EthGetWork> |
ethGetWork() |
Request<?,EthHashrate> |
ethHashrate() |
rx.Observable<Log> |
ethLogObservable(EthFilter ethFilter)
Create an observable to filter for specific log events on the blockchain.
|
Request<?,EthMining> |
ethMining() |
Request<?,EthFilter> |
ethNewBlockFilter() |
Request<?,EthFilter> |
ethNewFilter(EthFilter ethFilter) |
Request<?,EthFilter> |
ethNewPendingTransactionFilter() |
rx.Observable<java.lang.String> |
ethPendingTransactionHashObservable()
Create an Observable to emit pending transactions, i.e.
|
Request<?,EthProtocolVersion> |
ethProtocolVersion() |
Request<?,EthSendTransaction> |
ethSendRawTransaction(java.lang.String signedTransactionData) |
Request<?,EthSendTransaction> |
ethSendTransaction(Transaction transaction) |
Request<?,EthSign> |
ethSign(java.lang.String address,
java.lang.String sha3HashOfDataToSign) |
Request<?,EthSubmitHashrate> |
ethSubmitHashrate(java.lang.String hashrate,
java.lang.String clientId) |
Request<?,EthSubmitWork> |
ethSubmitWork(java.lang.String nonce,
java.lang.String headerPowHash,
java.lang.String mixDigest) |
Request<?,EthSyncing> |
ethSyncing() |
Request<?,EthUninstallFilter> |
ethUninstallFilter(java.math.BigInteger filterId) |
rx.Observable<LogNotification> |
logsNotifications(java.util.List<java.lang.String> addresses,
java.util.List<java.lang.String> topics)
Creates an observable that emits notifications for logs included in new imported blocks.
|
Request<?,NetListening> |
netListening() |
Request<?,NetPeerCount> |
netPeerCount() |
Request<?,NetVersion> |
netVersion() |
rx.Observable<NewHeadsNotification> |
newHeadsNotifications()
Creates an observable that emits a notification when a new header is appended to a chain,
including chain reorganizations.
|
rx.Observable<Transaction> |
pendingTransactionObservable()
Create an Observable to emit all pending transactions that have yet to be placed into a
block on the blockchain.
|
rx.Observable<EthBlock> |
replayBlocksObservable(DefaultBlockParameter startBlock,
DefaultBlockParameter endBlock,
boolean fullTransactionObjects)
Create an Observable that emits all blocks from the blockchain contained within the
requested range.
|
rx.Observable<EthBlock> |
replayBlocksObservable(DefaultBlockParameter startBlock,
DefaultBlockParameter endBlock,
boolean fullTransactionObjects,
boolean ascending)
Create an Observable that emits all blocks from the blockchain contained within the
requested range.
|
rx.Observable<Transaction> |
replayTransactionsObservable(DefaultBlockParameter startBlock,
DefaultBlockParameter endBlock)
Create an Observable that emits all transactions from the blockchain contained within the
requested range.
|
Request<?,ShhAddToGroup> |
shhAddToGroup(java.lang.String identityAddress) |
Request<?,ShhMessages> |
shhGetFilterChanges(java.math.BigInteger filterId) |
Request<?,ShhMessages> |
shhGetMessages(java.math.BigInteger filterId) |
Request<?,ShhHasIdentity> |
shhHasIdentity(java.lang.String identityAddress) |
Request<?,ShhNewFilter> |
shhNewFilter(ShhFilter shhFilter) |
Request<?,ShhNewGroup> |
shhNewGroup() |
Request<?,ShhNewIdentity> |
shhNewIdentity() |
Request<?,ShhPost> |
shhPost(ShhPost shhPost) |
Request<?,ShhUninstallFilter> |
shhUninstallFilter(java.math.BigInteger filterId) |
Request<?,ShhVersion> |
shhVersion() |
void |
shutdown()
Shutdowns a Web3j instance and closes opened resources.
|
rx.Observable<Transaction> |
transactionObservable()
Create an Observable to emit all new transactions as they are confirmed on the blockchain.
|
Request<?,Web3ClientVersion> |
web3ClientVersion() |
Request<?,Web3Sha3> |
web3Sha3(java.lang.String data) |
public static final int DEFAULT_BLOCK_TIME
protected final Web3jService web3jService
public JsonRpc2_0Web3j(Web3jService web3jService)
public JsonRpc2_0Web3j(Web3jService web3jService, long pollingInterval, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
public Request<?,Web3ClientVersion> web3ClientVersion()
web3ClientVersion
in interface Ethereum
public Request<?,NetVersion> netVersion()
netVersion
in interface Ethereum
public Request<?,NetListening> netListening()
netListening
in interface Ethereum
public Request<?,NetPeerCount> netPeerCount()
netPeerCount
in interface Ethereum
public Request<?,EthProtocolVersion> ethProtocolVersion()
ethProtocolVersion
in interface Ethereum
public Request<?,EthCoinbase> ethCoinbase()
ethCoinbase
in interface Ethereum
public Request<?,EthSyncing> ethSyncing()
ethSyncing
in interface Ethereum
public Request<?,EthHashrate> ethHashrate()
ethHashrate
in interface Ethereum
public Request<?,EthGasPrice> ethGasPrice()
ethGasPrice
in interface Ethereum
public Request<?,EthAccounts> ethAccounts()
ethAccounts
in interface Ethereum
public Request<?,EthBlockNumber> ethBlockNumber()
ethBlockNumber
in interface Ethereum
public Request<?,EthGetBalance> ethGetBalance(java.lang.String address, DefaultBlockParameter defaultBlockParameter)
ethGetBalance
in interface Ethereum
public Request<?,EthGetStorageAt> ethGetStorageAt(java.lang.String address, java.math.BigInteger position, DefaultBlockParameter defaultBlockParameter)
ethGetStorageAt
in interface Ethereum
public Request<?,EthGetTransactionCount> ethGetTransactionCount(java.lang.String address, DefaultBlockParameter defaultBlockParameter)
ethGetTransactionCount
in interface Ethereum
public Request<?,EthGetBlockTransactionCountByHash> ethGetBlockTransactionCountByHash(java.lang.String blockHash)
ethGetBlockTransactionCountByHash
in interface Ethereum
public Request<?,EthGetBlockTransactionCountByNumber> ethGetBlockTransactionCountByNumber(DefaultBlockParameter defaultBlockParameter)
ethGetBlockTransactionCountByNumber
in interface Ethereum
public Request<?,EthGetUncleCountByBlockHash> ethGetUncleCountByBlockHash(java.lang.String blockHash)
ethGetUncleCountByBlockHash
in interface Ethereum
public Request<?,EthGetUncleCountByBlockNumber> ethGetUncleCountByBlockNumber(DefaultBlockParameter defaultBlockParameter)
ethGetUncleCountByBlockNumber
in interface Ethereum
public Request<?,EthGetCode> ethGetCode(java.lang.String address, DefaultBlockParameter defaultBlockParameter)
ethGetCode
in interface Ethereum
public Request<?,EthSign> ethSign(java.lang.String address, java.lang.String sha3HashOfDataToSign)
public Request<?,EthSendTransaction> ethSendTransaction(Transaction transaction)
ethSendTransaction
in interface Ethereum
public Request<?,EthSendTransaction> ethSendRawTransaction(java.lang.String signedTransactionData)
ethSendRawTransaction
in interface Ethereum
public Request<?,EthCall> ethCall(Transaction transaction, DefaultBlockParameter defaultBlockParameter)
public Request<?,EthEstimateGas> ethEstimateGas(Transaction transaction)
ethEstimateGas
in interface Ethereum
public Request<?,EthBlock> ethGetBlockByHash(java.lang.String blockHash, boolean returnFullTransactionObjects)
ethGetBlockByHash
in interface Ethereum
public Request<?,EthBlock> ethGetBlockByNumber(DefaultBlockParameter defaultBlockParameter, boolean returnFullTransactionObjects)
ethGetBlockByNumber
in interface Ethereum
public Request<?,EthTransaction> ethGetTransactionByHash(java.lang.String transactionHash)
ethGetTransactionByHash
in interface Ethereum
public Request<?,EthTransaction> ethGetTransactionByBlockHashAndIndex(java.lang.String blockHash, java.math.BigInteger transactionIndex)
ethGetTransactionByBlockHashAndIndex
in interface Ethereum
public Request<?,EthTransaction> ethGetTransactionByBlockNumberAndIndex(DefaultBlockParameter defaultBlockParameter, java.math.BigInteger transactionIndex)
ethGetTransactionByBlockNumberAndIndex
in interface Ethereum
public Request<?,EthGetTransactionReceipt> ethGetTransactionReceipt(java.lang.String transactionHash)
ethGetTransactionReceipt
in interface Ethereum
public Request<?,EthBlock> ethGetUncleByBlockHashAndIndex(java.lang.String blockHash, java.math.BigInteger transactionIndex)
ethGetUncleByBlockHashAndIndex
in interface Ethereum
public Request<?,EthBlock> ethGetUncleByBlockNumberAndIndex(DefaultBlockParameter defaultBlockParameter, java.math.BigInteger uncleIndex)
ethGetUncleByBlockNumberAndIndex
in interface Ethereum
public Request<?,EthGetCompilers> ethGetCompilers()
ethGetCompilers
in interface Ethereum
public Request<?,EthCompileLLL> ethCompileLLL(java.lang.String sourceCode)
ethCompileLLL
in interface Ethereum
public Request<?,EthCompileSolidity> ethCompileSolidity(java.lang.String sourceCode)
ethCompileSolidity
in interface Ethereum
public Request<?,EthCompileSerpent> ethCompileSerpent(java.lang.String sourceCode)
ethCompileSerpent
in interface Ethereum
public Request<?,EthFilter> ethNewFilter(EthFilter ethFilter)
ethNewFilter
in interface Ethereum
public Request<?,EthFilter> ethNewBlockFilter()
ethNewBlockFilter
in interface Ethereum
public Request<?,EthFilter> ethNewPendingTransactionFilter()
ethNewPendingTransactionFilter
in interface Ethereum
public Request<?,EthUninstallFilter> ethUninstallFilter(java.math.BigInteger filterId)
ethUninstallFilter
in interface Ethereum
public Request<?,EthLog> ethGetFilterChanges(java.math.BigInteger filterId)
ethGetFilterChanges
in interface Ethereum
public Request<?,EthLog> ethGetFilterLogs(java.math.BigInteger filterId)
ethGetFilterLogs
in interface Ethereum
public Request<?,EthLog> ethGetLogs(EthFilter ethFilter)
ethGetLogs
in interface Ethereum
public Request<?,EthGetWork> ethGetWork()
ethGetWork
in interface Ethereum
public Request<?,EthSubmitWork> ethSubmitWork(java.lang.String nonce, java.lang.String headerPowHash, java.lang.String mixDigest)
ethSubmitWork
in interface Ethereum
public Request<?,EthSubmitHashrate> ethSubmitHashrate(java.lang.String hashrate, java.lang.String clientId)
ethSubmitHashrate
in interface Ethereum
public Request<?,DbPutString> dbPutString(java.lang.String databaseName, java.lang.String keyName, java.lang.String stringToStore)
dbPutString
in interface Ethereum
public Request<?,DbGetString> dbGetString(java.lang.String databaseName, java.lang.String keyName)
dbGetString
in interface Ethereum
public Request<?,DbPutHex> dbPutHex(java.lang.String databaseName, java.lang.String keyName, java.lang.String dataToStore)
public Request<?,DbGetHex> dbGetHex(java.lang.String databaseName, java.lang.String keyName)
public Request<?,ShhVersion> shhVersion()
shhVersion
in interface Ethereum
public Request<?,ShhNewIdentity> shhNewIdentity()
shhNewIdentity
in interface Ethereum
public Request<?,ShhHasIdentity> shhHasIdentity(java.lang.String identityAddress)
shhHasIdentity
in interface Ethereum
public Request<?,ShhNewGroup> shhNewGroup()
shhNewGroup
in interface Ethereum
public Request<?,ShhAddToGroup> shhAddToGroup(java.lang.String identityAddress)
shhAddToGroup
in interface Ethereum
public Request<?,ShhNewFilter> shhNewFilter(ShhFilter shhFilter)
shhNewFilter
in interface Ethereum
public Request<?,ShhUninstallFilter> shhUninstallFilter(java.math.BigInteger filterId)
shhUninstallFilter
in interface Ethereum
public Request<?,ShhMessages> shhGetFilterChanges(java.math.BigInteger filterId)
shhGetFilterChanges
in interface Ethereum
public Request<?,ShhMessages> shhGetMessages(java.math.BigInteger filterId)
shhGetMessages
in interface Ethereum
public rx.Observable<NewHeadsNotification> newHeadsNotifications()
Web3jRx
newHeadsNotifications
in interface Web3jRx
public rx.Observable<LogNotification> logsNotifications(java.util.List<java.lang.String> addresses, java.util.List<java.lang.String> topics)
Web3jRx
logsNotifications
in interface Web3jRx
addresses
- only return logs from this list of address. Return logs from all addresses
if the list is emptytopics
- only return logs that match specified topics. Returns logs for all topics if
the list is emptypublic rx.Observable<java.lang.String> ethBlockHashObservable()
Web3jRx
ethBlockHashObservable
in interface Web3jRx
public rx.Observable<java.lang.String> ethPendingTransactionHashObservable()
Web3jRx
ethPendingTransactionHashObservable
in interface Web3jRx
public rx.Observable<Log> ethLogObservable(EthFilter ethFilter)
Web3jRx
ethLogObservable
in interface Web3jRx
ethFilter
- filter criteriapublic rx.Observable<Transaction> transactionObservable()
Web3jRx
transactionObservable
in interface Web3jRx
public rx.Observable<Transaction> pendingTransactionObservable()
Web3jRx
pendingTransactionObservable
in interface Web3jRx
public rx.Observable<EthBlock> blockObservable(boolean fullTransactionObjects)
Web3jRx
blockObservable
in interface Web3jRx
fullTransactionObjects
- if true, provides transactions embedded in blocks, otherwise
transaction hashespublic rx.Observable<EthBlock> replayBlocksObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects)
Web3jRx
replayBlocksObservable
in interface Web3jRx
startBlock
- block number to commence withendBlock
- block number to finish withfullTransactionObjects
- if true, provides transactions embedded in blocks, otherwise
transaction hashespublic rx.Observable<EthBlock> replayBlocksObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects, boolean ascending)
Web3jRx
replayBlocksObservable
in interface Web3jRx
startBlock
- block number to commence withendBlock
- block number to finish withfullTransactionObjects
- if true, provides transactions embedded in blocks, otherwise
transaction hashesascending
- if true, emits blocks in ascending order between range, otherwise
in descending orderpublic rx.Observable<Transaction> replayTransactionsObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock)
Web3jRx
replayTransactionsObservable
in interface Web3jRx
startBlock
- block number to commence withendBlock
- block number to finish withpublic rx.Observable<EthBlock> catchUpToLatestBlockObservable(DefaultBlockParameter startBlock, boolean fullTransactionObjects, rx.Observable<EthBlock> onCompleteObservable)
Web3jRx
To automatically subscribe to new blocks, use
Web3jRx.catchUpToLatestAndSubscribeToNewBlocksObservable(DefaultBlockParameter, boolean)
.
catchUpToLatestBlockObservable
in interface Web3jRx
startBlock
- the block number we wish to request fromfullTransactionObjects
- if we require full Transaction
objects to be provided
in the EthBlock
responsesonCompleteObservable
- a subsequent Observable that we wish to run once we are caught
up with the latest blockpublic rx.Observable<EthBlock> catchUpToLatestBlockObservable(DefaultBlockParameter startBlock, boolean fullTransactionObjects)
Web3jRx
catchUpToLatestBlockObservable
in interface Web3jRx
startBlock
- the block number we wish to request fromfullTransactionObjects
- if we require full Transaction
objects to be provided
in the EthBlock
responsespublic rx.Observable<Transaction> catchUpToLatestTransactionObservable(DefaultBlockParameter startBlock)
Web3jRx
catchUpToLatestTransactionObservable
in interface Web3jRx
startBlock
- the block number we wish to request frompublic rx.Observable<EthBlock> catchUpToLatestAndSubscribeToNewBlocksObservable(DefaultBlockParameter startBlock, boolean fullTransactionObjects)
Web3jRx
catchUpToLatestAndSubscribeToNewBlocksObservable
in interface Web3jRx
startBlock
- the block number we wish to request fromfullTransactionObjects
- if we require full Transaction
objects to be provided
in the EthBlock
responsespublic rx.Observable<Transaction> catchUpToLatestAndSubscribeToNewTransactionsObservable(DefaultBlockParameter startBlock)
Web3jRx
Web3jRx.catchUpToLatestAndSubscribeToNewBlocksObservable(DefaultBlockParameter, boolean)
,
except that all transactions contained within the blocks are emitted.catchUpToLatestAndSubscribeToNewTransactionsObservable
in interface Web3jRx
startBlock
- the block number we wish to request from