Documentation ¶
Index ¶
- type Account
- func (c *Account) GetAccountAndPositionRisk(req requests.GetAccountAndPositionRisk) (response responses.GetAccountAndPositionRisk, err error)
- func (c *Account) GetBalance(req requests.GetBalance) (response responses.GetBalance, err error)
- func (c *Account) GetBills(req requests.GetBills, arc bool) (response responses.GetBills, err error)
- func (c *Account) GetConfig() (response responses.GetConfig, err error)
- func (c *Account) GetFeeRates(req requests.GetFeeRates) (response responses.GetFeeRates, err error)
- func (c *Account) GetInterestAccrued(req requests.GetInterestAccrued) (response responses.GetInterestAccrued, err error)
- func (c *Account) GetInterestRates(req requests.GetBalance) (response responses.GetInterestRates, err error)
- func (c *Account) GetLeverage(req requests.GetLeverage) (response responses.Leverage, err error)
- func (c *Account) GetMaxAvailableTradeAmount(req requests.GetMaxAvailableTradeAmount) (response responses.GetMaxAvailableTradeAmount, err error)
- func (c *Account) GetMaxBuySellAmount(req requests.GetMaxBuySellAmount) (response responses.GetMaxBuySellAmount, err error)
- func (c *Account) GetMaxLoan(req requests.GetMaxLoan) (response responses.GetMaxLoan, err error)
- func (c *Account) GetMaxWithdrawals(req requests.GetBalance) (response responses.GetMaxWithdrawals, err error)
- func (c *Account) GetPositions(req requests.GetPositions) (response responses.GetPositions, err error)
- func (c *Account) IncreaseDecreaseMargin(req requests.IncreaseDecreaseMargin) (response responses.IncreaseDecreaseMargin, err error)
- func (c *Account) SetGreeks(req requests.SetGreeks) (response responses.SetGreeks, err error)
- func (c *Account) SetLeverage(req requests.SetLeverage) (response responses.Leverage, err error)
- func (c *Account) SetPositionMode(req requests.SetPositionMode) (response responses.SetPositionMode, err error)
- type ClientRest
- type Funding
- func (c *Funding) AssetBillsDetails(req requests.AssetBillsDetails) (response responses.AssetBillsDetails, err error)
- func (c *Funding) FundsTransfer(req requests.FundsTransfer) (response responses.FundsTransfer, err error)
- func (c *Funding) GetBalance(req requests.GetBalance) (response responses.GetBalance, err error)
- func (c *Funding) GetCurrencies() (response responses.GetCurrencies, err error)
- func (c *Funding) GetDepositAddress(req requests.GetDepositAddress) (response responses.GetDepositAddress, err error)
- func (c *Funding) GetDepositHistory(req requests.GetDepositHistory) (response responses.GetDepositHistory, err error)
- func (c *Funding) GetPiggyBankBalance(req requests.GetPiggyBankBalance) (response responses.GetPiggyBankBalance, err error)
- func (c *Funding) GetWithdrawalHistory(req requests.GetWithdrawalHistory) (response responses.GetWithdrawalHistory, err error)
- func (c *Funding) PiggyBankPurchaseRedemption(req requests.PiggyBankPurchaseRedemption) (response responses.PiggyBankPurchaseRedemption, err error)
- func (c *Funding) Withdrawal(req requests.Withdrawal) (response responses.Withdrawal, err error)
- type Market
- func (c *Market) Get24HTotalVolume() (response responses.TotalVolume24H, err error)
- func (c *Market) GetCandlesticks(req requests.GetCandlesticks) (response responses.Candle, err error)
- func (c *Market) GetCandlesticksHistory(req requests.GetCandlesticks) (response responses.Candle, err error)
- func (c *Market) GetIndexCandlesticks(req requests.GetCandlesticks) (response responses.IndexCandle, err error)
- func (c *Market) GetIndexComponents(req requests.GetIndexComponents) (response responses.IndexComponent, err error)
- func (c *Market) GetIndexTickers(req requests.GetIndexTickers) (response responses.Ticker, err error)
- func (c *Market) GetMarkPriceCandlesticks(req requests.GetCandlesticks) (response responses.CandleMarket, err error)
- func (c *Market) GetOrderBook(req requests.GetOrderBook) (response responses.OrderBook, err error)
- func (c *Market) GetTicker(req requests.GetTicker) (response responses.Ticker, err error)
- func (c *Market) GetTickers(req requests.GetTickers) (response responses.Ticker, err error)
- func (c *Market) GetTrades(req requests.GetTrades) (response responses.Trade, err error)
- type PublicData
- func (c *PublicData) GetDeliveryExerciseHistory(req requests.GetDeliveryExerciseHistory) (response responses.GetDeliveryExerciseHistory, err error)
- func (c *PublicData) GetDiscountRateAndInterestFreeQuota(req requests.GetDiscountRateAndInterestFreeQuota) (response responses.GetDiscountRateAndInterestFreeQuota, err error)
- func (c *PublicData) GetEstimatedDeliveryExercisePrice(req requests.GetEstimatedDeliveryExercisePrice) (response responses.GetEstimatedDeliveryExercisePrice, err error)
- func (c *PublicData) GetInstruments(req requests.GetInstruments) (response responses.GetInstruments, err error)
- func (c *PublicData) GetInterestRateAndLoanQuota() (response responses.GetInterestRateAndLoanQuota, err error)
- func (c *PublicData) GetLimitPrice(req requests.GetLimitPrice) (response responses.GetLimitPrice, err error)
- func (c *PublicData) GetLiquidationOrders(req requests.GetLiquidationOrders) (response responses.GetLiquidationOrders, err error)
- func (c *PublicData) GetMarkPrice(req requests.GetMarkPrice) (response responses.GetMarkPrice, err error)
- func (c *PublicData) GetOpenInterest(req requests.GetOpenInterest) (response responses.GetOpenInterest, err error)
- func (c *PublicData) GetOptionMarketData(req requests.GetOptionMarketData) (response responses.GetOptionMarketData, err error)
- func (c *PublicData) GetPositionTiers(req requests.GetPositionTiers) (response responses.GetPositionTiers, err error)
- func (c *PublicData) GetSystemTime() (response responses.GetSystemTime, err error)
- func (c *PublicData) GetUnderlying(req requests.GetUnderlying) (response responses.GetUnderlying, err error)
- type SubAccount
- func (c *SubAccount) CreateAPIKey(req requests.CreateAPIKey) (response responses.APIKey, err error)
- func (c *SubAccount) CreateAPIKeySubAccount(req requests.CreatAPIKeySubAccount) (response responses.CreatAPIKeySubAccount, err error)
- func (c *SubAccount) CreateDepositAddressSubAccount(req requests.CreateDepositAddress) (response responses.CreateDepositAddress, err error)
- func (c *SubAccount) CreateSubAccount(req requests.CreateSubAccount) (response responses.CreateSubAccount, err error)
- func (c *SubAccount) DeleteAPIKEySubAccount(req requests.DeleteAPIKeySubAccount) (response responses.DeleteAPIKeySubAccount, err error)
- func (c *SubAccount) DeleteAPIKey(req requests.DeleteAPIKey) (response responses.APIKey, err error)
- func (c *SubAccount) DeleteSubAccount(req requests.DeleteSubAccount) (response responses.DeleteSubAccount, err error)
- func (c *SubAccount) GetBalance(req requests.GetBalance) (response responses.GetBalance, err error)
- func (c *SubAccount) GetDepositAddressSubAccount(req requests.GetDepositAddress) (response responses.GetDepositAddress, err error)
- func (c *SubAccount) GetDepositHistorySubAccount(req requests.GetDepositHistory) (response responses.GetDepositHistory, err error)
- func (c *SubAccount) GetFeeRatesSubAccount(req requests.GetFeeRatesSubAccount) (response responses.GetFeeRatesSubAccount, err error)
- func (c *SubAccount) HistoryTransfer(req requests.HistoryTransfer) (response responses.HistoryTransfer, err error)
- func (c *SubAccount) ManageTransfers(req requests.ManageTransfers) (response responses.ManageTransfer, err error)
- func (c *SubAccount) QueryAPIKey(req requests.QueryAPIKey) (response responses.APIKey, err error)
- func (c *SubAccount) ResetAPIKey(req requests.CreateAPIKey) (response responses.APIKey, err error)
- func (c *SubAccount) SetFeeRateSubAccount(req requests.SetFeeRateSubAccount) (response responses.SetFeeRateSubAccount, err error)
- func (c *SubAccount) SetLevelSubAccount(req requests.SetLevelSubAccount) (response responses.SetLevelSubAccount, err error)
- func (c *SubAccount) UpdateAPIKeySubAccount(req requests.UpdateAPIKEySubAccount) (response responses.UpdateAPIKEySubAccount, err error)
- func (c *SubAccount) UpdateDepositAddressSubAccount(req requests.UpdateDepositAddress) (response responses.UpdateDepositAddress, err error)
- func (c *SubAccount) ViewList(req requests.ViewList) (response responses.ViewList, err error)
- type Trade
- func (c *Trade) AmendOrder(req []requests.AmendOrder) (response responses.AmendOrder, err error)
- func (c *Trade) CancelAdvanceAlgoOrder(req []requests.CancelAlgoOrder) (response responses.CancelAlgoOrder, err error)
- func (c *Trade) CancelAlgoOrder(req []requests.CancelAlgoOrder) (response responses.CancelAlgoOrder, err error)
- func (c *Trade) CancelOrder(req []requests.CancelOrder) (response responses.CancelOrder, err error)
- func (c *Trade) ClosePosition(req requests.ClosePosition) (response responses.ClosePosition, err error)
- func (c *Trade) GetAlgoOrderList(req requests.AlgoOrderList, arch bool) (response responses.AlgoOrderList, err error)
- func (c *Trade) GetOrderDetail(req requests.OrderDetails) (response responses.OrderList, err error)
- func (c *Trade) GetOrderHistory(req requests.OrderList, arch bool) (response responses.OrderList, err error)
- func (c *Trade) GetOrderList(req requests.OrderList) (response responses.OrderList, err error)
- func (c *Trade) GetTransactionDetails(req requests.TransactionDetails, arch bool) (response responses.TransactionDetail, err error)
- func (c *Trade) PlaceAlgoOrder(req requests.PlaceAlgoOrder) (response responses.PlaceAlgoOrder, err error)
- func (c *Trade) PlaceMultipleOrders(req []requests.PlaceOrder) (response responses.PlaceOrder, err error)
- func (c *Trade) PlaceOrder(req requests.PlaceOrder) (response responses.PlaceOrder, err error)
- type TradeData
- func (c *TradeData) GetContractsOpenInterestAndVolume(req requests.GetRatio) (response responses.GetOpenInterestAndVolume, err error)
- func (c *TradeData) GetLongShortRatio(req requests.GetRatio) (response responses.GetRatio, err error)
- func (c *TradeData) GetMarginLendingRatio(req requests.GetRatio) (response responses.GetRatio, err error)
- func (c *TradeData) GetOpenInterestAndVolumeExpiry(req requests.GetRatio) (response responses.GetOpenInterestAndVolumeExpiry, err error)
- func (c *TradeData) GetOpenInterestAndVolumeStrike(req requests.GetOpenInterestAndVolumeStrike) (response responses.GetOpenInterestAndVolumeStrike, err error)
- func (c *TradeData) GetOptionsOpenInterestAndVolume(req requests.GetRatio) (response responses.GetOpenInterestAndVolume, err error)
- func (c *TradeData) GetPutCallRatio(req requests.GetRatio) (response responses.GetPutCallRatio, err error)
- func (c *TradeData) GetSupportCoin() (response responses.GetSupportCoin, err error)
- func (c *TradeData) GetTakerFlow(req requests.GetRatio) (response responses.GetTakerFlow, err error)
- func (c *TradeData) GetTakerVolume(req requests.GetTakerVolume) (response responses.GetTakerVolume, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account
https://www.okex.com/docs-v5/en/#rest-api-account
func NewAccount ¶
func NewAccount(c *ClientRest) *Account
NewAccount returns a pointer to a fresh Account
func (*Account) GetAccountAndPositionRisk ¶
func (c *Account) GetAccountAndPositionRisk(req requests.GetAccountAndPositionRisk) (response responses.GetAccountAndPositionRisk, err error)
GetAccountAndPositionRisk Get account and position risk
https://www.okex.com/docs-v5/en/#rest-api-account-get-account-and-position-risk
func (*Account) GetBalance ¶
func (c *Account) GetBalance(req requests.GetBalance) (response responses.GetBalance, err error)
GetBalance Retrieve a list of assets (with non-zero balance), remaining balance, and available amount in the account.
https://www.okex.com/docs-v5/en/#rest-api-account-get-balance
func (*Account) GetBills ¶
func (c *Account) GetBills(req requests.GetBills, arc bool) (response responses.GetBills, err error)
GetBills Retrieve the bills of the account. The bill refers to all transaction records that result in changing the balance of an account. Pagination is supported, and the response is sorted with the most recent first. This endpoint can retrieve data from the last 7 days.
https://www.okex.com/docs-v5/en/#rest-api-account-get-bills-details-last-7-days
Retrieve the account’s bills. The bill refers to all transaction records that result in changing the balance of an account. Pagination is supported, and the response is sorted with most recent first. This endpoint can retrieve data from the last 3 months.
https://www.okex.com/docs-v5/en/#rest-api-account-get-bills-details-last-3-months
func (*Account) GetConfig ¶
GetConfig Retrieve current account configuration.
https://www.okex.com/docs-v5/en/#rest-api-account-get-account-configuration
func (*Account) GetFeeRates ¶
func (c *Account) GetFeeRates(req requests.GetFeeRates) (response responses.GetFeeRates, err error)
GetFeeRates
https://www.okex.com/docs-v5/en/#rest-api-account-get-fee-rates
func (*Account) GetInterestAccrued ¶
func (c *Account) GetInterestAccrued(req requests.GetInterestAccrued) (response responses.GetInterestAccrued, err error)
GetInterestAccrued
https://www.okex.com/docs-v5/en/#rest-api-account-get-interest-accrued
func (*Account) GetInterestRates ¶
func (c *Account) GetInterestRates(req requests.GetBalance) (response responses.GetInterestRates, err error)
GetInterestRates Get the user's current leveraged currency borrowing interest rate
https://www.okex.com/docs-v5/en/#rest-api-account-get-interest-rate
func (*Account) GetLeverage ¶
GetLeverage
https://www.okex.com/docs-v5/en/#rest-api-account-get-leverage
func (*Account) GetMaxAvailableTradeAmount ¶
func (c *Account) GetMaxAvailableTradeAmount(req requests.GetMaxAvailableTradeAmount) (response responses.GetMaxAvailableTradeAmount, err error)
GetMaxAvailableTradeAmount
https://www.okex.com/docs-v5/en/#rest-api-account-get-maximum-available-tradable-amount
func (*Account) GetMaxBuySellAmount ¶
func (c *Account) GetMaxBuySellAmount(req requests.GetMaxBuySellAmount) (response responses.GetMaxBuySellAmount, err error)
GetMaxBuySellAmount
https://www.okex.com/docs-v5/en/#rest-api-account-get-maximum-buy-sell-amount-or-open-amount
func (*Account) GetMaxLoan ¶
func (c *Account) GetMaxLoan(req requests.GetMaxLoan) (response responses.GetMaxLoan, err error)
GetMaxLoan
https://www.okex.com/docs-v5/en/#rest-api-account-get-the-maximum-loan-of-instrument
func (*Account) GetMaxWithdrawals ¶
func (c *Account) GetMaxWithdrawals(req requests.GetBalance) (response responses.GetMaxWithdrawals, err error)
GetMaxWithdrawals
https://www.okex.com/docs-v5/en/#rest-api-account-get-maximum-withdrawals
func (*Account) GetPositions ¶
func (c *Account) GetPositions(req requests.GetPositions) (response responses.GetPositions, err error)
GetPositions Retrieve information on your positions. When the account is in net mode, net positions will be displayed, and when the account is in long/short mode, long or short positions will be displayed.
https://www.okex.com/docs-v5/en/#rest-api-account-get-positions
func (*Account) IncreaseDecreaseMargin ¶
func (c *Account) IncreaseDecreaseMargin(req requests.IncreaseDecreaseMargin) (response responses.IncreaseDecreaseMargin, err error)
IncreaseDecreaseMargin Increase or decrease the margin of the isolated position.
https://www.okex.com/docs-v5/en/#rest-api-account-increase-decrease-margin
func (*Account) SetGreeks ¶
SetGreeks Set the display type of Greeks.
https://www.okex.com/docs-v5/en/#rest-api-account-set-greeks-m-bs
func (*Account) SetLeverage ¶
SetLeverage The following are the setting leverage cases for an instrument:
Set leverage for isolated MARGIN at pairs level.
Set leverage for cross MARGIN in Single-currency margin at pairs level.
Set leverage for cross MARGIN in Multi-currency margin at currency level.
Set leverage for cross/isolated FUTURES/SWAP at underlying/contract level. https://www.okex.com/docs-v5/en/#rest-api-account-set-leverage
func (*Account) SetPositionMode ¶
func (c *Account) SetPositionMode(req requests.SetPositionMode) (response responses.SetPositionMode, err error)
SetPositionMode FUTURES and SWAP support both long/short mode and net mode. In net mode, users can only have positions in one direction; In long/short mode, users can hold positions in long and short directions.
https://www.okex.com/docs-v5/en/#rest-api-account-set-position-mode
type ClientRest ¶
type ClientRest struct { Account *Account SubAccount *SubAccount Trade *Trade Funding *Funding Market *Market PublicData *PublicData TradeData *TradeData Client *http.Client // contains filtered or unexported fields }
ClientRest is the rest api client
func NewClient ¶
func NewClient(apiKey, secretKey, passphrase string, baseURL okex.BaseURL, destination okex.Destination) *ClientRest
NewClient returns a pointer to a fresh ClientRest
func (*ClientRest) Do ¶
func (c *ClientRest) Do(method, path string, private bool, params ...map[string]string) (*http.Response, error)
Do the http request to the server
func (*ClientRest) DoBatch ¶ added in v1.1.6
func (c *ClientRest) DoBatch(path string, params interface{}) (*http.Response, error)
DoBatch the private post request to the server with parameters of type slice
type Funding ¶
type Funding struct {
// contains filtered or unexported fields
}
Funding
https://www.okex.com/docs-v5/en/#rest-api-funding
func NewFunding ¶
func NewFunding(c *ClientRest) *Funding
NewFunding returns a pointer to a fresh Funding
func (*Funding) AssetBillsDetails ¶
func (c *Funding) AssetBillsDetails(req requests.AssetBillsDetails) (response responses.AssetBillsDetails, err error)
AssetBillsDetails Query the billing record, you can get the latest 1 month historical data.
https://www.okex.com/docs-v5/en/#rest-api-funding-asset-bills-details
func (*Funding) FundsTransfer ¶
func (c *Funding) FundsTransfer(req requests.FundsTransfer) (response responses.FundsTransfer, err error)
FundsTransfer This endpoint supports the transfer of funds between your funding account and trading account, and from the master account to sub-accounts. Direct transfers between sub-accounts are not allowed.
https://www.okex.com/docs-v5/en/#rest-api-funding-funds-transfer
func (*Funding) GetBalance ¶
func (c *Funding) GetBalance(req requests.GetBalance) (response responses.GetBalance, err error)
GetBalance Retrieve the balances of all the assets, and the amount that is available or on hold.
https://www.okex.com/docs-v5/en/#rest-api-funding-get-balance
func (*Funding) GetCurrencies ¶
func (c *Funding) GetCurrencies() (response responses.GetCurrencies, err error)
GetCurrencies Retrieve a list of all currencies. Not all currencies can be traded. Currencies that have not been defined in ISO 4217 may use a custom symbol.
https://www.okex.com/docs-v5/en/#rest-api-funding-get-currencies
func (*Funding) GetDepositAddress ¶
func (c *Funding) GetDepositAddress(req requests.GetDepositAddress) (response responses.GetDepositAddress, err error)
GetDepositAddress Retrieve the deposit addresses of currencies, including previously-used addresses.
https://www.okex.com/docs-v5/en/#rest-api-funding-get-deposit-address
func (*Funding) GetDepositHistory ¶
func (c *Funding) GetDepositHistory(req requests.GetDepositHistory) (response responses.GetDepositHistory, err error)
GetDepositHistory Retrieve the deposit history of all currencies, up to 100 recent records in a year.
https://www.okex.com/docs-v5/en/#rest-api-funding-get-deposit-history
func (*Funding) GetPiggyBankBalance ¶
func (c *Funding) GetPiggyBankBalance(req requests.GetPiggyBankBalance) (response responses.GetPiggyBankBalance, err error)
GetPiggyBankBalance
https://www.okex.com/docs-v5/en/#rest-api-funding-get-piggybank-balance
func (*Funding) GetWithdrawalHistory ¶
func (c *Funding) GetWithdrawalHistory(req requests.GetWithdrawalHistory) (response responses.GetWithdrawalHistory, err error)
GetWithdrawalHistory Retrieve the withdrawal records according to the currency, withdrawal status, and time range in reverse chronological order. The 100 most recent records are returned by default.
https://www.okex.com/docs-v5/en/#rest-api-funding-get-withdrawal-history
func (*Funding) PiggyBankPurchaseRedemption ¶
func (c *Funding) PiggyBankPurchaseRedemption(req requests.PiggyBankPurchaseRedemption) (response responses.PiggyBankPurchaseRedemption, err error)
PiggyBankPurchaseRedemption
https://www.okex.com/docs-v5/en/#rest-api-funding-piggybank-purchase-redemption
func (*Funding) Withdrawal ¶
func (c *Funding) Withdrawal(req requests.Withdrawal) (response responses.Withdrawal, err error)
Withdrawal Withdrawal of tokens.
https://www.okex.com/docs-v5/en/#rest-api-funding-withdrawal
type Market ¶
type Market struct {
// contains filtered or unexported fields
}
Market
https://www.okex.com/docs-v5/en/#rest-api-market-data
func NewMarket ¶
func NewMarket(c *ClientRest) *Market
NewMarket returns a pointer to a fresh Market
func (*Market) Get24HTotalVolume ¶
func (c *Market) Get24HTotalVolume() (response responses.TotalVolume24H, err error)
Get24HTotalVolume The 24-hour trading volume is calculated on a rolling basis, using USD as the pricing unit.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-24h-total-volume
func (*Market) GetCandlesticks ¶
func (c *Market) GetCandlesticks(req requests.GetCandlesticks) (response responses.Candle, err error)
GetCandlesticks Retrieve the candlestick charts. This endpoint can retrieve the latest 1,440 data entries. Charts are returned in groups based on the requested bar.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-candlesticks
func (*Market) GetCandlesticksHistory ¶
func (c *Market) GetCandlesticksHistory(req requests.GetCandlesticks) (response responses.Candle, err error)
GetCandlesticksHistory Retrieve history candlestick charts from recent years.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-candlesticks
func (*Market) GetIndexCandlesticks ¶
func (c *Market) GetIndexCandlesticks(req requests.GetCandlesticks) (response responses.IndexCandle, err error)
GetIndexCandlesticks Retrieve the candlestick charts of the index. This endpoint can retrieve the latest 1,440 data entries. Charts are returned in groups based on the requested bar.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-index-candlesticks
func (*Market) GetIndexComponents ¶
func (c *Market) GetIndexComponents(req requests.GetIndexComponents) (response responses.IndexComponent, err error)
GetIndexComponents Get the index component information data on the market
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-index-components
func (*Market) GetIndexTickers ¶
func (c *Market) GetIndexTickers(req requests.GetIndexTickers) (response responses.Ticker, err error)
GetIndexTickers Retrieve index tickers.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-index-tickers
func (*Market) GetMarkPriceCandlesticks ¶
func (c *Market) GetMarkPriceCandlesticks(req requests.GetCandlesticks) (response responses.CandleMarket, err error)
GetMarkPriceCandlesticks Retrieve the candlestick charts of mark price. This endpoint can retrieve the latest 1,440 data entries. Charts are returned in groups based on the requested bar.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-mark-price-candlesticks
func (*Market) GetOrderBook ¶
GetOrderBook Retrieve a instrument is order book.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-order-book
func (*Market) GetTicker ¶
GetTicker Retrieve the latest price snapshot, best bid/ask price, and trading volume in the last 24 hours.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-ticker
func (*Market) GetTickers ¶
GetTickers Retrieve the latest price snapshot, best bid/ask price, and trading volume in the last 24 hours.
https://www.okex.com/docs-v5/en/#rest-api-market-data-get-tickers
type PublicData ¶
type PublicData struct {
// contains filtered or unexported fields
}
PublicData
https://www.okex.com/docs-v5/en/#rest-api-public-data
func NewPublicData ¶
func NewPublicData(c *ClientRest) *PublicData
NewPublicData returns a pointer to a fresh PublicData
func (*PublicData) GetDeliveryExerciseHistory ¶
func (c *PublicData) GetDeliveryExerciseHistory(req requests.GetDeliveryExerciseHistory) (response responses.GetDeliveryExerciseHistory, err error)
GetDeliveryExerciseHistory Retrieve the estimated delivery price, which will only have a return value one hour before the delivery/exercise.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-instruments
func (*PublicData) GetDiscountRateAndInterestFreeQuota ¶
func (c *PublicData) GetDiscountRateAndInterestFreeQuota(req requests.GetDiscountRateAndInterestFreeQuota) (response responses.GetDiscountRateAndInterestFreeQuota, err error)
GetDiscountRateAndInterestFreeQuota Retrieve discount rate level and interest-free quota.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-discount-rate-and-interest-free-quota
func (*PublicData) GetEstimatedDeliveryExercisePrice ¶
func (c *PublicData) GetEstimatedDeliveryExercisePrice(req requests.GetEstimatedDeliveryExercisePrice) (response responses.GetEstimatedDeliveryExercisePrice, err error)
GetEstimatedDeliveryExercisePrice Retrieve the estimated delivery price which will only have a return value one hour before the delivery/exercise.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-estimated-delivery-Exercise-price
func (*PublicData) GetInstruments ¶
func (c *PublicData) GetInstruments(req requests.GetInstruments) (response responses.GetInstruments, err error)
GetInstruments Retrieve a list of instruments with open contracts.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-instruments
func (*PublicData) GetInterestRateAndLoanQuota ¶
func (c *PublicData) GetInterestRateAndLoanQuota() (response responses.GetInterestRateAndLoanQuota, err error)
GetInterestRateAndLoanQuota Get margin interest rate
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-position-tiers
func (*PublicData) GetLimitPrice ¶
func (c *PublicData) GetLimitPrice(req requests.GetLimitPrice) (response responses.GetLimitPrice, err error)
GetLimitPrice Retrieve the highest buy limit and lowest sell limit of the instrument.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-limit-price
func (*PublicData) GetLiquidationOrders ¶
func (c *PublicData) GetLiquidationOrders(req requests.GetLiquidationOrders) (response responses.GetLiquidationOrders, err error)
GetLiquidationOrders Retrieve information on liquidation orders in the last 7 days.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-liquidation-orders
func (*PublicData) GetMarkPrice ¶
func (c *PublicData) GetMarkPrice(req requests.GetMarkPrice) (response responses.GetMarkPrice, err error)
GetMarkPrice Retrieve mark price.
We set the mark price based on the SPOT index and at a reasonable basis to prevent individual users from manipulating the market and causing the contract price to fluctuate.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-mark-price
func (*PublicData) GetOpenInterest ¶
func (c *PublicData) GetOpenInterest(req requests.GetOpenInterest) (response responses.GetOpenInterest, err error)
GetOpenInterest Retrieve the total open interest for contracts on OKEx.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-open-interest
func (*PublicData) GetOptionMarketData ¶
func (c *PublicData) GetOptionMarketData(req requests.GetOptionMarketData) (response responses.GetOptionMarketData, err error)
GetOptionMarketData Retrieve option market data.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-option-market-data
func (*PublicData) GetPositionTiers ¶
func (c *PublicData) GetPositionTiers(req requests.GetPositionTiers) (response responses.GetPositionTiers, err error)
GetPositionTiers Position information,Maximum leverage depends on your borrowings and margin ratio.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-position-tiers
func (*PublicData) GetSystemTime ¶
func (c *PublicData) GetSystemTime() (response responses.GetSystemTime, err error)
GetSystemTime Retrieve API server time.
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-system-time
func (*PublicData) GetUnderlying ¶
func (c *PublicData) GetUnderlying(req requests.GetUnderlying) (response responses.GetUnderlying, err error)
GetUnderlying
https://www.okex.com/docs-v5/en/#rest-api-public-data-get-underlying
type SubAccount ¶
type SubAccount struct {
// contains filtered or unexported fields
}
SubAccount
https://www.okex.com/docs-v5/en/#rest-api-subaccount
func NewSubAccount ¶
func NewSubAccount(c *ClientRest) *SubAccount
NewSubAccount returns a pointer to a fresh SubAccount
func (*SubAccount) CreateAPIKey ¶
func (c *SubAccount) CreateAPIKey(req requests.CreateAPIKey) (response responses.APIKey, err error)
CreateAPIKey applies to master accounts only
https://www.okex.com/docs-v5/en/#rest-api-subaccount-create-an-apikey-for-a-sub-account
func (*SubAccount) CreateAPIKeySubAccount ¶ added in v1.3.4
func (c *SubAccount) CreateAPIKeySubAccount(req requests.CreatAPIKeySubAccount) ( response responses.CreatAPIKeySubAccount, err error)
CreateAPIKeySubAccount applies to master accounts only
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-create-an-api-key-for-a-sub-account
func (*SubAccount) CreateDepositAddressSubAccount ¶ added in v1.3.4
func (c *SubAccount) CreateDepositAddressSubAccount(req requests.CreateDepositAddress) ( response responses.CreateDepositAddress, err error)
CreateDepositAddressSubAccount applies to master accounts only
func (*SubAccount) CreateSubAccount ¶ added in v1.3.4
func (c *SubAccount) CreateSubAccount(req requests.CreateSubAccount) (response responses.CreateSubAccount, err error)
CreateSubAccount applies to master accounts only
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-create-sub-account
func (*SubAccount) DeleteAPIKEySubAccount ¶ added in v1.3.4
func (c *SubAccount) DeleteAPIKEySubAccount(req requests.DeleteAPIKeySubAccount) ( response responses.DeleteAPIKeySubAccount, err error)
DeleteAPIKEySubAccount applies to master accounts only
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-delete-the-api-key-of-sub-accounts
func (*SubAccount) DeleteAPIKey ¶
func (c *SubAccount) DeleteAPIKey(req requests.DeleteAPIKey) (response responses.APIKey, err error)
DeleteAPIKey applies to master accounts only
https://www.okex.com/docs-v5/en/#rest-api-subaccount-delete-the-apikey-of-sub-accounts
func (*SubAccount) DeleteSubAccount ¶ added in v1.3.4
func (c *SubAccount) DeleteSubAccount(req requests.DeleteSubAccount) (response responses.DeleteSubAccount, err error)
DeleteSubAccount applies to master accounts only
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-delete-sub-account
func (*SubAccount) GetBalance ¶
func (c *SubAccount) GetBalance(req requests.GetBalance) (response responses.GetBalance, err error)
GetBalance Query detailed balance info of Trading Account of a sub-account via the master account (applies to master accounts only)
https://www.okex.com/docs-v5/en/#rest-api-subaccount-get-sub-account-balance
func (*SubAccount) GetDepositAddressSubAccount ¶ added in v1.3.4
func (c *SubAccount) GetDepositAddressSubAccount(req requests.GetDepositAddress) (response responses.GetDepositAddress, err error)
GetDepositAddressSubAccount applies to master accounts only
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-get-sub-account-deposit-address
func (*SubAccount) GetDepositHistorySubAccount ¶ added in v1.4.1
func (c *SubAccount) GetDepositHistorySubAccount(req requests.GetDepositHistory) (response responses.GetDepositHistory, err error)
GetDepositHistorySubAccount applies to master accounts only
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-get-sub-account-deposit-history
func (*SubAccount) GetFeeRatesSubAccount ¶ added in v1.3.5
func (c *SubAccount) GetFeeRatesSubAccount(req requests.GetFeeRatesSubAccount) (response responses.GetFeeRatesSubAccount, err error)
GetFeeRatesSubAccount
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-get-sub-account-deposit-address
func (*SubAccount) HistoryTransfer ¶
func (c *SubAccount) HistoryTransfer(req requests.HistoryTransfer) (response responses.HistoryTransfer, err error)
HistoryTransfer applies to master accounts only
https://www.okex.com/docs-v5/en/#rest-api-subaccount-history-of-sub-account-transfer
func (*SubAccount) ManageTransfers ¶
func (c *SubAccount) ManageTransfers(req requests.ManageTransfers) (response responses.ManageTransfer, err error)
ManageTransfers applies to master accounts only
func (*SubAccount) QueryAPIKey ¶
func (c *SubAccount) QueryAPIKey(req requests.QueryAPIKey) (response responses.APIKey, err error)
QueryAPIKey applies to master accounts only
https://www.okex.com/docs-v5/en/#rest-api-subaccount-query-the-apikey-of-a-sub-account
func (*SubAccount) ResetAPIKey ¶
func (c *SubAccount) ResetAPIKey(req requests.CreateAPIKey) (response responses.APIKey, err error)
ResetAPIKey applies to master accounts only
https://www.okex.com/docs-v5/en/#rest-api-subaccount-reset-the-apikey-of-a-sub-account
func (*SubAccount) SetFeeRateSubAccount ¶ added in v1.3.4
func (c *SubAccount) SetFeeRateSubAccount(req requests.SetFeeRateSubAccount) (response responses.SetFeeRateSubAccount, err error)
SetFeeRateSubAccount applies to master accounts only
func (*SubAccount) SetLevelSubAccount ¶ added in v1.3.4
func (c *SubAccount) SetLevelSubAccount(req requests.SetLevelSubAccount) (response responses.SetLevelSubAccount, err error)
SetLevelSubAccount applies to master accounts only
func (*SubAccount) UpdateAPIKeySubAccount ¶ added in v1.3.4
func (c *SubAccount) UpdateAPIKeySubAccount(req requests.UpdateAPIKEySubAccount) ( response responses.UpdateAPIKEySubAccount, err error)
UpdateAPIKeySubAccount applies to master accounts only
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-reset-the-api-key-of-a-sub-account
func (*SubAccount) UpdateDepositAddressSubAccount ¶ added in v1.3.4
func (c *SubAccount) UpdateDepositAddressSubAccount(req requests.UpdateDepositAddress) ( response responses.UpdateDepositAddress, err error)
UpdateDepositAddressSubAccount applies to master accounts only
https://www.okx.com/docs-v5/broker_en/#non-disclosed-broker-api-modify-sub-account-deposit-address
func (*SubAccount) ViewList ¶
ViewList applies to master accounts only
https://www.okex.com/docs-v5/en/#rest-api-subaccount-view-sub-account-list
type Trade ¶
type Trade struct {
// contains filtered or unexported fields
}
Trade
https://www.okex.com/docs-v5/en/#rest-api-trade
func (*Trade) AmendOrder ¶
func (c *Trade) AmendOrder(req []requests.AmendOrder) (response responses.AmendOrder, err error)
AmendOrder Amend an incomplete order.
https://www.okex.com/docs-v5/en/#rest-api-trade-amend-order
Amend incomplete orders in batches. Maximum 20 orders can be amended at a time. Request parameters should be passed in the form of an array.
https://www.okex.com/docs-v5/en/#rest-api-trade-amend-multiple-orders
func (*Trade) CancelAdvanceAlgoOrder ¶
func (c *Trade) CancelAdvanceAlgoOrder(req []requests.CancelAlgoOrder) (response responses.CancelAlgoOrder, err error)
CancelAdvanceAlgoOrder Cancel unfilled algo orders(iceberg order and twap order). A maximum of 10 orders can be canceled at a time. Request parameters should be passed in the form of an array.
Only released on demo trading ¶
https://www.okex.com/docs-v5/en/#rest-api-trade-cancel-advance-algo-order
func (*Trade) CancelAlgoOrder ¶
func (c *Trade) CancelAlgoOrder(req []requests.CancelAlgoOrder) (response responses.CancelAlgoOrder, err error)
CancelAlgoOrder Cancel unfilled algo orders(trigger order, oco order, conditional order). A maximum of 10 orders can be canceled at a time. Request parameters should be passed in the form of an array.
https://www.okex.com/docs-v5/en/#rest-api-trade-cancel-algo-order
func (*Trade) CancelOrder ¶ added in v1.0.8
func (c *Trade) CancelOrder(req []requests.CancelOrder) (response responses.CancelOrder, err error)
CancelOrder Cancel an incomplete order.
https://www.okex.com/docs-v5/en/#rest-api-trade-cancel-order
Cancel incomplete orders in batches. Maximum 20 orders can be canceled at a time. Request parameters should be passed in the form of an array.
https://www.okex.com/docs-v5/en/#rest-api-trade-cancel-multiple-orders
func (*Trade) ClosePosition ¶
func (c *Trade) ClosePosition(req requests.ClosePosition) (response responses.ClosePosition, err error)
ClosePosition Close all positions of an instrument via a market order.
https://www.okex.com/docs-v5/en/#rest-api-trade-close-positions
func (*Trade) GetAlgoOrderList ¶
func (c *Trade) GetAlgoOrderList(req requests.AlgoOrderList, arch bool) (response responses.AlgoOrderList, err error)
GetAlgoOrderList Retrieve a list of untriggered Algo orders under the current account.
`iceberg` order and `twap` order just supported on demo trading
https://www.okex.com/docs-v5/en/#rest-api-trade-get-algo-order-list
Retrieve a list of all algo orders under the current account in the last 3 months.
`iceberg` order and `twap` order just supported on demo trading
https://www.okex.com/docs-v5/en/#rest-api-trade-get-algo-order-history
func (*Trade) GetOrderDetail ¶
GetOrderDetail Retrieve order details.
https://www.okex.com/docs-v5/en/#rest-api-trade-get-order-details
func (*Trade) GetOrderHistory ¶
func (c *Trade) GetOrderHistory(req requests.OrderList, arch bool) (response responses.OrderList, err error)
GetOrderHistory Retrieve the completed order data for the last 7 days, and the incomplete orders that have been cancelled are only reserved for 2 hours.
https://www.okex.com/docs-v5/en/#rest-api-trade-get-order-history-last-7-days
Retrieve the completed order data of the last 3 months, and the incomplete orders that have been canceled are only reserved for 2 hours. https://www.okex.com/docs-v5/en/#rest-api-trade-get-order-history-last-3-months
func (*Trade) GetOrderList ¶
GetOrderList Retrieve all incomplete orders under the current account.
https://www.okex.com/docs-v5/en/#rest-api-trade-get-order-list
func (*Trade) GetTransactionDetails ¶
func (c *Trade) GetTransactionDetails(req requests.TransactionDetails, arch bool) (response responses.TransactionDetail, err error)
GetTransactionDetails Retrieve recently-filled transaction details in the last 3 day.
https://www.okex.com/docs-v5/en/#rest-api-trade-get-order-history-last-7-days
Retrieve recently-filled transaction details in the last 3 months.
https://www.okex.com/docs-v5/en/#rest-api-trade-get-transaction-details-last-3-months
func (*Trade) PlaceAlgoOrder ¶
func (c *Trade) PlaceAlgoOrder(req requests.PlaceAlgoOrder) (response responses.PlaceAlgoOrder, err error)
PlaceAlgoOrder The algo order includes trigger order, oco order, conditional order,iceberg order and twap order.
`iceberg` order and `twap` order just supported on demo trading
https://www.okex.com/docs-v5/en/#rest-api-trade-place-algo-order
func (*Trade) PlaceMultipleOrders ¶
func (c *Trade) PlaceMultipleOrders(req []requests.PlaceOrder) (response responses.PlaceOrder, err error)
PlaceMultipleOrders Cancel an incomplete order.
https://www.okex.com/docs-v5/en/#rest-api-trade-place-multiple-orders
func (*Trade) PlaceOrder ¶
func (c *Trade) PlaceOrder(req requests.PlaceOrder) (response responses.PlaceOrder, err error)
PlaceOrder You can place an order only if you have sufficient funds.
https://www.okex.com/docs-v5/en/#rest-api-trade-get-positions
type TradeData ¶
type TradeData struct {
// contains filtered or unexported fields
}
TradeData
https://www.okex.com/docs-v5/en/#rest-api-tradeing-data
func NewTradeData ¶
func NewTradeData(c *ClientRest) *TradeData
NewTradeData returns a pointer to a fresh TradeData
func (*TradeData) GetContractsOpenInterestAndVolume ¶
func (c *TradeData) GetContractsOpenInterestAndVolume(req requests.GetRatio) (response responses.GetOpenInterestAndVolume, err error)
GetContractsOpenInterestAndVolume Open interest is the sum of all long and short futures and perpetual swap positions.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-contracts-open-interest-and-volume
func (*TradeData) GetLongShortRatio ¶
func (c *TradeData) GetLongShortRatio(req requests.GetRatio) (response responses.GetRatio, err error)
GetLongShortRatio This is the ratio of users with net long vs short positions. It includes data from futures and perpetual swaps.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-long-short-ratio
func (*TradeData) GetMarginLendingRatio ¶
func (c *TradeData) GetMarginLendingRatio(req requests.GetRatio) (response responses.GetRatio, err error)
GetMarginLendingRatio This indicator shows the ratio of cumulative data value between currency pair leverage quote currency and underlying asset over a given period of time.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-margin-lending-ratio
func (*TradeData) GetOpenInterestAndVolumeExpiry ¶
func (c *TradeData) GetOpenInterestAndVolumeExpiry(req requests.GetRatio) (response responses.GetOpenInterestAndVolumeExpiry, err error)
GetOpenInterestAndVolumeExpiry This shows the volume and open interest for each upcoming expiration. You can use this to see which expirations are currently the most popular to trade.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-open-interest-and-volume-expiry
func (*TradeData) GetOpenInterestAndVolumeStrike ¶
func (c *TradeData) GetOpenInterestAndVolumeStrike(req requests.GetOpenInterestAndVolumeStrike) (response responses.GetOpenInterestAndVolumeStrike, err error)
GetOpenInterestAndVolumeStrike This shows what option strikes are the most popular for each expiration.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-open-interest-and-volume-strike
func (*TradeData) GetOptionsOpenInterestAndVolume ¶
func (c *TradeData) GetOptionsOpenInterestAndVolume(req requests.GetRatio) (response responses.GetOpenInterestAndVolume, err error)
GetOptionsOpenInterestAndVolume This shows the sum of all open positions and how much total trading volume has taken place.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-options-open-interest-and-volume
func (*TradeData) GetPutCallRatio ¶
func (c *TradeData) GetPutCallRatio(req requests.GetRatio) (response responses.GetPutCallRatio, err error)
GetPutCallRatio This shows the relative buy/sell volume for calls and puts. It shows whether traders are bullish or bearish on price and volatility.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-put-call-ratio
func (*TradeData) GetSupportCoin ¶
func (c *TradeData) GetSupportCoin() (response responses.GetSupportCoin, err error)
GetSupportCoin Get the currency supported by the transaction big data interface
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-support-coin
func (*TradeData) GetTakerFlow ¶
func (c *TradeData) GetTakerFlow(req requests.GetRatio) (response responses.GetTakerFlow, err error)
GetTakerFlow This shows the relative buy/sell volume for calls and puts. It shows whether traders are bullish or bearish on price and volatility.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-taker-flow
func (*TradeData) GetTakerVolume ¶
func (c *TradeData) GetTakerVolume(req requests.GetTakerVolume) (response responses.GetTakerVolume, err error)
GetTakerVolume This is the taker volume for both buyers and sellers. This shows the influx and exit of funds in and out of {coin}.
https://www.okex.com/docs-v5/en/#rest-api-trading-data-get-support-coin