Skip to content

Instantly share code, notes, and snippets.

template PartcipantRole
with
provider : Party
cro : Party
coordinator: Party
participant : Party
trialBrochure : ClinicalTrialBrochure
where
signatory provider, participant
key(participant, provider) : (Party, Party)
template ParticipantRecord
with
provider : Party
cro : Party
coordinator: Party
participant : Party
trialBrochure : ClinicalTrialBrochure
symptoms : [Symptoms]
doses : [Doses]
where
template ClinicalTrialNetwork
with
operator : Party
where
signatory operator
controller operator can
nonconsuming InviteRegulator : ContractId RegulatorInvitation
with
regulator : Party
import Ledger, { CreateEvent, Query, Stream, StreamCloseEvent, QueryResult } from '@daml/ledger';
var ledger = new Ledger({token, ledgerUrl, reconnectThreshold: 60});
var activeContractSet = ledger.query();
const {loading, contract} = useStreamFetchByKey(T, () => k, ...);
-- becomes
const {loading, contracts} = useStreamFetchByKeys(T, () => [k], ...));
const contract = contracts[0];
useStreamQuery(T) --> useStreamQueries(T)
useStreamQuery(T, () => query, ...) --> useStreamQueries(T, () => [query], ...)
\party acs time commandsInFlight state -> do
let subscribers = getContracts @Subscriber acs
expr
-- becomes
\party -> do
time <- getTime
commandsInFlight <- getCommandsInFlight
subscribers <- query @Subscriber
\acs msg state -> let subscribers = getContracts @Subscriber acs
in expr
-- becomes
\msg -> do
subscribers <- query @Subscriber
modify $ \state -> expr
\acs -> let subscribers = getContracts @Subscriber acs
in expr
-- becomes
do
subscribers <- query @Subscriber
return expr
codegen:
js:
output-directory: ui/daml.js
npm-scope: daml.js