public class JsonRpc2_0Web3j extends java.lang.Object implements Web3j
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_BLOCK_TIME |
protected Web3jService |
web3jService |
| 构造器和说明 |
|---|
JsonRpc2_0Web3j(Web3jService web3jService) |
JsonRpc2_0Web3j(Web3jService web3jService,
long pollingInterval,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService) |
| 限定符和类型 | 方法和说明 |
|---|---|
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. those transactions that have been
submitted by a node, but don't yet form part of a block (haven't been mined yet).
|
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 在接口中 Ethereumpublic Request<?,NetVersion> netVersion()
netVersion 在接口中 Ethereumpublic Request<?,NetListening> netListening()
netListening 在接口中 Ethereumpublic Request<?,NetPeerCount> netPeerCount()
netPeerCount 在接口中 Ethereumpublic Request<?,EthProtocolVersion> ethProtocolVersion()
ethProtocolVersion 在接口中 Ethereumpublic Request<?,EthCoinbase> ethCoinbase()
ethCoinbase 在接口中 Ethereumpublic Request<?,EthSyncing> ethSyncing()
ethSyncing 在接口中 Ethereumpublic Request<?,EthHashrate> ethHashrate()
ethHashrate 在接口中 Ethereumpublic Request<?,EthGasPrice> ethGasPrice()
ethGasPrice 在接口中 Ethereumpublic Request<?,EthAccounts> ethAccounts()
ethAccounts 在接口中 Ethereumpublic Request<?,EthBlockNumber> ethBlockNumber()
ethBlockNumber 在接口中 Ethereumpublic Request<?,EthGetBalance> ethGetBalance(java.lang.String address, DefaultBlockParameter defaultBlockParameter)
ethGetBalance 在接口中 Ethereumpublic Request<?,EthGetStorageAt> ethGetStorageAt(java.lang.String address, java.math.BigInteger position, DefaultBlockParameter defaultBlockParameter)
ethGetStorageAt 在接口中 Ethereumpublic Request<?,EthGetTransactionCount> ethGetTransactionCount(java.lang.String address, DefaultBlockParameter defaultBlockParameter)
ethGetTransactionCount 在接口中 Ethereumpublic Request<?,EthGetBlockTransactionCountByHash> ethGetBlockTransactionCountByHash(java.lang.String blockHash)
ethGetBlockTransactionCountByHash 在接口中 Ethereumpublic Request<?,EthGetBlockTransactionCountByNumber> ethGetBlockTransactionCountByNumber(DefaultBlockParameter defaultBlockParameter)
ethGetBlockTransactionCountByNumber 在接口中 Ethereumpublic Request<?,EthGetUncleCountByBlockHash> ethGetUncleCountByBlockHash(java.lang.String blockHash)
ethGetUncleCountByBlockHash 在接口中 Ethereumpublic Request<?,EthGetUncleCountByBlockNumber> ethGetUncleCountByBlockNumber(DefaultBlockParameter defaultBlockParameter)
ethGetUncleCountByBlockNumber 在接口中 Ethereumpublic Request<?,EthGetCode> ethGetCode(java.lang.String address, DefaultBlockParameter defaultBlockParameter)
ethGetCode 在接口中 Ethereumpublic Request<?,EthSign> ethSign(java.lang.String address, java.lang.String sha3HashOfDataToSign)
public Request<?,EthSendTransaction> ethSendTransaction(Transaction transaction)
ethSendTransaction 在接口中 Ethereumpublic Request<?,EthSendTransaction> ethSendRawTransaction(java.lang.String signedTransactionData)
ethSendRawTransaction 在接口中 Ethereumpublic Request<?,EthCall> ethCall(Transaction transaction, DefaultBlockParameter defaultBlockParameter)
public Request<?,EthEstimateGas> ethEstimateGas(Transaction transaction)
ethEstimateGas 在接口中 Ethereumpublic Request<?,EthBlock> ethGetBlockByHash(java.lang.String blockHash, boolean returnFullTransactionObjects)
ethGetBlockByHash 在接口中 Ethereumpublic Request<?,EthBlock> ethGetBlockByNumber(DefaultBlockParameter defaultBlockParameter, boolean returnFullTransactionObjects)
ethGetBlockByNumber 在接口中 Ethereumpublic Request<?,EthTransaction> ethGetTransactionByHash(java.lang.String transactionHash)
ethGetTransactionByHash 在接口中 Ethereumpublic Request<?,EthTransaction> ethGetTransactionByBlockHashAndIndex(java.lang.String blockHash, java.math.BigInteger transactionIndex)
ethGetTransactionByBlockHashAndIndex 在接口中 Ethereumpublic Request<?,EthTransaction> ethGetTransactionByBlockNumberAndIndex(DefaultBlockParameter defaultBlockParameter, java.math.BigInteger transactionIndex)
public Request<?,EthGetTransactionReceipt> ethGetTransactionReceipt(java.lang.String transactionHash)
ethGetTransactionReceipt 在接口中 Ethereumpublic Request<?,EthBlock> ethGetUncleByBlockHashAndIndex(java.lang.String blockHash, java.math.BigInteger transactionIndex)
ethGetUncleByBlockHashAndIndex 在接口中 Ethereumpublic Request<?,EthBlock> ethGetUncleByBlockNumberAndIndex(DefaultBlockParameter defaultBlockParameter, java.math.BigInteger uncleIndex)
ethGetUncleByBlockNumberAndIndex 在接口中 Ethereumpublic Request<?,EthGetCompilers> ethGetCompilers()
ethGetCompilers 在接口中 Ethereumpublic Request<?,EthCompileLLL> ethCompileLLL(java.lang.String sourceCode)
ethCompileLLL 在接口中 Ethereumpublic Request<?,EthCompileSolidity> ethCompileSolidity(java.lang.String sourceCode)
ethCompileSolidity 在接口中 Ethereumpublic Request<?,EthCompileSerpent> ethCompileSerpent(java.lang.String sourceCode)
ethCompileSerpent 在接口中 Ethereumpublic Request<?,EthFilter> ethNewFilter(EthFilter ethFilter)
ethNewFilter 在接口中 Ethereumpublic Request<?,EthFilter> ethNewBlockFilter()
ethNewBlockFilter 在接口中 Ethereumpublic Request<?,EthFilter> ethNewPendingTransactionFilter()
ethNewPendingTransactionFilter 在接口中 Ethereumpublic Request<?,EthUninstallFilter> ethUninstallFilter(java.math.BigInteger filterId)
ethUninstallFilter 在接口中 Ethereumpublic Request<?,EthLog> ethGetFilterChanges(java.math.BigInteger filterId)
ethGetFilterChanges 在接口中 Ethereumpublic Request<?,EthLog> ethGetFilterLogs(java.math.BigInteger filterId)
ethGetFilterLogs 在接口中 Ethereumpublic Request<?,EthLog> ethGetLogs(EthFilter ethFilter)
ethGetLogs 在接口中 Ethereumpublic Request<?,EthGetWork> ethGetWork()
ethGetWork 在接口中 Ethereumpublic Request<?,EthSubmitWork> ethSubmitWork(java.lang.String nonce, java.lang.String headerPowHash, java.lang.String mixDigest)
ethSubmitWork 在接口中 Ethereumpublic Request<?,EthSubmitHashrate> ethSubmitHashrate(java.lang.String hashrate, java.lang.String clientId)
ethSubmitHashrate 在接口中 Ethereumpublic Request<?,DbPutString> dbPutString(java.lang.String databaseName, java.lang.String keyName, java.lang.String stringToStore)
dbPutString 在接口中 Ethereumpublic Request<?,DbGetString> dbGetString(java.lang.String databaseName, java.lang.String keyName)
dbGetString 在接口中 Ethereumpublic 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 在接口中 Ethereumpublic Request<?,ShhNewIdentity> shhNewIdentity()
shhNewIdentity 在接口中 Ethereumpublic Request<?,ShhHasIdentity> shhHasIdentity(java.lang.String identityAddress)
shhHasIdentity 在接口中 Ethereumpublic Request<?,ShhNewGroup> shhNewGroup()
shhNewGroup 在接口中 Ethereumpublic Request<?,ShhAddToGroup> shhAddToGroup(java.lang.String identityAddress)
shhAddToGroup 在接口中 Ethereumpublic Request<?,ShhNewFilter> shhNewFilter(ShhFilter shhFilter)
shhNewFilter 在接口中 Ethereumpublic Request<?,ShhUninstallFilter> shhUninstallFilter(java.math.BigInteger filterId)
shhUninstallFilter 在接口中 Ethereumpublic Request<?,ShhMessages> shhGetFilterChanges(java.math.BigInteger filterId)
shhGetFilterChanges 在接口中 Ethereumpublic Request<?,ShhMessages> shhGetMessages(java.math.BigInteger filterId)
shhGetMessages 在接口中 Ethereumpublic rx.Observable<NewHeadsNotification> newHeadsNotifications()
Web3jRxnewHeadsNotifications 在接口中 Web3jRxpublic rx.Observable<LogNotification> logsNotifications(java.util.List<java.lang.String> addresses, java.util.List<java.lang.String> topics)
Web3jRxlogsNotifications 在接口中 Web3jRxaddresses - 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()
Web3jRxethBlockHashObservable 在接口中 Web3jRxpublic rx.Observable<java.lang.String> ethPendingTransactionHashObservable()
Web3jRxethPendingTransactionHashObservable 在接口中 Web3jRxpublic rx.Observable<Log> ethLogObservable(EthFilter ethFilter)
Web3jRxethLogObservable 在接口中 Web3jRxethFilter - filter criteriapublic rx.Observable<Transaction> transactionObservable()
Web3jRxtransactionObservable 在接口中 Web3jRxpublic rx.Observable<Transaction> pendingTransactionObservable()
Web3jRxpendingTransactionObservable 在接口中 Web3jRxpublic rx.Observable<EthBlock> blockObservable(boolean fullTransactionObjects)
Web3jRxblockObservable 在接口中 Web3jRxfullTransactionObjects - if true, provides transactions embedded in blocks, otherwise
transaction hashespublic rx.Observable<EthBlock> replayBlocksObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock, boolean fullTransactionObjects)
Web3jRxreplayBlocksObservable 在接口中 Web3jRxstartBlock - 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)
Web3jRxreplayBlocksObservable 在接口中 Web3jRxstartBlock - 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)
Web3jRxreplayTransactionsObservable 在接口中 Web3jRxstartBlock - block number to commence withendBlock - block number to finish withpublic rx.Observable<EthBlock> catchUpToLatestBlockObservable(DefaultBlockParameter startBlock, boolean fullTransactionObjects, rx.Observable<EthBlock> onCompleteObservable)
Web3jRxTo automatically subscribe to new blocks, use
Web3jRx.catchUpToLatestAndSubscribeToNewBlocksObservable(DefaultBlockParameter, boolean).
catchUpToLatestBlockObservable 在接口中 Web3jRxstartBlock - 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)
Web3jRxcatchUpToLatestBlockObservable 在接口中 Web3jRxstartBlock - 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)
Web3jRxcatchUpToLatestTransactionObservable 在接口中 Web3jRxstartBlock - the block number we wish to request frompublic rx.Observable<EthBlock> catchUpToLatestAndSubscribeToNewBlocksObservable(DefaultBlockParameter startBlock, boolean fullTransactionObjects)
Web3jRxcatchUpToLatestAndSubscribeToNewBlocksObservable 在接口中 Web3jRxstartBlock - 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)
Web3jRxWeb3jRx.catchUpToLatestAndSubscribeToNewBlocksObservable(DefaultBlockParameter, boolean),
except that all transactions contained within the blocks are emitted.catchUpToLatestAndSubscribeToNewTransactionsObservable 在接口中 Web3jRxstartBlock - the block number we wish to request from