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) BlockByNumber(number uint64) (*types.Block, error)
- func (o *EthClient) BlockReceiptsByNumber(number uint64) ([]*types.Receipt, error)
- func (o *EthClient) Chain() (*model.Chain, error)
- func (o *EthClient) LatestBlockNumber() (uint64, 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)
- func (o *EthClient) TxReceipt(hash string) (*types.Receipt, error)
- func (o *EthClient) TxReceiptByBlockNumber(number uint64) ([]model.Transaction, 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) BlockByNumber ¶ added in v1.2.4
BlockByNumber
@Description: 读取一个块 @receiver o @param number 如果number<=0,则读取最新块 @return *types.Block @return error
func (*EthClient) BlockReceiptsByNumber ¶ added in v1.2.12
BlockReceiptsByNumber
@Description: 读取一个块所有交易的回执 @receiver o @param number @return []*types.Receipt @return error
func (*EthClient) LatestBlockNumber ¶ added in v1.2.7
LatestBlockNumber
@Description: 获取最新块 @receiver o @return uint64 @return error
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
func (*EthClient) TokenTransfer ¶
func (*EthClient) TxReceipt ¶ added in v1.2.12
TxReceipt
@Description: 根据hash获取交易回执 @receiver o @param hash @return *types.Receipt @return error
func (*EthClient) TxReceiptByBlockNumber ¶ added in v1.2.12
func (o *EthClient) TxReceiptByBlockNumber(number uint64) ([]model.Transaction, error)
TxReceiptByBlockNumber
@Description: 获取一个块的所有交易 @receiver o @param number @return []model.Transaction @return error
Click to show internal directories.
Click to hide internal directories.