pub struct Account {
pub public_key: CompressedPubKey,
pub token_id: TokenId,
pub token_symbol: TokenSymbol,
pub balance: Balance,
pub nonce: Nonce,
pub receipt_chain_hash: ReceiptChainHash,
pub delegate: Option<CompressedPubKey>,
pub voting_for: VotingFor,
pub timing: Timing,
pub permissions: Permissions<AuthRequired>,
pub zkapp: Option<Box<ZkAppAccount>>,
}
Fields§
§public_key: CompressedPubKey
§token_id: TokenId
§token_symbol: TokenSymbol
the token_symbol
describes a token id owned by the account id
from this account, not the token id used by this account
balance: Balance
§nonce: Nonce
§receipt_chain_hash: ReceiptChainHash
§delegate: Option<CompressedPubKey>
§voting_for: VotingFor
§timing: Timing
§permissions: Permissions<AuthRequired>
§zkapp: Option<Box<ZkAppAccount>>
Implementations§
Source§impl Account
impl Account
pub fn create_with(account_id: AccountId, balance: Balance) -> Self
pub fn delegate_or_empty(&self) -> MyCow<'_, CompressedPubKey>
pub fn zkapp_or_empty(&self) -> MyCow<'_, Box<ZkAppAccount>>
pub fn initialize(account_id: &AccountId) -> Self
pub fn deserialize(bytes: &[u8]) -> Self
pub fn serialize(&self) -> Vec<u8> ⓘ
pub fn empty() -> Self
pub fn id(&self) -> AccountId
pub fn has_locked_tokens(&self, global_slot: Slot) -> bool
pub fn has_locked_tokens_checked( &self, global_slot: &CheckedSlot<Fp>, w: &mut Witness<Fp>, ) -> Boolean
pub fn liquid_balance_at_slot(&self, global_slot: Slot) -> Balance
pub fn min_balance_at_slot(&self, global_slot: Slot) -> Balance
Sourcepub fn has_permission_to(&self, control: ControlTag, to: PermissionTo) -> bool
pub fn has_permission_to(&self, control: ControlTag, to: PermissionTo) -> bool
pub fn checked_has_permission_to<F: FieldWitness>( &self, consts: PermsConst, signature_verifies: Option<Boolean>, to: PermissionTo, w: &mut Witness<F>, ) -> Boolean
Sourcepub fn has_permission_to_send(&self) -> bool
pub fn has_permission_to_send(&self) -> bool
true iff account has permissions set that enable them to transfer Mina (assuming the command is signed)
Sourcepub fn has_permission_to_receive(&self) -> bool
pub fn has_permission_to_receive(&self) -> bool
true iff account has permissions set that enable them to receive Mina
Sourcepub fn has_permission_to_set_delegate(&self) -> bool
pub fn has_permission_to_set_delegate(&self) -> bool
true iff account has permissions set that enable them to set their delegate (assuming the command is signed)
Sourcepub fn has_permission_to_increment_nonce(&self) -> bool
pub fn has_permission_to_increment_nonce(&self) -> bool
true iff account has permissions set that enable them to increment their nonce (assuming the command is signed)
pub fn hash(&self) -> Fp
pub fn checked_hash(&self, w: &mut Witness<Fp>) -> Fp
pub fn rand() -> Self
Trait Implementations§
Source§impl AccountInterface for Account
impl AccountInterface for Account
type W = ()
type Bool = bool
type Balance = Balance
type GlobalSlot = Slot
type D = ()
type VerificationKeyHash = Option<Fp256<FpParameters>>
fn register_verification_key(&self, data: &Self::D, w: &mut Self::W)
fn get(&self) -> &Account
fn get_mut(&mut self) -> &mut Account
fn set_delegate(&mut self, new: CompressedPubKey)
fn zkapp(&self) -> MyCow<'_, ZkAppAccount>
fn zkapp_mut(&mut self) -> &mut ZkAppAccount
fn verification_key_hash(&self) -> Option<Fp>
fn set_token_id(&mut self, token_id: TokenId)
fn is_timed(&self) -> Self::Bool
fn balance(&self) -> Self::Balance
fn set_balance(&mut self, balance: Self::Balance)
fn check_timing( &self, txn_global_slot: &Self::GlobalSlot, w: &mut Self::W, ) -> (TimingValidation<Self::Bool>, Timing)
fn make_zkapp(&mut self)
fn unmake_zkapp(&mut self)
fn proved_state(&self) -> Self::Bool
fn set_proved_state(&mut self, proved_state: Self::Bool)
fn app_state(&self) -> [Fp; 8]
fn last_action_slot(&self) -> Self::GlobalSlot
fn set_last_action_slot(&mut self, slot: Self::GlobalSlot)
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Account> for MinaBaseAccountBinableArgStableV2
impl From<&Account> for MinaBaseAccountBinableArgStableV2
Source§impl ToFieldElements<Fp256<FpParameters>> for Box<Account>
impl ToFieldElements<Fp256<FpParameters>> for Box<Account>
fn to_field_elements(&self, fields: &mut Vec<Fp>)
fn to_field_elements_owned(&self) -> Vec<F>
Source§impl ToInputs for Account
impl ToInputs for Account
fn to_inputs(&self, inputs: &mut Inputs)
fn to_inputs_owned(&self) -> Inputs
fn hash_with_param(&self, param: &LazyParam) -> Fp
fn checked_hash_with_param(&self, param: &LazyParam, w: &mut Witness<Fp>) -> Fp
impl Eq for Account
impl StructuralPartialEq for Account
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
Blanket Implementations§
§impl<T> BinProtSize for Twhere
T: BinProtWrite,
impl<T> BinProtSize for Twhere
T: BinProtWrite,
fn binprot_size(&self) -> usize
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
Source§impl<T> FromBinProtStream for Twhere
T: BinProtRead,
impl<T> FromBinProtStream for Twhere
T: BinProtRead,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.