DAML React template and using contract key to fetch contracts
App Development2 posts386 views5 likesLast activity Jan 2021
MA
ManishGroverOP
Jan 2021Hi,
I think I’ve seen this question before but can’t seem to find it.
How would I use a contract key from the DAML ui template? The contract key is (signatory party id, a unique key).
const classes = useStyles();
const party = useParty();
const ledger = useLedger();
const assets = useStreamQuery(Client).contracts;
thank you.
ST
Stephen
Jan 2021There are a bunch of things you can do with contract keys, each with their own signatures. The Getting Started guide supplies a few examples:
Keys are well-typed when you use codegen, so I strongly recommend letting TypeScript guide you in formatting your key data for these functions properly.