-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: address book + new send flow (#1239)
* basic components * basic components * updates * wip * between my accounts * basic add contact * render list * inputs func components * handle from selection * from identicon * onchangetoaddress * add to address book modal * add from modal and parse asdress book * scan qr * select own accounts * reverse ens and better state * handle parse * clear to * handle account label * next and redux * handle to ens * parse address book * handle send flow navigation * amount view * render only tokens * pick selected asset * redux set selected address * use max * switch currency * confirm * clean * init confirm * confirm view * render fiat in confirm * handle eth txs * handle erc20 txs * parseTransactionData * wait for gas estimation * custom gas modal * handle gas selection * handle advanced tx fee * custom gas improvs * handle gas selected * handle current selected when cancel * use time estimates * handle amount errors * address search * typo * recents * parsedRecents * cleaner code * handle address errors * handle more error cases * fix usemax * handle global primary currency * handle use max with fiat as prim currency * switch currency working * set asset before and fix switched symbol * render gas wait time * improve gas selectors * add weeks and days * better parsewaittime * fix selected asset change * improve conversion * parseTransactionData " * validate gas on confirm * handle use max with gas for eth * add gas estimation in amount * estimatedTotalGas once on mount * send tx * gas bug on amount * render collectibles in list * handle collectibles list and data * handle collectible on confirm * ignore No stops in gradient * handle focus * handle tradable collectibles and sort them * handle tokens without exchange rate * check collectible removal * start tx from asset * go to new send flow from everywhere * hex data modal * reset tx on unmount * delete unused files * reset tx * start tx with asset * redux update * clean state * isETH * highlight address to * use currency symbols and texttransfor uppercase * handle currency code in amount input * send to up to date design * amount up to date design * confirm up to date design * send to up to date design android * next buttons margin bottom * input amount font * fix texts color * fix androi dpaste * alignments * handle mmm txs * handle ens name when resolved * formatting and locales * add contacts from settings * no need for edit component * handle add validation * locales * rename route * delete contact * spanish * handle scan and android' * more locales * address ready when edit * snappppppsSs * others * fix reverse ens * disable add address without an alias * fixes * address elemenr * snaps * custom gas validation * locale missing * check decimal * comments * snaps * fix key * fix assets * fix use mac * renderFiatAddition * fix empty data * snaps * fix gas calculation for erc721 * rm logs * validation * handle change from without asset * use flat list * rm unused code * rename * fix delete * fix empty bug * fix margin issue 10 * issue 11 * 12 * send qr to old sendflow 13 * snaps * fix others contacts * fix edit * use mac * lte * bn(0) * fix 13 * handle space and emojis * fix validation * contact form with refs * snapS
- Loading branch information
1 parent
52fea8c
commit e0c0b07
Showing
73 changed files
with
6,249 additions
and
178 deletions.
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,72 @@ | ||
import TransactionTypes from '../../core/TransactionTypes'; | ||
|
||
const { | ||
ASSET: { ETH, ERC20, ERC721 } | ||
} = TransactionTypes; | ||
|
||
/** | ||
* 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 | ||
}; | ||
} | ||
|
||
/** | ||
* 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
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.