I want to create wallet account via Rust program by using payer & mint account, in that case how to predict the number of bytes to allocate for the new account data so that I can pay less rent ?
let space = spl_token::state::Account::get_packed_len(); //Number of bytes to allocate for the new account data
let rent = rpc.get_minimum_balance_for_rent_exemption(space)?; //Calculate min rent according to expected account data size
//Build instruction for create account
let create_token_acc_ix = solana_program::system_instruction::create_account(
&payer_pubkey,
&wallet_pubkey,
rent,
space as u64,
&spl_token::ID,
);