-
-
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: address book + new send flow #1239
Merged
Merged
Changes from 125 commits
Commits
Show all changes
160 commits
Select commit
Hold shift + click to select a range
4446993
basic components
estebanmino 42ec6d9
basic components
estebanmino e196ac9
updates
estebanmino 2dbd37e
wip
estebanmino 6a96323
between my accounts
estebanmino ba2c317
basic add contact
estebanmino f1448f5
render list
estebanmino 8824c1e
inputs func components
estebanmino 96e9ff1
handle from selection
estebanmino 6a011d6
from identicon
estebanmino ccc9fb0
onchangetoaddress
estebanmino 59cebc9
add to address book modal
estebanmino a7a3a1e
add from modal and parse asdress book
estebanmino b97707f
scan qr
estebanmino d1b93a1
select own accounts
estebanmino 465476f
reverse ens and better state
estebanmino f77ae1d
handle parse
estebanmino 5287731
clear to
estebanmino 2d38051
handle account label
estebanmino 98388d6
next and redux
estebanmino f414f6b
handle to ens
estebanmino a0318ff
parse address book
estebanmino ae9efff
handle send flow navigation
estebanmino 812056a
amount view
estebanmino 91ac956
render only tokens
estebanmino a384dc6
pick selected asset
estebanmino 7804d9c
redux set selected address
estebanmino 584f9de
use max
estebanmino 7a546a1
switch currency
estebanmino 6d9f8fa
confirm
estebanmino 0241097
clean
estebanmino 6394378
init confirm
estebanmino b03d760
confirm view
estebanmino 62b36e0
render fiat in confirm
estebanmino 2465537
handle eth txs
estebanmino acc9f41
handle erc20 txs
estebanmino 3fb8ff4
parseTransactionData
estebanmino e99f8ae
wait for gas estimation
estebanmino 0461d11
custom gas modal
estebanmino 250c225
handle gas selection
estebanmino 9e2d9e5
handle advanced tx fee
estebanmino 9fd5049
custom gas improvs
estebanmino b817d0c
handle gas selected
estebanmino e8176bb
handle current selected when cancel
estebanmino c30442b
use time estimates
estebanmino 61246f9
handle amount errors
estebanmino 9310fde
address search
estebanmino 907e98f
typo
estebanmino 55ad49b
recents
estebanmino 3326913
parsedRecents
estebanmino b525c1e
cleaner code
estebanmino 9cd5080
handle address errors
estebanmino 0832840
handle more error cases
estebanmino a6c8e09
fix usemax
estebanmino 6798468
handle global primary currency
estebanmino 0593e9e
handle use max with fiat as prim currency
estebanmino 593a50a
switch currency working
estebanmino c300255
set asset before and fix switched symbol
estebanmino add6593
render gas wait time
estebanmino 3e7fe6d
improve gas selectors
estebanmino 153c1c1
add weeks and days
estebanmino 1f3e24e
better parsewaittime
estebanmino 33b28e6
fix selected asset change
estebanmino 9ed0243
improve conversion
estebanmino a6595e8
parseTransactionData
estebanmino e500106
validate gas on confirm
estebanmino 320ca11
handle use max with gas for eth
estebanmino 46c32fa
add gas estimation in amount
estebanmino a6e61c4
estimatedTotalGas once on mount
estebanmino a25f0b6
send tx
estebanmino bd51233
gas bug on amount
estebanmino 69706a6
render collectibles in list
estebanmino a0b4287
handle collectibles list and data
estebanmino 0657963
handle collectible on confirm
estebanmino 1537868
ignore No stops in gradient
estebanmino a6255e3
handle focus
estebanmino 1a527d3
handle tradable collectibles and sort them
estebanmino 6e833a4
handle tokens without exchange rate
estebanmino 98184d0
check collectible removal
estebanmino f18fd2c
start tx from asset
estebanmino 515a8c0
go to new send flow from everywhere
estebanmino 3711585
hex data modal
estebanmino 1caa91b
reset tx on unmount
estebanmino fb54961
delete unused files
estebanmino beaf656
reset tx
estebanmino 5f04ada
start tx with asset
estebanmino baf76c2
redux update
estebanmino c90be4b
clean state
estebanmino feaab16
isETH
estebanmino 12b9187
highlight address to
estebanmino 143f965
use currency symbols and texttransfor uppercase
estebanmino 2d9e4e3
handle currency code in amount input
estebanmino 34aeefa
send to up to date design
estebanmino 88094ca
amount up to date design
estebanmino b1ed849
confirm up to date design
estebanmino 61a3689
send to up to date design android
estebanmino 42f6efa
next buttons margin bottom
estebanmino 254a0d4
input amount font
estebanmino 81050a3
fix texts color
estebanmino 88f8c06
fix androi dpaste
estebanmino 5751b8a
alignments
estebanmino 1569558
handle mmm txs
estebanmino dc1c251
handle ens name when resolved
estebanmino f9b4491
formatting and locales
estebanmino 3581b28
add contacts from settings
estebanmino ce608d9
no need for edit component
estebanmino b2f66dd
handle add validation
estebanmino 27d1d89
locales
estebanmino 0b04af8
rename route
estebanmino 82ee0b5
delete contact
estebanmino 8321d2c
spanish
estebanmino 818fcd7
handle scan and android'
estebanmino d99c91d
more locales
estebanmino de5279e
address ready when edit
estebanmino bca8bf2
snappppppsSs
estebanmino 12e1ab6
Merge branch 'develop' into feature/address-book
estebanmino b349388
others
estebanmino c2ab99f
fix reverse ens
estebanmino deb5324
disable add address without an alias
estebanmino fb9d3c4
fixes
estebanmino b0a78be
address elemenr
estebanmino c216e3f
snaps
estebanmino 0be0475
custom gas validation
estebanmino 0b534f0
locale missing
estebanmino e8a5c84
check decimal
estebanmino 1e98ffd
comments
estebanmino 6d68e0b
snaps
estebanmino 1176fa7
fix key
estebanmino e4fb0e3
fix assets
estebanmino b47d5ee
fix use mac
estebanmino 7926ac7
renderFiatAddition
estebanmino fdfc77c
fix empty data
estebanmino 4c63753
snaps
estebanmino 72700f5
fix gas calculation for erc721
estebanmino d0e5d5e
Merge branch 'develop' into feature/address-book
estebanmino 0213035
rm logs
estebanmino a8a2dfc
validation
estebanmino 42e784e
handle change from without asset
estebanmino e6ffa84
use flat list
estebanmino 806424e
rm unused code
estebanmino 93f0e97
rename
estebanmino 9a526e7
fix delete
estebanmino e2d2a82
fix empty bug
estebanmino 4ad6d35
fix margin issue 10
estebanmino ea6623e
issue 11
estebanmino 68fb904
12
estebanmino 19b293e
send qr to old sendflow 13
estebanmino 1a76bc9
snaps
estebanmino adfe114
Merge branch 'develop' into feature/address-book
estebanmino 6a5a023
fix others contacts
estebanmino 38f9dca
fix edit
estebanmino ec25daf
use mac
estebanmino 28a19f4
lte
estebanmino 11da3ea
bn(0)
estebanmino 03837c2
fix 13
estebanmino 9ab0c52
handle space and emojis
estebanmino ca2dd53
fix validation
estebanmino 5802545
contact form with refs
estebanmino 5921076
snapS
estebanmino e8d4043
Merge branch 'develop' into feature/address-book
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* Clears transaction object completely | ||
*/ | ||
export function resetTransaction() { | ||
return { | ||
type: 'RESET_TRANSACTION' | ||
}; | ||
} | ||
|
||
/** | ||
* Starts a new transaction state with an asset | ||
* | ||
* @param {object} selectedAsset - Asset to start the transaction with | ||
*/ | ||
export function newAssetTransaction(selectedAsset) { | ||
return { | ||
type: 'NEW_ASSET_TRANSACTION', | ||
selectedAsset, | ||
assetType: selectedAsset.isETH ? 'ETH' : selectedAsset.tokenId ? 'ERC721' : 'ERC20' | ||
}; | ||
} | ||
|
||
/** | ||
* Sets transaction to address and ensRecipient in case is available | ||
* | ||
* @param {string} from - Address to send the transaction from | ||
* @param {string} to - Address to send the transaction to | ||
* @param {string} ensRecipient - Resolved ens name to send the transaction to | ||
* @param {string} transactionToName - Resolved address book name for to address | ||
* @param {string} transactionFromName - Resolved address book name for from address | ||
*/ | ||
export function setRecipient(from, to, ensRecipient, transactionToName, transactionFromName) { | ||
return { | ||
type: 'SET_RECIPIENT', | ||
from, | ||
to, | ||
ensRecipient, | ||
transactionToName, | ||
transactionFromName | ||
}; | ||
} | ||
|
||
/** | ||
* Sets asset as selectedAsset | ||
* | ||
* @param {object} selectedAsset - Asset to start the transaction with | ||
*/ | ||
export function setSelectedAsset(selectedAsset) { | ||
return { | ||
type: 'SET_SELECTED_ASSET', | ||
selectedAsset, | ||
assetType: selectedAsset.isETH ? 'ETH' : selectedAsset.tokenId ? 'ERC721' : 'ERC20' | ||
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. same |
||
}; | ||
} | ||
|
||
/** | ||
* Sets transaction object to be sent | ||
* | ||
* @param {object} transaction - Transaction object with from, to, data, gas, gasPrice, value | ||
*/ | ||
export function prepareTransaction(transaction) { | ||
return { | ||
type: 'PREPARE_TRANSACTION', | ||
transaction | ||
}; | ||
} |
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 |
---|---|---|
|
@@ -30,6 +30,7 @@ import ExperimentalSettings from '../../Views/Settings/ExperimentalSettings'; | |
import NetworksSettings from '../../Views/Settings/NetworksSettings'; | ||
import NetworkSettings from '../../Views/Settings/NetworksSettings/NetworkSettings'; | ||
import AppInformation from '../../Views/Settings/AppInformation'; | ||
import Contacts from '../../Views/Settings/Contacts'; | ||
import Wallet from '../../Views/Wallet'; | ||
import TransactionsView from '../../Views/TransactionsView'; | ||
import SyncWithExtension from '../../Views/SyncWithExtension'; | ||
|
@@ -38,6 +39,7 @@ import AddAsset from '../../Views/AddAsset'; | |
import Collectible from '../../Views/Collectible'; | ||
import CollectibleView from '../../Views/CollectibleView'; | ||
import Send from '../../Views/Send'; | ||
import SendTo from '../../Views/SendFlow/SendTo'; | ||
import RevealPrivateCredential from '../../Views/RevealPrivateCredential'; | ||
import WalletConnectSessions from '../../Views/WalletConnectSessions'; | ||
import OfflineMode from '../../Views/OfflineMode'; | ||
|
@@ -87,6 +89,9 @@ import contractMap from 'eth-contract-metadata'; | |
import MessageSign from '../../UI/MessageSign'; | ||
import WalletConnectReturnToBrowserModal from '../../UI/WalletConnectReturnToBrowserModal'; | ||
import AsyncStorage from '@react-native-community/async-storage'; | ||
import Amount from '../../Views/SendFlow/Amount'; | ||
import Confirm from '../../Views/SendFlow/Confirm'; | ||
import ContactForm from '../../Views/Settings/Contacts/ContactForm'; | ||
|
||
const styles = StyleSheet.create({ | ||
flex: { | ||
|
@@ -203,6 +208,12 @@ const MainNavigator = createStackNavigator( | |
CompanySettings: { | ||
screen: AppInformation | ||
}, | ||
ContactsSettings: { | ||
screen: Contacts | ||
}, | ||
ContactForm: { | ||
screen: ContactForm | ||
}, | ||
SyncWithExtensionView: { | ||
screen: SyncWithExtension | ||
}, | ||
|
@@ -242,6 +253,19 @@ const MainNavigator = createStackNavigator( | |
} | ||
}) | ||
}, | ||
SendFlowView: { | ||
screen: createStackNavigator({ | ||
SendTo: { | ||
screen: SendTo | ||
}, | ||
Amount: { | ||
screen: Amount | ||
}, | ||
Confirm: { | ||
screen: Confirm | ||
} | ||
}) | ||
}, | ||
ApprovalView: { | ||
screen: createStackNavigator({ | ||
Approval: { | ||
|
@@ -734,7 +758,7 @@ class Main extends PureComponent { | |
}; | ||
|
||
onUnapprovedTransaction = async transactionMeta => { | ||
if (this.props.transaction.value || this.props.transaction.to) { | ||
if (this.props.transaction.value || this.props.transaction.to || transactionMeta.origin === 'MMM') { | ||
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. that MMM could be part of the same utils file I mentioned in the previous comments |
||
return; | ||
} | ||
// Check if it's a payment channel deposit transaction to sign | ||
|
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.
Since we have this strings in a few different places, maybe it's time to have a transactionTypes utils and set them all as constants to avoid misspelling like
ERC_20
,ERC_721
, etc