pub struct Wallet {
pub seed: String,
pub public_key: String,
pub private_key: String,
pub classic_address: String,
pub sequence: u64,
}
Expand description
The cryptographic keys needed to control an XRP Ledger account.
See Cryptographic Keys:
<https://xrpl.org/cryptographic-keys.html>
Fields§
§seed: String
The seed from which the public and private keys are derived.
public_key: String
The public key that is used to identify this wallet’s signatures, as a hexadecimal string.
private_key: String
The private key that is used to create signatures, as a hexadecimal string. MUST be kept secret!
TODO Use seckey
classic_address: String
The address that publicly identifies this wallet, as a base58 string.
sequence: u64
The next available sequence number to use for transactions from this wallet. Must be updated by the user. Increments on the ledger with every successful transaction submission, and stays the same with every failed transaction submission.
Implementations§
Source§impl Wallet
impl Wallet
Sourcepub fn new(seed: &str, sequence: u64) -> XRPLWalletResult<Self>
pub fn new(seed: &str, sequence: u64) -> XRPLWalletResult<Self>
Generate a new Wallet.
Sourcepub fn create(
crypto_algorithm: Option<CryptoAlgorithm>,
) -> XRPLWalletResult<Self>
pub fn create( crypto_algorithm: Option<CryptoAlgorithm>, ) -> XRPLWalletResult<Self>
Generates a new seed and Wallet.
Sourcepub fn get_xaddress(
&self,
tag: Option<u64>,
is_test_network: bool,
) -> XRPLWalletResult<String>
pub fn get_xaddress( &self, tag: Option<u64>, is_test_network: bool, ) -> XRPLWalletResult<String>
Returns the X-Address of the Wallet’s account.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Wallet
impl RefUnwindSafe for Wallet
impl Send for Wallet
impl Sync for Wallet
impl Unpin for Wallet
impl UnwindSafe for Wallet
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.