notifier

package
v0.0.0-...-48d27f4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

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

func NewNotifier

func NewNotifier(db *database.DB, shutdown context.CancelCauseFunc) (*Notifier, error)

func (*Notifier) BeforeAfterNotify

func (nf *Notifier) BeforeAfterNotify(businessId string, isBefore bool, notifySuccess bool, deposits []database.Deposits, withdraws []database.Withdraws, internals []database.Internals) error

func (*Notifier) BuildNotifyTransaction

func (nf *Notifier) BuildNotifyTransaction(deposits []database.Deposits, withdraws []database.Withdraws, internals []database.Internals) (*NotifyRequest, error)

func (*Notifier) Start

func (nf *Notifier) Start(ctx context.Context) error

func (*Notifier) Stop

func (nf *Notifier) Stop(ctx context.Context) error

func (*Notifier) Stopped

func (nf *Notifier) Stopped() bool

type NotifyClient

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

func NewNotifierClient

func NewNotifierClient(baseUrl string) (*NotifyClient, error)

func (*NotifyClient) BusinessNotify

func (nc *NotifyClient) BusinessNotify(notifyData *NotifyRequest) (bool, error)

type NotifyRequest

type NotifyRequest struct {
	Txn []Transaction `json:"txn"`
}

type NotifyResponse

type NotifyResponse struct {
	Success bool `json:"success"`
}

type Transaction

type Transaction struct {
	BlockHash   string `json:"block_hash"`
	BlockNumber uint64 `json:"block_number"`
	Hash        string `json:"hash"`
	FromAddress string `json:"from_address"`
	ToAddress   string `json:"to_address"`
	Value       string `json:"value"`
	Fee         string `json:"fee"`
	TxType      string `json:"tx_type"` // 0: 充值,1:提现;2:归集,3:热转冷;4:冷转热
	Confirms    uint8  `json:"confirms"`
}

Jump to

Keyboard shortcuts

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