Steps to reproduce:
-- Edit daml.yaml so sdk-version: 1.7.0
daml build
daml codegen js .daml/dist/my-app-0.1.0.dar -o ui/daml.js
daml deploy --host localhost --port 6865
daml json-api --ledger-host localhost --ledger-port 6865 --http-port 7575 --address 0.0.0.0 --allow-insecure-tokens
cd ui/
export REACT_APP_LEDGER_ID=fabric-ledger
npm install
npm start
All building works up until npm start
where I get the following error which I believe may be related to the recent api change in fetchByKey
and similar functions:
/Users/anthonylusardi/software/my-app/ui/src/components/LoginScreen.tsx
TypeScript error in /Users/anthonylusardi/software/my-app/ui/src/components/LoginScreen.tsx(25,50):
Argument of type 'Template<User, string, "b5b1f86483ff42ebfdea3ef260a6407140906dcb8b3b7f4b0f8ca0b99c7ac5ce:User:User"> & { Archive: Choice<User, Archive, {}, string>; Follow: Choice<...>; }' is not assignable to parameter of type 'Template<object, string, string>'.
Type 'Template<User, string, "b5b1f86483ff42ebfdea3ef260a6407140906dcb8b3b7f4b0f8ca0b99c7ac5ce:User:User"> & { Archive: Choice<User, Archive, {}, string>; Follow: Choice<...>; }' is missing the following properties from type 'Template<object, string, string>': sdkVersion, keyEncode, encode TS2345
23 | try {
24 | const ledger = new Ledger({token: credentials.token, httpBaseUrl});
> 25 | let userContract = await ledger.fetchByKey(User.User, credentials.party);
| ^
26 | if (userContract === null) {
27 | const user = {username: credentials.party, following: []};
28 | userContract = await ledger.create(User.User, user);