Documentation ¶
Index ¶
- type Account
- func (a *Account) AccountByMnemonic() (account *Account, err error)
- func (a *Account) AccountGenKeystore(privateKey, pwd, path string) (address string, err error)
- func (a *Account) AccountInfoByMnemonic(mnemonic string) (account *Account, err error)
- func (a *Account) AccountWithPrivateKey(privateKey string) (account *Account, err error)
- type Chain
- func (c *Chain) BuildTxSign(privateKey *ecdsa.PrivateKey, txNoSign *eTypes.Transaction) (*types.BuildTxResult, error)
- func (c *Chain) BuildTxUnSign(address string, transaction *types.Transaction) (*eTypes.Transaction, error)
- func (c *Chain) Close()
- func (c *Chain) EstimateGasLimit(msg *types.CallMsg) (gas string, err error)
- func (c *Chain) Nonce(spenderAddressHex string) (uint64, error)
- func (c *Chain) SendTx(signedTx *eTypes.Transaction) error
- type Token
- type Transaction
- func (t *Transaction) BlockByNumber(number uint64) (*types.Block, error)
- func (t *Transaction) LatestBlockNumber() (uint64, error)
- func (t *Transaction) TxByBlockNumber(number uint64) ([]Transaction, error)
- func (t *Transaction) TxByHash(hash string) (*Transaction, error)
- func (t *Transaction) TxIsPending(hash string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Address string `json:"address"` PrivateKey string `json:"privateKey"` PublicKey string `json:"publicKey"` Mnemonic string `json:"mnemonic"` }
func NewAccount ¶
func NewAccount() *Account
func (*Account) AccountByMnemonic ¶
func (*Account) AccountGenKeystore ¶ added in v1.2.13
AccountGenKeystore
@Description: 生成keystore文件 @receiver a @param privateKey @param pwd @return address @return err
func (*Account) AccountInfoByMnemonic ¶
AccountInfoByMnemonic
@Description: get mnemonic account info @receiver d @param mnemonic @return address @return privateKey @return publicKey @return err
type Chain ¶
type Chain struct { RemoteRpcClient *ethclient.Client Timeout int64 ChainId *big.Int // contains filtered or unexported fields }
func GetChain ¶
GetChain
@Description: get connect from cache @param rpcUrl @param timeout @return *EthChain @return error
func (*Chain) BuildTxSign ¶
func (c *Chain) BuildTxSign(privateKey *ecdsa.PrivateKey, txNoSign *eTypes.Transaction) (*types.BuildTxResult, error)
func (*Chain) BuildTxUnSign ¶
func (c *Chain) BuildTxUnSign(address string, transaction *types.Transaction) (*eTypes.Transaction, error)
BuildTxUnSign
@Description: the transaction no sign @receiver c @param privateKey @param transaction @return *eTypes.Transaction @return error
func (*Chain) EstimateGasLimit ¶
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func (*Token) EstimateGasLimit ¶
type Transaction ¶ added in v1.2.2
type Transaction struct { Hash string Protected bool Nonce uint64 Data []byte Size uint64 Value decimal.Decimal GasPrice decimal.Decimal Type string ChainId decimal.Decimal Gas uint64 Cost decimal.Decimal GasFeeCap decimal.Decimal GasTipCap decimal.Decimal To string From string Time uint64 GasUsed uint64 CumulativeGasUsed uint64 ReceiptStatus uint64 EffectiveGasPrice decimal.Decimal BlobGasUsed uint64 BlobGasPrice decimal.Decimal TransactionIndex uint ContractAddress string // contains filtered or unexported fields }
func NewTransaction ¶ added in v1.2.2
func NewTransaction(chain *Chain) *Transaction
func (*Transaction) BlockByNumber ¶ added in v1.2.4
func (t *Transaction) BlockByNumber(number uint64) (*types.Block, error)
BlockByNumber
@Description: 根据编号获取块 @receiver t @param number 如果number<=0,则读取最新块 @return *types.Block @return error
func (*Transaction) LatestBlockNumber ¶ added in v1.2.7
func (t *Transaction) LatestBlockNumber() (uint64, error)
LatestBlockNumber
@Description: 获取最新块高度 @receiver t @return uint64 @return error
func (*Transaction) TxByBlockNumber ¶ added in v1.2.13
func (t *Transaction) TxByBlockNumber(number uint64) ([]Transaction, error)
TxByBlockNumber
@Description: 获取一个块的交易 @receiver t @param number @return []Transaction @return error
func (*Transaction) TxByHash ¶ added in v1.2.13
func (t *Transaction) TxByHash(hash string) (*Transaction, error)
TxByHash
@Description: 根据hash获取交易记录回执 @receiver t @param hash @return *types.Receipt @return error
func (*Transaction) TxIsPending ¶ added in v1.2.13
func (t *Transaction) TxIsPending(hash string) (bool, error)
TxIsPending
@Description: is pendding @receiver t @param hash @return bool @return error
Click to show internal directories.
Click to hide internal directories.