core

package
v0.0.0-...-5362a35 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionLock   = 1
	ActionUnlock = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Action  int
	VaultID uint64
	// Exp in nano seconds
	Exp uint64
}

func DecodeEvent

func DecodeEvent(b []byte) (*Event, error)

func (*Event) Encode

func (e *Event) Encode() []byte

type Group

type Group struct {
	Members   []string `json:"members,omitempty"`
	Threshold uint8    `json:"threshold,omitempty"`
}

func DecodeGroup

func DecodeGroup(b []byte) (*Group, error)

func (*Group) Encode

func (g *Group) Encode() []byte

type Invoker

type Invoker interface {
	// Payment generate a mixin payment code
	Payment(ctx context.Context, assetID string, amount decimal.Decimal, extra []byte) (string, error)
}

type Vault

type Vault struct {
	ID     uint64
	UserID string
	Symbol string
	Amount decimal.Decimal
	End    time.Time
}

type VaultStore

type VaultStore interface {
	Save(vault *Vault) error
	Delete(id uint64) (*Vault, error)
	List(userID string) ([]*Vault, error)
}

Jump to

Keyboard shortcuts

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