account

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidBalanceAmount is the error for an invalid balance amount.
	ErrInvalidBalanceAmount = errors.New("invalid balance amount")
	// ErrInvalidBalanceAsset is the error for an invalid balance asset.
	ErrInvalidBalanceAsset = errors.New("invalid balance asset")
	// ErrNotEnoughAsset is the error for not enough asset.
	ErrNotEnoughAsset = errors.New("not enough asset")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	Balances map[string]float64 `json:"balances"`
}

Account is the struct for an account.

func (*Account) ApplyOrder

func (a *Account) ApplyOrder(price float64, o order.Order) error

ApplyOrder will apply an order to the account.

func (Account) Validate

func (a Account) Validate() error

Validate will validate the account.

Jump to

Keyboard shortcuts

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