util

package
v0.0.0-...-43dd9f0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERC20TransferHash         = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" //crypto.Keccak256Hash([]byte("Transfer(address,address,uint256)"))
	ERC721TransferHash        = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" //crypto.Keccak256Hash([]byte("Transfer(address,address,uint256)"))
	ERC1155TransferSingleHash = "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62" //crypto.Keccak256Hash([]byte("TransferSingle(address,address,address,uint256,uint256)"))
	ERC1155TransferBatchHash  = "0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb" //crypto.Keccak256Hash([]byte("TransferBatch(address,address,address,uint256[],uint256[])"))
	Zero24                    = "000000000000000000000000"
	HexPrefix                 = "0x"
)

Variables

View Source
var (
	Request     *log.Logger //request
	Persistence *log.Logger //persistence
	Node        *log.Logger //Node
	Dispatch    *log.Logger //dispatch
	Param       *log.Logger //param
	Trace       *log.Logger //0
	Debug       *log.Logger //2
	Info        *log.Logger //4
	Warn        *log.Logger //6
	Error       *log.Logger //8
)
View Source
var LocalTime *time.Location

Functions

func Bytes

func Bytes(v interface{}) []byte

func GetETHAddressFromTopic

func GetETHAddressFromTopic(content string) (string, error)

func Hex2Uint64

func Hex2Uint64(v string) (uint64, error)

func Init

func Init(path string, level int)

func NowDay

func NowDay() uint64

func NowMs

func NowMs() uint64

func Panic

func Panic(msg string)

func PanicError

func PanicError(err error)

func PrintErrorIfExist

func PrintErrorIfExist(err error)

func RemoveHexPrefix

func RemoveHexPrefix(content string) string

func Uint642Hex

func Uint642Hex(v uint64) string

Types

type Chain

type Chain uint64
const (
	ChainUnknown Chain = 0
	ChainHECO    Chain = 1
	ChainBSC     Chain = 2
	ChainETH     Chain = 3
)

type ConfigApp

type ConfigApp struct {
	Version     string `yaml:"version"`
	Environment string `yaml:"environment"`
	Port        string `yaml:"port"`
}

type ConfigMysql

type ConfigMysql struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Name     string `yaml:"name"`
	MaxConn  int    `yaml:"maxConn"`
	MaxIdle  int    `yaml:"maxIdle"`
}

type ConfigRedisSingle

type ConfigRedisSingle struct {
	Address  string `yaml:"address"`
	Password string `yaml:"password"`
}

type DTO

type DTO interface {
}

type Dex

type Dex uint64
const (
	DexUnknown Dex = 0
	DexYouSwap Dex = 1
)

type Result

type Result interface {
}

Jump to

Keyboard shortcuts

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