Documentation ¶
Index ¶
- Constants
- func BuildKeys(privateKeyStr string) (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
- func GetKeyConfig(cfg *util.Config) (*util.KeyConfig, error)
- type SwapEngine
- func (engine *SwapEngine) AddSwapPairInstance(swapPair *model.SwapPair) error
- func (engine *SwapEngine) GetSwapPairInstance(erc20Addr ethcom.Address) (*SwapPairIns, error)
- func (engine *SwapEngine) InsertRetryFailedSwaps(swapIDList []uint) ([]uint, []uint, error)
- func (engine *SwapEngine) Start()
- func (engine *SwapEngine) UpdateSwapInstance(swapPair *model.SwapPair)
- func (engine *SwapEngine) WithdrawToken(chain string, tokenAddr, recipient ethcom.Address, amount *big.Int) (string, error)
- type SwapPairEngine
- type SwapPairIns
Constants ¶
View Source
const ( SwapTokenReceived common.SwapStatus = "received" SwapQuoteRejected common.SwapStatus = "rejected" SwapConfirmed common.SwapStatus = "confirmed" SwapSending common.SwapStatus = "sending" SwapSent common.SwapStatus = "sent" SwapSendFailed common.SwapStatus = "sent_fail" SwapSuccess common.SwapStatus = "sent_success" SwapPairReceived common.SwapPairStatus = "received" SwapPairConfirmed common.SwapPairStatus = "confirmed" SwapPairSending common.SwapPairStatus = "sending" SwapPairSent common.SwapPairStatus = "sent" SwapPairSendFailed common.SwapPairStatus = "sent_fail" SwapPairSuccess common.SwapPairStatus = "sent_success" SwapPairFinalized common.SwapPairStatus = "finalized" RetrySwapConfirmed common.RetrySwapStatus = "confirmed" RetrySwapSending common.RetrySwapStatus = "sending" RetrySwapSent common.RetrySwapStatus = "sent" RetrySwapSendFailed common.RetrySwapStatus = "sent_fail" RetrySwapSuccess common.RetrySwapStatus = "sent_success" SwapEth2BSC common.SwapDirection = "eth_bsc" SwapBSC2Eth common.SwapDirection = "bsc_eth" BatchSize = 50 TrackSentTxBatchSize = 100 SleepTime = 5 SwapSleepSecond = 2 TrackSwapPairSMBatchSize = 5 TxFailedStatus = 0x00 MaxUpperBound = "999999999999999999999999999999999999" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SwapEngine ¶
type SwapEngine struct {
// contains filtered or unexported fields
}
func NewSwapEngine ¶
func NewSwapEngine(db *gorm.DB, cfg *util.Config, bscClient, ethClient *ethclient.Client) (*SwapEngine, error)
NewSwapEngine returns the swapEngine instance
func (*SwapEngine) AddSwapPairInstance ¶
func (engine *SwapEngine) AddSwapPairInstance(swapPair *model.SwapPair) error
func (*SwapEngine) GetSwapPairInstance ¶
func (engine *SwapEngine) GetSwapPairInstance(erc20Addr ethcom.Address) (*SwapPairIns, error)
func (*SwapEngine) InsertRetryFailedSwaps ¶
func (engine *SwapEngine) InsertRetryFailedSwaps(swapIDList []uint) ([]uint, []uint, error)
func (*SwapEngine) Start ¶
func (engine *SwapEngine) Start()
func (*SwapEngine) UpdateSwapInstance ¶
func (engine *SwapEngine) UpdateSwapInstance(swapPair *model.SwapPair)
func (*SwapEngine) WithdrawToken ¶
type SwapPairEngine ¶
type SwapPairEngine struct {
// contains filtered or unexported fields
}
func NewSwapPairEngine ¶
func NewSwapPairEngine(db *gorm.DB, cfg *util.Config, bscClient *ethclient.Client, swapEngine *SwapEngine) (*SwapPairEngine, error)
func (*SwapPairEngine) Start ¶
func (engine *SwapPairEngine) Start()
Click to show internal directories.
Click to hide internal directories.