Usage
Format
import { readAmount, readDenom, readPercent, toAmount } from "@terra.kitchen/utils"
readAmount("1234567890")
readAmount("1234567890", { decimals: 0 })
readAmount("1234567890", { fixed: 6 })
readAmount("1234567890", { comma: true })
readAmount("1234567890", { integer: true })
readAmount("1234567890", { prefix: true })
toAmount("1234.56789")
toAmount("1234", { decimals: 0 })
readDenom("uluna")
readDenom("uusd")
readPercent("1.23")
readPercent("1.23", { fixed: 3 })
Is
import { isDenom, isDenomTerra } from "@terra.kitchen/utils"
isDenomTerra("uusd")
isDenomTerra("uluna")
isDenom("uusd")
isDenom("uluna")
Text
import { truncate } from "@terra.kitchen/utils"
truncate("terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v")
truncate("terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v", [6, 3])