mirror of
https://github.com/kremalicious/asi-calculator.git
synced 2024-12-22 09:23:16 +01:00
Matthias Kretschmann
0d08ba807b
* tweak number display * select whole amount upon input focus * handle letter input * number formatting
15 lines
388 B
TypeScript
15 lines
388 B
TypeScript
import { tokens } from '@/constants'
|
|
import type { TokenAddress, Token } from '@/types'
|
|
|
|
export function getTokenBySymbol(symbol: string): Token | undefined {
|
|
const token = tokens.find((t) => t.symbol === symbol)
|
|
return token
|
|
}
|
|
|
|
export function getTokenAddressBySymbol(
|
|
symbol: string
|
|
): TokenAddress | undefined {
|
|
const token = getTokenBySymbol(symbol)
|
|
return token?.address
|
|
}
|