pub struct TokenMap {
pub usdc: Token,
pub usdc_9: Token,
}Fields§
§usdc: Token“USDC” token, use a custom token on devnet
usdc_9: TokenCustom “USDC” token used internally with 9 decimals
Implementations§
Source§impl TokenMap
impl TokenMap
pub fn new(devnet_tokens: bool) -> Self
Sourcepub fn find(&'static self, token: &str) -> Option<TokenType>
pub fn find(&'static self, token: &str) -> Option<TokenType>
Find a supported token either by name or by pubkey string.
Returns None if the token is not supported.
§Examples
use aimo_core::token_map::token_map;
let token_map = token_map(false);
// Find by symbol
let usdc_by_symbol = token_map.find("USDC");
// Find by mint address
let usdc_by_mint = token_map.find("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");Trait Implementations§
Auto Trait Implementations§
impl Freeze for TokenMap
impl RefUnwindSafe for TokenMap
impl Send for TokenMap
impl Sync for TokenMap
impl Unpin for TokenMap
impl UnwindSafe for TokenMap
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<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