Documentation ¶
Index ¶
- type Account
- func (a *Account) GetAccountAndPositionRisk(req requests.GetAccountAndPositionRisk) (response responses.GetAccountAndPositionRisk, err error)
- func (a *Account) GetBalance(req requests.GetBalance) (response responses.GetBalance, err error)
- func (a *Account) GetBills(req requests.GetBills, arc bool) (response responses.GetBills, err error)
- func (a *Account) GetConfig() (response responses.GetConfig, err error)
- func (a *Account) GetFeeRates(req requests.GetFeeRates) (response responses.GetFeeRates, err error)
- func (a *Account) GetInterestAccrued(req requests.GetInterestAccrued) (response responses.GetInterestAccrued, err error)
- func (a *Account) GetInterestRates(req requests.GetBalance) (response responses.GetInterestRates, err error)
- func (a *Account) GetLeverage(req requests.GetLeverage) (response responses.Leverage, err error)
- func (a *Account) GetMaxAvailableTradeAmount(req requests.GetMaxAvailableTradeAmount) (response responses.GetMaxAvailableTradeAmount, err error)
- func (a *Account) GetMaxBuySellAmount(req requests.GetMaxBuySellAmount) (response responses.GetMaxBuySellAmount, err error)
- func (a *Account) GetMaxLoan(req requests.GetMaxLoan) (response responses.GetMaxLoan, err error)
- func (a *Account) GetMaxWithdrawals(req requests.GetBalance) (response responses.GetMaxWithdrawals, err error)
- func (a *Account) GetPositions(req requests.GetPositions) (response responses.GetPositions, err error)
- func (a *Account) IncreaseDecreaseMargin(req requests.IncreaseDecreaseMargin) (response responses.IncreaseDecreaseMargin, err error)
- func (a *Account) SetGreeks(req requests.SetGreeks) (response responses.SetGreeks, err error)
- func (a *Account) SetLeverage(req requests.SetLeverage) (response responses.Leverage, err error)
- func (a *Account) SetPositionMode(req requests.SetPositionMode) (response responses.SetPositionMode, err error)
- type ClientRest
- type Funding
- func (a *Funding) AssetBillsDetails(req requests.AssetBillsDetails) (response responses.AssetBillsDetails, err error)
- func (a *Funding) FundsTransfer(req requests.FundsTransfer) (response responses.FundsTransfer, err error)
- func (a *Funding) GetBalance(req requests.GetBalance) (response responses.GetBalance, err error)
- func (a *Funding) GetCurrencies() (response responses.GetCurrencies, err error)
- func (a *Funding) GetDepositAddress(req requests.GetDepositAddress) (response responses.GetDepositAddress, err error)
- func (a *Funding) GetDepositHistory(req requests.GetDepositHistory) (response responses.GetDepositHistory, err error)
- func (a *Funding) GetPiggyBankBalance(req requests.GetPiggyBankBalance) (response responses.GetPiggyBankBalance, err error)
- func (a *Funding) GetWithdrawalHistory(req requests.GetWithdrawalHistory) (response responses.GetWithdrawalHistory, err error)
- func (a *Funding) PiggyBankPurchaseRedemption(req requests.PiggyBankPurchaseRedemption) (response responses.PiggyBankPurchaseRedemption, err error)
- func (a *Funding) Withdrawal(req requests.Withdrawal) (response responses.Withdrawal, err error)
- type Market
- func (a *Market) Get24HTotalVolume() (response responses.TotalVolume24H, err error)
- func (a *Market) GetCandlesticks(req requests.GetCandlesticks) (response responses.Candle, err error)
- func (a *Market) GetCandlesticksHistory(req requests.GetCandlesticks) (response responses.Candle, err error)
- func (a *Market) GetIndexCandlesticks(req requests.GetCandlesticks) (response responses.IndexCandle, err error)
- func (a *Market) GetIndexComponents(req requests.GetIndexComponents) (response responses.IndexComponent, err error)
- func (a *Market) GetIndexTickers(req requests.GetIndexTickers) (response responses.Ticker, err error)
- func (a *Market) GetMarkPriceCandlesticks(req requests.GetCandlesticks) (response responses.CandleMarket, err error)
- func (a *Market) GetOrderBook(req requests.GetOrderBook) (response responses.OrderBook, err error)
- func (a *Market) GetTicker(req requests.GetTickers) (response responses.Ticker, err error)
- func (a *Market) GetTickers(req requests.GetTickers) (response responses.Ticker, err error)
- func (a *Market) GetTrades(req requests.GetTrades) (response responses.Trade, err error)
- type Trade
- func (a *Trade) AmendOrder(req []requests.OrderList) (response responses.AmendOrder, err error)
- func (a *Trade) CandleOrder(req []requests.CancelOrder) (response responses.PlaceOrder, err error)
- func (a *Trade) ClosePosition(req requests.ClosePosition) (response responses.ClosePosition, err error)
- func (a *Trade) GetOrderDetail(req requests.OrderList) (response responses.Order, err error)
- func (a *Trade) GetOrderHistory(req requests.OrderList, arch bool) (response responses.Order, err error)
- func (a *Trade) GetOrderList(req requests.OrderList) (response responses.Order, err error)
- func (a *Trade) GetTransactionDetails(req requests.TransactionDetails, arch bool) (response responses.TransactionDetail, err error)
- func (a *Trade) PlaceMultipleOrders(req []requests.PlaceOrder) (response responses.PlaceOrder, err error)
- func (a *Trade) PlaceOrder(req []requests.PlaceOrder) (response responses.PlaceOrder, 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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 Trade *Trade Funding *Funding Market *Market // 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
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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 (a *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 of the market 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 Trade ¶
type Trade struct {
// contains filtered or unexported fields
}
Trade
https://www.okex.com/docs-v5/en/#rest-api-trade
func (*Trade) AmendOrder ¶
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) CandleOrder ¶
func (a *Trade) CandleOrder(req []requests.CancelOrder) (response responses.PlaceOrder, err error)
CandleOrder 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 (a *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) GetOrderDetail ¶
GetOrderDetail Retrieve order details.
https://www.okex.com/docs-v5/en/#rest-api-trade-get-order-details
func (*Trade) GetOrderHistory ¶
func (a *Trade) GetOrderHistory(req requests.OrderList, arch bool) (response responses.Order, 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 (a *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) PlaceMultipleOrders ¶
func (a *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 (a *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