Skip to content

Commit

Permalink
Fix wallet routes
Browse files Browse the repository at this point in the history
  • Loading branch information
notVitaliy committed Sep 9, 2018
1 parent bbbd79a commit 8743f73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/core/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Core {

if (hasExchange !== true) return hasExchange

return WalletStore.instance.getWallet({ exchange, symbol, strategy })
return WalletStore.instance.loadWallet({ exchange, symbol, strategy })
}

public async adjustWallet({ exchange, symbol, strategy, asset, currency }) {
Expand Down
10 changes: 5 additions & 5 deletions src/server/routes/strategy/strategy.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export class StrategyRouter extends BaseRouter {
res.send(result)
})

this.router.get('/list', async (req, res) => {
const result = await core.listStrategies()
res.send(result)
})

this.router.post('/', async ({ body }, res) => {
const result = await core.addStrategy(body)
res.send(result)
Expand All @@ -35,11 +40,6 @@ export class StrategyRouter extends BaseRouter {
res.send(result)
})

this.router.get('/list', async (req, res) => {
const result = await core.listStrategies()
res.send(result)
})

this.router.post('/start', async ({ body }, res) => {
const result = await core.startStrategy(body)
res.send(result)
Expand Down
6 changes: 3 additions & 3 deletions src/server/routes/strategy/wallet/wallet.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export class WalletRouter extends BaseRouter {
private constructor() {
super()

this.router.get('/', async ({ body }, res) => {
const result = await core.getWallet(body)
res.send(result)
this.router.get('/', async ({ query: { exchange, symbol, strategy } }, res) => {
const result = await core.getWallet({ exchange, symbol, strategy })
res.send(result ? result : { asset: 0, currency: 0 })
})

this.router.put('/', async ({ body }, res) => {
Expand Down

0 comments on commit 8743f73

Please sign in to comment.