client

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromHandler

func PromHandler(handler http.Handler) gin.HandlerFunc

Types

type EvmClient added in v0.0.9

type EvmClient struct {
	// contains filtered or unexported fields
}

func NewEvmClient added in v0.0.9

func NewEvmClient(conf *clientModel.ConfEvmChainClient) (*EvmClient, error)

func (*EvmClient) BalanceAt added in v0.0.9

func (ec *EvmClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)

func (*EvmClient) BlockByHash added in v0.0.9

func (ec *EvmClient) BlockByHash(ctx context.Context, blockHash common.Hash) (*types.Block, error)

func (*EvmClient) BlockByNumber added in v0.0.9

func (ec *EvmClient) BlockByNumber(ctx context.Context, blockNumber *big.Int) (*types.Block, error)

func (*EvmClient) BlockNumber added in v0.0.9

func (ec *EvmClient) BlockNumber(ctx context.Context) (uint64, error)

func (*EvmClient) ChainID added in v0.0.9

func (ec *EvmClient) ChainID(ctx context.Context) (*big.Int, error)

func (*EvmClient) Close added in v0.0.9

func (ec *EvmClient) Close()

func (*EvmClient) CodeAt added in v0.0.9

func (ec *EvmClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)

func (*EvmClient) ERC20Allowance added in v0.0.10

func (ec *EvmClient) ERC20Allowance(ctx context.Context, token common.Address, owner common.Address, spender common.Address) (*big.Int, error)

func (*EvmClient) ERC20Approve added in v0.0.10

func (ec *EvmClient) ERC20Approve(ctx context.Context, token common.Address, signer common.Address, to common.Address, value *big.Int) (*types.Transaction, error)

func (*EvmClient) ERC20BalanceOf added in v0.0.10

func (ec *EvmClient) ERC20BalanceOf(ctx context.Context, token common.Address, account common.Address) (*big.Int, error)

func (*EvmClient) ERC20Decimals added in v0.0.10

func (ec *EvmClient) ERC20Decimals(ctx context.Context, token common.Address) (uint8, error)

func (*EvmClient) ERC20DecreaseAllowance added in v0.0.10

func (ec *EvmClient) ERC20DecreaseAllowance(ctx context.Context, token common.Address, signer common.Address, to common.Address, value *big.Int) (*types.Transaction, error)

func (*EvmClient) ERC20IncreaseAllowance added in v0.0.10

func (ec *EvmClient) ERC20IncreaseAllowance(ctx context.Context, token common.Address, signer common.Address, to common.Address, value *big.Int) (*types.Transaction, error)

func (*EvmClient) ERC20Name added in v0.0.10

func (ec *EvmClient) ERC20Name(ctx context.Context, token common.Address) (string, error)

func (*EvmClient) ERC20Symbol added in v0.0.10

func (ec *EvmClient) ERC20Symbol(ctx context.Context, token common.Address) (string, error)

func (*EvmClient) ERC20TotalSupply added in v0.0.10

func (ec *EvmClient) ERC20TotalSupply(ctx context.Context, token common.Address) (*big.Int, error)

func (*EvmClient) ERC20Transfer added in v0.0.10

func (ec *EvmClient) ERC20Transfer(ctx context.Context, token common.Address, signer common.Address, to common.Address, value *big.Int) (*types.Transaction, error)

func (*EvmClient) EstimateGas added in v0.0.9

func (ec *EvmClient) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)

func (*EvmClient) FeeHistory added in v0.0.9

func (ec *EvmClient) FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64) (*ethereum.FeeHistory, error)

func (*EvmClient) GetAllSinners added in v0.0.10

func (ec *EvmClient) GetAllSinners() []common.Address

func (*EvmClient) GetTransportURL added in v0.0.10

func (ec *EvmClient) GetTransportURL() string

func (*EvmClient) HeaderByHash added in v0.0.9

func (ec *EvmClient) HeaderByHash(ctx context.Context, blockHash common.Hash) (*types.Header, error)

func (*EvmClient) HeaderByNumber added in v0.0.9

func (ec *EvmClient) HeaderByNumber(ctx context.Context, blockNumber *big.Int) (*types.Header, error)

func (*EvmClient) NetworkID added in v0.0.9

func (ec *EvmClient) NetworkID(ctx context.Context) (*big.Int, error)

func (*EvmClient) NonceAt added in v0.0.9

func (ec *EvmClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)

func (*EvmClient) PendingBalanceAt added in v0.0.9

func (ec *EvmClient) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error)

func (*EvmClient) PendingCodeAt added in v0.0.9

func (ec *EvmClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

func (*EvmClient) PendingNonceAt added in v0.0.9

func (ec *EvmClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

func (*EvmClient) PendingStorageAt added in v0.0.9

func (ec *EvmClient) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error)

func (*EvmClient) PendingTransactionCount added in v0.0.9

func (ec *EvmClient) PendingTransactionCount(ctx context.Context) (uint, error)

func (*EvmClient) SendTransaction added in v0.0.9

func (ec *EvmClient) SendTransaction(ctx context.Context, tx *types.Transaction) error

func (*EvmClient) SendTransactionSimple added in v0.0.10

func (ec *EvmClient) SendTransactionSimple(ctx context.Context, signer common.Address, to common.Address, value *big.Int) (*types.Transaction, error)

func (*EvmClient) StorageAt added in v0.0.9

func (ec *EvmClient) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)

func (*EvmClient) SuggestGasPrice added in v0.0.9

func (ec *EvmClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)

func (*EvmClient) SuggestGasTipCap added in v0.0.9

func (ec *EvmClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

func (*EvmClient) TransactionByHash added in v0.0.9

func (ec *EvmClient) TransactionByHash(ctx context.Context, blockHash common.Hash) (*types.Transaction, bool, error)

func (*EvmClient) TransactionCount added in v0.0.9

func (ec *EvmClient) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error)

func (*EvmClient) TransactionInBlock added in v0.0.9

func (ec *EvmClient) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)

func (*EvmClient) TransactionReceipt added in v0.0.9

func (ec *EvmClient) TransactionReceipt(ctx context.Context, blockHash common.Hash) (*types.Receipt, error)

type EvmClientInterface added in v0.0.9

type EvmClientInterface interface {
	BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
	BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
	HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
	TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error)
	TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)

	TransactionByHash(ctx context.Context, txHash common.Hash) (tx *types.Transaction, isPending bool, err error)
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
	SendTransaction(ctx context.Context, tx *types.Transaction) error

	BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
	StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)
	CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
	NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)

	SuggestGasPrice(ctx context.Context) (*big.Int, error)
	SuggestGasTipCap(ctx context.Context) (*big.Int, error)
	FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64) (*ethereum.FeeHistory, error)
	EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error)

	//	Geth PendingStateReader
	PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error)
	PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error)
	PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
	PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
	PendingTransactionCount(ctx context.Context) (uint, error)

	BlockNumber(ctx context.Context) (uint64, error)
	ChainID(ctx context.Context) (*big.Int, error)
}

type GinMethodConvert added in v0.0.9

type GinMethodConvert struct {
	// contains filtered or unexported fields
}

func NewGinMethodConvert

func NewGinMethodConvert(conf *clientModel.ConfPool) *GinMethodConvert

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(conf *client.ConfPool) *Pool

func (*Pool) GetEvmClient added in v0.0.9

func (p *Pool) GetEvmClient(chainID int64) *EvmClient

func (*Pool) GetSolanaClient added in v0.0.9

func (p *Pool) GetSolanaClient(chainEnv string) *SolanaClient

type SolanaClient added in v0.0.9

type SolanaClient struct {
	HttpClient   *req.Client
	ClientID     string
	AppID        string
	Zone         string
	Cluster      string
	ChainEnv     string
	Provider     string
	TransportURL string
}

func NewSolanaClient added in v0.0.9

func NewSolanaClient(conf *clientModel.ConfSolanaClient) (*SolanaClient, error)

func (*SolanaClient) GetBalance added in v0.0.9

func (sc *SolanaClient) GetBalance(ctx context.Context, request *solana.GetBalanceRequest) (*solana.GetBalanceReply, error)

func (*SolanaClient) GetTokenAccountBalance added in v0.0.9

type SolanaClientInterface added in v0.0.9

type SolanaClientInterface interface {
}

Jump to

Keyboard shortcuts

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