chain

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainClient

type ChainClient interface {
	Balance(ctx context.Context, account common.Address) (decimal.Decimal, error)
	TokenBalance(ctx context.Context, token common.Address, account common.Address) (*big.Int, error)
	TokenInfo(ctx context.Context, token common.Address) (TokenInfo, error)

	GetTransaction(ctx context.Context, hash common.Hash) (types.Item, error)
	GetChainID(ctx context.Context) (int64, error)
	GetChainInfo(ctx context.Context) (types.Item, error)
	GetAccountInfo(ctx context.Context, account common.Address) (types.Item, error)
	SendTransaction(ctx context.Context, from types.Account, to *common.Address, options ...interface{}) (common.Hash, error)
	SendQuery(ctx context.Context, from common.Address, to common.Address, options ...interface{}) ([]byte, error)
}

type Eth

type Eth struct {
	Client *ethclient.Client
	// contains filtered or unexported fields
}

func NewEth added in v1.2.1

func NewEth(url string, confirm bool, gas uint64, gasTipCap *big.Int) (*Eth, error)

func (*Eth) Balance

func (c *Eth) Balance(ctx context.Context, account common.Address) (decimal.Decimal, error)

func (*Eth) Call

func (c *Eth) Call(ctx context.Context, sender types.Account, contract common.Address, function string, argTypes abi.Arguments, args ...interface{}) (*ethtypes.Receipt, error)

func (*Eth) FunctionCallData

func (c *Eth) FunctionCallData(function string, argTypes abi.Arguments, args ...interface{}) ([]byte, error)

func (*Eth) GetAccountInfo

func (c *Eth) GetAccountInfo(ctx context.Context, account common.Address) (types.Item, error)

func (*Eth) GetChainID

func (c *Eth) GetChainID(ctx context.Context) (int64, error)

func (*Eth) GetChainInfo

func (c *Eth) GetChainInfo(ctx context.Context) (types.Item, error)

func (*Eth) GetTransaction

func (c *Eth) GetTransaction(ctx context.Context, hash common.Hash) (types.Item, error)

func (*Eth) Query

func (c *Eth) Query(ctx context.Context, resolver types.AddressResolver, sender common.Address, contract common.Address, function string, args ...string) ([]interface{}, error)

func (*Eth) SendQuery

func (c *Eth) SendQuery(ctx context.Context, sender common.Address, to common.Address, options ...interface{}) ([]byte, error)

func (*Eth) SendTransaction

func (c *Eth) SendTransaction(ctx context.Context, from types.Account, to *common.Address, options ...interface{}) (common.Hash, error)

func (*Eth) TokenBalance

func (c *Eth) TokenBalance(ctx context.Context, token common.Address, account common.Address) (*big.Int, error)

func (*Eth) TokenInfo

func (c *Eth) TokenInfo(ctx context.Context, token common.Address) (TokenInfo, error)

type TokenInfo added in v1.2.0

type TokenInfo struct {
	Address common.Address
	Symbol  string
	Decimal uint8
}

type WithData

type WithData struct {
	Data []byte
}

type WithGas

type WithGas struct {
	Gas uint64
}

type WithGasFeeCap

type WithGasFeeCap struct {
	Value *big.Int
}

type WithGasPrice

type WithGasPrice struct {
	Price *big.Int
}

type WithGasTipCap

type WithGasTipCap struct {
	Value *big.Int
}

type WithNonce

type WithNonce struct {
	Nonce uint64
}

type WithValue

type WithValue struct {
	Value *big.Int
}

Jump to

Keyboard shortcuts

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