org.ergoplatform.appkit.ColdErgoClient.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ergo-appkit_2.11 Show documentation
Show all versions of ergo-appkit_2.11 Show documentation
A Library for Polyglot Development of Ergo Applications
The newest version!
package org.ergoplatform.appkit
import java.util.function
import org.ergoplatform.restapi.client
import org.ergoplatform.appkit.impl.{ColdBlockchainContext, NodeInfoParameters}
import org.ergoplatform.restapi.client.NodeInfo
class ColdErgoClient(networkType: NetworkType, val params: BlockchainParameters) extends ErgoClient {
/**
* Convenience constructor for giving maxBlockCost
*/
def this(networkType: NetworkType, maxBlockCost: Int, blockVersion: Byte) {
this(networkType,
new NodeInfoParameters(
new NodeInfo()
.parameters(new client.Parameters()
.maxBlockCost(Integer.valueOf(maxBlockCost))
.blockVersion(Integer.valueOf(blockVersion))
)
)
)
}
override def execute[T](action: function.Function[BlockchainContext, T]): T = {
val ctx = new ColdBlockchainContext(networkType, params)
val res = action.apply(ctx)
res
}
override def getDataSource: BlockchainDataSource = ???
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy