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

CommandName

Field

Type

Description

getCommandName

Text

data ErrorClassName

Scala class name of the exception thrown

ErrorClassName

Field

Type

Description

getErrorClassName

Text

data ErrorMessage

Result of the getMessage method on the Scala exception

ErrorMessage

Field

Type

Description

getErrorMessage

Text

data FailedCmd

Daml type representing a Scala exception thrown during script interpretation. Used for internal testing of the Daml Script library.

FailedCmd

Field

Type

Description

commandName

CommandName

errorClassName

ErrorClassName

errorMessage

ErrorMessage

data ContractNotFoundAdditionalInfo

Additional debugging information provided only by IDE Ledger

data PackageName

Used for vetting and unvetting packages

PackageName

Field

Type

Description

name

Text

version

Text

Functions

tryCommands

: Script a -> Script (Either FailedCmd a)

Internal testing tool that allows us to catch FailedCmds in the daml language

liftFailedCommandToFailureStatus

: Script a -> Script a

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 the daml 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 the daml 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 the daml 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 the daml 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 the daml 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 the daml 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