-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: advanced custom rpc #661
Merged
Merged
Changes from 32 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
248ba5a
add rpc target chainid ticker and nickname
estebanmino d86187b
use network nickname
estebanmino 60e5027
add isETH
estebanmino e4feb71
use of ticker
estebanmino 1efffbe
move settings component to settings
estebanmino 26b0189
basic networks settings
estebanmino 29373ef
basic network settings
estebanmino 0a7be7b
add and edit forms
estebanmino d2fdecd
adding custom rpc from network settings
estebanmino 98bc41c
add block explorer url
estebanmino 83caeaa
handle action anabled
estebanmino 6baf297
validate chainid
estebanmino b5b970d
doc and locales
estebanmino 0dca0a3
drawer view in blockexplorer
estebanmino cdca683
handle block explorer from tx detauls
estebanmino 48944b9
handle tx unit with ticker
estebanmino e78f358
configure native currency
estebanmino 148982e
if no conversion rate shpiw 0
estebanmino 55b029e
handle send from drawer
estebanmino ad5760c
handle render from wei
estebanmino e444ac0
handle eth input
estebanmino 2e804f7
action keys
estebanmino d80feba
update snapshots
estebanmino 3943d8e
create snapshots
estebanmino ba52200
more locales
estebanmino 526a38c
conditional rpc rendering in networks sett
estebanmino 13bcc76
network icon top
estebanmino 13ee5ee
ticker to uppercase
estebanmino 51c1c62
android ui
estebanmino 96071f3
small fixes
estebanmino fbda130
more android
estebanmino a16cd30
merge dev
estebanmino c66f801
getticker getblockexoplorer
estebanmino 30fc571
parse url name
estebanmino c11fe3b
bump gaba
estebanmino af78468
Merge branch 'develop' into feature/advanced-custom-rpc
estebanmino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ import { connect } from 'react-redux'; | |
import { hexToBN } from 'gaba/util'; | ||
import { toChecksumAddress } from 'ethereumjs-util'; | ||
import { weiToFiat, renderFromWei } from '../../../util/number'; | ||
import { strings } from '../../../../locales/i18n'; | ||
import { ScrollView } from 'react-native-gesture-handler'; | ||
import { strings } from '../../../../locales/i18n'; | ||
|
||
const styles = StyleSheet.create({ | ||
root: { | ||
|
@@ -126,7 +126,11 @@ class AccountSelect extends Component { | |
/** | ||
* Primary currency, either ETH or Fiat | ||
*/ | ||
primaryCurrency: PropTypes.string | ||
primaryCurrency: PropTypes.string, | ||
/** | ||
* Current provider ticker | ||
*/ | ||
ticker: PropTypes.string | ||
}; | ||
|
||
static defaultProps = { | ||
|
@@ -153,17 +157,17 @@ class AccountSelect extends Component { | |
} | ||
|
||
renderOption(account, onPress) { | ||
const { conversionRate, currentCurrency, primaryCurrency } = this.props; | ||
const { conversionRate, currentCurrency, primaryCurrency, ticker } = this.props; | ||
const balance = hexToBN(account.balance); | ||
|
||
// render balances according to selected 'primaryCurrency' | ||
let mainBalance, secondaryBalance; | ||
if (primaryCurrency === 'ETH') { | ||
mainBalance = renderFromWei(balance) + ' ' + strings('unit.eth'); | ||
secondaryBalance = weiToFiat(balance, conversionRate, currentCurrency).toUpperCase(); | ||
mainBalance = renderFromWei(balance) + ' ' + ticker || strings('unit.eth'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we have a getTicker fn under utils that receives ticker and returns |
||
secondaryBalance = weiToFiat(balance, conversionRate, currentCurrency.toUpperCase()); | ||
} else { | ||
mainBalance = weiToFiat(balance, conversionRate, currentCurrency).toUpperCase(); | ||
secondaryBalance = renderFromWei(balance) + ' ' + strings('unit.eth'); | ||
mainBalance = weiToFiat(balance, conversionRate, currentCurrency.toUpperCase()); | ||
secondaryBalance = renderFromWei(balance) + ' ' + ticker || strings('unit.eth'); | ||
} | ||
|
||
return ( | ||
|
@@ -218,7 +222,8 @@ const mapStateToProps = state => ({ | |
identities: state.engine.backgroundState.PreferencesController.identities, | ||
currentCurrency: state.engine.backgroundState.CurrencyRateController.currentCurrency, | ||
selectedAddress: state.engine.backgroundState.PreferencesController.selectedAddress, | ||
primaryCurrency: state.settings.primaryCurrency | ||
primaryCurrency: state.settings.primaryCurrency, | ||
ticker: state.engine.backgroundState.NetworkController.provider.ticker | ||
}); | ||
|
||
export default connect(mapStateToProps)(AccountSelect); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
teh other one is Network
s
SettingsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should start wearning my 👓