Off-ledger settlement in Daml Finance - how to include a reference id?

Hi there, it is possible to allocate/approve Daml Finance Settlement Instruction for off-ledger settlement, but I can’t see any way to add a reference ID for the off-ledger transaction. Is there any way to do it? Essentially I want the settler to be able to verify that some transaction has taken place off-ledger by looking up a reference ID in the external system

Hi @huw,

If you’d like to reference an off-ledger settlement for an Instruction instance, say with key k, you could consider creating a custom keyed template called OffledgerSettled with the same key value k. This template can also include the referenceId.

You can then make adjustments to the Instruction implementation to use a fetchByKey to retrieve the corresponding OffledgerSettlement and its referenceId. Additionally, you may consider exercising a choice on the OffledgerSettlement template to indicate that it has been accounted for.

This is just a suggestion, but I hope it helps!

Johan