core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityStorage

type ActivityStorage interface {
	Record(
		action string,
		id common.ActivityID,
		destination string,
		params map[string]interface{},
		result map[string]interface{},
		status string,
		timepoint uint64) error
}

type Blockchain

type Blockchain interface {
	Send(
		token common.Token,
		amount *big.Int,
		address ethereum.Address) (ethereum.Hash, error)
	SetRates(
		sources []ethereum.Address,
		dests []ethereum.Address,
		rates []*big.Int,
		expiryBlocks []*big.Int) (ethereum.Hash, error)
}

type ReserveCore

type ReserveCore struct {
	// contains filtered or unexported fields
}

func NewReserveCore

func NewReserveCore(
	blockchain Blockchain,
	storage ActivityStorage,
	rm ethereum.Address) *ReserveCore

func (ReserveCore) CancelOrder

func (self ReserveCore) CancelOrder(id common.ActivityID, exchange common.Exchange) error

func (ReserveCore) Deposit

func (self ReserveCore) Deposit(
	exchange common.Exchange,
	token common.Token,
	amount *big.Int,
	timepoint uint64) (common.ActivityID, error)

func (ReserveCore) SetRates

func (self ReserveCore) SetRates(
	sources []common.Token,
	dests []common.Token,
	rates []*big.Int,
	expiryBlocks []*big.Int) (common.ActivityID, error)

func (ReserveCore) Trade

func (self ReserveCore) Trade(
	exchange common.Exchange,
	tradeType string,
	base common.Token,
	quote common.Token,
	rate float64,
	amount float64,
	timepoint uint64) (common.ActivityID, float64, float64, bool, error)

func (ReserveCore) Withdraw

func (self ReserveCore) Withdraw(
	exchange common.Exchange, token common.Token,
	amount *big.Int, timepoint uint64) (common.ActivityID, error)

Jump to

Keyboard shortcuts

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