callback

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DepositWebhookDto

type DepositWebhookDto struct {
	Blockchain       models.Blockchain        `json:"blockchain"`
	Hash             string                   `json:"hash"`
	NetworkCreatedAt time.Time                `json:"network_created_at"`
	FromAddress      string                   `json:"from_address"`
	ToAddress        string                   `json:"to_address"`
	Amount           string                   `json:"amount"`
	Fee              string                   `json:"fee"`
	ContractAddress  string                   `json:"contract_address"`
	Status           models.TransactionStatus `json:"status"`
	IsSystem         bool                     `json:"is_system"`
	Confirmations    uint64                   `json:"confirmations"`
	WalletType       models.WalletType        `json:"wallet_type"`
	TxUniqKey        string                   `json:"tx_uniq_key,omitempty"`
	ExternalWalletID *uuid.UUID               `json:"external_wallet_id,omitempty"`
	Currency         *models.Currency
}

func (DepositWebhookDto) GetAddressForUpdateBalance

func (dto DepositWebhookDto) GetAddressForUpdateBalance() string

func (DepositWebhookDto) GetCurrency

func (dto DepositWebhookDto) GetCurrency() *models.Currency

func (DepositWebhookDto) GetStatus

func (dto DepositWebhookDto) GetStatus() models.TransactionStatus

func (DepositWebhookDto) GetToAddress

func (dto DepositWebhookDto) GetToAddress() string

type ICallback

type ICallback interface {
	HandleDepositCallback(ctx context.Context, dto DepositWebhookDto) error
	HandleTransferCallback(ctx context.Context, dto TransferWebhookDto) error
	HandleUpdateTransferStatusCallback(ctx context.Context, dto processing_request.TransferStatusWebhook) error
}

func New

func New(
	logger logger.Logger,
	eventListener event.IListener,
	storage storage.IStorage,
	transactionsService transactions.ITransaction,
	unconfirmedTransactionsService transactions.IUnconfirmedTransaction,
	storeService store.IStore,
	currConvService currconv.ICurrencyConvertor,
	receiptsService receipts.IReceiptService,
) ICallback

type ProcessingWebhook

type ProcessingWebhook struct {
	Blockchain       models.Blockchain        `json:"blockchain"`
	Hash             string                   `json:"hash"`
	NetworkCreatedAt time.Time                `json:"network_created_at"`
	FromAddress      string                   `json:"from_address"`
	ToAddress        string                   `json:"to_address"`
	Amount           string                   `json:"amount"`
	Fee              string                   `json:"fee"`
	ContractAddress  string                   `json:"contract_address"`
	Status           models.TransactionStatus `json:"status"`
	Confirmations    uint64                   `json:"confirmations"`
	TransactionType  models.TransactionsType  `json:"transaction_type"`
	TxUniqKey        string                   `json:"tx_uniq_key,omitempty"`
	ExternalWalletID uuid.UUID                `json:"external_wallet_id,omitempty"`
}

type Service

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

func (*Service) HandleDepositCallback

func (s *Service) HandleDepositCallback(ctx context.Context, dto DepositWebhookDto) error

func (*Service) HandleTransferCallback

func (s *Service) HandleTransferCallback(ctx context.Context, dto TransferWebhookDto) error

func (*Service) HandleUpdateTransferStatusCallback

func (s *Service) HandleUpdateTransferStatusCallback(ctx context.Context, dto processing_request.TransferStatusWebhook) error

type TransferWebhookDto

type TransferWebhookDto struct {
	Blockchain       models.Blockchain        `json:"blockchain"`
	TransferID       uuid.NullUUID            `json:"transfer_id"`
	Hash             string                   `json:"hash"`
	NetworkCreatedAt time.Time                `json:"network_created_at"`
	FromAddress      string                   `json:"from_address"`
	ToAddress        string                   `json:"to_address"`
	Amount           string                   `json:"amount"`
	Fee              string                   `json:"fee"`
	ContractAddress  string                   `json:"contract_address"`
	Status           models.TransactionStatus `json:"status"`
	IsSystem         bool                     `json:"is_system"`
	Confirmations    uint64                   `json:"confirmations"`
	TxUniqKey        string                   `json:"tx_uniq_key,omitempty"`
	WalletType       models.WalletType        `json:"wallet_type"`
	ExternalWalletID *uuid.UUID               `json:"external_wallet_id,omitempty"`
	Currency         *models.Currency
}

func (TransferWebhookDto) GetAddressForUpdateBalance

func (dto TransferWebhookDto) GetAddressForUpdateBalance() string

func (TransferWebhookDto) GetCurrency

func (dto TransferWebhookDto) GetCurrency() *models.Currency

func (TransferWebhookDto) GetStatus

func (TransferWebhookDto) GetToAddress

func (dto TransferWebhookDto) GetToAddress() string

type WebhookDtoInterface

type WebhookDtoInterface interface {
	GetToAddress() string
	GetAddressForUpdateBalance() string
	GetStatus() models.TransactionStatus
	GetCurrency() *models.Currency
}

Jump to

Keyboard shortcuts

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