f1exapi

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderSideASK = "ASK"
	OrderSideBID = "BID"

	OrderTypeLimit  = "LIMIT"
	OrderTypeMarket = "MARKET"

	TransferSourceCancel = "CANCEL"
	TransferSourceRefund = "REFUND"
	TransferSourceMatch  = "MATCH"

	TradeSideMaker = "MAKER"
	TradeSideTaker = "TAKER"
)

Variables

This section is empty.

Functions

func EncodeAuthMemo added in v1.1.10

func EncodeAuthMemo(key crypto.PublicKey) (string, error)

func SignToken

func SignToken(claim Claim, key *ecdsa.PrivateKey) (string, error)

Types

type Claim

type Claim struct {
	jwt.StandardClaims
	MerchantID string `json:"mid,omitempty"`
	UserID     string `json:"uid,omitempty"`
}

type OrderAction

type OrderAction struct {
	S string    // side
	A uuid.UUID // asset
	P string    // price
	T string    // type
	M uuid.UUID // merchant
}

func ParsePutOrder added in v1.1.7

func ParsePutOrder(memo string) (*OrderAction, error)

func (*OrderAction) Encode

func (action *OrderAction) Encode() (string, error)

type PutOrderInput

type PutOrderInput struct {
	Base       string `valid:"uuid,required"`
	Quote      string `valid:"uuid,required"`
	Side       string `valid:"in(ASK|BID),required"`
	Type       string `valid:"in(LIMIT|MARKET),required"`
	Price      string
	MerchantID string `valid:"uuid"`
}

type PutOrderOutput

type PutOrderOutput struct {
	AssetID  string
	Memo     string
	Opponent string
}

func PutOrder

func PutOrder(input *PutOrderInput) (*PutOrderOutput, error)

type TransferAction

type TransferAction struct {
	S string    // source
	O uuid.UUID // order
	A uuid.UUID // asset id
	P string    // price
	C string    // category, bid or ask
}

func ParseTransfer

func ParseTransfer(memo string) (*TransferAction, error)

Jump to

Keyboard shortcuts

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