evm

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GAS_LIMIT_MAINNET  = 200000
	GAS_LIMIT_GOERLI   = 200000
	GAS_LIMIT_ARBITRUM = 5000000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockRange added in v1.0.3

type BlockRange struct {
	From int64
	To   int64
}

type ERC20

type ERC20 struct {
	Address  string
	Symbol   string
	Decimals int64
	Owner    string
}

type EVMClient

type EVMClient struct {
	API            string
	ChainId        int
	PrivateKey     *ecdsa.PrivateKey
	PublicKey      common.Address
	Client         *ethclient.Client
	MaxGasFee      float64
	MaxPriorityFee float64
	GasLimit       int64
}

func NewEVMClient

func NewEVMClient(conf *config.Config) (*EVMClient, error)

NewEVMClient constructs the EVM client

func (*EVMClient) GetERC20

func (e *EVMClient) GetERC20(tokenAddress string) (*ERC20, error)

GetERC20 gets ERC20 Token info

func (*EVMClient) GetTx

func (e *EVMClient) GetTx(hash string) (*Tx, error)

GetTx gets tx by hash

func (*EVMClient) ImportPrivateKey

func (c *EVMClient) ImportPrivateKey(pk string) (*EVMClient, error)

ImportPrivateKey imports private key and generates corresponding public key

func (*EVMClient) ParseBridgeLogs

func (e *EVMClient) ParseBridgeLogs(eventName string, bridgeAddress string, blocks *BlockRange) ([]*EventLog, error)

ParseEventLog parses event logs from Ethereum

func (*EVMClient) SubmitEIP1559Tx

func (e *EVMClient) SubmitEIP1559Tx(gasPrice float64, priorityFee float64, to *common.Address, value int64, data []byte) (*types.Transaction, error)

type EventLog

type EventLog struct {
	TxID        common.Hash
	BlockHeight uint64
	Token       common.Address
	Amount      *big.Int
	To          common.Address
	Destination string
}

type Tx

type Tx struct {
	TxHash  string
	ChainId int64
	To      string
	Data    string
}

Jump to

Keyboard shortcuts

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