pub struct InitializeStorageAccountV2<'info> {
pub storage_config: Box<Account<'info, StorageConfig>>,
pub user_info: Box<Account<'info, UserInfo>>,
pub storage_account: Box<Account<'info, StorageAccountV2>>,
pub stake_account: Box<Account<'info, TokenAccount>>,
pub token_mint: Account<'info, Mint>,
pub owner_1: Signer<'info>,
pub uploader: Signer<'info>,
pub owner_1_token_account: Box<Account<'info, TokenAccount>>,
pub system_program: Program<'info, System>,
pub token_program: Program<'info, Token>,
pub rent: Sysvar<'info, Rent>,
}Expand description
This InitializeStorageAccount context is used to initialize a StorageAccount which stores a user’s
storage information including stake token account address, storage requested, and access keys.
Fields§
§storage_config: Box<Account<'info, StorageConfig>>This account is a PDA that holds the storage configuration, including current cost per byte,
user_info: Box<Account<'info, UserInfo>>This account is a PDA that holds a user’s info (not specific to one storage account).
storage_account: Box<Account<'info, StorageAccountV2>>This account is a PDA that holds a user’s storage account information.
Upgraded to StorageAccountV2.
stake_account: Box<Account<'info, TokenAccount>>This token account serves as the account which holds user’s stake for file storage.
token_mint: Account<'info, Mint>This is the token in question for staking.
owner_1: Signer<'info>This is the user who is initializing the storage account and is automatically added as an admin
uploader: Signer<'info>Uploader needs to sign as this txn needs to be fulfilled on the middleman server to create the ceph bucket
owner_1_token_account: Box<Account<'info, TokenAccount>>This is the user’s token account with which they are staking
system_program: Program<'info, System>System Program
token_program: Program<'info, Token>Token Program
rent: Sysvar<'info, Rent>Rent Program
Trait Implementations§
Source§impl<'info> Accounts<'info> for InitializeStorageAccountV2<'info>where
'info: 'info,
impl<'info> Accounts<'info> for InitializeStorageAccountV2<'info>where
'info: 'info,
Source§fn try_accounts(
program_id: &Pubkey,
accounts: &mut &[AccountInfo<'info>],
ix_data: &[u8],
__bumps: &mut BTreeMap<String, u8>,
__reallocs: &mut BTreeSet<Pubkey>,
) -> Result<Self>
fn try_accounts( program_id: &Pubkey, accounts: &mut &[AccountInfo<'info>], ix_data: &[u8], __bumps: &mut BTreeMap<String, u8>, __reallocs: &mut BTreeSet<Pubkey>, ) -> Result<Self>
Mint account from the SPL token program in a particular
field, then it should be impossible for this method to return Ok if
any other account type is given–from the SPL token program or elsewhere. Read moreSource§impl<'info> AccountsExit<'info> for InitializeStorageAccountV2<'info>where
'info: 'info,
impl<'info> AccountsExit<'info> for InitializeStorageAccountV2<'info>where
'info: 'info,
Source§impl<'info> ToAccountInfos<'info> for InitializeStorageAccountV2<'info>where
'info: 'info,
impl<'info> ToAccountInfos<'info> for InitializeStorageAccountV2<'info>where
'info: 'info,
fn to_account_infos(&self) -> Vec<AccountInfo<'info>>
Source§impl<'info> ToAccountMetas for InitializeStorageAccountV2<'info>
impl<'info> ToAccountMetas for InitializeStorageAccountV2<'info>
Source§fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>
fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>
is_signer is given as an optional override for the signer meta field.
This covers the edge case when a program-derived-address needs to relay
a transaction from a client to another program but sign the transaction
before the relay. The client cannot mark the field as a signer, and so
we have to override the is_signer meta field given by the client.Auto Trait Implementations§
impl<'info> Freeze for InitializeStorageAccountV2<'info>
impl<'info> !RefUnwindSafe for InitializeStorageAccountV2<'info>
impl<'info> !Send for InitializeStorageAccountV2<'info>
impl<'info> !Sync for InitializeStorageAccountV2<'info>
impl<'info> Unpin for InitializeStorageAccountV2<'info>
impl<'info> UnsafeUnpin for InitializeStorageAccountV2<'info>
impl<'info> !UnwindSafe for InitializeStorageAccountV2<'info>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more