Versions in this module Expand all Collapse all v0 v0.0.1 Mar 23, 2022 Changes in this version + const ERC20InterfaceABI + const ERC721InterfaceABI + const TokenTypeErc20 + const TokenTypeErc721 + var BigIntEthGWei = big.NewInt(1e9) + func CalcEthFee(gasPrice *big.Int, gas int64) int64 + func DeployContract(opts *bind.TransactOpts, backend bind.ContractBackend, jsonAbi string, ...) (common.Address, *types.Transaction, error) + func EstimateContractMethodGas(param TransactBaseParam, backend bind.ContractBackend, ...) (int64, error) + func GweiToWei(v int64) *big.Int + func HexToAddress(addr string) (common.Address, error) + func HexToHash(s string) common.Hash + func MakeTransactOpts(w *wallet.EthWallet, param TransactBaseParam, gasLimit int64, nonce int64) (*bind.TransactOpts, error) + func SerializeTransaction(tx *types.Transaction) (string, error) + func SignTx(w *wallet.EthWallet, tx *types.Transaction) (*types.Transaction, error) + func TransferEther(opts *bind.TransactOpts, backend bind.ContractBackend, ...) (*types.Transaction, error) + func WeiToGwei(v *big.Int) int64 + type Erc20Contract struct + func NewErc20Contract(address common.Address, backend bind.ContractBackend) *Erc20Contract + func (this *Erc20Contract) Allowance(tokenOwner common.Address, spender common.Address) (*big.Int, error) + func (this *Erc20Contract) Approve(opts *bind.TransactOpts, spender common.Address, tokens *big.Int) (*types.Transaction, error) + func (this *Erc20Contract) BalanceOf(tokenOwner common.Address) (*big.Int, error) + func (this *Erc20Contract) Decimals() (int, error) + func (this *Erc20Contract) EstimateApproveGas(param TransactBaseParam, spender common.Address, tokens *big.Int) (int64, error) + func (this *Erc20Contract) EstimateTransferFromGas(param TransactBaseParam, from common.Address, to common.Address, ...) (int64, error) + func (this *Erc20Contract) EstimateTransferGas(param TransactBaseParam, to common.Address, tokens *big.Int) (int64, error) + func (this *Erc20Contract) Name() (string, error) + func (this *Erc20Contract) Symbol() (string, error) + func (this *Erc20Contract) TotalSupply() (*big.Int, error) + func (this *Erc20Contract) Transfer(opts *bind.TransactOpts, to common.Address, tokens *big.Int) (*types.Transaction, error) + func (this *Erc20Contract) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, ...) (*types.Transaction, error) + type Erc20Meta struct + Address string + Decimals int + Symbol string + type Erc721Contract struct + func NewErc721Contract(address common.Address, backend bind.ContractBackend) *Erc721Contract + func (this *Erc721Contract) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) + func (this *Erc721Contract) BalanceOf(owner common.Address) (*big.Int, error) + func (this *Erc721Contract) EstimateApproveGas(param TransactBaseParam, to common.Address, tokenId *big.Int) (int64, error) + func (this *Erc721Contract) EstimateSafeTransferFrom2Gas(param TransactBaseParam, from common.Address, to common.Address, ...) (int64, error) + func (this *Erc721Contract) EstimateSafeTransferFromGas(param TransactBaseParam, from common.Address, to common.Address, ...) (int64, error) + func (this *Erc721Contract) EstimateSetApprovalForAllGas(param TransactBaseParam, operator common.Address, approved bool) (int64, error) + func (this *Erc721Contract) EstimateTransferFromGas(param TransactBaseParam, from common.Address, to common.Address, ...) (int64, error) + func (this *Erc721Contract) GetApproved(tokenId *big.Int) (common.Address, error) + func (this *Erc721Contract) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) + func (this *Erc721Contract) Name() (string, error) + func (this *Erc721Contract) OwnerOf(tokenId *big.Int) (common.Address, error) + func (this *Erc721Contract) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, ...) (*types.Transaction, error) + func (this *Erc721Contract) SafeTransferFrom2(opts *bind.TransactOpts, from common.Address, to common.Address, ...) (*types.Transaction, error) + func (this *Erc721Contract) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) + func (this *Erc721Contract) SupportsInterface(interfaceId [4]byte) (bool, error) + func (this *Erc721Contract) Symbol() (string, error) + func (this *Erc721Contract) TokenByIndex(index *big.Int) (*big.Int, error) + func (this *Erc721Contract) TokenOfOwnerByIndex(owner common.Address, index *big.Int) (*big.Int, error) + func (this *Erc721Contract) TokenURI(tokenId *big.Int) (string, error) + func (this *Erc721Contract) TotalSupply() (*big.Int, error) + func (this *Erc721Contract) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, ...) (*types.Transaction, error) + type EthClient struct + RpcClient *ethclient.Client + func NewEthClient(URL string) (*EthClient, error) + func (this *EthClient) GetTransactionCountByNumber(ctx context.Context, blockNumber int64) (uint, error) + func (this *EthClient) SendRawTransaction(ctx context.Context, signedHex string) (string, error) + func (this *EthClient) SetHeader(key, value string) + func (this *EthClient) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, from *common.Address, blockNumber *big.Int, err error) + type TransactBaseParam struct + BaseFee *big.Int + EthValue *big.Int + From common.Address + GasFeeCap *big.Int + GasPrice *big.Int + GasTipCap *big.Int + func (this *TransactBaseParam) EnsureGasPrice(backend bind.ContractBackend) error + func (this *TransactBaseParam) GetGasPrice() *big.Int + type TransferEvent struct + BlockNumber int64 + ContractAddress string + From string + To string + TokenType int + Txid string + Value string + func FilterTransferLog(cli *ethclient.Client, fromBlock int64, toBlock int64, ...) ([]*TransferEvent, error)