Documentation
¶
Index ¶
- Variables
- type IUserService
- type IWalletService
- type SortOrder
- type UserService
- type WalletService
- func (s *WalletService) Deposit(userID uint, currency string, amount decimal.Decimal) error
- func (s *WalletService) GetBalances(userID uint, currencies []string) ([]models.Vault, error)
- func (s *WalletService) GetTransactionHistory(userID uint, txnType models.TransactionType, cursor string, order SortOrder, ...) ([]models.Transaction, string, error)
- func (s *WalletService) Transfer(senderID, recipientID uint, currency string, amount decimal.Decimal, ...) error
- func (s *WalletService) Withdraw(userID uint, currency string, amount decimal.Decimal) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = errors.New("user not found") )
View Source
var ( ErrInvalidAmount = errors.New("invalid amount") ErrInsufficientBalance = errors.New("insufficient balance") )
Functions ¶
This section is empty.
Types ¶
type IUserService ¶
type IWalletService ¶
type IWalletService interface { Deposit(userID uint, currency string, amount decimal.Decimal) error Withdraw(userID uint, currency string, amount decimal.Decimal) error Transfer(senderID, recipientID uint, currency string, amount decimal.Decimal, memo string) error GetBalances(userID uint, currencies []string) ([]models.Vault, error) GetTransactionHistory(userID uint, txnType models.TransactionType, cursor string, order SortOrder, limit int) ([]models.Transaction, string, error) }
type UserService ¶
UserService represents the service for user-related operations
func NewUserService ¶
func NewUserService(db *gorm.DB) *UserService
func (*UserService) GetUserByName ¶
type WalletService ¶
WalletService represents the service for wallet-related operations
func NewWalletService ¶
func NewWalletService(db *gorm.DB) *WalletService
func (*WalletService) GetBalances ¶
func (*WalletService) GetTransactionHistory ¶
func (s *WalletService) GetTransactionHistory( userID uint, txnType models.TransactionType, cursor string, order SortOrder, limit int) ([]models.Transaction, string, error)
GetTransactionHistory retrieves paginated transaction history using a unique cursor with filters
Click to show internal directories.
Click to hide internal directories.