> ## 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.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# Daml.Script.Internal

> Reference documentation for Daml module Daml.Script.Internal.

Daml module

# Daml.Script.Internal

Contains all Internal and Alpha functionality provided by Daml Script.

Daml

[Updated 3.7.5](#history-updated-3-7-5)

Module
Daml.Script.Internal

Latest release
3.7.5

## Data Types

### `data FailedCmd`

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

Constructors:

* `FailedCmd`

**commandName** `CommandName`

**errorClassName** `ErrorClassName`

**errorMessage** `ErrorMessage`

Instances:

* instance `Eq` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517)
* instance `Show` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517)
* instance `GetField` `commandName` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`CommandName`](#type-daml-script-internal-questions-testing-stable-commandname-commandname-51757)
* instance `GetField` `errorClassName` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`ErrorClassName`](#type-daml-script-internal-questions-testing-stable-errorclassname-errorclassname-12295)
* instance `GetField` `errorMessage` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`ErrorMessage`](#type-daml-script-internal-questions-testing-stable-errormessage-errormessage-8491)
* instance `SetField` `commandName` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`CommandName`](#type-daml-script-internal-questions-testing-stable-commandname-commandname-51757)
* instance `SetField` `errorClassName` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`ErrorClassName`](#type-daml-script-internal-questions-testing-stable-errorclassname-errorclassname-12295)
* instance `SetField` `errorMessage` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`ErrorMessage`](#type-daml-script-internal-questions-testing-stable-errormessage-errormessage-8491)

### `data ErrorMessage`

Result of the `getMessage` method on the Scala exception

Constructors:

* `ErrorMessage`

**getErrorMessage** `Text`

Instances:

* instance `Eq` [`ErrorMessage`](#type-daml-script-internal-questions-testing-stable-errormessage-errormessage-8491)
* instance `Show` [`ErrorMessage`](#type-daml-script-internal-questions-testing-stable-errormessage-errormessage-8491)
* instance `GetField` `errorMessage` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`ErrorMessage`](#type-daml-script-internal-questions-testing-stable-errormessage-errormessage-8491)
* instance `GetField` `getErrorMessage` [`ErrorMessage`](#type-daml-script-internal-questions-testing-stable-errormessage-errormessage-8491) `Text`
* instance `SetField` `errorMessage` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`ErrorMessage`](#type-daml-script-internal-questions-testing-stable-errormessage-errormessage-8491)
* instance `SetField` `getErrorMessage` [`ErrorMessage`](#type-daml-script-internal-questions-testing-stable-errormessage-errormessage-8491) `Text`

### `data ErrorClassName`

Scala class name of the exception thrown

Constructors:

* `ErrorClassName`

**getErrorClassName** `Text`

Instances:

* instance `Eq` [`ErrorClassName`](#type-daml-script-internal-questions-testing-stable-errorclassname-errorclassname-12295)
* instance `Show` [`ErrorClassName`](#type-daml-script-internal-questions-testing-stable-errorclassname-errorclassname-12295)
* instance `GetField` `errorClassName` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`ErrorClassName`](#type-daml-script-internal-questions-testing-stable-errorclassname-errorclassname-12295)
* instance `GetField` `getErrorClassName` [`ErrorClassName`](#type-daml-script-internal-questions-testing-stable-errorclassname-errorclassname-12295) `Text`
* instance `SetField` `errorClassName` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`ErrorClassName`](#type-daml-script-internal-questions-testing-stable-errorclassname-errorclassname-12295)
* instance `SetField` `getErrorClassName` [`ErrorClassName`](#type-daml-script-internal-questions-testing-stable-errorclassname-errorclassname-12295) `Text`

### `data CommandName`

Name of the Daml Script Command (or Question) that failed

Constructors:

* `CommandName`

**getCommandName** `Text`

Instances:

* instance `Eq` [`CommandName`](#type-daml-script-internal-questions-testing-stable-commandname-commandname-51757)
* instance `Show` [`CommandName`](#type-daml-script-internal-questions-testing-stable-commandname-commandname-51757)
* instance `GetField` `commandName` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`CommandName`](#type-daml-script-internal-questions-testing-stable-commandname-commandname-51757)
* instance `GetField` `getCommandName` [`CommandName`](#type-daml-script-internal-questions-testing-stable-commandname-commandname-51757) `Text`
* instance `SetField` `commandName` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) [`CommandName`](#type-daml-script-internal-questions-testing-stable-commandname-commandname-51757)
* instance `SetField` `getCommandName` [`CommandName`](#type-daml-script-internal-questions-testing-stable-commandname-commandname-51757) `Text`

### `data ContractNotFoundAdditionalInfo`

Additional debugging information provided only by IDE Ledger

Instances:

* instance `Show` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199)
* instance `GetField` `actAs` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) \[`Party`]
* instance `GetField` `additionalDebuggingInfo` [`ContractNotFoundSubmitError`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-submit-error-contractnotfoundsubmiterror-39189) (`Optional` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199))
* instance `GetField` `additionalInfoCid` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) [`AnyContractId`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-util-stable-anycontractid-anycontractid-68288)
* instance `GetField` `effectiveAt` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) `Text`
* instance `GetField` `observers` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) \[`Party`]
* instance `GetField` `readAs` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) \[`Party`]
* instance `SetField` `actAs` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) \[`Party`]
* instance `SetField` `additionalDebuggingInfo` [`ContractNotFoundSubmitError`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-submit-error-contractnotfoundsubmiterror-39189) (`Optional` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199))
* instance `SetField` `additionalInfoCid` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) [`AnyContractId`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-util-stable-anycontractid-anycontractid-68288)
* instance `SetField` `effectiveAt` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) `Text`
* instance `SetField` `observers` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) \[`Party`]
* instance `SetField` `readAs` [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) \[`Party`]

### `data PackageName`

Used for vetting and unvetting packages

Constructors:

* `PackageName`

**name** `Text`

**version** `Text`

Instances:

* instance `IsQuestion` `ListAllPackages` \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)]
* instance `IsQuestion` `ListVettedPackages` \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)]
* instance `Eq` [`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)
* instance `Ord` [`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)
* instance `Show` [`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)
* instance `GetField` `packages` `UnvetPackages` \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)]
* instance `GetField` `packages` `VetPackages` \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)]
* instance `SetField` `packages` `UnvetPackages` \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)]
* instance `SetField` `packages` `VetPackages` \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)]

## Functions

### `tryCommands`

`tryCommands` : [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) `a` -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) (`Either` [`FailedCmd`](#type-daml-script-internal-questions-testing-stable-failedcmd-failedcmd-6517) `a`)

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

### `liftFailedCommandToFailureStatus`

`liftFailedCommandToFailureStatus` : [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) `a` -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) `a`

Runs a script and lifts FailedCmd scala exceptions into a FailureStatus, which can be caught via tryFailureStatus

### `isNotActive`

`isNotActive` : [`ContractNotFoundAdditionalInfo`](#type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199) -> `Optional` [`AnyContractId`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-util-stable-anycontractid-anycontractid-68288)

Exacts nonactive contract ID from ContractNotFoundAdditionalInfo

### `vetPackages`

`vetPackages` : `HasCallStack` => \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)] -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) ()

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`

`vetPackagesOnParticipant` : `HasCallStack` => \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)] -> [`ParticipantName`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-partymanagement-stable-participantname-participantname-29562) -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) ()

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`

`unvetPackages` : `HasCallStack` => \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)] -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) ()

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`

`unvetPackagesOnParticipant` : `HasCallStack` => \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)] -> [`ParticipantName`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-partymanagement-stable-participantname-participantname-29562) -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) ()

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`

`listVettedPackages` : `HasCallStack` => [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)]

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`

`listAllPackages` : `HasCallStack` => [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) \[[`PackageName`](#type-daml-script-internal-questions-packages-stable-packagename-packagename-80649)]

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`

`allocateReplicatedPartyOn` : `Text` -> [`ParticipantName`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-partymanagement-stable-participantname-participantname-29562) -> \[[`ParticipantName`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-partymanagement-stable-participantname-participantname-29562)] -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) `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`

`allocateReplicatedPartyWithHintOn` : `Text` -> [`PartyIdHint`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-partymanagement-stable-partyidhint-partyidhint-41530) -> [`ParticipantName`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-partymanagement-stable-participantname-participantname-29562) -> \[[`ParticipantName`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-questions-partymanagement-stable-participantname-participantname-29562)] -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) `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`

`throwAnyException` : `AnyException` -> [`Script`](https://docs.canton.network/appdev/reference/daml-script/daml-script#type-daml-script-internal-lowlevel-stable-script-script-12809) `t`

Throws an `AnyException`, note that this function discards the stacktrace

## History

Updated
`3.7.5`

Module declarations or documentation updated.

Updated
`3.7.3`

Module declarations or documentation updated.

Updated
`3.7.0`

Module declarations or documentation updated.

Updated
`3.6.0`

Module declarations or documentation updated.

Updated
`3.5.12`

Module declarations or documentation updated.

Updated
`3.5.2`

Module declarations or documentation updated.

Updated
`3.5.1`

Module declarations or documentation updated.

Updated
`3.4.11`

Module declarations or documentation updated.

Updated
`3.4.10`

Module declarations or documentation updated.
