asset

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Currency string `json:"currency" db:"currency"`

	Total     fixedpoint.Value `json:"total" db:"total"`
	Locked    fixedpoint.Value `json:"lock" db:"lock" `
	Available fixedpoint.Value `json:"available"  db:"available"`
	Borrowed  fixedpoint.Value `json:"borrowed" db:"borrowed"`
	Interest  fixedpoint.Value `json:"interest" db:"interest"`

	NetAsset fixedpoint.Value `json:"netAsset" db:"net_asset"`

	// NetAssetInUSD is net asset in USD
	NetAssetInUSD fixedpoint.Value `json:"netAssetInUSD" db:"net_asset_in_usd"`

	// NetAssetInBTC is net asset in BTC
	NetAssetInBTC fixedpoint.Value `json:"netAssetInBTC" db:"net_asset_in_btc"`

	Debt          fixedpoint.Value `json:"debt" db:"debt"`
	DebtInUSD     fixedpoint.Value `json:"debtInUSD" db:"debt_in_usd"`
	InterestInUSD fixedpoint.Value `json:"interestInUSD" db:"interest_in_usd"`

	Time       time.Time        `json:"time" db:"time"`
	PriceInUSD fixedpoint.Value `json:"priceInUSD" db:"price_in_usd"`
}

type Map

type Map map[string]Asset

func (Map) Filter

func (m Map) Filter(f func(asset *Asset) bool) Map

func (Map) InUSD

func (m Map) InUSD() (total fixedpoint.Value)

func (Map) Merge

func (m Map) Merge(other Map) Map

func (Map) PlainText

func (m Map) PlainText() (o string)

func (Map) SlackAttachment

func (m Map) SlackAttachment() slack.Attachment

func (Map) Slice

func (m Map) Slice() (assets []Asset)

Jump to

Keyboard shortcuts

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