pub struct CIP36KeyRegistration(/* private fields */);Implementations§
Source§impl CIP36KeyRegistration
impl CIP36KeyRegistration
Sourcepub fn new(
delegation: &CIP36DelegationDistribution,
stake_credential: &CIP36StakeCredential,
payment_address: &Address,
nonce: CIP36Nonce,
) -> Self
pub fn new( delegation: &CIP36DelegationDistribution, stake_credential: &CIP36StakeCredential, payment_address: &Address, nonce: CIP36Nonce, ) -> Self
Creates a new CIP36KeyRegistration. You must then sign self.hash_to_sign() to make a RegistrationWitness.
§Arguments
delegation- Delegationstake_credential- stake address for the network that this transaction is submitted to (to point to the Ada that is being delegated).payment_address- Shelley oayment address discriminated for the same network this transaction is submitted to for receiving awairds.nonce- Monotonically rising across all transactions with the same staking key. Recommended to just use the slot of this tx.
Source§impl CIP36KeyRegistration
impl CIP36KeyRegistration
Sourcepub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
Sourcepub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes using canonical CBOR encodings
Sourcepub fn from_cbor_bytes(
cbor_bytes: &[u8],
) -> Result<CIP36KeyRegistration, JsError>
pub fn from_cbor_bytes( cbor_bytes: &[u8], ) -> Result<CIP36KeyRegistration, JsError>
- Create this type from CBOR bytes
Sourcepub fn to_cbor_hex(&self) -> String
pub fn to_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes encoded as a hex string (useful for working with CIP30).
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
Sourcepub fn to_canonical_cbor_hex(&self) -> String
pub fn to_canonical_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes using canonical CBOR encodings as hex bytes
Sourcepub fn from_cbor_hex(cbor_bytes: &str) -> Result<CIP36KeyRegistration, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<CIP36KeyRegistration, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
Source§impl CIP36KeyRegistration
impl CIP36KeyRegistration
pub fn delegation(&self) -> CIP36DelegationDistribution
pub fn stake_credential(&self) -> CIP36StakeCredential
pub fn payment_address(&self) -> Address
pub fn nonce(&self) -> CIP36Nonce
pub fn set_voting_purpose(&mut self, voting_purpose: CIP36VotingPurpose)
pub fn voting_purpose(&self) -> CIP36VotingPurpose
Trait Implementations§
Source§impl AsRef<CIP36KeyRegistration> for CIP36KeyRegistration
impl AsRef<CIP36KeyRegistration> for CIP36KeyRegistration
Source§fn as_ref(&self) -> &CIP36KeyRegistration
fn as_ref(&self) -> &CIP36KeyRegistration
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for CIP36KeyRegistration
impl Clone for CIP36KeyRegistration
Source§fn clone(&self) -> CIP36KeyRegistration
fn clone(&self) -> CIP36KeyRegistration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CIP36KeyRegistration
impl Debug for CIP36KeyRegistration
Source§impl From<CIP36KeyRegistration> for CIP36KeyRegistration
impl From<CIP36KeyRegistration> for CIP36KeyRegistration
Source§fn from(native: CIP36KeyRegistration) -> Self
fn from(native: CIP36KeyRegistration) -> Self
Converts to this type from the input type.
Source§impl From<CIP36KeyRegistration> for JsValue
impl From<CIP36KeyRegistration> for JsValue
Source§fn from(value: CIP36KeyRegistration) -> Self
fn from(value: CIP36KeyRegistration) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for CIP36KeyRegistration
impl FromWasmAbi for CIP36KeyRegistration
Source§impl Into<CIP36KeyRegistration> for CIP36KeyRegistration
impl Into<CIP36KeyRegistration> for CIP36KeyRegistration
Source§fn into(self) -> CIP36KeyRegistration
fn into(self) -> CIP36KeyRegistration
Converts this type into the (usually inferred) input type.
Source§impl IntoWasmAbi for CIP36KeyRegistration
impl IntoWasmAbi for CIP36KeyRegistration
Source§impl RefFromWasmAbi for CIP36KeyRegistration
impl RefFromWasmAbi for CIP36KeyRegistration
Source§type Anchor = RcRef<CIP36KeyRegistration>
type Anchor = RcRef<CIP36KeyRegistration>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl VectorFromWasmAbi for CIP36KeyRegistration
impl VectorFromWasmAbi for CIP36KeyRegistration
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[CIP36KeyRegistration]>
Source§impl VectorIntoJsValue for CIP36KeyRegistration
impl VectorIntoJsValue for CIP36KeyRegistration
fn vector_into_jsvalue(vector: Box<[CIP36KeyRegistration]>) -> JsValue
Source§impl VectorIntoWasmAbi for CIP36KeyRegistration
impl VectorIntoWasmAbi for CIP36KeyRegistration
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[CIP36KeyRegistration]>) -> Self::Abi
Source§impl WasmDescribeVector for CIP36KeyRegistration
impl WasmDescribeVector for CIP36KeyRegistration
impl SupportsConstructor for CIP36KeyRegistration
impl SupportsInstanceProperty for CIP36KeyRegistration
impl SupportsStaticProperty for CIP36KeyRegistration
Auto Trait Implementations§
impl Freeze for CIP36KeyRegistration
impl RefUnwindSafe for CIP36KeyRegistration
impl Send for CIP36KeyRegistration
impl Sync for CIP36KeyRegistration
impl Unpin for CIP36KeyRegistration
impl UnwindSafe for CIP36KeyRegistration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.