swapper

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: GPL-3.0 Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract interface {
	Initiate() error
	Audit() error
	Redeem([32]byte) error
	AuditSecret() ([32]byte, error)
	Refund() error
}

type ContractBuilder

type ContractBuilder interface {
	BuildSwapContracts(swap Swap) (Contract, Contract, error)
}

type Logger

type Logger interface {
	LogInfo(foundation.SwapID, string)
	LogDebug(foundation.SwapID, string)
	LogError(foundation.SwapID, error)
}

type Storage

type Storage interface {
	InsertSwap(swap Swap) error
	PendingSwap(foundation.SwapID) (Swap, error)
	DeletePendingSwap(foundation.SwapID) error
	PendingSwaps() ([]Swap, error)
}

type Swap

type Swap struct {
	foundation.SwapBlob

	Secret   [32]byte `json:"secret"`
	Password string   `json:"password"`
}

func NewSwap

func NewSwap(swapBlob foundation.SwapBlob, secret [32]byte, password string) Swap

type Swapper

type Swapper interface {
	Run(done <-chan struct{}, swaps <-chan Swap, statuses chan<- foundation.SwapStatus)
}

func New

func New(builder ContractBuilder, storage Storage, logger Logger) Swapper

Jump to

Keyboard shortcuts

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