currency

package
v1.10.21-0...-3b66969 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxDailyUsdLimit = 1_000.00
)

Variables

View Source
var (
	SendLimits = map[currency_lib.Code]SendLimit{}/* 166 elements not displayed */

)

todo: Better way of managing all of this

Functions

func CalculateUsdMarketValue

func CalculateUsdMarketValue(ctx context.Context, data code_data.Provider, mint *common.Account, quarks uint64, at time.Time) (float64, float64, error)

CalculateUsdMarketValue calculates the current USD market value of a crypto amount in quarks.

func GetLatestExchangeRateTime

func GetLatestExchangeRateTime() time.Time

GetLatestExchangeRateTime gets the latest time for fetching an exchange rate. By synchronizing on a time, we can eliminate the amount of perceived volatility over short time spans.

func ValidateClientExchangeData

func ValidateClientExchangeData(ctx context.Context, data code_data.Provider, proto *transactionpb.ExchangeData) (bool, string, error)

ValidateClientExchangeData validates proto exchange data provided by a client

Types

type SendLimit

type SendLimit struct {
	PerTransaction float64
}

Jump to

Keyboard shortcuts

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