Documentation
¶
Index ¶
- Constants
- func EncodeAuthMemo(key crypto.PublicKey) (string, error)
- func SignToken(claim Claim, key interface{}) (string, error)
- func UseEndpoint(endpoint string)
- type AssetTicker
- type Claim
- type Depth
- type DepthOrder
- type Order
- type OrderAction
- type Pair
- type PutOrderInput
- type PutOrderOutput
- type QueryOrdersInput
- type TransferAction
Constants ¶
View Source
const ( OrderSideASK = "ASK" OrderSideBID = "BID" OrderTypeLimit = "LIMIT" OrderTypeMarket = "MARKET" OrderStatePending = "PENDING" OrderStateDone = "DONE" TransferSourceCancel = "CANCEL" TransferSourceRefund = "REFUND" TransferSourceMatch = "MATCH" TradeSideMaker = "MAKER" TradeSideTaker = "TAKER" )
View Source
const (
Endpoint = "https://exchange.fox.one"
)
Variables ¶
This section is empty.
Functions ¶
func UseEndpoint ¶ added in v1.2.1
func UseEndpoint(endpoint string)
Types ¶
type AssetTicker ¶ added in v1.3.3
type AssetTicker struct { AssetID string `json:"asset_id"` Symbol string `json:"symbol"` Volume decimal.Decimal `json:"volume"` Price decimal.Decimal `json:"price"` Change decimal.Decimal `json:"change"` PriceUSD decimal.Decimal `json:"price_usd"` ChangeUSD decimal.Decimal `json:"change_usd"` PriceBTC decimal.Decimal `json:"price_btc"` ChangeBTC decimal.Decimal `json:"change_btc"` }
func ReadAssetTickers ¶ added in v1.3.3
func ReadAssetTickers(ctx context.Context) ([]*AssetTicker, error)
type Claim ¶
type Claim struct { jwt.StandardClaims MerchantID string `json:"mid,omitempty"` UserID string `json:"uid,omitempty"` }
type Depth ¶ added in v1.3.12
type Depth struct { Asks []DepthOrder `json:"asks,omitempty"` Bids []DepthOrder `json:"bids,omitempty"` // version LastUpdateID int64 `json:"last_update_id,omitempty"` }
type DepthOrder ¶ added in v1.3.12
func (DepthOrder) Values ¶ added in v1.3.12
func (order DepthOrder) Values() (price, amount decimal.Decimal)
type Order ¶ added in v1.2.1
type Order struct { OrderID string `json:"id"` CreatedAt int64 `json:"created_at"` OrderType string `json:"order_type"` UserID string `json:"user_id"` QuoteAssetID string `json:"quote_asset_id"` BaseAssetID string `json:"base_asset_id"` Symbol string `json:"symbol"` Side string `json:"side"` Price decimal.Decimal `json:"price"` RemainingAmount decimal.Decimal `json:"remaining_amount"` FilledAmount decimal.Decimal `json:"filled_amount"` RemainingFunds decimal.Decimal `json:"remaining_fund"` FilledFunds decimal.Decimal `json:"filled_fund"` State string `json:"state"` }
func QueryOrder ¶ added in v1.2.4
func QueryOrders ¶ added in v1.2.1
func QueryOrders(ctx context.Context, token string, input *QueryOrdersInput) ([]*Order, *pagination.Pagination, error)
type OrderAction ¶
type OrderAction struct { S string // side A uuid.UUID // asset P string // price T string // type O uuid.UUID // order id M uuid.UUID // merchant U []byte // user public key }
func ParsePutOrder ¶ added in v1.1.7
func ParsePutOrder(memo string) (*OrderAction, error)
func (*OrderAction) Encode ¶
func (action *OrderAction) Encode() (string, error)
type Pair ¶ added in v1.3.12
type Pair struct { Symbol string `json:"symbol,omitempty"` Status string `json:"status,omitempty"` Logo string `json:"logo,omitempty"` BaseAsset string `json:"base_asset,omitempty"` BaseAssetID string `json:"base_asset_id,omitempty"` QuoteAsset string `json:"quote_asset,omitempty"` QuoteAssetID string `json:"quote_asset_id,omitempty"` AmountPrecision int32 `json:"amount_precision,omitempty"` FundPrecision int32 `json:"fund_precision,omitempty"` PricePrecision int32 `json:"price_precision,omitempty"` BaseMinAmount decimal.Decimal `json:"base_min_amount,omitempty"` BaseMaxAmount decimal.Decimal `json:"base_max_amount,omitempty"` QuoteMinAmount decimal.Decimal `json:"quote_min_amount,omitempty"` QuoteMaxAmount decimal.Decimal `json:"quote_max_amount,omitempty"` }
type PutOrderInput ¶
type PutOrderOutput ¶
func PutOrder ¶
func PutOrder(input *PutOrderInput) (*PutOrderOutput, error)
type QueryOrdersInput ¶ added in v1.2.1
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)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.