dao

package
v0.0.0-...-0b5acb0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SwapStateRequestOngoing     SwapState = "request_ongoing"
	SwapStateRequestRejected    SwapState = "request_rejected"
	SwapStateRequestConfirmed   SwapState = "request_confirmed"
	SwapStateFillTxDryRunFailed SwapState = "fill_tx_dry_run_failed"
	SwapStateFillTxCreated      SwapState = "fill_tx_created"
	SwapStateFillTxSent         SwapState = "fill_tx_sent"
	SwapStateFillTxConfirmed    SwapState = "fill_tx_confirmed"
	SwapStateFillTxFailed       SwapState = "fill_tx_failed"
	SwapStateFillTxMissing      SwapState = "fill_tx_missing"

	SwapDirectionForward  SwapDirection = "forward"
	SwapDirectionBackward SwapDirection = "backward"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Swap

type Swap struct {
	ID string

	// Basic Token Information
	SrcChainID   string
	DstChainID   string
	SrcTokenAddr string
	DstTokenAddr string
	Sender       string
	Recipient    string
	IDs          datatypes.JSON `gorm:"not null"`
	Amounts      datatypes.JSON `gorm:"not null"`
	Signature    string

	// Swap State
	State         SwapState
	SwapDirection SwapDirection

	// Request Transaction Information
	RequestTxHash     string
	RequestHeight     int64
	RequestBlockHash  string
	RequestTrackRetry int64

	// Fill Transaction Information
	FillConsumedFeeAmount string
	FillGasPrice          string
	FillGasUsed           int64
	FillHeight            int64
	FillTxHash            string
	FillTrackRetry        int64
	FillBlockHash         string

	MessageLog string

	// Timestamp
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (Swap) TableName

func (Swap) TableName() string

type SwapDao

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

func (*SwapDao) GetSwaps

func (s *SwapDao) GetSwaps(params erc_1155_swaps.GetErc1155SwapsParams) (int64, []Swap, error)

type SwapDaoInterface

type SwapDaoInterface interface {
	GetSwaps(params erc_1155_swaps.GetErc1155SwapsParams) (int64, []Swap, error)
}

func NewSwapDao

func NewSwapDao(db *gorm.DB) SwapDaoInterface

type SwapDirection

type SwapDirection string

type SwapPair

type SwapPair struct {
	ID string

	// Basic Token Information
	SrcChainID   string
	DstChainID   string
	SrcTokenAddr string
	DstTokenAddr string
	Sponsor      string
	Available    bool
	Signature    string
	URI          string

	// Pair State
	State SwapPairState

	// Registration Transaction Information
	RegisterTxHash     string
	RegisterHeight     int64
	RegisterBlockHash  string
	RegisterBlockLogID *string

	// Creation Transaction Information
	CreateConsumedFeeAmount string
	CreateGasPrice          string
	CreateGasUsed           int64
	CreateHeight            int64
	CreateTxHash            string
	CreateTrackRetry        int64
	CreateBlockHash         string
	CreateBlockLogID        *string

	MessageLog string

	// Timestamp
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (SwapPair) TableName

func (SwapPair) TableName() string

type SwapPairDao

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

func (*SwapPairDao) GetSwapPairs

type SwapPairDaoInterface

type SwapPairDaoInterface interface {
	GetSwapPairs(params erc_1155_swap_pairs.GetErc1155SwapPairsParams) (int64, []SwapPair, error)
}

func NewSwapPairDao

func NewSwapPairDao(db *gorm.DB) SwapPairDaoInterface

type SwapPairState

type SwapPairState string
const (
	SwapPairStateRegistrationOngoing    SwapPairState = "registration_ongoing"
	SwapPairStateRegistrationConfirmed  SwapPairState = "registration_confirmed"
	SwapPairStateCreationTxDryRunFailed SwapPairState = "creation_tx_dry_run_failed"
	SwapPairStateCreationTxCreated      SwapPairState = "creation_tx_created"
	SwapPairStateCreationTxSent         SwapPairState = "creation_tx_sent"
	SwapPairStateCreationTxConfirmed    SwapPairState = "creation_tx_confirmed"
	SwapPairStateCreationTxFailed       SwapPairState = "creation_tx_failed"
	SwapPairStateCreationTxMissing      SwapPairState = "creation_tx_missing"
)

type SwapState

type SwapState string

Jump to

Keyboard shortcuts

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