Solana account is represented by the AccountInfo struct, which can be seen here and whose structure is basically this:
pub struct AccountInfo<'a> {
pub key: &'a Pubkey,
pub is_signer: bool,
pub is_writable: bool,
pub lamports: Rc<RefCell<&'a mut u64>>,
pub data: Rc<RefCell<&'a mut [u8]>>,
pub owner: &'a Pubkey,
pub executable: bool,
pub rent_epoch: Epoch,
}
Now I am reading this page of the documentation about showing the program account from the command line. See here
The following command was ran:
solana program show <ACCOUNT_ADDRESS>
and the result shown as:
Program Id: 3KS2k14CmtnuVv2fvYcvdrNgC94Y11WETBpMUGgXyWZL
Owner: BPFLoaderUpgradeab1e11111111111111111111111
ProgramData Address: EHsACWBhgmw8iq5dmUZzTA1esRqcTognhKNHUkPi4q4g
Authority: FwoGJNUaJN2zfVEex9BB11Dqb3NJKy3e9oY3KTh9XzCU
Last Deployed In Slot: 63890568
Data Length: 5216 (0x1460) bytes
Now I am not sure how to map this to AccountInfo
. Specifically what is Authority
? is it the same as key
in AccountInfo
?
Also how does ProgramData Address
from the output corresponds to data
in AccountInfo
?