Splice.Api.Token.MetadataV1

Types and interfaces for retrieving metadata about tokens.

Interfaces

interface AnyContract

Interface used to represent arbitrary contracts. Note that this is not expected to be implemented by any template, so it should only be used in the form ContractId AnyContract and through coerceContractId but not through any of the interface functions like fetchFromInterface that check whether the template actually implements the interface.

viewtype AnyContractView

  • Choice Archive

    Controller: Signatories of implementing template

    Returns: ()

    (no fields)

Data Types

type AnyContractId

= ContractId AnyContract

A reference to some contract id. Use coerceContractId to convert from and to this type.

data AnyContractView

Not used. See the AnyContract interface for more information.

AnyContractView

(no fields)

instance HasFromAnyView AnyContract AnyContractView

instance HasInterfaceView AnyContract AnyContractView

data AnyValue

A generic representation of serializable Daml values.

Used to pass arbitrary data across interface boundaries. For example to pass data from an an app backend to an interface choice implementation.

AV_Text Text

AV_Int Int

AV_Decimal Decimal

AV_Bool Bool

AV_Date Date

AV_Time Time

AV_RelTime RelTime

AV_Party Party

AV_ContractId AnyContractId

AV_List [AnyValue]

AV_Map (TextMap AnyValue)

instance Eq AnyValue

instance Show AnyValue

instance GetField "values" ChoiceContext (TextMap AnyValue)

instance SetField "values" ChoiceContext (TextMap AnyValue)

data ChoiceContext

A type for passing extra data from an app’s backends to the choices of that app exercised in commands submitted by app users.

ChoiceContext

Field

Type

Description

values

TextMap AnyValue

The values passed in by the app backend to the choice. The keys are considered internal to the app and should not be read by third-party code.

instance Eq ChoiceContext

instance Show ChoiceContext

instance GetField "context" ExtraArgs ChoiceContext

instance GetField "values" ChoiceContext (TextMap AnyValue)

instance SetField "context" ExtraArgs ChoiceContext

instance SetField "values" ChoiceContext (TextMap AnyValue)

data ChoiceExecutionMetadata

A generic result for choices that do not need to return specific data.

ChoiceExecutionMetadata

Field

Type

Description

meta

Metadata

Additional metadata specific to the result of exercising the choice, used for extensibility.

instance Eq ChoiceExecutionMetadata

instance Show ChoiceExecutionMetadata

instance GetField "meta" ChoiceExecutionMetadata Metadata

instance SetField "meta" ChoiceExecutionMetadata Metadata

data ExtraArgs

A common type for passing both the choice context and the metadata to a choice.

ExtraArgs

Field

Type

Description

context

ChoiceContext

Extra arguments to be passed to the implementation of an interface choice. These are provided via an off-ledger API by the app implementing the interface.

meta

Metadata

Additional metadata to pass in. In contrast to the extraArgs, these are provided by the caller of the choice. The expectation is that the meaning of metadata fields will be agreed on in later standards, or on a case-by-case basis between the caller and the implementer of the interface.

instance Eq ExtraArgs

instance Show ExtraArgs

instance GetField "context" ExtraArgs ChoiceContext

instance GetField "meta" ExtraArgs Metadata

instance SetField "context" ExtraArgs ChoiceContext

instance SetField "meta" ExtraArgs Metadata

data Metadata

Machine-readable metadata intended for communicating additional information using well-known keys between systems. This is mainly used to allow for the post-hoc expansion of the information associated with contracts and choice arguments and results.

Modeled after by k8s support for annotations: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/(https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/).

Implementors SHOULD follow the same conventions for allocating keys as used by k8s; i.e., they SHOULD be prefixed using the DNS name of the app defining the key.

Implementors SHOULD keep metadata small, as on-ledger data is costly.

Metadata

Field

Type

Description

values

TextMap Text

Key-value pairs of metadata entries.

instance Eq Metadata

instance Ord Metadata

instance Show Metadata

instance GetField "meta" ChoiceExecutionMetadata Metadata

instance GetField "meta" ExtraArgs Metadata

instance GetField "values" Metadata (TextMap Text)

instance SetField "meta" ChoiceExecutionMetadata Metadata

instance SetField "meta" ExtraArgs Metadata

instance SetField "values" Metadata (TextMap Text)

Functions

emptyChoiceContext

: ChoiceContext

Empty choice context.

emptyMetadata

: Metadata

Empty metadata.

Comments