clients

package
v1.6.5-rc27 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthClient

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

EthClient is a client for ethereum compatible chain

func NewEthClient

func NewEthClient(endpoint string) *EthClient

NewEthClient creates a new EthClient

func (*EthClient) SendTransaction

func (c *EthClient) SendTransaction(ctx context.Context, toStr, valueStr, dataStr string, op *optypes.SyncOperator) (*ethtypes.Transaction, error)

SendTransaction sends transaction

func (*EthClient) TransactionByHash

func (c *EthClient) TransactionByHash(ctx context.Context, hash string) (any, error)

TransactionByHash returns transaction by hash

func (*EthClient) TransactionState

func (c *EthClient) TransactionState(ctx context.Context, hash string) (enums.TransactionState, error)

TransactionState returns transaction state TODO: refactor to reduce duplicate code with other chain clients (e.g. zksync.go)

type ZKSyncClient

type ZKSyncClient struct {
	*EthClient
}

ZKSyncClient is a client for zksync chain

func NewZKSyncClient

func NewZKSyncClient(endpoint string) *ZKSyncClient

NewZKSyncClient creates a new ZKSyncClient

func (*ZKSyncClient) TransactionByHash

func (c *ZKSyncClient) TransactionByHash(ctx context.Context, hash string) (any, error)

TransactionByHash returns transaction by hash

func (*ZKSyncClient) TransactionState

func (c *ZKSyncClient) TransactionState(ctx context.Context, hash string) (enums.TransactionState, error)

TransactionState returns transaction state

Jump to

Keyboard shortcuts

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