Splice.Api.Token.BurnMintV1

An interface for registries to expose burn/mint operations in a generic way for bridges to use them, and for wallets to parse their use.

Interfaces

interface BurnMintFactory

A factory for generic burn/mint operations.

viewtype BurnMintFactoryView

  • Choice Archive

    Controller: Signatories of implementing template

    Returns: ()

    (no fields)

  • Choice BurnMintFactory_BurnMint

    Burn the holdings in inputHoldingCids and create holdings with the owners and amounts specified in outputs.

    Note that this is jointly authorized by the admin and the extraActors. The admin thus controls all calls to this choice, and some implementations might required extraActors to be present, e.g., the owners of the minted and burnt holdings.

    Implementations are free to restrict the implementation of this choice including failing on all inputs or not implementing this interface at all.

    Controller: (DA.Internal.Record.getField @"admin" (view this)) :: extraActors

    Returns: BurnMintFactory_BurnMintResult

    Field

    Type

    Description

    expectedAdmin

    Party

    The expected admin party issuing the factory. Implementations MUST validate that this matches the admin of the factory. Callers should ensure they get expectedAdmin from a trusted source, e.g., a read against their own participant. That way they can ensure that it is safe to exercise a choice on a factory contract acquired from an untrusted source provided all vetted Daml packages only contain interface implementations that check the expected admin party.

    instrumentId

    InstrumentId

    The instrument id of the holdings. All holdings in inputHoldingCids as well as the resulting output holdings MUST have this instrument id.

    inputHoldingCids

    [ContractId Holding]

    The holdings that should be burnt. All holdings in inputHoldingCids MUST be archived by this choice. Implementations MAY enforce additional restrictions such as all inputHoldingCids belonging to the same owner.

    outputs

    [BurnMintOutput]

    The holdings that should be created. The choice MUST create new holdings with the given amounts.

    extraActors

    [Party]

    Extra actors, the full actors required are the admin + extraActors. This is often the owners of inputHoldingCids and outputs but we allow different sets of actors to support token implementations with different authorization setups.

    extraArgs

    ExtraArgs

    Additional context. Implementations SHOULD include a splice.lfdecentralizedtrust.org/reason key in the metadata to provide a human readable description for explain why the BurnMintFactory_BurnMint choice was called, so that generic wallets can display it to the user.

  • Choice BurnMintFactory_PublicFetch

    Controller: actor

    Returns: BurnMintFactoryView

    Field

    Type

    Description

    expectedAdmin

    Party

    The expected admin party issuing the factory. Implementations MUST validate that this matches the admin of the factory. Callers should ensure they get expectedAdmin from a trusted source, e.g., a read against their own participant. That way they can ensure that it is safe to exercise a choice on a factory contract acquired from an untrusted source provided all vetted Daml packages only contain interface implementations that check the expected admin party.

    actor

    Party

    The party fetching the data.

  • Method burnMintFactory_burnMintImpl : ContractId BurnMintFactory -> BurnMintFactory_BurnMint -> Update BurnMintFactory_BurnMintResult

  • Method burnMintFactory_publicFetchImpl : ContractId BurnMintFactory -> BurnMintFactory_PublicFetch -> Update BurnMintFactoryView

Data Types

data BurnMintFactoryView

The view of a BurnMintFactory.

BurnMintFactoryView

Field

Type

Description

admin

Party

The party representing the registry app that administers the instruments for which this burnt-mint factory can be used.

meta

Metadata

Additional metadata specific to the burn-mint factory, used for extensibility.

instance Eq BurnMintFactoryView

instance Show BurnMintFactoryView

instance HasMethod BurnMintFactory "burnMintFactory_publicFetchImpl" (ContractId BurnMintFactory -> BurnMintFactory_PublicFetch -> Update BurnMintFactoryView)

instance HasFromAnyView BurnMintFactory BurnMintFactoryView

instance HasInterfaceView BurnMintFactory BurnMintFactoryView

instance GetField "admin" BurnMintFactoryView Party

instance GetField "meta" BurnMintFactoryView Metadata

instance SetField "admin" BurnMintFactoryView Party

instance SetField "meta" BurnMintFactoryView Metadata

instance HasExercise BurnMintFactory BurnMintFactory_PublicFetch BurnMintFactoryView

instance HasExerciseGuarded BurnMintFactory BurnMintFactory_PublicFetch BurnMintFactoryView

instance HasFromAnyChoice BurnMintFactory BurnMintFactory_PublicFetch BurnMintFactoryView

instance HasToAnyChoice BurnMintFactory BurnMintFactory_PublicFetch BurnMintFactoryView

data BurnMintFactory_BurnMintResult

The result of calling the BurnMintFactory_BurnMint choice.

BurnMintFactory_BurnMintResult

Field

Type

Description

outputCids

[ContractId Holding]

The holdings created by the choice. Must contain exactly the outputs specified in the choice argument in the same order.

instance Eq BurnMintFactory_BurnMintResult

instance Show BurnMintFactory_BurnMintResult

instance HasMethod BurnMintFactory "burnMintFactory_burnMintImpl" (ContractId BurnMintFactory -> BurnMintFactory_BurnMint -> Update BurnMintFactory_BurnMintResult)

instance GetField "outputCids" BurnMintFactory_BurnMintResult [ContractId Holding]

instance SetField "outputCids" BurnMintFactory_BurnMintResult [ContractId Holding]

instance HasExercise BurnMintFactory BurnMintFactory_BurnMint BurnMintFactory_BurnMintResult

instance HasExerciseGuarded BurnMintFactory BurnMintFactory_BurnMint BurnMintFactory_BurnMintResult

instance HasFromAnyChoice BurnMintFactory BurnMintFactory_BurnMint BurnMintFactory_BurnMintResult

instance HasToAnyChoice BurnMintFactory BurnMintFactory_BurnMint BurnMintFactory_BurnMintResult

data BurnMintOutput

The specification of a holding to create as part of the burn/mint operation.

BurnMintOutput

Field

Type

Description

owner

Party

The owner of the holding to create.

amount

Decimal

The amount of the holding to create.

context

ChoiceContext

Context specific to this output which can be used to support locking or other registry-specific features.

instance Eq BurnMintOutput

instance Show BurnMintOutput

instance GetField "amount" BurnMintOutput Decimal

instance GetField "context" BurnMintOutput ChoiceContext

instance GetField "outputs" BurnMintFactory_BurnMint [BurnMintOutput]

instance GetField "owner" BurnMintOutput Party

instance SetField "amount" BurnMintOutput Decimal

instance SetField "context" BurnMintOutput ChoiceContext

instance SetField "outputs" BurnMintFactory_BurnMint [BurnMintOutput]

instance SetField "owner" BurnMintOutput Party

Functions

burnMintFactory_burnMintImpl

: BurnMintFactory -> ContractId BurnMintFactory -> BurnMintFactory_BurnMint -> Update BurnMintFactory_BurnMintResult

burnMintFactory_publicFetchImpl

: BurnMintFactory -> ContractId BurnMintFactory -> BurnMintFactory_PublicFetch -> Update BurnMintFactoryView

Comments