Documentation ¶
Index ¶
- func EstimateGas(ctx *gin.Context, msg any) (uint64, error)
- func Fail(ctx *gin.Context, data gin.H, msg string)
- func GetBalanceAt(ctx *gin.Context, address string, blockNumber *big.Int) (*big.Int, error)
- func GetBlockByNumber(ctx *gin.Context, number *big.Int) (any, error)
- func GetBlockNumber(ctx *gin.Context) (uint64, error)
- func GetEIP155RawTx(ctx *gin.Context, gas uint64, private, to string, value *big.Int) (string, error)
- func GetEIP155SignedTx(ctx *gin.Context, gas uint64, private, to string, value *big.Int) (*types.Transaction, error)
- func GetEIP155SignedTxData(ctx *gin.Context, gas uint64, private, to string, value *big.Int) (string, error)
- func GetGasPrice(ctx *gin.Context) (*big.Int, error)
- func GetNonceAt(ctx *gin.Context, address string, blockNumber *big.Int) (uint64, error)
- func GetPendingNonceAt(ctx *gin.Context, address string) (uint64, error)
- func GetReceiptByHash(ctx *gin.Context, txHash string) (receipt any, err error)
- func GetTransactionByHash(ctx *gin.Context, txHash string) (tx any, isPending bool, err error)
- func Response(ctx *gin.Context, httpStatus int, code int, data gin.H, msg string)
- func SendRawedTransaction(ctx *gin.Context, rawTx string, tx *types.Transaction) error
- func SendSignedTransaction(ctx *gin.Context, sign string, tx *types.Transaction) error
- func Success(ctx *gin.Context, data gin.H, msg string)
- type EvmClient
- type EvmClientImpl
- func (c *EvmClientImpl) BalanceAt(ctx context.Context, address string, blockNumber *big.Int) (*big.Int, error)
- func (c *EvmClientImpl) BlockByNumber(ctx context.Context, number *big.Int) (interface{}, error)
- func (c *EvmClientImpl) BlockNumber(ctx context.Context) (uint64, error)
- func (c *EvmClientImpl) EstimateGas(ctx context.Context, msg any) (uint64, error)
- func (c *EvmClientImpl) NetworkID(ctx context.Context) (*big.Int, error)
- func (c *EvmClientImpl) NonceAt(ctx context.Context, address string, blockNumber *big.Int) (uint64, error)
- func (c *EvmClientImpl) PendingNonceAt(ctx context.Context, address string) (uint64, error)
- func (c *EvmClientImpl) SendTransaction(ctx context.Context, tx any) error
- func (c *EvmClientImpl) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (c *EvmClientImpl) TransactionByHash(ctx context.Context, txHash string) (tx any, isPending bool, err error)
- func (c *EvmClientImpl) TransactionReceipt(ctx context.Context, txHash string) (any, error)
- type ResponseMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBalanceAt ¶
func GetEIP155RawTx ¶
func GetEIP155SignedTx ¶
func GetEIP155SignedTxData ¶
func GetNonceAt ¶
func GetReceiptByHash ¶
func GetTransactionByHash ¶
func SendRawedTransaction ¶
func SendSignedTransaction ¶
Types ¶
type EvmClient ¶
type EvmClient interface { BlockNumber(ctx context.Context) (uint64, error) SuggestGasPrice(ctx context.Context) (*big.Int, error) BalanceAt(ctx context.Context, account string, blockNumber *big.Int) (*big.Int, error) NonceAt(ctx context.Context, account string, blockNumber *big.Int) (uint64, error) PendingNonceAt(ctx context.Context, account string) (uint64, error) NetworkID(ctx context.Context) (*big.Int, error) EstimateGas(ctx context.Context, msg any) (uint64, error) SendTransaction(ctx context.Context, tx any) error BlockByNumber(ctx context.Context, number *big.Int) (any, error) TransactionByHash(ctx context.Context, txHash string) (tx any, isPending bool, err error) TransactionReceipt(ctx context.Context, txHash string) (any, error) }
type EvmClientImpl ¶
type EvmClientImpl struct {
// contains filtered or unexported fields
}
func NewEVMClient ¶
func NewEVMClient(url string) (*EvmClientImpl, error)
func (*EvmClientImpl) BlockByNumber ¶
func (*EvmClientImpl) BlockNumber ¶
func (c *EvmClientImpl) BlockNumber(ctx context.Context) (uint64, error)
func (*EvmClientImpl) EstimateGas ¶
func (*EvmClientImpl) PendingNonceAt ¶
func (*EvmClientImpl) SendTransaction ¶
func (c *EvmClientImpl) SendTransaction(ctx context.Context, tx any) error
func (*EvmClientImpl) SuggestGasPrice ¶
func (*EvmClientImpl) TransactionByHash ¶
func (*EvmClientImpl) TransactionReceipt ¶
type ResponseMsg ¶
Click to show internal directories.
Click to hide internal directories.