Documentation
¶
Index ¶
- type EvmClient
- func (o *EvmClient) AccountByMnemonic() (account *model.Account, err error)
- func (o *EvmClient) AccountGenKeystore(privateKey, pwd, path string) (address string, err error)
- func (o *EvmClient) AccountInfoByMnemonic(mnemonic string) (account *model.Account, err error)
- func (o *EvmClient) AccountWithPrivateKey(privateKey string) (account *model.Account, err error)
- func (o *EvmClient) Chain() (*model.Chain, error)
- func (o *EvmClient) LatestBlockNumber() (uint64, error)
- func (o *EvmClient) MetamaskSignLogin(message, privateKey string) (string, error)
- func (o *EvmClient) Nonce(address string) (nonce uint64, err error)
- func (o *EvmClient) SignEip721(privateKey string, typedData *apitypes.TypedData) (string, error)
- func (o *EvmClient) TokenBalanceOf(address string) (balance string, err error)
- func (o *EvmClient) TokenErc20BalanceOf(address, contractAddress string, opts *bind.CallOpts) (balance string, err error)
- func (o *EvmClient) TokenEstimateGasLimit(fromAddress, receiverAddress, gasPrice, amount string, data []byte) (balance string, err error)
- func (o *EvmClient) TokenTransfer(...) (hash string, err error)
- func (o *EvmClient) TxByBlockNumber(number uint64) ([]model.Transaction, error)
- func (o *EvmClient) TxByHash(hash string) (*model.Transaction, error)
- func (o *EvmClient) TxIsPending(hash string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvmClient ¶ added in v1.2.13
type EvmClient struct { RpcUrl string // contains filtered or unexported fields }
func NewEthClient ¶
NewEthClient
@Description: if rpcUrl and timeout is empty,you can‘t connect the node,but you can use the function about wallet @param rpcUrl @param timeout @return *EvmClient
func NewSimpleEthClient ¶
func NewSimpleEthClient() *EvmClient
NewSimpleEthClient
@Description: not support connect to the node @return *EvmClient
func (*EvmClient) AccountByMnemonic ¶ added in v1.2.13
func (*EvmClient) AccountGenKeystore ¶ added in v1.2.13
func (*EvmClient) AccountInfoByMnemonic ¶ added in v1.2.13
AccountInfoByMnemonic
@Description: @receiver o @param mnemonic @return account @return err
func (*EvmClient) AccountWithPrivateKey ¶ added in v1.2.13
func (*EvmClient) LatestBlockNumber ¶ added in v1.2.13
LatestBlockNumber
@Description: 获取最新块 @receiver o @return uint64 @return error
func (*EvmClient) MetamaskSignLogin ¶ added in v1.2.13
MetamaskSignLogin
@Description: metamask sign login @receiver o @param message @param privateKey @return string @return error
func (*EvmClient) SignEip721 ¶ added in v1.2.13
SignEip721
@Description: eip721 sign @receiver o @param privateKey @param typedData @return string @return error
func (*EvmClient) TokenBalanceOf ¶ added in v1.2.13
func (*EvmClient) TokenErc20BalanceOf ¶ added in v1.2.13
func (o *EvmClient) TokenErc20BalanceOf(address, contractAddress string, opts *bind.CallOpts) (balance string, err error)
TokenErc20BalanceOf
@Description: erc20 balance @receiver o @param address user's account address @param contractAddress erc20 address @opts options @return balance @return err
func (*EvmClient) TokenEstimateGasLimit ¶ added in v1.2.13
func (o *EvmClient) TokenEstimateGasLimit(fromAddress, receiverAddress, gasPrice, amount string, data []byte) (balance string, err error)
TokenEstimateGasLimit
@Description: 估算gas ,如果是合约地址,data肯定不得为空 @receiver o @param fromAddress @param receiverAddress @param gasPrice @param amount @param data @return balance @return err
func (*EvmClient) TokenTransfer ¶ added in v1.2.13
func (*EvmClient) TxByBlockNumber ¶ added in v1.2.13
func (o *EvmClient) TxByBlockNumber(number uint64) ([]model.Transaction, error)
TxByBlockNumber
@Description: get all tx by block number @receiver o @param number @return []model.Transaction @return error
Click to show internal directories.
Click to hide internal directories.