Skip to main content

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. View Type: EventLogView Choices:

Choice Archive

Controllers: Signatories of implementing template Returns: ()

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.
Controllers: admin Returns: EventLog_HoldingsChangeResult Arguments:
Party
Instrument admin reporting the change in holdings.
Account
The account for which the change in holdings occurred.
[ContractId Holding]
The holdings of the account that were consumed.They MUST be archived in the same transaction and they MUST be ownedby the account specified in this change.Note that these MAY include holdings that were created and archivedwithin the same transaction. Such holding contract ids will occurin both the input and output list of holdings.
[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 iszero MAY result in events that do have empty input and outputholdings.Note also that merging and splitting of holdings MAY be reported withan empty list of transfer legs, as the merge and split actions may notbe related to a (self-)transfer of tokens.
[ContractId Holding]
The newly created holdings of the account.
[Party]
Parties that should be notified about the change in holdings.MUST include at least the account parties.
ExtraArgs
Arguments storing both metadata and additional context information about the event.Use splice.lfdecentralizedtrust.org/reason to explain the reason for the overall changein holdings.The ChoiceContext is provided to allow storing extra links to contract-ids, which isnot possible using Metadata alone, as contract-ids cannot be stored as Text.
Methods:

Method eventLog_holdingsChangeImpl

Type: 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. Constructors:
  • EventLogView
Party
Instrument admin reporting the change in holdings.
Metadata
Additional metadata about the event log, used for extensibility.
Instances:

data EventLog_HoldingsChangeResult

Result of logging a change in holdings event. Provided for extensibility in a future where interfaces are upgradeable. Constructors:
  • EventLog_HoldingsChangeResult
(no fields) Instances:

data TransferLegSide

A side of a transfer of holdings between two parties. Used to report transfer events on the affected accounts. Constructors:
  • TransferLegSide
Text
An identifier for the transfer leg intended to correlate the senderand receiver sides.
TransferSide
The side of the transfer that this leg refers to.
Account
The account on the other side of the transfer leg; i.e., the senderin case of side == ReceiverSide, and the receiver in case ofside == SenderSide.
Decimal
The amount to transfer.
Text
The instrument identifier used by the instrument admin.
Metadata
Additional metadata about the transfer leg, used for extensibility.
Instances:

data TransferSide

A side of a transfer. Constructors:
  • SenderSide
The outbound side of a transfer, i.e., the sending of assets.
  • ReceiverSide
The inbound direction, i.e., the receipt of assets. Instances:

Functions

eventLog_holdingsChangeImpl

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