Skip to content

Commit

Permalink
style(*): webstorm auto reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
benmarten committed Jan 9, 2018
1 parent b73adaa commit b88b3e7
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 33 deletions.
2 changes: 0 additions & 2 deletions src/Utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import colors from 'colors';

export default class Utils {
static pad(width, string, padding) {
return (width <= string.length) ? string : this.pad(width, padding + string, padding)
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ async function refreshPortfolio() {

for (let account in Settings.accounts) {
let name = Utils.capitalize(account)
let Wallet;
let Wallet
try {
Wallet = require(`./model/integrations/${name}Wallet`).default;
Wallet = require(`./model/integrations/${name}Wallet`).default
} catch (ignored) {
console.log(`Warning: Integration for Exchange: ${name} not found!`)
continue
Expand Down
16 changes: 7 additions & 9 deletions src/model/integrations/AbstractWallet.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@

export default class AbstractWallet {

/**
* @param credentials The bittrex api credentials.
* @param credentials The api credentials.
*/
constructor(credentials) {
this.credentials = credentials
}

/**
* Returns the balances for this account
*
* @return {Promise} The account balances.
*/
getBalance() {
return this.constructor._getBalanceForCredential(this.credentials)
static _getBalanceForCredential(credentials) {
throw new Error('Method _getBalanceForCredential() is not implemented!')
}

/**
* Returns the balances for this account
*
* @return {Promise} The account balances.
*/
static _getBalanceForCredential(credentials) {
throw new Error('Method _getBalanceForCredential() is not implemented!')
getBalance() {
return this.constructor._getBalanceForCredential(this.credentials)
}
}
3 changes: 1 addition & 2 deletions src/model/integrations/BinanceWallet.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from '../Coin'
// noinspection NpmUsedModulesInstalled
import Binance from 'binance'

export default class BinanceWallet extends AbstractWallet {

/**
* Returns the balances for a bittrex account.
* @param credential The bittrex api credentials.
Expand Down
3 changes: 1 addition & 2 deletions src/model/integrations/BitfinexWallet.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from '../Coin'
// noinspection NpmUsedModulesInstalled
import Bitfinex from 'bitfinex'

export default class BitfinexWallet extends AbstractWallet {

/**
* Returns the balances for a Bitfinex account.
* @param credential The Bitfinex api credentials.
Expand Down
5 changes: 2 additions & 3 deletions src/model/integrations/BitgrailWallet.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from '../Coin'
import request from 'request-promise'
import crypto from 'crypto'
import querystring from 'querystring'

export default class BitgrailWallet extends AbstractWallet{

export default class BitgrailWallet extends AbstractWallet {
/**
* Returns the balances for a Bitgrail account.
* @param credential The Bitgrail api credentials.
Expand Down
4 changes: 1 addition & 3 deletions src/model/integrations/BittrexWallet.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from '../Coin'
// noinspection NpmUsedModulesInstalled
import Bittrex from 'node-bittrex-api'

export default class BittrexWallet extends AbstractWallet {


/**
* Returns the balances for a bittrex account.
* @param credential The bittrex api credentials.
Expand Down
3 changes: 1 addition & 2 deletions src/model/integrations/CoinbaseWallet.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from '../Coin'
// noinspection NpmUsedModulesInstalled
const Coinbase = require('coinbase').Client

export default class CoinbaseWallet extends AbstractWallet {

/**
* Returns the balances for a coinbase account.
* @param credential The coinbase api credentials.
Expand Down
3 changes: 1 addition & 2 deletions src/model/integrations/GdaxWallet.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from '../Coin'
// noinspection NpmUsedModulesInstalled
const Gdax = require('gdax').AuthenticatedClient

export default class GdaxWallet extends AbstractWallet {

/**
* Returns the balances for a GDAX account.
* @param credential The GDAX API credentials.
Expand Down
3 changes: 1 addition & 2 deletions src/model/integrations/HitbtcWallet.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from './../Coin'
import request from 'requestretry'

export default class HitbtcWallet extends AbstractWallet {

/**
* Returns the balances for a HitBTC account.
* @param credential The HitBTC api credentials.
Expand Down
3 changes: 1 addition & 2 deletions src/model/integrations/KrakenWallet.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from '../Coin'
// noinspection NpmUsedModulesInstalled
import KrakenClient from 'kraken-api'

export default class KrakenWallet extends AbstractWallet {

/**
* Returns the balances for a Kraken account.
* @param credential The Kraken api credentials.
Expand Down
3 changes: 1 addition & 2 deletions src/model/integrations/PoloniexWallet.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import AbstractWallet from "./AbstractWallet"
import AbstractWallet from './AbstractWallet'
import Coin from '../Coin'
// noinspection NpmUsedModulesInstalled
import Poloniex from 'poloniex-api-node'

export default class PoloniexWallet extends AbstractWallet {

/**
* @param credential.apiKey The api key.
* @param credential.apiSecret The api secret.
Expand Down

0 comments on commit b88b3e7

Please sign in to comment.