There are two program ids in the code base of solana-program-library
. To be precise:
ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'
TOKEN_PROGRAM_ID = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
And I do not get the idea of separating these two programs and the general use of them. I mean, I'm well aware of the idea of tokens. But why there are two programs? I have flicked through the code and have noticed such a thing, that there is no js
client to associated-token-account
, only program
. And it seems that it is used only as a part of the @solana/spl-token
js client.
As far as I can get it, ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID
serves only one purpose, this is creation of new accounts. Plus, there is fn process_recover_nested(...)
which usage is obscure for me.
So I would appreciate someone's explanation of this differentiation and usage purposes.