pub struct AccountConfig {
pub master_weight: Option<u32>,
pub low_threshold: Option<u32>,
pub med_threshold: Option<u32>,
pub high_threshold: Option<u32>,
pub signers: Vec<(PublicKey, u32)>,
}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);Fields§
§master_weight: Option<u32>Weight assigned to the master key (account owner)
low_threshold: Option<u32>Threshold for low security operations
med_threshold: Option<u32>Threshold for medium security operations
high_threshold: Option<u32>Threshold for high security operations
signers: Vec<(PublicKey, u32)>Additional signers with their respective weights
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§
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> 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