pub enum Chain {
Solana {
reference: String,
},
Evm {
reference: String,
},
}Expand description
A blockchain network, identified by namespace and reference per CAIP-2.
Variants§
Solana
Solana — Ed25519 signing.
Reference is the genesis hash prefix (e.g. 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
for mainnet).
Evm
EVM-compatible chain — secp256k1 / EIP-191 signing.
Reference is the integer chain ID as a string (e.g. "8453" for Base).
Implementations§
Source§impl Chain
impl Chain
Sourcepub fn solana_mainnet() -> Self
pub fn solana_mainnet() -> Self
Solana mainnet.
Sourcepub fn tempo_testnet() -> Self
pub fn tempo_testnet() -> Self
Tempo testnet (EVM chain ID 42431).
Sourcepub fn caip2(&self) -> String
pub fn caip2(&self) -> String
Format as a CAIP-2 chain identifier string.
Examples: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "eip155:8453".
Sourcepub fn from_caip2(s: &str) -> Result<Self, JwtError>
pub fn from_caip2(s: &str) -> Result<Self, JwtError>
Parse a CAIP-2 chain identifier string.
Sourcepub fn jwt_algorithm(&self) -> JwtAlgorithm
pub fn jwt_algorithm(&self) -> JwtAlgorithm
Returns the JWT algorithm for this chain.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chain
impl<'de> Deserialize<'de> for Chain
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Chain
impl StructuralPartialEq for Chain
Auto Trait Implementations§
impl Freeze for Chain
impl RefUnwindSafe for Chain
impl Send for Chain
impl Sync for Chain
impl Unpin for Chain
impl UnsafeUnpin for Chain
impl UnwindSafe for Chain
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more