Skip to content

feat: Accept HasAddress inputs in the ATA instruction plans - #186

Merged
lorisleiva merged 7 commits into
solana-program:mainfrom
amilz:js/has-address-ata-plans
Oct 16, 2026
Merged

lorisleiva merged 7 commits into
solana-program:mainfrom
amilz:js/has-address-ata-plans

Conversation

@amilz

@amilz amilz commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Lets the hand-written helpers accept HasAddress inputs (e.g. a web3.js v3 PublicKey), matching the generated client.

// before
await getMintToATAInstructionPlanAsync({ mint: mint.publicKey.toBase58(), owner: payer.publicKey.toBase58(), ... });
// after
await getMintToATAInstructionPlanAsync({ mint: mint.publicKey, owner: payer.publicKey, ... });
  • mintToATA / transferToATA: address, authority and program override inputs widened to InstructionAccountInput / Address | HasAddress.
  • createMint: mint/freeze authorities and program overrides accept HasAddress.
  • Bumps @codama/renderers-js to 2.7.0 (PDA seeds, data args, fetchers and program overrides accept HasAddress), dropping the now-redundant unwraps.
  • tokenProgram({ programAddress }) forwards to the generated plugin and defaults the program for batch, createMint, mintToATA and transferToATA.

FYI @lorisleiva

@amilz amilz changed the title Accept HasAddress inputs in the ATA instruction plans feat: Accept HasAddress inputs in the ATA instruction plans Oct 9, 2026
lorisleiva
lorisleiva previously approved these changes Oct 11, 2026

@lorisleiva lorisleiva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for tackling those!

…n plans

Widen `authority` (transferToATA) and `mintAuthority` (mintToATA) from
`Address | TransactionSigner` to `InstructionAccountInput | InstructionSignerInput`,
matching the generated instructions, so a HasAddress such as a multisig can be
passed alongside `multiSigners`.

Program overrides (`systemProgram`, `tokenProgram`, `associatedTokenProgram`)
in createMint, mintToATA and transferToATA now accept `Address | HasAddress`
and are unwrapped only when provided, keeping the existing defaults.
amilz added 2 commits October 14, 2026 14:10
The renderer now accepts `Address | HasAddress` for public key inputs
(instruction data args, PDA seeds, account data args). Generated clients
require @solana/kit ^8.5.0, so bump it accordingly.
Widen `mintAuthority` to `Address | HasAddress` and `freezeAuthority` to
`OptionOrNullable<Address | HasAddress>`, matching the regenerated
`getInitializeMint2Instruction`. The async ATA plans now pass
`tokenProgram` straight to `findAssociatedTokenPda`, whose seeds accept
`HasAddress`.
amilz and others added 3 commits October 15, 2026 07:16
The renderer now accepts HasAddress program address overrides, so the
ATA instruction plans pass their program configs through without
unwrapping. The token plugin accepts an optional programAddress that
defaults the program for generated, batch and plan-based instructions.
Bumps `@solana-program/system` to 0.16 and the Kit plugins to 0.19 in the JS client. System 0.16's `getCreateAccountInstruction` accepts `HasAddress` program addresses, so `getCreateMintInstructionPlan` no longer needs to unwrap the `systemProgram` and `tokenProgram` overrides before passing them through.
@lorisleiva
lorisleiva merged commit bf3261c into solana-program:main Oct 16, 2026
30 checks passed
@amilz
amilz deleted the js/has-address-ata-plans branch October 16, 2026 11:59
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