trade

package
v1.0.73 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertTrade

func InsertTrade(trade Trade) (int, error)

func RemoveTrade

func RemoveTrade(tradeID int) error

func UpdateTrade

func UpdateTrade(trade Trade) error

Types

type MinMaxTradeDates

type MinMaxTradeDates struct {
	MinTradeDate *time.Time
	MaxTradeDate *time.Time
}

func GetMinAndMaxTradeDates

func GetMinAndMaxTradeDates() (*MinMaxTradeDates, error)

type Trade

type Trade struct {
	ID                      *int           `json:"id"`
	ParentTradeID           *int           `json:"parentTradeId"`
	FromAccountID           *int           `json:"fromAccountId"`
	ToAccountID             *int           `json:"toAccountId"`
	AssetID                 *int           `json:"assetId"`
	SourceID                *int           `json:"sourceId"`
	UUID                    string         `json:"uuid"`
	TransactionIDFromSource string         `json:"transactionIdFromSource"`
	OrderIDFromSource       string         `json:"orderIdFromSource"`
	TradeIDFromSource       string         `json:"tradeIdFromSource"`
	Name                    string         `json:"name"`
	AlternateName           string         `json:"alternateName"`
	TradeTypeID             *int           `json:"tradeTypeId"`
	TradeDate               time.Time      `json:"tradeDate"`
	SettleDate              time.Time      `json:"settleDate"`
	TransferDate            time.Time      `json:"transferDate"`
	FromQuantity            *float64       `json:"fromQuantity"`
	ToQuantity              *float64       `json:"toQuantity"`
	Price                   *float64       `json:"price"`
	TotalAmount             *float64       `json:"totalAmount"`
	FeesAmount              *float64       `json:"feesAmount"`
	FeesAssetID             *int           `json:"feesAssetId"`
	RealizedReturnAmount    *float64       `json:"realizedReturnAmount"`
	RealizedReturnAssetID   *int           `json:"realizedReturnAssetId"`
	CostBasisAmount         *float64       `json:"costBasisAmount"`
	CostBasisTradeID        *int           `json:"costBasisTradeId"`
	Description             string         `json:"description"`
	SourceData              types.JSONText `json:"sourceData"`
	IsActive                bool           `json:"isActive"`
	CreatedBy               string         `json:"createdBy"`
	CreatedAt               time.Time      `json:"createdAt"`
	UpdatedBy               string         `json:"updatedBy"`
	UpdatedAt               time.Time      `json:"updatedAt"`
}

Asset

func GetTrade

func GetTrade(tradeID int) (*Trade, error)

func GetTradeByFromAccountStartAndEndDates

func GetTradeByFromAccountStartAndEndDates(fromAccountID *int, startDate, endDate time.Time) ([]Trade, error)

func GetTradeByStartAndEndDates

func GetTradeByStartAndEndDates(startDate, endDate time.Time) ([]Trade, error)

func GetTradeByToAccountStartAndEndDates

func GetTradeByToAccountStartAndEndDates(toAccountID *int, startDate, endDate time.Time) ([]Trade, error)

func GetTradeByTradeID

func GetTradeByTradeID(tradeID int) (*Trade, error)

func GetTradeByTransactionIDFromSource

func GetTradeByTransactionIDFromSource(transactionIDFromSource string, fromAccountID *int, toAccountID *int) (*Trade, error)

func GetTradeList

func GetTradeList() ([]Trade, error)

Jump to

Keyboard shortcuts

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