bridge

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package bridge provides types for Bridge events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEventType added in v0.0.176

func GetEventType(eventType uint8) string

GetEventType gets the str/clear text event type from EventType.

nolint:cyclop

Types

type EventLog

type EventLog interface {
	// GetContractAddress returns the contract address of the log.
	GetContractAddress() common.Address
	// GetBlockNumber returns the block number of the log.
	GetBlockNumber() uint64
	// GetTxHash returns the transaction hash of the log.
	GetTxHash() common.Hash
	// GetToken returns the token of the event.
	GetToken() common.Address
	// GetAmount returns the amount of the event.
	GetAmount() *big.Int
	// GetEventType returns the event type of the log.
	GetEventType() EventType
	// GetEventIndex returns the index of the log.
	GetEventIndex() uint64
	// GetRecipient returns the recipient of the event.
	GetRecipient() *common.Address
	// GetDestinationChainID returns the chain id of the token deposit.
	GetDestinationChainID() *big.Int
	// GetTokenIndexFrom returns the token index of the token deposit and swap.
	GetTokenIndexFrom() *uint8
	// GetTokenIndexTo returns the token index of the token deposit and swap.
	GetTokenIndexTo() *uint8
	// GetMinDy returns the min dy of the token deposit and swap.
	GetMinDy() *big.Int
	// GetDeadline returns the deadline of the token deposit and swap.
	GetDeadline() *big.Int
	// GetSwapTokenIndex returns the swap token index of the token redeem and remove.
	GetSwapTokenIndex() *uint8
	// GetSwapMinAmount returns the swap min amount of the token redeem and remove.
	GetSwapMinAmount() *big.Int
	// GetSwapDeadline returns the swap deadline of the token redeem and remove.
	GetSwapDeadline() *big.Int
	// GetRecipientBytes returns the recipient of the event.
	GetRecipientBytes() *[32]byte
	// GetFee returns the fee of the token withdraw.
	GetFee() *big.Int
	// GetKappa returns the kappa of the token withdraw.
	GetKappa() *[32]byte
	// GetSwapSuccess returns the swap success of the token withdraw and remove.
	GetSwapSuccess() *bool
}

EventLog is the interface for all bridge events.

type EventType

type EventType uint8

EventType is the type of the bridge event.

const (
	// DepositEvent is the token deposit event.
	DepositEvent EventType = iota // Origin
	// RedeemEvent is the token redeem event.
	RedeemEvent // Origin
	// WithdrawEvent is the token withdraw event.
	WithdrawEvent // Destination
	// MintEvent is the token mint event.
	MintEvent // Destination
	// DepositAndSwapEvent is the token deposit and swap event.
	DepositAndSwapEvent // Origin
	// MintAndSwapEvent is the token mint and swap event.
	MintAndSwapEvent // Destination
	// RedeemAndSwapEvent is the token redeem and swap event.
	RedeemAndSwapEvent // Origin
	// RedeemAndRemoveEvent is the token redeem and remove event.
	RedeemAndRemoveEvent // Origin
	// WithdrawAndRemoveEvent is the token withdraw and remove event.
	WithdrawAndRemoveEvent // Destination
	// RedeemV2Event is the token redeem v2 event.
	RedeemV2Event // Origin
	// CircleRequestSentEvent is emitted when the origin bridge event is executed using the cctp contract.
	CircleRequestSentEvent // Origin
	// CircleRequestFulfilledEvent is emitted when the destination bridge event is executed using the cctp contract.
	CircleRequestFulfilledEvent // Destination
	// BridgeRequestedEvent is emitted when the origin bridge event is executed using the rfq contract.
	BridgeRequestedEvent // Origin
	// BridgeRelayedEvent is emitted when the destination bridge event is executed using the rfq contract.
	BridgeRelayedEvent // Destination
)

func AllEventTypes

func AllEventTypes() []EventType

AllEventTypes is a list of the event types.

func (EventType) GormDataType

func (i EventType) GormDataType() string

GormDataType gets the data type to use for gorm.

func (EventType) Int

func (i EventType) Int() uint8

Int gets the int value of the event type.

func (*EventType) Scan

func (i *EventType) Scan(src interface{}) error

Scan gets the type to insert into the db.

func (EventType) String

func (i EventType) String() string

func (EventType) Value

func (i EventType) Value() (driver.Value, error)

Value gets the value to use for the db.

Jump to

Keyboard shortcuts

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