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

# Splice.Expiry

> Documentation for Splice.Expiry

Functions for computing amulet and lock expiry times and conditions.

## Data Types

**data** BoundedSet a

> A symbolic representation of a set of values of type `a` useful for computing upper-bounds.
>
> Singleton a
>
> > `Singleton x` represents the singleton set `{x}`
>
> AfterMaxBound
>
> > `AfterMaxBound` represents the set of all values larger than the maximal value that can be represented by type `a`
>
> **instance** [Functor](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-base-functor-31205) BoundedSet
>
> **instance** [Eq](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-classes-eq-22713) a => [Eq](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-classes-eq-22713) (BoundedSet a)
>
> **instance** [Show](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-show-show-65360) a => [Show](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-show-show-65360) (BoundedSet a)

**data** TimeLock

> A lock held by multiple parties until its expiry.
>
> TimeLock
>
> > | Field | Type | Description |
> > | - | - | - |
> > | holders | \[[Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932)] | |
> > | expiresAt | [Time](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-time-63886) | |
> > | optContext | [Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952) | Short, human-readable description of the context in which the amulet is locked. Intended for wallets to inform the user about the reason for the lock. Consider what details to share about the context, as that might be private and the string here will be public information. |
>
> **instance** FromAnyValue TimeLock
>
> **instance** ToAnyValue TimeLock
>
> **instance** [Eq](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-classes-eq-22713) TimeLock
>
> **instance** [Ord](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-classes-ord-6395) TimeLock
>
> **instance** [Show](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-show-show-65360) TimeLock
>
> **instance** GetField "expiresAt" TimeLock [Time](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-time-63886)
>
> **instance** GetField "holders" TimeLock \[[Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932)]
>
> **instance** GetField "lock" LockedAmulet TimeLock
>
> **instance** GetField "lock" PreprocessedTransferOutput ([Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) TimeLock)
>
> **instance** GetField "lock" TransferOutput ([Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) TimeLock)
>
> **instance** GetField "optContext" TimeLock ([Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952))
>
> **instance** SetField "expiresAt" TimeLock [Time](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-time-63886)
>
> **instance** SetField "holders" TimeLock \[[Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932)]
>
> **instance** SetField "lock" LockedAmulet TimeLock
>
> **instance** SetField "lock" PreprocessedTransferOutput ([Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) TimeLock)
>
> **instance** SetField "lock" TransferOutput ([Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) TimeLock)
>
> **instance** SetField "optContext" TimeLock ([Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952))

## Functions

maxInt
: [Int](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-int-37261)

maxDecimalDiv10
: [Decimal](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-decimal-18135)

minTime
: [Time](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-time-63886)

The smallest time point that can be represented by the `Time` type.

maxTime
: [Time](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-time-63886)

The largest time point that can be represented by the `Time` type.

amountExpiresAt
: ExpiringAmount -> BoundedSet Round

Compute the round where the amulet expires. i.e. the amulet is fully expired.

isAmuletExpired
: Round -> ExpiringAmount -> [Bool](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-bool-66265)

`isAmuletExpired openRound amuletAmount` computes whether the expiring `amuletAmount` is definitely expired in case the `openRound` is open.
