Skip to content

feat(dynamic-client): extract dynamic-address-resolution#996

Open
mikhd wants to merge 3 commits into
codama-idl:mainfrom
hoodieshq:feat/pr1-dynamic-address-resolution
Open

feat(dynamic-client): extract dynamic-address-resolution#996
mikhd wants to merge 3 commits into
codama-idl:mainfrom
hoodieshq:feat/pr1-dynamic-address-resolution

Conversation

@mikhd
Copy link
Copy Markdown
Contributor

@mikhd mikhd commented May 12, 2026

Description

This PR [1] extracts Account address resolution functionality from dynamic-client into dynamic-address-resolution package (including standalone PDA resolution). Package dynamic-client was cleaned and now uses dynamic-address-resolution.

Change

  • dynamic-address-resolution contains full functionality of Address resolution for the given Instruction's Account. Exports resolveStandalonePda, resolveInstructionAccountAddress and address helpers.
    • We only move files around with few re-namings and fixes of imports. util files and tests displayed as new are not new.
  • Added generics to exported functions, so they can consume generated types.
  • Cleaned dynamic-client.

Minor

  • Re-named isConvertibleAddress -> isAddressConvertible, createInputValueTransformer -> createCodecInputTransformer.
  • Duplicated three tiny cross-package helpers (formatValueType, safeStringify, getMaybeNodeKind - 20 lines of code) to avoid exposing them as public functions for now.
  • Moved tests files around to align with the new package folder structure.

Public API:

dynamic-address-resolution

// Resolvers
export { resolveInstructionAccountAddress, resolveStandalonePda } from './resolvers';

// Visitors
export { createCodecInputTransformer, createDefaultValueEncoderVisitor } from './visitors';

// Helpers
export { isPublicKeyLike, isAddressConvertible, toAddress } from './shared/address';
export { OPTIONAL_NODE_KINDS } from './shared/nodes';

// Types
export type { AccountsInput, ArgumentsInput, ResolverFn, ResolversInput, ResolverFnInput } from './shared/types';
export type { AddressInput, PublicKeyLike } from './shared/address';

dynamic-client

Unchanged

Notes

This is 1st out of 4 forthcoming dependent PRs. In the next we will do more in terms of spliting:

  1. Extract dynamic-instructions - it will contain functionality for building Solana kit Instruction and AccountMeta. Uses dynamic-address-resolution.

  2. Split type generations between dynamic-address-resolution, dynamic-instructions, dynamic-client packages.

  3. Refactor constant pda seeds resolution.

mikhd added 2 commits May 12, 2026 15:17
* feat: extract dynamic-address-resolution

* feat: add dynamic-address-resolution to dynamic-client

- Cleaned dynamic-client from dynamic-address-resolution files
- Hook dynamic-address-resolution, fix imports

* chore: re-build custom idls

* fix: cleanup

* feat: export DEFAULT_VALUE_ENCODER_SUPPORTED_NODE_KINDS from dynamic-address-resolution

* fix: types import

* fix: async describe

* fix: cleanup
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

🦋 Changeset detected

Latest commit: 5d6add5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@codama/dynamic-address-resolution Minor
@codama/dynamic-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant