ahmedsakr / wstrade-api

API Wrapper for Wealthsimple Trade

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Namespace and Rename APIs

ahmedsakr opened this issue · comments

All APIs are currently linearly defined under the exported object. A namespaced approach would allow APIs to be logically grouped under categories that they are related to.

These are the namespaced categories that I suggest and the APIs that would fall under them.

*APIs in bold are renamed to take advantage of namespacing

Current APIs Namespace new APIs
trade.login() auth trade.auth.login()
trade.refresh() auth trade.auth.refresh()
trade.addHeader() headers trade.headers.add()
trade.removeHeader() headers trade.headers.remove()
trade.clearHeaders() headers trade.headers.clear()
trade.getAccounts() accounts trade.accounts.all()
trade.getAccountData() accounts trade.accounts.data()
trade.getHistory() accounts trade.accounts.history()
trade.getAcitivites() accounts trade.accounts.activities()
trade.getBankAccounts() accounts trade.accounts.getBankAccounts()
trade.getDeposits() accounts trade.accounts.deposits()
trade.getPositions() accounts trade.accounts.positions()
trade.getOrdersByPage() orders trade.orders.page()
trade.getOrders() orders trade.orders.all()
trade.getPendingOrders() orders trade.orders.pending()
trade.getFilledOrders() orders trade.orders.filled()
trade.getCancelledOrders() orders trade.orders.cancelled()
trade.cancelOrder() orders trade.orders.cancel()
trade.cancelPendingOrders() orders trade.orders.cancelPending()
trade.placeMarketBuy() orders trade.orders.marketBuy()
trade.placeLimitBuy() orders trade.orders.limitBuy()
trade.placeStopLimitBuy() orders trade.orders.stopLimitBuy()
trade.placeMarketSell() orders trade.orders.marketSell()
trade.placeLimitSell() orders trade.orders.limitSell()
trade.placeStopLimitSell() orders trade.orders.stopLimitSell()
trade.getExchangeRates() data trade.data.exchangeRates()
trade.getSecurity() data trade.data.getSecurity()