FungibleAsset

Interface for contract states representing assets which are fungible, countable and issued by a specific party. States contain assets which are equivalent (such as cash of the same currency), so records of their existence can be merged or split as needed where the issuer is the same. For instance, dollars issued by the Fed are fungible and countable (in cents), barrels of West Texas crude are fungible and countable (oil from two small containers can be poured into one large container), shares of the same class in a specific company are fungible and countable, and so on.

An example usage would be a cash transaction contract that implements currency using state objects that implement this interface.

Parameters

T

a type that represents the asset in question. This should describe the basic type of the asset (GBP, USD, oil, shares in company , etc.) and any additional metadata (issuer, grade, class, etc.).

Inheritors

Properties

Link copied to clipboard
abstract override val amount: Amount<Issued<T>>

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

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
abstract val owner: AbstractParty

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

Link copied to clipboard

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
abstract 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
abstract fun withNewOwnerAndAmount(newAmount: Amount<Issued<T>>, newOwner: AbstractParty): FungibleAsset<T>

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