safe-react/src/utils/constants.ts

31 lines
1.9 KiB
TypeScript
Raw Normal View History

(Feature) - xDai Compatibility (#1476) * feat: Support for Volta and EWC * chore: Store network ID in the ETHEREUM_NETWORK enum itself * chore: forward tx and address to non-etherscan explorers * fix test, avoid assigning enum to const * (Feature) [xDai] - Create network-based configurations (#1420) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * (Feature) [xDai] Use generic config (#1422) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * fix function name after merge development * (Feature) [xDai] - Contract interaction abi lookup (#1429) * Filter Apps by network (#1433) * Filter apps by network * (Feature) [xDai] - Parametrize ethscan values (#1424) * (Feature) [xDai] - Use parametrized network values (#1437) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Use tx service for loading token info (#1435) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Visually differentiate networks (#1431) Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> * (Feature) [xDai] - Cosmetic fixes (#1449) * Add staging configuration for deployment using xDai (#1459) * Add staging xDai deployment to travis * Add safe apps production url for xdai * Add travis rule to build xDai on master or integration branch * (Bugfix) Set min height to ListContentLayout wrapper #1447 (#1451) * fix min-height app container and margin to info text at bottom * change css unit from % to vh Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * disable OpenZepplin in xDai (#1465) * remove any in config/index.ts (#1462) * [xDai] Parametrize Native Coin (#1444) * fix `generateBatchRequest` calls * Fix some ETH harcoded values + Add tests * Fix null or undefined value * Move nativeCoin outside component + fix toTokenInput function * Remove native coin from useEffect Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Disable safe sections based on network config (#1468) * Adds FEATURES enum Renames features to disabledFeatures * Uses FEATURES enum instead of hard-coded contract features * Refactor enabledFeatures function, now checks that there are not disabled features by config before return the enabledFeatures result * Adds SAFE_APPS and CONTRACT_INTERACTION to FEATURES enum * Remove SAFE_APPS from sidebar if disabled * Redirect user from /apps if safe apps are disabled * Disables contract interaction from config * Remove !remoteOwners * Move settings to a constant * Deploy from xDai integration branch only to xDai staging * Fix .travis.yml warnings * Update branch and condition for staging deployment * Update xDai depoy condition * (Feature) [xDai] - Fetch collectibles from Gnosis services (#1460) * Add https to safe-xdai apps link * make getExplorerInfo return values per network (#1470) * (Fix) "Approve transaction" modal closes (#1477) * add equality function to prevent re-renders - I left the inline equalityFn, as an ad-hoc solution. First, because we're going to remove this when https://github.com/gnosis/safe-react/issues/1479 is done Second, because this way it infers the types defined in the useSelector generics * (Fix) xDai feature issues (#1484) Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * RPC interactions errors (#1475) * Add options to httpProvider * Add log when generateatchRequest fails * add types to generateBarchRequest * fix types in `generateBatchRequests` * add `.d` for imports of definition files * add `undefined` alternative value for `generateBatchRequests` ReturnValues - also, fixed typing errors in related functions * fix return values for `generateBatchRequests` in tests Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) xDai configs (#1489) * (Feature) - Replaces ETH with network native coin (#1491) * Remove networkInfo from the components * Replaces humanReadableValue to fromTokenUnit Co-authored-by: JosephBagaric <bagaricjos@gmail.com> Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> Co-authored-by: nicolas <nicosampler@users.noreply.github.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com> Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
2020-10-18 16:48:22 -03:00
export const APP_ENV = process.env.REACT_APP_ENV
export const NODE_ENV = process.env.NODE_ENV
export const IS_PRODUCTION = process.env.NODE_ENV === 'production'
(Feature) - xDai Compatibility (#1476) * feat: Support for Volta and EWC * chore: Store network ID in the ETHEREUM_NETWORK enum itself * chore: forward tx and address to non-etherscan explorers * fix test, avoid assigning enum to const * (Feature) [xDai] - Create network-based configurations (#1420) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * (Feature) [xDai] Use generic config (#1422) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * fix function name after merge development * (Feature) [xDai] - Contract interaction abi lookup (#1429) * Filter Apps by network (#1433) * Filter apps by network * (Feature) [xDai] - Parametrize ethscan values (#1424) * (Feature) [xDai] - Use parametrized network values (#1437) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Use tx service for loading token info (#1435) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Visually differentiate networks (#1431) Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> * (Feature) [xDai] - Cosmetic fixes (#1449) * Add staging configuration for deployment using xDai (#1459) * Add staging xDai deployment to travis * Add safe apps production url for xdai * Add travis rule to build xDai on master or integration branch * (Bugfix) Set min height to ListContentLayout wrapper #1447 (#1451) * fix min-height app container and margin to info text at bottom * change css unit from % to vh Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * disable OpenZepplin in xDai (#1465) * remove any in config/index.ts (#1462) * [xDai] Parametrize Native Coin (#1444) * fix `generateBatchRequest` calls * Fix some ETH harcoded values + Add tests * Fix null or undefined value * Move nativeCoin outside component + fix toTokenInput function * Remove native coin from useEffect Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Disable safe sections based on network config (#1468) * Adds FEATURES enum Renames features to disabledFeatures * Uses FEATURES enum instead of hard-coded contract features * Refactor enabledFeatures function, now checks that there are not disabled features by config before return the enabledFeatures result * Adds SAFE_APPS and CONTRACT_INTERACTION to FEATURES enum * Remove SAFE_APPS from sidebar if disabled * Redirect user from /apps if safe apps are disabled * Disables contract interaction from config * Remove !remoteOwners * Move settings to a constant * Deploy from xDai integration branch only to xDai staging * Fix .travis.yml warnings * Update branch and condition for staging deployment * Update xDai depoy condition * (Feature) [xDai] - Fetch collectibles from Gnosis services (#1460) * Add https to safe-xdai apps link * make getExplorerInfo return values per network (#1470) * (Fix) "Approve transaction" modal closes (#1477) * add equality function to prevent re-renders - I left the inline equalityFn, as an ad-hoc solution. First, because we're going to remove this when https://github.com/gnosis/safe-react/issues/1479 is done Second, because this way it infers the types defined in the useSelector generics * (Fix) xDai feature issues (#1484) Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * RPC interactions errors (#1475) * Add options to httpProvider * Add log when generateatchRequest fails * add types to generateBarchRequest * fix types in `generateBatchRequests` * add `.d` for imports of definition files * add `undefined` alternative value for `generateBatchRequests` ReturnValues - also, fixed typing errors in related functions * fix return values for `generateBatchRequests` in tests Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) xDai configs (#1489) * (Feature) - Replaces ETH with network native coin (#1491) * Remove networkInfo from the components * Replaces humanReadableValue to fromTokenUnit Co-authored-by: JosephBagaric <bagaricjos@gmail.com> Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> Co-authored-by: nicolas <nicosampler@users.noreply.github.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com> Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
2020-10-18 16:48:22 -03:00
export const NETWORK = process.env.REACT_APP_NETWORK?.toUpperCase() || 'RINKEBY'
export const INTERCOM_ID = APP_ENV === 'production' ? process.env.REACT_APP_INTERCOM_ID : 'plssl1fl'
export const GOOGLE_ANALYTICS_ID = process.env.REACT_APP_GOOGLE_ANALYTICS || ''
export const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN || ''
export const PORTIS_ID = process.env.REACT_APP_PORTIS_ID ?? '852b763d-f28b-4463-80cb-846d7ec5806b'
export const FORTMATIC_KEY = process.env.REACT_APP_FORTMATIC_KEY ?? 'pk_test_CAD437AA29BE0A40'
export const BLOCKNATIVE_KEY = process.env.REACT_APP_BLOCKNATIVE_KEY ?? '7fbb9cee-7e97-4436-8770-8b29a9a8814c'
(Feature) - xDai Compatibility (#1476) * feat: Support for Volta and EWC * chore: Store network ID in the ETHEREUM_NETWORK enum itself * chore: forward tx and address to non-etherscan explorers * fix test, avoid assigning enum to const * (Feature) [xDai] - Create network-based configurations (#1420) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * (Feature) [xDai] Use generic config (#1422) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * fix function name after merge development * (Feature) [xDai] - Contract interaction abi lookup (#1429) * Filter Apps by network (#1433) * Filter apps by network * (Feature) [xDai] - Parametrize ethscan values (#1424) * (Feature) [xDai] - Use parametrized network values (#1437) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Use tx service for loading token info (#1435) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Visually differentiate networks (#1431) Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> * (Feature) [xDai] - Cosmetic fixes (#1449) * Add staging configuration for deployment using xDai (#1459) * Add staging xDai deployment to travis * Add safe apps production url for xdai * Add travis rule to build xDai on master or integration branch * (Bugfix) Set min height to ListContentLayout wrapper #1447 (#1451) * fix min-height app container and margin to info text at bottom * change css unit from % to vh Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * disable OpenZepplin in xDai (#1465) * remove any in config/index.ts (#1462) * [xDai] Parametrize Native Coin (#1444) * fix `generateBatchRequest` calls * Fix some ETH harcoded values + Add tests * Fix null or undefined value * Move nativeCoin outside component + fix toTokenInput function * Remove native coin from useEffect Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Disable safe sections based on network config (#1468) * Adds FEATURES enum Renames features to disabledFeatures * Uses FEATURES enum instead of hard-coded contract features * Refactor enabledFeatures function, now checks that there are not disabled features by config before return the enabledFeatures result * Adds SAFE_APPS and CONTRACT_INTERACTION to FEATURES enum * Remove SAFE_APPS from sidebar if disabled * Redirect user from /apps if safe apps are disabled * Disables contract interaction from config * Remove !remoteOwners * Move settings to a constant * Deploy from xDai integration branch only to xDai staging * Fix .travis.yml warnings * Update branch and condition for staging deployment * Update xDai depoy condition * (Feature) [xDai] - Fetch collectibles from Gnosis services (#1460) * Add https to safe-xdai apps link * make getExplorerInfo return values per network (#1470) * (Fix) "Approve transaction" modal closes (#1477) * add equality function to prevent re-renders - I left the inline equalityFn, as an ad-hoc solution. First, because we're going to remove this when https://github.com/gnosis/safe-react/issues/1479 is done Second, because this way it infers the types defined in the useSelector generics * (Fix) xDai feature issues (#1484) Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * RPC interactions errors (#1475) * Add options to httpProvider * Add log when generateatchRequest fails * add types to generateBarchRequest * fix types in `generateBatchRequests` * add `.d` for imports of definition files * add `undefined` alternative value for `generateBatchRequests` ReturnValues - also, fixed typing errors in related functions * fix return values for `generateBatchRequests` in tests Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) xDai configs (#1489) * (Feature) - Replaces ETH with network native coin (#1491) * Remove networkInfo from the components * Replaces humanReadableValue to fromTokenUnit Co-authored-by: JosephBagaric <bagaricjos@gmail.com> Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> Co-authored-by: nicolas <nicosampler@users.noreply.github.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com> Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
2020-10-18 16:48:22 -03:00
/*
* Not being used
export const SQUARELINK_ID = {
[ETHEREUM_NETWORK.RINKEBY]: '46ce08fe50913cfa1b78',
[ETHEREUM_NETWORK.MAINNET]: process.env.REACT_APP_SQUARELINK_ID,
[ETHEREUM_NETWORK.XDAI]: process.env.REACT_APP_SQUARELINK_ID,
}
*/
(Feature) erc721 feature implementation (#570) * Add Assets sections * (add) collectibles tab * (add) criptokitty items * (add) collectible items, definitive edition * (fix) collectibles were overlapping with bottom banner * (fix) wording * (fix) responsive issues * Install `async-sema` dependency * Create collectible source classes - source from mocked data and opensea, it's extendable to import information from other sources * Update `Collectible` implementation to use new data source * Create constants file to better handle env variables and default values * Add description to item's cards - also added a mocked class with real data * Fix `saveTxToHistory`, remove hardcoded `CALL` * Fix after merge development * Set background color for collectible based on data info - Changed `withStyles` in favor of a hook-like approach with `makeStyles` * Enhance collectible card info and group title * Use current safeAddress to query for collectibles information - also migrated from `withStyles` to `makeStyles` * Use proper key values for lists and set more significant names * update yarn.lock after merge * Fix linting error * Move ethAsToken verification outside loop * Use absolute route for `SendModal` import * Move Collectibles into redux store * Update yarn.lock file * Selectable NFTs * Divide the `collectible` store into `nftAssets` and `nftTokens` - Also updated components to retain functionality - Created a `textShortener` function for better presentation * Update `yarn.lock` * Update `yarn.lock` * Fix item background color * Clears the tokenID select field when the collectible selected changes * Open Send modal from the assets section * Use token name for the token selection dropdown * Add openZeppelin contracts dependency * Create ERC721 getter * Fix types, default values and clean code * Fix: properly refresh list of collectibles when switching safes * Add ReviewCollectible step in send NFT * Change items shadow * Give option to choose what to send by clicking 'Send' button in AddressBook * Disable [Send] button for Collectibles if not owner * Set Coins as default option in assets tab - also fixed styles for `Coins` option * Use collectible icon in send modal * Set default message when no assets available - removed pagination feature * Create SafeVersionProvider to better handle version-related tasks Provides: - current and latest versions, - a boolean indicating a need for update, - an upgradeSafe callback to trigger upgrade from any place, - a list of enabled features, depending on the current version - the latter needs a refactor like extract features outside the provider and define constants for the features. * Force build * Update `yarn.lock` * Disable Manage list for NFTs * Fix container shadow - Also fixes tables shadow, thanks to @gabitoesmiapodo * Enable nested routes for balances (assets) tab * Default to `/balance` if invalid nested path * Disable [Send Collectible] button, if not supported by safe * Change sub-menu buttons to clickable text * Replace Paragraph with Link * Fix invalid props errors for Link component * Fallback to `transferFrom` if `safeTransferFrom` is not implemented * Use `transfer` as fallback to ERC-721's `safeTransferFrom` - need to identify ERC721 token using `transfer` and `name` methods * Display failed transactions * Use react.lazy for collectibles' modals * Identify ERC-721 token transaction * Fix Send Collectibles modal layout/behavior - disable dropdown list if there's no item to pick - fix placeholder for tokens list - fix dropdown list styles * Set default `isSuccessful` flag to `true` * Save version related values into store - each safe has its `currentVersion`, `needsUpdate` and `featuresEnabled` - and safes store has the `latestMasterContractVersion` * Migrate Balance to use store-provided values * Migrate Settings to use store-provided values * Migrate ChooseTxType to use store-provided values * Remove SafeVersionProvider Co-authored-by: Gabriel Rodriguez Alsina <gabriel.rodriguez@altoros.com> Co-authored-by: apane <agustin.pane@gmail.com>
2020-03-18 17:24:24 -03:00
export const INFURA_TOKEN = process.env.REACT_APP_INFURA_TOKEN || ''
(Feature) - xDai Compatibility (#1476) * feat: Support for Volta and EWC * chore: Store network ID in the ETHEREUM_NETWORK enum itself * chore: forward tx and address to non-etherscan explorers * fix test, avoid assigning enum to const * (Feature) [xDai] - Create network-based configurations (#1420) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * (Feature) [xDai] Use generic config (#1422) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * fix function name after merge development * (Feature) [xDai] - Contract interaction abi lookup (#1429) * Filter Apps by network (#1433) * Filter apps by network * (Feature) [xDai] - Parametrize ethscan values (#1424) * (Feature) [xDai] - Use parametrized network values (#1437) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Use tx service for loading token info (#1435) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Visually differentiate networks (#1431) Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> * (Feature) [xDai] - Cosmetic fixes (#1449) * Add staging configuration for deployment using xDai (#1459) * Add staging xDai deployment to travis * Add safe apps production url for xdai * Add travis rule to build xDai on master or integration branch * (Bugfix) Set min height to ListContentLayout wrapper #1447 (#1451) * fix min-height app container and margin to info text at bottom * change css unit from % to vh Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * disable OpenZepplin in xDai (#1465) * remove any in config/index.ts (#1462) * [xDai] Parametrize Native Coin (#1444) * fix `generateBatchRequest` calls * Fix some ETH harcoded values + Add tests * Fix null or undefined value * Move nativeCoin outside component + fix toTokenInput function * Remove native coin from useEffect Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Disable safe sections based on network config (#1468) * Adds FEATURES enum Renames features to disabledFeatures * Uses FEATURES enum instead of hard-coded contract features * Refactor enabledFeatures function, now checks that there are not disabled features by config before return the enabledFeatures result * Adds SAFE_APPS and CONTRACT_INTERACTION to FEATURES enum * Remove SAFE_APPS from sidebar if disabled * Redirect user from /apps if safe apps are disabled * Disables contract interaction from config * Remove !remoteOwners * Move settings to a constant * Deploy from xDai integration branch only to xDai staging * Fix .travis.yml warnings * Update branch and condition for staging deployment * Update xDai depoy condition * (Feature) [xDai] - Fetch collectibles from Gnosis services (#1460) * Add https to safe-xdai apps link * make getExplorerInfo return values per network (#1470) * (Fix) "Approve transaction" modal closes (#1477) * add equality function to prevent re-renders - I left the inline equalityFn, as an ad-hoc solution. First, because we're going to remove this when https://github.com/gnosis/safe-react/issues/1479 is done Second, because this way it infers the types defined in the useSelector generics * (Fix) xDai feature issues (#1484) Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * RPC interactions errors (#1475) * Add options to httpProvider * Add log when generateatchRequest fails * add types to generateBarchRequest * fix types in `generateBatchRequests` * add `.d` for imports of definition files * add `undefined` alternative value for `generateBatchRequests` ReturnValues - also, fixed typing errors in related functions * fix return values for `generateBatchRequests` in tests Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) xDai configs (#1489) * (Feature) - Replaces ETH with network native coin (#1491) * Remove networkInfo from the components * Replaces humanReadableValue to fromTokenUnit Co-authored-by: JosephBagaric <bagaricjos@gmail.com> Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> Co-authored-by: nicolas <nicosampler@users.noreply.github.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com> Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
2020-10-18 16:48:22 -03:00
export const LATEST_SAFE_VERSION = process.env.REACT_APP_LATEST_SAFE_VERSION || '1.1.1'
(Feature) erc721 feature implementation (#570) * Add Assets sections * (add) collectibles tab * (add) criptokitty items * (add) collectible items, definitive edition * (fix) collectibles were overlapping with bottom banner * (fix) wording * (fix) responsive issues * Install `async-sema` dependency * Create collectible source classes - source from mocked data and opensea, it's extendable to import information from other sources * Update `Collectible` implementation to use new data source * Create constants file to better handle env variables and default values * Add description to item's cards - also added a mocked class with real data * Fix `saveTxToHistory`, remove hardcoded `CALL` * Fix after merge development * Set background color for collectible based on data info - Changed `withStyles` in favor of a hook-like approach with `makeStyles` * Enhance collectible card info and group title * Use current safeAddress to query for collectibles information - also migrated from `withStyles` to `makeStyles` * Use proper key values for lists and set more significant names * update yarn.lock after merge * Fix linting error * Move ethAsToken verification outside loop * Use absolute route for `SendModal` import * Move Collectibles into redux store * Update yarn.lock file * Selectable NFTs * Divide the `collectible` store into `nftAssets` and `nftTokens` - Also updated components to retain functionality - Created a `textShortener` function for better presentation * Update `yarn.lock` * Update `yarn.lock` * Fix item background color * Clears the tokenID select field when the collectible selected changes * Open Send modal from the assets section * Use token name for the token selection dropdown * Add openZeppelin contracts dependency * Create ERC721 getter * Fix types, default values and clean code * Fix: properly refresh list of collectibles when switching safes * Add ReviewCollectible step in send NFT * Change items shadow * Give option to choose what to send by clicking 'Send' button in AddressBook * Disable [Send] button for Collectibles if not owner * Set Coins as default option in assets tab - also fixed styles for `Coins` option * Use collectible icon in send modal * Set default message when no assets available - removed pagination feature * Create SafeVersionProvider to better handle version-related tasks Provides: - current and latest versions, - a boolean indicating a need for update, - an upgradeSafe callback to trigger upgrade from any place, - a list of enabled features, depending on the current version - the latter needs a refactor like extract features outside the provider and define constants for the features. * Force build * Update `yarn.lock` * Disable Manage list for NFTs * Fix container shadow - Also fixes tables shadow, thanks to @gabitoesmiapodo * Enable nested routes for balances (assets) tab * Default to `/balance` if invalid nested path * Disable [Send Collectible] button, if not supported by safe * Change sub-menu buttons to clickable text * Replace Paragraph with Link * Fix invalid props errors for Link component * Fallback to `transferFrom` if `safeTransferFrom` is not implemented * Use `transfer` as fallback to ERC-721's `safeTransferFrom` - need to identify ERC721 token using `transfer` and `name` methods * Display failed transactions * Use react.lazy for collectibles' modals * Identify ERC-721 token transaction * Fix Send Collectibles modal layout/behavior - disable dropdown list if there's no item to pick - fix placeholder for tokens list - fix dropdown list styles * Set default `isSuccessful` flag to `true` * Save version related values into store - each safe has its `currentVersion`, `needsUpdate` and `featuresEnabled` - and safes store has the `latestMasterContractVersion` * Migrate Balance to use store-provided values * Migrate Settings to use store-provided values * Migrate ChooseTxType to use store-provided values * Remove SafeVersionProvider Co-authored-by: Gabriel Rodriguez Alsina <gabriel.rodriguez@altoros.com> Co-authored-by: apane <agustin.pane@gmail.com>
2020-03-18 17:24:24 -03:00
export const APP_VERSION = process.env.REACT_APP_APP_VERSION || 'not-defined'
export const OPENSEA_API_KEY = process.env.REACT_APP_OPENSEA_API_KEY || ''
(Feature) - xDai Compatibility (#1476) * feat: Support for Volta and EWC * chore: Store network ID in the ETHEREUM_NETWORK enum itself * chore: forward tx and address to non-etherscan explorers * fix test, avoid assigning enum to const * (Feature) [xDai] - Create network-based configurations (#1420) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * (Feature) [xDai] Use generic config (#1422) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * fix function name after merge development * (Feature) [xDai] - Contract interaction abi lookup (#1429) * Filter Apps by network (#1433) * Filter apps by network * (Feature) [xDai] - Parametrize ethscan values (#1424) * (Feature) [xDai] - Use parametrized network values (#1437) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Use tx service for loading token info (#1435) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Visually differentiate networks (#1431) Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> * (Feature) [xDai] - Cosmetic fixes (#1449) * Add staging configuration for deployment using xDai (#1459) * Add staging xDai deployment to travis * Add safe apps production url for xdai * Add travis rule to build xDai on master or integration branch * (Bugfix) Set min height to ListContentLayout wrapper #1447 (#1451) * fix min-height app container and margin to info text at bottom * change css unit from % to vh Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * disable OpenZepplin in xDai (#1465) * remove any in config/index.ts (#1462) * [xDai] Parametrize Native Coin (#1444) * fix `generateBatchRequest` calls * Fix some ETH harcoded values + Add tests * Fix null or undefined value * Move nativeCoin outside component + fix toTokenInput function * Remove native coin from useEffect Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Disable safe sections based on network config (#1468) * Adds FEATURES enum Renames features to disabledFeatures * Uses FEATURES enum instead of hard-coded contract features * Refactor enabledFeatures function, now checks that there are not disabled features by config before return the enabledFeatures result * Adds SAFE_APPS and CONTRACT_INTERACTION to FEATURES enum * Remove SAFE_APPS from sidebar if disabled * Redirect user from /apps if safe apps are disabled * Disables contract interaction from config * Remove !remoteOwners * Move settings to a constant * Deploy from xDai integration branch only to xDai staging * Fix .travis.yml warnings * Update branch and condition for staging deployment * Update xDai depoy condition * (Feature) [xDai] - Fetch collectibles from Gnosis services (#1460) * Add https to safe-xdai apps link * make getExplorerInfo return values per network (#1470) * (Fix) "Approve transaction" modal closes (#1477) * add equality function to prevent re-renders - I left the inline equalityFn, as an ad-hoc solution. First, because we're going to remove this when https://github.com/gnosis/safe-react/issues/1479 is done Second, because this way it infers the types defined in the useSelector generics * (Fix) xDai feature issues (#1484) Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * RPC interactions errors (#1475) * Add options to httpProvider * Add log when generateatchRequest fails * add types to generateBarchRequest * fix types in `generateBatchRequests` * add `.d` for imports of definition files * add `undefined` alternative value for `generateBatchRequests` ReturnValues - also, fixed typing errors in related functions * fix return values for `generateBatchRequests` in tests Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) xDai configs (#1489) * (Feature) - Replaces ETH with network native coin (#1491) * Remove networkInfo from the components * Replaces humanReadableValue to fromTokenUnit Co-authored-by: JosephBagaric <bagaricjos@gmail.com> Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> Co-authored-by: nicolas <nicosampler@users.noreply.github.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com> Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
2020-10-18 16:48:22 -03:00
export const COLLECTIBLES_SOURCE = process.env.REACT_APP_COLLECTIBLES_SOURCE || 'Gnosis'
Feature #587 - App performance improvement (#738) * Refactor Balances to functional component Removes Balances props in Layout.jsx * Replaces selectors that were using safeParamAddressSelector with safeParamAddressFromStateSelector to avoid the bug of non-loaded safe when called Also exports extendedTransactionsSelector to let the components use it * Refactors Transactions.jsx, replaces transactions.tsx with txsTable.jsx Removes all unused props from transactions.jsx Makes all childs of txsTable.jsx fetch the props they need instead of sharing all of them even if they are not used * Adds new selectors: safeNameSelector, safeNeedsUpdateSelector, safeCurrentVersionSelector * Removes unused props from layout to settings.jsx Removed props from the settings.jsx childs, now they fetch the values they need directly from the store * Removes unused redux connect * Adds safeEthBalanceSelector * Removes all the props from layout to settings * Refactor root and layout, extracts checkForUpdate and componentDidMount to components Extracts header and tabs from Layout.jsx * Makes routes.jsx use selectors instead of connect to unify the code * Loads tabs components using react suspense * Fixs warning when trying to update root component within loadStore.jsx Replaces safe with safeAddress selector in layout.jsx to reduce the unnecessary rendering Fixs setState in container.jsx * Fixs checkForUpdates fetchTokenBalances Adds FetchTokens.jsx in balances Adds safeFeaturesEnabledSelector * Fixs load addressbook action * Replaces safe with owners in manage owners * Improves buildSafe promises calls Improves the loadStorage calls * Fixs error "Uncaught (in promise) TypeError: Cannot read property 'includes' of undefined" * Extracts LoadStore from outside the router component to avoid re-loading the store Adds react lazy for Coins and Collectible tabs * Reduce the polling rate for fetching transactions * Removes unused actions.js Removes unused selector props * Fixes owners column selector usage * Fixes processTransaction usage * Optimize how the transaction list within the transactions tab are loaded * Fix lint error * Fix edit addressbook entry * Fixs show send coins modal * feature: batchRequest for incoming transactions * Fixs race condition on loadStore Fixs check for updates address null validation * Adds ensureOnceAsync for getGnosisSafeInstanceAt Adds batch request for safe params * Removes unnecessary checkAndUpdateSafe from checkForUpdates, now the safe gets updated when a transaction arrives * Fixs ensureOnce/memoization * refactor: make a generic generateBatchRequest method Create a generic method to easily build web3 batch requests * refactor: use `generateBatchRequest` in `getTokensBalances` * Removes .toJS in edit entry * Removes web3 from sendTransactions Removes pascal case FetchTokens * Replaces /layout import * Replaces CheckForUpdates component with useCheckForUpdates hook * Makes FetchTokens a hook * Removes getSafeParamsBatch, now the safes gets the data using the generic generateBatchRequests * Replaces INITIAL_STATUS with INITIAL_STATE * Replaces regex Adds spaces before return * Adds wrapInSuspense * Runs prettier * Makes checkAndUpdateSafe use generateBatchRequests * Makes checkAndUpdateSafe use generateBatchRequests * Fixs check for updates with null address * Fixs transaction details getNameFromAddressBook * Fixes zIndex between cookies banner and transaction details * fix: cast returned values to number Original code was expecting a BN instance, now it's a plain string. * Fix replace owner name * Fix race condition with adbk load * Fixes replaces owner * Fixs apps * Moved hooks into own folder * Moved LoadStore to routes.js Refactors LoadStore as Hook Move LoadStore to hooks folder * Moves useLoadStore to safes/index * Revert loadStore place change * Fixes bug with fetchEtherBalance that causes updateSafe to be called * remove useLoadStore, add useAnalytics hook * remove React.memo from SafeView * Reverts removing useLoadStore in order to maintain the consistency of the code * rewrite useLoadStore in a more hook-y way, rename it to useLoadSafe * Removes unnecessary setSafeLoaded * Removes unnecessary safeLoaded * fix: Coins values and balances The app was retrieving ERC20 tokens information from 3 different endpoints. - One from `balance/` to have the list updated - another from `balance/usd` to have the values in USD - the last one from the blockchain, to update the balances This was all simplified to `balance/usd`. Also, added a `currencyRate` to be updated when the currency is modified. The value calculation happens on a component level, so when the `balanceUsd` value is modified, the value is properly reflected on the screen. Refactored `activateTokensByBalance` to `fetchSafeTokens`, as this was doing quite more than just _activating_ and also added the `currencyList` calculation in it, so everything is updated when `balance/usd` endpoint is requested. * fix: Balance screen Collectibles weren't loading when clicking on the link Also, refactored setState usage, to properly update current state * fix: featuresEnabled undefined * fix: add/activate newly received tokens * fix: NaN Values in Coins for a newly loaded Safe Was failing to set a default value for the `currencyRate` * fix: Settings fails to load if `owners` is not loaded into store Added a `Loader` until the required Safe's data is loaded into store. * fix: prefetch txs data When building the Txs list, we requested data for every tx what was translated into several RPC calls. Now by _batchRequesting_ all the information on beforehand, Safe's loading is a bit faster. * fix: prevent requesting safe, when there's no safe available in the store * enhancement: fetch tokens when loading safe By doing this, when loading a safe in the balance screen we will have tokens immediately loaded into the coins list * fix: load collectibles when switch to collectibles screen Collectibles weren't loaded when clicking menu link for a newly loaded safe. Now every switch to the collectible's screen will trigger a fetch for collectibles. * fix: fetch only if safe is ready Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
2020-04-23 11:18:06 -03:00
export const TIMEOUT = process.env.NODE_ENV === 'test' ? 1500 : 5000
export const ETHERSCAN_API_KEY = process.env.REACT_APP_ETHERSCAN_API_KEY
(Feature) - xDai Compatibility (#1476) * feat: Support for Volta and EWC * chore: Store network ID in the ETHEREUM_NETWORK enum itself * chore: forward tx and address to non-etherscan explorers * fix test, avoid assigning enum to const * (Feature) [xDai] - Create network-based configurations (#1420) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * (Feature) [xDai] Use generic config (#1422) Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> * fix function name after merge development * (Feature) [xDai] - Contract interaction abi lookup (#1429) * Filter Apps by network (#1433) * Filter apps by network * (Feature) [xDai] - Parametrize ethscan values (#1424) * (Feature) [xDai] - Use parametrized network values (#1437) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Use tx service for loading token info (#1435) Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Visually differentiate networks (#1431) Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> * (Feature) [xDai] - Cosmetic fixes (#1449) * Add staging configuration for deployment using xDai (#1459) * Add staging xDai deployment to travis * Add safe apps production url for xdai * Add travis rule to build xDai on master or integration branch * (Bugfix) Set min height to ListContentLayout wrapper #1447 (#1451) * fix min-height app container and margin to info text at bottom * change css unit from % to vh Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * disable OpenZepplin in xDai (#1465) * remove any in config/index.ts (#1462) * [xDai] Parametrize Native Coin (#1444) * fix `generateBatchRequest` calls * Fix some ETH harcoded values + Add tests * Fix null or undefined value * Move nativeCoin outside component + fix toTokenInput function * Remove native coin from useEffect Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) [xDai] - Disable safe sections based on network config (#1468) * Adds FEATURES enum Renames features to disabledFeatures * Uses FEATURES enum instead of hard-coded contract features * Refactor enabledFeatures function, now checks that there are not disabled features by config before return the enabledFeatures result * Adds SAFE_APPS and CONTRACT_INTERACTION to FEATURES enum * Remove SAFE_APPS from sidebar if disabled * Redirect user from /apps if safe apps are disabled * Disables contract interaction from config * Remove !remoteOwners * Move settings to a constant * Deploy from xDai integration branch only to xDai staging * Fix .travis.yml warnings * Update branch and condition for staging deployment * Update xDai depoy condition * (Feature) [xDai] - Fetch collectibles from Gnosis services (#1460) * Add https to safe-xdai apps link * make getExplorerInfo return values per network (#1470) * (Fix) "Approve transaction" modal closes (#1477) * add equality function to prevent re-renders - I left the inline equalityFn, as an ad-hoc solution. First, because we're going to remove this when https://github.com/gnosis/safe-react/issues/1479 is done Second, because this way it infers the types defined in the useSelector generics * (Fix) xDai feature issues (#1484) Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> * RPC interactions errors (#1475) * Add options to httpProvider * Add log when generateatchRequest fails * add types to generateBarchRequest * fix types in `generateBatchRequests` * add `.d` for imports of definition files * add `undefined` alternative value for `generateBatchRequests` ReturnValues - also, fixed typing errors in related functions * fix return values for `generateBatchRequests` in tests Co-authored-by: fernandomg <fernando.greco@gmail.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> * (Feature) xDai configs (#1489) * (Feature) - Replaces ETH with network native coin (#1491) * Remove networkInfo from the components * Replaces humanReadableValue to fromTokenUnit Co-authored-by: JosephBagaric <bagaricjos@gmail.com> Co-authored-by: Matias Dastugue <matias.dastugue@altoros.com> Co-authored-by: Mati Dastugue <mdastugu@amazon.com> Co-authored-by: Agustin Pane <agustin.pane@gmail.com> Co-authored-by: nicolas <nicosampler@users.noreply.github.com> Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm> Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com> Co-authored-by: nicosampler <nf.dominguez.87@gmail.com> Co-authored-by: Mikhail Mikheev <mmvsha73@gmail.com>
2020-10-18 16:48:22 -03:00
export const EXCHANGE_RATE_URL = 'https://api.exchangeratesapi.io/latest'
export const EXCHANGE_RATE_URL_FALLBACK = 'https://api.coinbase.com/v2/exchange-rates'
export const IPFS_GATEWAY = process.env.REACT_APP_IPFS_GATEWAY
export const SPENDING_LIMIT_MODULE_ADDRESS =
process.env.REACT_APP_SPENDING_LIMIT_MODULE_ADDRESS || '0xCFbFaC74C26F8647cBDb8c5caf80BB5b32E43134'