Deprecated

This Splice documentation site is deprecated. Use the current Canton Network docs.

Open current docs

Splice.Api.Token.TransferEventsV2

Interface to log events for token standard transfers.

Interfaces

interface EventLog

An interface for templates that can be used to report token standard v2 events.

The non-consuming choice of this interface is used by the instrument admin to report token transfers. Make sure to only consider events from the instrument admin as token transfer events for a token.

viewtype EventLogView

  • Choice Archive

    Controller: Signatories of implementing template

    Returns: ()

    (no fields)

  • Choice EventLog_HoldingsChange

    Signal a change in the holdings of an account to the observers.

    Asset admins MUST ensure that these events explain:

    1. All changes to the holdings of all regular accounts, including holdings that were created and archived within a single transaction.

    2. All incoming and outgoing transfers for all regular accounts.

    Controller: admin

    Returns: EventLog_HoldingsChangeResult

    Field

    Type

    Description

    admin

    Party

    Instrument admin reporting the change in holdings.

    account

    Account

    The account for which the change in holdings occurred.

    inputHoldingCids

    [ContractId Holding]

    The holdings of the account that were consumed. They MUST be archived in the same transaction and they MUST be owned by the account specified in this change. Note that these MAY include holdings that were created and archived within the same transaction. Such holding contract ids will occur in both the input and output list of holdings.

    transferLegSides

    [TransferLegSide]

    The transfers that caused the change in holdings. Their net balance changes MUST match the change in holdings of the account. Both sides of a transfer MUST be reported, and their ids must match. Transfer leg ids MUST be unique for different transfer legs. Note that the settlement of transfers whose net balance change is zero MAY result in events that do have empty input and output holdings. Note also that merging and splitting of holdings MAY be reported with an empty list of transfer legs, as the merge and split actions may not be related to a (self-)transfer of tokens.

    outputHoldingCids

    [ContractId Holding]

    The newly created holdings of the account.

    observers

    [Party]

    Parties that should be notified about the change in holdings. MUST include at least the account parties.

    extraArgs

    ExtraArgs

    Arguments storing both metadata and additional context information about the event. Use splice.lfdecentralizedtrust.org/reason to explain the reason for the overall change in holdings. The ChoiceContext is provided to allow storing extra links to contract-ids, which is not possible using Metadata alone, as contract-ids cannot be stored as Text.

  • Method eventLog_holdingsChangeImpl : ContractId EventLog -> EventLog_HoldingsChange -> Update EventLog_HoldingsChangeResult

Data Types

data EventLogView

View of an EventLog contract.

Note that EventLog contracts do not support public fetching, as they are intended to be used by the instrument admin or app provider only.

EventLogView

Field

Type

Description

admin

Party

Instrument admin reporting the change in holdings.

meta

Metadata

Additional metadata about the event log, used for extensibility.

instance Eq EventLogView

instance Show EventLogView

instance HasFromAnyView EventLog EventLogView

instance HasInterfaceView EventLog EventLogView

instance GetField "admin" EventLogView Party

instance GetField "meta" EventLogView Metadata

instance SetField "admin" EventLogView Party

instance SetField "meta" EventLogView Metadata

data EventLog_HoldingsChangeResult

data TransferLegSide

A side of a transfer of holdings between two parties.

Used to report transfer events on the affected accounts.

TransferLegSide

Field

Type

Description

transferLegId

Text

An identifier for the transfer leg intended to correlate the sender and receiver sides.

side

TransferSide

The side of the transfer that this leg refers to.

otherside

Account

The account on the other side of the transfer leg; i.e., the sender in case of side == ReceiverSide, and the receiver in case of side == SenderSide.

amount

Decimal

The amount to transfer.

instrumentId

Text

The instrument identifier used by the instrument admin.

meta

Metadata

Additional metadata about the transfer leg, used for extensibility.

instance Eq TransferLegSide

instance Ord TransferLegSide

instance Show TransferLegSide

instance GetField "amount" TransferLegSide Decimal

instance GetField "instrumentId" TransferLegSide Text

instance GetField "meta" TransferLegSide Metadata

instance GetField "otherside" TransferLegSide Account

instance GetField "side" TransferLegSide TransferSide

instance GetField "transferLegId" TransferLegSide Text

instance GetField "transferLegSides" EventLog_HoldingsChange [TransferLegSide]

instance SetField "amount" TransferLegSide Decimal

instance SetField "instrumentId" TransferLegSide Text

instance SetField "meta" TransferLegSide Metadata

instance SetField "otherside" TransferLegSide Account

instance SetField "side" TransferLegSide TransferSide

instance SetField "transferLegId" TransferLegSide Text

instance SetField "transferLegSides" EventLog_HoldingsChange [TransferLegSide]

data TransferSide

A side of a transfer.

SenderSide

The outbound side of a transfer, i.e., the sending of assets.

ReceiverSide

The inbound direction, i.e., the receipt of assets.

instance Eq TransferSide

instance Ord TransferSide

instance Show TransferSide

instance GetField "side" TransferLegSide TransferSide

instance SetField "side" TransferLegSide TransferSide

Functions

eventLog_holdingsChangeImpl

: EventLog -> ContractId EventLog -> EventLog_HoldingsChange -> Update EventLog_HoldingsChangeResult

Comments