be-components 0.4.9 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +12 -3
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/Checkout/api/index.js +247 -0
  4. package/lib/commonjs/Checkout/api/index.js.map +1 -0
  5. package/lib/commonjs/Checkout/components/AccountSummaryCard.js +274 -0
  6. package/lib/commonjs/Checkout/components/AccountSummaryCard.js.map +1 -0
  7. package/lib/commonjs/Checkout/components/ItemSummaryCard.js +56 -0
  8. package/lib/commonjs/Checkout/components/ItemSummaryCard.js.map +1 -0
  9. package/lib/commonjs/Checkout/components/OrderSummaryCard.js +84 -0
  10. package/lib/commonjs/Checkout/components/OrderSummaryCard.js.map +1 -0
  11. package/lib/commonjs/Checkout/index.js +590 -0
  12. package/lib/commonjs/Checkout/index.js.map +1 -0
  13. package/lib/commonjs/Components/Button.js +11 -3
  14. package/lib/commonjs/Components/Button.js.map +1 -1
  15. package/lib/commonjs/Components/Checkbox.js +6 -2
  16. package/lib/commonjs/Components/Checkbox.js.map +1 -1
  17. package/lib/commonjs/Components/Icons.js +441 -4
  18. package/lib/commonjs/Components/Icons.js.map +1 -1
  19. package/lib/commonjs/Components/Spring.js +6 -5
  20. package/lib/commonjs/Components/Spring.js.map +1 -1
  21. package/lib/commonjs/LocationTracker/LocationStatus.js +95 -0
  22. package/lib/commonjs/LocationTracker/LocationStatus.js.map +1 -0
  23. package/lib/commonjs/LocationTracker/api/index.js +124 -0
  24. package/lib/commonjs/LocationTracker/api/index.js.map +1 -0
  25. package/lib/commonjs/LocationTracker/index.js +207 -0
  26. package/lib/commonjs/LocationTracker/index.js.map +1 -0
  27. package/lib/commonjs/Observer/Observer.js +2 -0
  28. package/lib/commonjs/Observer/Observer.js.map +1 -1
  29. package/lib/commonjs/Wallet/api/index.js +621 -0
  30. package/lib/commonjs/Wallet/api/index.js.map +1 -0
  31. package/lib/commonjs/Wallet/components/ACHAdd.js +63 -0
  32. package/lib/commonjs/Wallet/components/ACHAdd.js.map +1 -0
  33. package/lib/commonjs/Wallet/components/AccountCard.js +137 -0
  34. package/lib/commonjs/Wallet/components/AccountCard.js.map +1 -0
  35. package/lib/commonjs/Wallet/components/AccountLimitManager.js +321 -0
  36. package/lib/commonjs/Wallet/components/AccountLimitManager.js.map +1 -0
  37. package/lib/commonjs/Wallet/components/AccountManager.js +202 -0
  38. package/lib/commonjs/Wallet/components/AccountManager.js.map +1 -0
  39. package/lib/commonjs/Wallet/components/AccountSnoozeManager.js +260 -0
  40. package/lib/commonjs/Wallet/components/AccountSnoozeManager.js.map +1 -0
  41. package/lib/commonjs/Wallet/components/AddressCard.js +56 -0
  42. package/lib/commonjs/Wallet/components/AddressCard.js.map +1 -0
  43. package/lib/commonjs/Wallet/components/AddressManager.js +365 -0
  44. package/lib/commonjs/Wallet/components/AddressManager.js.map +1 -0
  45. package/lib/commonjs/Wallet/components/DepositCard.js +165 -0
  46. package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -0
  47. package/lib/commonjs/Wallet/components/LinkAccountManager.js +167 -0
  48. package/lib/commonjs/Wallet/components/LinkAccountManager.js.map +1 -0
  49. package/lib/commonjs/Wallet/components/ManageAccountCard.js +216 -0
  50. package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -0
  51. package/lib/commonjs/Wallet/components/ManualACHAdd.js +270 -0
  52. package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -0
  53. package/lib/commonjs/Wallet/components/ManualCardAdd.js +337 -0
  54. package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -0
  55. package/lib/commonjs/Wallet/components/MyBalance.js +73 -0
  56. package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -0
  57. package/lib/commonjs/Wallet/components/PayPalOrderCapture.js +68 -0
  58. package/lib/commonjs/Wallet/components/PayPalOrderCapture.js.map +1 -0
  59. package/lib/commonjs/Wallet/components/RemoveAccount.js +108 -0
  60. package/lib/commonjs/Wallet/components/RemoveAccount.js.map +1 -0
  61. package/lib/commonjs/Wallet/components/VerifyACHAccount.js +196 -0
  62. package/lib/commonjs/Wallet/components/VerifyACHAccount.js.map +1 -0
  63. package/lib/commonjs/Wallet/components/WalletSetup.js +316 -0
  64. package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -0
  65. package/lib/commonjs/Wallet/components/WithdrawCard.js +336 -0
  66. package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -0
  67. package/lib/commonjs/Wallet/index.js +221 -0
  68. package/lib/commonjs/Wallet/index.js.map +1 -0
  69. package/lib/commonjs/constants/colors.js +3 -0
  70. package/lib/commonjs/constants/colors.js.map +1 -1
  71. package/lib/commonjs/index.js +21 -0
  72. package/lib/commonjs/index.js.map +1 -1
  73. package/lib/module/ApiOverrides/index.js +12 -3
  74. package/lib/module/ApiOverrides/index.js.map +1 -1
  75. package/lib/module/Checkout/api/index.js +241 -0
  76. package/lib/module/Checkout/api/index.js.map +1 -0
  77. package/lib/module/Checkout/components/AccountSummaryCard.js +267 -0
  78. package/lib/module/Checkout/components/AccountSummaryCard.js.map +1 -0
  79. package/lib/module/Checkout/components/ItemSummaryCard.js +49 -0
  80. package/lib/module/Checkout/components/ItemSummaryCard.js.map +1 -0
  81. package/lib/module/Checkout/components/OrderSummaryCard.js +77 -0
  82. package/lib/module/Checkout/components/OrderSummaryCard.js.map +1 -0
  83. package/lib/module/Checkout/index.js +581 -0
  84. package/lib/module/Checkout/index.js.map +1 -0
  85. package/lib/module/Components/Button.js +11 -3
  86. package/lib/module/Components/Button.js.map +1 -1
  87. package/lib/module/Components/Checkbox.js +6 -2
  88. package/lib/module/Components/Checkbox.js.map +1 -1
  89. package/lib/module/Components/Icons.js +441 -4
  90. package/lib/module/Components/Icons.js.map +1 -1
  91. package/lib/module/Components/Spring.js +6 -5
  92. package/lib/module/Components/Spring.js.map +1 -1
  93. package/lib/module/LocationTracker/LocationStatus.js +88 -0
  94. package/lib/module/LocationTracker/LocationStatus.js.map +1 -0
  95. package/lib/module/LocationTracker/api/index.js +118 -0
  96. package/lib/module/LocationTracker/api/index.js.map +1 -0
  97. package/lib/module/LocationTracker/index.js +200 -0
  98. package/lib/module/LocationTracker/index.js.map +1 -0
  99. package/lib/module/Observer/Observer.js +2 -0
  100. package/lib/module/Observer/Observer.js.map +1 -1
  101. package/lib/module/Wallet/api/index.js +615 -0
  102. package/lib/module/Wallet/api/index.js.map +1 -0
  103. package/lib/module/Wallet/components/ACHAdd.js +56 -0
  104. package/lib/module/Wallet/components/ACHAdd.js.map +1 -0
  105. package/lib/module/Wallet/components/AccountCard.js +130 -0
  106. package/lib/module/Wallet/components/AccountCard.js.map +1 -0
  107. package/lib/module/Wallet/components/AccountLimitManager.js +312 -0
  108. package/lib/module/Wallet/components/AccountLimitManager.js.map +1 -0
  109. package/lib/module/Wallet/components/AccountManager.js +195 -0
  110. package/lib/module/Wallet/components/AccountManager.js.map +1 -0
  111. package/lib/module/Wallet/components/AccountSnoozeManager.js +251 -0
  112. package/lib/module/Wallet/components/AccountSnoozeManager.js.map +1 -0
  113. package/lib/module/Wallet/components/AddressCard.js +49 -0
  114. package/lib/module/Wallet/components/AddressCard.js.map +1 -0
  115. package/lib/module/Wallet/components/AddressManager.js +356 -0
  116. package/lib/module/Wallet/components/AddressManager.js.map +1 -0
  117. package/lib/module/Wallet/components/DepositCard.js +156 -0
  118. package/lib/module/Wallet/components/DepositCard.js.map +1 -0
  119. package/lib/module/Wallet/components/LinkAccountManager.js +158 -0
  120. package/lib/module/Wallet/components/LinkAccountManager.js.map +1 -0
  121. package/lib/module/Wallet/components/ManageAccountCard.js +207 -0
  122. package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -0
  123. package/lib/module/Wallet/components/ManualACHAdd.js +261 -0
  124. package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -0
  125. package/lib/module/Wallet/components/ManualCardAdd.js +328 -0
  126. package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -0
  127. package/lib/module/Wallet/components/MyBalance.js +66 -0
  128. package/lib/module/Wallet/components/MyBalance.js.map +1 -0
  129. package/lib/module/Wallet/components/PayPalOrderCapture.js +61 -0
  130. package/lib/module/Wallet/components/PayPalOrderCapture.js.map +1 -0
  131. package/lib/module/Wallet/components/RemoveAccount.js +100 -0
  132. package/lib/module/Wallet/components/RemoveAccount.js.map +1 -0
  133. package/lib/module/Wallet/components/VerifyACHAccount.js +187 -0
  134. package/lib/module/Wallet/components/VerifyACHAccount.js.map +1 -0
  135. package/lib/module/Wallet/components/WalletSetup.js +307 -0
  136. package/lib/module/Wallet/components/WalletSetup.js.map +1 -0
  137. package/lib/module/Wallet/components/WithdrawCard.js +327 -0
  138. package/lib/module/Wallet/components/WithdrawCard.js.map +1 -0
  139. package/lib/module/Wallet/index.js +212 -0
  140. package/lib/module/Wallet/index.js.map +1 -0
  141. package/lib/module/constants/colors.js +3 -0
  142. package/lib/module/constants/colors.js.map +1 -1
  143. package/lib/module/index.js +4 -1
  144. package/lib/module/index.js.map +1 -1
  145. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  146. package/lib/typescript/src/Checkout/api/index.d.ts +49 -0
  147. package/lib/typescript/src/Checkout/api/index.d.ts.map +1 -0
  148. package/lib/typescript/src/Checkout/components/AccountSummaryCard.d.ts +18 -0
  149. package/lib/typescript/src/Checkout/components/AccountSummaryCard.d.ts.map +1 -0
  150. package/lib/typescript/src/Checkout/components/ItemSummaryCard.d.ts +8 -0
  151. package/lib/typescript/src/Checkout/components/ItemSummaryCard.d.ts.map +1 -0
  152. package/lib/typescript/src/Checkout/components/OrderSummaryCard.d.ts +8 -0
  153. package/lib/typescript/src/Checkout/components/OrderSummaryCard.d.ts.map +1 -0
  154. package/lib/typescript/src/Checkout/index.d.ts +12 -0
  155. package/lib/typescript/src/Checkout/index.d.ts.map +1 -0
  156. package/lib/typescript/src/Components/Button.d.ts.map +1 -1
  157. package/lib/typescript/src/Components/Checkbox.d.ts +3 -1
  158. package/lib/typescript/src/Components/Checkbox.d.ts.map +1 -1
  159. package/lib/typescript/src/Components/Icons.d.ts +8 -1
  160. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  161. package/lib/typescript/src/Components/Spring.d.ts.map +1 -1
  162. package/lib/typescript/src/LocationTracker/LocationStatus.d.ts +21 -0
  163. package/lib/typescript/src/LocationTracker/LocationStatus.d.ts.map +1 -0
  164. package/lib/typescript/src/LocationTracker/api/index.d.ts +19 -0
  165. package/lib/typescript/src/LocationTracker/api/index.d.ts.map +1 -0
  166. package/lib/typescript/src/LocationTracker/index.d.ts +22 -0
  167. package/lib/typescript/src/LocationTracker/index.d.ts.map +1 -0
  168. package/lib/typescript/src/Observer/Observer.d.ts.map +1 -1
  169. package/lib/typescript/src/Wallet/api/index.d.ts +94 -0
  170. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -0
  171. package/lib/typescript/src/Wallet/components/ACHAdd.d.ts +13 -0
  172. package/lib/typescript/src/Wallet/components/ACHAdd.d.ts.map +1 -0
  173. package/lib/typescript/src/Wallet/components/AccountCard.d.ts +10 -0
  174. package/lib/typescript/src/Wallet/components/AccountCard.d.ts.map +1 -0
  175. package/lib/typescript/src/Wallet/components/AccountLimitManager.d.ts +10 -0
  176. package/lib/typescript/src/Wallet/components/AccountLimitManager.d.ts.map +1 -0
  177. package/lib/typescript/src/Wallet/components/AccountManager.d.ts +13 -0
  178. package/lib/typescript/src/Wallet/components/AccountManager.d.ts.map +1 -0
  179. package/lib/typescript/src/Wallet/components/AccountSnoozeManager.d.ts +10 -0
  180. package/lib/typescript/src/Wallet/components/AccountSnoozeManager.d.ts.map +1 -0
  181. package/lib/typescript/src/Wallet/components/AddressCard.d.ts +10 -0
  182. package/lib/typescript/src/Wallet/components/AddressCard.d.ts.map +1 -0
  183. package/lib/typescript/src/Wallet/components/AddressManager.d.ts +23 -0
  184. package/lib/typescript/src/Wallet/components/AddressManager.d.ts.map +1 -0
  185. package/lib/typescript/src/Wallet/components/DepositCard.d.ts +14 -0
  186. package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -0
  187. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts +10 -0
  188. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts.map +1 -0
  189. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts +17 -0
  190. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -0
  191. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts +11 -0
  192. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -0
  193. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts +11 -0
  194. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts.map +1 -0
  195. package/lib/typescript/src/Wallet/components/MyBalance.d.ts +14 -0
  196. package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -0
  197. package/lib/typescript/src/Wallet/components/PayPalOrderCapture.d.ts +16 -0
  198. package/lib/typescript/src/Wallet/components/PayPalOrderCapture.d.ts.map +1 -0
  199. package/lib/typescript/src/Wallet/components/RemoveAccount.d.ts +10 -0
  200. package/lib/typescript/src/Wallet/components/RemoveAccount.d.ts.map +1 -0
  201. package/lib/typescript/src/Wallet/components/VerifyACHAccount.d.ts +10 -0
  202. package/lib/typescript/src/Wallet/components/VerifyACHAccount.d.ts.map +1 -0
  203. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts +11 -0
  204. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -0
  205. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts +16 -0
  206. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -0
  207. package/lib/typescript/src/Wallet/index.d.ts +10 -0
  208. package/lib/typescript/src/Wallet/index.d.ts.map +1 -0
  209. package/lib/typescript/src/constants/colors.d.ts +3 -0
  210. package/lib/typescript/src/constants/colors.d.ts.map +1 -1
  211. package/lib/typescript/src/index.d.ts +4 -1
  212. package/lib/typescript/src/index.d.ts.map +1 -1
  213. package/package.json +4 -1
  214. package/src/ApiOverrides/index.ts +13 -3
  215. package/src/Checkout/api/index.tsx +190 -0
  216. package/src/Checkout/components/AccountSummaryCard.tsx +169 -0
  217. package/src/Checkout/components/ItemSummaryCard.tsx +34 -0
  218. package/src/Checkout/components/OrderSummaryCard.tsx +40 -0
  219. package/src/Checkout/index.tsx +398 -0
  220. package/src/Components/Button.tsx +5 -4
  221. package/src/Components/Checkbox.tsx +5 -2
  222. package/src/Components/Icons.tsx +196 -3
  223. package/src/Components/Spring.tsx +4 -3
  224. package/src/LocationTracker/LocationStatus.tsx +96 -0
  225. package/src/LocationTracker/api/index.tsx +114 -0
  226. package/src/LocationTracker/index.tsx +130 -0
  227. package/src/Observer/Observer.tsx +2 -1
  228. package/src/Wallet/api/index.ts +461 -0
  229. package/src/Wallet/components/ACHAdd.tsx +49 -0
  230. package/src/Wallet/components/AccountCard.tsx +92 -0
  231. package/src/Wallet/components/AccountLimitManager.tsx +204 -0
  232. package/src/Wallet/components/AccountManager.tsx +103 -0
  233. package/src/Wallet/components/AccountSnoozeManager.tsx +150 -0
  234. package/src/Wallet/components/AddressCard.tsx +31 -0
  235. package/src/Wallet/components/AddressManager.tsx +203 -0
  236. package/src/Wallet/components/DepositCard.tsx +91 -0
  237. package/src/Wallet/components/LinkAccountManager.tsx +119 -0
  238. package/src/Wallet/components/ManageAccountCard.tsx +146 -0
  239. package/src/Wallet/components/ManualACHAdd.tsx +164 -0
  240. package/src/Wallet/components/ManualCardAdd.tsx +185 -0
  241. package/src/Wallet/components/MyBalance.tsx +64 -0
  242. package/src/Wallet/components/PayPalOrderCapture.tsx +59 -0
  243. package/src/Wallet/components/RemoveAccount.tsx +68 -0
  244. package/src/Wallet/components/VerifyACHAccount.tsx +140 -0
  245. package/src/Wallet/components/WalletSetup.tsx +197 -0
  246. package/src/Wallet/components/WithdrawCard.tsx +145 -0
  247. package/src/Wallet/index.tsx +229 -0
  248. package/src/constants/colors.ts +3 -0
  249. package/src/index.tsx +7 -2
  250. package/src/types.d.ts +295 -1
@@ -0,0 +1,229 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { View, ActivityIndicator } from 'react-native';
3
+ import { WalletApi, WalletHelpers } from './api';
4
+ import Colors from '../constants/colors';
5
+ import WalletSetup from './components/WalletSetup';
6
+ import type { MyPlayerProps, PlayerBalanceProps } from '../ProfileManager/api/types';
7
+ import AccountAdd from './components/ACHAdd';
8
+ import type { AccountProps, ItemOrderProps, PlayerAddressProps, PlayerDepositLimitProps, PlayerWithdrawLimitProps, WalletSettingsProps } from '../types';
9
+ import MyBalance from './components/MyBalance';
10
+ import ManualCardAdd from './components/ManualCardAdd';
11
+ import DepositCard from './components/DepositCard';
12
+ import WithdrawCard from './components/WithdrawCard';
13
+ import AccountManager from './components/AccountManager';
14
+ import ManageAccountCard from './components/ManageAccountCard';
15
+ import AccountSnoozeManager from './components/AccountSnoozeManager';
16
+ import AccountLimitManager from './components/AccountLimitManager';
17
+ import RemoveAccountCard from './components/RemoveAccount';
18
+ import AddressManager from './components/AddressManager';
19
+ import VerifyACHAccount from './components/VerifyACHAccount';
20
+ import LinkAccountManager from './components/LinkAccountManager';
21
+ import ManualACHAdd from './components/ManualACHAdd';
22
+
23
+ type MyWalletProps = {
24
+ account_id?:string,
25
+ onClose:() => void,
26
+ onTransact: (item_order:ItemOrderProps, account_id?:string) => void
27
+ }
28
+
29
+ const MyWallet = ({ account_id, onTransact, onClose }:MyWalletProps) => {
30
+ const [ active_view, setActiveView ] = useState('account_manager');
31
+ const [ selected_account, setSelectedAccount ] = useState<AccountProps>();
32
+ const [ wallet, setWallet ] = useState<{
33
+ loaded:boolean,
34
+ player_addresses:PlayerAddressProps[],
35
+ wallet_settings?:WalletSettingsProps,
36
+ player?:MyPlayerProps,
37
+ player_balance?:PlayerBalanceProps,
38
+ deposit_limit?:PlayerDepositLimitProps,
39
+ withdraw_limit?:PlayerWithdrawLimitProps,
40
+ accounts:AccountProps[]
41
+ }>({
42
+ loaded: false,
43
+ accounts: [],
44
+ player_addresses:[]
45
+ })
46
+ const { loaded, player, wallet_settings, player_balance, deposit_limit, withdraw_limit, accounts, player_addresses } = wallet
47
+ const ibt_placeholder_account = accounts.find(a => a.ibt_placeholder);
48
+
49
+ useEffect(() => {
50
+ getData()
51
+ },[])
52
+
53
+ const getData = async() => {
54
+ WalletApi.setEnvironment();
55
+ const p = await WalletApi.getMyDetails();
56
+ const pb = await WalletApi.getMyBalance();
57
+ const ws = await WalletApi.getMySettings();
58
+ const dl = await WalletApi.getMyDepositLimit();
59
+ const wl = await WalletApi.getMyWithdrawLimit();
60
+ const pa = await WalletApi.getMyAddresses();
61
+ const accts = await WalletApi.getMyAccounts();
62
+ if(account_id){ setSelectedAccount(accts.find(a => a.account_id == account_id)) }
63
+
64
+
65
+ setWallet({
66
+ ...wallet,
67
+ loaded:true,
68
+ player:p,
69
+ wallet_settings:ws,
70
+ player_balance: pb,
71
+ deposit_limit: dl,
72
+ player_addresses: pa,
73
+ withdraw_limit:wl,
74
+ accounts:accts
75
+ })
76
+
77
+ }
78
+ const handleSelectAccount = async(account:AccountProps) => {
79
+ setSelectedAccount(account)
80
+ if(account.status == 'verify'){ return setActiveView('verify') }
81
+ setActiveView('manage_account')
82
+ }
83
+
84
+ if(!loaded || !player || !wallet_settings || !player_balance || !deposit_limit || !withdraw_limit){
85
+ return (
86
+ <View>
87
+ <ActivityIndicator size='large' color={Colors.brand.midnight} />
88
+ </View>
89
+ )
90
+ }
91
+
92
+ return (
93
+ <View style={{ flex:1 }}>
94
+ {!WalletHelpers.isWalletAuthenticated(wallet_settings) ?
95
+ <WalletSetup
96
+ player={player}
97
+ wallet_settings={wallet_settings}
98
+ onSettingsUpdate={(ws) => {
99
+ setWallet({ ...wallet, wallet_settings: ws })
100
+ if(WalletHelpers.isWalletAuthenticated(ws)){ setActiveView('account_manager') }
101
+ }}
102
+ />
103
+ :active_view == 'account_manager' ?
104
+ <AccountManager
105
+ accounts={accounts}
106
+ onSelectInstantBankTransfer={() => {
107
+ setActiveView('add_ibt');
108
+ }}
109
+ onClose={onClose}
110
+ onSelectManualACH={() => setActiveView('add_ach')}
111
+ onSelectManualCard={() => setActiveView('add_card')}
112
+ onSelectAccount={(acct) => handleSelectAccount(acct)}
113
+ />
114
+ :active_view == 'addresses' ?
115
+ <AddressManager
116
+ player={player}
117
+ player_addresses={player_addresses}
118
+ onAddAddress={(addy) => setWallet({ ...wallet, player_addresses: player_addresses.concat(addy) })}
119
+ onRemoveAddress={(addy) => setWallet({ ...wallet, player_addresses: player_addresses.filter(pa => pa.player_address_id != addy.player_address_id) })}
120
+ onSelect={() => console.log('hey')}
121
+ onCancel={() => console.log('cancel')}
122
+ />
123
+ :active_view == 'account_limit' && selected_account ?
124
+ <AccountLimitManager
125
+ account={selected_account}
126
+ onCancel={() => console.log('hey')}
127
+ onSetLimit={() => console.log('HEY AGAIN')}
128
+ />
129
+ :active_view == 'account_remove' && selected_account ?
130
+ <RemoveAccountCard
131
+ account={selected_account}
132
+ onCancel={() => console.log('hey')}
133
+ onRemove={() => console.log('HEY AGAIN')}
134
+ />
135
+ :active_view == 'account_snooze' && selected_account ?
136
+ <AccountSnoozeManager
137
+ account={selected_account}
138
+ onCancel={() => console.log('hey')}
139
+ onSnooze={() => console.log('HEY AGAIN')}
140
+ />
141
+ :active_view == 'manage_account' && selected_account ?
142
+ <ManageAccountCard
143
+ player={player}
144
+ wallet_settings={wallet_settings}
145
+ player_balance={player_balance}
146
+ account={selected_account}
147
+ deposit_limit={deposit_limit}
148
+ withdraw_limit={withdraw_limit}
149
+ onAccountUpdate={(acct) => setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id) })}
150
+ onClose={() => setActiveView('account_manager')}
151
+ onTransact={onTransact}
152
+ />
153
+ :active_view == 'deposit' && selected_account ?
154
+ <DepositCard
155
+ player={player}
156
+ wallet_settings={wallet_settings}
157
+ deposit_limit={deposit_limit}
158
+ account={selected_account}
159
+ onCancel={() => setActiveView('account_manager')}
160
+ onTransact={(item_order) => onTransact(item_order, selected_account.account_id)}
161
+ />
162
+ :active_view == 'withdraw' && selected_account ?
163
+ <WithdrawCard
164
+ player={player}
165
+ player_balance={player_balance}
166
+ wallet_settings={wallet_settings}
167
+ withdraw_limit={withdraw_limit}
168
+ deposit_limit={deposit_limit}
169
+ account={selected_account}
170
+ onTransact={(item_order) => onTransact(item_order, selected_account.account_id)}
171
+ onCancel={() => setActiveView('account_manager')}
172
+ />
173
+ :active_view == 'verify' && selected_account ?
174
+ <VerifyACHAccount
175
+ account={selected_account}
176
+ onClose={() => {
177
+ setActiveView('account_manager')
178
+ setSelectedAccount(undefined);
179
+ }}
180
+ onUpdateAccount={(acct) => {
181
+ setSelectedAccount(acct)
182
+ setWallet({ ...wallet, accounts: accounts.filter(a => a.account_id != acct.account_id).concat(acct) })
183
+ }}
184
+ />
185
+ :active_view == 'add_ibt' && ibt_placeholder_account?
186
+ <LinkAccountManager
187
+ ibt_placeholer_account={ibt_placeholder_account}
188
+ onComplete={(account_id) => console.log(account_id)}
189
+ onCancel={() => setActiveView('account_manager')}
190
+ />
191
+ :active_view == 'add_ach'?
192
+ <ManualACHAdd
193
+ player={player}
194
+ onAddAccount={(acct) => setWallet({ ...wallet, accounts: accounts.concat(acct) })}
195
+ onCancel={() => setActiveView('account_manager')}
196
+
197
+ />
198
+ :active_view == 'add_card'?
199
+ <ManualCardAdd
200
+ player={player}
201
+ onAddAccount={(acct) => {
202
+ setWallet({ ...wallet, accounts: accounts.concat(acct) })
203
+ setActiveView('account_manager')
204
+ }}
205
+ onCancel={() => setActiveView('account_manager')}
206
+ />
207
+ :active_view == 'add' ?
208
+ <AccountAdd
209
+ player={player}
210
+ accounts={accounts}
211
+ onNext={() => console.log('next')}
212
+ onClose={() => console.log('')}
213
+ walkthrough
214
+ />
215
+ :active_view == 'balance' ?
216
+ <MyBalance
217
+ player={player}
218
+ balance_account={accounts.find(a => a.account_type == 'bettoredge')}
219
+ player_balance={player_balance}
220
+ walkthrough
221
+ onNext={() => console.log('')}
222
+ onClose={() => console.log('CLOSE')}
223
+ />
224
+ :<></>}
225
+ </View>
226
+ )
227
+ }
228
+
229
+ export default MyWallet
@@ -16,6 +16,9 @@ const Colors = {
16
16
  cyan: '#52BCD1',
17
17
  electric:'#4D8FCD'
18
18
  },
19
+ company: {
20
+ paypal: '#FCBB32'
21
+ },
19
22
  shades: {
20
23
  white: '#FFFFFF',
21
24
  shade100: '#F2F5F7',
package/src/index.tsx CHANGED
@@ -7,7 +7,9 @@ import LinearGradient from "react-native-linear-gradient";
7
7
  import Colors from "./constants/colors";
8
8
  import Observer, { BEEventApi, BELinkApi } from './Observer';
9
9
  import BettorSearch from "./BettorSearch";
10
-
10
+ import MyWallet from "./Wallet";
11
+ import Checkout from "./Checkout";
12
+ import { usePlayerLocation } from "./LocationTracker/LocationStatus";
11
13
 
12
14
  export {
13
15
  Authenticator,
@@ -19,6 +21,9 @@ export {
19
21
  SocialComponents,
20
22
  APIOverrides,
21
23
  LinearGradient,
24
+ usePlayerLocation,
22
25
  BettorSearch,
23
- Colors
26
+ Colors,
27
+ MyWallet,
28
+ Checkout
24
29
  }
package/src/types.d.ts CHANGED
@@ -25,7 +25,15 @@ export interface PublicPlayerProps {
25
25
  }
26
26
 
27
27
 
28
-
28
+ export interface LocationProps {
29
+ location_id:string,
30
+ value:string,
31
+ label:string,
32
+ legal_ind:boolean,
33
+ location_image: string,
34
+ create_datetime:any,
35
+ last_update_datetime: any
36
+ }
29
37
 
30
38
  //EVENTS SVC TYPES
31
39
 
@@ -352,3 +360,289 @@ export interface PollResponseProps {
352
360
  create_datetime:any,
353
361
  last_update_datetime:any
354
362
  }
363
+
364
+
365
+
366
+
367
+
368
+ //WALLET TYPES
369
+
370
+ export interface WalletSettingsProps {
371
+ wallet_settings_id: string,
372
+ player_id:string,
373
+ require_pin: boolean,
374
+ pin?: string,
375
+ allow_cards:boolean,
376
+ allow_manual_ach:boolean,
377
+ allow_paypal:boolean,
378
+ agreed_to_terms:boolean,
379
+ auth_end_datetime?: any,
380
+ terms_timestamp?:any,
381
+ status: string,
382
+ status_description?:string,
383
+ create_datetime:any,
384
+ last_update_datetime: any
385
+ }
386
+
387
+
388
+ export interface AccountProps {
389
+ account_id:string,
390
+ player_id:string,
391
+ account_type: 'card' | 'ach' | 'paypal' | 'bettoredge',
392
+ account_label: string,
393
+ status:string,
394
+ ach_detail?:ACHDetailProps,
395
+ card_detail?:CardDetailProps,
396
+ default_account?:boolean,
397
+ create_datetime:any,
398
+ default_billing_address_id?:string,
399
+ transaction_fee:number,
400
+ client_id?:string,
401
+ redirect_url?:string,
402
+ ibt_placeholder?:boolean,
403
+ legacy_id?:string,
404
+ last_verify_attempt?:any
405
+ last_update_datetime:any
406
+ }
407
+
408
+ export interface AccountActionProps {
409
+ action_id:string,
410
+ action_type:string,
411
+ action_title:string,
412
+ action_description:string
413
+ }
414
+
415
+ export interface PlayerAddressProps {
416
+ player_address_id:string,
417
+ player_id:string,
418
+ name?: string,
419
+ street: string,
420
+ city: string,
421
+ state: string,
422
+ country:string,
423
+ type: 'shipping' | 'billing',
424
+ zip:string,
425
+ status:string,
426
+ create_datetime:any,
427
+ last_update_datetime:any
428
+ }
429
+
430
+
431
+ export interface ACHDetailProps {
432
+ ach_detail_id:string,
433
+ account_id:string,
434
+ external_id:string,
435
+ masked_account_number?:string,
436
+ bank_name:string,
437
+ account_type: 'checking' | 'savings'
438
+ routing_number?:string,
439
+ account_number?:string,
440
+ encryption_iv?:string,
441
+ session_id?:string,
442
+ payment_provider:'nuvei' | 'payliance',
443
+ ach_type: 'ibf' | 'manual',
444
+ create_datetime:any,
445
+ last_update_datetime:any
446
+ }
447
+
448
+ export interface CardDetailProps {
449
+ card_detail_id: string,
450
+ account_id:string,
451
+ first_name:string,
452
+ last_name:string,
453
+ middle_name?:string,
454
+ expiration_date:any,
455
+ card_number:string,
456
+ card_type?:string,
457
+ card_brand?:string,
458
+ masked_card_number:string,
459
+ encryption_iv:any,
460
+ authorize_transaction_id?:string,
461
+ fail_reason?:string,
462
+ cvv:string,
463
+ default_address_id?:string,
464
+ status:string,
465
+ create_datetime:any,
466
+ last_update_datetime:any
467
+ }
468
+
469
+ export interface AccountLimitProps {
470
+ account_limit_id:string,
471
+ account_id:string,
472
+ limit_amount:number,
473
+ limit_days:number,
474
+ status:'active'|'inactive',
475
+ current_amount:number,
476
+ create_datetime:any,
477
+ reset_datetime:any,
478
+ last_update_datetime:any
479
+ }
480
+
481
+ export interface AccountSnoozeProps {
482
+ account_snooze_id:string,
483
+ account_id:string,
484
+ snooze_days: number,
485
+ status: 'active' | 'inactive',
486
+ create_datetime:any,
487
+ end_datetime:any,
488
+ last_update_datetime:any
489
+ }
490
+
491
+ export interface TransactionProps {
492
+ transaction_id:string,
493
+ account_id:string,
494
+ transaction_type: 'debit' | 'credit',
495
+ description: string,
496
+ currency: 'USD',
497
+ player_id:string,
498
+ amount: number,
499
+ billing_address_id?:string,
500
+ is_error?:boolean,
501
+ error_code?:string, //If we get an error on the transaction, we need to start showing the users the errors
502
+ error_description?:string,
503
+ be_client_id?:string,
504
+ redirect_url?:string,
505
+ require_review?:boolean,
506
+ session_id?:string,
507
+ cvv?:string,
508
+ transaction_details?:TransactionDetailProps[],
509
+ player_balance_request_id?:string, //Used for withdraws. When the withdraw processes, this id is sent to auth-svc to confirm the money was moved
510
+ external_id?:string | number,
511
+ status:'redirect'|'posted'|'failed'|'settled'|'error'|'chargeback'|'pending'|'cancelled',
512
+ external_status?:string,
513
+ estimated_settle_datetime?:any,
514
+ ip_address?:string,
515
+ legacy_id?:string,
516
+ create_datetime:any,
517
+ last_update_datetime:any
518
+ }
519
+
520
+ export interface TransactionDetailProps {
521
+ transaction_detail_id:string,
522
+ transaction_id:string,
523
+ amount:number,
524
+ action?: 'deposit' | 'withdraw' | 'chargeback' | 'wallet_purchase',
525
+ fee_type?: 'processing' | 'shipping' | 'chargeback',
526
+ description: string,
527
+ legacy_id?:string,
528
+ create_datetime:any,
529
+ last_update_datetime:any
530
+ }
531
+
532
+ export interface ItemOrderProps {
533
+ item_order_id:string,
534
+ items:{
535
+ item_id:string,
536
+ size?:SizeOptionProps,
537
+ color?:ColorOptionProps,
538
+ quantity:number,
539
+ amount:number
540
+ }[],
541
+ amount:number | string,
542
+ transaction_id?:string,
543
+ player_id:string,
544
+ external_id?:string,
545
+ status:string,
546
+ fee_1?: string,
547
+ fee_1_amount?:number,
548
+ fee_2?:string,
549
+ fee_2_amount?:number,
550
+ recurring_order_id?:string,
551
+ debit_only?:boolean,
552
+ region?: string,
553
+ type: 'wallet' | 'store' | 'affiliate',
554
+ location?: any,
555
+ shipping_status?:'not_shipped'|'in_transit'|'delivered',
556
+ shipping_address_id?:string,
557
+ tracking_url?:string,
558
+ total_amount:number,
559
+ description:string,
560
+ create_datetime:any,
561
+ last_update_datetime:any
562
+ }
563
+
564
+ export interface PlayerDepositLimitProps {
565
+ player_deposit_limit_id:string,
566
+ player_id:string,
567
+ instant_limit:number,
568
+ instant_available:number,
569
+ instant_deposits:number,
570
+ last_days_card_deposits:number,
571
+ last_days_ach_deposits:number,
572
+ ach_fee:number,
573
+ card_fee:number,
574
+ paypal_fee:number,
575
+ streak:number,
576
+ streak_type:'success'|'fail',
577
+ hold_days:number,
578
+ ach_daily_limit: number,
579
+ card_daily_limit:number,
580
+ create_datetime:any,
581
+ last_update_datetime:any
582
+ }
583
+
584
+ export interface PlayerWithdrawLimitProps {
585
+ player_withdraw_limit_id:string,
586
+ player_id:string,
587
+ ach_daily_limit: number,
588
+ card_daily_limit:number,
589
+ promo_received: number,
590
+ promo_received_date?:string,
591
+ total_staked:number,
592
+ withdraws_per_week: number,
593
+ last_days_ach_withdraws:number,
594
+ last_days_card_withdraws:number,
595
+ week_withdraw_count:number
596
+ create_datetime: any,
597
+ last_update_datetime:any
598
+ }
599
+
600
+
601
+ export interface SizeOptionProps {
602
+ size: 'xs'|'s'|'m'|'l'|'xl'|'xxl'|'xxxl',
603
+ label: string,
604
+ in_stock:boolean
605
+ }
606
+
607
+ export interface ColorOptionProps {
608
+ color: string, //Hex value
609
+ label: string
610
+ in_stock: boolean
611
+ }
612
+
613
+ export interface ItemProps {
614
+ item_id:string,
615
+ company_id:string,
616
+ type: 'store'|'affiliate'|'wallet'
617
+ name: string,
618
+ item_fees: ItemFeeProps[],
619
+ description: string,
620
+ value?:number,
621
+ transaction_type: 'credit'|'debit',
622
+ catalog_id?:string,
623
+ identifier?:string,
624
+ price:number,
625
+ size_options?: SizeOptionProps[],
626
+ color_options?: ColorOptionProps[],
627
+ price_editable?:boolean,
628
+ location_required?:boolean,
629
+ location_restricted?:boolean,
630
+ locations_allowed?:string[],
631
+ shipping_address_required:boolean,
632
+ billing_address_required:boolean,
633
+ wallet_allowed:boolean,
634
+ images: any[] | ItemImageProps[],
635
+ status:string,
636
+ debit_only?:boolean,
637
+ no_fees?:boolean,
638
+ recurring_eligible?:boolean,
639
+ recur_frequency?:number,
640
+ recur_frequency_unit?:'days'|'months'|'weeks',
641
+ recur_next_item_id?:string,
642
+ create_datetime:any,
643
+ last_update_datetime:any
644
+ }
645
+
646
+ export interface ItemImageProps {
647
+ url:string, default:boolean, color?:string, width?:number, height?:number
648
+ }