GetView - Daml.Finance.Interface.Instrument.Bond.FloatingRate.Instrument
- jvelasco.intellecteuOP 1
Hi,
Is there a reason why the Interface
Daml.Finance.Interface.Instrument.Bond.FloatingRate.Instrumentand the rest of Bond instrument interfaces do not provide a choiceGetViewlike for instanceDaml.Finance.Interface.Instrument.Token.InstrumentorDaml.Finance.Interface.Instrument.Equity.Instrument?Thanks!
Jose - Johan_Sjodin 2
No, there is no reason for that. I think we should add a
github.com/digital-asset/daml-financeGetViewchoice to each instrument interface to be consistent. I have opened a ticket where we can track this.Add `GetView` choice to all `Instrument`s (to be consistent)
opened 01:28PM - 15 Mar 23 UTCcomponent-bond`Daml.Finance.Interface.Instrument.Bond.FloatingRate.Instrument` and the rest of…
It’s worth noting that each instrument has a
GetViewfrom theBase.Instrument, but this won’t provide access to all of the contract’s data.The purpose of the
GetViewchoice is to allow a party, sayAlice, to get the view of a contract, without necessarily being a stakeholder of the contract. This can be useful in situations where someone needs access to reference data, but shouldn’t be a stakeholder of the contract. For example, ifpublicPartyis an observer of aninstrumentCid, andAlicehasreadAsrights ofpublicParty, she can get the view by running:submitMulti [alice] [publicParty] do exerciseCmd instrumentCid GetView with actor = aliceWithout a
GetViewchoice,Alicecould try to get the data by afetchorfetchByKey. However,fetch instrumentCidis not an option forAlicesince the submitting party must be a stakeholder. Similarly,Alicecannot usefetchByKeywithout authorization from at least one stakeholder of the contract. Therefore, theGetViewchoice provides a more accessible way for parties to obtain view-only access to a contract’s data.Thanks for raising this!
Johan