-
Notifications
You must be signed in to change notification settings - Fork 504
/
selectors.ts
65 lines (45 loc) · 2.08 KB
/
selectors.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { RootState } from 'data/rootReducer'
export const getEverypay3DSDetails = (state: RootState) =>
state.components.simpleBuy.everypay3DS
export const getSBAccount = (state: RootState) =>
state.components.simpleBuy.account
export const getCryptoCurrency = (state: RootState) =>
state.components.simpleBuy.cryptoCurrency
export const getFiatCurrency = (state: RootState) =>
state.components.simpleBuy.fiatCurrency || state.preferences.sbFiatCurrency
export const getDefaultMethod = (state: RootState) =>
state.components.simpleBuy.defaultMethod
export const getSBBalances = (state: RootState) =>
state.components.simpleBuy.balances
export const getSBCard = (state: RootState) => state.components.simpleBuy.card
export const getSBCardId = (state: RootState) =>
state.components.simpleBuy.cardId
export const getSBCards = (state: RootState) => state.components.simpleBuy.cards
export const getSBFiatEligible = (state: RootState) =>
state.components.simpleBuy.fiatEligible
export const getSBQuote = (state: RootState) => state.components.simpleBuy.quote
export const getSBPairs = (state: RootState) => state.components.simpleBuy.pairs
export const getSBPair = (state: RootState) =>
state.components.simpleBuy.pair || {
buyMax: '',
buyMin: '',
pair: ''
}
export const getSBPaymentMethods = (state: RootState) =>
state.components.simpleBuy.methods
export const getSBProviderDetails = (state: RootState) =>
state.components.simpleBuy.providerDetails
export const getSBOrder = (state: RootState) => state.components.simpleBuy.order
export const getSBOrders = (state: RootState) =>
state.components.simpleBuy.orders
export const getSBLatestPendingOrder = (state: RootState) =>
state.components.simpleBuy.orders.getOrElse([]).find(order => {
return (
order.state === 'PENDING_CONFIRMATION' ||
order.state === 'PENDING_DEPOSIT' ||
order.state === 'DEPOSIT_MATCHED'
)
})
export const getSBSuggestedAmounts = (state: RootState) =>
state.components.simpleBuy.suggestedAmounts
export const getStep = (state: RootState) => state.components.simpleBuy.step