I am trying to follow the examples provided on the Solana website to create and implement a transfer-hook program. I have successfully built and deployed the example program provided here, then minted spl-tokens with the transfer-hook program using
spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token --transfer-hook <TRANSFER_HOOK_PROGRAM_ID>
The guide then states you can can then initialize the transfer-hook account with the provided CLI from here using
spl-transfer-hook create-extra-metas <PROGRAM_ID> <MINT_ID> [<ACCOUNT_PUBKEY>:<ROLE> ...]
I understand that this will call the InitializeExtraAccountMetas
function from the transfer hook program, but what specially belongs in [<ACCOUNT_PUBKEY>:<ROLE> ...]
? Is this were I put the address of the account that holds the extra_account_metas
? It is my understanding that at this point said account does not exist. Am I missing a step here?
[<ACCOUNT_PUBKEY>:<ROLE> ...]
is optional and is not needed for the example program. The cli will then create the account from the Program ID and the Mint ID usingspl_transfer_hook_interface::get_extra_account_metas_address(token, program_id)
. I would appreciate if someone could write a more complete answer explaining this interface.