You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const accountAddress = "...";
const myAccount = await myProgram.account.myAccount.fetch(accountAddress);
const counterPlusOne = myAccount.counter + 1; // Assuming the counter has been initialised
Results in TS2365: Operator '+' cannot be applied to types 'unknown' and '1'.
Vec<String> fields map to unknown type in Typescript. Only the types defined in TypeMap are considered when determining how to map a Vec<T> to some T'[].
The text was updated successfully, but these errors were encountered:
We've run up against two small issues when working in Typescript with the types generated for account fields from the IDLs.
Option<T>
fields map tounknown
type in Typescript whenT
is one of the standard types defined inTypeMap
, e.g.,Results in
TS2365: Operator '+' cannot be applied to types 'unknown' and '1'.
Vec<String>
fields map tounknown
type in Typescript. Only the types defined inTypeMap
are considered when determining how to map aVec<T>
to someT'[]
.The text was updated successfully, but these errors were encountered: