utils

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToMap

func BytesToMap(jsonBytes []byte) (map[string]string, error)

Function to convert a JSON string to map[string]string

func CombineWithSuffix

func CombineWithSuffix(field []byte, uniqueNum uint64, maxLength int) []byte

func FormatBalance

func FormatBalance(bal uint64, decimals uint8) string

func GenerateIDWithAddress

func GenerateIDWithAddress(id ids.ID, addr codec.Address) ids.ID

func GenerateIDWithIndex

func GenerateIDWithIndex(id ids.ID, i uint64) ids.ID

func GenerateIDWithString

func GenerateIDWithString(str string) ids.ID

GenerateIDWithString creates a new ID based on the hash of the provided string.

func GenerateRandomID

func GenerateRandomID() (ids.ID, error)

generateRandomID creates a random ids.ID for use in generating random ids.

func GetAssetAddressBySymbol

func GetAssetAddressBySymbol(symbol string) (codec.Address, error)

func MapToBytes

func MapToBytes(inputMap map[string]string) ([]byte, error)

Function to convert a map[string]string to a JSON string

func ParseBalance

func ParseBalance(bal string, decimals uint8) (uint64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL