services

package
v0.0.0-...-41575ae Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpdateVouchersTimeFrame = 60 * 60 * 24 // 1 day
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdrestiaRequests

type AdrestiaRequests struct {
	AdrestiaUrl string
}

func (*AdrestiaRequests) DepositInfo

func (a *AdrestiaRequests) DepositInfo(depositParams models.DepositParams) (depositInfo models.DepositInfo, err error)

func (*AdrestiaRequests) GetPath

func (a *AdrestiaRequests) GetPath(fromCoin string, amount float64) (path models.VoucherPathResponse, err error)

func (*AdrestiaRequests) GetTradeStatus

func (a *AdrestiaRequests) GetTradeStatus(tradeParams hestia.Trade) (tradeInfo hestia.ExchangeOrderInfo, err error)

func (*AdrestiaRequests) GetWithdrawalTxHash

func (a *AdrestiaRequests) GetWithdrawalTxHash(withdrawParams models.WithdrawInfo) (txId string, err error)

func (*AdrestiaRequests) Trade

func (a *AdrestiaRequests) Trade(tradeParams hestia.Trade) (txId string, err error)

func (*AdrestiaRequests) Withdraw

func (a *AdrestiaRequests) Withdraw(withdrawParams models.WithdrawParamsV2) (withdrawal models.WithdrawInfo, err error)

type AdrestiaService

type AdrestiaService interface {
	DepositInfo(depositParams amodels.DepositParams) (depositInfo amodels.DepositInfo, err error)
	Trade(tradeParams hestia.Trade) (txId string, err error)
	GetTradeStatus(tradeParams hestia.Trade) (tradeInfo hestia.ExchangeOrderInfo, err error)
	Withdraw(withdrawParams amodels.WithdrawParamsV2) (withdrawal amodels.WithdrawInfo, err error)
	GetWithdrawalTxHash(withdrawParams amodels.WithdrawInfo) (txId string, err error)
	GetPath(fromCoin string, amount float64) (path amodels.VoucherPathResponse, err error)
}

type BitcouRequests

type BitcouRequests struct {
	BitcouURL    string
	BitcouToken  string
	VouchersList VouchersData
	DevMode      bool
}

func NewBitcouService

func NewBitcouService(devMode bool, version int) *BitcouRequests

func (*BitcouRequests) GetAccountBalanceV2

func (bs *BitcouRequests) GetAccountBalanceV2() (models.AccountInfo, error)

func (*BitcouRequests) GetPhoneTopUpList

func (bs *BitcouRequests) GetPhoneTopUpList(phoneNb string) ([]int, error)

func (*BitcouRequests) GetPhoneTopUpListV2

func (bs *BitcouRequests) GetPhoneTopUpListV2(phoneNb string) ([]int, error)

func (*BitcouRequests) GetTransactionInformation

func (bs *BitcouRequests) GetTransactionInformation(purchaseInfo models.PurchaseInfo) (models.PurchaseInfoResponse, error)

func (*BitcouRequests) GetTransactionInformationV2

func (bs *BitcouRequests) GetTransactionInformationV2(purchaseInfo models.PurchaseInfo) (models.PurchaseInfoResponseV2, error)

type BitcouService

type BitcouService interface {
	GetPhoneTopUpList(phoneNb string) ([]int, error)
	GetPhoneTopUpListV2(phoneNb string) ([]int, error)
	GetTransactionInformation(purchaseInfo models.PurchaseInfo) (models.PurchaseInfoResponse, error)
	GetTransactionInformationV2(purchaseInfo models.PurchaseInfo) (models.PurchaseInfoResponseV2, error)
	GetAccountBalanceV2() (models.AccountInfo, error)
}

type HestiaRequests

type HestiaRequests struct {
	HestiaURL string
	TestingDb bool
}

func (*HestiaRequests) GetCoinsConfig

func (h *HestiaRequests) GetCoinsConfig() ([]hestia.Coin, error)

func (*HestiaRequests) GetUserInfo

func (h *HestiaRequests) GetUserInfo(uid string) (info string, err error)

func (*HestiaRequests) GetVoucherInfo

func (h *HestiaRequests) GetVoucherInfo(voucherid string) (hestia.Voucher, error)

func (*HestiaRequests) GetVoucherInfoV2

func (h *HestiaRequests) GetVoucherInfoV2(country string, productId string) (models.LightVoucherV2, error)

func (*HestiaRequests) GetVoucherStatus

func (h *HestiaRequests) GetVoucherStatus() (hestia.Config, error)

func (*HestiaRequests) GetVoucherV2

func (h *HestiaRequests) GetVoucherV2(voucherid string) (hestia.VoucherV2, error)

func (*HestiaRequests) GetVouchersByStatusV2

func (h *HestiaRequests) GetVouchersByStatusV2(status hestia.VoucherStatusV2) ([]hestia.VoucherV2, error)

func (*HestiaRequests) GetVouchersByTimestamp

func (h *HestiaRequests) GetVouchersByTimestamp(uid string, timestamp string) (vouchers []hestia.Voucher, err error)

func (*HestiaRequests) GetVouchersByTimestampV2

func (h *HestiaRequests) GetVouchersByTimestampV2(uid string, timestamp string) (vouchers []hestia.VoucherV2, err error)

func (*HestiaRequests) GetVouchersStatus

func (h *HestiaRequests) GetVouchersStatus() (hestia.Config, error)

func (*HestiaRequests) UpdateVoucher

func (h *HestiaRequests) UpdateVoucher(voucherData hestia.Voucher) (string, error)

func (*HestiaRequests) UpdateVoucherV2

func (h *HestiaRequests) UpdateVoucherV2(voucherData hestia.VoucherV2) (string, error)

type HestiaService

type HestiaService interface {
	GetVouchersStatus() (hestia.Config, error)
	GetCoinsConfig() ([]hestia.Coin, error)
	GetVoucherInfo(voucherid string) (hestia.Voucher, error)
	GetVoucherV2(voucherid string) (hestia.VoucherV2, error)
	GetVoucherInfoV2(country string, productId string) (models.LightVoucherV2, error)
	UpdateVoucher(voucherData hestia.Voucher) (string, error)
	UpdateVoucherV2(voucherData hestia.VoucherV2) (string, error)
	GetVouchersByStatusV2(status hestia.VoucherStatusV2) ([]hestia.VoucherV2, error)
	GetVouchersByTimestamp(uid string, timestamp string) (vouchers []hestia.Voucher, err error)
	GetVouchersByTimestampV2(uid string, timestamp string) (vouchers []hestia.VoucherV2, err error)
	GetUserInfo(uid string) (info string, err error)
	GetVoucherStatus() (hestia.Config, error)
}

type PlutusRequests

type PlutusRequests struct {
	PlutusURL string
}

func (*PlutusRequests) GetNewPaymentAddress

func (p *PlutusRequests) GetNewPaymentAddress(coin string) (addr string, err error)

func (*PlutusRequests) GetWalletBalance

func (p *PlutusRequests) GetWalletBalance(coin string) (plutus.Balance, error)

func (*PlutusRequests) SubmitPayment

func (p *PlutusRequests) SubmitPayment(body plutus.SendAddressBodyReq) (txid string, err error)

func (*PlutusRequests) ValidateRawTx

func (p *PlutusRequests) ValidateRawTx(body plutus.ValidateRawTxReq) (valid bool, err error)

type PlutusService

type PlutusService interface {
	GetNewPaymentAddress(coin string) (addr string, err error)
	SubmitPayment(body plutus.SendAddressBodyReq) (txid string, err error)
	ValidateRawTx(body plutus.ValidateRawTxReq) (valid bool, err error)
	GetWalletBalance(coin string) (plutus.Balance, error)
}

type VouchersData

type VouchersData struct {
	List        map[string][]models.Voucher
	LastUpdated time.Time
}

Jump to

Keyboard shortcuts

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