getAccountMetaFactory
Creates a factory function that converts resolved instruction accounts to account metas.
The factory handles the conversion of ResolvedInstructionAccount objects into AccountMeta or AccountSignerMeta objects suitable for building instructions. It also determines how to handle optional accounts based on the provided strategy.
Parameters
| Parameter | Type | Description |
|---|---|---|
programAddress | Address | The program address, used when optional accounts use the programId strategy. |
optionalAccountStrategy | "omitted" | "programId" | How to handle null account values: - 'omitted': Optional accounts are excluded from the instruction entirely. - 'programId': Optional accounts are replaced with the program address as a read-only account. |
Returns
A factory function that converts a resolved account to an account meta.
Parameters
| Parameter | Type |
|---|---|
inputName | string |
account | ResolvedInstructionAccount |
Returns
| AccountMeta<string>
| AccountSignerMeta<string, TransactionSigner<string>>
| undefined