
com.github.jleskovar.btcrpc.websocket.WrappedWebSocketBtcClient.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of btc-rpc-client Show documentation
Show all versions of btc-rpc-client Show documentation
Kotlin-based JSON-RPC client for bitcoind/btcd
The newest version!
package com.github.jleskovar.btcrpc.websocket
import com.github.jleskovar.btcrpc.*
import java.math.BigDecimal
class WrappedWebSocketBtcClient(
private val username: String,
private val password: String,
private val delegate: BitcoinRpcClient,
private val jsonWebSocketRpcClient: JsonWebSocketRpcClient
) : WebSocketBitcoinRpcClient {
override fun connect() {
jsonWebSocketRpcClient.connect()
// Authenticate as soon as web socket is open (btcd)
delegate.btcdAuthenticate(username, password)
}
override fun disconnect() {
jsonWebSocketRpcClient.disconnect()
}
override fun btcdAuthenticate(username: String, password: String) {
delegate.btcdAuthenticate(username, password)
}
override fun btcdGenerate(numberOfBlocks: Int): List {
return delegate.btcdGenerate(numberOfBlocks)
}
override fun btcdGetBlockWithTransactions(blockHash: String, verbose: Boolean): String {
return delegate.btcdGetBlockWithTransactions(blockHash, verbose)
}
override fun abandonTransaction(transactionId: String) {
delegate.abandonTransaction(transactionId)
}
override fun abortRescan() {
delegate.abortRescan()
}
override fun addMultiSigAddress(required: Int?, keys: List): String {
return delegate.addMultiSigAddress(required, keys)
}
override fun addNode(address: String, operation: NodeListOperation) {
delegate.addNode(address, operation)
}
override fun backupWallet(destination: String) {
delegate.backupWallet(destination)
}
override fun clearBanned() {
delegate.clearBanned()
}
override fun createMultiSig(required: Int, keys: List): MultiSigAddress {
return delegate.createMultiSig(required, keys)
}
override fun createRawTransaction(inputs: List, outputs: Map, lockTime: Int?, replaceable: Boolean?): String {
return delegate.createRawTransaction(inputs, outputs, lockTime, replaceable)
}
override fun decodeRawTransaction(transactionId: String): Transaction {
return delegate.decodeRawTransaction(transactionId)
}
override fun decodeScript(scriptHex: String): DecodedScript {
return delegate.decodeScript(scriptHex)
}
override fun disconnectNode(nodeAddress: String?, nodeId: Int?) {
delegate.disconnectNode(nodeAddress, nodeId)
}
override fun dumpPrivateKey(address: String): String {
return delegate.dumpPrivateKey(address)
}
override fun dumpWallet(filename: String): Map<*, *> {
return delegate.dumpWallet(filename)
}
override fun encryptWallet(passphrase: String) {
delegate.encryptWallet(passphrase)
}
override fun generate(numberOfBlocks: Int, maxTries: Int?): List {
return delegate.generate(numberOfBlocks, maxTries)
}
override fun getAddedNodeInfo(): List {
return delegate.getAddedNodeInfo()
}
override fun getBalance(account: String, minconf: Int, includeWatchOnly: Boolean): BigDecimal {
return delegate.getBalance(account, minconf, includeWatchOnly)
}
override fun getBestBlockhash(): String {
return delegate.getBestBlockhash()
}
override fun getBlockData(blockHash: String, verbosity: Int): String {
return delegate.getBlockData(blockHash, verbosity)
}
override fun getBlock(blockHash: String, verbosity: Int): BlockInfo {
return delegate.getBlock(blockHash, verbosity)
}
override fun getBlockWithTransactions(blockHash: String, verbosity: Int): BlockInfoWithTransactions {
return delegate.getBlockWithTransactions(blockHash, verbosity)
}
override fun getBlockchainInfo(): BlockChainInfo {
return delegate.getBlockchainInfo()
}
override fun getBlockCount(): Int {
return delegate.getBlockCount()
}
override fun getBlockHash(height: Int): String {
return delegate.getBlockHash(height)
}
override fun getBlockHeader(blockHash: String, verbose: Boolean?): Any {
return delegate.getBlockHeader(blockHash, verbose)
}
override fun getBlockTemplate(blockTemplateRequest: BlockTemplateRequest?) {
delegate.getBlockTemplate(blockTemplateRequest)
}
override fun getChainTips(): List {
return delegate.getChainTips()
}
override fun getChainTransactionStats(blockWindowSize: Int?, blockHashEnd: String?): ChainTransactionStats {
return delegate.getChainTransactionStats(blockWindowSize, blockHashEnd)
}
override fun getConnectionCount(): Int {
return delegate.getConnectionCount()
}
override fun getDifficulty(): BigDecimal {
return delegate.getDifficulty()
}
override fun getMemoryInfo(): Any {
return delegate.getMemoryInfo()
}
override fun getMempoolAncestors(transactionId: String): Any {
return delegate.getMempoolAncestors(transactionId)
}
override fun getMempoolDescendants(): Any {
return delegate.getMempoolDescendants()
}
override fun getMempoolEntry(transactionId: String): Map<*, *> {
return delegate.getMempoolEntry(transactionId)
}
override fun getMempoolInfo(): MemPoolInfo {
return delegate.getMempoolInfo()
}
override fun getMiningInfo(): MiningInfo {
return delegate.getMiningInfo()
}
override fun getNetworkTotals(): NetworkTotals {
return delegate.getNetworkTotals()
}
override fun getNetworkHashesPerSeconds(lastBlocks: Int, height: Int): Long {
return delegate.getNetworkHashesPerSeconds(lastBlocks, height)
}
override fun getNetworkInfo(): NetworkInfo {
return delegate.getNetworkInfo()
}
override fun getNewAddress(): String {
return delegate.getNewAddress()
}
override fun getPeerInfo(): List {
return delegate.getPeerInfo()
}
override fun getRawChangeAddress(): String {
return delegate.getRawChangeAddress()
}
override fun getRawMemPool(verbose: Boolean): List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy