Skip to content

Commit

Permalink
fix(brokerage): add some todos for converting strings to enums later …
Browse files Browse the repository at this point in the history
…and removed some commented code
  • Loading branch information
blockdylanb committed Jun 3, 2021
1 parent 75c5aa1 commit 4e7f151
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ export const interpolatePrice = (
amount: BigNumber
): number | string => {
try {
// if (thisPrice.isGreaterThan(nextPrice)) throw new Error('Should be sorted')
// if (thisVol.isGreaterThan(nextVol)) throw new Error('Should be sorted')
// if (amount.isLessThan(thisVol) && amount.isGreaterThan(nextVol))
// throw new Error('Amount should be between x[0] and x[1]')

return amount
.minus(thisVol)
.times(nextPrice.minus(thisPrice).dividedBy(nextVol.minus(thisVol)))
Expand All @@ -64,7 +59,7 @@ export const getRate = (
minor?: boolean
): number => {
try {
for (var index = 0; index <= priceTiers.length; index++) {
for (let index = 0; index <= priceTiers.length; index += 1) {
const priceTier = priceTiers[index]
if (index === priceTiers.length - 1)
return minor
Expand Down
15 changes: 3 additions & 12 deletions packages/blockchain-wallet-v4/src/network/api/simpleBuy/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { CardNameType } from 'components/Form/CreditCardBox/model'
import {
BeneficiaryType,
CoinType,
FiatType,
WalletCurrencyType
} from 'core/types'
import { BeneficiaryType, CoinType, FiatType, WalletCurrencyType } from 'core/types'
import { BankDetails } from 'data/types'

export type Everypay3DSResponseType = {
Expand Down Expand Up @@ -103,12 +98,7 @@ export type SBCardType = {

export type SBCardPartnerType = 'EVERYPAY'

export type SBCardStateType =
| 'PENDING'
| 'CREATED'
| 'ACTIVE'
| 'BLOCKED'
| 'FRAUD_REVIEW'
export type SBCardStateType = 'PENDING' | 'CREATED' | 'ACTIVE' | 'BLOCKED' | 'FRAUD_REVIEW'

export type SBPairsType = string

Expand Down Expand Up @@ -216,6 +206,7 @@ export type SBSellOrderType = ISBBuyOrderType & {
}
export type SBOrderType = SBBuyOrderType | SBSellOrderType

// TODO: refactor this into an enum
export type SBOrderStateType =
| 'PENDING_CONFIRMATION'
| 'PENDING_DEPOSIT'
Expand Down

0 comments on commit 4e7f151

Please sign in to comment.