client

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountClient

type AccountClient struct {
	// contains filtered or unexported fields
}

Responsible to operate account

func (*AccountClient) FuturesTransfer

func (p *AccountClient) FuturesTransfer(request account.FuturesTransferRequest) (int64, error)

Transfer fund between spot account and future contract account

func (*AccountClient) GetAccountAssetValuation

func (p *AccountClient) GetAccountAssetValuation(accountType string, valuationCurrency string, subUid int64) (*account.GetAccountAssetValuationResponse, error)

Returns the valuation of the total assets of the account in btc or fiat currency.

func (*AccountClient) GetAccountBalance

func (p *AccountClient) GetAccountBalance(accountId string) (*account.AccountBalance, error)

Returns the balance of an account specified by account id

func (*AccountClient) GetAccountHistory

func (p *AccountClient) GetAccountHistory(accountId string, optionalRequest account.GetAccountHistoryOptionalRequest) ([]account.AccountHistory, error)

Returns the amount changes of specified user's account

func (*AccountClient) GetAccountInfo

func (p *AccountClient) GetAccountInfo() ([]account.AccountInfo, error)

Returns a list of accounts owned by this API user

func (*AccountClient) GetAccountLedger

func (p *AccountClient) GetAccountLedger(accountId string, optionalRequest account.GetAccountLedgerOptionalRequest) ([]account.Ledger, error)

Returns the account ledger of specified user's account

func (*AccountClient) GetPointBalance

func (p *AccountClient) GetPointBalance(subUid string) (*account.GetPointBalanceResponse, error)

Returns the point balance of specified user's account

func (*AccountClient) Init

func (p *AccountClient) Init(accessKey string, secretKey string, host string) *AccountClient

Initializer

func (*AccountClient) TransferAccount

func (*AccountClient) TransferPoint

Transfer points between spot account and future contract account

type AlgoOrderClient

type AlgoOrderClient struct {
	// contains filtered or unexported fields
}

Responsible to operate algo order

func (*AlgoOrderClient) CancelOrder

Cancel orders by client order id

func (*AlgoOrderClient) GetHistoryOrders

func (p *AlgoOrderClient) GetHistoryOrders(request *model.GetRequest) (*algoorder.GetHistoryOrdersResponse, error)

func (*AlgoOrderClient) GetOpenOrders

func (p *AlgoOrderClient) GetOpenOrders(request *model.GetRequest) (*algoorder.GetOpenOrdersResponse, error)

func (*AlgoOrderClient) GetSpecificOrder

func (p *AlgoOrderClient) GetSpecificOrder(request *model.GetRequest) (*algoorder.GetSpecificOrderResponse, error)

func (*AlgoOrderClient) Init

func (p *AlgoOrderClient) Init(accessKey string, secretKey string, host string) *AlgoOrderClient

Initializer

func (*AlgoOrderClient) PlaceOrder

Place a new order

type CommonClient

type CommonClient struct {
	// contains filtered or unexported fields
}

Responsible to get common information

func (*CommonClient) GetCurrencys

func (p *CommonClient) GetCurrencys() ([]string, error)

Get all Supported Currencies This endpoint returns all Huobi's supported trading currencies.

func (*CommonClient) GetMarketStatus

func (p *CommonClient) GetMarketStatus() (*common.MarketStatus, error)

Returns current market status

func (*CommonClient) GetSymbols

func (p *CommonClient) GetSymbols() ([]common.Symbol, error)

Get all Supported Trading Symbol This endpoint returns all Huobi's supported trading symbol.

func (*CommonClient) GetSystemStatus

func (p *CommonClient) GetSystemStatus() (string, error)

func (*CommonClient) GetTimestamp

func (p *CommonClient) GetTimestamp() (int, error)

Get Current Timestamp This endpoint returns the current timestamp, i.e. the number of milliseconds that have elapsed since 00:00:00 UTC on 1 January 1970.

func (*CommonClient) GetV2ReferenceCurrencies

func (p *CommonClient) GetV2ReferenceCurrencies(optionalRequest common.GetV2ReferenceCurrencies) ([]common.CurrencyChain, error)

APIv2 - Currency & Chains API user could query static reference information for each currency, as well as its corresponding chain(s). (Public Endpoint)

func (*CommonClient) Init

func (p *CommonClient) Init(host string) *CommonClient

Initializer

type CrossMarginClient

type CrossMarginClient struct {
	// contains filtered or unexported fields
}

Responsible to operate cross margin

func (*CrossMarginClient) ApplyLoan

func (p *CrossMarginClient) ApplyLoan(request margin.CrossMarginOrdersRequest) (int, error)

Place an order to apply a margin loan.

func (*CrossMarginClient) GeneralMarginLoanOrders

Returns general margin orders based on a specific searching criteria.

func (*CrossMarginClient) GeneralRepay

Repays general margin loan with you asset in your margin account.

func (*CrossMarginClient) GetMarginLoanInfo

func (p *CrossMarginClient) GetMarginLoanInfo() ([]margin.CrossMarginLoanInfo, error)

Returns loan interest rates and quota applied on the user

func (*CrossMarginClient) Init

func (p *CrossMarginClient) Init(accessKey string, secretKey string, host string) *CrossMarginClient

Initializer

func (*CrossMarginClient) MarginAccountsBalance

func (p *CrossMarginClient) MarginAccountsBalance(SubUid string) (*margin.CrossMarginAccountsBalance, error)

Returns the balance of the margin loan account.

func (*CrossMarginClient) MarginLoanOrders

Returns margin orders based on a specific searching criteria.

func (*CrossMarginClient) Repay

func (p *CrossMarginClient) Repay(orderId string, request margin.MarginOrdersRepayRequest) (int, error)

Repays margin loan with you asset in your margin account.

func (*CrossMarginClient) TransferIn

func (p *CrossMarginClient) TransferIn(request margin.CrossMarginTransferRequest) (int, error)

Transfer specific asset from spot trading account to cross margin account

func (*CrossMarginClient) TransferOut

func (p *CrossMarginClient) TransferOut(request margin.CrossMarginTransferRequest) (int, error)

Transfer specific asset from cross margin account to spot trading account

type ETFClient

type ETFClient struct {
	// contains filtered or unexported fields
}

Responsible to operate ETF

func (*ETFClient) GetSwapConfig

func (p *ETFClient) GetSwapConfig(etfName string) (*etf.SwapConfig, error)

Return the basic information of ETF creation and redemption, as well as ETF constituents

func (*ETFClient) GetSwapList

func (p *ETFClient) GetSwapList(etfName string, offset int, limit int) ([]*etf.SwapList, error)

Get past creation and redemption.(up to 100 records)

func (*ETFClient) Init

func (p *ETFClient) Init(accessKey string, secretKey string, host string) *ETFClient

Initializer

func (*ETFClient) SwapIn

func (p *ETFClient) SwapIn(request etf.SwapRequest) (bool, error)

Swap in ETF

func (*ETFClient) SwapOut

func (p *ETFClient) SwapOut(request etf.SwapRequest) (bool, error)

Swap out ETF

type IsolatedMarginClient

type IsolatedMarginClient struct {
	// contains filtered or unexported fields
}

Responsible to operate isolated margin

func (*IsolatedMarginClient) Apply

Place an order to apply a margin loan.

func (*IsolatedMarginClient) GetMarginLoanInfo

Returns loan interest rates and quota applied on the user

func (*IsolatedMarginClient) Init

func (p *IsolatedMarginClient) Init(accessKey string, secretKey string, host string) *IsolatedMarginClient

Initializer

func (*IsolatedMarginClient) MarginAccountsBalance

Returns the balance of the margin loan account.

func (*IsolatedMarginClient) MarginLoanOrders

Returns margin orders based on a specific searching criteria.

func (*IsolatedMarginClient) Repay

func (p *IsolatedMarginClient) Repay(orderId string, request margin.MarginOrdersRepayRequest) (int, error)

Repays margin loan with you asset in your margin account.

func (*IsolatedMarginClient) TransferIn

Transfer specific asset from spot trading account to isolated margin account

func (*IsolatedMarginClient) TransferOut

Transfer specific asset from isolated margin account to spot trading account

type MarketClient

type MarketClient struct {
	// contains filtered or unexported fields
}

Responsible to get market information

func (*MarketClient) GetAllSymbolsLast24hCandlesticksAskBid

func (client *MarketClient) GetAllSymbolsLast24hCandlesticksAskBid() ([]market.SymbolCandlestick, error)

Retrieve the latest tickers for all supported pairs.

func (*MarketClient) GetCandlestick

func (client *MarketClient) GetCandlestick(symbol string, optionalRequest market.GetCandlestickOptionalRequest) ([]market.Candlestick, error)

Retrieves all klines in a specific range.

func (*MarketClient) GetDepth

func (client *MarketClient) GetDepth(symbol string, step string, optionalRequest market.GetDepthOptionalRequest) (*market.Depth, error)

Retrieves the current order book of a specific pair

func (*MarketClient) GetHistoricalTrade

func (client *MarketClient) GetHistoricalTrade(symbol string, optionalRequest market.GetHistoricalTradeOptionalRequest) ([]market.TradeTick, error)

Retrieves the most recent trades with their price, volume, and direction.

func (*MarketClient) GetLast24hCandlestick

func (client *MarketClient) GetLast24hCandlestick(symbol string) (*market.Candlestick, error)

Retrieves the summary of trading in the market for the last 24 hours.

func (*MarketClient) GetLast24hCandlestickAskBid

func (client *MarketClient) GetLast24hCandlestickAskBid(symbol string) (*market.CandlestickAskBid, error)

Retrieves the latest ticker with some important 24h aggregated market data.

func (*MarketClient) GetLatestTrade

func (client *MarketClient) GetLatestTrade(symbol string) (*market.TradeTick, error)

Retrieves the latest trade with its price, volume, and direction.

func (*MarketClient) Init

func (p *MarketClient) Init(host string) *MarketClient

Initializer

type OrderClient

type OrderClient struct {
	// contains filtered or unexported fields
}

Responsible to operate on order

func (*OrderClient) CancelOrderByClientOrderId

func (p *OrderClient) CancelOrderByClientOrderId(clientOrderId string) (*order.CancelOrderByClientResponse, error)

Cancel an order by client order id

func (*OrderClient) CancelOrderById

func (p *OrderClient) CancelOrderById(orderId string) (*order.CancelOrderByIdResponse, error)

Cancel an order by order id

func (*OrderClient) CancelOrdersByCriteria

Submit cancellation for multiple orders at once with given criteria.

func (*OrderClient) CancelOrdersByIds

Submit cancellation for multiple orders at once with given ids

func (*OrderClient) GetHistoryOrders

func (p *OrderClient) GetHistoryOrders(request *model.GetRequest) (*order.GetHistoryOrdersResponse, error)

Returns orders based on a specific searching criteria.

func (*OrderClient) GetLast48hOrders

func (p *OrderClient) GetLast48hOrders(request *model.GetRequest) (*order.GetHistoryOrdersResponse, error)

Returns orders based on a specific searching criteria (within 48 hours)

func (*OrderClient) GetMatchResultsByCriteria

func (p *OrderClient) GetMatchResultsByCriteria(request *model.GetRequest) (*order.GetMatchResultsResponse, error)

Returns the match results of past and open orders based on specific search criteria.

func (*OrderClient) GetMatchResultsById

func (p *OrderClient) GetMatchResultsById(orderId string) (*order.GetMatchResultsResponse, error)

Returns the match result of an order.

func (*OrderClient) GetOpenOrders

func (p *OrderClient) GetOpenOrders(request *model.GetRequest) (*order.GetOpenOrdersResponse, error)

Returns all open orders which have not been filled completely.

func (*OrderClient) GetOrderByCriteria

func (p *OrderClient) GetOrderByCriteria(request *model.GetRequest) (*order.GetOrderResponse, error)

Returns the detail of one order by client order id

func (*OrderClient) GetOrderById

func (p *OrderClient) GetOrderById(orderId string) (*order.GetOrderResponse, error)

Returns the detail of one order by order id

func (*OrderClient) GetTransactFeeRate

func (p *OrderClient) GetTransactFeeRate(request *model.GetRequest) (*order.GetTransactFeeRateResponse, error)

Returns the current transaction fee rate applied to the user.

func (*OrderClient) Init

func (p *OrderClient) Init(accessKey string, secretKey string, host string) *OrderClient

Initializer

func (*OrderClient) PlaceOrder

func (p *OrderClient) PlaceOrder(request *order.PlaceOrderRequest) (*order.PlaceOrderResponse, error)

Place a new order and send to the exchange to be matched.

func (*OrderClient) PlaceOrders

func (p *OrderClient) PlaceOrders(request []order.PlaceOrderRequest) (*order.PlaceOrdersResponse, error)

Place multipler orders (at most 10 orders)

type StableCoinClient

type StableCoinClient struct {
	// contains filtered or unexported fields
}

Responsible to operate wallet

func (*StableCoinClient) ExchangeStableCoin

func (p *StableCoinClient) ExchangeStableCoin(quoteId string) (*stablecoin.ExchangeStableCoinResponse, error)

Exchange stable coin

func (*StableCoinClient) GetExchangeRate

func (p *StableCoinClient) GetExchangeRate(currency string, amount string, exchangeType string) (*stablecoin.GetExchangeRateResponse, error)

Get stable coin exchange rate

func (*StableCoinClient) Init

func (p *StableCoinClient) Init(accessKey string, secretKey string, host string) *StableCoinClient

Initializer

type SubUserClient

type SubUserClient struct {
	// contains filtered or unexported fields
}

Responsible to operate wallet

func (*SubUserClient) CreateSubUser

func (p *SubUserClient) CreateSubUser(request subuser.CreateSubUserRequest) ([]subuser.UserData, error)

Parent user query sub user deposit address of corresponding chain, for a specific crypto currency (except IOTA)

func (*SubUserClient) GetSubUserAccount

func (p *SubUserClient) GetSubUserAccount(subUid int64) ([]account.SubUserAccount, error)

Returns the balance of a sub-account specified by sub-uid

func (*SubUserClient) GetSubUserAggregateBalance

func (p *SubUserClient) GetSubUserAggregateBalance() ([]account.Balance, error)

Returns the aggregated balance from all the sub-users

func (*SubUserClient) GetSubUserDepositAddress

func (p *SubUserClient) GetSubUserDepositAddress(subUid int64, currency string) ([]wallet.DepositAddress, error)

Parent user query sub user deposit address of corresponding chain, for a specific crypto currency (except IOTA)

func (*SubUserClient) GetUid

func (p *SubUserClient) GetUid() (int64, error)

func (*SubUserClient) Init

func (p *SubUserClient) Init(accessKey string, secretKey string, host string) *SubUserClient

Initializer

func (*SubUserClient) QuerySubUserDepositHistory

func (p *SubUserClient) QuerySubUserDepositHistory(subUid int64, optionalRequest subuser.QuerySubUserDepositHistoryOptionalRequest) ([]subuser.DepositHistory, error)

Parent user query sub user deposits history

func (*SubUserClient) SetSubUserTradableMarket

func (p *SubUserClient) SetSubUserTradableMarket(request subuser.SetSubUserTradableMarketRequest) ([]subuser.TradableMarket, error)

Set Tradable Market for Sub Users

func (*SubUserClient) SetSubUserTransferability

func (p *SubUserClient) SetSubUserTransferability(request subuser.SetSubUserTransferabilityRequest) ([]subuser.Transferability, error)

Set Asset Transfer Permission for Sub Users

func (*SubUserClient) SubUserManagement

Lock or unlock a specific user

func (*SubUserClient) SubUserTransfer

func (p *SubUserClient) SubUserTransfer(request subuser.SubUserTransferRequest) (string, error)

Transfer asset between parent and sub account

type WalletClient

type WalletClient struct {
	// contains filtered or unexported fields
}

Responsible to operate wallet

func (*WalletClient) CancelWithdraw

func (p *WalletClient) CancelWithdraw(withdrawId int64) (int64, error)

Cancels a previously created withdraw request by its transfer id.

func (*WalletClient) CreateWithdraw

func (p *WalletClient) CreateWithdraw(request wallet.CreateWithdrawRequest) (int64, error)

Withdraw from spot trading account to an external address.

func (*WalletClient) GetDepositAddress

func (p *WalletClient) GetDepositAddress(currency string) ([]wallet.DepositAddress, error)

Get deposit address of corresponding chain, for a specific crypto currency (except IOTA)

func (*WalletClient) GetWithdrawAddress

func (p *WalletClient) GetWithdrawAddress(request *model.GetRequest) (*wallet.GetWithdrawAddressResponse, error)

Parent user to query withdraw address available for API key

func (*WalletClient) GetWithdrawQuota

func (p *WalletClient) GetWithdrawQuota(currency string) (*wallet.WithdrawQuota, error)

Query withdraw quota for currencies

func (*WalletClient) Init

func (p *WalletClient) Init(accessKey string, secretKey string, host string) *WalletClient

Initializer

func (*WalletClient) QueryDepositWithdraw

func (p *WalletClient) QueryDepositWithdraw(depositOrWithdraw string, optionalRequest wallet.QueryDepositWithdrawOptionalRequest) ([]wallet.DepositWithdraw, error)

Returns all existed withdraws and deposits and return their latest status.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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