pub struct Keystore { /* private fields */ }Implementations§
Source§impl Keystore
impl Keystore
Sourcepub fn new_default() -> Result<Self, Error>
pub fn new_default() -> Result<Self, Error>
Loads a keystore from the default path: $HOME/.sui/sui_config/sui.keystore.
pub fn new(path: PathBuf) -> Result<Self, Error>
pub fn path(&self) -> &Path
pub const fn aliases(&self) -> &BTreeMap<Address, Alias>
pub fn get_public_key(&self, address: Address) -> Option<PublicKey>
pub fn sign_message( &self, message: &[u8], signer: Address, ) -> Result<SimpleSignature, Error>
Sourcepub fn sign_tx(
&self,
transaction: &Transaction,
signer: Address,
) -> Result<SimpleSignature, Error>
pub fn sign_tx( &self, transaction: &Transaction, signer: Address, ) -> Result<SimpleSignature, Error>
Sign the transaction for a simple address. Fails if the keystore lacks the private
key for it.
Sourcepub fn multisign_tx(
&self,
transaction: &Transaction,
committee: MultisigCommittee,
indices: &[usize],
) -> Result<MultisigAggregatedSignature, Error>
pub fn multisign_tx( &self, transaction: &Transaction, committee: MultisigCommittee, indices: &[usize], ) -> Result<MultisigAggregatedSignature, Error>
Sign the transaction for a native Sui multisig address. Fails if the keystore lacks the
private keys for the signers with the given indices.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keystore
impl RefUnwindSafe for Keystore
impl Send for Keystore
impl Sync for Keystore
impl Unpin for Keystore
impl UnwindSafe for Keystore
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