server

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAmount = errors.New("invalid amount")
View Source
var ErrInvalidLength = errors.New("invalid length")

Functions

func MarshalAmount

func MarshalAmount(amount *big.Int) string

func MarshalSecretHash

func MarshalSecretHash(hash [32]byte) string

func MarshalToken

func MarshalToken(token foundation.Token) string

func NewHandler

func NewHandler(authenticator auth.Authenticator, manager funds.Manager, swaps chan<- swapper.Swap, statusQueries chan<- status.Query) http.Handler

NewHandler creates a new http handler

func NewServer

func NewServer(authenticator auth.Authenticator, fundManager funds.Manager, swaps chan<- swapper.Swap, statusQueries chan<- status.Query) *server

func UnmarshalAmount

func UnmarshalAmount(amount string) (*big.Int, error)

func UnmarshalSecretHash

func UnmarshalSecretHash(hash string) ([32]byte, error)

func UnmarshalToken

func UnmarshalToken(token string) (foundation.Token, error)

Types

type Balance

type Balance struct {
	Token   string `json:"token"`
	Address string `json:"address"`
	Amount  string `json:"amount"`
}

type GetBalanceResponse

type GetBalanceResponse struct {
	Balances []Balance `json:"balances"`
}

type GetSwapsResponse

type GetSwapsResponse struct {
	Swaps []SwapStatus `json:"swaps"`
}

type GetWhoAmIResponse

type GetWhoAmIResponse struct {
	Version         string             `json:"version"`
	SupportedTokens []foundation.Token `json:"supportedTokens"`
}

GetWhoAmIResponse data object contains the Swapper's internal information.

type PostWithdrawalsRequest

type PostWithdrawalsRequest struct {
	To     string `json:"to"`
	Token  string `json:"token"`
	Amount string `json:"amount"`
}

type PostWithdrawalsResponse

type PostWithdrawalsResponse struct {
	TxHash string `txHash`
}

type SwapStatus

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

Jump to

Keyboard shortcuts

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