tasks

package
v0.0.0-...-4d9bc2d Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RebaseEventName       = "Rebase"
	RebaseEvent           = "Rebase(uint256,uint256,uint256,uint256)"
	RebaseRewardKey       = "rebase-reward-key:%d:%s"
	RebaseRewardKeyExpire = time.Minute

	SwapForPfTokensEventName   = "SwapForPfTokens"
	SwapForPfTokensEvent       = "SwapForPfTokens(address,address,uint256,uint256)"
	SwapForFundTokensEventName = "SwapForFundTokens"
	SwapForFundTokensEvent     = "SwapForFundTokens(address,address,uint256,uint256,uint256)"

	WithdrawEventName = RequestRedemptionEventName
	WithdrawEvent     = RequestRedemptionEvent

	MintEventName = "Mint"
	BurnEventName = "Burn"
)
View Source
const (
	RequestRedemptionEventName = "RequestRedemption"
	RequestRedemptionEvent     = "RequestRedemption(address,uint256,uint256,address[],uint256[])"

	ClaimEventName = "Claim"
	ClaimEvent     = "Claim(address,uint256)"

	RefundEventName = "Refund"
	RefundEvent     = "Refund(address,uint256)"
)
View Source
const (
	WalletAssignTask = "wallet:assign"

	ERC20_TRANSFER_EVENT        = "Transfer(address,address,uint256)"
	HANDLE_WALLET_DEPOSIT_EVENT = "HandleWalletDeposit(address,uint256,address,address,uint256,uint256,uint256,uint256,uint256)"
)

A list of task types.

View Source
const WithdrawStatusUpdateInterval = time.Minute * 1

Variables

This section is empty.

Functions

func HandleWalletAssign

func HandleWalletAssign(p *WalletAssignPayload) (err error)

func HandleWalletAssignTask

func HandleWalletAssignTask(ctx context.Context, t *asynq.Task) error

func NewWalletAssignTask

func NewWalletAssignTask(task *WalletAssignPayload) (*asynq.Task, error)

func ScanPftokenWatch

func ScanPftokenWatch(lb loadbalance.LoadBalance, contractAddr string, deployedHeight, chainId uint64) error

ScanPftokenWatch

scan pftoken event

func ScanWithdrawWatch

func ScanWithdrawWatch(lb loadbalance.LoadBalance, contractAddr string, deployedHeight, chainId uint64) error

ScanWithdrawWatch

scan withdraw event

func StartPftokenStatistics

func StartPftokenStatistics()

func StartWalletStatistics

func StartWalletStatistics()

func Watch

func Watch(ctx context.Context, p *WalletAssignPayload, cancel context.CancelFunc) (err error)

func WatchWalletEvent

func WatchWalletEvent(ctx context.Context, p *WalletAssignPayload, cancel context.CancelFunc) (err error)

func WithdrawStatusUpdate

func WithdrawStatusUpdate()

Types

type TaskClient

type TaskClient struct {
	AsynqClient *asynq.Client
}

func GetClient

func GetClient() *TaskClient

func NewClient

func NewClient(redis asynq.RedisConnOpt) *TaskClient

func (*TaskClient) Enqueue

func (t *TaskClient) Enqueue(task *asynq.Task, processAt time.Time, maxRetry, timeout int) (info *asynq.TaskInfo, err error)

type WalletAssignPayload

type WalletAssignPayload struct {
	UUID            string
	Address         string
	ChainId         uint64
	HolderAddress   string
	ReceiverAddress string
	BlockNumber     uint64
	Amount          string
	BlockTime       time.Time
	ExpireTime      time.Time
	Nonce           uint64
}

type WalletTransferEvent

type WalletTransferEvent struct {
	From  common.Address
	To    common.Address
	Value *big.Int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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