import Exchange from './abstract/poloniex.js'; import type { TransferEntry, Int, Leverage, OrderSide, OrderType, OrderRequest, OHLCV, Trade, OrderBook, Order, Balances, Str, MarginModification, Transaction, Ticker, Tickers, Market, Strings, Currency, CurrencyInterface, Num, Currencies, TradingFees, Dict, int, DepositAddress, Position, NullableDict, DepositWithdrawFees, PositionModeInfo } from './base/types.js'; /** * @class poloniex * @augments Exchange */ export default class poloniex extends Exchange { describe(): any; parseOHLCV(ohlcv: any, market?: Market): OHLCV; /** * @method * @name poloniex#fetchOHLCV * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market * @see https://api-docs.poloniex.com/spot/api/public/market-data#candles * @see https://api-docs.poloniex.com/v3/futures/api/market/get-kline-data * @param {string} symbol unified symbol of the market to fetch OHLCV data for * @param {string} timeframe the length of time each candle represents * @param {int} [since] timestamp in ms of the earliest candle to fetch * @param {int} [limit] the maximum amount of candles to fetch * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {int} [params.until] timestamp in ms * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume */ fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: Dict): Promise; loadMarkets(reload?: boolean, params?: Dict): Promise>; /** * @method * @name poloniex#fetchMarkets * @description retrieves data on all markets for poloniex * @see https://api-docs.poloniex.com/spot/api/public/reference-data#symbol-information * @see https://api-docs.poloniex.com/v3/futures/api/market/get-all-product-info * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object[]} an array of objects representing market data */ fetchMarkets(params?: Dict): Promise; fetchSpotMarkets(params?: Dict): Promise; fetchSwapMarkets(params?: Dict): Promise; parseMarket(market: Dict): Market; parseSpotMarket(market: Dict): Market; parseSwapMarket(market: Dict): Market; /** * @method * @name poloniex#fetchTime * @description fetches the current integer timestamp in milliseconds from the exchange server * @see https://api-docs.poloniex.com/spot/api/public/reference-data#system-timestamp * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {int} the current integer timestamp in milliseconds from the exchange server */ fetchTime(params?: Dict): Promise; parseTicker(ticker: Dict, market?: Market): Ticker; /** * @method * @name poloniex#fetchTickers * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market * @see https://api-docs.poloniex.com/spot/api/public/market-data#ticker * @see https://api-docs.poloniex.com/v3/futures/api/market/get-market-info * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/?id=ticker-structure} */ fetchTickers(symbols?: Strings, params?: Dict): Promise; /** * @method * @name poloniex#fetchCurrencies * @description fetches all available currencies on an exchange * @see https://api-docs.poloniex.com/spot/api/public/reference-data#currencyv2-information * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an associative dictionary of currencies */ fetchCurrencies(params?: Dict): Promise; parseCurrency(currency: Dict): CurrencyInterface; /** * @method * @name poloniex#fetchTicker * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market * @see https://api-docs.poloniex.com/spot/api/public/market-data#ticker * @see https://api-docs.poloniex.com/v3/futures/api/market/get-market-info * @param {string} symbol unified symbol of the market to fetch the ticker for * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure} */ fetchTicker(symbol: string, params?: Dict): Promise; parseTrade(trade: Dict, market?: Market): Trade; /** * @method * @name poloniex#fetchTrades * @description get the list of most recent trades for a particular symbol * @see https://api-docs.poloniex.com/spot/api/public/market-data#trades * @see https://api-docs.poloniex.com/v3/futures/api/market/get-execution-info * @param {string} symbol unified symbol of the market to fetch trades for * @param {int} [since] timestamp in ms of the earliest trade to fetch * @param {int} [limit] the maximum amount of trades to fetch * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades} */ fetchTrades(symbol: string, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name poloniex#fetchMyTrades * @description fetch all trades made by the user * @see https://api-docs.poloniex.com/spot/api/private/trade#trade-history * @see https://api-docs.poloniex.com/v3/futures/api/trade/get-execution-details * @param {string} symbol unified market symbol * @param {int} [since] the earliest time in ms to fetch trades for * @param {int} [limit] the maximum number of trades structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {int} [params.until] the latest time in ms to fetch entries for * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure} */ fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; parseOrderStatus(status: Str): Str; parseOrder(order: Dict, market?: Market): Order; parseOrderType(status: Str): Str; parseOpenOrders(orders: Dict[], market: Market, result: Order[]): Order[]; /** * @method * @name poloniex#fetchOpenOrders * @description fetch all unfilled currently open orders * @see https://api-docs.poloniex.com/spot/api/private/order#open-orders * @see https://api-docs.poloniex.com/spot/api/private/smart-order#open-orders // trigger orders * @see https://api-docs.poloniex.com/v3/futures/api/trade/get-current-orders * @param {string} symbol unified market symbol * @param {int} [since] the earliest time in ms to fetch open orders for * @param {int} [limit] the maximum number of open orders structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.trigger] set true to fetch trigger orders instead of regular orders * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name poloniex#fetchClosedOrders * @see https://api-docs.poloniex.com/v3/futures/api/trade/get-order-history * @description fetches information on multiple closed orders made by the user * @param {string} symbol unified market symbol of the market orders were made in * @param {int} [since] the earliest time in ms to fetch orders for * @param {int} [limit] the maximum number of order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {int} [params.until] timestamp in ms of the latest entry * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name poloniex#createOrder * @description create a trade order * @see https://api-docs.poloniex.com/spot/api/private/order#create-order * @see https://api-docs.poloniex.com/spot/api/private/smart-order#create-order // trigger orders * @param {string} symbol unified symbol of the market to create an order in * @param {string} type 'market' or 'limit' * @param {string} side 'buy' or 'sell' * @param {float} amount how much of currency you want to trade in units of base currency * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount * @param {string} [params.clientOrderId] a unique identifier for the order * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: Dict): Promise; /** * @method * @name poloniex#createOrders * @description create a list of trade orders, all orders must be of the same market type, either spot or swap * @see https://api-docs.poloniex.com/spot/api/private/order#create-multiple-orders * @see https://api-docs.poloniex.com/v3/futures/api/trade/place-multiple-orders * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params * @param {object} [params] extra parameters specific to the exchange API endpoint, applied to every order * @param {string} [params.marginMode] *swap only* 'cross' or 'isolated', defaults to 'cross' * @param {string} [params.posSide] *swap only* 'LONG', 'SHORT' or 'BOTH', defaults to 'BOTH', the batch endpoint requires it explicitly * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ createOrders(orders: OrderRequest[], params?: {}): Promise; orderRequest(symbol: string, type: OrderType, side: OrderSide, amount: Num, request: Dict, price?: Num, params?: Dict): [Dict, Dict]; /** * @method * @name poloniex#editOrder * @description edit a trade order * @see https://api-docs.poloniex.com/spot/api/private/order#cancel-replace-order * @see https://api-docs.poloniex.com/spot/api/private/smart-order#cancel-replace-order * @param {string} id order id * @param {string} symbol unified symbol of the market to create an order in * @param {string} type 'market' or 'limit' * @param {string} side 'buy' or 'sell' * @param {float} [amount] how much of the currency you want to trade in units of the base currency * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at * @param {string} [params.clientOrderId] a unique identifier for the order * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: Dict): Promise; cancelOrder(id: string, symbol?: Str, params?: Dict): Promise; /** * @method * @name poloniex#cancelOrders * @description cancel multiple orders * @see https://api-docs.poloniex.com/spot/api/private/order#cancel-multiple-orders-by-ids * @see https://api-docs.poloniex.com/v3/futures/api/trade/cancel-multiple-orders * @param {string[]} ids order ids * @param {string} [symbol] unified market symbol, required for swap markets * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string[]} [params.clientOrderIds] alternative to ids, cancel by client order ids * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise; /** * @method * @name poloniex#cancelAllOrders * @description cancel all open orders * @see https://api-docs.poloniex.com/spot/api/private/order#cancel-all-orders * @see https://api-docs.poloniex.com/spot/api/private/smart-order#cancel-all-orders // trigger orders * @see https://api-docs.poloniex.com/v3/futures/api/trade/cancel-all-orders - contract markets * @param {string} [symbol] unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.trigger] true if canceling trigger orders * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure} */ cancelAllOrders(symbol?: Str, params?: Dict): Promise; /** * @method * @name poloniex#fetchOrder * @description fetch an order by it's id * @see https://api-docs.poloniex.com/spot/api/private/order#order-details * @see https://api-docs.poloniex.com/spot/api/private/smart-order#open-orders // trigger orders * @param {string} id order id * @param {string} symbol unified market symbol, default is undefined * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.trigger] true if fetching a trigger order * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} */ fetchOrder(id: string, symbol?: Str, params?: Dict): Promise; fetchOrderStatus(id: string, symbol?: Str, params?: Dict): Promise<"closed" | "open">; /** * @method * @name poloniex#fetchOrderTrades * @description fetch all the trades made from a single order * @see https://api-docs.poloniex.com/spot/api/private/trade#trades-by-order-id * @param {string} id order id * @param {string} symbol unified market symbol * @param {int} [since] the earliest time in ms to fetch trades for * @param {int} [limit] the maximum number of trades to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure} */ fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: Dict): Promise; parseBalance(response: any): Balances; /** * @method * @name poloniex#fetchBalance * @description query for balance and get the amount of funds available for trading or funds locked in orders * @see https://api-docs.poloniex.com/spot/api/private/account#all-account-balances * @see https://api-docs.poloniex.com/v3/futures/api/account/balance * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure} */ fetchBalance(params?: Dict): Promise; /** * @method * @name poloniex#fetchTradingFees * @description fetch the trading fees for multiple markets * @see https://api-docs.poloniex.com/spot/api/private/account#fee-info * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure} indexed by market symbols */ fetchTradingFees(params?: Dict): Promise; /** * @method * @name poloniex#fetchOrderBook * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data * @see https://api-docs.poloniex.com/spot/api/public/market-data#order-book * @see https://api-docs.poloniex.com/v3/futures/api/market/get-order-book * @param {string} symbol unified symbol of the market to fetch the order book for * @param {int} [limit] the maximum amount of order book entries to return * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [order book structure]{@link https://docs.ccxt.com/?id=order-book-structure} */ fetchOrderBook(symbol: string, limit?: Int, params?: Dict): Promise; /** * @method * @name poloniex#createDepositAddress * @description create a currency deposit address * @see https://api-docs.poloniex.com/spot/api/private/wallet#deposit-addresses * @param {string} code unified currency code of the currency for the deposit address * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [address structure]{@link https://docs.ccxt.com/?id=address-structure} */ createDepositAddress(code: string, params?: Dict): Promise; /** * @method * @name poloniex#fetchDepositAddress * @description fetch the deposit address for a currency associated with this account * @see https://api-docs.poloniex.com/spot/api/private/wallet#deposit-addresses * @param {string} code unified currency code * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [address structure]{@link https://docs.ccxt.com/?id=address-structure} */ fetchDepositAddress(code: string, params?: Dict): Promise; prepareRequestForDepositAddress(code: string, params?: Dict): any; parseDepositAddressSpecial(response: Dict, currency: any, networkEntry: Dict): DepositAddress; /** * @method * @name poloniex#transfer * @description transfer currency internally between wallets on the same account * @see https://api-docs.poloniex.com/spot/api/private/account#accounts-transfer * @param {string} code unified currency code * @param {float} amount amount to transfer * @param {string} fromAccount account to transfer from * @param {string} toAccount account to transfer to * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/?id=transfer-structure} */ transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: Dict): Promise; parseTransfer(transfer: Dict, currency?: Currency): TransferEntry; /** * @method * @name poloniex#withdraw * @description make a withdrawal * @see https://api-docs.poloniex.com/spot/api/private/wallet#withdraw-currency * @param {string} code unified currency code * @param {float} amount the amount to withdraw * @param {string} address the address to withdraw to * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.tag] memo / destination tag, required for currencies in options['withdrawTagRequiredCurrencies'] * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/?id=transaction-structure} */ withdraw(code: string, amount: number, address: string, params?: Dict): Promise; fetchTransactionsHelper(code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name poloniex#fetchDepositsWithdrawals * @description fetch history of deposits and withdrawals * @see https://api-docs.poloniex.com/spot/api/private/wallet#wallets-activity-records * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/?id=transaction-structure} */ fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name poloniex#fetchWithdrawals * @description fetch all withdrawals made from an account * @see https://api-docs.poloniex.com/spot/api/private/wallet#wallets-activity-records * @param {string} code unified currency code * @param {int} [since] the earliest time in ms to fetch withdrawals for * @param {int} [limit] the maximum number of withdrawals structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure} */ fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; /** * @method * @name poloniex#fetchDepositWithdrawFees * @description fetch deposit and withdraw fees * @see https://api-docs.poloniex.com/spot/api/public/reference-data#currency-information * @param {string[]|undefined} codes list of unified currency codes * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/?id=fee-structure} */ fetchDepositWithdrawFees(codes?: Strings, params?: Dict): Promise; parseDepositWithdrawFees(response: any, codes?: Strings, currencyIdKey?: Str): any; parseDepositWithdrawFee(fee: any, currency?: Currency): any; /** * @method * @name poloniex#fetchDeposits * @description fetch all deposits made to an account * @see https://api-docs.poloniex.com/spot/api/private/wallet#wallets-activity-records * @param {string} code unified currency code * @param {int} [since] the earliest time in ms to fetch deposits for * @param {int} [limit] the maximum number of deposits structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure} */ fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: Dict): Promise; parseTransactionStatus(status: Str): Str; parseTransaction(transaction: Dict, currency?: Currency): Transaction; /** * @method * @name poloniex#setLeverage * @description set the level of leverage for a market * @see https://api-docs.poloniex.com/v3/futures/api/positions/set-leverage * @param {int} leverage the rate of leverage * @param {string} symbol unified market symbol * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.marginMode] 'cross' or 'isolated' * @returns {object} response from the exchange */ setLeverage(leverage: int, symbol?: Str, params?: Dict): Promise; /** * @method * @name poloniex#fetchLeverage * @description fetch the set leverage for a market * @see https://api-docs.poloniex.com/v3/futures/api/positions/get-leverages * @param {string} symbol unified market symbol * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [leverage structure]{@link https://docs.ccxt.com/?id=leverage-structure} */ fetchLeverage(symbol: string, params?: Dict): Promise; parseLeverage(leverage: Dict, market?: Market): Leverage; /** * @method * @name poloniex#fetchPositionMode * @description fetches the position mode, hedged or one way, hedged is set identically for all linear markets or all inverse markets * @see https://api-docs.poloniex.com/v3/futures/api/positions/position-mode-switch * @param {string} [symbol] unified symbol of the market to fetch the position mode for (not used by fetchPositionMode) * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an object detailing whether the market is in hedged or one-way mode */ fetchPositionMode(symbol?: Str, params?: Dict): Promise; /** * @method * @name poloniex#setPositionMode * @description set hedged to true or false for a market * @see https://api-docs.poloniex.com/v3/futures/api/positions/position-mode-switch * @param {bool} hedged set to true to use the hedged position mode * @param {string} symbol not used by setPositionMode () * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} response from the exchange */ setPositionMode(hedged: boolean, symbol?: Str, params?: Dict): Promise; /** * @method * @name poloniex#fetchPositions * @description fetch all open positions * @see https://api-docs.poloniex.com/v3/futures/api/positions/get-current-position * @param {string[]|undefined} symbols list of unified market symbols * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.standard] whether to fetch standard contract positions * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/?id=position-structure} */ fetchPositions(symbols?: Strings, params?: Dict): Promise; parsePosition(position: Dict, market?: Market): Position; modifyMarginHelper(symbol: string, amount: any, type: string, params?: Dict): Promise; parseMarginModification(data: Dict, market?: Market): MarginModification; /** * @method * @name poloniex#reduceMargin * @description remove margin from a position * @param {string} symbol unified market symbol * @param {float} amount the amount of margin to remove * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [margin structure]{@link https://docs.ccxt.com/?id=margin-structure} */ reduceMargin(symbol: string, amount: number, params?: Dict): Promise; /** * @method * @name poloniex#addMargin * @description add margin * @param {string} symbol unified market symbol * @param {float} amount amount of margin to add * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [margin structure]{@link https://docs.ccxt.com/?id=margin-structure} */ addMargin(symbol: string, amount: number, params?: Dict): Promise; nonce(): number; sign(path: string, api?: string, method?: string, params?: Dict, headers?: NullableDict, body?: Str): Dict; handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): undefined; }