pub struct CrateToken {
pub mint: Pubkey,
pub bump: u8,
pub fee_setter_authority: Pubkey,
pub fee_to_setter: Pubkey,
pub issue_authority: Pubkey,
pub withdraw_authority: Pubkey,
pub author_fee_to: Pubkey,
pub issue_fee_bps: u16,
pub withdraw_fee_bps: u16,
}Expand description
Contains the info of a crate token. Immutable. The account associated with this struct is also the mint/freeze authority.
Fields§
§mint: Pubkeyanchor_spl::token::Mint of the CrateToken.
bump: u8Bump.
Authority that can modify the CrateToken’s fees.
fee_to_setter: PubkeyAuthority that can modify who can change the fees.
Authority that is allowed to issue new shares of the Crate. This is usually a program that will handle users depositing tokens into the crate + giving them shares of the crate.
Authority that is allowed to withdraw any token from the Crate. Withdrawals may be subject to fees.
Account which is the recipient of issue/withdraw (“author”) fees. If fees do not exist, this is unused.
issue_fee_bps: u16The issuance fee in bps. crate::ISSUE_FEE_BPS of this fee goes to the Crate DAO.
withdraw_fee_bps: u16The issuance fee in bps. crate::WITHDRAW_FEE_BPS of this fee goes to the Crate DAO.
Implementations§
Source§impl CrateToken
impl CrateToken
Sourcepub fn apply_issue_fee(&self, amount: u64) -> Result<Fees>
pub fn apply_issue_fee(&self, amount: u64) -> Result<Fees>
Applies the issuance fee.
Sourcepub fn apply_withdraw_fee(&self, amount: u64) -> Result<Fees>
pub fn apply_withdraw_fee(&self, amount: u64) -> Result<Fees>
Applies the withdraw fee.
Trait Implementations§
Source§impl AccountDeserialize for CrateToken
impl AccountDeserialize for CrateToken
Source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Mint account into a token
Account.Source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
Source§impl AccountSerialize for CrateToken
impl AccountSerialize for CrateToken
Source§impl BorshDeserialize for CrateToken
impl BorshDeserialize for CrateToken
Source§impl BorshSerialize for CrateToken
impl BorshSerialize for CrateToken
Source§impl Clone for CrateToken
impl Clone for CrateToken
Source§fn clone(&self) -> CrateToken
fn clone(&self) -> CrateToken
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CrateToken
impl Debug for CrateToken
Source§impl Default for CrateToken
impl Default for CrateToken
Source§fn default() -> CrateToken
fn default() -> CrateToken
Source§impl Discriminator for CrateToken
impl Discriminator for CrateToken
fn discriminator() -> [u8; 8]
Source§impl PartialEq for CrateToken
impl PartialEq for CrateToken
impl Copy for CrateToken
impl Eq for CrateToken
impl StructuralPartialEq for CrateToken
Auto Trait Implementations§
impl Freeze for CrateToken
impl RefUnwindSafe for CrateToken
impl Send for CrateToken
impl Sync for CrateToken
impl Unpin for CrateToken
impl UnwindSafe for CrateToken
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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