pub struct Wallet { /* private fields */ }
Expand description
A wallet implementing wallet standard
Implementations§
Source§impl Wallet
impl Wallet
Sourcepub async fn connect(&self) -> WalletResult<WalletAccount>
pub async fn connect(&self) -> WalletResult<WalletAccount>
Send a request to connect to a browser wallet
Sourcepub async fn disconnect(&self) -> WalletResult<()>
pub async fn disconnect(&self) -> WalletResult<()>
Send a request to the browser wallet to disconnect
Sourcepub async fn sign_in(
&self,
signin_input: &SigninInput,
public_key: [u8; 32],
) -> WalletResult<SignInOutput>
pub async fn sign_in( &self, signin_input: &SigninInput, public_key: [u8; 32], ) -> WalletResult<SignInOutput>
Send a signin request to the browser wallet
Sourcepub async fn sign_message<'a>(
&self,
message: &'a [u8],
account: &WalletAccount,
) -> WalletResult<SignedMessageOutput<'a>>
pub async fn sign_message<'a>( &self, message: &'a [u8], account: &WalletAccount, ) -> WalletResult<SignedMessageOutput<'a>>
Send a sign message request to the browser wallet. Message must be UTF-8 encoded
Sourcepub async fn sign_transaction(
&self,
transaction_bytes: &[u8],
cluster: Option<Cluster>,
account: &WalletAccount,
) -> WalletResult<Vec<Vec<u8>>>
pub async fn sign_transaction( &self, transaction_bytes: &[u8], cluster: Option<Cluster>, account: &WalletAccount, ) -> WalletResult<Vec<Vec<u8>>>
Send a sign transaction request to the browser wallet. The transaction bytes expected are encoded using serde in byte form.
Sourcepub async fn sign_and_send_transaction(
&self,
transaction_bytes: &[u8],
cluster: Cluster,
options: SendOptions,
account: &WalletAccount,
) -> WalletResult<Signature>
pub async fn sign_and_send_transaction( &self, transaction_bytes: &[u8], cluster: Cluster, options: SendOptions, account: &WalletAccount, ) -> WalletResult<Signature>
Send a sign and send transaction request to the browser wallet.
Sourcepub async fn call_on_event(
&self,
connection_info: ConnectionInfoInner,
wallet_name: String,
sender: WalletEventSender,
signal_receiver: Receiver<()>,
) -> WalletResult<()>
pub async fn call_on_event( &self, connection_info: ConnectionInfoInner, wallet_name: String, sender: WalletEventSender, signal_receiver: Receiver<()>, ) -> WalletResult<()>
Get the standard events Function [standard:events].on
Sourcepub fn from_jsvalue(value: JsValue) -> WalletResult<Self>
pub fn from_jsvalue(value: JsValue) -> WalletResult<Self>
Parse the Wallet details from a JsValue
Sourcepub fn accounts(&self) -> &[WalletAccount]
pub fn accounts(&self) -> &[WalletAccount]
Get the accounts provided by the wallet
Sourcepub fn standard_connect(&self) -> bool
pub fn standard_connect(&self) -> bool
Check whether the wallet supports standard:connect
feature
Sourcepub fn standard_disconnect(&self) -> bool
pub fn standard_disconnect(&self) -> bool
Check whether the wallet supports standard:disconnect
feature
Sourcepub fn standard_events(&self) -> bool
pub fn standard_events(&self) -> bool
Check whether the wallet supports standard:events
feature
Sourcepub fn solana_signin(&self) -> bool
pub fn solana_signin(&self) -> bool
Check whether the wallet supports solana:signIn
feature
Sourcepub fn solana_sign_message(&self) -> bool
pub fn solana_sign_message(&self) -> bool
Check whether the wallet supports solana:signMessage
feature
Sourcepub fn solana_sign_and_send_transaction(&self) -> bool
pub fn solana_sign_and_send_transaction(&self) -> bool
Check whether the wallet supports solana:signAndSendTransaction
feature
Sourcepub fn solana_sign_transaction(&self) -> bool
pub fn solana_sign_transaction(&self) -> bool
Check whether the wallet supports solana:signTransaction
feature
Sourcepub fn icon(&self) -> Option<&WalletIcon>
pub fn icon(&self) -> Option<&WalletIcon>
Get the optional wallet icon
Sourcepub fn version(&self) -> &SemverVersion
pub fn version(&self) -> &SemverVersion
Get the version of the wallet standard that the wallet supports