Overview
Oanda Rest is a api wrapper for oanda rest-v20 with got serving as underlying HTTP requests library
Getting started
Requires NodeJS >= v4
$ npm install @terryx/oanda-rest
Usage
const OandaRest = require('@terryx/oanda-rest')
const api = OandaRest({
accountID: 'OANDA_ACCOUNT_ID',
endpoint: 'https://api-fxpractice.oanda.com',
apiKey: 'API_KEY'
})
api.accounts().then(res => {
// account details
console.log(res.account)
})
API
api.accounts()
api.accountsSummary()
api.accountsInstruments()
api.createOrder(OrderRequest)
api.cancelOrder(OrderID)
api.instrumentsCandles = (InstrumentName, additionalParams = {})
api.instrumentsPrice = (additionalParams = {})