notifier

package
v0.0.0-...-3d49c3f Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 12 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       database.TransactionType `json:"tx_type"`
	Confirms     uint8                    `json:"confirms"`
	TokenAddress string                   `json:"token_address"`
	TokenId      string                   `json:"token_id"`
	TokenMeta    string                   `json:"token_meta"`
}

Jump to

Keyboard shortcuts

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