Skip to content

Conversation

@atharmohammad
Copy link
Contributor

@atharmohammad atharmohammad commented Jul 12, 2025

  1. Support for generating decoders with optional accounts, it considers 3 cases:
  • Optional account in middle: These are used with PROGRAM_ID as placeholders to skip, can be omitted on user end.
  • Optional accounts in the end: Accounts like Rent are omitted in some transactions and crashes indexer.
  • Optional accounts marked with optional (In Legacy IDL) and IsOptional
  1. Added next_account in account_utils for common utility functions.

  2. Generated MPL Token Metadata decoder with latest IDL v1.14

  3. Add tests in mpl-token-metadata-decoder for optional rent account in Instruction CreateMetadataV3.

fixes #334

@KellianDev
Copy link
Contributor

Hey @atharmohammad, I'm reworking the decoder generation with a Codama renderer right now (see #386). I will use the next_account util you wrote and looking at the isOptional field of accounts on the Codama IDLs when generating the ArrangeAccounts implementation. So, ready to merge if the conflicts are fixed OR it will just be done once the CLI update is released 5 to 10 days out.

@atharmohammad atharmohammad force-pushed the feat/optional-accounts branch from b5fafbe to 1150008 Compare July 26, 2025 06:14
@KellianDev
Copy link
Contributor

There's a small clippy issue left @atharmohammad, merging once CI goes through.

Copy link
Contributor

@KellianDev KellianDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KellianDev KellianDev merged commit 958432e into sevenlabs-hq:main Jul 26, 2025
5 checks passed
@atharmohammad atharmohammad deleted the feat/optional-accounts branch July 27, 2025 08:47
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.

BUG! carbon_mpl_token_metadata_decoder CreateMetadataAccountV3 arrange accounts

2 participants