controllers

package
v0.0.0-...-e0155c2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRates

func GetRates(prepareData models.PrepareShiftRequest, selectedCoin hestia.Coin, obolService obol.ObolService, plutusService services.PlutusService) (amountTo decimal.Decimal, payment models.PaymentInfo, feePayment models.PaymentInfo, err error)

func GetServiceConfig

func GetServiceConfig(data models.PrepareShiftRequest, hestiaService services.HestiaService, dev bool) (selectedCoin hestia.Coin, err error)

Utility Functions

Types

type TycheController

type TycheController struct {
	PrepareShifts map[string]models.PrepareShiftInfo

	TxsAvailable bool
	Hestia       services.HestiaService
	Plutus       services.PlutusService
	Obol         obol.ObolService
	DevMode      bool
	// contains filtered or unexported fields
}

func (*TycheController) AddShiftToMap

func (s *TycheController) AddShiftToMap(uid string, shiftPrepare models.PrepareShiftInfo)

func (*TycheController) Balance

func (s *TycheController) Balance(_ string, _ []byte, params models.Params) (interface{}, error)

func (*TycheController) GetShiftFromMap

func (s *TycheController) GetShiftFromMap(key string) (models.PrepareShiftInfo, error)

func (*TycheController) OpenBalance

func (s *TycheController) OpenBalance(_ string, _ []byte, params models.Params) (interface{}, error)

func (*TycheController) OpenPrepare

func (s *TycheController) OpenPrepare(uid string, payload []byte, _ models.Params) (interface{}, error)

func (*TycheController) OpenStatus

func (s *TycheController) OpenStatus(_ string, _ []byte, _ models.Params) (interface{}, error)

func (*TycheController) OpenStore

func (s *TycheController) OpenStore(uid string, payload []byte, _ models.Params) (interface{}, error)

func (*TycheController) Prepare

func (s *TycheController) Prepare(uid string, payload []byte, _ models.Params) (interface{}, error)

func (*TycheController) PrepareV11

func (s *TycheController) PrepareV11(_ string, payload []byte, _ models.Params) (interface{}, error)

Tyche v2 API. Most important change is the use of ShiftId instead of UID as Mempool Map Key.

func (*TycheController) RemoveShiftFromMap

func (s *TycheController) RemoveShiftFromMap(uid string)

func (*TycheController) Status

func (s *TycheController) Status(string, []byte, models.Params) (interface{}, error)

func (*TycheController) Store

func (s *TycheController) Store(uid string, payload []byte, _ models.Params) (interface{}, error)

func (*TycheController) StoreV11

func (s *TycheController) StoreV11(uid string, payload []byte, _ models.Params) (interface{}, error)

type TycheControllerV2

type TycheControllerV2 struct {
	PrepareShifts map[string]models.PrepareShiftInfoV2

	TxsAvailable bool
	Hestia       services.HestiaService
	Plutus       services.PlutusService
	Obol         obol.ObolService
	Adrestia     services.AdrestiaService
	DevMode      bool
	ExFactory    *exchanges.ExchangeFactory
	// contains filtered or unexported fields
}

func (*TycheControllerV2) AddShiftToMap

func (s *TycheControllerV2) AddShiftToMap(uid string, shiftPrepare models.PrepareShiftInfoV2)

func (*TycheControllerV2) BalanceV2

func (s *TycheControllerV2) BalanceV2(_ string, _ []byte, params models.Params) (interface{}, error)

func (*TycheControllerV2) GetRatesV2

func (s *TycheControllerV2) GetRatesV2(prepareData models.PrepareShiftRequest, selectedCoin hestia.Coin) (amountTo decimal.Decimal, paymentData models.PaymentInfoV2, err error)

func (*TycheControllerV2) GetShiftFromMap

func (s *TycheControllerV2) GetShiftFromMap(key string) (models.PrepareShiftInfoV2, error)

func (*TycheControllerV2) PrepareV2

func (s *TycheControllerV2) PrepareV2(uid string, payload []byte, _ models.Params) (interface{}, error)

Tyche v2 API. Most important change is the use of ShiftId instead of UID as Mempool Map Key.

func (*TycheControllerV2) RemoveShiftFromMap

func (s *TycheControllerV2) RemoveShiftFromMap(uid string)

utils

func (*TycheControllerV2) StatusV2

func (s *TycheControllerV2) StatusV2(uid string, _ []byte, _ models.Params) (interface{}, error)

func (*TycheControllerV2) StoreV2

func (s *TycheControllerV2) StoreV2(uid string, payload []byte, _ models.Params) (interface{}, error)

Jump to

Keyboard shortcuts

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