Documentation ¶
Index ¶
- Variables
- func All[T any](set []T) (subsets [][]T)
- func Combinations[T any](set []T, n int) (subsets [][]T)
- func ConvertBigIntFromString(v0, v1 string) (n0 *big.Int, n1 *big.Int, err error)
- func ConvertFloat64ToTokenAmount(amount float64, decimals int) *big.Int
- func ConvertHexToDecimalInStringFormat(hexString string) string
- func ConvertTokenAmountToFloat64(amt string, tokenDecimal int32) float64
- func CreateTransactionOpts(client *ethclient.Client, key *ecdsa.PrivateKey, chainId uint64, ...) (opts *bind.TransactOpts, err error)
- func EncodeAddress(addr common.Address) []byte
- func EncodeBigInt(b *big.Int) []byte
- func EncodeBytesString(v string) []byte
- func EncodePacked(input ...[]byte) []byte
- func EncodeUint256(v string) []byte
- func EncodeUint256Array(arr []string) []byte
- func GenerateIncreaseID() (int64, error)
- func GetHTTPClient() *http.Client
- func GetRandomNumber(min, max int) (int, error)
- func HTTPReq(method string, url string, httpClient *http.Client, content []byte, ...) (body []byte, err error)
- func InTransaction(db *xorm.Engine, callback dbTransactionFunc) error
- func InitLog(logPath, logLever string)
- func IsAnAddress(address string) bool
- func IsValidTxHash(txHash string) bool
- func Logger() *zap.Logger
- func PadLeft(str, pad string, length int) string
- func PrivateToAddress(key string) (string, error)
- func RemoveIndex[T any](s []T, index int) []T
- func TxWaitToSync(ctx context.Context, client *ethclient.Client, tx *types.Transaction) (*types.Receipt, bool, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var IsAlphanumeric = regexp.MustCompile(`^[0-9a-zA-Z]+$`).MatchString
Functions ¶
func All ¶
func All[T any](set []T) (subsets [][]T)
All returns all combinations for a given string array. This is essentially a powerset of the given set except that the empty set is disregarded.
Example ¶
combinations := All([]string{"A", "B", "C"}) fmt.Println(combinations)
Output: [[A] [B] [A B] [C] [A C] [B C] [A B C]]
func Combinations ¶
Combinations returns combinations of n elements for a given string array. For n < 1, it equals to All and returns all combinations.
func ConvertBigIntFromString ¶
func CreateTransactionOpts ¶
func CreateTransactionOpts(client *ethclient.Client, key *ecdsa.PrivateKey, chainId uint64, caller common.Address) (opts *bind.TransactOpts, err error)
func EncodeAddress ¶
func EncodeBigInt ¶
func EncodeBytesString ¶
func EncodePacked ¶
func EncodeUint256 ¶
func EncodeUint256Array ¶
func GenerateIncreaseID ¶
func GetHTTPClient ¶
func HTTPReq ¶
func HTTPReq(method string, url string, httpClient *http.Client, content []byte, headers map[string]string) (body []byte, err error)
HTTPReq ..
func InTransaction ¶
func IsAnAddress ¶
func IsValidTxHash ¶
func PrivateToAddress ¶
func RemoveIndex ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.