Documentation ¶
Index ¶
- func BytesToFloat64(bytes []byte) float64
- func BytesToInt64(data []byte) int64
- func ChainIdGetTokenType(chainId string) string
- func ChainIdToChainName(chainId string) string
- func ChainNameToChainID(chainName string) string
- func CombineShares(shares [][]byte) ([]byte, error)
- func CompleteNPeriodsBetween(start time.Time, end time.Time, N float64) float64
- func ETHToTronAddress(addr string) string
- func EcdsaPrivateKeyGetSolPrivateKey(privateKeyECDSA *ecdsa.PrivateKey) (key ed25519.PrivateKey, address string, err error)
- func Erc20SingAndSend(client *ethclient.Client, privateKey *ecdsa.PrivateKey, ...) (string, error)
- func EthAddrToTronAddr(ethAddr string) (tronAddr string)
- func EthBalanceAtAndOf(address, contract, tokenDecimals string, ethClient *ethclient.Client) (bAt, bOf decimal.Decimal, err error)
- func EthUrlConnTest(client *rpc.Client) (time.Duration, error)
- func EthZeroAddress() string
- func ExternalIP() net.IP
- func FindDifference(slice1 []string, slice2 []string) []string
- func Float64ToBytes(f float64) []byte
- func GenMnemonic(lang int) (string, error)
- func GenerateRandomDigits(length int) string
- func GenerateRandomKey(seed int64, length int) string
- func GenerateRandomString(length int) string
- func GenerateSeed(dividend int64) int64
- func GetAccount(ctx context.Context) (account string)
- func GetIpFromAddr(addr net.Addr) net.IP
- func GetKaiId(ctx context.Context) (kaiId int64)
- func GetNationByIp(ip string) (record *geoip2.City, err error)
- func GetRandStr(strSize int) string
- func GetRandomID() uint32
- func GetToken(secretKey, account string, iat, seconds, uid, kaiId int64) (string, error)
- func GetUid(ctx context.Context) int64
- func GetUserIp(r *http.Request) string
- func HexToDec(hexStr string) uint64
- func InArray[T comparable](element T, array []T) bool
- func Int64ToBytes(n int64) []byte
- func Int64ToTime(t int64) (timeStr string)
- func IsEthAddress(address string) bool
- func IsHttpURL(url string) bool
- func IsSolAddress(address string) bool
- func IsTronAddress(addr string) bool
- func IsTronNativeAsset(asset string) bool
- func IsValidAddress(iaddress interface{}) bool
- func IsValidMnemonic(mnemonic string) bool
- func IsZeroAddress(iaddress interface{}) bool
- func MnemonicGetEthAddress(mnemonic string, path string) (address string, err error)
- func MnemonicGetSolAddress(mnemonic string, path string) (address string, err error)
- func MnemonicGetTronAddress(mnemonic string, path string) (address string, err error)
- func MnemonicToPrivateKey(mnemonic, salt, pathStr string) (*ecdsa.PrivateKey, error)
- func PrivateECDSAToSolEd25519(privateKeyECDSA *ecdsa.PrivateKey) (edPrivate ed25519.PrivateKey, err error)
- func PrivateKeyGetEthAddress(privateKeyECDSA *ecdsa.PrivateKey) (address string, err error)
- func PrivateKeyGetSolAddress(privateKeyECDSA *ecdsa.PrivateKey) (address string, err error)
- func PrivateKeyGetTronAddress(privateKeyECDSA *ecdsa.PrivateKey) (address string, err error)
- func PublicKeyToEthAddress(publicKey string) (string, error)
- func ReverseRandomKey(partialStr string) int64
- func SolBalanceAtAndOf(address, contract, tokenDecimals string, solC *SolClient.Client) (bAt, bOf decimal.Decimal, err error)
- func SolIsTransactionSuccessful(txHash string, solClient *client.Client) (bool, error)
- func SplitNumber(num int64) (string, string, error)
- func SplitToShares(privateKey string, minimumShares int, totalShares int) ([][]byte, error)
- func StringToInt64(str string) (int64, error)
- func StringToInt64Must(str string) int64
- func StructToMap(s interface{}) map[string]interface{}
- func ToBool(val interface{}) bool
- func ToDecimal(ivalue interface{}, decimals int) decimal.Decimal
- func ToInt64(value interface{}) (int64, error)
- func ToInt64Must(value interface{}) int64
- func ToLocalDateByMilliSecond(milliSecond int64, local string) string
- func ToLocalDateBySecond(second int64, local string) string
- func ToString(val interface{}) string
- func ToWei(value interface{}, decimals int) *big.Int
- func TronAddrToEthAddr(tronAddr string) (ethAddr string)
- func TronNativeAssetDecimals() uint8
- func TronToEthAddress(addr string) (common.Address, error)
- func TronZeroAddress(asset string) string
- func TrxBalanceAtAndOf(address, contract, tokenDecimals string, trxClient *tron.TronClient) (bAt, bOf decimal.Decimal, err error)
- func TrxIsTransactionSuccessful(client *tron.TronClient, txHash common.Hash) (bool, uint64)
- func VerifyToken(token, secret string) (*jwt.Token, error)
- type Address
- type Erc20Transfer
- type JwtParam
- type Resp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToFloat64 ¶
func BytesToInt64 ¶
func ChainIdGetTokenType ¶
func ChainIdToChainName ¶
func ChainNameToChainID ¶
func CompleteNPeriodsBetween ¶
CompleteNPeriodsBetween 计算两个时间戳相差的N倍数
func ETHToTronAddress ¶
func EcdsaPrivateKeyGetSolPrivateKey ¶
func EcdsaPrivateKeyGetSolPrivateKey(privateKeyECDSA *ecdsa.PrivateKey) (key ed25519.PrivateKey, address string, err error)
func Erc20SingAndSend ¶
func EthAddrToTronAddr ¶
func EthBalanceAtAndOf ¶
func EthZeroAddress ¶
func EthZeroAddress() string
func ExternalIP ¶
func Float64ToBytes ¶
func GenerateRandomDigits ¶
func GenerateRandomKey ¶
GenerateRandomKey 生成随机字符串
func GenerateRandomString ¶
GenerateRandomString 生成指定长度的字符串
func GetAccount ¶
func GetNationByIp ¶
GetNationByIp 根据ip获取国家信息
func GetRandomID ¶
func GetRandomID() uint32
func InArray ¶
func InArray[T comparable](element T, array []T) bool
func Int64ToBytes ¶
func IsEthAddress ¶
func IsTronAddress ¶
func IsTronNativeAsset ¶
func IsValidAddress ¶
func IsValidAddress(iaddress interface{}) bool
IsValidAddress validate hex address
func IsZeroAddress ¶
func IsZeroAddress(iaddress interface{}) bool
IsZeroAddress validate if it's a 0 address
func MnemonicGetEthAddress ¶
func MnemonicGetSolAddress ¶
func MnemonicGetTronAddress ¶
func MnemonicToPrivateKey ¶
func MnemonicToPrivateKey(mnemonic, salt, pathStr string) (*ecdsa.PrivateKey, error)
MnemonicToPrivateKey 助记词转私钥
func PrivateECDSAToSolEd25519 ¶
func PrivateECDSAToSolEd25519(privateKeyECDSA *ecdsa.PrivateKey) (edPrivate ed25519.PrivateKey, err error)
func PrivateKeyGetEthAddress ¶
func PrivateKeyGetEthAddress(privateKeyECDSA *ecdsa.PrivateKey) (address string, err error)
func PrivateKeyGetSolAddress ¶
func PrivateKeyGetSolAddress(privateKeyECDSA *ecdsa.PrivateKey) (address string, err error)
func PrivateKeyGetTronAddress ¶
func PrivateKeyGetTronAddress(privateKeyECDSA *ecdsa.PrivateKey) (address string, err error)
func PublicKeyToEthAddress ¶
func ReverseRandomKey ¶
func SolBalanceAtAndOf ¶
func SplitToShares ¶
func StringToInt64 ¶
func StringToInt64Must ¶
func StructToMap ¶
func StructToMap(s interface{}) map[string]interface{}
func ToInt64Must ¶
func ToInt64Must(value interface{}) int64
func ToLocalDateBySecond ¶
func TronAddrToEthAddr ¶
func TronNativeAssetDecimals ¶
func TronNativeAssetDecimals() uint8
func TronZeroAddress ¶
func TrxBalanceAtAndOf ¶
func VerifyToken ¶
Types ¶
type Erc20Transfer ¶
type Erc20Transfer struct { Client *ethclient.Client PrivateKey *ecdsa.PrivateKey Contract *common.Address }
func NewErc20Transfer ¶
func NewErc20Transfer(client *ethclient.Client, privateKey *ecdsa.PrivateKey, contract common.Address) *Erc20Transfer
func (*Erc20Transfer) Close ¶
func (e *Erc20Transfer) Close()
func (*Erc20Transfer) SenToErc20 ¶
Click to show internal directories.
Click to hide internal directories.