Documentation ¶
Index ¶
- Constants
- type Ethereum
- func (_Ethereum *Ethereum) Balance(address common.Address) (*big.Float, error)
- func (_Ethereum *Ethereum) CloseClient()
- func (_Ethereum *Ethereum) FormatEther(wei *big.Int, decimals int) *big.Float
- func (_Ethereum *Ethereum) FormatWei(value *big.Float, decimals int) *big.Int
- func (_Ethereum *Ethereum) GenerateKey() (string, string, error)
- func (_Ethereum *Ethereum) GetAccountAuth() (*bind.TransactOpts, error)
- func (_Ethereum *Ethereum) GetTokenDecimalsAmount(value *big.Float) (*big.Int, error)
- func (_Ethereum *Ethereum) IsAddress(address string) bool
- func (_Ethereum *Ethereum) SetClient(rpcURL string) *Ethereum
- func (_Ethereum *Ethereum) SetContract(address string) *Ethereum
- func (_Ethereum *Ethereum) SetPrivateKey(privateStr string) *Ethereum
- func (_Ethereum *Ethereum) TokenBalance(address common.Address) (*big.Float, error)
- func (_Ethereum *Ethereum) TokenDecimals() (*big.Int, error)
- func (_Ethereum *Ethereum) TokenTransfer(address common.Address, value *big.Float) (*types.Transaction, error)
- func (_Ethereum *Ethereum) TokenTransferFrom(fromAddress, toAddress common.Address, value *big.Float) (*types.Transaction, error)
- func (_Ethereum *Ethereum) TransactionAsMessage(tx *types.Transaction) (types.Message, error)
- func (_Ethereum *Ethereum) TransactionByHash(hashTxStr string) (*types.Transaction, bool)
Constants ¶
View Source
const ( TokenPocketRPC = "https://web3.mytokenpocket.vip" BinanceRPC = "https://bsc.nodereal.io" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ethereum ¶
type Ethereum struct {
// contains filtered or unexported fields
}
func (*Ethereum) CloseClient ¶ added in v1.11.6
func (_Ethereum *Ethereum) CloseClient()
CloseClient 关闭连接
func (*Ethereum) FormatEther ¶
FormatEther 获取以太单位
func (*Ethereum) GenerateKey ¶
GenerateKey 生成 私钥|地址
func (*Ethereum) GetAccountAuth ¶
func (_Ethereum *Ethereum) GetAccountAuth() (*bind.TransactOpts, error)
GetAccountAuth 获取账号权限
func (*Ethereum) GetTokenDecimalsAmount ¶
GetTokenDecimalsAmount 转换Token的数量
func (*Ethereum) SetContract ¶ added in v1.11.2
SetContract 设置合约
func (*Ethereum) SetPrivateKey ¶
SetPrivateKey 设置私钥
func (*Ethereum) TokenBalance ¶
TokenBalance 合约余额
func (*Ethereum) TokenDecimals ¶ added in v1.11.7
TokenDecimals 合约精度
func (*Ethereum) TokenTransfer ¶
func (_Ethereum *Ethereum) TokenTransfer(address common.Address, value *big.Float) (*types.Transaction, error)
TokenTransfer 合约转账
func (*Ethereum) TokenTransferFrom ¶
func (_Ethereum *Ethereum) TokenTransferFrom(fromAddress, toAddress common.Address, value *big.Float) (*types.Transaction, error)
TokenTransferFrom 合约授权转账
func (*Ethereum) TransactionAsMessage ¶ added in v1.11.4
TransactionAsMessage 获取哈希消息
func (*Ethereum) TransactionByHash ¶ added in v1.11.4
func (_Ethereum *Ethereum) TransactionByHash(hashTxStr string) (*types.Transaction, bool)
TransactionByHash 查询交易hex状态
Click to show internal directories.
Click to hide internal directories.