executor

package
v0.0.0-...-32b5228 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SwapStartedEventName        = "SphynxSwapStarted"
	ETH2BSCSwapStartedEventHash = ethcmm.HexToHash("0x833cb5872c808322e8666b65ac48146042bc300435300238bb929b559b9e1f6a")
	BSC2ETHSwapStartedEventHash = ethcmm.HexToHash("0xfc1a6eab912bd888ec0f7a92e1ee241615ab5e87aadc94db8c334a17efaae97d")
)

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

View Source
var (
	SwapPairRegisterEventName = "SphynxSwapPairRegister"
	SwapPairRegisterEventHash = ethcmm.HexToHash("0x06101386f3a9dd45570dce2027311173d0e136955e5b912edece89cca5bb526d")
)

================= SphynxSwapPairRegister ===================

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
	BEP20ContractAddr 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