wallet

package
v0.0.0-...-fb81480 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package wallet provides functionality related to user wallets, including balance retrieval, deposits, and withdrawals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MainAPI

type MainAPI interface {
	// GetBalance retrieves the balance for a user in multiple currencies.
	GetBalance(userId int) (*model.Currency, error)

	// Deposit adds funds to the user's wallet.
	Deposit(dep *model.Operation) (float64, error)

	// Withdraw removes funds from the user's wallet.
	Withdraw(with *model.Operation) (float64, error)
}

MainAPI defines the core wallet operations: retrieving balance, depositing funds, and withdrawing funds.

type Wallet

type Wallet struct {
	MainAPI
}

Wallet represents a wallet service that implements the MainAPI interface.

func New

func New(repo *storage.Storage) *Wallet

New creates and returns a new instance of Wallet with the given repository.

Jump to

Keyboard shortcuts

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