chain

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	ID        int64
	Address   string
	Committed AccountState
	Verified  AccountState
}

type AccountState

type AccountState struct {
	Balances map[string]string
	Nonce    uint64
}

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) (types.Item, 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 NewEthFromURL

func NewEthFromURL(url string) (*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) SubmitTx

func (c *Eth) SubmitTx(ctx context.Context, sender types.Account, to *common.Address, opts ...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) (types.Item, error)

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
}

type ZkSync

type ZkSync struct {
	URL string
}

func NewZkSyncFromURL

func NewZkSyncFromURL(url string) (*ZkSync, error)

func (*ZkSync) Balance

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

func (*ZkSync) GetAccountInfo

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

func (*ZkSync) GetChainID

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

func (*ZkSync) GetChainInfo

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

func (*ZkSync) GetTransaction

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

func (*ZkSync) SendQuery

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

func (*ZkSync) SendTransaction

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

func (*ZkSync) TokenBalance

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

func (*ZkSync) TokenInfo

func (c *ZkSync) TokenInfo(ctx context.Context, token common.Address) (types.Item, error)

Jump to

Keyboard shortcuts

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