Amount |
data class Amount : Comparable<Amount> Amount represents a positive quantity of currency, measured in pennies, which are the smallest representable units. |
Attachment |
interface Attachment : NamedByHash An attachment is a ZIP (or an optionally signed JAR) that contains one or more files. Attachments are meant to contain public static data which can be referenced from transactions and utilised from contracts. Good examples of how attachments are meant to be used include: |
AuthenticatedObject |
data class AuthenticatedObject<out T : Any> Wraps an object that was signed by a public key, which may be a well known/recognised institutional key. |
Command |
data class Command Command data/content plus pubkey pair: the signature is stored at the end of the serialized bytes |
CommandData |
interface CommandData Marker interface for classes that represent commands |
Contract |
interface Contract Implemented by a program that implements business logic on the shared ledger. All participants run this code for every LedgerTransaction they see on the network, for every input and output state. All contracts must accept the transaction for it to be accepted: failure of any aborts the entire thing. The time is taken from a trusted timestamp attached to the transaction itself i.e. it is NOT necessarily the current time. |
ContractFactory |
interface ContractFactory A contract factory knows how to lazily load and instantiate contract objects. |
ContractState |
interface ContractState A contract state (or just "state") contains opaque data used by a contract program. It can be thought of as a disk file that the program can use to persist data across transactions. States are immutable: once created they are never updated, instead, any changes must generate a new successor state. |
Fix |
data class Fix : CommandData A Fix represents a named interest rate, on a given day, for a given duration. It can be embedded in a tx. |
FixOf |
data class FixOf A FixOf identifies the question side of a fix: what day, tenor and type of fix ("LIBOR", "EURIBOR" etc) |
LedgerTransaction |
data class LedgerTransaction A LedgerTransaction wraps the data needed to calculate one or more successor states from a set of input states. It is the first step after extraction from a WireTransaction. The signatures at this point have been lined up with the commands from the wire, and verified/looked up. |
NamedByHash |
interface NamedByHash Implemented by anything that can be named by a secure hash value (e.g. transactions, attachments). |
OwnableState |
interface OwnableState : ContractState |
Party |
data class Party A Party is well known (name, pubkey) pair. In a real system this would probably be an X.509 certificate. |
PartyReference |
data class PartyReference Reference to something being stored or issued by a party e.g. in a vault or (more likely) on their normal ledger. The reference is intended to be encrypted so its meaningless to anyone other than the party. |
Requirements |
class Requirements |
SignedTransaction |
data class SignedTransaction : NamedByHash Container for a WireTransaction and attached signatures. |
StateAndRef |
data class StateAndRef<out T : ContractState> A StateAndRef is simply a (state, ref) pair. For instance, a wallet (which holds available assets) contains these. |
StateRef |
data class StateRef A stateref is a pointer (reference) to a state, this is an equivalent of an "outpoint" in Bitcoin. It records which transaction defined the state and where in that transaction it was. |
ThreadBox |
class ThreadBox<T> A threadbox is a simple utility that makes it harder to forget to take a lock before accessing some shared state. Simply define a private class to hold the data that must be grouped under the same lock, and then pass the only instance to the ThreadBox constructor. You can now use the locked method with a lambda to take the lock in a way that ensures itll be released if theres an exception. |
TimestampCommand |
data class TimestampCommand : CommandData If present in a transaction, contains a time that was verified by the timestamping authority/authorities whose public keys are identified in the containing Command object. The true time must be between (after, before) |
TransactionBuilder |
class TransactionBuilder A mutable transaction thats in the process of being built, before all signatures are present. |
TransactionForVerification |
data class TransactionForVerification A transaction in fully resolved and sig-checked form, ready for passing as input to a verification function. |
TransactionGraphSearch |
class TransactionGraphSearch : Callable<List<WireTransaction>> Given a map of transaction id to SignedTransaction, performs a breadth first search of the dependency graph from the starting point down in order to find transactions that match the given query criteria. |
TransactionGroup |
class TransactionGroup A TransactionGroup defines a directed acyclic graph of transactions that can be resolved with each other and then verified. Successful verification does not imply the non-existence of other conflicting transactions: simply that this subgraph does not contain conflicts and is accepted by the involved contracts. |
TransientProperty |
class TransientProperty<T> A simple wrapper that enables the use of Kotlins "val x by TransientProperty { ... }" syntax. Such a property will not be serialized to disk, and if its missing (or the first time its accessed), the initializer will be used to set it up. Note that the initializer will be called with the TransientProperty object locked. |
TypeOnlyCommandData |
abstract class TypeOnlyCommandData : CommandData Commands that inherit from this are intended to have no data items: its only their presence that matters. |
WireTransaction |
data class WireTransaction : NamedByHash Transaction ready for serialisation, without any signatures attached. |
TransactionConflictException |
class TransactionConflictException : Exception |
TransactionResolutionException |
class TransactionResolutionException : Exception |
TransactionVerificationException |
class TransactionVerificationException : Exception Thrown if a verification fails due to a contract rejection. |
UnknownContractException |
class UnknownContractException : Exception |
java.nio.file.Path | |
java.time.temporal.Temporal | |
kotlin.Double | |
kotlin.Int | |
kotlin.String | |
kotlin.collections.Iterable | |
kotlin.collections.List |
CHF |
val CHF: Currency |
GBP |
val GBP: Currency |
R |
val R: Requirements |
RunOnCallerThread |
val RunOnCallerThread: <ERROR CLASS> |
USD |
val USD: Currency |
currency |
fun currency(code: String): Currency Defines a simple domain specific language for the specificiation of financial contracts. Currently covers: |
extractZipFile |
fun extractZipFile(zipPath: Path, toPath: Path): Unit Given a path to a zip file, extracts it to the given directory. |
failure |
fun <T> <ERROR CLASS><T>.failure(executor: Executor, body: (Throwable) -> Unit): <ERROR CLASS> infix fun <T> <ERROR CLASS><T>.failure(body: (Throwable) -> Unit): <ERROR CLASS><T> |
hash |
fun ContractState.hash(): SecureHash Returns the SHA-256 hash of the serialised contents of this state (not cached) |
logElapsedTime |
fun <T> logElapsedTime(label: String, logger: <ERROR CLASS>? = null, body: () -> T): T |
random63BitValue |
fun random63BitValue(): Long Returns a random positive long generated using a secure RNG. This function sacrifies a bit of entropy in order to avoid potential bugs where the value is used in a context where negative numbers are not expected. |
requireThat |
fun <R> requireThat(body: Requirements.() -> R): R |
setFrom |
fun <T> <ERROR CLASS><T>.setFrom(logger: <ERROR CLASS>? = null, block: () -> T): <ERROR CLASS><T> Executes the given block and sets the future to either the result, or any exception that was thrown. |
success |
fun <T> <ERROR CLASS><T>.success(executor: Executor, body: (T) -> Unit): <ERROR CLASS> infix fun <T> <ERROR CLASS><T>.success(body: (T) -> Unit): <ERROR CLASS><T> |
then |
fun <T> <ERROR CLASS><T>.then(executor: Executor, body: () -> Unit): <ERROR CLASS> infix fun <T> <ERROR CLASS><T>.then(body: () -> Unit): <ERROR CLASS><T> |
toLedgerTransaction |
fun WireTransaction.toLedgerTransaction(identityService: IdentityService, attachmentStorage: AttachmentStorage): LedgerTransaction Looks up identities and attachments from storage to generate a LedgerTransaction. |
verifyToLedgerTransaction |
fun SignedTransaction.verifyToLedgerTransaction(identityService: IdentityService, attachmentStorage: AttachmentStorage): LedgerTransaction Calls verify to check all required signatures are present, and then uses the passed IdentityService to call WireTransaction.toLedgerTransaction to look up well known identities from pubkeys. |