pub struct AccountConfig { /* private fields */ }
Expand description
Configuration options for setting up or modifying a Stellar account.
Used to configure thresholds and signers for an account. This is particularly useful for creating or modifying multisig accounts with specific threshold requirements.
§Example
use soroban_rs::AccountConfig;
use stellar_strkey::ed25519::PublicKey;
let config = AccountConfig::new()
.with_master_weight(10)
.with_thresholds(1, 5, 10)
.add_signer(PublicKey::from_string("PUBLIC KEY").unwrap(), 5);
Implementations§
Source§impl AccountConfig
impl AccountConfig
Sourcepub fn with_master_weight(self, weight: u32) -> Self
pub fn with_master_weight(self, weight: u32) -> Self
Sets the master key weight for the account.
§Parameters
weight
- The weight to assign to the master key Set to 0 to prevent the master key from being used for signing
Sourcepub fn with_thresholds(self, low: u32, med: u32, high: u32) -> Self
pub fn with_thresholds(self, low: u32, med: u32, high: u32) -> Self
Sets the threshold values for low, medium, and high security operations.
§Parameters
low
- Threshold for low security operations (e.g., setting options)med
- Threshold for medium security operations (e.g., payments)high
- Threshold for high security operations (e.g., account merge)
Sourcepub fn add_signer(self, key: PublicKey, weight: u32) -> Self
pub fn add_signer(self, key: PublicKey, weight: u32) -> Self
Adds a new signer with the specified weight.
§Parameters
key
- The public key of the signer to addweight
- The weight to assign to this signer
Trait Implementations§
Source§impl Clone for AccountConfig
impl Clone for AccountConfig
Source§fn clone(&self) -> AccountConfig
fn clone(&self) -> AccountConfig
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 AccountConfig
impl Debug for AccountConfig
Source§impl Default for AccountConfig
impl Default for AccountConfig
Source§fn default() -> AccountConfig
fn default() -> AccountConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AccountConfig
impl RefUnwindSafe for AccountConfig
impl Send for AccountConfig
impl Sync for AccountConfig
impl Unpin for AccountConfig
impl UnwindSafe for AccountConfig
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> 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