Versions in this module Expand all Collapse all v1 v1.0.4 Aug 19, 2019 v1.0.3 Jul 29, 2019 v1.0.2 Jul 25, 2019 v1.0.1 Jul 16, 2019 Changes in this version type OKEx + OKExMargin *OKExMargin + type OKExMargin struct + func (ok *OKExMargin) Borrow(parameter BorrowParameter) (borrowId string, err error) + func (ok *OKExMargin) CancelOrder(orderId string, currency CurrencyPair) (bool, error) + func (ok *OKExMargin) GetMarginAccount(pair CurrencyPair) (*MarginAccount, error) + func (ok *OKExMargin) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error) + func (ok *OKExMargin) GetUnfinishOrders(currency CurrencyPair) ([]Order, error) + func (ok *OKExMargin) PlaceOrder(ord *Order) (*Order, error) + func (ok *OKExMargin) Repayment(parameter RepaymentParameter) (repaymentId string, err error) type PlaceOrderParam + MarginTrading string v1.0.0 Jul 15, 2019 Changes in this version + const ACCEPT + const APPLICATION_JSON + const APPLICATION_JSON_UTF8 + const BCH_USD_SWAP + const BSV_USD_SWAP + const BTC_USD_SWAP + const C2C + const CANCEL_ORDER + const CONTENT_TYPE + const COOKIE + const DELETE + const ENGLISH + const EOS_USD_SWAP + const ETC_USD_SWAP + const ETH_USD_SWAP + const Endpoint + const FOK + const FUTURE + const GET + const GET_ACCOUNTS + const GET_DEPTH + const GET_ORDER + const GET_POSITION + const GET_TICKER + const GET_UNFINISHED_ORDERS + const IOC + const LOCALE + const LTC_USD_SWAP + const OK_ACCESS_KEY + const OK_ACCESS_PASSPHRASE + const OK_ACCESS_SIGN + const OK_ACCESS_TIMESTAMP + const OK_FROM + const OK_LIMIT + const OK_TO + const ORDINARY + const PLACE_ORDER + const POST + const POST_ONLY + const ResultDataJsonString + const ResultPageJsonString + const SIMPLIFIED_CHINESE + const SPOT + const SPOT_MARGIN + const SUB_ACCOUNT + const SWAP + const TIPS + const TRADITIONAL_CHINESE + const WALLET + const WITHDRAWAL_COIN + const WITHDRAWAL_OKCOIN + const WITHDRAWAL_OKEx + const XRP_USD_SWAP + type AllFutureContractInfo struct + type BaesDepthInfo []interface + type BaseCandleInfo []interface + type BaseFillInfo struct + ExecType string + Fee string + InstrumentId string + OrderId string + OrderQty string + Price string + Side string + Timestamp string + TradeId string + type BaseHistoricalFundingRate struct + FundingRate string + FundingTime string + InstrumentId string + InterestRate string + RealizedRate string + type BaseInstrumentAmount struct + Amount string + InstrumentId string + Timestamp string + type BaseInstrumentInfo struct + Coin string + ContractVal string + Delivery string + InstrumentId string + Listing string + QuoteCurrency string + SizeIncrement string + TickSize string + UnderlyingIndex string + type BaseLedgerInfo struct + Amount string + Fee string + InstrumentId string + LedgerId string + Timestamp string + Type string + type BaseLiquidationInfo struct + CreatedAt string + InstrumentId string + Loss string + Price string + Size string + Type string + type BaseOrderInfo struct + ContractVal string + Fee float64 + FilledQty float64 + InstrumentId string + OrderId string + Price float64 + PriceAvg float64 + Size float64 + Status int + Timestamp string + Type int + type BasePlaceOrderInfo struct + ClientOid string + MatchPrice string + Price string + Size string + Type string + type BaseResponse struct + ErrorCode string + ErrorMessage string + Result bool + type BaseSwapOrderResult struct + ClientOid string + ErrorCode string + ErrorMessage string + OrderId string + Result string + type BaseTickerInfo struct + High24h float64 + InstrumentId string + Last float64 + Low24h float64 + Timestamp string + Volume24h float64 + type BaseTradeInfo struct + Price string + Side string + Size string + Timestamp string + TradeId string + type BizWarmTips struct + Code int + Message string + type CrossedAccountInfo struct + Equity float64 + MarginMode string + type DepositAddress struct + Address string + CanDeposit int + CanWithdraw int + Currency string + Memo string + PaymentId string + Tag string + type DepositWithDrawHistory struct + Amount float64 + Currency string + Fee string + From string + Memo string + Status int + Timestamp time.Time + To string + Txid string + WithdrawalId string + type FutureContractInfo struct + Alias string + ContractVal string + Delivery string + InstrumentID string + Listing string + QuoteCurrency string + TickSize float64 + TradeIncrement string + UnderlyingIndex string + type OKEx struct + OKExFuture *OKExFuture + OKExSpot *OKExSpot + OKExSwap *OKExSwap + OKExWallet *OKExWallet + func NewOKEx(config *APIConfig) *OKEx + func (ok *OKEx) BuildRequestBody(params interface{}) (string, *bytes.Reader, error) + func (ok *OKEx) CancelOrder(orderId string, currency CurrencyPair) (bool, error) + func (ok *OKEx) DoRequest(httpMethod, uri, reqBody string, response interface{}) error + func (ok *OKEx) GetAccount() (*Account, error) + func (ok *OKEx) GetDepth(size int, currency CurrencyPair) (*Depth, error) + func (ok *OKEx) GetExchangeName() string + func (ok *OKEx) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error) + func (ok *OKEx) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error) + func (ok *OKEx) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error) + func (ok *OKEx) GetTicker(currency CurrencyPair) (*Ticker, error) + func (ok *OKEx) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error) + func (ok *OKEx) GetUnfinishOrders(currency CurrencyPair) ([]Order, error) + func (ok *OKEx) IsoTime() string + func (ok *OKEx) LimitBuy(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKEx) LimitSell(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKEx) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKEx) MarketSell(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKEx) UUID() string + type OKExFuture struct + func (ok *OKExFuture) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error) + func (ok *OKExFuture) GetContractValue(currencyPair CurrencyPair) (float64, error) + func (ok *OKExFuture) GetDeliveryTime() (int, int, int, int) + func (ok *OKExFuture) GetExchangeName() string + func (ok *OKExFuture) GetFee() (float64, error) + func (ok *OKExFuture) GetFutureContractInfo() ([]FutureContractInfo, error) + func (ok *OKExFuture) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error) + func (ok *OKExFuture) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error) + func (ok *OKExFuture) GetFutureIndex(currencyPair CurrencyPair) (float64, error) + func (ok *OKExFuture) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error) + func (ok *OKExFuture) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (ok *OKExFuture) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error) + func (ok *OKExFuture) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error) + func (ok *OKExFuture) GetFutureUserinfo() (*FutureAccount, error) + func (ok *OKExFuture) GetKlineRecords(contract_type string, currency CurrencyPair, period, size, since int) ([]FutureKline, error) + func (ok *OKExFuture) GetRate() (float64, error) + func (ok *OKExFuture) GetTrades(contract_type string, currencyPair CurrencyPair, since int64) ([]Trade, error) + func (ok *OKExFuture) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (ok *OKExFuture) MarketCloseAllPosition(currency CurrencyPair, contract string, oType int) (bool, error) + func (ok *OKExFuture) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + func (ok *OKExFuture) PlaceFutureOrder2(matchPrice int, ord *FutureOrder) (*FutureOrder, error) + type OKExSpot struct + func (ok *OKExSpot) BatchPlaceOrders(orders []Order) ([]PlaceOrderResponse, error) + func (ok *OKExSpot) CancelOrder(orderId string, currency CurrencyPair) (bool, error) + func (ok *OKExSpot) GetAccount() (*Account, error) + func (ok *OKExSpot) GetDepth(size int, currency CurrencyPair) (*Depth, error) + func (ok *OKExSpot) GetExchangeName() string + func (ok *OKExSpot) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error) + func (ok *OKExSpot) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error) + func (ok *OKExSpot) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error) + func (ok *OKExSpot) GetTicker(currency CurrencyPair) (*Ticker, error) + func (ok *OKExSpot) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error) + func (ok *OKExSpot) GetUnfinishOrders(currency CurrencyPair) ([]Order, error) + func (ok *OKExSpot) LimitBuy(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKExSpot) LimitSell(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKExSpot) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKExSpot) MarketSell(amount, price string, currency CurrencyPair) (*Order, error) + func (ok *OKExSpot) PlaceOrder(ty string, ord *Order) (*Order, error) + type OKExSwap struct + func NewOKExSwap(config *APIConfig) *OKExSwap + func (ok *OKExSwap) AdaptTradeStatus(status int) TradeStatus + func (ok *OKExSwap) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error) + func (ok *OKExSwap) GetContractValue(currencyPair CurrencyPair) (float64, error) + func (ok *OKExSwap) GetDeliveryTime() (int, int, int, int) + func (ok *OKExSwap) GetExchangeName() string + func (ok *OKExSwap) GetExchangeRate() (float64, error) + func (ok *OKExSwap) GetFee() (float64, error) + func (ok *OKExSwap) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error) + func (ok *OKExSwap) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error) + func (ok *OKExSwap) GetFutureIndex(currencyPair CurrencyPair) (float64, error) + func (ok *OKExSwap) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error) + func (ok *OKExSwap) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (ok *OKExSwap) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error) + func (ok *OKExSwap) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error) + func (ok *OKExSwap) GetFutureUserinfo() (*FutureAccount, error) + func (ok *OKExSwap) GetKlineRecords(contract_type string, currency CurrencyPair, period, size, since int) ([]FutureKline, error) + func (ok *OKExSwap) GetTrades(contract_type string, currencyPair CurrencyPair, since int64) ([]Trade, error) + func (ok *OKExSwap) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (ok *OKExSwap) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + type OKExWallet struct + func (ok *OKExWallet) GetAccount() (*Account, error) + func (ok *OKExWallet) GetDepositAddress(currency Currency) ([]DepositAddress, error) + func (ok *OKExWallet) GetDepositHistory(currency *Currency) ([]DepositWithDrawHistory, error) + func (ok *OKExWallet) GetWithDrawalFee(currency *Currency) ([]WithdrawFee, error) + func (ok *OKExWallet) GetWithDrawalHistory(currency *Currency) ([]DepositWithDrawHistory, error) + func (ok *OKExWallet) Transfer(param TransferParameter) error + func (ok *OKExWallet) Withdrawal(param WithdrawParameter) (withdrawId string, err error) + type OrderResponse struct + ClientOid string + FilledNotional string + FilledSize string + InstrumentId string + Notional string + OrderId string + OrderType int + Price float64 + PriceAvg string + Side string + Size float64 + State int + Timestamp string + Type string + type PlaceOrderInfo struct + InstrumentId string + type PlaceOrderParam struct + ClientOid string + InstrumentId string + Notional float64 + OrderType int + Price float64 + Side string + Size float64 + Type string + type PlaceOrderResponse struct + ClientOid string + ErrorCode string + ErrorMessage string + OrderId string + Result bool + type PlaceOrdersInfo struct + InstrumentId string + OrderData []*BasePlaceOrderInfo + type SwapAccountHolds BaseInstrumentAmount + type SwapAccountInfo struct + Equity float64 + FixedBalance float64 + InstrumentId string + Margin float64 + MarginFrozen float64 + MarginMode string + MarginRatio float64 + RealizedPnl float64 + Timestamp string + TotalAvailBalance float64 + UnrealizedPnl float64 + type SwapAccounts struct + Info []SwapAccountInfo + type SwapAccountsLedgerList []BaseLedgerInfo + type SwapAccountsSetting struct + InstrumentId string + LongLeverage string + MarginMode string + ShortLeverage string + type SwapBatchCancelOrderResult struct + Ids []string + InstrumentId string + Result string + type SwapCancelOrderResult struct + ErrorCode string + ErrorMessage string + OrderId string + Result bool + type SwapCandleList []BaseCandleInfo + type SwapFillsInfo struct + FillInfo []*BaseFillInfo + type SwapFundingTime struct + FundingTime string + InstrumentId string + type SwapHistoricalFundingRateList []BaseHistoricalFundingRate + type SwapIndexInfo struct + Index string + InstrumentId string + Timestamp string + type SwapInstrumentDepth struct + Asks []BaesDepthInfo + Bids []BaesDepthInfo + Timestamp string + type SwapInstrumentList []BaseInstrumentInfo + type SwapLiquidationList []BaseLiquidationInfo + type SwapMarkPrice struct + InstrumentId string + MarkPrice string + Timestamp string + type SwapOpenInterest BaseInstrumentAmount + type SwapOrderResult struct + type SwapOrdersInfo struct + OrderInfo []BaseOrderInfo + type SwapOrdersResult struct + OrderInfo []BaseSwapOrderResult + type SwapPosition struct + Holding []SwapPositionHolding + MarginMode string + type SwapPositionHolding struct + AvailPosition float64 + AvgCost float64 + InstrumentId string + Leverage string + LiquidationPrice float64 + Margin string + Position float64 + RealizedPnl float64 + SettlementPrice float64 + Side string + Timestamp string + type SwapPriceLimit struct + Highest string + InstrumentId string + Lowest string + Timestamp string + type SwapRate struct + InstrumentId string + Rate string + Timestamp string + type SwapTickerList []BaseTickerInfo + type SwapTradeList []BaseTradeInfo + type TransferParameter struct + Amount float64 + Currency string + From int + InstrumentId string + SubAccount string + To int + ToInstrumentId string + type WithdrawFee struct + Currency string + MaxFee string + MinFee string + type WithdrawParameter struct + Amount float64 + Currency string + Destination int + Fee string + ToAddress string + TradePwd string