Skip to content

Conversation

@ERoydev
Copy link
Collaborator

@ERoydev ERoydev commented Oct 22, 2025

Summary

This renderer now supports instruction arguments used in PDA seeds, allowing automatic seed handling.
Users can invoke instructions without manually preparing seeds, and when reading an account from the generated client, they can simply call the derivePda function with the required parameters.

 final argumentPdaAcc = await deriveArgumentPdaPda('Hello, Seed!');

    final data = await client.getAccountInfo(
      argumentPdaAcc.toBase58(),
      encoding: Encoding.base64,
    );

Key Changes

  • PDA Seed Serialization

    • Added generateDartSeedSerializationCode in src/utils/types.ts for type-based Dart serialization (String, Uint8List, int, BigInt, bool, custom types).
    • Updated generatePdaSeeds and createInlinePdaFile in src/utils/pda.ts to use accurate Dart types and type-aware seed serialization.
  • Instruction Function & Autoderivation

    • Refined autoderivation logic in src/fragments/instructionFunction.ts to support argument-based PDA derivation.
    • Instruction functions now generate type-safe PDA parameters and import PDA files as needed.

@ERoydev ERoydev requested a review from vlady-kotsev October 22, 2025 15:52
Base automatically changed from chore/derive-programId to feat/codama-new-approach October 24, 2025 12:49
Base automatically changed from feat/codama-new-approach to main October 27, 2025 13:20
@ERoydev ERoydev closed this Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants