onramp

package
v0.0.0-...-c6effd4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPurchaseAlreadyExists indicates an onramp purchase record already exists
	ErrPurchaseAlreadyExists = errors.New("onramp purchase record already exists")

	// ErrPurchaseNotFound indicates an onramp purchase record doesn't exists
	ErrPurchaseNotFound = errors.New("onramp purchase record not found")
)

Functions

This section is empty.

Types

type Record

type Record struct {
	Id uint64

	Owner    string
	Platform int // todo: can't use client.DeviceType due to import cycle
	Currency string
	Amount   float64
	Nonce    uuid.UUID

	CreatedAt time.Time
}

todo: We can track provider, fulfillment state, time to fulfillment, etc.

func (*Record) Clone

func (r *Record) Clone() Record

func (*Record) CopyTo

func (r *Record) CopyTo(dst *Record)

func (*Record) Validate

func (r *Record) Validate() error

type Store

type Store interface {
	// Put creates a new onramp purchase record
	Put(ctx context.Context, record *Record) error

	// Get gets an onramp purchase record by nonce
	Get(ctx context.Context, nonce uuid.UUID) (*Record, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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