Skip to content

Commit

Permalink
Merge branch v1.50.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rhrusha committed Aug 3, 2022
2 parents 15d927e + d3a4905 commit e0cc4ac
Show file tree
Hide file tree
Showing 53 changed files with 763 additions and 447 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ buck-out/

# Bundle artifact
*.jsbundle

2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.50.5"
versionName "1.50.7"

missingDimensionStrategy 'react-native-camera', 'general'
multiDexEnabled true
Expand Down
Binary file modified android/app/src/main/assets/fonts/icomoon.ttf
Binary file not shown.
4 changes: 3 additions & 1 deletion app/appstores/Actions/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import walletDS from '@app/appstores/DataSource/Wallet/Wallet'

import NavStore from '@app/components/navigation/NavStore'

import { setFilter, setSelectedWallet, setSortValue, setStakingCoins } from '@app/appstores/Stores/Main/MainStoreActions'
import { setFilter, setSelectedWallet, setSortValue, setStakingCoins, setHomeFilterWithBalance } from '@app/appstores/Stores/Main/MainStoreActions'
import { setInitState, setInitError } from '@app/appstores/Stores/Init/InitStoreActions'
import walletActions from '@app/appstores/Stores/Wallet/WalletActions'
import currencyActions from '@app/appstores/Stores/Currency/CurrencyActions'
Expand Down Expand Up @@ -178,6 +178,8 @@ class App {

await setSortValue(trusteeAsyncStorage.getSortValue() || null)

await setHomeFilterWithBalance(trusteeAsyncStorage.getHomeFilterWithBalance() || false)

await this.setAccountFilterData()

// first step of init
Expand Down
8 changes: 4 additions & 4 deletions app/appstores/Actions/TransactionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ const transactionActions = {
if (typeof transaction.wayType === 'undefined' || !transaction.wayType) {
transaction.wayType = transaction.transactionDirection
}
if (transaction?.bseOrderData) {
transaction.wayType = TransactionFilterTypeDict.SWAP
}
// if (transaction?.bseOrderData) {
// transaction.wayType = TransactionFilterTypeDict.SWAP
// }
if (transaction?.addressAmount === 0 || transaction?.transactionFilterType === TransactionFilterTypeDict.FEE) {
transaction.addressAmountPrettyPrefix = '-'
transaction.wayType = TransactionFilterTypeDict.FEE
Expand Down Expand Up @@ -260,7 +260,7 @@ const transactionActions = {

try {
transaction.addressAmountNorm = BlocksoftPrettyNumbers.setCurrencyCode(account.currencyCode).makePretty(transaction.addressAmount, 'transactionActions.addressAmount')
const res = BlocksoftPrettyNumbers.makeCut(transaction.addressAmountNorm)
const res = BlocksoftPrettyNumbers.makeCut(transaction.addressAmountNorm, account.currencyCode === 'BTC' ? 8 : 5) // @todo settings for better
if (res.isSatoshi) {
addressAmountSatoshi = '...' + transaction.addressAmount
transaction.addressAmountPretty = res.cutted
Expand Down
55 changes: 36 additions & 19 deletions app/appstores/Stores/Currency/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,50 @@ const hiddenAssets = ['ETH_ONE']
export const getVisibleCurrencies = createSelector(
[state => state.currencyStore.cryptoCurrencies],
(currencies => {
let { walletNumber } = store.getState().mainStore.selectedWallet
if (typeof walletNumber === 'undefined' || !walletNumber) {
walletNumber = 1
} else {
walletNumber = walletNumber * 1
}
try {
let { walletNumber } = store.getState().mainStore.selectedWallet
if (typeof walletNumber === 'undefined' || !walletNumber) {
walletNumber = 1
} else {
walletNumber = walletNumber * 1
}

Log.log('ACT/Currency getVisibleCurrencies selectedWallet walletNumber ' + walletNumber)
Log.log('ACT/Currency getVisibleCurrencies selectedWallet walletNumber ' + walletNumber + ' started')

const tmp = currencies.filter(c => {
if (c.isHidden === null) {
c.maskedHidden = true
} else {
const mask = Number(c.isHidden || 0).toString(2).split('').reverse() // split to binary
if (typeof mask[walletNumber] === 'undefined') {
c.maskedHidden = mask.length === 1 ? (mask[mask.length - 1] === '1') : false
const tmp = currencies.filter(c => {
if (c.isHidden === null) {
c.maskedHidden = true
} else {
c.maskedHidden = mask[walletNumber] === '1'
const mask = Number(c.isHidden || 0).toString(2).split('').reverse() // split to binary
if (typeof mask[walletNumber] === 'undefined') {
c.maskedHidden = mask.length === 1 ? (mask[mask.length - 1] === '1') : false
} else {
c.maskedHidden = mask[walletNumber] === '1'
}
}
return !c.maskedHidden
})
if (!tmp) {
return []
}
return !c.maskedHidden
})
return [...tmp]

Log.log('ACT/Currency getVisibleCurrencies selectedWallet walletNumber ' + walletNumber + ' finished')
return [...tmp]
} catch (e) {
Log.err('ACT/Currency getVisibleCurrencies error ' + e.message)
return []
}
})
)

export const getVisibleAssets = createSelector(
[state => state.currencyStore.cryptoCurrencies],
(data => data.filter(item => !hiddenAssets.includes(item.currencyCode)))
(data => {
try {
return data.filter(item => !hiddenAssets.includes(item.currencyCode))
} catch (e) {
Log.err('ACT/Currency getVisibleAssets error ' + e.message)
return []
}
})
)
18 changes: 4 additions & 14 deletions app/components/AppLockBlur.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author yura
*/
import React from 'react'
import { StyleSheet } from 'react-native'
import { StyleSheet, Platform } from 'react-native'
import { BlurView } from "@react-native-community/blur"
import { connect } from 'react-redux'

Expand All @@ -19,9 +19,9 @@ class AppLockBlur extends React.PureComponent {

return (
<>
{this.props.isBlurVisible ? (
{(this.props.isBlurVisible && Platform.OS === 'ios') ? (
<BlurView
style={styles.wrapper}
style={StyleSheet.absoluteFill}
blurType={blurColor}
blurAmount={10}
reducedTransparencyFallbackColor='white'
Expand All @@ -38,14 +38,4 @@ const mapStateToProps = (state) => {
}
}

export default connect(mapStateToProps)(AppLockBlur)

const styles = StyleSheet.create({
wrapper: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0
}
})
export default connect(mapStateToProps)(AppLockBlur)
35 changes: 35 additions & 0 deletions app/components/elements/CurrencyIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default class CurrencyIcon extends PureComponent {
return 'ETH_VLX'
} else if (currencyCode.indexOf('ONE_') !== -1) {
return 'ETH_ONE'
} else if (currencyCode.indexOf('WAVES_') !== -1) {
return 'WAVES'
} else if (currencyCode.indexOf('ASH_') !== -1) {
return require('@assets/images/currency/ASH.png')
}
}

Expand All @@ -58,6 +62,10 @@ export default class CurrencyIcon extends PureComponent {
return 'ETH_VLX'
case 'ONE':
return 'ETH_ONE'
case 'WAVES':
return 'WAVES'
case 'ASH':
return 'ASH'
default:
return null
}
Expand Down Expand Up @@ -337,6 +345,7 @@ export default class CurrencyIcon extends PureComponent {
case 'TRX_WBTT':
case 'BNB_SMART_BTT':
case 'ETH_BTT':
case 'ETH_BTT_NEW':
return (
<View style={{ ...styles.icon, borderColor: colorDict[currencyCode].colors[isLight ? 'mainColor' : 'darkColor'], ...tmpContainerStyle }}>
<View style={styles.icon__item}>
Expand Down Expand Up @@ -533,6 +542,7 @@ export default class CurrencyIcon extends PureComponent {
case 'SOL_USDT':
case 'MATIC_USDT':
case 'VLX_USDT':
case 'WAVES_USDT':
return (
<View style={{ ...styles.icon, borderColor: colorDict[currencyCode].colors[isLight ? 'mainColor' : 'darkColor'], ...tmpContainerStyle }}>
<View style={styles.icon__item}>
Expand Down Expand Up @@ -563,6 +573,7 @@ export default class CurrencyIcon extends PureComponent {
case 'SOL_USDC':
case 'MATIC_USDC':
case 'FTM_USDC':
case 'WAVES_USDC':
return (
<View style={{ ...styles.icon, borderColor: colorDict['ETH_USDC'].colors[isLight ? 'mainColor' : 'darkColor'], ...tmpContainerStyle }}>
<View style={styles.icon__item}>
Expand Down Expand Up @@ -869,6 +880,30 @@ export default class CurrencyIcon extends PureComponent {
</View>
)

case 'WAVES_USDN':
return (
<View style={{ ...styles.icon, borderColor: colorDict[currencyCode].colors[isLight ? 'mainColor' : 'darkColor'], ...tmpContainerStyle }}>
<View style={styles.icon__item}>
<CustomIcon name='WAVES_USDN' style={{ color: colorDict[currencyCode].colors[isLight ? 'mainColor' : 'darkColor'], fontSize: fontSize }} />
<View style={{ ...styles.icon__mark, backgroundColor: colors.common.iconMarkBg, ...tmpMarkStyle }}>
<CustomIcon name={block} style={{ color: colorDict[block].colors[isLight ? 'mainColor' : 'darkColor'] }} size={14} />
</View>
</View>
</View>
)

case 'ASH_CRYPTEX':
case 'ASH_SKRYPIN':
return (
<View style={{ ...styles.icon, borderColor: colorDict[currencyCode].colors[isLight ? 'mainColor' : 'darkColor'], ...tmpContainerStyle }}>
<View style={styles.icon__item}>
<CustomIcon name={currencyCode} style={{ color: colorDict[currencyCode].colors[isLight ? 'mainColor' : 'darkColor'], fontSize: fontSize }} />
<View style={{ ...styles.icon__mark, backgroundColor: colors.common.iconMarkBg, ...tmpMarkStyle }}>
<Image resize='stretch' source={block} style={{ width: 14, height: 14, marginBottom: 2, marginRight: 1 }} />
</View>
</View>
</View>
)

case 'CUSTOM_ABYSS':
case 'CUSTOM_SOLVE':
Expand Down
2 changes: 1 addition & 1 deletion app/modules/Account/AccountReceive/AccountReceiveScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class AccountReceiveScreen extends React.PureComponent {
<View>
<InvoiceListItem
title={strings('account.invoiceText')}
onPress={() => handleShareInvoice(getAddress.call(this), currencyCode, currencyName)}
onPress={() => handleShareInvoice(getAddress.call(this), currencyCode, currencyName, this.context.isLight)}
containerStyle={{ marginHorizontal: GRID_SIZE, borderRadius: 12, backgroundColor: colors.backDropModal.mainButton, marginBottom: GRID_SIZE }}
textColor='#F7F7F7'
iconType='invoice'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class HdAddressListItem extends React.PureComponent {

const {
GRID_SIZE,
colors
colors,
isLight
} = this.context

const { currencyCode, currencyName } = this.props.selectedCryptoCurrencyData
Expand All @@ -82,7 +83,7 @@ class HdAddressListItem extends React.PureComponent {
<View>
<InvoiceListItem
title={strings('account.invoiceText')}
onPress={() => handleShareInvoice(this.props.address, currencyCode, currencyName)}
onPress={() => handleShareInvoice(this.props.address, currencyCode, currencyName, isLight)}
containerStyle={{ marginHorizontal: GRID_SIZE, borderRadius: 12, backgroundColor: colors.backDropModal.mainButton, marginBottom: GRID_SIZE }}
textColor='#F7F7F7'
iconType='invoice'
Expand Down
4 changes: 3 additions & 1 deletion app/modules/Account/AccountStaking/AccountStakingSOL.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ class AccountStakingSOL extends React.PureComponent {
inputBaseColor='#f4f4f4'
inputTextColor='#f4f4f4'
tintColor='#7127ac'
paste={true}
paste
additional='NUMBER'
decimals={9}
/>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingTop: GRID_SIZE * 1.5 }}>
Expand Down
21 changes: 21 additions & 0 deletions app/modules/Account/AccountTransaction/AccountTransactionScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,24 @@ class AccountTransactionScreen extends PureComponent {
)
}

renderTxSecretToView = (transaction) => {

if (typeof transaction.transactionJson === 'undefined') return null

if (transaction.transactionJson === null) return null

if (typeof transaction.transactionJson.secretTxKey === 'undefined' || !transaction.transactionJson.secretTxKey) {
return null
}

return <TransactionItem
title={'Tx private key'}
subtitle={transaction.transactionJson.secretTxKey}
copyAction={() => this.handleSubContentPress({ plain: transaction.transactionJson.secretTxKey })}
/>
}


renderRBFToView = (transaction) => {
if (typeof transaction.transactionJson === 'undefined') return null

Expand Down Expand Up @@ -466,6 +484,9 @@ class AccountTransactionScreen extends PureComponent {
/>
)
})}

{this.renderTxSecretToView(transaction)}

{linkExplorer !== null ?
<TouchableDebounce onPress={() => handleLink.call(this, linkExplorer)}>
<LetterSpacing textStyle={{ ...styles.viewExplorer, color: colors.common.checkbox.bgChecked }}
Expand Down
5 changes: 3 additions & 2 deletions app/modules/Account/elements/HeaderBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@ class HeaderBlocks extends React.Component {

const {
GRID_SIZE,
colors
colors,
isLight
} = this.context

return (
<View>
<InvoiceListItem
title={strings('account.invoiceText')}
onPress={() => handleShareInvoice(params?.address, params?.currencyCode, params?.currencyName)}
onPress={() => handleShareInvoice(params?.address, params?.currencyCode, params?.currencyName, isLight)}
containerStyle={{ marginHorizontal: GRID_SIZE, borderRadius: 12, backgroundColor: colors.backDropModal.mainButton, marginBottom: GRID_SIZE }}
textColor='#F7F7F7'
iconType='invoice'
Expand Down
3 changes: 2 additions & 1 deletion app/modules/Account/elements/Transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ const globalStyles = {

fontFamily: 'Montserrat-SemiBold',
fontSize: 14,
color: '#1EB3E4'
color: '#1EB3E4',
paddingBottom: Platform.OS === 'ios' ? 0 : 1
},
transaction__item__subtitle: {
fontFamily: 'Montserrat-SemiBold',
Expand Down
5 changes: 2 additions & 3 deletions app/modules/Account/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ const getCurrentDate = (date) => {
return newDate.toString().split(' ')[1] + ' ' + newDate.getDate() + ', ' + newDate.getFullYear()
}

const handleShareInvoice = (address, currencyCode, currencyName) => {
const message = `${BlocksoftCustomLinks.getLink(`INVOICE_URL`, this.context.isLight)}?crypto_name=${currencyName}&crypto_code=${currencyCode}&wallet_address=${address}`

const handleShareInvoice = (address, currencyCode, currencyName, isLight) => {
const message = `${BlocksoftCustomLinks.getLink(`INVOICE_URL`, isLight)}&crypto_name=${currencyName}&crypto_code=${currencyCode}&wallet_address=${address}`
const shareOptions = {
title: strings('account.invoiceText'),
url: message
Expand Down
10 changes: 4 additions & 6 deletions app/modules/Cashback/CashbackScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ class CashbackScreen extends React.PureComponent {
cashbackStore
} = this.props

const cashbackTotalBalance = cashbackStore.dataFromApi.totalCashbackBalance || 0
const cpaTotalBalance = cashbackStore.dataFromApi.cpaTotalBalance || 0
const cashbackBalance = cashbackStore.dataFromApi.cashbackBalance || 0
const cpaBalance = cashbackStore.dataFromApi.cpaBalance || 0

const getSections = [
{
title: strings('cashback.cashback'),
value: 'CASHBACK',
balance: `${UtilsService.cutNumber(cashbackTotalBalance, 2)} ${this.cashbackCurrency}`,
balance: `${UtilsService.cutNumber(cashbackBalance, 2)} ${this.cashbackCurrency}`,
iconType: 'earn'
},
{
title: strings('cashback.cpa'),
value: 'CPA',
balance: `${UtilsService.cutNumber(cpaTotalBalance, 2)} ${this.cashbackCurrency}`,
balance: `${UtilsService.cutNumber(cpaBalance, 2)} ${this.cashbackCurrency}`,
iconType: 'cpa'
}
]
Expand All @@ -90,8 +90,6 @@ class CashbackScreen extends React.PureComponent {
<DetailsHeader
cashbackStore={cashbackStore}
scrollDetails={this.scrollDetails}
cashbackTotalBalance={cashbackTotalBalance}
cpaTotalBalance={cpaTotalBalance}
sections={getSections}
/>
)
Expand Down

0 comments on commit e0cc4ac

Please sign in to comment.