Documentation
¶
Index ¶
- Constants
- func AmountToUint(amount Amount) sdk.Uint
- func FloatToUint(input float64) sdk.Uint
- func FloatToUintAndMultipleOne(input float64) sdk.Uint
- func IntToInt64(input sdk.Int) int64
- func IntToUint64(input sdk.Int) uint64
- func IsBNB(ticker Ticker) bool
- func IsBNBChain(c Chain) bool
- func IsRune(ticker Ticker) bool
- func UintToFloat64(input sdk.Uint) float64
- func UintToUint64(input sdk.Uint) uint64
- type Address
- type Amount
- func (a Amount) Equals(a2 Amount) bool
- func (a Amount) Float64() float64
- func (a Amount) GreaterThen(f float64) bool
- func (a Amount) IsEmpty() bool
- func (a Amount) IsNegative() bool
- func (a Amount) IsZero() bool
- func (a Amount) LessThen(f float64) bool
- func (a Amount) Minus(a2 Amount) Amount
- func (a Amount) Plus(a2 Amount) Amount
- func (a Amount) String() string
- type Chain
- type Coin
- type Coins
- type Duration
- type Ticker
- type Tickers
- type TxID
- type TxIDs
Constants ¶
View Source
const ( BNBChain = Chain("BNB") ETHChain = Chain("ETH") BTCChain = Chain("BTC") )
View Source
const ( BNBTicker = Ticker("BNB") RuneTicker = Ticker("RUNE") RuneA1FTicker = Ticker("RUNE-A1F") RuneB1ATicker = Ticker("RUNE-B1A") )
View Source
const One = 100000000
One is useful type so we don't need to type 8 zero all the time
Variables ¶
This section is empty.
Functions ¶
func AmountToUint ¶
func FloatToUint ¶
func IntToInt64 ¶ added in v1.0.1
func IntToUint64 ¶ added in v1.0.1
func IsBNBChain ¶ added in v1.0.1
Types ¶
type Address ¶ added in v1.0.1
type Address string
func NewAddress ¶ added in v1.0.1
NewAddress create a new Address Sample: bnb1lejrrtta9cgr49fuh7ktu3sddhe0ff7wenlpn6
type Amount ¶
type Amount string
func NewAmountFromFloat ¶
func UintToAmount ¶
func (Amount) GreaterThen ¶
func (Amount) IsNegative ¶
type Coin ¶
type Coin struct { Chain Chain `json:"chain"` Denom Ticker `json:"denom"` Amount sdk.Uint `json:"amount"` }
type Duration ¶
Duration embedded time.Duration so we could use string to represent duration in json file for example ,1s ,1h , 5m etc
func (Duration) MarshalJSON ¶
MarshalJSON marshal the duration to json string
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON convert the json value back to time.Duration
Click to show internal directories.
Click to hide internal directories.