getTicker

Returns the latest ticker indicators.

getTicker(pair: String?)
Parameters
pair (String? = '') Currency pair e.g. XBTZAR
Example
client.getTicker().then(console.log).catch(console.log)

getAllTickers

Returns the latest ticker indicators from all active Luno exchanges.

getAllTickers()
Example
client.getAllTickers().then(console.log).catch(console.log)

getOrderBook

Returns a list of bids and asks in the order book

getOrderBook(pair: String?)
Parameters
pair (String? = '') Currency pair e.g. XBTZAR
Example
client.getOrderBook().then(console.log).catch(console.log)

getTrades

Returns a list of the most recent trades. At most 100 results are returned per call.

getTrades(since: (Number | String | Date)?, pair: String?)
Parameters
since ((Number | String | Date)?) Fetch trades executed after this time
pair (String? = '') Currency pair e.g. XBTZAR
Example
client.getTrades(new Date('7/7/7')).then(console.log).catch(console.log)

createAccount

Create an additional account for the specified currency.

createAccount(name: String, currency: String)
Parameters
name (String = '') The label to use for this account e.g. "Trading ACC"
currency (String = '') The currency code for the account you want to create e.g. XBT, IDR, MYR, ZAR

getBalances

Return the list of all accounts and their respective balances.

getBalances()
Example
client.getBalances().then(console.log).catch(console.log)

getTransactions

Return a list of transaction entries from an account. By default fetches the 100 most recent rows.

getTransactions(id: (String | Number), minRow: (String | Number)?, maxRow: (String | Number)?)
Parameters
id ((String | Number) = '') Account ID
minRow ((String | Number)? = -100) Minimum of the row range to return (inclusive)
maxRow ((String | Number)? = 0) Maximum of the row range to return (exclusive)

getPendingTransactions

Return a list of all pending transactions related to the account.

getPendingTransactions(id: (String | Number))
Parameters
id ((String | Number) = '') Account ID

getOrderList

Returns a list of the most recently placed orders

getOrderList(state: String?, pair: String?)
Parameters
state (String?) Filter to only orders of this state e.g. PENDING
pair (String?) Filter to only orders of this currency pair e.g. XBTZAR

postOrder

Create a new trade order.

postOrder(type: String, volume: (String | Number), price: (String | Number), pair: String?)
Parameters
type (String = '') "BID" for a bid (buy) limit order or "ASK" for an ask (sell) limit order
volume ((String | Number) = '') Amount of Bitcoin to buy or sell as a decimal string in units of BTC e.g. "1.423"
price ((String | Number) = '') Limit price as a decimal string in units of ZAR/BTC e.g. "1200".
pair (String? = '') The currency pair to trade e.g. XBTZAR

postMarketOrder

Create a new market order.

postMarketOrder(type: String, volume: String, pair: String)
Parameters
type (String = '') "BUY" to buy bitcoin, or "SELL" to sell bitcoin
volume (String = '') For a "BUY" order: amount of local currency (e.g. ZAR, MYR) to spend as a decimal string in units of the local currency e.g. "100.50". For a "SELL" order: amount of Bitcoin to sell as a decimal string in units of BTC e.g. "1.423".
pair (String) The currency pair to trade e.g. XBTZAR

stopOrder

Request to stop an order.

stopOrder(id: String)
Parameters
id (String = '') The order reference as a string e.g. BXMC2CJ7HNB88U4

getOrder

Get an order by its id.

getOrder(id: String)
Parameters
id (String = '') The order ID
Example
client.getOrder(1234).then(console.log).catch(console.log)

getTradesList

Returns a list of your recent trades for a given pair, sorted by oldest first.

getTradesList(since: Number?, limit: Number?, pair: String?)
Parameters
since (Number?) Filter to trades on or after this timestamp, e.g. 1470810728478
limit (Number?) Limit to this number of trades (min 1, max 100, default 100)
pair (String?) Filter to trades of this currency pair e.g. XBTZAR
Example
client.getTradesList(new Date('7/7/7'), 50).then(console.log).catch(console.log)

getReceiveAddress

Returns the default receive address associated with your account and the amount received via the address. You can specify an optional address parameter to return information for a non-default receive address. In the response, total_received is the total confirmed Bitcoin amount received excluding unconfirmed transactions. total_unconfirmed is the total sum of unconfirmed receive transactions.

getReceiveAddress(asset: String, address: String?)
Parameters
asset (String = '') Currency code of the asset e.g. XBT
address (String?) Specific Bitcoin address to retrieve. If not provided, the default address will be used
Example
client.getReceiveAddress('XBT').then(console.log).catch(console.log)

createReceiveAddress

Allocates a new receive address to your account. There is a rate limit of 1 address per hour, but bursts of up to 10 addresses are allowed.

createReceiveAddress(asset: String)
Parameters
asset (String = '') Currency code of the asset e.g. XBT
Example
client.createReceiveAddress('XBT').then(console.log).catch(console.log)

getFeeInfo

Returns your fees and 30 day trading volume (as of midnight) for a given pair.

getFeeInfo(pair: String?)
Parameters
pair (String? = '') Filter to trades of this currency pair e.g. XBTZAR
Example
client.getFeeInfo('XBTZAR').then(console.log).catch(console.log)

getWithdrawalRequests

Returns a list of withdrawal requests.

getWithdrawalRequests()
Example
client.getWithdrawalRequests().then(console.log).catch(console.log)

requestWithdrawal

Creates a new withdrawal request.

requestWithdrawal(type: String, amount: (String | Number), beneficiaryId: String?)
Parameters
type (String = '') Withdrawal types e.g. ZAR_EFT, NAD_EFT, KES_MPESA, MYR_IBG, IDR_LLG
amount ((String | Number)) Amount to withdraw. The currency depends on the type
beneficiaryId (String?) The beneficiary ID of the bank account the withdrawal will be paid out to. This parameter is required if you have multiple bank accounts.
Example
client.requestWithdrawal('ZAR_EFT', 1000)

getWithdrawalStatus

Returns the status of a particular withdrawal request.

getWithdrawalStatus(id: (String | Number))
Parameters
id ((String | Number)) Withdrawal ID to retrieve
Example
client.getWithdrawalStatus(1234).then(console.log).catch(console.log)

cancelWithdrawalRequest

Cancel a withdrawal request. This can only be done if the request is still in state PENDING.

cancelWithdrawalRequest(id: (String | Number))
Parameters
id ((String | Number)) ID of the withdrawal to cancel
Example
client.cancelWithdrawalRequest(1234).then(console.log).catch(console.log)

send

Send Bitcoin from your account to a Bitcoin address or email address.

send(amount: (String | Number), currency: String, address: String, description: String?, message: String?)
Parameters
amount ((String | Number) = '') Amount to send as a decimal string
currency (String = '') Currency to send e.g. XBT
address (String = '') Destination Bitcoin address or email address to send to
description (String?) Description for the transaction to record on the account statement
message (String?) Message to send to the recipient. This is only relevant when sending to an email address
Example
client.send(1000, 'XBT', 'foo@bar.com')

createQuote

Creates a new quote to buy or sell a particular amount.

createQuote(type: String, amount: (String | Number), pair: String?)
Parameters
type (String = '') Possible types: BUY, SELL
amount ((String | Number) = '') Amount to buy or sell in the pair base currency
pair (String? = '') Currency pair to trade e.g. XBTZAR, XBTMYR. The pair can also be flipped if you want to buy or sell the counter currency (e.g. ZARXBT)
Example
client.createQuote('BUY', 1000).then(console.log).catch(console.log)

getQuote

Get the latest status of a quote.

getQuote(id: String)
Parameters
id (String = '') ID of the quote to retrieve
Example
client.getQuote(1234).then(console.log).catch(console.log)

exerciseQuote

Exercise a quote to perform the trade. If there is sufficient balance available in your account, it will be debited and the counter amount credited. An error is returned if the quote has expired or if you have insufficient available balance.

exerciseQuote(id: String)
Parameters
id (String = '') ID of the quote to exercise
Example
client.exerciseQuote(1234).then(console.log).catch(console.log)

discardQuote

Discard a quote. Once a quote has been discarded, it cannot be exercised even if it has not expired yet.

discardQuote(id: String)
Parameters
id (String = '') ID of the quote to discard
Example
client.discardQuote(1234).then(console.log).catch(console.log)