models

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLSettings

type ACLSettings struct {
	SubAccountID                    string `json:"sub_account_id"`
	DepositAddressGenerationEnabled bool   `json:"deposit_address_generation_enabled"`
	WithdrawEnabled                 bool   `json:"withdraw_enabled"`
	Description                     string `json:"description"`
	CreatedAt                       string `json:"created_at"`
	UpdatedAt                       string `json:"updated_at"`
}

type APIError

type APIError struct {
	Code        int    `json:"code"`
	Message     string `json:"message"`
	Description string `json:"description"`
}

Error is an error from the exchange

func (APIError) String

func (err APIError) String() string

type AmountLock

type AmountLock struct {
	ID                int64  `json:"id"`
	Currency          string `json:"currency"`
	Amount            string `json:"amount"`
	DateEnd           string `json:"date_end"`
	Description       string `json:"description"`
	Cancelled         bool   `json:"cancelled"`
	CancelledAt       string `json:"cancelled_at"`
	CancelDescription string `json:"cancel_description"`
	CreatedAt         string `json:"created_at"`
}

type Balance

type Balance struct {
	Currency  string `json:"currency"`
	Available string `json:"available"`
	Reserved  string `json:"reserved"`
}

Balance is the amount of currency a user have

type BookLevel

type BookLevel struct {
	Price  string `json:"price"`
	Amount string `json:"amount"`
}

BookLevel agregates orders by price in a symbol

type BooleanResponse

type BooleanResponse struct {
	Result bool `json:"result"`
}

type Candle

type Candle struct {
	Timestamp   string `json:"timestamp"`
	Open        string `json:"open"`
	Close       string `json:"close"`
	High        string `json:"max"`
	Low         string `json:"min"`
	Volume      string `json:"volume"`
	VolumeQuote string `json:"volume_quote"`
}

Candle is an OHLC representation of the market This version uses Max instead of High nad Min instead of Low

type ConvertedCandles added in v3.1.1

type ConvertedCandles struct {
	TargetCurrency string              `json:"target_currency"`
	Data           map[string][]Candle `json:"data"`
}

type ConvertedCandlesOfSymbol added in v3.1.1

type ConvertedCandlesOfSymbol struct {
	TargetCurrency string   `json:"target_currency"`
	Data           []Candle `json:"data"`
}

type CryptoAddress

type CryptoAddress struct {
	Currency    string `json:"currency"`
	Address     string `json:"address"`
	PaymentID   string `json:"payment_id"`
	PublicKey   string `json:"publicKey"`
	NetworkCode string `json:"network_code"`
}

CryptoAddress is an crypto address

type Currency

type Currency struct {
	FullName            string    `json:"full_name"`
	Crypto              bool      `json:"crypto"`
	PayinEnabled        bool      `json:"payin_enabled"`
	PayoutEnabled       bool      `json:"payout_enabled"`
	TransferEnabled     bool      `json:"transfer_enabled"`
	PrecisionTransfer   string    `json:"precision_transfer"`
	Sign                string    `json:"sign"`
	QRPrefix            string    `json:"qr_prefix"`
	CryptoPaymentIDName string    `json:"crypto_payment_id_name"`
	CryptoExplorer      string    `json:"crypto_explorer"`
	Delisted            bool      `json:"delisted"`
	Networks            []Network `json:"networks"`
}

type ErrorMetadata

type ErrorMetadata struct {
	Timestamp string    `json:"timestamp"`
	Path      string    `json:"path"`
	APIError  *APIError `json:"error"`
	RequestID string    `json:"request_id"`
	Status    int       `json:"status"`
}

ErrorMetadata is the data asociated with an error from the exchange

type Fee

type Fee struct {
	Fee        string `json:"fee"`
	NetworkFee string `json:"networkFee"`
	Amount     string `json:"amount"`
	Currency   string `json:"currency"`
}

type FeeResponse

type FeeResponse struct {
	Fee         string `json:"fee"`
	NetworkCode string `json:"networkCode"`
}

type HistoryPoint

type HistoryPoint struct {
	Timestamp string `json:"timestamp"`
	Open      string `json:"open"`
	Close     string `json:"close"`
	Min       string `json:"min"`
	Max       string `json:"max"`
}

type IDResponse

type IDResponse struct {
	ID     string `json:"id"`
	Result string `json:"result"`
}

func (*IDResponse) GetID

func (idResponse *IDResponse) GetID() string

type MetaTransaction

type MetaTransaction struct {
	FiatToCrypto map[string]interface{} `json:"fiat_to_crypto"`

	ID                string                         `json:"id"`
	ProviderName      string                         `json:"provider_name"`
	OrderType         string                         `json:"order_type"`
	SourceCurrency    string                         `json:"source_currency"`
	TargetCurrency    string                         `json:"target_currency"`
	WalletAddress     string                         `json:"wallet_address"`
	TransactionHash   string                         `json:"tx_hash"`
	TargetAmount      string                         `json:"target_amount"`
	SourceAmount      string                         `json:"source_amount"`
	Status            args.MetaTransactionStatusType `json:"status"`
	CreatedAt         string                         `json:"created_at"`
	UpdatedAt         string                         `json:"updated_at"`
	DeletedAt         string                         `json:"deleted_at"`
	PaymentMethodType string                         `json:"payment_method_type"`
}

type MiniTicker

type MiniTicker struct {
	Timestamp   int64  `json:"t"`
	Open        string `json:"o"`
	Last        string `json:"c"`
	High        string `json:"h"`
	Low         string `json:"l"`
	VolumeBase  string `json:"v"`
	VolumeQuote string `json:"q"`
}

type MiniTickerFeed

type MiniTickerFeed map[string]MiniTicker

type NativeTransaction

type NativeTransaction struct {
	ID            string   `json:"tx_id"`
	Index         int64    `json:"index"`
	Currency      string   `json:"currency"`
	Amount        string   `json:"amount"`
	Fee           string   `json:"fee"`
	Address       string   `json:"address"`
	PaymentID     string   `json:"payment_id"`
	Hash          string   `json:"hash"`
	OffchainID    string   `json:"offchain_id"`
	Confirmations int64    `json:"confirmations"`
	PublicComment string   `json:"public_comment"`
	ErrorCode     string   `json:"error_code"`
	Senders       []string `json:"senders"`
}

type Network

type Network struct {
	Network            string `json:"network"`
	Protocol           string `json:"protocol"`
	Default            bool   `json:"default"`
	PayinEnabled       bool   `json:"payin_enabled"`
	PayoutEnabled      bool   `json:"payout_enabled"`
	PrecisionPayout    string `json:"presicion_payout"`
	PayoutFee          string `str:"payout_fee"`
	PayoutIsPaymentID  bool   `json:"payout_is_payment_id"`
	PayinPaymentID     bool   `json:"payin_payment_id"`
	PayinConfirmations int    `json:"payin_confirmation"`
	AddressRegex       string `json:"address_confirmation"`
	PaymentIDRegex     string `json:"payment_id_regex"`
	LowProcessingTime  string `json:"low_processing_time"`
	HighProcessingTime string `json:"high_processing_time"`
	AvgProcessingTime  string `json:"avg_processing_time"`
}

type Notification

type Notification[ft FeedType] struct {
	Data             ft
	NotificationType args.NotificationType
}

type Order

type Order struct {
	ID                    int64                `json:"id"`
	ClientOrderID         string               `json:"client_order_id"`
	Symbol                string               `json:"symbol"`
	Side                  string               `json:"side"`
	Status                args.OrderStatusType `json:"status"`
	Type                  args.OrderType       `json:"type"`
	TimeInForce           args.TimeInForceType `json:"time_in_force"`
	Quantity              string               `json:"quantity"`
	QuantityCumulative    string               `json:"quantity_cumulative"`
	Price                 string               `json:"price"`
	StopPrice             string               `json:"stop_price"`
	ExpireTime            string               `json:"expire_time"`
	PostOnly              bool                 `json:"post_only"`
	OriginalClientOrderID string               `json:"original_client_order_id"`
	CreatedAt             string               `json:"created_at"`
	UpdatedAt             string               `json:"updated_at"`
	Trades                []TradeOfOrder       `json:"trades"`
	Contingency           args.ContingencyType `json:"contingency_type"`
	OrderListID           string               `json:"order_list_id"`
}

Order is the abstraction of an order in a symbol in the exchange

type OrderBook

type OrderBook struct {
	Ask       []BookLevel `json:"ask"`
	Bid       []BookLevel `json:"bid"`
	Timestamp string      `json:"timestamp"`
}

OrderBook is the current state of a symbol

func FromOrderbookJsonToOrderbook

func FromOrderbookJsonToOrderbook(obJson OrderBookJson) OrderBook

type OrderBookJson

type OrderBookJson struct {
	Ask       [][]string `json:"ask"`
	Bid       [][]string `json:"bid"`
	Timestamp string     `json:"timestamp"`
}

OrderBook is the current state of a symbol

type OrderbookTop

type OrderbookTop struct {
	Timestamp       int64  `json:"t"`
	BestAsk         string `json:"a"`
	BestAskQuantity string `json:"A"`
	BestBid         string `json:"b"`
	BestBidQuantity string `json:"B"`
}

type OrderbookTopFeed

type OrderbookTopFeed map[string]OrderbookTop

type PayoutCryptoAddress

type PayoutCryptoAddress struct {
	Address   string `json:"address"`
	PaymentID string `json:"payment_id"`
}

PayoutCryptoAddress is for external crypto addresses

type Price

type Price struct {
	Currency  string `json:"currency"`
	Price     string `json:"price"`
	Timestamp string `json:"timestamp"`
}

type PriceFeed

type PriceFeed map[string]WSPrice

type PriceHistory

type PriceHistory struct {
	Currency string         `json:"currency"`
	History  []HistoryPoint `json:"history"`
}

type PublicTrade

type PublicTrade struct {
	ID        int64  `json:"id"`
	Price     string `json:"price"`
	Quantity  string `json:"qty"`
	Side      string `json:"side"`
	Timestamp string `json:"timestamp"`
}

PublicTrade is the available information from public trades

type Report

type Report struct {
	ID                    int64                `json:"id"`
	ClientOrderID         string               `json:"client_order_id"`
	Symbol                string               `json:"symbol"`
	Side                  args.SideType        `json:"side"`
	Status                args.OrderStatusType `json:"status"`
	OrderType             args.OrderType       `json:"type"`
	TimeInForce           args.TimeInForceType `json:"time_in_force"`
	Quantity              string               `json:"quantity"`
	Price                 string               `json:"price"`
	QuantityCumulative    string               `json:"quantity_cumulative"`
	PostOnly              bool                 `json:"post_only"`
	OrderListID           string               `json:"order_list_id"`
	CreatedAt             string               `json:"created_at"`
	UpdatedAt             string               `json:"updated_at"`
	StopPrice             string               `json:"stopPrice"`
	ExpireTime            string               `json:"expire_time"`
	OriginalClientOrderID string               `json:"original_client_order_id"`
	TradeID               int64                `json:"trade_id"`
	TradeQuantity         string               `json:"trade_quantity"`
	TradePrice            string               `json:"trade_price"`
	TradeFee              string               `json:"trade_fee"`
	TradeTaker            bool                 `json:"trade_taker"`
	ReportType            args.ReportType      `json:"report_type"`
}

Report is used for websocket trading reports.

type ResultListResponse

type ResultListResponse struct {
	IDs []string `json:"result"`
}

type ResultResponse

type ResultResponse struct {
	ID string `json:"result"`
}

type SubAccount

type SubAccount struct {
	ID     string `json:"sub_account_id"`
	Email  string `json:"email"`
	Status string `json:"status"`
}

type SubAccountBalances

type SubAccountBalances struct {
	Wallet []Balance `json:"wallet"`
	Spot   []Balance `json:"spot"`
}

type Subscription

type Subscription[ft FeedType] struct {
	NotificationChannel string
	NotificationCh      chan Notification[ft]
	Symbols             []string
}

type Symbol

type Symbol struct {
	Type               string                `json:"type"`
	BaseCurrency       string                `json:"base_currency"`
	QuoteCurrency      string                `json:"quote_currency"`
	Status             args.SymbolStatusType `json:"status"`
	QuantityIncrement  string                `json:"quantity_increment"`
	TickSize           string                `json:"tick_size"`
	TakeRate           string                `json:"take_rate"`
	MakeRate           string                `json:"make_rate"`
	FeeCurrency        string                `json:"fee_currency"`
	MarginTrading      bool                  `json:"margin_trading"`
	MaxInitialLeverage string                `json:"max_initial_leverage"`
}

Symbol is a market made of two currencies being exchanged

type Ticker

type Ticker struct {
	Timestamp   string `json:"timestamp"`
	Open        string `json:"open"`
	Close       string `json:"close"`
	Last        string `json:"last"`
	High        string `json:"high"`
	Low         string `json:"low"`
	Volume      string `json:"volume"`
	VolumeQuote string `json:"volume_quote"`
	Ask         string `json:"ask"`
	Bid         string `json:"bid"`
}

func (*Ticker) GetClose

func (ticker *Ticker) GetClose() string

func (*Ticker) GetLast

func (ticker *Ticker) GetLast() string

type Trade

type Trade struct {
	ID            int64         `json:"id"`
	OrderID       int64         `json:"order_id"`
	ClientOrderID string        `json:"client_order_id"`
	Symbol        string        `json:"symbol"`
	Side          args.SideType `json:"side"`
	Quantity      string        `json:"quantity"`
	Price         string        `json:"price"`
	Fee           string        `json:"fee"`
	Timestamp     string        `json:"timestamp"`
	Taker         bool          `json:"taker"`
}

Trade is a movement of currency where the user takes part

type TradeOfOrder

type TradeOfOrder struct {
	ID        int64  `json:"id"`
	Price     string `json:"price"`
	Quantity  string `json:"quantity"`
	Fee       string `json:"fee"`
	Taker     bool   `json:"taker"`
	Timestamp string `json:"timestamp"`
}

TradeOfOrder is the trade information of trades of an order

type TradingCommission

type TradingCommission struct {
	Symbol   string `json:"symbol"`
	TakeRate string `json:"take_rate"`
	MakeRate string `json:"make_rate"`
}

TradingCommission is the asociated cost to trade in the exchange

type Transaction

type Transaction struct {
	ID        int64                       `json:"id"`
	Status    args.TransactionStatusType  `json:"status"`
	Type      args.TransactionTypeType    `json:"type"`
	SubType   args.TransactionSubTypeType `json:"subtype"`
	CreatedAt string                      `json:"created_at"`
	UpdatedAt string                      `json:"updated_at"`
	Native    NativeTransaction           `json:"native"`
	Meta      MetaTransaction             `json:"meta"`
}

Transaction is a movement of currency, not in the market, but related on the exchange

type WSCandle

type WSCandle struct {
	Timestamp   int64  `json:"t"`
	Open        string `json:"o"`
	Close       string `json:"c"`
	High        string `json:"h"`
	Low         string `json:"l"`
	Volume      string `json:"v"`
	VolumeQuote string `json:"q"`
}

type WSCandleFeed

type WSCandleFeed map[string][]WSCandle

type WSOrderbook

type WSOrderbook struct {
	Timestamp      int64      `json:"t"`
	SequenceNumber int64      `json:"s"`
	Ask            [][]string `json:"a"`
	Bid            [][]string `json:"b"`
}

type WSOrderbookFeed

type WSOrderbookFeed map[string]WSOrderbook

type WSPrice

type WSPrice struct {
	Timestamp int64  `json:"t"`
	Rate      string `json:"r"`
}

type WSTicker

type WSTicker struct {
	Timestamp          int64  `json:"t"`
	BestAsk            string `json:"a"`
	BestAskQuantity    string `json:"A"`
	BestBid            string `json:"b"`
	BestBidQuantity    string `json:"B"`
	Last               string `json:"c"`
	Open               string `json:"o"`
	High               string `json:"h"`
	Low                string `json:"l"`
	VolumeBase         string `json:"v"`
	VolumeQuote        string `json:"q"`
	PriceChange        string `json:"p"`
	PriceChangePercent string `json:"P"`
	LastTradeID        int64  `json:"L"`
}

type WSTickerFeed

type WSTickerFeed map[string]WSTicker

type WSTrade

type WSTrade struct {
	Timestamp int64  `json:"t"`
	ID        int64  `json:"i"`
	Price     string `json:"p"`
	Quantity  string `json:"q"`
	Side      string `json:"s"`
}

type WSTradeFeed

type WSTradeFeed map[string][]WSTrade

Jump to

Keyboard shortcuts

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