pub struct SpotToken {
pub name: String,
pub index: u32,
pub token_id: String,
pub wei_decimals: u32,
pub evm_contract: Option<EvmContract>,
}Expand description
One token of spotMeta’s tokens, the fields a transfer reads.
Fields§
§name: String§index: u32What a balance’s token and borrowLend name it by.
token_id: String0x and 32 hex digits.
wei_decimals: u32The decimals Core counts it in.
evm_contract: Option<EvmContract>Its ERC-20 on HyperEVM; null for a token with none, and for HYPE on
mainnet, which is HyperEVM’s own coin.
Implementations§
Source§impl SpotToken
impl SpotToken
Sourcepub fn is_hype(&self, network: Network) -> bool
pub fn is_hype(&self, network: Network) -> bool
Whether this is the network’s HYPE, by its index there.
Sourcepub fn system_address(&self, network: Network) -> Address
pub fn system_address(&self, network: Network) -> Address
Where it crosses from Core to HyperEVM: 0x2222...2222 for HYPE, 0x20 and the index for
any other token.
Sourcepub fn evm_decimals(&self, network: Network) -> Option<u32>
pub fn evm_decimals(&self, network: Network) -> Option<u32>
Its decimals on HyperEVM: eighteen for HYPE, weiDecimals plus the
ERC-20’s extra for a linked token, None for a token with no ERC-20.
Sourcepub fn crossing_places(&self, network: Network) -> Option<u32>
pub fn crossing_places(&self, network: Network) -> Option<u32>
The most places an amount crossing to HyperEVM may have: the fewer of its Core and HyperEVM
decimals. None when it cannot cross.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SpotToken
impl<'de> Deserialize<'de> for SpotToken
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>,
impl Eq for SpotToken
Source§impl From<Token> for SpotToken
USDC or HYPE from the network itself, with no link to HyperEVM read: HYPE
needs none, and USDC does not cross here.
impl From<Token> for SpotToken
USDC or HYPE from the network itself, with no link to HyperEVM read: HYPE needs none, and USDC does not cross here.
impl StructuralPartialEq for SpotToken
Auto Trait Implementations§
impl Freeze for SpotToken
impl RefUnwindSafe for SpotToken
impl Send for SpotToken
impl Sync for SpotToken
impl Unpin for SpotToken
impl UnsafeUnpin for SpotToken
impl UnwindSafe for SpotToken
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.