currency

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound             = errors.New("record not found")
	ErrInvalidRange         = errors.New("the provided range is not valid")
	ErrInvalidInterval      = errors.New("the provided interval is not valid")
	ErrExists               = errors.New("record exists")
	ErrStaleMetadataVersion = errors.New("metadata version is stale")
	ErrStaleReserveState    = errors.New("reserve state is stale")
	ErrStaleHolderState     = errors.New("holder count state is stale")
	ErrDuplicateCurrency    = errors.New("duplicate currency detected")
)

Functions

This section is empty.

Types

type ExchangeRateRecord

type ExchangeRateRecord struct {
	Id     uint64
	Time   time.Time
	Rate   float64
	Symbol string
}

type HolderCountRecord added in v1.4.0

type HolderCountRecord struct {
	Id          uint64
	Mint        string
	HolderCount uint64
	Time        time.Time
}

func (*HolderCountRecord) Clone added in v1.4.0

func (*HolderCountRecord) CopyTo added in v1.4.0

func (m *HolderCountRecord) CopyTo(dst *HolderCountRecord)

func (*HolderCountRecord) Validate added in v1.4.0

func (m *HolderCountRecord) Validate() error

type MetadataRecord

type MetadataRecord struct {
	Id uint64

	Name        string
	Symbol      string
	Description string
	ImageUrl    string
	BillColors  []string
	SocialLinks []SocialLink

	Seed string

	Authority string

	Mint     string
	MintBump uint8
	Decimals uint8

	CurrencyConfig     string
	CurrencyConfigBump uint8

	LiquidityPool     string
	LiquidityPoolBump uint8

	VaultMint     string
	VaultMintBump uint8

	VaultCore     string
	VaultCoreBump uint8

	SellFeeBps uint16

	Alt string

	State   MetadataState
	Version uint64

	CreatedBy string
	CreatedAt time.Time
}

func (*MetadataRecord) Clone

func (m *MetadataRecord) Clone() *MetadataRecord

func (*MetadataRecord) CopyTo

func (m *MetadataRecord) CopyTo(dst *MetadataRecord)

func (*MetadataRecord) Validate

func (m *MetadataRecord) Validate() error

type MetadataState added in v0.35.0

type MetadataState uint8
const (
	MetadataStateUnknown MetadataState = iota
	MetadataStateAvailable
	MetadataStateWaitingForInitialPurchase
	MetadataStateFundingAuthority
	MetadataStateExecutingInitialPurchase
	MetadataStateCompletingInitialization
	MetadataStateFinalValidation
	MetadataStateAbandoning
	MetadataStateAbandoned
)

func (MetadataState) String added in v1.0.0

func (s MetadataState) String() string

type MultiRateRecord

type MultiRateRecord struct {
	Time  time.Time
	Rates map[string]float64
}

type ReserveRecord

type ReserveRecord struct {
	Id                uint64
	Mint              string
	SupplyFromBonding uint64
	Slot              uint64 // Not available for historical records
	Time              time.Time
}

func (*ReserveRecord) Clone

func (m *ReserveRecord) Clone() *ReserveRecord

func (*ReserveRecord) CopyTo

func (m *ReserveRecord) CopyTo(dst *ReserveRecord)

func (*ReserveRecord) Validate

func (m *ReserveRecord) Validate() error
type SocialLink struct {
	Type  SocialLinkType `json:"type"`
	Value string         `json:"value"`
}

type SocialLinkType added in v0.31.0

type SocialLinkType uint8
const (
	SocialLinkTypeUnknown SocialLinkType = iota
	SocialLinkTypeWebsite
	SocialLinkTypeX
	SocialLinkTypeTelegram
	SocialLinkTypeDiscord
)

Directories

Path Synopsis
Package exchange defines a focused store for core-mint exchange rate records.
Package exchange defines a focused store for core-mint exchange rate records.
cache
Package cache provides an exchange.Store decorator that caches single- and all-symbol rate lookups in front of a wrapped store.
Package cache provides an exchange.Store decorator that caches single- and all-symbol rate lookups in front of a wrapped store.
dynamodb
Package dynamodb implements the exchange.Store interface on top of DynamoDB.
Package dynamodb implements the exchange.Store interface on top of DynamoDB.
memory
Package memory provides an in-memory exchange.Store implementation for fast unit tests.
Package memory provides an in-memory exchange.Store implementation for fast unit tests.
tests
Package tests holds the shared conformance suite run against every exchange.Store implementation.
Package tests holds the shared conformance suite run against every exchange.Store implementation.
Package holder defines a focused store for currency creator mint holder counts.
Package holder defines a focused store for currency creator mint holder counts.
dynamodb
Package dynamodb implements the holder.Store interface on top of DynamoDB.
Package dynamodb implements the holder.Store interface on top of DynamoDB.
memory
Package memory provides an in-memory holder.Store implementation for fast unit tests.
Package memory provides an in-memory holder.Store implementation for fast unit tests.
tests
Package tests holds the shared conformance suite run against every holder.Store implementation.
Package tests holds the shared conformance suite run against every holder.Store implementation.
Package metadata defines a focused store for currency creator mint metadata.
Package metadata defines a focused store for currency creator mint metadata.
Package reserve defines a focused store for currency creator mint reserve states.
Package reserve defines a focused store for currency creator mint reserve states.
cache
Package cache provides a reserve.Store decorator that caches point-in-time reserve lookups in front of a wrapped store.
Package cache provides a reserve.Store decorator that caches point-in-time reserve lookups in front of a wrapped store.
dynamodb
Package dynamodb implements the reserve.Store interface on top of DynamoDB.
Package dynamodb implements the reserve.Store interface on top of DynamoDB.
memory
Package memory provides an in-memory reserve.Store implementation for fast unit tests.
Package memory provides an in-memory reserve.Store implementation for fast unit tests.
tests
Package tests holds the shared conformance suite run against every reserve.Store implementation.
Package tests holds the shared conformance suite run against every reserve.Store implementation.

Jump to

Keyboard shortcuts

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