Enum WalletError

Source
pub enum WalletError {
Show 46 variants ChannelError, JsError { name: String, message: String, stack: String, }, InternalError(String), ValueNotFound, ExpectedValueNotFound(String), MissingAccessToBrowserWindow, MissingAccessToBrowserDocument, UnsupportedCommitment(String), InvalidWalletVersion(String), InvalidSemVerNumber(String), Expected32ByteLength, Expected64ByteLength, VersionNotFound, UnsupportedWalletFeature(String), UnsupportedTransactionVersion, LegacyTransactionSupportRequired, UnsupportedChain(String), MissingConnectFunction, WalletNotFound, AccountNotFound, WalletConnectError(String), ConnectHasNoAccounts, MissingDisconnectFunction, MissingGetAccountsFunction(String), WalletDisconnectError(String), StandardEventsError(String), MissingStandardEventsFunction, MissingSignInFunction, ExpiryTimeEarlierThanIssuedTime, NotBeforeTimeEarlierThanIssuedTime, NotBeforeTimeLaterThanExpirationTime, ExpirationTimeIsInThePast, NotBeforeTimeIsInThePast, InvalidBase58Address, NonceMustBeAtLeast8Characters, InvalidISO8601Timestamp(String), MessageResponseMismatch, InvalidSignature, InvalidEd25519SignatureBytes, InvalidEd25519PublicKeyBytes, MissingSignMessageFunction, SignedMessageMismatch, ReceivedAnEmptySignedMessagesArray, MissingSignTransactionFunction, SendAndSignTransactionSignatureEmpty, Op(String),
}
Expand description

Error handling enum

Variants§

§

ChannelError

Unable to send the a WalletEvent via the crate::WalletEventSender

§

JsError

An JavaScript Error corresponding to a JsValue . It contains the error type represented by name, the error message message and the stack message which offers a trace of which functions were called. Learn about this error type from Error - Mozilla Developer Network

Fields

§name: String

The name of the error from a Javascript error message

§message: String

The message contained in the error

§stack: String

The stack from the JavaScript error message

§

InternalError(String)

An internal error that occurs when casting a JavaScript types or DOM types to a Rust type using web_sys::wasm_bindgen::JsCast trait and foo.dyn_ref::<T>() or foo.dyn_into::<T>() where foo is a variable of type JsValue. These error can also occur when trying to parse a browser error from JavaScript value into a WalletError::JsError. Open an issue describing this error at - https://github.com/JamiiDao/SolanaWalletAdapter/issues

§

ValueNotFound

A value of undefined or null was encountered

§

ExpectedValueNotFound(String)

A value was expected but it does not exist in the JsValue

§

MissingAccessToBrowserWindow

Unable to access browser window

§

MissingAccessToBrowserDocument

Unable to access browser document

§

UnsupportedCommitment(String)

Only processed, confirmed and finalized commitments are supported by Solana clusters

§

InvalidWalletVersion(String)

The wallet version is invalid, expected SemVer version

§

InvalidSemVerNumber(String)

Unexpected SemVer number to parse to a u8

§

Expected32ByteLength

The byte length should be equal to 32 bytes in length

§

Expected64ByteLength

The byte length should be equal to 64 bytes in length

§

VersionNotFound

The version was not found

§

UnsupportedWalletFeature(String)

This feature is not supported as a standard or solana namespace feature

§

UnsupportedTransactionVersion

Encountered an unsupported transaction version. Only legacy and version zero transactions are supported.

§

LegacyTransactionSupportRequired

Legacy transaction versions need to be supported yet the encountered wallet does not do this.

§

UnsupportedChain(String)

The blockchain encountered is not supported.

§

MissingConnectFunction

The connect function of the standard:connect namespace was not found while parsing a wallet

§

WalletNotFound

Attempted to connect to a wallet that does not exist or is yet to be registered

§

AccountNotFound

Attempted to connect to an account that does not exist or might have been disconnected

§

WalletConnectError(String)

Unable to connect to a wallet. The user may have rejected the request

§

ConnectHasNoAccounts

The connect method did not return any accounts

§

MissingDisconnectFunction

The wallet standard:disconnect feature is missing

§

MissingGetAccountsFunction(String)

The accounts method to get the accounts connected to a wallet is missing from wallet

§

WalletDisconnectError(String)

Unable to disconnect wallet.

§

StandardEventsError(String)

Encountered an error while calling standard:events function

§

MissingStandardEventsFunction

Called The Function for standard:events yet the wallet does not provide it

§

MissingSignInFunction

The wallet did not register a signIn function for solana:signIn namespece

§

ExpiryTimeEarlierThanIssuedTime

This token expires earlier than it was issued. Make sure to set the expiry time to be a later date than the issued time

§

NotBeforeTimeEarlierThanIssuedTime

This token becomes valid earlier than it was issued. Make sure to set the not_before time to be equal to or a later date than the issued time

§

NotBeforeTimeLaterThanExpirationTime

This token becomes valid after it has already expired. Make sure to set the not_before time to be equal to or a date before expiry time

§

ExpirationTimeIsInThePast

The expiration time is set to expire in the past

§

NotBeforeTimeIsInThePast

NotBefore time is set in the past

§

InvalidBase58Address

Invalid Base58 Address

§

NonceMustBeAtLeast8Characters

The nonce is required to be at least 8 characters long

§

InvalidISO8601Timestamp(String)

Expected a timestamp in the format specified by ISO8601

§

MessageResponseMismatch

The message signed by the wallet is not the same as the message sent to the wallet for signing

§

InvalidSignature

The Ed25519 Signature is invalid for the signed message and public key“)]

§

InvalidEd25519SignatureBytes

The bytes provided for the Ed25519 Signature are invalid

§

InvalidEd25519PublicKeyBytes

The bytes provided for the Ed25519 Public Key are invalid

§

MissingSignMessageFunction

The function call to Sign A Message Is Missing

§

SignedMessageMismatch

The message sent to the wallet to be signed is different from the message the wallet responded with

§

ReceivedAnEmptySignedMessagesArray

The Wallet returned an empty array of signed messages

§

MissingSignTransactionFunction

The solana:signTransaction function is missing in the provided wallet

§

SendAndSignTransactionSignatureEmpty

The sendAndSignTransaction method did not return any signature

§

Op(String)

An operation resulted in an error. This is a convenience error that you can use to return any error that was not caused by the wallet adapter, example, parsing a recipient address or the result of parsing the body of a HTTP response using serde resulted in an error. Remember, this error is not from the crate::WalletAdapter but instead an external error.

Trait Implementations§

Source§

impl Clone for WalletError

Source§

fn clone(&self) -> WalletError

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WalletError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for WalletError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for WalletError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<JsValue> for WalletError

Source§

fn from(value: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<SendError<WalletEvent>> for WalletError

Source§

fn from(value: SendError<WalletEvent>) -> Self

Converts to this type from the input type.
Source§

impl Hash for WalletError

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for WalletError

Source§

fn cmp(&self, other: &WalletError) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for WalletError

Source§

fn eq(&self, other: &WalletError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for WalletError

Source§

fn partial_cmp(&self, other: &WalletError) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for WalletError

Source§

impl StructuralPartialEq for WalletError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V