Canton Network docsDaml Script › Modules
Daml.Script
Updated 24-11-2026
Daml module
Daml.Script
The Daml Script testing library.
DamlUpdated 3.7.3
ModuleDaml.Script
Latest release3.7.4
Data Types
data UserRight
The rights of a user.
Constructors:
ParticipantAdmin
CanActAs Party
CanReadAs Party
CanReadAsAnyParty
CanExecuteAs Party
CanExecuteAsAnyParty
CanActAsAnyParty
- instance
IsQuestionGrantUserRights(Optional[UserRight]) - instance
IsQuestionListUserRights(Optional[UserRight]) - instance
IsQuestionRevokeUserRights(Optional[UserRight]) - instance
EqUserRight - instance
ShowUserRight - instance
GetFieldrightsCreateUser[UserRight] - instance
GetFieldrightsGrantUserRights[UserRight] - instance
GetFieldrightsRevokeUserRights[UserRight] - instance
SetFieldrightsCreateUser[UserRight] - instance
SetFieldrightsGrantUserRights[UserRight] - instance
SetFieldrightsRevokeUserRights[UserRight]
data UserNotFound
Thrown if a user cannot be located for a given user identifier.
Constructors:
UserNotFound
- instance
EqUserNotFound - instance
ShowUserNotFound - instance
HasFromAnyExceptionUserNotFound - instance
HasMessageUserNotFound - instance
HasThrowUserNotFound - instance
HasToAnyExceptionUserNotFound - instance
GetFieldmessageUserNotFoundText - instance
GetFielduserIdUserNotFoundUserId - instance
SetFielduserIdUserNotFoundUserId
data User
User-info record for a user in the user management service.
Constructors:
User
- instance
IsQuestionGetUser(OptionalUser) - instance
IsQuestionListAllUsers[User] - instance
EqUser - instance
OrdUser - instance
ShowUser - instance
GetFieldprimaryPartyUser(OptionalParty) - instance
GetFielduserCreateUserUser - instance
GetFielduserIdUserUserId - instance
SetFieldprimaryPartyUser(OptionalParty) - instance
SetFielduserCreateUserUser - instance
SetFielduserIdUserUserId
data UserAlreadyExists
Thrown if a user to be created already exists.
Constructors:
UserAlreadyExists
- instance
EqUserAlreadyExists - instance
ShowUserAlreadyExists - instance
HasFromAnyExceptionUserAlreadyExists - instance
HasMessageUserAlreadyExists - instance
HasThrowUserAlreadyExists - instance
HasToAnyExceptionUserAlreadyExists - instance
GetFieldmessageUserAlreadyExistsText - instance
GetFielduserIdUserAlreadyExistsUserId - instance
SetFielduserIdUserAlreadyExistsUserId
data UserId
Identifier for a user in the user management service.
Constructors:
UserId Text
- instance
EqUserId - instance
OrdUserId - instance
ShowUserId - instance
GetFielduserIdDeleteUserUserId - instance
GetFielduserIdGetUserUserId - instance
GetFielduserIdGrantUserRightsUserId - instance
GetFielduserIdListUserRightsUserId - instance
GetFielduserIdRevokeUserRightsUserId - instance
GetFielduserIdUserUserId - instance
GetFielduserIdUserAlreadyExistsUserId - instance
GetFielduserIdUserNotFoundUserId - instance
SetFielduserIdDeleteUserUserId - instance
SetFielduserIdGetUserUserId - instance
SetFielduserIdGrantUserRightsUserId - instance
SetFielduserIdListUserRightsUserId - instance
SetFielduserIdRevokeUserRightsUserId - instance
SetFielduserIdUserUserId - instance
SetFielduserIdUserAlreadyExistsUserId - instance
SetFielduserIdUserNotFoundUserId
data InvalidUserId
Thrown if text for a user identifier does not conform to the format restriction.
Constructors:
InvalidUserId
- instance
EqInvalidUserId - instance
ShowInvalidUserId - instance
HasFromAnyExceptionInvalidUserId - instance
HasMessageInvalidUserId - instance
HasThrowInvalidUserId - instance
HasToAnyExceptionInvalidUserId - instance
GetFieldmInvalidUserIdText - instance
GetFieldmessageInvalidUserIdText - instance
SetFieldmInvalidUserIdText
data ConcurrentSubmits a
Applicative that allows for multiple concurrent transaction submissions
See concurrently for usage of this type.
Instances:
- instance
ScriptSubmitConcurrentSubmits - instance
FunctorConcurrentSubmits - instance
ApplicativeConcurrentSubmits - instance
GetFieldcontinue(ConcurrentSubmitsa) ([EitherSubmitError([CommandResult],TransactionTree)] ->a) - instance
GetFieldsubmits(ConcurrentSubmitsa) [Submission] - instance
SetFieldcontinue(ConcurrentSubmitsa) ([EitherSubmitError([CommandResult],TransactionTree)] ->a) - instance
SetFieldsubmits(ConcurrentSubmitsa) [Submission]
data PackageId
Package-id newtype for package preference
Constructors:
PackageId Text
- instance
EqPackageId - instance
ShowPackageId - instance
GetFieldsPackagePreferenceSubmission(Optional[PackageId]) - instance
SetFieldsPackagePreferenceSubmission(Optional[PackageId])
data SubmitOptions
Options to detemine the stakeholders of a transaction, as well as disclosures.
Intended to be specified using the actAs, readAs and disclose builders, combined using the Semigroup concat (<>) operator.
actAs alice <> readAs [alice, bob] <> disclose myContract
signatory, see their docs for examples.
All submissions must specify at least one actAs party, else a runtime error will be thrown.
A minimum submission may look like
actAs alice `submit` createCmd MyContract with party = alice
SubmitOptions to
submit, which will represent the actAs field.
The above example could be reduced to
alice `submit` createCmd MyContract with party = alice
- instance
IsSubmitOptionsSubmitOptions - instance
MonoidSubmitOptions - instance
SemigroupSubmitOptions
data ExercisedIndexPayload t
Constructors:
ExercisedIndexPayload
- instance
GetFieldchild(ExercisedIndexPayloadt) (TreeIndext) - instance
GetFieldchoice(ExercisedIndexPayloadt)Text - instance
GetFieldoffset(ExercisedIndexPayloadt)Int - instance
GetFieldtemplateId(ExercisedIndexPayloadt)TemplateTypeRep - instance
SetFieldchild(ExercisedIndexPayloadt) (TreeIndext) - instance
SetFieldchoice(ExercisedIndexPayloadt)Text - instance
SetFieldoffset(ExercisedIndexPayloadt)Int - instance
SetFieldtemplateId(ExercisedIndexPayloadt)TemplateTypeRep
data TreeIndex t
Constructors:
CreatedIndex (CreatedIndexPayload t)
ExercisedIndex (ExercisedIndexPayload t)
- instance
GetFieldchild(ExercisedIndexPayloadt) (TreeIndext) - instance
SetFieldchild(ExercisedIndexPayloadt) (TreeIndext)
data TransactionTree
Constructors:
TransactionTree
- instance
IsQuestionSubmit[EitherSubmitError([CommandResult],TransactionTree)] - instance
ShowTransactionTree - instance
GetFieldcontinue(ConcurrentSubmitsa) ([EitherSubmitError([CommandResult],TransactionTree)] ->a) - instance
GetFieldrootEventsTransactionTree[TreeEvent] - instance
SetFieldcontinue(ConcurrentSubmitsa) ([EitherSubmitError([CommandResult],TransactionTree)] ->a) - instance
SetFieldrootEventsTransactionTree[TreeEvent]
data Exercised
Constructors:
Exercised
- instance
ShowExercised - instance
GetFieldargumentExercisedAnyChoice - instance
GetFieldchildEventsExercised[TreeEvent] - instance
GetFieldchoiceExercisedText - instance
GetFieldcontractIdExercisedAnyContractId - instance
SetFieldargumentExercisedAnyChoice - instance
SetFieldchildEventsExercised[TreeEvent] - instance
SetFieldchoiceExercisedText - instance
SetFieldcontractIdExercisedAnyContractId
data TreeEvent
Constructors:
CreatedEvent Created
ExercisedEvent Exercised
- instance
ShowTreeEvent - instance
GetFieldchildEventsExercised[TreeEvent] - instance
GetFieldrootEventsTransactionTree[TreeEvent] - instance
SetFieldchildEventsExercised[TreeEvent] - instance
SetFieldrootEventsTransactionTree[TreeEvent]
data CreatedIndexPayload t
Constructors:
CreatedIndexPayload
- instance
GetFieldoffset(CreatedIndexPayloadt)Int - instance
GetFieldtemplateId(CreatedIndexPayloadt)TemplateTypeRep - instance
SetFieldoffset(CreatedIndexPayloadt)Int - instance
SetFieldtemplateId(CreatedIndexPayloadt)TemplateTypeRep
data Created
Constructors:
Created
- instance
ShowCreated - instance
GetFieldargumentCreatedAnyTemplate - instance
GetFieldcontractIdCreatedAnyContractId - instance
SetFieldargumentCreatedAnyTemplate - instance
SetFieldcontractIdCreatedAnyContractId
type CryptoErrorType
= AnyCryptoErrorType
Backwards compatibility alias
type DevErrorType
= AnyDevErrorType
Backwards compatibility alias
type ExternalCallErrorType
= AnyExternalCallErrorType
Backwards compatibility alias
type SubmitError
= AnySubmitError
Backwards compatibility alias
Instances:
- instance
IsQuestionSubmit[EitherSubmitError([CommandResult],TransactionTree)] - instance
ShowSubmitError - instance
GetFieldcontinue(ConcurrentSubmitsa) ([EitherSubmitError([CommandResult],TransactionTree)] ->a) - instance
SetFieldcontinue(ConcurrentSubmitsa) ([EitherSubmitError([CommandResult],TransactionTree)] ->a)
type UpgradeErrorType
= AnyUpgradeErrorType
Backwards compatibility alias
Instances:
- instance
ShowUpgradeErrorType
data AuthenticationFailedUpgradeError
Constructors:
AuthenticationFailedUpgradeError
- instance
IsUpgradeErrorTypeAuthenticationFailedUpgradeError - instance
GetFieldcoidAuthenticationFailedUpgradeErrorAnyContractId - instance
GetFieldcreateArgAuthenticationFailedUpgradeErrorAnyTemplate - instance
GetFielddstTemplateIdAuthenticationFailedUpgradeErrorTemplateTypeRep - instance
GetFieldsrcTemplateIdAuthenticationFailedUpgradeErrorTemplateTypeRep - instance
SetFieldcoidAuthenticationFailedUpgradeErrorAnyContractId - instance
SetFieldcreateArgAuthenticationFailedUpgradeErrorAnyTemplate - instance
SetFielddstTemplateIdAuthenticationFailedUpgradeErrorTemplateTypeRep - instance
SetFieldsrcTemplateIdAuthenticationFailedUpgradeErrorTemplateTypeRep
data AuthorizationErrorSubmitError
Generic authorization failure, included missing party authority, invalid signatories, etc.
Constructors:
AuthorizationErrorSubmitError
- instance
IsSubmitErrorAuthorizationErrorSubmitError - instance
GetFieldauthorizationErrorMessageAuthorizationErrorSubmitErrorText - instance
SetFieldauthorizationErrorMessageAuthorizationErrorSubmitErrorText
data ChoiceGuardFailedDevError
Constructors:
ChoiceGuardFailedDevError
- instance
IsDevErrorTypeChoiceGuardFailedDevError
data ContractDoesNotImplementInterfaceSubmitError
Attempted to use a contract as an interface that it does not implement
Constructors:
ContractDoesNotImplementInterfaceSubmitError
- instance
IsSubmitErrorContractDoesNotImplementInterfaceSubmitError - instance
GetFieldcontractIdContractDoesNotImplementInterfaceSubmitErrorAnyContractId - instance
GetFieldinterfaceIdContractDoesNotImplementInterfaceSubmitErrorTemplateTypeRep - instance
GetFieldtemplateIdContractDoesNotImplementInterfaceSubmitErrorTemplateTypeRep - instance
SetFieldcontractIdContractDoesNotImplementInterfaceSubmitErrorAnyContractId - instance
SetFieldinterfaceIdContractDoesNotImplementInterfaceSubmitErrorTemplateTypeRep - instance
SetFieldtemplateIdContractDoesNotImplementInterfaceSubmitErrorTemplateTypeRep
data ContractDoesNotImplementRequiringInterfaceSubmitError
Attempted to use a contract as a required interface that it does not implement
Constructors:
ContractDoesNotImplementRequiringInterfaceSubmitError
- instance
IsSubmitErrorContractDoesNotImplementRequiringInterfaceSubmitError - instance
GetFieldcontractIdContractDoesNotImplementRequiringInterfaceSubmitErrorAnyContractId - instance
GetFieldrequiredInterfaceIdContractDoesNotImplementRequiringInterfaceSubmitErrorTemplateTypeRep - instance
GetFieldrequiringInterfaceIdContractDoesNotImplementRequiringInterfaceSubmitErrorTemplateTypeRep - instance
GetFieldtemplateIdContractDoesNotImplementRequiringInterfaceSubmitErrorTemplateTypeRep - instance
SetFieldcontractIdContractDoesNotImplementRequiringInterfaceSubmitErrorAnyContractId - instance
SetFieldrequiredInterfaceIdContractDoesNotImplementRequiringInterfaceSubmitErrorTemplateTypeRep - instance
SetFieldrequiringInterfaceIdContractDoesNotImplementRequiringInterfaceSubmitErrorTemplateTypeRep - instance
SetFieldtemplateIdContractDoesNotImplementRequiringInterfaceSubmitErrorTemplateTypeRep
data ContractHashingErrorSubmitError
Failed to hash a contract
Constructors:
ContractHashingErrorSubmitError
- instance
IsSubmitErrorContractHashingErrorSubmitError - instance
GetFieldcontractIdContractHashingErrorSubmitErrorAnyContractId - instance
GetFieldcreateArgContractHashingErrorSubmitErrorAnyTemplate - instance
GetFielddstTemplateIdContractHashingErrorSubmitErrorTemplateTypeRep - instance
GetFielderrorMessageContractHashingErrorSubmitErrorText - instance
SetFieldcontractIdContractHashingErrorSubmitErrorAnyContractId - instance
SetFieldcreateArgContractHashingErrorSubmitErrorAnyTemplate - instance
SetFielddstTemplateIdContractHashingErrorSubmitErrorTemplateTypeRep - instance
SetFielderrorMessageContractHashingErrorSubmitErrorText
data ContractIdComparabilitySubmitError
Attempted to compare incomparable contract IDs. You’re doing something very wrong.
Two contract IDs with the same prefix are incomparable if one of them is local and the other non-local
or if one is relative and the other relative or absolute with a different suffix.
Constructors:
ContractIdComparabilitySubmitError
- instance
IsSubmitErrorContractIdComparabilitySubmitError - instance
GetFieldglobalExistingContractIdContractIdComparabilitySubmitErrorText - instance
SetFieldglobalExistingContractIdContractIdComparabilitySubmitErrorText
data ContractIdInContractKeySubmitError
Illegal Contract ID found in Contract Key
Constructors:
ContractIdInContractKeySubmitError
data ContractKeyNotFoundSubmitError
Contract with given contract key could not be found
Constructors:
ContractKeyNotFoundSubmitError
- instance
IsSubmitErrorContractKeyNotFoundSubmitError - instance
GetFieldcontractKeyContractKeyNotFoundSubmitErrorAnyContractKey - instance
SetFieldcontractKeyContractKeyNotFoundSubmitErrorAnyContractKey
data ContractNotFoundSubmitError
Contract with given contract ID could not be found, and has never existed on this participant
When run on Canton, there may be more than one contract ID, and additionalDebuggingInfo is always None
On the other hand, when run on IDELedger, there is only ever one contract ID, and additionalDebuggingInfo is always Some
Constructors:
ContractNotFoundSubmitError
Provided as text, as we do not know the template ID of a contract if the lookup fails
should always be None in Canton’s case, see https://github.com/digital-asset/daml/issues/17154
- instance
IsSubmitErrorContractNotFoundSubmitError - instance
GetFieldadditionalDebuggingInfoContractNotFoundSubmitError(OptionalContractNotFoundAdditionalInfo) - instance
GetFieldunknownContractIdsContractNotFoundSubmitError(NonEmptyText) - instance
SetFieldadditionalDebuggingInfoContractNotFoundSubmitError(OptionalContractNotFoundAdditionalInfo) - instance
SetFieldunknownContractIdsContractNotFoundSubmitError(NonEmptyText)
data CreateEmptyContractKeyMaintainersSubmitError
Attempted to create a contract with empty contract key maintainers
Constructors:
CreateEmptyContractKeyMaintainersSubmitError
- instance
IsSubmitErrorCreateEmptyContractKeyMaintainersSubmitError - instance
GetFieldinvalidTemplateCreateEmptyContractKeyMaintainersSubmitErrorAnyTemplate - instance
SetFieldinvalidTemplateCreateEmptyContractKeyMaintainersSubmitErrorAnyTemplate
data CryptoErrorSubmitError
Crypto exceptions
Constructors:
CryptoErrorSubmitError
- instance
IsSubmitErrorCryptoErrorSubmitError - instance
GetFieldcryptoErrorMessageCryptoErrorSubmitErrorText - instance
GetFieldcryptoErrorTypeCryptoErrorSubmitErrorAnyCryptoErrorType - instance
SetFieldcryptoErrorMessageCryptoErrorSubmitErrorText - instance
SetFieldcryptoErrorTypeCryptoErrorSubmitErrorAnyCryptoErrorType
data DevErrorSubmitError
Development feature exceptions
Constructors:
DevErrorSubmitError
- instance
IsSubmitErrorDevErrorSubmitError - instance
GetFielddevErrorMessageDevErrorSubmitErrorText - instance
GetFielddevErrorTypeDevErrorSubmitErrorAnyDevErrorType - instance
SetFielddevErrorMessageDevErrorSubmitErrorText - instance
SetFielddevErrorTypeDevErrorSubmitErrorAnyDevErrorType
data DisclosedContractKeyHashingErrorSubmitError
Given disclosed contract key does not match the contract key of the contract on ledger.
Constructors:
DisclosedContractKeyHashingErrorSubmitError
- instance
IsSubmitErrorDisclosedContractKeyHashingErrorSubmitError - instance
GetFieldcontractIdDisclosedContractKeyHashingErrorSubmitErrorAnyContractId - instance
GetFieldexpectedKeyDisclosedContractKeyHashingErrorSubmitErrorAnyContractKey - instance
GetFieldgivenKeyHashDisclosedContractKeyHashingErrorSubmitErrorText - instance
SetFieldcontractIdDisclosedContractKeyHashingErrorSubmitErrorAnyContractId - instance
SetFieldexpectedKeyDisclosedContractKeyHashingErrorSubmitErrorAnyContractKey - instance
SetFieldgivenKeyHashDisclosedContractKeyHashingErrorSubmitErrorText
data DuplicateContractKeySubmitError
Attempted to create a contract with a contract key that already exists
Constructors:
DuplicateContractKeySubmitError
- instance
IsSubmitErrorDuplicateContractKeySubmitError - instance
GetFieldduplicateContractKeyDuplicateContractKeySubmitError(OptionalAnyContractKey) - instance
SetFieldduplicateContractKeyDuplicateContractKeySubmitError(OptionalAnyContractKey)
data EffectfulRollbackErrorSubmitError
Rollback exceptions
Constructors:
EffectfulRollbackErrorSubmitError
- instance
IsSubmitErrorEffectfulRollbackErrorSubmitError - instance
GetFieldeffectfulRollbackErrorMsgEffectfulRollbackErrorSubmitErrorText - instance
SetFieldeffectfulRollbackErrorMsgEffectfulRollbackErrorSubmitErrorText
data ExecutionFailedExternalCallError
Constructors:
ExecutionFailedExternalCallError
data ExternalCallErrorSubmitError
External-call interpretation exception
Constructors:
ExternalCallErrorSubmitError
- instance
IsSubmitErrorExternalCallErrorSubmitError - instance
GetFieldextensionIdExternalCallErrorSubmitErrorText - instance
GetFieldexternalCallErrorMessageExternalCallErrorSubmitErrorText - instance
GetFieldexternalCallErrorTypeExternalCallErrorSubmitErrorAnyExternalCallErrorType - instance
GetFieldfunctionIdExternalCallErrorSubmitErrorText - instance
SetFieldextensionIdExternalCallErrorSubmitErrorText - instance
SetFieldexternalCallErrorMessageExternalCallErrorSubmitErrorText - instance
SetFieldexternalCallErrorTypeExternalCallErrorSubmitErrorAnyExternalCallErrorType - instance
SetFieldfunctionIdExternalCallErrorSubmitErrorText
data FailureStatusErrorSubmitError
Exception resulting from call to failWithStatus
Constructors:
FailureStatusErrorSubmitError
- instance
IsSubmitErrorFailureStatusErrorSubmitError - instance
GetFieldfailureStatusFailureStatusErrorSubmitErrorFailureStatus - instance
SetFieldfailureStatusFailureStatusErrorSubmitErrorFailureStatus
data FetchEmptyContractKeyMaintainersSubmitError
Attempted to fetch a contract with empty contract key maintainers
Constructors:
FetchEmptyContractKeyMaintainersSubmitError
- instance
IsSubmitErrorFetchEmptyContractKeyMaintainersSubmitError - instance
GetFieldfailedTemplateKeyFetchEmptyContractKeyMaintainersSubmitErrorAnyContractKey - instance
SetFieldfailedTemplateKeyFetchEmptyContractKeyMaintainersSubmitErrorAnyContractKey
data InconsistentContractKeySubmitError
Contract key lookup yielded different results
Constructors:
InconsistentContractKeySubmitError
- instance
IsSubmitErrorInconsistentContractKeySubmitError - instance
GetFieldcontractKeyInconsistentContractKeySubmitErrorAnyContractKey - instance
SetFieldcontractKeyInconsistentContractKeySubmitErrorAnyContractKey
data InvalidOutputExternalCallError
Constructors:
InvalidOutputExternalCallError
data LocalVerdictLockedContractsSubmitError
The transaction refers to locked contracts which are in the process of being created, transferred, or
archived by another transaction. If the other transaction fails, this transaction could be successfully retried.
Constructors:
LocalVerdictLockedContractsSubmitError
- instance
IsSubmitErrorLocalVerdictLockedContractsSubmitError - instance
GetFieldlocalVerdictLockedContractsLocalVerdictLockedContractsSubmitError[AnyContractId] - instance
SetFieldlocalVerdictLockedContractsLocalVerdictLockedContractsSubmitError[AnyContractId]
data LocalVerdictLockedKeysSubmitError
The transaction refers to locked keys which are in the process of being modified by another transaction.
Constructors:
LocalVerdictLockedKeysSubmitError
- instance
IsSubmitErrorLocalVerdictLockedKeysSubmitError - instance
GetFieldlocalVerdictLockedKeysLocalVerdictLockedKeysSubmitError[AnyContractKey] - instance
SetFieldlocalVerdictLockedKeysLocalVerdictLockedKeysSubmitError[AnyContractKey]
data MalformedByteEncodingCryptoError
Constructors:
MalformedByteEncodingCryptoError
- instance
IsCryptoErrorTypeMalformedByteEncodingCryptoError - instance
GetFieldvalueMalformedByteEncodingCryptoErrorText - instance
SetFieldvalueMalformedByteEncodingCryptoErrorText
data MalformedKeyCryptoError
Constructors:
MalformedKeyCryptoError
- instance
IsCryptoErrorTypeMalformedKeyCryptoError - instance
GetFieldkeyValueMalformedKeyCryptoErrorText - instance
SetFieldkeyValueMalformedKeyCryptoErrorText
data MalformedSignatureCryptoError
Constructors:
MalformedSignatureCryptoError
- instance
IsCryptoErrorTypeMalformedSignatureCryptoError - instance
GetFieldsignatureValueMalformedSignatureCryptoErrorText - instance
SetFieldsignatureValueMalformedSignatureCryptoErrorText
data NonComparableValuesSubmitError
Attempted to compare values that are not comparable
Constructors:
NonComparableValuesSubmitError
data PreparationFailedExternalCallError
Constructors:
PreparationFailedExternalCallError
data TemplatePreconditionViolatedSubmitError
Failure due to false result from ensure, strictly pre-exception.
According to docs, not throwable with LF >= 1.14.
On LF >= 1.14, a failed ensure will result in a PreconditionFailed
exception wrapped in UnhandledException.
Constructors:
TemplatePreconditionViolatedSubmitError
data TranslationFailedUpgradeError
Constructors:
TranslationFailedUpgradeError
- instance
IsUpgradeErrorTypeTranslationFailedUpgradeError - instance
GetFieldcreateArgTranslationFailedUpgradeErrorAnyTemplate - instance
GetFielddstTemplateIdTranslationFailedUpgradeErrorTemplateTypeRep - instance
GetFieldmCoidTranslationFailedUpgradeError(OptionalAnyContractId) - instance
GetFieldsrcTemplateIdTranslationFailedUpgradeErrorTemplateTypeRep - instance
SetFieldcreateArgTranslationFailedUpgradeErrorAnyTemplate - instance
SetFielddstTemplateIdTranslationFailedUpgradeErrorTemplateTypeRep - instance
SetFieldmCoidTranslationFailedUpgradeError(OptionalAnyContractId) - instance
SetFieldsrcTemplateIdTranslationFailedUpgradeErrorTemplateTypeRep
data TruncatedErrorSubmitError
One of the above error types where the full exception body did not fit into the response, and was incomplete.
Constructors:
TruncatedErrorSubmitError
One of the constructor names of SubmitFailure except DevError, UnknownError, TruncatedError
- instance
IsSubmitErrorTruncatedErrorSubmitError - instance
GetFieldtruncatedErrorMessageTruncatedErrorSubmitErrorText - instance
GetFieldtruncatedErrorTypeTruncatedErrorSubmitErrorText - instance
SetFieldtruncatedErrorMessageTruncatedErrorSubmitErrorText - instance
SetFieldtruncatedErrorTypeTruncatedErrorSubmitErrorText
data UnhandledExceptionSubmitError
Unhandled user thrown exception
Constructors:
UnhandledExceptionSubmitError
Errors more complex than simple records cannot currently be encoded over the grpc status. Such errors will be missing here.
- instance
IsSubmitErrorUnhandledExceptionSubmitError - instance
GetFieldexcUnhandledExceptionSubmitError(OptionalAnyException) - instance
SetFieldexcUnhandledExceptionSubmitError(OptionalAnyException)
data UnknownErrorSubmitError
Generic catch-all for missing errors.
Constructors:
UnknownErrorSubmitError
- instance
IsSubmitErrorUnknownErrorSubmitError - instance
GetFieldunknownErrorMessageUnknownErrorSubmitErrorText - instance
SetFieldunknownErrorMessageUnknownErrorSubmitErrorText
data UnknownNewFeatureDevError
This should never happen - Update Scripts when you see this!
Constructors:
UnknownNewFeatureDevError
- instance
IsDevErrorTypeUnknownNewFeatureDevError
data UnresolvedPackageNameSubmitError
No vetted package with given package name could be found
Constructors:
UnresolvedPackageNameSubmitError
- instance
IsSubmitErrorUnresolvedPackageNameSubmitError - instance
GetFieldpackageNameUnresolvedPackageNameSubmitErrorText - instance
SetFieldpackageNameUnresolvedPackageNameSubmitErrorText
data UnsupportedContractIdSubmitError
Unsupported contract id type/version
Constructors:
UnsupportedContractIdSubmitError
- instance
IsSubmitErrorUnsupportedContractIdSubmitError - instance
GetFieldunknownContractIdUnsupportedContractIdSubmitErrorText - instance
SetFieldunknownContractIdUnsupportedContractIdSubmitErrorText
data UpgradeErrorSubmitError
Upgrade exception
Constructors:
UpgradeErrorSubmitError
- instance
IsSubmitErrorUpgradeErrorSubmitError - instance
GetFielderrorMessageUpgradeErrorSubmitErrorText - instance
GetFielderrorTypeUpgradeErrorSubmitErrorAnyUpgradeErrorType - instance
SetFielderrorMessageUpgradeErrorSubmitErrorText - instance
SetFielderrorTypeUpgradeErrorSubmitErrorAnyUpgradeErrorType
data UserErrorSubmitError
Transaction failure due to abort/assert calls pre-exceptions
Constructors:
UserErrorSubmitError
- instance
IsSubmitErrorUserErrorSubmitError - instance
GetFielduserErrorMessageUserErrorSubmitErrorText - instance
SetFielduserErrorMessageUserErrorSubmitErrorText
data ValidationFailedUpgradeError
Constructors:
ValidationFailedUpgradeError
- instance
IsUpgradeErrorTypeValidationFailedUpgradeError - instance
GetFieldcoidValidationFailedUpgradeErrorAnyContractId - instance
GetFielddstPackageNameValidationFailedUpgradeErrorText - instance
GetFielddstTemplateIdValidationFailedUpgradeErrorTemplateTypeRep - instance
GetFieldoriginalKeyOptValidationFailedUpgradeError(Optional(AnyContractKey, [Party])) - instance
GetFieldoriginalNonSignatoryStakeholdersValidationFailedUpgradeError[Party] - instance
GetFieldoriginalSignatoriesValidationFailedUpgradeError[Party] - instance
GetFieldrecomputedKeyOptValidationFailedUpgradeError(Optional(AnyContractKey, [Party])) - instance
GetFieldrecomputedNonSignatoryStakeholdersValidationFailedUpgradeError[Party] - instance
GetFieldrecomputedSignatoriesValidationFailedUpgradeError[Party] - instance
GetFieldsrcPackageNameValidationFailedUpgradeErrorText - instance
GetFieldsrcTemplateIdValidationFailedUpgradeErrorTemplateTypeRep - instance
SetFieldcoidValidationFailedUpgradeErrorAnyContractId - instance
SetFielddstPackageNameValidationFailedUpgradeErrorText - instance
SetFielddstTemplateIdValidationFailedUpgradeErrorTemplateTypeRep - instance
SetFieldoriginalKeyOptValidationFailedUpgradeError(Optional(AnyContractKey, [Party])) - instance
SetFieldoriginalNonSignatoryStakeholdersValidationFailedUpgradeError[Party] - instance
SetFieldoriginalSignatoriesValidationFailedUpgradeError[Party] - instance
SetFieldrecomputedKeyOptValidationFailedUpgradeError(Optional(AnyContractKey, [Party])) - instance
SetFieldrecomputedNonSignatoryStakeholdersValidationFailedUpgradeError[Party] - instance
SetFieldrecomputedSignatoriesValidationFailedUpgradeError[Party] - instance
SetFieldsrcPackageNameValidationFailedUpgradeErrorText - instance
SetFieldsrcTemplateIdValidationFailedUpgradeErrorTemplateTypeRep
data ValueNestingSubmitError
A value has been nested beyond a given depth limit
Constructors:
ValueNestingSubmitError
- instance
IsSubmitErrorValueNestingSubmitError - instance
GetFieldlimitValueNestingSubmitErrorInt - instance
SetFieldlimitValueNestingSubmitErrorInt
data WronglyTypedContractSubmitError
Attempted to exercise/fetch a contract with the wrong template type
Constructors:
WronglyTypedContractSubmitError
- instance
IsSubmitErrorWronglyTypedContractSubmitError - instance
GetFieldactualTemplateIdWronglyTypedContractSubmitErrorTemplateTypeRep - instance
GetFieldcontractIdWronglyTypedContractSubmitErrorAnyContractId - instance
GetFieldexpectedTemplateIdWronglyTypedContractSubmitErrorTemplateTypeRep - instance
SetFieldactualTemplateIdWronglyTypedContractSubmitErrorTemplateTypeRep - instance
SetFieldcontractIdWronglyTypedContractSubmitErrorAnyContractId - instance
SetFieldexpectedTemplateIdWronglyTypedContractSubmitErrorTemplateTypeRep
data AnyUpgradeErrorType
See IsUpgradeErrorType for details on how to use AnyUpgradeErrorType
Constructors:
AnyUpgradeErrorType TaggedRecord
- instance
IsTaggedRecordAnyUpgradeErrorType - instance
GetFielderrorTypeUpgradeErrorSubmitErrorAnyUpgradeErrorType - instance
SetFielderrorTypeUpgradeErrorSubmitErrorAnyUpgradeErrorType
data AnySubmitError
See IsSubmitError for details on how to use AnySubmitError
Constructors:
AnySubmitError TaggedRecord
- instance
IsTaggedRecordAnySubmitError
data AnyExternalCallErrorType
See IsExternalCallErrorType for details on how to use AnyExternalCallErrorType
Constructors:
AnyExternalCallErrorType TaggedRecord
- instance
IsTaggedRecordAnyExternalCallErrorType - instance
ShowAnyExternalCallErrorType - instance
GetFieldexternalCallErrorTypeExternalCallErrorSubmitErrorAnyExternalCallErrorType - instance
SetFieldexternalCallErrorTypeExternalCallErrorSubmitErrorAnyExternalCallErrorType
data AnyDevErrorType
See IsDevErrorType for details on how to use AnyDevErrorType
Constructors:
AnyDevErrorType TaggedRecord
- instance
IsTaggedRecordAnyDevErrorType - instance
ShowAnyDevErrorType - instance
GetFielddevErrorTypeDevErrorSubmitErrorAnyDevErrorType - instance
SetFielddevErrorTypeDevErrorSubmitErrorAnyDevErrorType
data AnyCryptoErrorType
See IsCryptoErrorType for details on how to use AnyCryptoErrorType
Constructors:
AnyCryptoErrorType TaggedRecord
- instance
IsTaggedRecordAnyCryptoErrorType - instance
ShowAnyCryptoErrorType - instance
GetFieldcryptoErrorTypeCryptoErrorSubmitErrorAnyCryptoErrorType - instance
SetFieldcryptoErrorTypeCryptoErrorSubmitErrorAnyCryptoErrorType
data AnyContractId
Constructors:
AnyContractId
- instance
EqAnyContractId - instance
ShowAnyContractId - instance
GetFieldadditionalInfoCidContractNotFoundAdditionalInfoAnyContractId - instance
GetFieldcoidAuthenticationFailedUpgradeErrorAnyContractId - instance
GetFieldcoidValidationFailedUpgradeErrorAnyContractId - instance
GetFieldcontractIdContractDoesNotImplementInterfaceSubmitErrorAnyContractId - instance
GetFieldcontractIdContractDoesNotImplementRequiringInterfaceSubmitErrorAnyContractId - instance
GetFieldcontractIdContractHashingErrorSubmitErrorAnyContractId - instance
GetFieldcontractIdDisclosedContractKeyHashingErrorSubmitErrorAnyContractId - instance
GetFieldcontractIdWronglyTypedContractSubmitErrorAnyContractId - instance
GetFieldcontractIdCreatedAnyContractId - instance
GetFieldcontractIdExercisedAnyContractId - instance
GetFieldlocalVerdictLockedContractsLocalVerdictLockedContractsSubmitError[AnyContractId] - instance
GetFieldmCoidTranslationFailedUpgradeError(OptionalAnyContractId) - instance
SetFieldadditionalInfoCidContractNotFoundAdditionalInfoAnyContractId - instance
SetFieldcoidAuthenticationFailedUpgradeErrorAnyContractId - instance
SetFieldcoidValidationFailedUpgradeErrorAnyContractId - instance
SetFieldcontractIdContractDoesNotImplementInterfaceSubmitErrorAnyContractId - instance
SetFieldcontractIdContractDoesNotImplementRequiringInterfaceSubmitErrorAnyContractId - instance
SetFieldcontractIdContractHashingErrorSubmitErrorAnyContractId - instance
SetFieldcontractIdDisclosedContractKeyHashingErrorSubmitErrorAnyContractId - instance
SetFieldcontractIdWronglyTypedContractSubmitErrorAnyContractId - instance
SetFieldcontractIdCreatedAnyContractId - instance
SetFieldcontractIdExercisedAnyContractId - instance
SetFieldlocalVerdictLockedContractsLocalVerdictLockedContractsSubmitError[AnyContractId] - instance
SetFieldmCoidTranslationFailedUpgradeError(OptionalAnyContractId)
data ParticipantName
Participant name for multi-participant script runs to address a specific participant
Constructors:
ParticipantName
- instance
GetFieldparticipantNameParticipantNameText - instance
SetFieldparticipantNameParticipantNameText
data PartyIdHint
A hint to the backing participant what party id to allocate.
Must be a valid PartyIdString (as described in @value.proto@).
Constructors:
PartyIdHint
- instance
GetFieldpartyIdHintPartyIdHintText - instance
SetFieldpartyIdHintPartyIdHintText
data PartyDetails
The party details returned by the party management service.
Constructors:
PartyDetails
- instance
IsQuestionListKnownParties[PartyDetails] - instance
EqPartyDetails - instance
OrdPartyDetails - instance
ShowPartyDetails - instance
GetFieldisLocalPartyDetailsBool - instance
GetFieldpartyPartyDetailsParty - instance
SetFieldisLocalPartyDetailsBool - instance
SetFieldpartyPartyDetailsParty
type PrivateKeyHex
= BytesHex
A DER formatted private key to be used for ECDSA message signing
Instances:
- instance
GetFieldprivateKeySecp256k1KeyPairPrivateKeyHex - instance
SetFieldprivateKeySecp256k1KeyPairPrivateKeyHex
data Secp256k1KeyPair
Secp256k1 key pair generated by secp256k1generatekeypair for testing.
Constructors:
Secp256k1KeyPair
- instance
IsQuestionSecp256k1GenerateKeyPairSecp256k1KeyPair - instance
GetFieldprivateKeySecp256k1KeyPairPrivateKeyHex - instance
GetFieldpublicKeySecp256k1KeyPairPublicKeyHex - instance
SetFieldprivateKeySecp256k1KeyPairPrivateKeyHex - instance
SetFieldpublicKeySecp256k1KeyPairPublicKeyHex
data Disclosure
Contract disclosures which can be acquired via queryDisclosure
Constructors:
Disclosure
- instance
EqDisclosure - instance
OrdDisclosure - instance
GetFieldsDisclosuresSubmission[Disclosure] - instance
SetFieldsDisclosuresSubmission[Disclosure]
data Commands a
This is used to build up the commands sent as part of submit.
If you enable the ApplicativeDo extension by adding
{-# LANGUAGE ApplicativeDo #-} at the top of your file, you can
use do-notation but the individual commands must not depend
on each other and the last statement in a do block
must be of the form return expr or pure expr.
Constructors:
Commands
- instance
FunctorCommands - instance
ApplicativeCommands - instance
GetFieldcommands(Commandsa) [CommandWithMeta] - instance
GetFieldcontinue(Commandsa) ([CommandResult] ->a) - instance
SetFieldcommands(Commandsa) [CommandWithMeta] - instance
SetFieldcontinue(Commandsa) ([CommandResult] ->a)
data AnyContractKey
Existential contract key type that can wrap an arbitrary contract key.
Instances:
- instance
EqAnyContractKey - instance
OrdAnyContractKey - instance
GetFieldcontractKeyQueryNByKeyAnyContractKey - instance
GetFieldcontractKeyContractKeyNotFoundSubmitErrorAnyContractKey - instance
GetFieldcontractKeyInconsistentContractKeySubmitErrorAnyContractKey - instance
GetFieldduplicateContractKeyDuplicateContractKeySubmitError(OptionalAnyContractKey) - instance
GetFieldexpectedKeyDisclosedContractKeyHashingErrorSubmitErrorAnyContractKey - instance
GetFieldfailedTemplateKeyFetchEmptyContractKeyMaintainersSubmitErrorAnyContractKey - instance
GetFieldkeyQueryByKeyAnyContractKey - instance
GetFieldlocalVerdictLockedKeysLocalVerdictLockedKeysSubmitError[AnyContractKey] - instance
GetFieldoriginalKeyOptValidationFailedUpgradeError(Optional(AnyContractKey, [Party])) - instance
GetFieldrecomputedKeyOptValidationFailedUpgradeError(Optional(AnyContractKey, [Party])) - instance
GetFieldsPrefetchKeysSubmission[AnyContractKey] - instance
SetFieldcontractKeyQueryNByKeyAnyContractKey - instance
SetFieldcontractKeyContractKeyNotFoundSubmitErrorAnyContractKey - instance
SetFieldcontractKeyInconsistentContractKeySubmitErrorAnyContractKey - instance
SetFieldduplicateContractKeyDuplicateContractKeySubmitError(OptionalAnyContractKey) - instance
SetFieldexpectedKeyDisclosedContractKeyHashingErrorSubmitErrorAnyContractKey - instance
SetFieldfailedTemplateKeyFetchEmptyContractKeyMaintainersSubmitErrorAnyContractKey - instance
SetFieldkeyQueryByKeyAnyContractKey - instance
SetFieldlocalVerdictLockedKeysLocalVerdictLockedKeysSubmitError[AnyContractKey] - instance
SetFieldoriginalKeyOptValidationFailedUpgradeError(Optional(AnyContractKey, [Party])) - instance
SetFieldrecomputedKeyOptValidationFailedUpgradeError(Optional(AnyContractKey, [Party])) - instance
SetFieldsPrefetchKeysSubmission[AnyContractKey]
data Script a
This is the type of A Daml script. Script is an instance of Action,
so you can use do notation.
Constructors:
Script
HIDEWe use an inlined StateT () to separate evaluation ofsomething of type Script from execution and to ensureproper sequencing of evaluation. This is mainly so that
debug does somethingslightly more sensible.- instance
ScriptSubmitScript - instance
FunctorScript - instance
CanAssertScript - instance
ActionCatchScript - instance
ActionThrowScript - instance
ActionFailWithStatusScript - instance
CanAbortScript - instance
HasTimeScript - instance
ActionScript - instance
ActionFailScript - instance
ApplicativeScript
Typeclasses
class IsSubmitError e
Allows casting AnySubmitError into and out of specific errors.
Methods:
toAnySubmitError:e->AnySubmitErrorTransform a submit error into an AnySubmitErrorfromAnySubmitError:AnySubmitError->OptionaleAttempt to transform an AnySubmitError into a specific submit error, givesNoneif the underlying type of the AnySubmitError does not match. This can be used with type application, i.e.fromAnySubmitError @UnsupportedContractIdSubmitErroror forced with view patterns:case anySubmitError of (fromAnySubmitError -> UnsupportedContractIdSubmitError {..}) -> ...
- instance
IsSubmitErrorAuthorizationErrorSubmitError - instance
IsSubmitErrorContractDoesNotImplementInterfaceSubmitError - instance
IsSubmitErrorContractDoesNotImplementRequiringInterfaceSubmitError - instance
IsSubmitErrorContractHashingErrorSubmitError - instance
IsSubmitErrorContractIdComparabilitySubmitError - instance
IsSubmitErrorContractIdInContractKeySubmitError - instance
IsSubmitErrorContractKeyNotFoundSubmitError - instance
IsSubmitErrorContractNotFoundSubmitError - instance
IsSubmitErrorCreateEmptyContractKeyMaintainersSubmitError - instance
IsSubmitErrorCryptoErrorSubmitError - instance
IsSubmitErrorDevErrorSubmitError - instance
IsSubmitErrorDisclosedContractKeyHashingErrorSubmitError - instance
IsSubmitErrorDuplicateContractKeySubmitError - instance
IsSubmitErrorEffectfulRollbackErrorSubmitError - instance
IsSubmitErrorExternalCallErrorSubmitError - instance
IsSubmitErrorFailureStatusErrorSubmitError - instance
IsSubmitErrorFetchEmptyContractKeyMaintainersSubmitError - instance
IsSubmitErrorInconsistentContractKeySubmitError - instance
IsSubmitErrorLocalVerdictLockedContractsSubmitError - instance
IsSubmitErrorLocalVerdictLockedKeysSubmitError - instance
IsSubmitErrorNonComparableValuesSubmitError - instance
IsSubmitErrorTemplatePreconditionViolatedSubmitError - instance
IsSubmitErrorTruncatedErrorSubmitError - instance
IsSubmitErrorUnhandledExceptionSubmitError - instance
IsSubmitErrorUnknownErrorSubmitError - instance
IsSubmitErrorUnresolvedPackageNameSubmitError - instance
IsSubmitErrorUnsupportedContractIdSubmitError - instance
IsSubmitErrorUpgradeErrorSubmitError - instance
IsSubmitErrorUserErrorSubmitError - instance
IsSubmitErrorValueNestingSubmitError - instance
IsSubmitErrorWronglyTypedContractSubmitError
class IsUpgradeErrorType e
SCU related submission errors
Allows casting AnyUpgradeErrorType into and out of specific upgrade error types.
Methods:
toAnyUpgradeErrorType:e->AnyUpgradeErrorTypeTransform an upgrade error type into an AnyUpgradeErrorTypefromAnyUpgradeErrorType:AnyUpgradeErrorType->OptionaleAttempt to transform an AnyUpgradeErrorType into a specific upgrade error type, givesNoneif the underlying type of the AnyUpgradeErrorType does not match.
- instance
IsUpgradeErrorTypeAuthenticationFailedUpgradeError - instance
IsUpgradeErrorTypeTranslationFailedUpgradeError - instance
IsUpgradeErrorTypeValidationFailedUpgradeError
class IsCryptoErrorType e
Daml Crypto (Secp256k1) related submission errors
Allows casting AnyCryptoErrorType into and out of specific crypto error types.
Methods:
toAnyCryptoErrorType:e->AnyCryptoErrorTypeTransform a crypto error type into an AnyCryptoErrorTypefromAnyCryptoErrorType:AnyCryptoErrorType->OptionaleAttempt to transform an AnyCryptoErrorType into a specific crypto error type, givesNoneif the underlying type of the AnyCryptoErrorType does not match.
- instance
IsCryptoErrorTypeMalformedByteEncodingCryptoError - instance
IsCryptoErrorTypeMalformedKeyCryptoError - instance
IsCryptoErrorTypeMalformedSignatureCryptoError
class IsExternalCallErrorType e
External-call related submission errors, one per stage: preparing the
call, executing it, and validating the service output.
Allows casting AnyExternalCallErrorType into and out of specific external-call error types.
Methods:
toAnyExternalCallErrorType:e->AnyExternalCallErrorTypeTransform an external-call error type into an AnyExternalCallErrorTypefromAnyExternalCallErrorType:AnyExternalCallErrorType->OptionaleAttempt to transform an AnyExternalCallErrorType into a specific external-call error type, givesNoneif the underlying type of the AnyExternalCallErrorType does not match.
- instance
IsExternalCallErrorTypeExecutionFailedExternalCallError - instance
IsExternalCallErrorTypeInvalidOutputExternalCallError - instance
IsExternalCallErrorTypePreparationFailedExternalCallError
class IsDevErrorType e
Errors that will be promoted to SubmitError once stable - code needs to be kept in sync with SubmitError.scala
Allows casting AnyDevErrorType into and out of specific dev error types.
Methods:
toAnyDevErrorType:e->AnyDevErrorTypeTransform a dev error type into an AnyDevErrorTypefromAnyDevErrorType:AnyDevErrorType->OptionaleAttempt to transform an AnyDevErrorType into a specific dev error type, givesNoneif the underlying type of the AnyDevErrorType does not match.
- instance
IsDevErrorTypeChoiceGuardFailedDevError - instance
IsDevErrorTypeUnknownNewFeatureDevError
Functions
userIdToText
userIdToText : UserId -> Text
Extract the name-text from a user identitifer.
validateUserId
validateUserId : HasCallStack => Text -> Script UserId
Construct a user identifer from text. May throw InvalidUserId.
createUser
createUser : HasCallStack => User -> [UserRight] -> Script ()
Create a user with the given rights. May throw UserAlreadyExists.
createUserOn
createUserOn : HasCallStack => User -> [UserRight] -> ParticipantName -> Script ()
Create a user with the given rights on the given participant. May throw UserAlreadyExists.
getUser
getUser : HasCallStack => UserId -> Script User
Fetch a user record by user id. May throw UserNotFound.
getUserOn
getUserOn : HasCallStack => UserId -> ParticipantName -> Script User
Fetch a user record by user id from the given participant. May throw UserNotFound.
listAllUsers
listAllUsers : Script [User]
List all users. This function may make multiple calls to underlying paginated ledger API.
listAllUsersOn
listAllUsersOn : ParticipantName -> Script [User]
List all users on the given participant. This function may make multiple calls to underlying paginated ledger API.
grantUserRights
grantUserRights : HasCallStack => UserId -> [UserRight] -> Script [UserRight]
Grant rights to a user. Returns the rights that have been newly granted. May throw UserNotFound.
grantUserRightsOn
grantUserRightsOn : HasCallStack => UserId -> [UserRight] -> ParticipantName -> Script [UserRight]
Grant rights to a user on the given participant. Returns the rights that have been newly granted. May throw UserNotFound.
revokeUserRights
revokeUserRights : HasCallStack => UserId -> [UserRight] -> Script [UserRight]
Revoke rights for a user. Returns the revoked rights. May throw UserNotFound.
revokeUserRightsOn
revokeUserRightsOn : HasCallStack => UserId -> [UserRight] -> ParticipantName -> Script [UserRight]
Revoke rights for a user on the given participant. Returns the revoked rights. May throw UserNotFound.
deleteUser
deleteUser : HasCallStack => UserId -> Script ()
Delete a user. May throw UserNotFound.
deleteUserOn
deleteUserOn : HasCallStack => UserId -> ParticipantName -> Script ()
Delete a user on the given participant. May throw UserNotFound.
listUserRights
listUserRights : HasCallStack => UserId -> Script [UserRight]
List the rights of a user. May throw UserNotFound.
listUserRightsOn
listUserRightsOn : HasCallStack => UserId -> ParticipantName -> Script [UserRight]
List the rights of a user on the given participant. May throw UserNotFound.
submitUser
submitUser : HasCallStack => UserId -> Commands a -> Script a
Submit the commands with the actAs and readAs claims granted to a user. May throw UserNotFound.
submitUserOn
submitUserOn : HasCallStack => UserId -> ParticipantName -> Commands a -> Script a
Submit the commands with the actAs and readAs claims granted to the user on the given participant. May throw UserNotFound.
setTime
setTime : HasCallStack => Time -> Script ()
Set the time via the time service.
This is only supported in Daml Studio and dpm test as well as
when running over the gRPC API against a ledger in static time mode.
Note that the ledger time service does not support going backwards in time.
However, you can go back in time in Daml Studio.
sleep
sleep : HasCallStack => RelTime -> Script ()
Sleep for the given duration.
This is primarily useful in tests
where you repeatedly call query until a certain state is reached.
Note that this will sleep for the same duration in both wall clock and static time mode.
passTime
passTime : RelTime -> Script ()
Advance ledger time by the given interval.
This is only supported in Daml Studio and dpm test as well as
when running over the gRPC API against a ledger in static time mode.
Note that this is not an atomic operation over the
gRPC API so no other clients should try to change time while this is
running.
Note that the ledger time service does not support going backwards in time.
However, you can go back in time in Daml Studio.
actAs
actAs : IsParties parties => parties -> SubmitOptions
Builds a SubmitOptions with given actAs parties.
Any given submission must include at least one actAs party.
Note that the parties type is constrainted by IsParties, allowing for specifying parties as any of the following:
Party
[Party]
NonEmpty Party
Set Party
Optional Party
readAs
readAs : IsParties parties => parties -> SubmitOptions
Builds a SubmitOptions with given readAs parties.
A given submission may omit any readAs parties and still be valid.
Note that the parties type is constrainted by IsParties, allowing for specifying parties as any of the following:
Party
[Party]
NonEmpty Party
Set Party
Optional Party
discloseMany
discloseMany : [Disclosure] -> SubmitOptions
Provides many Explicit Disclosures to the transaction.
disclose
disclose : Disclosure -> SubmitOptions
Provides an Explicit Disclosure to the transaction.
packagePreference
packagePreference : [PackageId] -> SubmitOptions
Provide a package id selection preference for upgrades for a submission
prefetchKeys
prefetchKeys : [AnyContractKey] -> SubmitOptions
Provide a list of contract keys to prefetch for a submission
concurrently
concurrently : HasCallStack => ConcurrentSubmits a -> Script a
Allows for concurrent submission of transactions, using an applicative, similar to Commands.
Concurrently takes a computation in ConcurrentSubmits, which supports all the existing submit functions
that Script supports. It however does not implement Action, and thus does not support true binding and computation interdependence
NOTE: The submission order of transactions within concurrently is deterministic, this function is not intended to test contention.
It is only intended to allow faster submission of many unrelated transactions, by not waiting for completion for each transaction before
sending the next.
Example:
exerciseResult <- concurrently $ do
alice `submit` createCmd ...
res <- alice `submit` exerciseCmd ...
bob `submit` createCmd ...
pure res
submitResultAndTree
submitResultAndTree : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script (a, TransactionTree)
Equivalent to submit but returns the result and the full transaction tree.
trySubmitResultAndTree
trySubmitResultAndTree : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script (Either SubmitError (a, TransactionTree))
Equivalent to trySubmit but returns the result and the full transaction tree.
submitWithError
submitWithError : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script SubmitError
Equivalent to submitMustFail but returns the error thrown.
submit
submit : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script a
submit p cmds submits the commands cmds as a single transaction
from party p and returns the value returned by cmds.
The options field can either be any “Parties” like type (See IsParties) or SubmitOptions
which allows for finer control over parameters of the submission.
If the transaction fails, submit also fails.
submitWithOptions
submitWithOptions : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script a
Deprecated: Daml 2.9 compatibility helper, use ‘submit’ instead
submitTree
submitTree : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script TransactionTree
Equivalent to submit but returns the full transaction tree.
trySubmit
trySubmit : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script (Either SubmitError a)
Submit a transaction and recieve back either the result, or a SubmitError.
In the majority of failures, this will not crash at runtime.
trySubmitTree
trySubmitTree : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script (Either SubmitError TransactionTree)
Equivalent to trySubmit but returns the full transaction tree.
submitMustFail
submitMustFail : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script ()
submitMustFail p cmds submits the commands cmds as a single transaction
from party p.
See submitWithOptions for details on the options field
It only succeeds if the submitting the transaction fails.
submitMustFailWithOptions
submitMustFailWithOptions : (HasCallStack, ScriptSubmit script, IsSubmitOptions options) => options -> Commands a -> script ()
Deprecated: Daml 2.9 compatibility helper, use ‘submitMustFail’ instead
submitMulti
submitMulti : (HasCallStack, ScriptSubmit script) => [Party] -> [Party] -> Commands a -> script a
Deprecated: Legacy API, use
submit, actAs and readAs separatelysubmitMulti actAs readAs cmds submits cmds as a single transaction
authorized by actAs. Fetched contracts must be visible to at least
one party in the union of actAs and readAs.
Note: This behaviour can be achieved using submit (actAs actors <> readAs readers) cmds
and is only provided for backwards compatibility.
submitMultiMustFail
submitMultiMustFail : (HasCallStack, ScriptSubmit script) => [Party] -> [Party] -> Commands a -> script ()
Deprecated: Legacy API, use
submitMustFail, actAs and readAs separatelysubmitMultiMustFail actAs readAs cmds behaves like submitMulti actAs readAs cmds
but fails when submitMulti succeeds and the other way around.
Note: This behaviour can be achieved using submitMustFail (actAs actors <> readAs readers) cmds
and is only provided for backwards compatibility.
submitTreeMulti
submitTreeMulti : (HasCallStack, ScriptSubmit script) => [Party] -> [Party] -> Commands a -> script TransactionTree
Deprecated: Legacy API, use
submitTree, actAs and readAs separatelysubmitMulti but returns the full transaction tree.
Note: This behaviour can be achieved using submitTree (actAs actors <> readAs readers) cmds
and is only provided for backwards compatibility.
trySubmitMulti
trySubmitMulti : (HasCallStack, ScriptSubmit script) => [Party] -> [Party] -> Commands a -> script (Either SubmitError a)
Deprecated: Legacy API, use
trySubmit, actAs and readAs separatelytrySubmit that allows specifying the actAs and readAs parties.
Note: This behaviour can be achieved using trySubmit (actAs actors <> readAs readers) cmds
and is only provided for backwards compatibility.
trySubmitConcurrently
trySubmitConcurrently : HasCallStack => Party -> [Commands a] -> Script [Either SubmitError a]
Deprecated: Legacy API, use
concurrent and trySubmit separatelysubmitWithDisclosures
submitWithDisclosures : HasCallStack => Party -> [Disclosure] -> Commands a -> Script a
Deprecated: Legacy API, use
trySubmit and disclosures separatelysubmitWithDisclosuresMustFail
submitWithDisclosuresMustFail : HasCallStack => Party -> [Disclosure] -> Commands a -> Script ()
Deprecated: Legacy API, use
submitMustFail and disclosures separatelyfromTree
fromTree : Template t => TransactionTree -> TreeIndex t -> ContractId t
Finds the contract id of an event within a tree given a tree index
Tree indices are created using the created(N) and exercised(N) builders
which allow building “paths” within a transaction to a create node
For example, exercisedN @MyTemplate1 "MyChoice" 2 $ createdN @MyTemplate2 1
would find the ContractId MyTemplate2 of the second (0 index) create event under
the 3rd exercise event of MyChoice from MyTemplate1
created
created : HasTemplateTypeRep t => TreeIndex t
Index for the first create event of a given template
e.g. created @MyTemplate
createdN
createdN : HasTemplateTypeRep t => Int -> TreeIndex t
Index for the Nth create event of a given template
e.g. createdN 2 @MyTemplate
created = createdN 0
exercised
exercised : HasTemplateTypeRep t => Text -> TreeIndex t' -> TreeIndex t'
Index for the first exercise of a given choice on a given template
e.g. exercised @MyTemplate "MyChoice"
exercisedN
exercisedN : HasTemplateTypeRep t => Text -> Int -> TreeIndex t' -> TreeIndex t'
Index for the Nth exercise of a given choice on a given template
e.g. exercisedN @MyTemplate "MyChoice" 2
exercised c = exercisedN c 0
coid
coid : AnyUpgradeErrorType -> AnyContractId
Backwards compatibility accessor for the coid field of the ValidationFailed and AuthenticationFailed patterns.
srcTemplateId
srcTemplateId : AnyUpgradeErrorType -> TemplateTypeRep
Backwards compatibility accessor for the srcTemplateId field of the ValidationFailed, TranslationFailed and AuthenticationFailed patterns.
dstTemplateId
dstTemplateId : AnyUpgradeErrorType -> TemplateTypeRep
Backwards compatibility accessor for the dstTemplateId field of the ValidationFailed, TranslationFailed and AuthenticationFailed patterns.
createArg
createArg : AnyUpgradeErrorType -> AnyTemplate
Backwards compatibility accessor for the createArg field of the TranslationFailed and AuthenticationFailed patterns.
contractId
contractId : AnySubmitError -> AnyContractId
Backwards compatibility accessor for the contractId field of the DisclosedContractKeyHashingError, WronglyTypedContract, ContractDoesNotImplementInterface and ContractDoesNotImplementRequiringInterface patterns.
templateId
templateId : AnySubmitError -> TemplateTypeRep
Backwards compatibility accessor for the templateId field of the ContractDoesNotImplementInterface and ContractDoesNotImplementRequiringInterface patterns.
contractKey
contractKey : AnySubmitError -> AnyContractKey
Backwards compatibility accessor for the contractKey field of the ContractKeyNotFound and InconsistentContractKey patterns.
fromAnyContractId
fromAnyContractId : Template t => AnyContractId -> Optional (ContractId t)
query
query : (Template t, HasEnsure t, IsParties p) => p -> Script [(ContractId t, t)]
Query the set of active contracts of the template
that are visible to the given party.
queryFilter
queryFilter : (Template c, HasEnsure c, IsParties p) => p -> (c -> Bool) -> Script [(ContractId c, c)]
Query the set of active contracts of the template
that are visible to the given party and match the given predicate.
queryContractId
queryContractId : (Template t, HasEnsure t, IsParties p, HasCallStack) => p -> ContractId t -> Script (Optional t)
Query for the contract with the given contract id.
Returns None if there is no active contract the party is a stakeholder on.
WARNING: Over the gRPC backend this performs a linear search over all contracts of
the same type, so only use this if the number of active contracts is small.
This is semantically equivalent to calling query
and filtering on the client side.
queryDisclosure
queryDisclosure : (Template t, IsParties p, HasCallStack) => p -> ContractId t -> Script (Optional Disclosure)
Queries a Disclosure for a given ContractId. Same performance caveats apply as to queryContractId.
queryInterface
queryInterface : (Template i, HasInterfaceView i v, IsParties p) => p -> Script [(ContractId i, Optional v)]
Query the set of active contract views for an interface
that are visible to the given party.
If the view function fails for a given contract id, The Optional v will be None.
queryInterfaceContractId
queryInterfaceContractId : (Template i, HasInterfaceView i v, IsParties p, HasCallStack) => p -> ContractId i -> Script (Optional v)
Query for the contract view with the given contract id.
Returns None if there is no active contract the party is a stakeholder on.
Returns None if the view function fails for the given contract id.
WARNING: Over the gRPC backend this performs a linear search over all contracts of
the same type, so only use this if the number of active contracts is small.
This is semantically equivalent to calling queryInterface
and filtering on the client side.
queryByKey
queryByKey : (HasCallStack, TemplateKey t k, IsParties p) => p -> k -> Script (Optional (ContractId t, t))
Returns None if there is no active contract with the given key that
the party is a stakeholder on.
WARNING: Over the gRPC backend this performs a linear search over all contracts of
the same type, so only use this if the number of active contracts is small.
This is semantically equivalent to calling query
and filtering on the client side.
queryNByKey
queryNByKey : (HasCallStack, TemplateKey t k, IsParties p) => p -> Int -> k -> Script [(ContractId t, t)]
Returns N contracts matching a key, returns empty list if the key is inactive
Only available in LF 2.3+
WARNING: Over the gRPC backend this performs a linear search over all contracts of
the same type, so only use this if the number of active contracts is small.
This is semantically equivalent to calling query
and filtering on the client side.
queryAllByKey
queryAllByKey : (HasCallStack, TemplateKey t k, IsParties p) => p -> k -> Script [(ContractId t, t)]
Returns all contracts matching a key, returns empty list if the key is inactive
Only available in LF 2.3+
WARNING: Over the gRPC backend this performs a linear search over all contracts of
the same type, so only use this if the number of active contracts is small.
This is semantically equivalent to calling query
and filtering on the client side.
allocateParty
allocateParty : HasCallStack => Text -> Script Party
Allocate a party with the given display name
using the party management service.
allocatePartyWithHint
allocatePartyWithHint : HasCallStack => Text -> PartyIdHint -> Script Party
Deprecated: Daml 3.3 compatibility helper, use ‘allocatePartyByHint’ instead of ‘allocatePartyWithHint’
allocatePartyByHint
allocatePartyByHint : HasCallStack => PartyIdHint -> Script Party
Allocate a party with the given id hint
using the party management service.
allocatePartyOn
allocatePartyOn : Text -> ParticipantName -> Script Party
Allocate a party with the given display name
on the specified participant using the party management service.
allocatePartyWithHintOn
allocatePartyWithHintOn : Text -> PartyIdHint -> ParticipantName -> Script Party
Deprecated: Daml 3.3 compatibility helper, use ‘allocatePartyByHintOn’ instead of ‘allocatePartyWithHintOn’
allocatePartyByHintOn
allocatePartyByHintOn : PartyIdHint -> ParticipantName -> Script Party
Allocate a party with the given id hint
on the specified participant using the party management service.
listKnownParties
listKnownParties : HasCallStack => Script [PartyDetails]
List the parties known to the default participant.
listKnownPartiesOn
listKnownPartiesOn : HasCallStack => ParticipantName -> Script [PartyDetails]
List the parties known to the given participant.
tryToEither
tryToEither : (() -> Script t) -> Script (Either AnyException t)
Named version of the try catch behaviour of Daml-Script.
Note that this is no more powerful than try catch in daml-script, and will not catch exceptions in submissions.
(Use trySubmit for this)
Input computation is deferred to catch pure exceptions
tryFailureStatus
tryFailureStatus : Script a -> Script (Either FailureStatus a)
Runs a script for a result. If it fails either by Daml Exceptions or failWithStatus, returns the
FailureStatus that a Canton Ledger would return.
secp256k1signWithEcdsaOnly
secp256k1signWithEcdsaOnly : HasCallStack => PrivateKeyHex -> BytesHex -> Script BytesHex
Using a DER formatted private key (encoded as a hex string) use Secp256k1 to sign a hex encoded string message.
Note that this implementation uses a random source with a fixed PRNG and seed, ensuring it behaves deterministically during testing.
For example, CCTP attestation services may be mocked in daml-script code.
secp256k1sign
secp256k1sign : HasCallStack => PrivateKeyHex -> BytesHex -> Script BytesHex
Using a DER formatted private key (encoded as a hex string) use Secp256k1 to sign a SHA256 digest of a hex encoded string message.
Note that this implementation uses a random source with a fixed PRNG and seed, ensuring it behaves deterministically during testing.
For example, CCTP attestation services may be mocked in daml-script code.
secp256k1generatekeypair
secp256k1generatekeypair : HasCallStack => Script Secp256k1KeyPair
Generate DER formatted Secp256k1 public/private key pairs.
toAnyContractKey
toAnyContractKey : (HasTemplateTypeRep t, TemplateKey t k) => k -> AnyContractKey
Wrap a contract key in AnyContractKey.
You must pass the template type t using an explicit type application.
For example toAnyContractKey @Proposal k.
fromAnyContractKey
fromAnyContractKey : (HasTemplateTypeRep t, TemplateKey t k) => AnyContractKey -> Optional k
Extract the underlying key from AnyContractKey if the template and
choice types match, or return None.
You must pass the template type t using an explicit type application.
For example fromAnyContractKey @Proposal k.
createCmd
createCmd : (Template t, HasEnsure t) => t -> Commands (ContractId t)
Create a contract of the given template.
exerciseCmd
exerciseCmd : Choice t c r => ContractId t -> c -> Commands r
Exercise a choice on the given contract.
exerciseByKeyCmd
exerciseByKeyCmd : (TemplateKey t k, Choice t c r) => k -> c -> Commands r
Exercise a choice on the contract with the given key.
createAndExerciseWithCidCmd
createAndExerciseWithCidCmd : (Template t, Choice t c r, HasEnsure t) => t -> c -> Commands (ContractId t, r)
Create a contract and exercise a choice on it in the same transaction, returns the created ContractId, and the choice result.
createAndExerciseCmd
createAndExerciseCmd : (Template t, Choice t c r, HasEnsure t) => t -> c -> Commands r
Create a contract and exercise a choice on it in the same transaction, returns only the choice result.
createExactCmd
createExactCmd : (Template t, HasEnsure t) => t -> Commands (ContractId t)
Create a contract of the given template, using the exact package ID of the template given - upgrades are disabled.
exerciseExactCmd
exerciseExactCmd : Choice t c r => ContractId t -> c -> Commands r
Exercise a choice on the given contract, using the exact package ID of the template given - upgrades are disabled.
exerciseByKeyExactCmd
exerciseByKeyExactCmd : (TemplateKey t k, Choice t c r) => k -> c -> Commands r
Exercise a choice on the contract with the given key, using the exact package ID of the template given - upgrades are disabled.
createAndExerciseWithCidExactCmd
createAndExerciseWithCidExactCmd : (Template t, Choice t c r, HasEnsure t) => t -> c -> Commands (ContractId t, r)
Create a contract and exercise a choice on it in the same transaction, returns the created ContractId, and the choice result.
Uses the exact package ID of the template given - upgrades are disabled.
createAndExerciseExactCmd
createAndExerciseExactCmd : (Template t, Choice t c r, HasEnsure t) => t -> c -> Commands r
Create a contract and exercise a choice on it in the same transaction, returns only the choice result.
archiveCmd
archiveCmd : Choice t Archive () => ContractId t -> Commands ()
Archive the given contract.
archiveCmd cid is equivalent to exerciseCmd cid Archive.
script
script : Script a -> Script a
Convenience helper to declare you are writing a Script.
This is only useful for readability and to improve type inference.
Any expression of type Script a is a valid script regardless of whether
it is implemented using script or not.
History
Updated
3.7.3Module declarations or documentation updated.
Updated
3.7.0Module declarations or documentation updated.
Updated
3.6.0Module declarations or documentation updated.
Updated
3.5.12Module declarations or documentation updated.
Updated
3.5.2Module declarations or documentation updated.
Updated
3.5.1Module declarations or documentation updated.
Updated
3.4.11Module declarations or documentation updated.
Updated
3.4.10Module declarations or documentation updated.