Documentation
¶
Index ¶
- func CheckEthSign(ethAddress string, originData string, ethSign string) bool
- func GetEthClientByChainId(chainId uint64) (*ethclient.Client, error)
- func GetEvmClientByChainId(chainId uint64) (*rpcclient.EvmClient, error)
- func GetLoadBalanceByChainId(chainId uint64) (loadbalance.LoadBalance, error)
- func Init()
- func InitClients(chainId uint64, rawurls []string)
- type Client
- func (c *Client) BlockByHash(hash common.Hash) (*types.Block, error)
- func (c *Client) BlockNumber(ctx context.Context) (uint64, error)
- func (c *Client) ChainID(ctx context.Context) (*big.Int, error)
- func (c *Client) Client() *ethclient.Client
- func (c *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
- func (c *Client) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (c *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (c *Client) NetworkID(ctx context.Context) (*big.Int, error)
- func (c *Client) Nonce(ctx context.Context, fromAddress common.Address) (uint64, error)
- func (c *Client) SendRAWTransaction(ctx context.Context, pk *PrivateKey, rawByte []byte) (*types.Transaction, error)
- func (c *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (c *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (c *Client) TransactionByHash(txHash common.Hash) (tx *types.Transaction, isPending bool, err error)
- func (c *Client) TransactionReceipt(txHash common.Hash) (*types.Receipt, error)
- func (c *Client) TransferringETH(ctx context.Context, pk *PrivateKey, toAddress common.Address, amount *big.Int) (*types.Transaction, error)
- type PrivateKey
- func (p *PrivateKey) Address() common.Address
- func (p *PrivateKey) ETHSignature(fromByte []byte) (string, error)
- func (p *PrivateKey) GetPrivateKey() (key *ecdsa.PrivateKey)
- func (p *PrivateKey) Hex() []byte
- func (p *PrivateKey) HexString() string
- func (p *PrivateKey) MakeTransact(chainId *big.Int) (*bind.TransactOpts, error)
- func (p *PrivateKey) PublicKey() *PublicKey
- func (p *PrivateKey) Sha256JWSSignature(fromByte []byte) (string, error)
- func (p *PrivateKey) Signature(data []byte) ([]byte, error)
- type PublicKey
- func (p *PublicKey) Address() common.Address
- func (p *PublicKey) EllipticMarshal() []byte
- func (p *PublicKey) Hex() []byte
- func (p *PublicKey) HexString() string
- func (p *PublicKey) VerifyEcdsaSecp256ETHSignature2022Signature(toByte []byte, signature string) (bool, error)
- func (p *PublicKey) VerifySha256JWSSignature(data []byte, signature string) (bool, error)
- func (p *PublicKey) VerifySignature(data, signature []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckEthSign ¶
CheckEthSign check whether Ethereum signature correct
func GetEvmClientByChainId ¶
func GetLoadBalanceByChainId ¶
func GetLoadBalanceByChainId(chainId uint64) (loadbalance.LoadBalance, error)
func InitClients ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func GetClientByChainId ¶
func (*Client) EstimateGas ¶
func (*Client) FilterLogs ¶
func (*Client) HeaderByNumber ¶
func (*Client) SendRAWTransaction ¶
func (c *Client) SendRAWTransaction(ctx context.Context, pk *PrivateKey, rawByte []byte) (*types.Transaction, error)
func (*Client) SubscribeFilterLogs ¶
func (*Client) SuggestGasPrice ¶
func (*Client) TransactionByHash ¶
func (*Client) TransactionReceipt ¶
func (*Client) TransferringETH ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
var PriKey *PrivateKey
func NewPrivateKey ¶
func NewPrivateKey(hex string) (*PrivateKey, error)
func NewPrivateKeyFromECDSA ¶
func NewPrivateKeyFromECDSA(key *ecdsa.PrivateKey) *PrivateKey
func (*PrivateKey) Address ¶
func (p *PrivateKey) Address() common.Address
func (*PrivateKey) ETHSignature ¶
func (p *PrivateKey) ETHSignature(fromByte []byte) (string, error)
func (*PrivateKey) GetPrivateKey ¶
func (p *PrivateKey) GetPrivateKey() (key *ecdsa.PrivateKey)
func (*PrivateKey) Hex ¶
func (p *PrivateKey) Hex() []byte
func (*PrivateKey) HexString ¶
func (p *PrivateKey) HexString() string
func (*PrivateKey) MakeTransact ¶
func (p *PrivateKey) MakeTransact(chainId *big.Int) (*bind.TransactOpts, error)
func (*PrivateKey) PublicKey ¶
func (p *PrivateKey) PublicKey() *PublicKey
func (*PrivateKey) Sha256JWSSignature ¶
func (p *PrivateKey) Sha256JWSSignature(fromByte []byte) (string, error)
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func GetPublicKeyUseEthSign ¶
func NewPublicKey ¶
func NewPublicKeyFromByte ¶
func (*PublicKey) EllipticMarshal ¶
func (*PublicKey) VerifyEcdsaSecp256ETHSignature2022Signature ¶
func (*PublicKey) VerifySha256JWSSignature ¶
func (*PublicKey) VerifySignature ¶
Click to show internal directories.
Click to hide internal directories.