Daml finance app - structuring vs structuringAuto
App Development2 posts175 views3 likesLast activity Nov 2022
BR
BrunoRTLOP
Nov 2022MA
Matteo_Limberto
Nov 2022Hi @BrunoRTL,
In the daml-finance-app, a service is a contract entered by two parties (resp. the provider and the customer) that have a business relationship.
The Structuring service is used to originate new instruments. This is a two step approach, where
- the customer requests for a new instrument to be created (e.g., via
RequestCreateToken) - the provider accepts the request and creates the desired instrument (e.g., via
CreateToken)
Running this workflow in the UI requires to
- log in as the customer to exercise
RequestCreateToken - log in as the provider to exercise
CreateToken - log back in as the customer to see the new instrument
Given that this gets a bit cumbersome when show-casing the app in a demo, there is an additional AutoService where the instrument creation request is automatically accepted by the provider (RequestAndCreateToken).
This way the above process just becomes
- log in as the customer and exercise
RequestAndCreateToken
Regarding your second question, the highlighted code just returns a message if there is no structuring service on the ledger for the current party.
I hope this clarifies it!
Matteo
