canton-network-docs/Splice APIsSplice Daml PackagesToken Standard v2splice-api-token-transfer-events-v2
Splice.Api.Token.TransferEventsV2
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:
- All changes to the holdings of all regular accounts, including holdings that were created and archived within a single transaction.
- All incoming and outgoing transfers for all regular accounts.
admin
Returns: EventLog_HoldingsChangeResult
Arguments:
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 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.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 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.
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 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.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
admin
Party
Instrument admin reporting the change in holdings.
meta
Metadata
Additional metadata about the event log, used for extensibility.
- instance
EqEventLogView - instance
ShowEventLogView - instance
HasFromAnyViewEventLogEventLogView - instance
HasInterfaceViewEventLogEventLogView - instance
GetFieldadminEventLogViewParty - instance
GetFieldmetaEventLogViewMetadata - instance
SetFieldadminEventLogViewParty - instance
SetFieldmetaEventLogViewMetadata
data EventLog_HoldingsChangeResult
Result of logging a change in holdings event. Provided for extensibility
in a future where interfaces are upgradeable.
Constructors:
EventLog_HoldingsChangeResult
- instance
HasMethodEventLogeventLog_holdingsChangeImpl(ContractIdEventLog->EventLog_HoldingsChange->UpdateEventLog_HoldingsChangeResult) - instance
HasExerciseEventLogEventLog_HoldingsChangeEventLog_HoldingsChangeResult - instance
HasExerciseGuardedEventLogEventLog_HoldingsChangeEventLog_HoldingsChangeResult - instance
HasFromAnyChoiceEventLogEventLog_HoldingsChangeEventLog_HoldingsChangeResult - instance
HasToAnyChoiceEventLogEventLog_HoldingsChangeEventLog_HoldingsChangeResult
data TransferLegSide
A side of a transfer of holdings between two parties.
Used to report transfer events on the affected accounts.
Constructors:
TransferLegSide
transferLegId
Text
An identifier for the transfer leg intended to correlate the senderand 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 senderin case of
side == ReceiverSide, and the receiver in case ofside == 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
EqTransferLegSide - instance
OrdTransferLegSide - instance
ShowTransferLegSide - instance
GetFieldamountTransferLegSideDecimal - instance
GetFieldinstrumentIdTransferLegSideText - instance
GetFieldmetaTransferLegSideMetadata - instance
GetFieldothersideTransferLegSideAccount - instance
GetFieldsideTransferLegSideTransferSide - instance
GetFieldtransferLegIdTransferLegSideText - instance
GetFieldtransferLegSidesEventLog_HoldingsChange[TransferLegSide] - instance
SetFieldamountTransferLegSideDecimal - instance
SetFieldinstrumentIdTransferLegSideText - instance
SetFieldmetaTransferLegSideMetadata - instance
SetFieldothersideTransferLegSideAccount - instance
SetFieldsideTransferLegSideTransferSide - instance
SetFieldtransferLegIdTransferLegSideText - instance
SetFieldtransferLegSidesEventLog_HoldingsChange[TransferLegSide]
data TransferSide
A side of a transfer.
Constructors:
SenderSide
ReceiverSide
- instance
EqTransferSide - instance
OrdTransferSide - instance
ShowTransferSide - instance
GetFieldsideTransferLegSideTransferSide - instance
SetFieldsideTransferLegSideTransferSide
Functions
eventLog_holdingsChangeImpl
eventLog_holdingsChangeImpl : EventLog -> ContractId EventLog -> EventLog_HoldingsChange -> Update EventLog_HoldingsChangeResult