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

source

pub const SEED: &'static [u8; 15] = b"royalty_account"

source

pub fn create_key(payer: &Pubkey, program_id: &Pubkey) -> (Pubkey, u8)

source

pub fn new( fee_payer: Pubkey, royalty_payer: Pubkey, recipient_ata: Pubkey, expiration_date: u64, royalty_basis_points: u16 ) -> Self

source

pub fn save(&self, dst: &mut [u8]) -> ProgramResult

source

pub fn from_account_info( a: &AccountInfo<'_> ) -> Result<RoyaltyAccount, ProgramError>

source

pub fn close(&mut self)

source

pub fn calculate_royalty_amount(&self, amount: u64) -> Result<u64, ProgramError>

Trait Implementations§

source§

impl BorshDeserialize for RoyaltyAccount

source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>

source§

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>

Deserialize this instance from a slice of bytes.
source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

source§

impl BorshSerialize for RoyaltyAccount

source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>

source§

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.
source§

impl BorshSize for RoyaltyAccount

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> AbiExample for T

source§

default fn example() -> T

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V