Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
peachbits committed May 19, 2021
2 parents 92c54d7 + 307800a commit bcfdb61
Show file tree
Hide file tree
Showing 72 changed files with 1,708 additions and 1,053 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; Edge additions
.*/node_modules/edge-plugin-bity/.*
.*/node_modules/metro/.*
.*/node_modules/react-native-confetti-cannon/.*
.*/node_modules/react-native-camera/.*
.*/node_modules/react-native-keyboard-aware-scroll-view/.*
.*/node_modules/react-native-permissions/.*
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# edge-react-gui

## 2.0.11 (2021-05-17)

- Add Fantom (FTM) support with fUSDT
- New themed Exchange scene with confetti
- Visual and text fixes
- XLM and XRP unique identifier fixes
- Upgrade edge-core-js to v0.17.33
- Add a paused flag to EdgeCurrencyWallet, and a matching changePaused method
- Deprecate EdgeCurrencyWallet.startEngine - Use EdgeCurrencyWallet.changePaused(false) instead
- Deprecate EdgeCurrencyWallet.stopEngine - Use EdgeCurrencyWallet.changePaused(true) instead
- Clean legacy Airbitz wallet files to prevent potential crashes at login
- Upgrade edge-currency-accountbased to v0.7.58
- Add Fantom
- FTM: Add fUSDT support
- XRP: Pass default fee to preparePayment
- XRP: Remove unused 'type' field from transaction validation
- XRP: Change destination tag limit to 10 digits and less than UINT32
- Fix metadata issue for accelerated ETH txs (RBF tx)
- Upgrade edge-exchange-plugins to v0.11.27
- Add constant rate for fUSDT to USDT
- ChangeNow: Add ERC20-only filter to prevent trading for mainnet tokens when only the ETH ERC20 token is available
- Upgrade edge-login-ui-rn to v0.9.2
- Add testID's to various screens
- Improve internal type-safety. This should not have any extenally-visible effects

## 2.0.10 (2021-05-05)

- Upgrade to RN 0.64
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Edge is known to build with this exact tool set. Updated versions of these tools
- macOS Catalina 10.15.6
- Xcode 12.1
- Android Studio 4.1
- CocoaPods 1.10.0
- CocoaPods 1.10.1
- Android NDK r21d
- NodeJS 14.15.0
- NPM 6.14.8
Expand Down
4 changes: 4 additions & 0 deletions flow-typed/Ignored.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ declare module 'edge-plugin-bity' {
declare module.exports: any
}

declare module 'react-native-confetti-cannon' {
declare module.exports: any
}

declare module 'react-native-camera' {
declare module.exports: any
}
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PODS:
- disklet (0.4.5):
- React
- DoubleConversion (1.1.6)
- edge-login-ui-rn (0.9.1):
- edge-login-ui-rn (0.9.2):
- React
- FBLazyVector (0.64.0)
- FBReactNativeSpec (0.64.0):
Expand Down Expand Up @@ -819,7 +819,7 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
disklet: 4f586f90b70fdb46f06614a5b7342eda5c90f253
DoubleConversion: cde416483dac037923206447da6e1454df403714
edge-login-ui-rn: 965cb13c3287f750f8ad25911020f9dc874b5886
edge-login-ui-rn: ec4ebbd0a919fe7a43ce18ac60bd2066e19312e8
FBLazyVector: 49cbe4b43e445b06bf29199b6ad2057649e4c8f5
FBReactNativeSpec: 1e13267222bde0a00017bffd3e9c3e895de2fbaa
Firebase: e1e089d9aac215a52442583f818ab61de3c4581b
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edge-react-gui",
"version": "2.0.10",
"version": "2.0.11",
"private": true,
"description": "Edge Wallet React GUI",
"homepage": "https://edge.app",
Expand Down Expand Up @@ -133,12 +133,12 @@
"detox": "^18.10.0",
"disklet": "^0.4.5",
"edge-components": "^0.0.31",
"edge-core-js": "^0.17.32",
"edge-currency-accountbased": "^0.7.55",
"edge-core-js": "^0.17.33",
"edge-currency-accountbased": "^0.7.58",
"edge-currency-bitcoin": "^4.9.14",
"edge-currency-monero": "^0.2.10",
"edge-exchange-plugins": "^0.11.25",
"edge-login-ui-rn": "^0.9.1",
"edge-exchange-plugins": "^0.11.27",
"edge-login-ui-rn": "^0.9.2",
"lodash": "^4.17.19",
"qrcode-generator": "^1.4.4",
"react": "17.0.1",
Expand All @@ -147,6 +147,7 @@
"react-native-camera": "git://github.com/EdgeApp/react-native-camera.git#edge-fixes",
"react-native-check-version": "^1.0.5",
"react-native-circular-progress": "^1.3.6",
"react-native-confetti-cannon": "^1.5.2",
"react-native-contacts": "^7.0.0",
"react-native-device-info": "^5.6.1",
"react-native-extra-dimensions-android": "^1.2.5",
Expand Down Expand Up @@ -197,9 +198,9 @@
"babel-jest": "^26.6.3",
"babel-loader": "^8.0.5",
"body-parser": "^1.18.2",
"edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#36c597e5ac9d53db87ee1f705360f9cc937b7b52",
"edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#f04ee29c23bf5621f87dedb6d2fb1c83a18781bc",
"edge-plugin-simplex": "https://github.com/EdgeApp/edge-plugin-simplex.git#efb0f2280192894e4c24e28e297d0e466f2d333b",
"edge-plugin-wyre": "https://github.com/EdgeApp/edge-plugin-wyre.git#3ff34e5f6ebdfea1199f6acccedc703cc9abcd7a",
"edge-plugin-wyre": "https://github.com/EdgeApp/edge-plugin-wyre.git#5aa2379dbd4045b8a514427b442bd59ca57c21b0",
"eslint": "7.14.0",
"eslint-config-standard-kit": "^0.14.4",
"eslint-plugin-detox": "^1.0.0",
Expand Down
38 changes: 21 additions & 17 deletions src/__tests__/__snapshots__/Request.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,27 @@ exports[`Request should render with loaded props 1`] = `
>
Request
</WithTheme(EdgeTextComponent)>
<ExchangedFlipInput
exchangeSecondaryToPrimaryRatio={Object {}}
forceUpdateGuiCounter={0}
headerCallback={[Function]}
headerText="Receive to undefined"
inputAccessoryViewID=""
isEditable={true}
isFiatOnTop={true}
isFocus={false}
keyboardVisible={false}
onExchangeAmountChanged={[Function]}
onNext={[Function]}
overridePrimaryExchangeAmount=""
primaryCurrencyInfo={Object {}}
secondaryCurrencyInfo={Object {}}
topReturnKeyType="done"
/>
<WithTheme(CardComponent)
marginRem={0}
>
<ExchangedFlipInput
exchangeSecondaryToPrimaryRatio={Object {}}
forceUpdateGuiCounter={0}
headerCallback={[Function]}
headerText="Receive to undefined"
inputAccessoryViewID=""
isEditable={true}
isFiatOnTop={true}
isFocus={false}
keyboardVisible={false}
onExchangeAmountChanged={[Function]}
onNext={[Function]}
overridePrimaryExchangeAmount=""
primaryCurrencyInfo={Object {}}
secondaryCurrencyInfo={Object {}}
topReturnKeyType="done"
/>
</WithTheme(CardComponent)>
<InputAccessoryView
backgroundColor="#FFFFFF"
nativeID="cancelHeaderId"
Expand Down
6 changes: 6 additions & 0 deletions src/__tests__/__snapshots__/RootReducer.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,15 @@ Object {
"FTC": Object {
"denomination": "100000000",
},
"FTM": Object {
"denomination": "1000000000000000000",
},
"FUN": Object {
"denomination": "100000000",
},
"FUSDT": Object {
"denomination": "1000000",
},
"GLM": Object {
"denomination": "1000000000000000000",
},
Expand Down
4 changes: 4 additions & 0 deletions src/__tests__/__snapshots__/SettingsScene.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ exports[`MyComponent should render Locked SettingsOverview 1`] = `
</View>
<Text
adjustsFontSizeToFit={true}
minimumFontScale={0.65}
numberOfLines={1}
style={
Array [
Expand Down Expand Up @@ -513,6 +514,7 @@ exports[`MyComponent should render Locked SettingsOverview 1`] = `
</View>
<Text
adjustsFontSizeToFit={true}
minimumFontScale={0.65}
numberOfLines={1}
style={
Array [
Expand Down Expand Up @@ -1506,6 +1508,7 @@ exports[`MyComponent should render UnLocked SettingsOverview 1`] = `
</View>
<Text
adjustsFontSizeToFit={true}
minimumFontScale={0.65}
numberOfLines={1}
style={
Array [
Expand Down Expand Up @@ -1925,6 +1928,7 @@ exports[`MyComponent should render UnLocked SettingsOverview 1`] = `
</View>
<Text
adjustsFontSizeToFit={true}
minimumFontScale={0.65}
numberOfLines={1}
style={
Array [
Expand Down
10 changes: 5 additions & 5 deletions src/actions/CryptoExchangeActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const getQuoteForTransaction = (info: SetNativeAmountInfo) => async (disp
}

const swapInfo = await fetchSwapQuote(state, request)

Actions[Constants.EXCHANGE_QUOTE_SCENE]({ swapInfo })
dispatch({ type: 'UPDATE_SWAP_QUOTE', data: swapInfo })
} catch (error) {
Expand Down Expand Up @@ -202,6 +203,7 @@ async function fetchSwapQuote(state: RootState, request: EdgeSwapRequest): Promi
)
const feeFiatAmount = formatNumber(feeFiatAmountRaw || 0, { toFixed: 2 })
const fee = `${feeDisplayAmount} ${feeDenomination.name} (${feeFiatAmount} ${fromWallet.fiatCurrencyCode.replace('iso:', '')})`
const fromTotalFiat = formatNumber(fromBalanceInFiatRaw + feeFiatAmountRaw, { toFixed: 2 })

// Format to amount:
const toPrimaryInfo = state.cryptoExchange.toWalletPrimaryInfo
Expand All @@ -221,6 +223,7 @@ async function fetchSwapQuote(state: RootState, request: EdgeSwapRequest): Promi
fee,
fromDisplayAmount,
fromFiat,
fromTotalFiat,
toDisplayAmount,
toFiat
}
Expand Down Expand Up @@ -336,16 +339,13 @@ export const shiftCryptoCurrency = (swapInfo: GuiSwapInfo) => async (dispatch: D
name,
category
}
Actions.popTo(Constants.EXCHANGE_SCENE)
Actions[Constants.EXCHANGE_SUCCESS_SCENE]()
await fromWallet.saveTxMetadata(result.transaction.txid, result.transaction.currencyCode, edgeMetaData)

dispatch({ type: 'SHIFT_COMPLETE' })

updateSwapCount(state)

setTimeout(() => {
Alert.alert(s.strings.exchange_succeeded, s.strings.exchanges_may_take_minutes)
}, 1)
const exchangeAmount = await toWallet.nativeToDenomination(toNativeAmount, toCurrencyCode)
const trackConversionOpts: { [key: string]: any } = {
account,
Expand All @@ -362,7 +362,7 @@ export const shiftCryptoCurrency = (swapInfo: GuiSwapInfo) => async (dispatch: D
logEvent('SwapFailed')
dispatch({ type: 'DONE_SHIFT_TRANSACTION' })
setTimeout(() => {
Alert.alert(s.strings.exchange_failed, error.message)
showError(`${s.strings.exchange_failed}. ${error.message}`)
}, 1)
}
}
Expand Down
12 changes: 9 additions & 3 deletions src/actions/SendConfirmationActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import type { Dispatch, GetState } from '../types/reduxTypes.js'
import { convertNativeToExchange } from '../util/utils'
import { playSendSound } from './SoundActions.js'

const XRP_DESTINATION_TAG_ERRORS = {
UNIQUE_IDENTIFIER_EXCEEDS_LENGTH: s.strings.send_make_spend_xrp_dest_tag_length_error,
UNIQUE_IDENTIFIER_EXCEEDS_LIMIT: s.strings.send_make_spend_xrp_dest_tag_limit_error,
UNIQUE_IDENTIFIER_FORMAT: s.strings.send_make_spend_xrp_dest_tag_format_error
}

export type FioSenderInfo = {
fioAddress: string,
fioWallet: EdgeCurrencyWallet | null,
Expand Down Expand Up @@ -459,9 +465,9 @@ export const updateTransactionAmount = (nativeAmount: string, exchangeAmount: st
})
.catch(error => {
let customError
const xrpLengthErrorCode = coreWallet.currencyInfo.defaultSettings.errorCodes.UNIQUE_IDENTIFIER_EXCEEDS_LENGTH
if (xrpLengthErrorCode != null && xrpLengthErrorCode === error.labelCode) {
customError = new Error(s.strings.send_make_spend_xrp_dest_tag_error)

if (coreWallet.currencyInfo.defaultSettings.errorCodes[error.labelCode] != null) {
customError = new Error(XRP_DESTINATION_TAG_ERRORS[error.labelCode])
}

console.log(error)
Expand Down
22 changes: 11 additions & 11 deletions src/components/Main.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import { CreateWalletImportScene } from '../components/scenes/CreateWalletImport
import { CreateWalletReviewScene } from '../components/scenes/CreateWalletReviewScene.js'
import { CreateWalletSelectCryptoScene } from '../components/scenes/CreateWalletSelectCryptoScene.js'
import { CreateWalletSelectFiatScene } from '../components/scenes/CreateWalletSelectFiatScene.js'
import { CryptoExchangeQuote } from '../components/scenes/CryptoExchangeQuoteScene.js'
import { CryptoExchangeScene } from '../components/scenes/CryptoExchangeScene.js'
import { CryptoExchangeSuccessScene } from '../components/scenes/CryptoExchangeSuccessScene.js'
import { CurrencySettingsScene } from '../components/scenes/CurrencySettingsScene.js'
import { DefaultFiatSettingScene } from '../components/scenes/DefaultFiatSettingScene.js'
import { FioAddressDetailsScene } from '../components/scenes/FioAddressDetailsScene'
Expand All @@ -39,7 +41,6 @@ import RequestDropMenu from '../connectors/components/HeaderMenuRequestConnector
import AddToken from '../connectors/scenes/AddTokenConnector.js'
import { CreateWalletAccountSelectConnector } from '../connectors/scenes/CreateWalletAccountSelectConnector.js'
import { CreateWalletAccountSetupConnector } from '../connectors/scenes/CreateWalletAccountSetupConnector.js'
import { CryptoExchangeQuoteConnector } from '../connectors/scenes/CryptoExchangeQuoteConnector.js'
import EdgeLoginSceneConnector from '../connectors/scenes/EdgeLoginSceneConnector'
import ManageTokens from '../connectors/scenes/ManageTokensConnector.js'
import Scan from '../connectors/scenes/ScanConnector'
Expand Down Expand Up @@ -69,7 +70,7 @@ import { ChangeMiningFeeScene } from './scenes/ChangeMiningFeeScene.js'
import { ChangePasswordScene } from './scenes/ChangePasswordScene.js'
import { ChangePinScene } from './scenes/ChangePinScene.js'
import { CreateWalletName } from './scenes/CreateWalletNameScene.js'
import { CryptoExchangeQuoteProcessingScreenComponent } from './scenes/CryptoExchangeQuoteProcessingScene.js'
import { CryptoExchangeQuoteProcessingScreen } from './scenes/CryptoExchangeQuoteProcessingScene.js'
import { CurrencyNotificationScene } from './scenes/CurrencyNotificationScene'
import { EditTokenScene } from './scenes/EditTokenScene.js'
import { FioDomainRegisterScene } from './scenes/FioDomainRegisterScene'
Expand Down Expand Up @@ -335,7 +336,6 @@ export class MainComponent extends React.Component<Props> {
renderRightButton={this.renderEmptyButton()}
/>
</Stack>

<Stack key={Constants.PLUGIN_BUY}>
<Scene
key={Constants.PLUGIN_BUY}
Expand All @@ -356,7 +356,6 @@ export class MainComponent extends React.Component<Props> {
hideTabBar
/>
</Stack>

<Stack key={Constants.PLUGIN_SELL}>
<Scene
key={Constants.PLUGIN_SELL}
Expand All @@ -377,13 +376,11 @@ export class MainComponent extends React.Component<Props> {
hideTabBar
/>
</Stack>

<Stack key={Constants.EXCHANGE}>
<Scene
key={Constants.EXCHANGE_SCENE}
navTransparent
component={ifLoggedIn(CryptoExchangeScene)}
renderTitle={<HeaderTitle title={s.strings.title_exchange} />}
renderLeftButton={this.renderExchangeButton()}
renderRightButton={<SideMenuButton />}
onEnter={() => this.props.checkEnabledExchanges()}
Expand All @@ -392,18 +389,21 @@ export class MainComponent extends React.Component<Props> {
key={Constants.EXCHANGE_QUOTE_PROCESSING_SCENE}
navTransparent
hideTabBar
component={ifLoggedIn(CryptoExchangeQuoteProcessingScreenComponent)}
renderTitle={<HeaderTitle title={s.strings.title_exchange} />}
component={ifLoggedIn(CryptoExchangeQuoteProcessingScreen)}
renderLeftButton={this.renderEmptyButton()}
renderRightButton={this.renderEmptyButton()}
/>
<Scene
key={Constants.EXCHANGE_QUOTE_SCENE}
navTransparent
component={ifLoggedIn(CryptoExchangeQuoteConnector)}
renderTitle={<HeaderTitle title={s.strings.title_exchange} />}
component={ifLoggedIn(CryptoExchangeQuote)}
renderLeftButton={<BackButton onPress={this.handleBack} />}
renderRightButton={<SideMenuButton />}
/>
<Scene
key={Constants.EXCHANGE_SUCCESS_SCENE}
navTransparent
component={ifLoggedIn(CryptoExchangeSuccessScene)}
renderLeftButton={this.renderEmptyButton()}
/>
</Stack>
</Tabs>
Expand Down
Loading

0 comments on commit bcfdb61

Please sign in to comment.