pub struct WalletAccountData {
pub address: String,
pub public_key: [u8; 32],
pub chains: Vec<String>,
pub features: Vec<String>,
pub label: Option<String>,
pub icon: Option<String>,
pub supported_features: FeatureSupport,
pub supported_chains: ChainSupport,
}Expand description
A data URI containing a base64-encoded SVG, WebP, PNG, or GIF image. NOTE that this does not contain the browser functions that would be called to perform operations
Fields§
§address: StringAddress of the account, corresponding with a public key.
public_key: [u8; 32]Public key of the account, corresponding with a secret key to use.
chains: Vec<String>Chains supported by the account. This must be a subset of the {@link Wallet.chains | chains} of the Wallet.
features: Vec<String>Feature names supported by the account. This must be a subset of the names of {@link Wallet.features | features} of the Wallet.
label: Option<String>Optional user-friendly descriptive label or name for the account. This may be displayed by the app.
icon: Option<String>Optional user-friendly icon for the account. This may be displayed by the app. */
Format data:image/${'svg+xml' | 'webp' | 'png' | 'gif'};base64,${string}
supported_features: FeatureSupportConvenience field, instead of going through the features field
supported_chains: ChainSupportConvenience field, instead of iteration through the chains field
Implementations§
Source§impl WalletAccountData
impl WalletAccountData
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 shorten_address<'a>(&'a self) -> WalletUtilsResult<Cow<'a, str>>
pub fn shorten_address<'a>(&'a self) -> WalletUtilsResult<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,
) -> WalletUtilsResult<Cow<'a, str>>
pub fn custom_shorten_address<'a>( &'a self, take: usize, ) -> WalletUtilsResult<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,
) -> WalletUtilsResult<Cow<'a, str>>
pub fn custom_shorten_address_rl<'a>( &'a self, left: usize, right: usize, ) -> WalletUtilsResult<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 WalletAccountData
impl Clone for WalletAccountData
Source§fn clone(&self) -> WalletAccountData
fn clone(&self) -> WalletAccountData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more