package web3j
This project is an idiomatic Scala wrapper around Web3J for Ethereum.
This project is built with Scala 2.12, and requires the Java 8 runtime; it is not yet compatible with Java 9.
This project promotes idiomatic Scala in the following ways:
- Variables and no-argument methods are actually names of properties, so
set
andget
prefixes are not used. This means some properties do not have exactly the same name as their Web3J counterpart. - Zero-argument methods only require parentheses if they perform side effects.
- Scala data types are used to the maximum extent that makes sense. For example, scala.concurrent.Future.
- A functional programming style is encouraged by always returning immutable data types from methods. For example, scala.collection.immutable.List
The Ethereum JSON-RPC documentation was the source of many the comments incorporated into this Scaladoc.
The JSON-RPC default block parameter
can represent a QUANTITY
or a TAG
.
Quantities are expressed as integer block numbers, and tags are strings with one of the values "latest", "earliest" or "pending".
The Java implementation
performs the same function as the underlying JSON-RPC implementation.
Whisper is an experimental communication protocol of the Ethereum P2P protocol suite that allows for messaging between users' DApps (Ethereum Distributed Applications). Whisper uses the same network that the blockchain runs on. The protocol is separate from the blockchain, so smart contracts do not have access to whispered messages.
EthBlock
and its internal types such as
Block,
TransactionObject and
TransactionResult
are returned by the following methods of com.micronautics.web3j.EthereumSynchronous and com.micronautics.web3j.EthereumASynchronous:
blockByHash
, blockByNumber
, uncleByBlockHashAndIndex
, uncleByBlockNumberAndIndex
.
- Source
- package.scala
- Alphabetic
- By Inheritance
- web3j
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final case class Address(value: String) extends AnyVal with Product with Serializable
- final case class BlockHash(value: String) extends AnyVal with Product with Serializable
- class Cmd extends AnyRef
- final case class Compiler(value: String) extends AnyVal with Product with Serializable
- final case class Digest(value: String) extends AnyVal with Product with Serializable
- final case class EtHash(value: String) extends AnyVal with Product with Serializable
-
class
Ether extends Ordered[Ether]
Wei are the smallest unit of currency and are always integers, never fractional quantities
-
class
EthereumASynchronous extends AnyRef
All of the methods in this class return a scala.concurrent.Future and do not block.
-
class
EthereumSynchronous extends AnyRef
All of the methods in this class block until a value is ready to be returned to the caller.
- final case class FilterId(value: BigInteger) extends AnyVal with Product with Serializable
-
sealed abstract final
class
InfuraNetwork extends Enum[InfuraNetwork]
From the web3j testnet docs: For development, its recommended you use the Rinkeby (geth only) or Kovan (Parity only) test networks.
From the web3j testnet docs: For development, its recommended you use the Rinkeby (geth only) or Kovan (Parity only) test networks. This is because they use a Proof of Authority (PoA) consensus mechanism, ensuring transactions and blocks are created in a consistent and timely manner. The Ropsten testnet, although closest to the Mainnet as it uses Proof of Work (PoW) consensus, has been subject to attacks in the past and tends to be more problematic for developers.
-
final
case class
Keccak256Hash(value: String) extends AnyVal with Product with Serializable
The SHA3 hash is more properly referred to as Keccak-256
- final case class LLLCompiled(value: String) extends AnyVal with Product with Serializable
- final case class LLLSource(value: String) extends AnyVal with Product with Serializable
-
final
case class
Nonce(value: BigInt) extends AnyVal with Product with Serializable
An account nonce is a transaction counter, provided by Ethereum for each Account.
An account nonce is a transaction counter, provided by Ethereum for each Account. Nonces prevent replay attacks wherein a transaction sending Ether from A to B can be replayed by B over and over to continually drain A's balance.
- See also
See Glossary
-
implicit
class
RichBlock extends AnyRef
Enriches
response.EthBlock.Block
with convenience methods - final case class SerpentCompiled(value: String) extends AnyVal with Product with Serializable
- final case class SerpentSource(value: String) extends AnyVal with Product with Serializable
- final case class Signature(value: String) extends AnyVal with Product with Serializable
- final case class SignedData(value: String) extends AnyVal with Product with Serializable
-
final
case class
SoliditySource(value: String) extends AnyVal with Product with Serializable
Web3J already has EthCompileSolidity.Code to represent Solidity compiled code
- final case class TransactionHash(value: String) extends AnyVal with Product with Serializable
-
class
Web3JScala extends AnyRef
Wrapper for Web3J