Struct near_primitives::account::AccessKey
source · pub struct AccessKey {
pub nonce: u64,
pub permission: AccessKeyPermission,
}
Expand description
Access key provides limited access to an account. Each access key belongs to some account and
is identified by a unique (within the account) public key. One account may have large number of
access keys. Access keys allow to act on behalf of the account by restricting transactions
that can be issued.
account_id,public_key
is a key in the state
Fields§
§nonce: u64
Nonce for this access key, used for tx nonce generation. When access key is created, nonce
is set to (block_height - 1) * 1e6
to avoid tx hash collision on access key re-creation.
See https://github.com/near/nearcore/issues/3779 for more details.
permission: AccessKeyPermission
Defines permissions for this access key.
Implementations§
source§impl AccessKey
impl AccessKey
pub const ACCESS_KEY_NONCE_RANGE_MULTIPLIER: u64 = 1_000_000u64
pub fn full_access() -> AccessKey
Trait Implementations§
source§impl BorshDeserialize for AccessKey
impl BorshDeserialize for AccessKey
fn deserialize_reader<__R>(reader: &mut __R) -> Result<AccessKey, Error>where
__R: Read,
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 AccessKey
impl BorshSerialize for AccessKey
source§impl<'de> Deserialize<'de> for AccessKey
impl<'de> Deserialize<'de> for AccessKey
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<AccessKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<AccessKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<AccessKey> for AccessKeyView
impl From<AccessKey> for AccessKeyView
source§impl From<AccessKeyView> for AccessKey
impl From<AccessKeyView> for AccessKey
source§fn from(view: AccessKeyView) -> Self
fn from(view: AccessKeyView) -> Self
Converts to this type from the input type.
source§impl PartialEq for AccessKey
impl PartialEq for AccessKey
source§impl Serialize for AccessKey
impl Serialize for AccessKey
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for AccessKey
impl StructuralPartialEq for AccessKey
Auto Trait Implementations§
impl Freeze for AccessKey
impl RefUnwindSafe for AccessKey
impl Send for AccessKey
impl Sync for AccessKey
impl Unpin for AccessKey
impl UnwindSafe for AccessKey
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> CallHasher for T
impl<T> CallHasher for T
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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