ethcli

package module
v2.0.0-...-653a5f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDynamicFeeTx

func BuildDynamicFeeTx(chainId *big.Int, nonce uint64, baseFee, priorityFee *big.Int,
	gas uint64, to *common.Address, value *big.Int, data []byte) *types.Transaction

BuildDynamicFeeTx build DynamicFee transaction

func BuildLegacyTx

func BuildLegacyTx(nonce uint64, gasPrice *big.Int,
	gas uint64, to *common.Address, value *big.Int, data []byte) *types.Transaction

BuildLegacyTx build Legacy transaction

func BytesToHex

func BytesToHex(bz []byte) string

func BytesToHexWith0x

func BytesToHexWith0x(bz []byte) string

func ERC20Allowance

func ERC20Allowance(ctx context.Context, cli *ethclient.Client, token, owner, spender string, blockNumber *big.Int) (*big.Int, error)

func ERC20Approve

func ERC20Approve(ctx context.Context, cli *ethclient.Client, token, key, spender, value string) (string, error)

func ERC20ApproveData

func ERC20ApproveData(spender, value string) ([]byte, error)

func ERC20BalanceOf

func ERC20BalanceOf(ctx context.Context, cli *ethclient.Client, token string, address string, blockNumber *big.Int) (*big.Int, error)

func ERC20Burn

func ERC20Burn(ctx context.Context, cli *ethclient.Client, token, key, value string) (string, error)

func ERC20BurnData

func ERC20BurnData(value string) ([]byte, error)

func ERC20BurnFrom

func ERC20BurnFrom(ctx context.Context, cli *ethclient.Client, token, key, owner, value string) (string, error)

func ERC20BurnFromData

func ERC20BurnFromData(owner, value string) ([]byte, error)

func ERC20Decimals

func ERC20Decimals(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (uint8, error)

func ERC20Mint

func ERC20Mint(ctx context.Context, cli *ethclient.Client, token, key, to, value string) (string, error)

func ERC20MintData

func ERC20MintData(to, value string) ([]byte, error)

func ERC20Name

func ERC20Name(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (string, error)

func ERC20Symbol

func ERC20Symbol(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (string, error)

func ERC20TotalSupply

func ERC20TotalSupply(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (*big.Int, error)

func ERC20Transfer

func ERC20Transfer(ctx context.Context, cli *ethclient.Client, token, key, to, value string) (string, error)

func ERC20TransferData

func ERC20TransferData(to, value string) ([]byte, error)

func ERC20TransferFrom

func ERC20TransferFrom(ctx context.Context, cli *ethclient.Client, token, key, from, to, value string) (string, error)

func ERC20TransferFromData

func ERC20TransferFromData(from, to, value string) ([]byte, error)

func ERC721Approve

func ERC721Approve(ctx context.Context, cli *ethclient.Client, token string, key, to string, tokenId *big.Int) (string, error)

func ERC721ApproveData

func ERC721ApproveData(to string, tokenId *big.Int) ([]byte, error)

func ERC721BalanceOf

func ERC721BalanceOf(ctx context.Context, cli *ethclient.Client, token string, owner string, blockNumber *big.Int) (*big.Int, error)

func ERC721Burn

func ERC721Burn(ctx context.Context, cli *ethclient.Client, token string, key string, tokenId *big.Int) (string, error)

func ERC721BurnData

func ERC721BurnData(tokenId *big.Int) ([]byte, error)

func ERC721Exists

func ERC721Exists(ctx context.Context, cli *ethclient.Client, token string, tokenId *big.Int, blockNumber *big.Int) (bool, error)

func ERC721GetApproved

func ERC721GetApproved(ctx context.Context, cli *ethclient.Client, token string, tokenId *big.Int, blockNumber *big.Int) (string, error)

func ERC721IsApprovedForAll

func ERC721IsApprovedForAll(ctx context.Context, cli *ethclient.Client, token string, owner, operator string, blockNumber *big.Int) (bool, error)

func ERC721Mint

func ERC721Mint(ctx context.Context, cli *ethclient.Client, token string, key string, to string) (string, error)

func ERC721MintData

func ERC721MintData(to string) ([]byte, error)

func ERC721MintWithTokenIdAndURI

func ERC721MintWithTokenIdAndURI(ctx context.Context, cli *ethclient.Client, token string, key string, to string, tokenId *big.Int, uri string) (string, error)

func ERC721MintWithTokenIdAndURIData

func ERC721MintWithTokenIdAndURIData(to string, tokenId *big.Int, uri string) ([]byte, error)

func ERC721MintWithTokenURI

func ERC721MintWithTokenURI(ctx context.Context, cli *ethclient.Client, token string, key string, to string, uri string) (string, error)

func ERC721MintWithTokenURIData

func ERC721MintWithTokenURIData(to string, uri string) ([]byte, error)

func ERC721Name

func ERC721Name(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (string, error)

func ERC721OwnerOf

func ERC721OwnerOf(ctx context.Context, cli *ethclient.Client, token string, tokenId *big.Int, blockNumber *big.Int) (string, error)

func ERC721Pause

func ERC721Pause(ctx context.Context, cli *ethclient.Client, token string, key string) (string, error)

func ERC721PauseData

func ERC721PauseData() ([]byte, error)

func ERC721Paused

func ERC721Paused(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (bool, error)

func ERC721SafeTransferFrom

func ERC721SafeTransferFrom(ctx context.Context, cli *ethclient.Client, token string, key, from, to string, tokenId *big.Int) (string, error)

func ERC721SafeTransferFromData

func ERC721SafeTransferFromData(from, to string, tokenId *big.Int) ([]byte, error)

func ERC721SafeTransferFromWithData

func ERC721SafeTransferFromWithData(ctx context.Context, cli *ethclient.Client, token string, key, from, to string, tokenId *big.Int, calldata []byte) (string, error)

func ERC721SafeTransferFromWithDataData

func ERC721SafeTransferFromWithDataData(from, to string, tokenId *big.Int, calldata []byte) ([]byte, error)

func ERC721SetApprovalForAll

func ERC721SetApprovalForAll(ctx context.Context, cli *ethclient.Client, token string, key, operator string, approved bool) (string, error)

func ERC721SetApprovalForAllData

func ERC721SetApprovalForAllData(operator string, approved bool) ([]byte, error)

func ERC721SupportsInterface

func ERC721SupportsInterface(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (bool, error)

func ERC721Symbol

func ERC721Symbol(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (string, error)

func ERC721TokenByIndex

func ERC721TokenByIndex(ctx context.Context, cli *ethclient.Client, token string, index *big.Int, blockNumber *big.Int) (*big.Int, error)

func ERC721TokenOfOwnerByIndex

func ERC721TokenOfOwnerByIndex(ctx context.Context, cli *ethclient.Client, token string, owner string, index *big.Int, blockNumber *big.Int) (*big.Int, error)

func ERC721TokenURI

func ERC721TokenURI(ctx context.Context, cli *ethclient.Client, token string, tokenId *big.Int, blockNumber *big.Int) (string, error)

ERC721TokenURI for ERC721Metadata && ERC721URIStorage

func ERC721TotalSupply

func ERC721TotalSupply(ctx context.Context, cli *ethclient.Client, token string, blockNumber *big.Int) (*big.Int, error)

func ERC721TransferFrom

func ERC721TransferFrom(ctx context.Context, cli *ethclient.Client, token string, key, from, to string, tokenId *big.Int) (string, error)

func ERC721TransferFromData

func ERC721TransferFromData(from, to string, tokenId *big.Int) ([]byte, error)

func ERC721Unpause

func ERC721Unpause(ctx context.Context, cli *ethclient.Client, token string, key string) (string, error)

func ERC721UnpauseData

func ERC721UnpauseData() ([]byte, error)

func ERC1155BalanceOf

func ERC1155BalanceOf(ctx context.Context, cli *ethclient.Client, token string, owner string, tokenId *big.Int, blockNumber *big.Int) (*big.Int, error)

func ERC1155BalanceOfBatch

func ERC1155BalanceOfBatch(ctx context.Context, cli *ethclient.Client, token string, owners []string, tokenIds []*big.Int, blockNumber *big.Int) ([]*big.Int, error)

func ERC1155Burn

func ERC1155Burn(ctx context.Context, cli *ethclient.Client, key string, token string, to string, id *big.Int, amount *big.Int) (string, error)

func ERC1155BurnBatch

func ERC1155BurnBatch(ctx context.Context, cli *ethclient.Client, key string, token string, to string, ids []*big.Int, amounts []*big.Int) (string, error)

func ERC1155BurnBatchData

func ERC1155BurnBatchData(from string, ids []*big.Int, amounts []*big.Int) ([]byte, error)

func ERC1155BurnData

func ERC1155BurnData(from string, id *big.Int, amount *big.Int) ([]byte, error)

func ERC1155IsApprovedForAll

func ERC1155IsApprovedForAll(ctx context.Context, cli *ethclient.Client, token string, owner string, operator string, blockNumber *big.Int) (bool, error)

func ERC1155Mint

func ERC1155Mint(ctx context.Context, cli *ethclient.Client, key string, token string, to string, id *big.Int, amount *big.Int, data []byte) (string, error)

func ERC1155MintBatch

func ERC1155MintBatch(ctx context.Context, cli *ethclient.Client, key string, token string, to string, ids []*big.Int, amounts []*big.Int, data []byte) (string, error)

func ERC1155MintBatchData

func ERC1155MintBatchData(to string, ids []*big.Int, amounts []*big.Int, data []byte) ([]byte, error)

func ERC1155MintData

func ERC1155MintData(to string, id *big.Int, amount *big.Int, data []byte) ([]byte, error)

func ERC1155SafeBatchTransferFrom

func ERC1155SafeBatchTransferFrom(ctx context.Context, cli *ethclient.Client, key string, token string, owner string, to string, ids []*big.Int, amounts []*big.Int, data []byte) (string, error)

func ERC1155SafeBatchTransferFromData

func ERC1155SafeBatchTransferFromData(from, to string, ids []*big.Int, amounts []*big.Int, data []byte) ([]byte, error)

func ERC1155SafeTransferFrom

func ERC1155SafeTransferFrom(ctx context.Context, cli *ethclient.Client, key string, token string, owner string, to string, id *big.Int, amount *big.Int, data []byte) (string, error)

func ERC1155SafeTransferFromData

func ERC1155SafeTransferFromData(from, to string, id *big.Int, amount *big.Int, data []byte) ([]byte, error)

func ERC1155SetApprovalForAll

func ERC1155SetApprovalForAll(ctx context.Context, cli *ethclient.Client, key string, token string, operator string, approved bool) (string, error)

func ERC1155SetApprovalForAllData

func ERC1155SetApprovalForAllData(operator string, approved bool) ([]byte, error)

func ERC1155SupportsInterface

func ERC1155SupportsInterface(ctx context.Context, cli *ethclient.Client, token string, interfaceId [4]byte, blockNumber *big.Int) (bool, error)

func ERC1155Uri

func ERC1155Uri(ctx context.Context, cli *ethclient.Client, token string, tokenId *big.Int, blockNumber *big.Int) (string, error)

func GenKey

func GenKey() (string, string, string, error)

GenKey return pk,address,sk

func HashToAddress

func HashToAddress(hx common.Hash) common.Address

func HashToBigInt

func HashToBigInt(hx common.Hash) *big.Int

func HexToBytes

func HexToBytes(str string) []byte

func SendDynamicFeeTx

func SendDynamicFeeTx(ctx context.Context, cli *ethclient.Client, key string, to *string, amount string, payload string) (string, error)

SendDynamicFeeTx High-level Send DynamicFee Transaction

func SendLegacyTx

func SendLegacyTx(ctx context.Context, cli *ethclient.Client, key string, to *string, amount string, payload string, gasPrice string, gasLimit uint64) (string, error)

SendLegacyTx High-level Send Legacy Transaction

func SendTx

func SendTx(ctx context.Context, cli *ethclient.Client, signedTx *types.Transaction) error

SendTx Send signed transaction

func SignTx

func SignTx(tx *types.Transaction, chainId *big.Int, key *ecdsa.PrivateKey) (*types.Transaction, error)

SignTx signs a transaction with the given private key.

func ToEther

func ToEther(v *big.Int) *big.Int

func ToWei

func ToWei(v *big.Int) *big.Int

func ValidAddress

func ValidAddress(address string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL