Skip to content
Permalink
Browse files

Refactor Code, Remove Redundant Code

  • Loading branch information...
piavgh committed Feb 12, 2019
1 parent 4bd929e commit a63c0a9fc28273a40fc3c8654a03cbbed881e1e9
1 app.js
@@ -14,7 +14,6 @@ app.use(logger('dev'))
app.use(express.json())
app.use(express.urlencoded({ extended: false }))
app.use(cookieParser())
app.use(express.static(path.join(__dirname, 'public')))

app.use('/', indexRouter)

@@ -1,12 +1,12 @@
import { BASE_URL, tokenAddresses, exchangeAddress } from '../config'
import { exchangeAddress } from '../config'
import { sendToServer } from '../utils/socket'
import { createLocalWalletSigner, createRawOrder } from '../utils/signer'
import { fetchPair } from '../services/fetchPair'
import { getPair } from './getPair'

export const prepareOrderParams = async (amount, price, side) => {
const signer = await createLocalWalletSigner()
const userAddress = await signer.getAddress()
const pair = await fetchPair()
const pair = await getPair()

const {
makeFee,
@@ -30,7 +30,7 @@ export const prepareOrderParams = async (amount, price, side) => {
return order
}

export const createOrder = async (order, baseToken = null, quoteToken = null) => {
export const createOrder = async (order) => {
try {
const createOrderMessage = {
channel: 'orders',
@@ -2,7 +2,7 @@ import axios from 'axios'

import { BASE_URL, tokenAddresses } from '../config'

export const fetchOrderBook = async (baseToken = null, quoteToken = null) => {
export const getOrderBook = async (baseToken = null, quoteToken = null) => {
try {
baseToken = baseToken || tokenAddresses.ETH
quoteToken = quoteToken || tokenAddresses.TOMO
@@ -2,7 +2,7 @@ import axios from 'axios'

import { BASE_URL, tokenAddresses } from '../config'

export const fetchPair = async (baseToken = null, quoteToken = null) => {
export const getPair = async (baseToken = null, quoteToken = null) => {
try {
baseToken = baseToken || tokenAddresses.ETH
quoteToken = quoteToken || tokenAddresses.TOMO

0 comments on commit a63c0a9

Please sign in to comment.
You can’t perform that action at this time.