generated from codama-idl/renderers-demo
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Currently we generate an enum for accounts and instructions.
I think we should instead generate these as eg:
export const TokenAccount = {
Mint: "Mint",
Token: "Token",
Multisig: "Multisig",
} as const;This would make them more legible when logged, and would give cleaner/more tree shakeable generated code.
To get the list of account names you'd need to use keyof typeof TokenAccount, but otherwise the use should be very similar to the current enum.
We would also need to update how we render DefinedTypeNode which is currently rendered as an enum. It might make sense to do similar to the above for that, or to do a union type.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels