Struct mpl_token_metadata::state::TokenRecord
source · #[repr(C)]pub struct TokenRecord {
pub key: Key,
pub bump: u8,
pub state: TokenState,
pub rule_set_revision: Option<u64>,
pub delegate: Option<Pubkey>,
pub delegate_role: Option<TokenDelegateRole>,
pub locked_transfer: Option<Pubkey>,
}
Expand description
The TokenRecord
struct represents the state of the token account holding a pNFT
. Given
that the token account is always frozen, it includes a state
that provides an abstraction
of frozen (locked) and thaw (unlocked).
It also stores state regarding token delegates that are set on the token account: the pubkey of the delegate set (this would match the spl-token account delegate) and the role.
Every token account holding a pNFT
has a token record associated. The seeds for the token
record PDA are:
"metadata"
- program id
- mint id
"token_record"
- token account id
Fields§
§key: Key
Account key.
bump: u8
Derivation bump.
state: TokenState
Represented the token state.
rule_set_revision: Option<u64>
Stores the rule set revision (if any). The revision is updated every time a new token delegate is approved.
delegate: Option<Pubkey>
Pubkey of the current token delegate. This delegate key will match the spl-token delegate pubkey.
delegate_role: Option<TokenDelegateRole>
The role of the current token delegate.
locked_transfer: Option<Pubkey>
Stores the destination pubkey when a transfer is lock to an allowed address. This pubkey gets set when a ‘LockTransfer’ delegate is approved.
Implementations§
Trait Implementations§
source§impl BorshDeserialize for TokenRecordwhere
Key: BorshDeserialize,
u8: BorshDeserialize,
TokenState: BorshDeserialize,
Option<u64>: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Option<TokenDelegateRole>: BorshDeserialize,
impl BorshDeserialize for TokenRecordwhere Key: BorshDeserialize, u8: BorshDeserialize, TokenState: BorshDeserialize, Option<u64>: BorshDeserialize, Option<Pubkey>: BorshDeserialize, Option<TokenDelegateRole>: BorshDeserialize,
source§impl BorshSerialize for TokenRecordwhere
Key: BorshSerialize,
u8: BorshSerialize,
TokenState: BorshSerialize,
Option<u64>: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Option<TokenDelegateRole>: BorshSerialize,
impl BorshSerialize for TokenRecordwhere Key: BorshSerialize, u8: BorshSerialize, TokenState: BorshSerialize, Option<u64>: BorshSerialize, Option<Pubkey>: BorshSerialize, Option<TokenDelegateRole>: BorshSerialize,
source§impl Clone for TokenRecord
impl Clone for TokenRecord
source§fn clone(&self) -> TokenRecord
fn clone(&self) -> TokenRecord
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TokenRecord
impl Debug for TokenRecord
source§impl Default for TokenRecord
impl Default for TokenRecord
source§impl PartialEq<TokenRecord> for TokenRecord
impl PartialEq<TokenRecord> for TokenRecord
source§fn eq(&self, other: &TokenRecord) -> bool
fn eq(&self, other: &TokenRecord) -> bool
self
and other
values to be equal, and is used
by ==
.