Struct access_protocol::state::RoyaltyAccount
source · pub struct RoyaltyAccount {
pub tag: Tag,
pub rent_payer: Pubkey,
pub royalty_payer: Pubkey,
pub recipient_ata: Pubkey,
pub expiration_date: u64,
pub royalty_basis_points: u16,
}
Fields§
§tag: Tag
Tag
rent_payer: Pubkey
The address that paid for the creation of this PDA
royalty_payer: Pubkey
The address that has to pay royalties from all their claims
recipient_ata: Pubkey
The address that collects the royalties
expiration_date: u64
The date after which the royalties are not paid anymore
royalty_basis_points: u16
The royalty basis points (i.e 1% = 100) going to the recommender
Implementations§
source§impl RoyaltyAccount
impl RoyaltyAccount
pub const SEED: &'static [u8; 15] = b"royalty_account"
pub fn create_key(payer: &Pubkey, program_id: &Pubkey) -> (Pubkey, u8)
pub fn new( fee_payer: Pubkey, royalty_payer: Pubkey, recipient_ata: Pubkey, expiration_date: u64, royalty_basis_points: u16 ) -> Self
pub fn save(&self, dst: &mut [u8]) -> ProgramResult
pub fn from_account_info( a: &AccountInfo<'_> ) -> Result<RoyaltyAccount, ProgramError>
pub fn close(&mut self)
pub fn calculate_royalty_amount(&self, amount: u64) -> Result<u64, ProgramError>
Trait Implementations§
source§impl BorshDeserialize for RoyaltyAccountwhere
Tag: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u16: BorshDeserialize,
impl BorshDeserialize for RoyaltyAccountwhere
Tag: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u16: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for RoyaltyAccount
impl BorshSerialize for RoyaltyAccount
Auto Trait Implementations§
impl Freeze for RoyaltyAccount
impl RefUnwindSafe for RoyaltyAccount
impl Send for RoyaltyAccount
impl Sync for RoyaltyAccount
impl Unpin for RoyaltyAccount
impl UnwindSafe for RoyaltyAccount
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
Mutably borrows from an owned value. Read more