onramp

package
v1.10.20 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 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
	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