Minor Changes
-
#175
716f6efThanks @ChiefWoods! - Generate typed program constants in program-specific files under a top-levelconstantsdirectory and re-export them from the generated client. -
#177
67b330dThanks @macalinao! - Add a newimportExtensionoption that appends explicit extensions to relative imports in generated code —.js/.tsfor generated files and/index.js//index.tsfor generated directories. This enables consumers using Node ESM resolution, Deno, Node type stripping, or TypeScript'sallowImportingTsExtensions/rewriteRelativeImportExtensionsoptions. -
#178
68385f9Thanks @macalinao! - Add a newerasableSyntaxoption that replaces generatedenumdeclarations withconstobjects and union types, making generated clients compatible with TypeScript'serasableSyntaxOnlyoption and Node.js type stripping. -
#174
a6221c9Thanks @ChiefWoods! - Add event generation fromEventNodes. Each program event is rendered into a dedicatedevents/page containing its discriminator constants, a typed event payload, encoder/decoder/codec functions and aparseXxxEventhelper validating the event discriminators before decoding. Program pages additionally expose an event enum and anidentifyMyProgramEventhelper mirroring the existing account and instruction identification helpers. Event codecs reference their discriminator constants instead of inlining the bytes, and all generated names are configurable through the neweventDataType,eventParseFunction,programEventsEnum,programEventsEnumVariantandprogramEventsIdentifierFunctionname transformers. -
#188
114b8caThanks @amilz! - Forward the program address to linked PDA default values in async instruction buildersInstruction accounts defaulting to a linked PDA were derived by calling the generated
find*Pda()function with no config, so the derivation always used the address baked into that function and silently ignored theprogramAddresspassed to the instruction builder. Programs deployed at different addresses per cluster produced instructions aimed at the overridden program with PDAs derived from the original one.Async builders now pass
{ programAddress }through to the find function when the PDA is derived from the instruction's own program, matching what the generatedfetch*FromSeedsaccount helpers already did. PDAs owned by another program, or pinned to an explicit program ID, keep their own address.This changes generated output for any client with a same-program linked PDA default, so regenerate after upgrading. PDA finders supplied through
linkOverrides.pdasare called with the same signature as generated ones, so they must accept a trailingconfig: { programAddress?: Address }argument.
Patch Changes
- #176
3764a46Thanks @macalinao! - Group type-only imports asimport type { ... }statements so that generated code no longer leaves empty side-effect imports in JavaScript emitted underverbatimModuleSyntax, and fix a missingtypekeyword on PDA seeds type imports in account PDA helpers. Consumers regenerating clients will see cosmeticimport { type A }→import type { A }diffs.