Currently, extracting the types for resolved account addresses (public keys) in integration tests requires verbose return type chaining.
Current boilerplate
let pubkeys: Awaited<
ReturnType<
ReturnType<typeof program["methods"]["myMethod"]>["rpcAndKeys"]
>
>["pubkeys"];
Proposed Solution
Introduce a MethodPubkeys utility type in the TypeScript client.
This provides a better way to extract these types directly from the IDL instructions.
New Usage
let pubkeys: anchor.MethodPubkeys<MyIdl, "myMethod">;
Code Locations Affected
ts/packages/anchor/src/program/namespace/types.ts
ts/packages/anchor/src/program/namespace/index.ts