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

# Daml.Script.Internal

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

<span id="module-daml-script-internal-18793" />

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

## Module Snapshot

<CardGroup cols={2}>
  <Card title="Lifecycle">
    Stable.
  </Card>

  <Card title="Notices">
    Status: `active`
    Introduced in: `3.4.9`
    Removed in: `-`
    Warnings: `0`
    Deprecations: `0`
    Deprecated since: `-`
  </Card>
</CardGroup>

## Data Types

<span id="type-daml-script-internal-questions-testing-commandname-12991" />

### `data CommandName`

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

Constructors:

<span id="constr-daml-script-internal-questions-testing-commandname-12826" />

* `CommandName`

<ResponseField name="getCommandName" type="Text" />

Instances:

* `instance Eq CommandName`
* `instance Show CommandName`
* `instance GetField commandName FailedCmd CommandName`
* `instance GetField getCommandName CommandName Text`
* `instance SetField commandName FailedCmd CommandName`
* `instance SetField getCommandName CommandName Text`

<span id="type-daml-script-internal-questions-testing-errorclassname-49861" />

### `data ErrorClassName`

Scala class name of the exception thrown

Constructors:

<span id="constr-daml-script-internal-questions-testing-errorclassname-42862" />

* `ErrorClassName`

<ResponseField name="getErrorClassName" type="Text" />

Instances:

* `instance Eq ErrorClassName`
* `instance Show ErrorClassName`
* `instance GetField errorClassName FailedCmd ErrorClassName`
* `instance GetField getErrorClassName ErrorClassName Text`
* `instance SetField errorClassName FailedCmd ErrorClassName`
* `instance SetField getErrorClassName ErrorClassName Text`

<span id="type-daml-script-internal-questions-testing-errormessage-78991" />

### `data ErrorMessage`

Result of the `getMessage` method on the Scala exception

Constructors:

<span id="constr-daml-script-internal-questions-testing-errormessage-24784" />

* `ErrorMessage`

<ResponseField name="getErrorMessage" type="Text" />

Instances:

* `instance Eq ErrorMessage`
* `instance Show ErrorMessage`
* `instance GetField errorMessage FailedCmd ErrorMessage`
* `instance GetField getErrorMessage ErrorMessage Text`
* `instance SetField errorMessage FailedCmd ErrorMessage`
* `instance SetField getErrorMessage ErrorMessage Text`

<span id="type-daml-script-internal-questions-testing-failedcmd-88074" />

### `data FailedCmd`

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

Constructors:

<span id="constr-daml-script-internal-questions-testing-failedcmd-77803" />

* `FailedCmd`

<ResponseField name="commandName" type="CommandName" />

<ResponseField name="errorClassName" type="ErrorClassName" />

<ResponseField name="errorMessage" type="ErrorMessage" />

Instances:

* `instance Eq FailedCmd`
* `instance Show FailedCmd`
* `instance GetField commandName FailedCmd CommandName`
* `instance GetField errorClassName FailedCmd ErrorClassName`
* `instance GetField errorMessage FailedCmd ErrorMessage`
* `instance SetField commandName FailedCmd CommandName`
* `instance SetField errorClassName FailedCmd ErrorClassName`
* `instance SetField errorMessage FailedCmd ErrorMessage`

<span id="type-daml-script-internal-questions-submit-error-contractnotfoundadditionalinfo-6199" />

### `data ContractNotFoundAdditionalInfo`

Additional debugging information provided only by IDE Ledger

Instances:

* `instance Show ContractNotFoundAdditionalInfo`
* `instance GetField actAs ContractNotFoundAdditionalInfo [Party]`
* `instance GetField additionalDebuggingInfo SubmitError (Optional ContractNotFoundAdditionalInfo)`
* `instance GetField additionalInfoCid ContractNotFoundAdditionalInfo AnyContractId`
* `instance GetField effectiveAt ContractNotFoundAdditionalInfo Text`
* `instance GetField observers ContractNotFoundAdditionalInfo [Party]`
* `instance GetField readAs ContractNotFoundAdditionalInfo [Party]`
* `instance SetField actAs ContractNotFoundAdditionalInfo [Party]`
* `instance SetField additionalDebuggingInfo SubmitError (Optional ContractNotFoundAdditionalInfo)`
* `instance SetField additionalInfoCid ContractNotFoundAdditionalInfo AnyContractId`
* `instance SetField effectiveAt ContractNotFoundAdditionalInfo Text`
* `instance SetField observers ContractNotFoundAdditionalInfo [Party]`
* `instance SetField readAs ContractNotFoundAdditionalInfo [Party]`

<span id="type-daml-script-internal-questions-packages-packagename-68696" />

### `data PackageName`

Used for vetting and unvetting packages

Constructors:

<span id="constr-daml-script-internal-questions-packages-packagename-3807" />

* `PackageName`

<ResponseField name="name" type="Text" />

<ResponseField name="version" type="Text" />

Instances:

* `instance IsQuestion ListAllPackages [PackageName]`
* `instance IsQuestion ListVettedPackages [PackageName]`
* `instance Eq PackageName`
* `instance Ord PackageName`
* `instance Show PackageName`
* `instance GetField name PackageName Text`
* `instance GetField packages UnvetPackages [PackageName]`
* `instance GetField packages VetPackages [PackageName]`
* `instance GetField version PackageName Text`
* `instance SetField name PackageName Text`
* `instance SetField packages UnvetPackages [PackageName]`
* `instance SetField packages VetPackages [PackageName]`
* `instance SetField version PackageName Text`

## Functions

<span id="function-daml-script-internal-questions-testing-trycommands-17332" />

### `tryCommands`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
tryCommands : Script a -> Script (Either FailedCmd a)
```

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

<span id="function-daml-script-internal-questions-testing-liftfailedcommandtofailurestatus-62416" />

### `liftFailedCommandToFailureStatus`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
liftFailedCommandToFailureStatus : Script a -> Script a
```

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

<span id="function-daml-script-internal-questions-submit-error-isnotactive-40539" />

### `isNotActive`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
isNotActive : ContractNotFoundAdditionalInfo -> Optional AnyContractId
```

Exacts nonactive contract ID from ContractNotFoundAdditionalInfo

<span id="function-daml-script-internal-questions-packages-vetpackages-16211" />

### `vetPackages`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

<span id="function-daml-script-internal-questions-packages-vetpackagesonparticipant-8324" />

### `vetPackagesOnParticipant`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

<span id="function-daml-script-internal-questions-packages-unvetpackages-80050" />

### `unvetPackages`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

<span id="function-daml-script-internal-questions-packages-unvetpackagesonparticipant-47459" />

### `unvetPackagesOnParticipant`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

<span id="function-daml-script-internal-questions-packages-listvettedpackages-3001" />

### `listVettedPackages`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

<span id="function-daml-script-internal-questions-packages-listallpackages-50063" />

### `listAllPackages`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

<span id="function-daml-script-internal-questions-partymanagement-allocatereplicatedpartyon-96671" />

### `allocateReplicatedPartyOn`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

<span id="function-daml-script-internal-questions-partymanagement-allocatereplicatedpartywithhinton-30144" />

### `allocateReplicatedPartyWithHintOn`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
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.

<span id="function-daml-script-internal-questions-exceptions-throwanyexception-70957" />

### `throwAnyException`

```daml theme={"theme":{"light":"github-light","dark":"github-dark"}}
throwAnyException : AnyException -> Script t
```

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