args

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildParams

func BuildParams(
	arguments []Argument,
	requireds ...string,
) (map[string]interface{}, error)

BuildParams makes a map with the Arguments functions, and check for the presence of "requireds" keys in the map, raising an error if some required keys are not present.

func BuildQuery

func BuildQuery(params map[string]interface{}) string

Types

type AccountType

type AccountType string

AccountType is the type of account used for internal user tranfers

const (
	AccountWallet AccountType = "wallet"
	AccountSpot   AccountType = "spot"
)

type Argument

type Argument func(map[string]interface{})

Argument are functions that serves as arguments for the diferent requests to the server, either rest request, or websocket requests. Argument works by extending a given map with a particular key. For example Symbol("EOSETH") returns an Argument that extends a map assigning "EOSETH" to the key "symbol". usually, a function returning an Argument is what's used as a request parameter. just like the Symbol(val string) function in the example above.

func Address

func Address(val string) Argument

func Amount

func Amount(val string) Argument

func AutoCommit

func AutoCommit(val bool) Argument

func ClientOrderID

func ClientOrderID(val string) Argument

func Contingency

func Contingency(val ContingencyType) Argument

func CreatedAt

func CreatedAt(val string) Argument

func Currencies

func Currencies(val []string) Argument

func Currency

func Currency(val string) Argument

func DepositAddressGenerationEnabled

func DepositAddressGenerationEnabled(val bool) Argument

func Depth

func Depth(val int) Argument

func Description

func Description(val string) Argument

func Destination

func Destination(val AccountType) Argument

func ExpireTime

func ExpireTime(val string) Argument

func FeeRequests

func FeeRequests(val []FeeRequest) Argument

func From

func From(val string) Argument

func FromCurrency

func FromCurrency(val string) Argument

func ID

func ID(val string) Argument

func IDFrom

func IDFrom(val string) Argument

func IDTill

func IDTill(val string) Argument

func Identifier

func Identifier(val string) Argument

func IdentifyBy

func IdentifyBy(val IdentifyByType) Argument

func IncludeFee

func IncludeFee(val bool) Argument

func Limit

func Limit(val int) Argument

func MakeRate

func MakeRate(val string) Argument

func Mode

func NetworkCode

func NetworkCode(val string) Argument

func NewClientOrderID

func NewClientOrderID(val string) Argument

func Offset

func Offset(val int) Argument

func OrderBookSpeed

func OrderBookSpeed(val OrderBookSpeedType) Argument

func OrderID

func OrderID(val int) Argument

func OrderListID

func OrderListID(val string) Argument

func Orders

func Orders(val []OrderRequest) Argument

func PaymentID

func PaymentID(val string) Argument

func Period

func Period(val PeriodType) Argument

func PostOnly

func PostOnly(val bool) Argument

func PreferredNetwork

func PreferredNetwork(val string) Argument

func Price

func Price(val string) Argument

func PriceRateSpeed

func PriceRateSpeed(val PriceRateSpeedType) Argument

func PublicComment

func PublicComment(val string) Argument

func Quantity

func Quantity(val string) Argument

func RequestClientOrderID

func RequestClientOrderID(val string) Argument

func ShowSenders

func ShowSenders(val string) Argument

func Side

func Side(val SideType) Argument

func Since

func Since(val string) Argument

func Sort

func Sort(val SortType) Argument

func SortBy

func SortBy(val SortByType) Argument

func Source

func Source(val AccountType) Argument

func StopPrice

func StopPrice(val string) Argument

func StrictValidate

func StrictValidate(val bool) Argument

func SubAccountID

func SubAccountID(val string) Argument

func SubAccountIDs

func SubAccountIDs(list ...string) Argument

func Subscription

func Subscription(val SubscriptionType) Argument

func Symbol

func Symbol(val string) Argument

func Symbols

func Symbols(val []string) Argument

func TakeRate

func TakeRate(val string) Argument

func TargetCurrency

func TargetCurrency(val string) Argument

func TickerSpeed

func TickerSpeed(val TickerSpeedType) Argument

func Till

func Till(val string) Argument

func TimeInForce

func TimeInForce(val TimeInForceType) Argument

func To

func To(val string) Argument

func ToCurrency

func ToCurrency(val string) Argument

func TransactionStatuses

func TransactionStatuses(list ...TransactionStatusType) Argument

func TransactionSubTypes

func TransactionSubTypes(list ...TransactionSubTypeType) Argument

func TransactionType

func TransactionType(val TransactionTypeType) Argument

func TransactionTypes

func TransactionTypes(list ...TransactionTypeType) Argument

func TransferType

func TransferType(val TransferTypeType) Argument

func Untill

func Untill(val string) Argument

func UpdatedAt

func UpdatedAt(val string) Argument

func UseOffchain

func UseOffchain(val UseOffchainType) Argument

func Volume

func Volume(val string) Argument

func WSDepth

func WSDepth(val WSDepthType) Argument

func WithdrawEnabled

func WithdrawEnabled(val bool) Argument

type ContingencyType

type ContingencyType string
const (
	ContingencyAllOrNone                ContingencyType = "allOrNone"
	ContingencyAON                      ContingencyType = "allOrNone"
	ContingencyOneCancelOther           ContingencyType = "oneCancelOther"
	ContingencyOCO                      ContingencyType = "oneCancelOther"
	ContingencyOTO                      ContingencyType = "oneTriggerOther"
	ContingencyOneTriggerOther          ContingencyType = "oneTriggerOther"
	ContingencyOneTriggerOneCancelOther ContingencyType = "oneTriggerOneCancelOther"
	ContingencyOTOCO                    ContingencyType = "oneTriggerOneCancelOther"
)

type FeeRequest

type FeeRequest struct {
	Currency    string `json:"currency"`
	Amount      string `json:"amount"`
	NetworkCode string `json:"network_code,omitempty"`
}

type IdentifyByType

type IdentifyByType string

IdentifyByType is the type of identifier used for transafers between users

const (
	IdentifyByEmail    IdentifyByType = "email"
	IdentifyByUsername IdentifyByType = "username"
)

type MetaTransactionStatusType

type MetaTransactionStatusType string
const (
	MetaTransactionStatusActive   MetaTransactionStatusType = "ACTIVE"
	MetaTransactionStatusInactive MetaTransactionStatusType = "INACTIVE"
)

type NotificationType

type NotificationType string
const (
	NotificationSnapshot NotificationType = "snapshot"
	NotificationUpdate   NotificationType = "update"
	NotificationData     NotificationType = "data"
)

type OrderBookSpeedType

type OrderBookSpeedType string
const (
	OrderBookSpeed100ms  OrderBookSpeedType = "100ms"
	OrderBookSpeed500ms  OrderBookSpeedType = "500ms"
	OrderBookSpeed1000ms OrderBookSpeedType = "1000ms"
)

type OrderRequest

type OrderRequest struct {
	ClientOrderID  string          `json:"client_order_id,omitempty"`
	Symbol         string          `json:"symbol,omitempty"`
	Side           SideType        `json:"side,omitempty"`
	Type           OrderType       `json:"type,omitempty"`
	TimeInForce    TimeInForceType `json:"time_in_force,omitempty"`
	Quantity       string          `json:"quantity,omitempty"`
	Price          string          `json:"price,omitempty"`
	StopPrice      string          `json:"stop_price,omitempty"`
	ExpireTime     string          `json:"expire_time,omitempty"`
	StrictValidate bool            `json:"strict_validate,omitempty"`
	PostOnly       bool            `json:"post_only,omitempty"`
	MakeRate       string          `json:"make_rate,omitempty"`
	TakeRate       string          `json:"take_rate,omitempty"`
}

type OrderStatusType

type OrderStatusType string
const (
	OrderStatusNew             OrderStatusType = "new"
	OrderStatusSuspended       OrderStatusType = "suspended"
	OrderStatusPartiallyFilled OrderStatusType = "partiallyFilled"
	OrderStatusFilled          OrderStatusType = "filled"
	OrderStatusCanceled        OrderStatusType = "canceled"
	OrderStatusExpired         OrderStatusType = "expired"
)

type OrderType

type OrderType string

OrderType is a type of order

const (
	OrderLimit            OrderType = "limit"
	OrderMarket           OrderType = "market"
	OrderStopLimit        OrderType = "stopLimit"
	OrderStopMarket       OrderType = "stopMarket"
	OrderTakeProfitLimit  OrderType = "takeProfitLimit"
	OrderTakeProfitMarket OrderType = "takeProfitMarket"
)

OrderTypes

type PeriodType

type PeriodType string

PeriodType is the period of a candle

const (
	Period1Minute   PeriodType = "M1"
	Period3Minutes  PeriodType = "M3"
	Period5Minutes  PeriodType = "M5"
	Period15Minutes PeriodType = "M15"
	Period30Minutes PeriodType = "M30"
	Period1Hour     PeriodType = "H1"
	Period4Hours    PeriodType = "H4"
	Period1Day      PeriodType = "D1"
	Period7Days     PeriodType = "D7"
	Period1Month    PeriodType = "1M"
)

type PriceRateSpeedType

type PriceRateSpeedType string
const (
	PriceRateSpeed1s PriceRateSpeedType = "1s"
	PriceRateSpeed3s PriceRateSpeedType = "3s"
)

type ReportType

type ReportType string
const (
	ReportStatus    ReportType = "status"
	ReportNew       ReportType = "new"
	ReportCanceled  ReportType = "canceled"
	ReportRejected  ReportType = "rejected"
	ReportExpired   ReportType = "expired"
	ReportSuspended ReportType = "suspended"
	ReportTrade     ReportType = "trade"
	ReportReplaced  ReportType = "replaced"
)

type SideType

type SideType string

SideType is an order side or a trade side of an order

const (
	SideSell SideType = "sell"
	SideBuy  SideType = "buy"
)

type SortByType

type SortByType string

SortBy is the field used for sorting lists

const (
	SortByTimestamp SortByType = "timestamp"
	SortByID        SortByType = "id"
	SortByCreatedAt SortByType = "created_at"
)

type SortType

type SortType string

SortType is the sorting direction of a query

const (
	SortASC  SortType = "ASC"
	SortDESC SortType = "DESC"
)

type SubscriptionModeType

type SubscriptionModeType string
const (
	SubscriptionModeUpdates SubscriptionModeType = "updates"
	SubscriptionModeBatches SubscriptionModeType = "batches"
)

type SubscriptionType

type SubscriptionType string

func SubscriptionTypeFullOrderbook

func SubscriptionTypeFullOrderbook(speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypeMiniTicker

func SubscriptionTypeMiniTicker(speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypeMiniTickerInBatch

func SubscriptionTypeMiniTickerInBatch(speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypeOrderbookTop

func SubscriptionTypeOrderbookTop(speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypeOrderbookTopInBatch

func SubscriptionTypeOrderbookTopInBatch(speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypePartialOrderbook

func SubscriptionTypePartialOrderbook(depth WSDepthType, speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypePartialOrderbookInBatch

func SubscriptionTypePartialOrderbookInBatch(depth WSDepthType, speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypeTicker

func SubscriptionTypeTicker(speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypeTickerInBatch

func SubscriptionTypeTickerInBatch(speed OrderBookSpeedType) SubscriptionType

func SubscriptionTypeTrades

func SubscriptionTypeTrades() SubscriptionType

func SubscriptionsTypeCandles

func SubscriptionsTypeCandles(period PeriodType) SubscriptionType

type SymbolStatusType

type SymbolStatusType string
const (
	SymbolStatusWorking   SymbolStatusType = "working"
	SymbolStatusSuspended SymbolStatusType = "suspended"
)

type TickerSpeedType

type TickerSpeedType string
const (
	TickerSpeed1s TickerSpeedType = "1s"
	TickerSpeed3s TickerSpeedType = "3s"
)

type TimeInForceType

type TimeInForceType string

TimeInForceType is the time in force of an order

const (
	TimeInForceGTC TimeInForceType = "GTC" // Good Till Cancel
	TimeInForceIOC TimeInForceType = "IOC" // Immediate or Cancel
	TimeInForceFOK TimeInForceType = "FOK" // Fill or Kill
	TimeInForceDAY TimeInForceType = "Day" // valid during Day
	TimeInForceGTD TimeInForceType = "GTD" // Good Till Date
)

type TransactionStatusType

type TransactionStatusType string
const (
	TransactionStatusCreated    TransactionStatusType = "CREATED"
	TransactionStatusPending    TransactionStatusType = "PENDING"
	TransactionStatusFailed     TransactionStatusType = "FAILED"
	TransactionStatusSuccess    TransactionStatusType = "SUCCESS"
	TransactionStatusRolledBack TransactionStatusType = "ROLLED_BACK"
)

type TransactionSubTypeType

type TransactionSubTypeType string
const (
	TransactionSubTypeUnclassified    TransactionSubTypeType = "UNCLASSIFIED"
	TransactionSubTypeBlockchain      TransactionSubTypeType = "BLOCKCHAIN"
	TransactionSubTypeAffiliate       TransactionSubTypeType = "AFFILIATE"
	TransactionSubTypeOffchain        TransactionSubTypeType = "OFFCHAIN"
	TransactionSubTypeFiat            TransactionSubTypeType = "FIAT"
	TransactionSubTypeSubAccount      TransactionSubTypeType = "SUB_ACCOUNT"
	TransactionSubTypeWalletToSpot    TransactionSubTypeType = "WALLET_TO_SPOT"
	TransactionSubTypeSpotToWallet    TransactionSubTypeType = "SPOT_TO_WALLET"
	TransactionSubTypeChainSwitchFrom TransactionSubTypeType = "CHAIN_SWITCH_FROM"
	TransactionSubTypeChainSwitchTo   TransactionSubTypeType = "CHAIN_SWITCH_TO"
)

type TransactionTypeType

type TransactionTypeType string
const (
	TransactionTypeDeposit  TransactionTypeType = "DEPOSIT"
	TransactionTypeWithdraw TransactionTypeType = "WITHDRAW"
	TransactionTypeTransfer TransactionTypeType = "TRANSFER"
	TransactionTypeSwap     TransactionTypeType = "SWAP"
)

type TransferTypeType

type TransferTypeType string
const (
	TransferToSubAccount   TransferTypeType = "to_sub_account"
	TransferFromSubAccount TransferTypeType = "from_sub_account"
)

type UseOffchainType

type UseOffchainType string
const (
	UseOffchainNever     UseOffchainType = "never"
	UseOffchainOptionaly UseOffchainType = "optionaly"
	UseOffChainRequired  UseOffchainType = "required"
)

type WSDepthType

type WSDepthType string
const (
	WSDepth5  WSDepthType = "D5"
	WSDepth10 WSDepthType = "D10"
	WSDepth20 WSDepthType = "D20"
)

Jump to

Keyboard shortcuts

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