util

package
v0.0.0-...-4d9bc2d Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcCoefficientByBigIntStr

func CalcCoefficientByBigIntStr(newTotalVal, oldTotalVal string, decimals int64) float64

func GetBalanceOf

func GetBalanceOf(payToken, address common.Address, cli *ethclient.Client) (*big.Int, error)

func GetRandomBigNumbers

func GetRandomBigNumbers(num int) []int

func GetRandomNumbers

func GetRandomNumbers(num int) []int

func GetRecordedBalance

func GetRecordedBalance(walletAddress common.Address, cli *ethclient.Client) (*big.Int, error)

func GetUUID

func GetUUID() string

func HexStringToUint64

func HexStringToUint64(s string) uint64

func IsDigit

func IsDigit(str string) bool

func LarkNotice

func LarkNotice(webHookUrl, msg string) (err error)

func Md5WithSalt

func Md5WithSalt(data string, salt string) string

func Sign

func Sign(msg, key []byte) string

func SpinLock

func SpinLock(chainId uint64, typ OnlyKeyType, uuid string)

SpinLock Preventing task duplication in a distributed environment

func StringToUint64

func StringToUint64(s string) uint64

func Verify

func Verify(msg, key []byte, hash string) (bool, error)

Types

type LarkResponse

type LarkResponse struct {
	StatusCode    int         `json:"StatusCode"`
	StatusMessage string      `json:"StatusMessage"`
	Code          int         `json:"code"`
	Data          interface{} `json:"data"`
	Msg           string      `json:"msg"`
}

type OnlyKeyType

type OnlyKeyType string
const (
	// case: 195_pid, 195_staking, 195_voucher, 1177777711_pid_voucher
	OnlyOneKey = "only_one_key:%s"

	TransferUSDT            OnlyKeyType = "transfer_usdt"
	ScanTransferWatchForDb  OnlyKeyType = "scan_transfer_watch_for_db"
	PFTokenRebase           OnlyKeyType = "pf_token_rebase"
	ScanWalletTransferWatch OnlyKeyType = "scan_wallet_transfer_watch"
	ScanWalletAssignWatch   OnlyKeyType = "scan_wallet_assign_watch"
	StartWalletAPR          OnlyKeyType = "start_wallet_apr"
	PftokenStatistics       OnlyKeyType = "pftoken_statistics"
	ScanPftokenWatch        OnlyKeyType = "scan_pftoken_watch"
	ScanWithdrawWatch       OnlyKeyType = "scan_withdraw_watch"
	WalletStatistics        OnlyKeyType = "wallet_statistics"
)

Jump to

Keyboard shortcuts

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