executor

package
v0.0.0-...-50fcca9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SwapStartedEventName        = "SwapStarted"
	ETH2BSCSwapStartedEventHash = ethcmm.HexToHash("0xf60309f865a6aa297da5fac6188136a02e5acfdf6e8f6d35257a9f4e9653170f")
	BSC2ETHSwapStartedEventHash = ethcmm.HexToHash("0x49c08ff11118922c1e8298915531eff9ef6f8b39b44b3e9952b75d47e1d0cdd0")
)

=================== SwapStarted =============

View Source
var (
	SwapPairRegisterEventName = "SwapPairRegister"
	SwapPairRegisterEventHash = ethcmm.HexToHash("0xfe3bd005e346323fa452df8cafc28c55b99e3766ba8750571d139c6cf5bc08a0")
)

================= SwapPairRegister ===================

Functions

This section is empty.

Types

type BSC2ETHSwapStartedEvent

type BSC2ETHSwapStartedEvent struct {
	BEP20Addr ethcmm.Address
	ERC20Addr ethcmm.Address
	FromAddr  ethcmm.Address
	Amount    *big.Int
	FeeAmount *big.Int
}

func ParseBSC2ETHSwapStartEvent

func ParseBSC2ETHSwapStartEvent(abi *abi.ABI, log *types.Log) (*BSC2ETHSwapStartedEvent, error)

func (*BSC2ETHSwapStartedEvent) ToSwapStartTxLog

func (ev *BSC2ETHSwapStartedEvent) ToSwapStartTxLog(log *types.Log) *model.SwapStartTxLog

type BscExecutor

type BscExecutor struct {
	Chain  string
	Config *util.Config

	SwapAgentAddr    ethcmm.Address
	BSCSwapAgentInst *contractabi.ETHSwapAgent
	SwapAgentAbi     abi.ABI
	Client           *ethclient.Client
}

func NewBSCExecutor

func NewBSCExecutor(ethClient *ethclient.Client, swapAddr string, config *util.Config) *BscExecutor

func (*BscExecutor) GetBlockAndTxEvents

func (e *BscExecutor) GetBlockAndTxEvents(height int64) (*common.BlockAndEventLogs, error)

func (*BscExecutor) GetChainName

func (e *BscExecutor) GetChainName() string

func (*BscExecutor) GetLogs

func (e *BscExecutor) GetLogs(header *types.Header) ([]interface{}, error)

func (*BscExecutor) GetSwapStartLogs

func (e *BscExecutor) GetSwapStartLogs(header *types.Header) ([]interface{}, error)

type ETH2BSCSwapStartedEvent

type ETH2BSCSwapStartedEvent struct {
	ERC20Addr ethcmm.Address
	FromAddr  ethcmm.Address
	Amount    *big.Int
	FeeAmount *big.Int
}

func ParseETH2BSCSwapStartEvent

func ParseETH2BSCSwapStartEvent(abi *abi.ABI, log *types.Log) (*ETH2BSCSwapStartedEvent, error)

func (*ETH2BSCSwapStartedEvent) ToSwapStartTxLog

func (ev *ETH2BSCSwapStartedEvent) ToSwapStartTxLog(log *types.Log) *model.SwapStartTxLog

type EthExecutor

type EthExecutor struct {
	Chain  string
	Config *util.Config

	SwapAgentAddr ethcmm.Address

	SwapAgentAbi abi.ABI
	Client       *ethclient.Client
	// contains filtered or unexported fields
}

func NewEthExecutor

func NewEthExecutor(ethClient *ethclient.Client, swapAddr string, config *util.Config) *EthExecutor

func (*EthExecutor) GetBlockAndTxEvents

func (e *EthExecutor) GetBlockAndTxEvents(height int64) (*common.BlockAndEventLogs, error)

func (*EthExecutor) GetChainName

func (e *EthExecutor) GetChainName() string

func (*EthExecutor) GetLogs

func (e *EthExecutor) GetLogs(header *types.Header) ([]interface{}, error)

func (*EthExecutor) GetSwapPairRegisterLogs

func (e *EthExecutor) GetSwapPairRegisterLogs(header *types.Header) ([]interface{}, error)

func (*EthExecutor) GetSwapStartLogs

func (e *EthExecutor) GetSwapStartLogs(header *types.Header) ([]interface{}, error)

type Executor

type Executor interface {
	GetBlockAndTxEvents(height int64) (*common.BlockAndEventLogs, error)
	GetChainName() string
}

type SwapPairRegisterEvent

type SwapPairRegisterEvent struct {
	Sponsor      ethcmm.Address
	ContractAddr ethcmm.Address
	Name         string
	Symbol       string
	Decimals     uint8
}

func ParseSwapPairRegisterEvent

func ParseSwapPairRegisterEvent(abi *abi.ABI, log *types.Log) (*SwapPairRegisterEvent, error)

func (*SwapPairRegisterEvent) ToSwapPairRegisterLog

func (ev *SwapPairRegisterEvent) ToSwapPairRegisterLog(log *types.Log) *model.SwapPairRegisterTxLog

Jump to

Keyboard shortcuts

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