core

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilDB = gorm.ErrInvalidDB
)

Functions

func Bech32Address added in v1.0.7

func Bech32Address(address string) (string, string, error)

func CSVRead added in v1.0.9

func CSVRead(filename string) ([][]string, error)

func DecimalAdd added in v1.0.8

func DecimalAdd(a, b string) (string, error)

func DecimalDivRound added in v1.0.8

func DecimalDivRound(a, b string, precision int32) (string, error)

func DecimalMul added in v1.0.8

func DecimalMul(a, b string) (string, error)

func DecimalSub added in v1.0.8

func DecimalSub(a, b string) (string, error)

func DictDel added in v1.0.15

func DictDel(service, key string)

func DictDelGlobal added in v1.0.15

func DictDelGlobal(key string)

func DictGet added in v1.0.12

func DictGet(service, key string) (any, bool)

func DictGetGlobal added in v1.0.14

func DictGetGlobal(key string) (any, bool)

func DictKeys added in v1.0.14

func DictKeys(service string) []string

func DictKeysGlobal added in v1.0.14

func DictKeysGlobal() []string

func DictSet added in v1.0.12

func DictSet(service, key string, val any)

func DictSetGlobal added in v1.0.14

func DictSetGlobal(key string, val any)

func Ecrecover

func Ecrecover(hash, sig string) (string, error)

func HashTypedData added in v1.0.6

func HashTypedData(typedDataJson string) (string, error)

func HexToAddress added in v1.0.6

func HexToAddress(address string) string

func HexToHash added in v1.0.11

func HexToHash(input string) string

func Keccak256

func Keccak256(data string) string

func RedisHExpire added in v1.0.16

func RedisHExpire(r *redis.Client, key string, duration string, fields ...string) ([]int64, error)

func RedisHGet added in v1.0.15

func RedisHGet(r *redis.Client, key, field string) (string, error)

func RedisHKeys added in v1.0.17

func RedisHKeys(r *redis.Client, key string) ([]string, error)

func RedisHSet added in v1.0.15

func RedisHSet(r *redis.Client, key string, values ...any) (int64, error)

func TableInsert

func TableInsert(db *gorm.DB, table string, obj map[string]any) error

func TableSelect

func TableSelect(db *gorm.DB, query string, values ...any) ([]map[string]any, error)

Types

type FetchArgs

type FetchArgs struct {
	Method  string            `json:"method"`
	Headers map[string]string `json:"headers"`
	Body    string            `json:"body"`
}

type FetchResp

type FetchResp struct {
	Status int    `json:"status"`
	Body   string `json:"body"`
}

func Fetch

func Fetch(url string, args FetchArgs) (*FetchResp, error)

type MerkleArgs added in v1.0.9

type MerkleArgs struct {
	Address string `json:"address"`
	Amount  string `json:"amount"`
}

type MerkleTree added in v1.0.9

type MerkleTree struct {
	Root    string              `json:"root"`
	Proof   map[string][]string `json:"proof"`
	Amounts map[string]string   `json:"amounts"`
}

func Merkle added in v1.0.9

func Merkle(name string, args []MerkleArgs) (*MerkleTree, error)

func TryMerkle added in v1.0.14

func TryMerkle(name string) (*MerkleTree, bool)

Jump to

Keyboard shortcuts

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