Documentation ¶
Index ¶
- func BytesToHex(bz []byte) string
- func BytesToHexWith0x(bz []byte) string
- func GenKey() (string, string, string, error)
- func HashToAddress(hx common.Hash) common.Address
- func HashToBigInt(hx common.Hash) *big.Int
- func HexToBytes(str string) []byte
- func ToEther(v *big.Int) *big.Int
- func ToWei(v *big.Int) *big.Int
- func ValidAddress(address string) bool
- type ETHCli
- func (cli *ETHCli) BuildTx(nonce uint64, gasPrice *big.Int, gas uint64, to *common.Address, ...) *types.Transaction
- func (cli *ETHCli) ID() *big.Int
- func (cli *ETHCli) ORC1155BalanceOf(token string, owner string, tokenId *big.Int, blockNumber *big.Int) (*big.Int, error)
- func (cli *ETHCli) ORC1155BalanceOfBatch(token string, owners []string, tokenIds []*big.Int, blockNumber *big.Int) ([]*big.Int, error)
- func (cli *ETHCli) ORC1155Burn(key string, token string, to string, id *big.Int, amount *big.Int) (string, error)
- func (cli *ETHCli) ORC1155BurnBatch(key string, token string, to string, ids []*big.Int, amounts []*big.Int) (string, error)
- func (cli *ETHCli) ORC1155IsApprovedForAll(token string, owner string, operator string, blockNumber *big.Int) (bool, error)
- func (cli *ETHCli) ORC1155Mint(key string, token string, to string, id *big.Int, amount *big.Int, data []byte) (string, error)
- func (cli *ETHCli) ORC1155MintBatch(key string, token string, to string, ids []*big.Int, amounts []*big.Int, ...) (string, error)
- func (cli *ETHCli) ORC1155SafeBatchTransferFrom(key string, token string, owner string, to string, ids []*big.Int, ...) (string, error)
- func (cli *ETHCli) ORC1155SafeTransferFrom(key string, token string, owner string, to string, id *big.Int, ...) (string, error)
- func (cli *ETHCli) ORC1155SetApprovalForAll(key string, token string, owner string, operator string, id *big.Int) (string, error)
- func (cli *ETHCli) ORC1155SupportsInterface(token string, interfaceId [4]byte, blockNumber *big.Int) (bool, error)
- func (cli *ETHCli) ORC1155Uri(token string, tokenId *big.Int, blockNumber *big.Int) (string, error)
- func (cli *ETHCli) ORC20Allowance(token, owner, spender string, blockNumber *big.Int) (*big.Int, error)
- func (cli *ETHCli) ORC20Approve(token, key, spender, value string) (string, error)
- func (cli *ETHCli) ORC20BalanceOf(token string, address string, blockNumber *big.Int) (*big.Int, error)
- func (cli *ETHCli) ORC20Burn(token, key, value string) (string, error)
- func (cli *ETHCli) ORC20BurnFrom(token, key, owner, value string) (string, error)
- func (cli *ETHCli) ORC20Decimals(token string, blockNumber *big.Int) (uint8, error)
- func (cli *ETHCli) ORC20Mint(token, key, to, value string) (string, error)
- func (cli *ETHCli) ORC20Name(token string, blockNumber *big.Int) (string, error)
- func (cli *ETHCli) ORC20Symbol(token string, blockNumber *big.Int) (string, error)
- func (cli *ETHCli) ORC20TotalSupply(token string, blockNumber *big.Int) (*big.Int, error)
- func (cli *ETHCli) ORC20Transfer(token, key, to, value string) (string, error)
- func (cli *ETHCli) ORC20TransferFrom(token, key, from, to, value string) (string, error)
- func (cli *ETHCli) ORC721Approve(token string, key, to string, tokenId *big.Int) (string, error)
- func (cli *ETHCli) ORC721BalanceOf(token string, owner string, blockNumber *big.Int) (*big.Int, error)
- func (cli *ETHCli) ORC721Burn(token string, key string, tokenId *big.Int) (string, error)
- func (cli *ETHCli) ORC721Exists(token string, tokenId *big.Int, blockNumber *big.Int) (bool, error)
- func (cli *ETHCli) ORC721GetApproved(token string, tokenId *big.Int, blockNumber *big.Int) (string, error)
- func (cli *ETHCli) ORC721IsApprovedForAll(token string, owner, operator string, blockNumber *big.Int) (bool, error)
- func (cli *ETHCli) ORC721Mint(token string, key string, to string) (string, error)
- func (cli *ETHCli) ORC721MintWithTokenIdAndURI(token string, key string, to string, tokenId *big.Int, uri string) (string, error)
- func (cli *ETHCli) ORC721MintWithTokenURI(token string, key string, to string, uri string) (string, error)
- func (cli *ETHCli) ORC721Name(token string, blockNumber *big.Int) (string, error)
- func (cli *ETHCli) ORC721OwnerOf(token string, tokenId *big.Int, blockNumber *big.Int) (string, error)
- func (cli *ETHCli) ORC721Pause(token string, key string) (string, error)
- func (cli *ETHCli) ORC721Paused(token string, blockNumber *big.Int) (bool, error)
- func (cli *ETHCli) ORC721SafeTransferFrom(token string, key, from, to string, tokenId *big.Int) (string, error)
- func (cli *ETHCli) ORC721SafeTransferFromWithData(token string, key, from, to string, tokenId *big.Int, calldata []byte) (string, error)
- func (cli *ETHCli) ORC721SetApprovalForAll(token string, key, operator string, approved bool) (string, error)
- func (cli *ETHCli) ORC721SupportsInterface(token string, blockNumber *big.Int) (bool, error)
- func (cli *ETHCli) ORC721Symbol(token string, blockNumber *big.Int) (string, error)
- func (cli *ETHCli) ORC721TokenByIndex(token string, index *big.Int, blockNumber *big.Int) (*big.Int, error)
- func (cli *ETHCli) ORC721TokenOfOwnerByIndex(token string, owner string, index *big.Int, blockNumber *big.Int) (*big.Int, error)
- func (cli *ETHCli) ORC721TokenURI(token string, tokenId *big.Int, blockNumber *big.Int) (string, error)
- func (cli *ETHCli) ORC721TotalSupply(token string, blockNumber *big.Int) (*big.Int, error)
- func (cli *ETHCli) ORC721TransferFrom(token string, key, from, to string, tokenId *big.Int) (string, error)
- func (cli *ETHCli) ORC721Unpause(token string, key string) (string, error)
- func (cli *ETHCli) SendMondoTx(key string, to *string, amount string, payload string, gasPrice string, ...) (string, error)
- func (cli *ETHCli) SendTx(ctx context.Context, signedTx *types.Transaction) error
- func (cli *ETHCli) SignTx(tx *types.Transaction, key string) (*types.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToHex ¶
func BytesToHexWith0x ¶
func HexToBytes ¶
func ValidAddress ¶
Types ¶
type ETHCli ¶
func (*ETHCli) BuildTx ¶
func (cli *ETHCli) BuildTx(nonce uint64, gasPrice *big.Int, gas uint64, to *common.Address, value *big.Int, data []byte) *types.Transaction
BuildTx 生成交易 nonce:from 的nonce,通过PendingNonceAt查询 gasPrice 小数位18位,最小为1*1e10,可通过SuggestGasPrice查询建议值 gas OLO普通转账21000,合约执行可通过EstimateGas先估算 to nil时部署合约 value OLO金额,小数位18位,最小为1*1e10 data 合约执行字节码
func (*ETHCli) ORC1155BalanceOf ¶
func (*ETHCli) ORC1155BalanceOfBatch ¶
func (*ETHCli) ORC1155Burn ¶
func (*ETHCli) ORC1155BurnBatch ¶
func (*ETHCli) ORC1155IsApprovedForAll ¶
func (*ETHCli) ORC1155Mint ¶
func (*ETHCli) ORC1155MintBatch ¶
func (*ETHCli) ORC1155SafeBatchTransferFrom ¶
func (*ETHCli) ORC1155SafeTransferFrom ¶
func (*ETHCli) ORC1155SetApprovalForAll ¶
func (*ETHCli) ORC1155SupportsInterface ¶
func (*ETHCli) ORC1155Uri ¶
func (*ETHCli) ORC20Allowance ¶
func (*ETHCli) ORC20Approve ¶
func (*ETHCli) ORC20BalanceOf ¶
func (*ETHCli) ORC20BurnFrom ¶
func (*ETHCli) ORC20Decimals ¶
func (*ETHCli) ORC20Symbol ¶
func (*ETHCli) ORC20TotalSupply ¶
func (*ETHCli) ORC20Transfer ¶
func (*ETHCli) ORC20TransferFrom ¶
func (*ETHCli) ORC721Approve ¶
func (*ETHCli) ORC721BalanceOf ¶
func (*ETHCli) ORC721Burn ¶
func (*ETHCli) ORC721Exists ¶
func (*ETHCli) ORC721GetApproved ¶
func (*ETHCli) ORC721IsApprovedForAll ¶
func (*ETHCli) ORC721Mint ¶
func (*ETHCli) ORC721MintWithTokenIdAndURI ¶
func (*ETHCli) ORC721MintWithTokenURI ¶
func (*ETHCli) ORC721Name ¶
func (*ETHCli) ORC721OwnerOf ¶
func (*ETHCli) ORC721Pause ¶
func (*ETHCli) ORC721Paused ¶
func (*ETHCli) ORC721SafeTransferFrom ¶
func (*ETHCli) ORC721SafeTransferFromWithData ¶
func (*ETHCli) ORC721SetApprovalForAll ¶
func (*ETHCli) ORC721SupportsInterface ¶
func (*ETHCli) ORC721Symbol ¶
func (*ETHCli) ORC721TokenByIndex ¶
func (*ETHCli) ORC721TokenOfOwnerByIndex ¶
func (*ETHCli) ORC721TokenURI ¶
func (cli *ETHCli) ORC721TokenURI(token string, tokenId *big.Int, blockNumber *big.Int) (string, error)
ORC721TokenURI for ERC721Metadata && ERC721URIStorage
func (*ETHCli) ORC721TotalSupply ¶
func (*ETHCli) ORC721TransferFrom ¶
func (*ETHCli) ORC721Unpause ¶
func (*ETHCli) SendMondoTx ¶
func (cli *ETHCli) SendMondoTx(key string, to *string, amount string, payload string, gasPrice string, gasLimit uint64) (string, error)
SendMondoTx 高级别的发送Mondo交易 key 私钥,无0x开头的hex格式 to 地址,为空或全0时为部署合约 amount 金额,十进制字符串,整数,小数位18,第9-18位小数将被忽略 payload 合约负载,0x开头、非0x开头的hex格式 gasPrice 可选,金额,十进制字符串,整数,小数位18,第9-18位小数将被忽略;为0或不填时从链上时建议price gasLimit 可选,为0时实时估算
func (*ETHCli) SignTx ¶
func (cli *ETHCli) SignTx(tx *types.Transaction, key string) (*types.Transaction, error)
SignTx 交易签名 tx 待签名交易 key 私钥,无0x开头的hex格式 返回已签名tx,tx.Hash返回交易hash
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
eth
|
|
ethclient
Package ethclient provides a client for the Ethereum RPC API.
|
Package ethclient provides a client for the Ethereum RPC API. |
ethclient/gethclient
Package gethclient provides an RPC client for geth-specific APIs.
|
Package gethclient provides an RPC client for geth-specific APIs. |
types
Package types contains data types related to Ethereum consensus.
|
Package types contains data types related to Ethereum consensus. |
Click to show internal directories.
Click to hide internal directories.