pub struct WalletAccount { /* private fields */ }
Expand description
Interface of a WalletAccount, also referred to as an Account.
An account is a read-only data object that is provided from the Wallet to the app,
authorizing the app to use it.
The app can use an account to display and query information from a chain.
The app can also act using an account by passing it to features
field of the Wallet.
Implementations§
Source§impl WalletAccount
impl WalletAccount
Sourcepub fn public_key(&self) -> [u8; 32]
pub fn public_key(&self) -> [u8; 32]
Public key of the account, corresponding with a secret key to use.
Sourcepub fn chains(&self) -> &[String]
pub fn chains(&self) -> &[String]
Chains supported by the account. This must be a subset of the {@link Wallet.chains | chains} of the Wallet.
Sourcepub fn features(&self) -> &[String]
pub fn features(&self) -> &[String]
Feature names supported by the account. This must be a subset of the names of {@link Wallet.features | features} of the Wallet.
Sourcepub fn label(&self) -> Option<&String>
pub fn label(&self) -> Option<&String>
Optional user-friendly descriptive label or name for the account. This may be displayed by the app.
Sourcepub fn icon(&self) -> Option<&String>
pub fn icon(&self) -> Option<&String>
An optional Wallet Icon
Sourcepub fn shorten_address<'a>(&'a self) -> WalletResult<Cow<'a, str>>
pub fn shorten_address<'a>(&'a self) -> WalletResult<Cow<'a, str>>
Get the shortened address of the Base58 address
.
It displays the first 4 characters and the last for characters
separated by ellipsis eg FXdl...RGd4
.
If the address is less than 8 characters, an error is thrown
Sourcepub fn custom_shorten_address<'a>(
&'a self,
take: usize,
) -> WalletResult<Cow<'a, str>>
pub fn custom_shorten_address<'a>( &'a self, take: usize, ) -> WalletResult<Cow<'a, str>>
Same as Self::shorten_address but with a custom range instead of taking the first 4 character and the last 4 characters it uses a custom range.
Sourcepub fn custom_shorten_address_rl<'a>(
&'a self,
left: usize,
right: usize,
) -> WalletResult<Cow<'a, str>>
pub fn custom_shorten_address_rl<'a>( &'a self, left: usize, right: usize, ) -> WalletResult<Cow<'a, str>>
Same as Self::shorten_address but with a custom range instead of taking the first 4 character and the last 4 characters it uses a custom range for first characters before ellipsis and last characters after ellipsis.
Sourcepub fn standard_connect(&self) -> bool
pub fn standard_connect(&self) -> bool
Checks if standard:connect
is supported
Sourcepub fn standard_disconnect(&self) -> bool
pub fn standard_disconnect(&self) -> bool
Checks if standard:disconnect
is supported
Sourcepub fn standard_events(&self) -> bool
pub fn standard_events(&self) -> bool
Checks if standard:events
is supported
Sourcepub fn solana_signin(&self) -> bool
pub fn solana_signin(&self) -> bool
Checks if solana:signIn
is supported
Sourcepub fn solana_sign_message(&self) -> bool
pub fn solana_sign_message(&self) -> bool
Checks if solana:signMessage
is supported
Sourcepub fn solana_sign_and_send_transaction(&self) -> bool
pub fn solana_sign_and_send_transaction(&self) -> bool
Checks if solana:signAndSendTransaction
is supported
Sourcepub fn solana_sign_transaction(&self) -> bool
pub fn solana_sign_transaction(&self) -> bool
Checks if solana:signTransaction
is supported
Trait Implementations§
Source§impl Clone for WalletAccount
impl Clone for WalletAccount
Source§fn clone(&self) -> WalletAccount
fn clone(&self) -> WalletAccount
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more