Documentation
¶
Index ¶
- type EthClient
- func (o *EthClient) AccountByMnemonic() (account *model.Account, err error)
- func (o *EthClient) AccountInfoByMnemonic(mnemonic string) (account *model.Account, err error)
- func (o *EthClient) AccountWithPrivateKey(privateKey string) (account *model.Account, err error)
- func (o *EthClient) Chain() (*model.Chain, error)
- func (o *EthClient) MetamaskSignLogin(message, privateKey string) (string, error)
- func (o *EthClient) Nonce(address string) (nonce uint64, err error)
- func (o *EthClient) SignEip721(privateKey string, typedData *apitypes.TypedData) (string, error)
- func (o *EthClient) TokenBalanceOf(address string) (balance string, err error)
- func (o *EthClient) TokenEstimateGasLimit(fromAddress, receiverAddress, gasPrice, amount string, data []byte) (balance string, err error)
- func (o *EthClient) TokenTransfer(...) (hash string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EthClient ¶
type EthClient 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 *EthClient
func NewSimpleEthClient ¶
func NewSimpleEthClient() *EthClient
NewSimpleEthClient
@Description: not support connect to the node @return *EthClient
func (*EthClient) AccountByMnemonic ¶
func (*EthClient) AccountInfoByMnemonic ¶
AccountInfoByMnemonic
@Description: @receiver o @param mnemonic @return account @return err
func (*EthClient) AccountWithPrivateKey ¶
func (*EthClient) MetamaskSignLogin ¶
MetamaskSignLogin
@Description: metamask sign login @receiver o @param message @param privateKey @return string @return error
func (*EthClient) SignEip721 ¶
SignEip721
@Description: eip721 sign @receiver o @param privateKey @param typedData @return string @return error
func (*EthClient) TokenBalanceOf ¶
func (*EthClient) TokenEstimateGasLimit ¶
func (o *EthClient) 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
Click to show internal directories.
Click to hide internal directories.