store

package
v0.0.0-...-a5eb945 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PendingSwaps

type PendingSwaps struct {
	Swaps [][32]byte `json:"pendingSwaps"`
}

PendingSwaps stores all the swaps that are pending

type State

type State interface {
	AddSwap([32]byte) error
	DeleteSwap([32]byte) error
	ExecutableSwaps(bool) ([][32]byte, error)
	RefundableSwaps() ([][32]byte, error)

	InitiateDetails([32]byte) (int64, [32]byte, error)
	PutInitiateDetails([32]byte, int64, [32]byte) error

	RedeemDetails([32]byte) ([32]byte, error)
	PutRedeemDetails([32]byte, [32]byte) error

	Status([32]byte) string
	PutStatus([32]byte, string) error

	Match([32]byte) (match.Match, error)
	PutMatch([32]byte, match.Match) error

	AtomDetails([32]byte) ([]byte, error)
	PutAtomDetails([32]byte, []byte) error
	AtomExists([32]byte) bool

	PutRedeemable([32]byte) error
	IsRedeemable([32]byte) bool
	Complained([32]byte) bool
	Redeemed([32]byte) error
}

func NewState

func NewState(store Store, logger logger.Logger) State

type Store

type Store interface {
	Read([]byte) ([]byte, error)
	Write([]byte, []byte) error
	Delete([]byte) error
}

type SwapInitiateDetails

type SwapInitiateDetails struct {
	Expiry   int64    `json:"expiry"`
	HashLock [32]byte `json:"hashLock"`
}

SwapInitiateDetails stores the swap status

type SwapMatch

type SwapMatch struct {
	PersonalOrderID [32]byte `json:"personalOrderID"`
	ForeignOrderID  [32]byte `json:"foreignOrderID"`
	SendValue       *big.Int `json:"sendValue"`
	ReceiveValue    *big.Int `json:"receiveValue"`
	SendCurrency    uint32   `json:"sendCurrency"`
	ReceiveCurrency uint32   `json:"receiveCurrency"`
}

SwapMatch stores the swap status

type SwapRedeemDetails

type SwapRedeemDetails struct {
	Secret [32]byte `json:"secret"`
}

type SwapStatus

type SwapStatus struct {
	Status string `json:"status"`
}

SwapStatus stores the swap status

Jump to

Keyboard shortcuts

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