Poloniex api market order
An (unofficial) Knot.js API client for the Poloniex cryptocurrency exchange.
The client supports both public (unauthenticated) and private (authenticated) calls to the Poloniex API.
For private calls, the user secret is never exposed to other parts of the program or over the Web. The user key is sent as a header to the API, along with a signed request.
MIT, open source. See LICENSE file.
In your app, require the module:
If not installed via NPM, then provide the path to lib/poloniex.js
In the past, the API server’s certficate was rejected. This was presumably a makeshift issue and was reported to Poloniex and immobile. Should the issue come up again, the line below is a makeshift workaround. Very first attempt using the client without this.
If only public API calls are needed, then no API key or secret is required:
Or, to use Poloniex’s trading API, your API key and secret must be provided:
All Poloniex API methods are supported (with some name switches to avoid naming collisions). All methods require a callback function.
The callback is passed two arguments:
- An error object, or null if the API request was successful
- A data object, the response from the API
For the most up-to-date API documentation, see poloniex.com/api.
These methods do not require a user key or secret.
Comes back the ticker for all markets.
Calls API method returnTicker .
Comebacks the 24-hour volume for all markets, plus totals for primary currencies.
Calls API method return24hVolume .
Comebacks the order book for a given market.
Calls API method returnOrderBook .
Comebacks candlestick chart data. Candlestick ",period", is one of 300, 900, 1800, 7200, 14400, or 86400 seconds. ",Embark", and ",end", are given in UNIX timestamp format and used to specify the date range for the data returned.
Comes back information about all currencies supported on the platform.
Comes back the list of loan offers and requests for a given currency.
These methods require the user key and secret.
Comes back all of your balances.
Calls API method returnBalances .
Comebacks all of your balances, including available balance, balance on orders, and the estimated BTC value of your balance. This call is limited to your exchange account. TODO: permit ",all", as well.
Comes back all of your deposit addresses.
Generates a fresh deposit address for the currency specified.
Comebacks your deposit and withdrawal history within a range, specified by ",commence", and ",end",, both of which should be given as UNIX timestamps.
Comes back your open orders for a given market, specified by the two given currencies.
Comes back the past 200 trades in a given market. Calls API method returnTradeHistory .
Comes back all trades involving the given order number.
Places a limit buy order in a given market.
Places a limit sell order in a given market.
Cancels an order you have placed in a given market.
Cancels an order and places a fresh one of the same type in a single atomic transaction, meaning either both operations will succeed or both will fail.
Instantly places a withdrawal for a given currency, with no email confirmation. In order to use this method, the withdrawal privilege must be enabled for your API key.
If you are enrolled in the maker-taker fee schedule, comes back your current trading fees and trailing 30-day volume in BTC. This information is updated once every 24 hours.
Comes back your balances for a specified account. Balances in a margin account may not be accessible if you have any open margin positions or orders.
Comes back the current tradable balances for each currency in each market for which margin trading is enabled. Balances may vary continually with market conditions.
Transfers funds from one account to another (e.g. from your exchange account to your margin account).
Comes back a summary of the entire margin account. This is the same information you will find in the Margin Account section of the Margin Trading page, under the Markets list.
Places a margin buy order in a given market. You may optionally specify a maximum lending rate using the ",lendingRate", parameter. If successful, the method will comeback the order number and any trades instantaneously resulting from your order.
Places a margin sell order in a given market. You may optionally specify a maximum lending rate using the ",lendingRate", parameter. If successful, the method will comeback the order number and any trades instantaneously resulting from your order.
Comes back information about the margin position in a given market. If you have no margin position in the specified market, ",type", will be set to ",none",. ",liquidationPrice", is an estimate, and does not necessarily represent the price at which an actual coerced liquidation will occur. If you have no liquidation price, the value will be -1.
Closes a margin position in a given market using a market order. This call will also comeback success if you do not have an open position in the specified market.
Creates a loan suggest for a given currency. The ",autoRenew", parameter should be a 0 or a 1.
Cancels a loan suggest specified by ",orderNumber",.
Comes back open loan offers for each currency.
Comebacks active loans for each currency.
Comes back up to ",limit", closed loans within the ",begin", and ",end", unix timestamps. (unix timestamps are voiced as numbers such as 1495681818 )
Toggles the autoRenew setting on an active loan, specified by ",orderNumber",. If successful, ",message", will indicate the fresh autoRenew setting.