pub struct Staking(/* private fields */);Expand description
Builds extrinsics for the staking pallet.
Methods that accept AccountIdLike or MultiAddressLike parameters will panic if the provided
value cannot be converted into the expected on-chain representation.
Implementations§
Source§impl Staking
impl Staking
Sourcepub fn bond(
&self,
value: u128,
payee: RewardDestination,
) -> SubmittableTransaction
pub fn bond( &self, value: u128, payee: RewardDestination, ) -> SubmittableTransaction
Bonds funds from the controller with the provided reward destination.
§Arguments
value- Amount of stake to bond.payee- Destination where rewards should be paid.
§Returns
Returns a SubmittableTransaction that bonds the specified amount.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn bond_extra(&self, value: u128) -> SubmittableTransaction
pub fn bond_extra(&self, value: u128) -> SubmittableTransaction
Adds additional stake on top of an existing bond.
§Arguments
value- Additional stake to add to the bonded balance.
§Returns
Returns a SubmittableTransaction that increases the bonded amount.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn unbond(&self, value: u128) -> SubmittableTransaction
pub fn unbond(&self, value: u128) -> SubmittableTransaction
Starts unbonding the given amount of funds.
§Arguments
value- Amount of stake to unbond.
§Returns
Returns a SubmittableTransaction that schedules the unbonding.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn rebond(&self, value: u128) -> SubmittableTransaction
pub fn rebond(&self, value: u128) -> SubmittableTransaction
Re-bonds a portion of funds that are currently unbonding.
§Arguments
value- Amount of stake to re-bond.
§Returns
Returns a SubmittableTransaction that re-bonds the requested amount.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn validate(&self, commission: u32, blocked: bool) -> SubmittableTransaction
pub fn validate(&self, commission: u32, blocked: bool) -> SubmittableTransaction
Advertises validator preferences for the caller.
§Arguments
commission- Desired commission percentage.blocked- Flag indicating whether new nominations are rejected.
§Returns
Returns a SubmittableTransaction that publishes the validator preferences.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn nominate(
&self,
targets: Vec<impl Into<MultiAddressLike>>,
) -> SubmittableTransaction
pub fn nominate( &self, targets: Vec<impl Into<MultiAddressLike>>, ) -> SubmittableTransaction
Nominates a new set of validator targets.
§Panics
Panics if any provided target cannot be converted into a MultiAddress.
§Arguments
targets- Validators to nominate.
§Returns
Returns a SubmittableTransaction that updates the nomination targets.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn payout_stakers(
&self,
validator_stash: impl Into<AccountIdLike>,
era: u32,
) -> SubmittableTransaction
pub fn payout_stakers( &self, validator_stash: impl Into<AccountIdLike>, era: u32, ) -> SubmittableTransaction
Pays out staking rewards for the given validator and era.
§Panics
Panics if validator_stash cannot be converted into an AccountId.
§Arguments
validator_stash- Stash account whose rewards are claimed.era- Era for which rewards are paid out.
§Returns
Returns a SubmittableTransaction that triggers the payout.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn set_controller(&self) -> SubmittableTransaction
pub fn set_controller(&self) -> SubmittableTransaction
Switches the controller account for the stash.
§Returns
Returns a SubmittableTransaction that sets a new controller (based on the signature).
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn set_payee(&self, payee: RewardDestination) -> SubmittableTransaction
pub fn set_payee(&self, payee: RewardDestination) -> SubmittableTransaction
Updates the staking reward destination.
§Arguments
payee- Destination where new rewards should be deposited.
§Returns
Returns a SubmittableTransaction that updates the reward destination.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn chill(&self) -> SubmittableTransaction
pub fn chill(&self) -> SubmittableTransaction
Stops nominating for the caller.
§Returns
Returns a SubmittableTransaction that chills the caller’s nominations.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn chill_other(
&self,
stash: impl Into<AccountIdLike>,
) -> SubmittableTransaction
pub fn chill_other( &self, stash: impl Into<AccountIdLike>, ) -> SubmittableTransaction
Issues a chill for another stash account.
§Panics
Panics if stash cannot be converted into an AccountId.
§Arguments
stash- Stash account to chill.
§Returns
Returns a SubmittableTransaction that chills the specified stash.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn withdraw_unbonded(
&self,
num_slashing_spans: u32,
) -> SubmittableTransaction
pub fn withdraw_unbonded( &self, num_slashing_spans: u32, ) -> SubmittableTransaction
Withdraws funds that have completed the unbonding period.
§Arguments
num_slashing_spans- Number of slashing spans to consider when finalising the withdrawal.
§Returns
Returns a SubmittableTransaction that withdraws matured unbonded funds.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn reap_stash(
&self,
stash: impl Into<AccountIdLike>,
num_slashing_spans: u32,
) -> SubmittableTransaction
pub fn reap_stash( &self, stash: impl Into<AccountIdLike>, num_slashing_spans: u32, ) -> SubmittableTransaction
Removes a stash that no longer has bonded funds.
§Panics
Panics if stash cannot be converted into an AccountId.
§Arguments
stash- Stash account to reap.num_slashing_spans- Number of slashing spans considered during reaping.
§Returns
Returns a SubmittableTransaction that reaps the empty stash.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn kick(
&self,
who: Vec<impl Into<MultiAddressLike>>,
) -> SubmittableTransaction
pub fn kick( &self, who: Vec<impl Into<MultiAddressLike>>, ) -> SubmittableTransaction
Removes the provided nominees from the caller’s nomination list.
§Panics
Panics if any identifier in who cannot be converted into a MultiAddress.
§Arguments
who- Nominees to remove.
§Returns
Returns a SubmittableTransaction that removes the specified nominees.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn force_apply_min_commission(
&self,
validator_stash: impl Into<AccountIdLike>,
) -> SubmittableTransaction
pub fn force_apply_min_commission( &self, validator_stash: impl Into<AccountIdLike>, ) -> SubmittableTransaction
Forces the commission for the given validator to the chain minimum.
§Panics
Panics if validator_stash cannot be converted into an AccountId.
§Arguments
validator_stash- Stash account whose commission is being forced.
§Returns
Returns a SubmittableTransaction that enforces the minimum commission.
§Errors
Does not perform network calls; transaction construction never fails.
Sourcepub fn payout_stakers_by_page(
&self,
validator_stash: impl Into<AccountIdLike>,
era: u32,
page: u32,
) -> SubmittableTransaction
pub fn payout_stakers_by_page( &self, validator_stash: impl Into<AccountIdLike>, era: u32, page: u32, ) -> SubmittableTransaction
Pays out staking rewards for a subset of nominators.
§Panics
Panics if validator_stash cannot be converted into an AccountId.
§Arguments
validator_stash- Stash account whose rewards are being claimed.era- Era for which rewards are paid.page- Page index selecting which nominators to payout.
§Returns
Returns a SubmittableTransaction that triggers the paged payout.
§Errors
Does not perform network calls; transaction construction never fails.
Auto Trait Implementations§
impl !RefUnwindSafe for Staking
impl !UnwindSafe for Staking
impl Freeze for Staking
impl Send for Staking
impl Sync for Staking
impl Unpin for Staking
impl UnsafeUnpin for Staking
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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> ⓘ
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> ⓘ
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 moreimpl<T> JsonSchemaMaybe for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§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,
self and passes that borrow into the pipe function. Read moreSource§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,
self and passes that borrow into the pipe function. Read moreSource§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
Source§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
Source§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
self, then passes self.as_ref() into the pipe function.Source§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
self, then passes self.as_mut() into the pipe
function.Source§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
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§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
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§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
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.