onramp

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 5 Imported by: 0

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
	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