CommodityState

data class CommodityState(val amount: Amount<Issued<Commodity>>, val owner: AbstractParty) : FungibleAsset<Commodity>

A state representing a commodity claim against some party

Constructors

Link copied to clipboard
constructor(deposit: PartyAndReference, amount: Amount<Commodity>, owner: AbstractParty)
constructor(amount: Amount<Issued<Commodity>>, owner: AbstractParty)

Properties

Link copied to clipboard
open override val amount: Amount<Issued<Commodity>>

Amount represents a positive quantity of some issued product which can be cash, tokens, assets, or generally anything else that's quantifiable with integer quantities. See Issued and Amount for more details.

Link copied to clipboard
open override val exitKeys: Set<PublicKey>

There must be an ExitCommand signed by these keys to destroy the amount. While all states require their owner to sign, some (i.e. cash) also require the issuer.

Link copied to clipboard
open override val owner: AbstractParty

There must be a MoveCommand signed by this key to claim the amount

Link copied to clipboard
open override val participants: <Error class: unknown class>

A participant is any party that should be notified when the state is created or consumed.

Link copied to clipboard

Obtain the typename of the required ContractClass associated with the target ContractState, using the BelongsToContract annotation by default, but falling through to checking the state's enclosing class if there is one and it inherits from Contract.

Functions

Link copied to clipboard

Returns the SHA-256 hash of the serialised contents of this state (not cached!)

Returns the hash of the serialised contents of this state (not cached!)

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun withNewOwner(newOwner: AbstractParty): CommandAndState

Copies the underlying data structure, replacing the owner field with this new value and leaving the rest alone.

Link copied to clipboard

Copies the underlying data structure, replacing the amount and owner fields with the new values and leaving the rest (exitKeys) alone.