pub struct TransactionApi;Implementations§
Source§impl TransactionApi
impl TransactionApi
Sourcepub fn create_multisig(
&self,
signers: Signers,
threshold: Threshold,
nonce: Nonce,
) -> StaticPayload<CreateMultisig>
pub fn create_multisig( &self, signers: Signers, threshold: Threshold, nonce: Nonce, ) -> StaticPayload<CreateMultisig>
Create a new multisig account with deterministic address
Parameters:
signers: List of accounts that can sign for this multisigthreshold: Number of approvals required to execute transactionsnonce: User-provided nonce for address uniqueness
The multisig address is deterministically derived from: hash(pallet_id || sorted_signers || threshold || nonce)
Signers are automatically sorted before hashing, so order doesn’t matter.
Economic costs:
- MultisigFee: burned immediately (spam prevention)
- MultisigDeposit: reserved until dissolution, then returned to creator (storage bond)
Sourcepub fn propose(
&self,
multisig_address: MultisigAddress,
call: Call,
expiry: Expiry,
) -> StaticPayload<Propose>
pub fn propose( &self, multisig_address: MultisigAddress, call: Call, expiry: Expiry, ) -> StaticPayload<Propose>
Propose a transaction to be executed by the multisig
Parameters:
multisig_address: The multisig account that will execute the callcall: The encoded call to executeexpiry: Block number when this proposal expires
The proposer must be a signer and must pay:
- A deposit (refundable - returned immediately on execution/cancellation)
- A fee (non-refundable, burned immediately)
For threshold=1: The proposal is created with Approved status immediately
and can be executed via execute() without additional approvals.
Weight: Charged upfront for worst-case (high-security path with decode). Refunded to actual cost on success based on whether HS path was taken.
Sourcepub fn approve(
&self,
multisig_address: MultisigAddress,
proposal_id: ProposalId,
) -> StaticPayload<Approve>
pub fn approve( &self, multisig_address: MultisigAddress, proposal_id: ProposalId, ) -> StaticPayload<Approve>
Approve a proposed transaction
If this approval brings the total approvals to or above the threshold,
the proposal status changes to Approved and can be executed via execute().
Parameters:
multisig_address: The multisig accountproposal_id: ID (nonce) of the proposal to approve
Weight: Charges for MAX call size, refunds based on actual
Sourcepub fn cancel(
&self,
multisig_address: MultisigAddress,
proposal_id: ProposalId,
) -> StaticPayload<Cancel>
pub fn cancel( &self, multisig_address: MultisigAddress, proposal_id: ProposalId, ) -> StaticPayload<Cancel>
Cancel a proposed transaction (only by proposer)
Parameters:
multisig_address: The multisig accountproposal_id: ID (nonce) of the proposal to cancel
Sourcepub fn remove_expired(
&self,
multisig_address: MultisigAddress,
proposal_id: ProposalId,
) -> StaticPayload<RemoveExpired>
pub fn remove_expired( &self, multisig_address: MultisigAddress, proposal_id: ProposalId, ) -> StaticPayload<RemoveExpired>
Remove expired proposals and return deposits to proposers
Can only be called by signers of the multisig. Removes Active or Approved proposals that have expired (past expiry block). Executed and Cancelled proposals are automatically cleaned up immediately.
Approved+expired proposals can become stuck if proposer is unavailable (e.g. lost keys, compromise). Allowing any signer to remove them prevents permanent deposit lockup and enables multisig dissolution.
The deposit is always returned to the original proposer, not the caller.
Sourcepub fn claim_deposits(
&self,
multisig_address: MultisigAddress,
) -> StaticPayload<ClaimDeposits>
pub fn claim_deposits( &self, multisig_address: MultisigAddress, ) -> StaticPayload<ClaimDeposits>
Claim all deposits from expired proposals
This is a batch operation that removes all expired proposals where:
- Caller is the proposer
- Proposal is Active or Approved and past expiry block
Note: Executed and Cancelled proposals are automatically cleaned up immediately, so only Active+Expired and Approved+Expired proposals need manual cleanup.
Returns all proposal deposits to the proposer in a single transaction.
Sourcepub fn execute(
&self,
multisig_address: MultisigAddress,
proposal_id: ProposalId,
) -> StaticPayload<Execute>
pub fn execute( &self, multisig_address: MultisigAddress, proposal_id: ProposalId, ) -> StaticPayload<Execute>
Execute an approved proposal
Can be called by any signer of the multisig once the proposal has reached the approval threshold (status = Approved). The proposal must not be expired.
On execution:
- The call is decoded and dispatched as the multisig account
- Proposal is removed from storage
- Deposit is returned to the proposer
Parameters:
multisig_address: The multisig accountproposal_id: ID (nonce) of the proposal to execute
Sourcepub fn approve_dissolve(
&self,
multisig_address: MultisigAddress,
) -> StaticPayload<ApproveDissolve>
pub fn approve_dissolve( &self, multisig_address: MultisigAddress, ) -> StaticPayload<ApproveDissolve>
Approve dissolving a multisig account
Signers call this to approve dissolving the multisig. When threshold is reached, the multisig is automatically dissolved.
Requirements:
- Caller must be a signer
- No proposals exist (active, executed, or cancelled) - must be fully cleaned up
- Multisig account balance must be zero
When threshold is reached:
- Deposit is returned to creator
- Multisig storage is removed
Auto Trait Implementations§
impl Freeze for TransactionApi
impl RefUnwindSafe for TransactionApi
impl Send for TransactionApi
impl Sync for TransactionApi
impl Unpin for TransactionApi
impl UnsafeUnpin for TransactionApi
impl UnwindSafe for TransactionApi
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
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
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 moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> 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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moreSource§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.Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.