Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.canton.network/llms.txt

Use this file to discover all available pages before exploring further.

Common utilities for implementing the token APIs for Amulet.

Typeclasses

class ToAnyValue a where
Values that can be converted to AnyValue
toAnyValue : a -> AnyValue
instance ToAnyValue TimeLock instance ToAnyValue Bool instance ToAnyValue Decimal instance ToAnyValue Int instance ToAnyValue Text instance ToAnyValue (ContractId t) instance ToAnyValue Date instance ToAnyValue Party instance ToAnyValue Time instance ToAnyValue RelTime instance ToAnyValue ChoiceContext instance ToAnyValue a => ToAnyValue [a]
class FromAnyValue a where
Attempt to parse a value from AnyValue. If a type implements both ToAnyValue and FromAnyValue then it must hold that fromAnyValue (toAnyValue x) = Right x for all x.
fromAnyValue : AnyValue -> Either Text a
instance FromAnyValue TimeLock instance FromAnyValue Bool instance FromAnyValue Decimal instance FromAnyValue Int instance FromAnyValue Text instance Template t => FromAnyValue (ContractId t) instance FromAnyValue Date instance FromAnyValue Party instance FromAnyValue Time instance FromAnyValue RelTime instance FromAnyValue ChoiceContext instance FromAnyValue a => FromAnyValue [a]

Orphan Typeclass Instances

instance Semigroup Metadata instance Monoid Metadata

Data Types

data TxKind
Internal type for the transaction kind.
TxKind_Transfer
TxKind_Unlock
TxKind_MergeSplit
TxKind_Burn
TxKind_Mint
TxKind_ExpireDust
instance Eq TxKind

Functions

splicePrefix : Text
amuletPrefix : Text
amuletInstrumentId : Party -> InstrumentIdShared definition of the instrument-id used for amulets.
optionalMetadata : Text -> (a -> Text) -> Optional a -> TextMap Text -> TextMap TextAdd an optional metadata entry.
nonZeroMetadata : (Eq a, Additive a, Show a) => Text -> a -> TextMap Text -> TextMap TextAdd an metadata entry if it is non-zero number.
optionalNonZeroMetadata : (Eq a, Additive a, Show a) => Text -> Optional a -> TextMap Text -> TextMap TextAdd an metadata entry for an optional value if it is non-zero number.
createdInRoundMetaKey : Text
ratePerRoundMetaKey : Text
svRewardAmountMetaKey : Text
appRewardAmountMetaKey : Text
unclaimedActivityRecordAmountMetaKey : Text
validatorRewardAmountMetaKey : Text
appRewardBeneficiariesMetaKey : Text
appRewardBeneficiaryWeightsMetaKey : Text
developmentFundAmountMetaKey : Text
reasonMetaKey : TextShort, human-readable reason for the transaction.
txKindMetaKey : TextKind of the transaction.
senderMetaKey : TextThe sender of a transfer.
burnedMetaKey : TextThe amount of token holdings burned as part of a transaction.
holdingTxMeta : TxKind -> Optional Text -> Optional Party -> Optional Decimal -> MetadataBuild the metadata for a transaction affecting the amulet holdings.
txKindToText : TxKind -> TextExported for testing only
simpleHoldingTxMeta : TxKind -> Optional Text -> Optional Decimal -> MetadataSimplified version for a few of the common cases.
externalPartyConfigStateContextKey : Text
featuredAppRightContextKey : Text
transferPreapprovalContextKey : Text
lockContextKey : TextThe key used to embed all the lock specification in the choice context.
lockExpiresAtContextKey : Text
lockHoldersContextKey : Text
lockContextContextKey : TextThe context description of a lock.
expireLockKey : TextKey used to signal to a choice whether an expired locked amulet should be unlocked.
beneficiariesFromMetadata : Metadata -> Either Text (Optional [AppRewardBeneficiary])
parseCommaSeparated : Text -> (Text -> Optional a) -> Text -> Either Text [a]
addOptionalAnyValue : ToAnyValue a => Text -> Optional a -> TextMap AnyValue -> TextMap AnyValueConvenience function to create maps that contain an optional value if it is set. See its use sites for examples.
lookupFromContext : FromAnyValue a => ChoiceContext -> Text -> Either Text (Optional a)Lookup and decode a value within a choice context.
getFromContext : FromAnyValue a => ChoiceContext -> Text -> Either Text aGet a value from a choice context, failing if it is not present or fails to parse.
lookupFromContextU : FromAnyValue a => ChoiceContext -> Text -> Update (Optional a)Convenience version of lookupFromContext that raises the failure within the Update.
getFromContextU : FromAnyValue a => ChoiceContext -> Text -> Update aConvenience version of getFromContext that raises the failure within the Update.