Documentation ¶
Index ¶
- Variables
- func CreateAuthentication(privateKey *ecdsa.PrivateKey, nonce *big.Int, value *big.Int, ...) *bind.TransactOpts
- func PrivateKeyToAddress(privateKey *ecdsa.PrivateKey) (address common.Address, err error)
- func SignTx(authCli *AuthClient, tx *types.Transaction) (signedTx *types.Transaction, err error)
- type AuthClient
- type ProviderClient
- func (cli *ProviderClient) DeployContract(authCli *AuthClient, gasPrice *big.Int, abiPath string, binPath string, ...) (contractAddress common.Address, txHash common.Hash, err error)
- func (cli *ProviderClient) DeployContractUntil(authCli *AuthClient, gasPrice *big.Int, abiPath string, binPath string, ...) (status bool, contractAddress common.Address, txHash common.Hash, err error)
- func (cli *ProviderClient) GetBalance(address string) (balance *big.Int, err error)
- func (cli *ProviderClient) GetBlockHeaderByHash(blockHash string) (header *types.Header, err error)
- func (cli *ProviderClient) GetBlockHeaderByNumber(height *big.Int) (header *types.Header, err error)
- func (cli *ProviderClient) GetBlockInfoByHash(blockHash string) (blockInfo *types.Block, err error)
- func (cli *ProviderClient) GetBlockInfoByNumber(height *big.Int) (blockInfo *types.Block, err error)
- func (cli *ProviderClient) GetHeight() (height uint64, err error)
- func (cli *ProviderClient) GetLatestBlockHeader() (header *types.Header, err error)
- func (cli *ProviderClient) GetLatestBlockInfo() (blockInfo *types.Block, err error)
- func (cli *ProviderClient) GetPendingNonce(address string) (nonce uint64, err error)
- func (cli *ProviderClient) GetTransactionByHash(transactionHash string) (tx *types.Transaction, isPending bool, err error)
- func (cli *ProviderClient) GetTransactionReceipt(transactionHash string) (receipt *types.Receipt, err error)
- func (cli *ProviderClient) IsContract(address string) (isContract bool, err error)
- func (cli *ProviderClient) Transfer(authCli *AuthClient, to string, amount *big.Int, data []byte, gasLimit uint64) (txHash string, err error)
- func (cli *ProviderClient) WaitingTransactionStatus(txHash string) (status bool, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidAddress = errors.New("err: input address is not valid! ") ErrInvalidAuthClientParams = errors.New("err: auth cli params is not valid! ") ErrInvalidParams = errors.New("err: input params are not valid! ") ErrInvalidHashValue = errors.New("err: input hash value is not valid! ") ErrInvalidPrivateKey = errors.New("err: input private key is not valid! ") ErrGetBlockStatus = errors.New("err: error when get status from chain! ") ErrAmountLessThanZero = errors.New("err: input amount value can not less than 0! ") )
View Source
var (
RinkebyChainId = big.NewInt(4)
)
Functions ¶
func CreateAuthentication ¶
func CreateAuthentication(privateKey *ecdsa.PrivateKey, nonce *big.Int, value *big.Int, gasPrice *big.Int) *bind.TransactOpts
func PrivateKeyToAddress ¶
func PrivateKeyToAddress(privateKey *ecdsa.PrivateKey) (address common.Address, err error)
func SignTx ¶
func SignTx(authCli *AuthClient, tx *types.Transaction) (signedTx *types.Transaction, err error)
Types ¶
type AuthClient ¶
type AuthClient struct { PrivateKey *ecdsa.PrivateKey `json:"private_key"` PublicKey *ecdsa.PublicKey `json:"public_key"` Address common.Address `json:"address"` ChainId *big.Int `json:"chain_id"` }
func NewAuthClient ¶
func NewAuthClient(priKey string, chainId *big.Int) (authCli *AuthClient, err error)
type ProviderClient ¶
func NewClient ¶
func NewClient(provider string) (cli *ProviderClient, err error)
func (*ProviderClient) DeployContract ¶
func (*ProviderClient) DeployContractUntil ¶
func (*ProviderClient) GetBalance ¶
func (cli *ProviderClient) GetBalance(address string) (balance *big.Int, err error)
func (*ProviderClient) GetBlockHeaderByHash ¶
func (cli *ProviderClient) GetBlockHeaderByHash(blockHash string) (header *types.Header, err error)
func (*ProviderClient) GetBlockHeaderByNumber ¶
func (*ProviderClient) GetBlockInfoByHash ¶
func (cli *ProviderClient) GetBlockInfoByHash(blockHash string) (blockInfo *types.Block, err error)
func (*ProviderClient) GetBlockInfoByNumber ¶
func (*ProviderClient) GetHeight ¶
func (cli *ProviderClient) GetHeight() (height uint64, err error)
func (*ProviderClient) GetLatestBlockHeader ¶
func (cli *ProviderClient) GetLatestBlockHeader() (header *types.Header, err error)
func (*ProviderClient) GetLatestBlockInfo ¶
func (cli *ProviderClient) GetLatestBlockInfo() (blockInfo *types.Block, err error)
func (*ProviderClient) GetPendingNonce ¶
func (cli *ProviderClient) GetPendingNonce(address string) (nonce uint64, err error)
func (*ProviderClient) GetTransactionByHash ¶
func (cli *ProviderClient) GetTransactionByHash(transactionHash string) (tx *types.Transaction, isPending bool, err error)
func (*ProviderClient) GetTransactionReceipt ¶
func (cli *ProviderClient) GetTransactionReceipt(transactionHash string) (receipt *types.Receipt, err error)
func (*ProviderClient) IsContract ¶
func (cli *ProviderClient) IsContract(address string) (isContract bool, err error)
func (*ProviderClient) Transfer ¶
func (cli *ProviderClient) Transfer(authCli *AuthClient, to string, amount *big.Int, data []byte, gasLimit uint64) (txHash string, err error)
func (*ProviderClient) WaitingTransactionStatus ¶
func (cli *ProviderClient) WaitingTransactionStatus(txHash string) (status bool, err error)
Click to show internal directories.
Click to hide internal directories.