- Overview
- Tutorials
- Getting started
- Get started with Canton and the JSON Ledger API
- Get started with Canton Network App Dev Quickstart
- Get started with smart contract development
- Basic contracts
- Test templates using Daml scripts
- Build the Daml Archive (.dar) file
- Data types
- Transform contracts using choices
- Add constraints to a contract
- Parties and authority
- Compose choices
- Handle exceptions
- Work with dependencies
- Functional programming 101
- The Daml standard library
- Test Daml contracts
- Next steps
- Application development
- Getting started
- Development how-tos
- Component how-tos
- Explanations
- References
- Application development
- Smart contract development
- Daml language cheat sheet
- Daml language reference
- Overview: Template Structure
- Reference: Templates
- Reference: Choices
- Reference: Updates
- Reference: Data Types
- Reference: Built-in Functions
- Reference: Expressions
- Reference: Functions
- Reference: Daml File Structure
- Reference: Daml Packages
- Reference: Contract Keys
- Reference: Interfaces
- Reference: Exceptions (Deprecated)
- Daml standard library
- DA.Action.State.Class
- DA.Action.State
- DA.Action
- DA.Assert
- DA.Bifunctor
- DA.Crypto.Text
- DA.Date
- DA.Either
- DA.Exception
- DA.Fail
- DA.Foldable
- DA.Functor
- DA.Internal.Interface.AnyView.Types
- DA.Internal.Interface.AnyView
- DA.List.BuiltinOrder
- DA.List.Total
- DA.List
- DA.Logic
- DA.Map
- DA.Math
- DA.Monoid
- DA.NonEmpty.Types
- DA.NonEmpty
- DA.Numeric
- DA.Optional
- DA.Record
- DA.Semigroup
- DA.Set
- DA.Stack
- DA.Text
- DA.TextMap
- DA.Time
- DA.Traversable
- DA.Tuple
- DA.Validation
- GHC.Show.Text
- GHC.Tuple.Check
- Prelude
- Daml Script
- Smart contract upgrading reference
- Glossary of concepts
Daml.Script.Internal¶
Contains all Internal and Alpha functionality provided by Daml Script. Use these with care. No stability guarantees are given for them across SDK upgrades.
Data Types¶
data CommandName
Name of the Daml Script Command (or Question) that failed
Field
Type
Description
getCommandName
data ErrorClassName
Scala class name of the exception thrown
Field
Type
Description
getErrorClassName
data ErrorMessage
Result of the
getMessage
method on the Scala exception
Field
Type
Description
getErrorMessage
data FailedCmd
Daml type representing a Scala exception thrown during script interpretation. Used for internal testing of the Daml Script library.
Field
Type
Description
commandName
errorClassName
errorMessage
data ContractNotFoundAdditionalInfo
Additional debugging information provided only by IDE Ledger
data PackageName
Functions¶
- tryCommands
: Script a -> Script (Either FailedCmd a)
Internal testing tool that allows us to catch FailedCmds in the daml language
- liftFailedCommandToFailureStatus
-
Runs a script and lifts FailedCmd scala exceptions into a FailureStatus, which can be caught via tryFailureStatus
- isNotActive
: ContractNotFoundAdditionalInfo -> Optional AnyContractId
Exacts nonactive contract ID from ContractNotFoundAdditionalInfo
- vetPackages
: HasCallStack => [PackageName] -> Script ()
Vet a set of packages on all participants. Note that the Admin API port must be provided when using this with a Canton Ledger Use
--admin-port
with thedaml script
CLI tool.
- vetPackagesOnParticipant
: HasCallStack => [PackageName] -> ParticipantName -> Script ()
Vet a set of packages on a single participant. Note that the Admin API port must be provided when using this with a Canton Ledger Use
--admin-port
with thedaml script
CLI tool.
- unvetPackages
: HasCallStack => [PackageName] -> Script ()
Unvet a set of packages on all participants. Note that the Admin API port must be provided when using this with a Canton Ledger Use
--admin-port
with thedaml script
CLI tool.
- unvetPackagesOnParticipant
: HasCallStack => [PackageName] -> ParticipantName -> Script ()
Unvet a set of packages on a single participant. Note that the Admin API port must be provided when using this with a Canton Ledger Use
--admin-port
with thedaml script
CLI tool.
- listVettedPackages
: HasCallStack => Script [PackageName]
Lists the vetted packages on the default participant Note that the Admin API port must be provided when using this with a Canton Ledger Use
--admin-port
with thedaml script
CLI tool.
- listAllPackages
: HasCallStack => Script [PackageName]
Lists all packages (vetted and unvetted) on the default participant Note that the Admin API port must be provided when using this with a Canton Ledger Use
--admin-port
with thedaml script
CLI tool.
- allocateReplicatedPartyOn
: Text -> ParticipantName -> [ParticipantName] -> Script Party
Allocate a party with the given display name on the specified main participant using the party management service and replicates it to the specified (possibly empty) list of additional participants. Commands submitted by the allocated party will be routed to the main participant.
- allocateReplicatedPartyWithHintOn
: Text -> PartyIdHint -> ParticipantName -> [ParticipantName] -> Script Party
Allocate a party with the given display name and id hint on the specified main participant using the party management service and replicates it to the specified (possibly empty) list of additional participants. Commands submitted by the allocated party will be routed to the main participant.
- throwAnyException
: AnyException -> Script t
Throws an
AnyException
, note that this function discards the stacktrace