Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4d699b7
feat: Support for Volta and EWC
josipbagaric Jun 23, 2020
dbf0b96
chore: Store network ID in the ETHEREUM_NETWORK enum itself
josipbagaric Jun 23, 2020
a2491fe
chore: forward tx and address to non-etherscan explorers
josipbagaric Jun 23, 2020
cbd4e77
fixes after rebase
fernandomg Sep 29, 2020
a211dcf
Merge branch 'development' into feature/#1353-xDai-compatibility
fernandomg Sep 30, 2020
580c7e9
fix test, avoid assingning enum to const
fernandomg Sep 30, 2020
cfe727e
fix typing errors
fernandomg Oct 1, 2020
6a4e353
(Feature) [xDai] - Create network-based configurations (#1420)
fernandomg Oct 2, 2020
ab2d1cf
(Feature) [xDai] Use generic config (#1422)
fernandomg Oct 5, 2020
76fe441
Merge branch 'development' into feature/#1353-xDai-compatibility
fernandomg Oct 5, 2020
c86a0ea
fix function name after merge development
fernandomg Oct 5, 2020
5278527
(Feature) [xDai] - Contract interaction abi lookup (#1429)
Agupane Oct 6, 2020
74cb6cf
Filter Apps by network (#1433)
nicosampler Oct 6, 2020
8c16bce
(Feature) [xDai] - Parametrize ethscan values (#1424)
Agupane Oct 6, 2020
7d28efd
(Feature) [xDai] - Use parametrized network values (#1437)
fernandomg Oct 8, 2020
8f85a2f
(Feature) [xDai] - Use tx service for loading token info (#1435)
Agupane Oct 8, 2020
dc77aeb
(Feature) [xDai] - Visually differentiate networks (#1431)
alongoni Oct 8, 2020
7d85c5f
Merge branch 'development' into feature/#1353-xDai-compatibility
fernandomg Oct 8, 2020
e941f1f
(Feature) [xDai] - Cosmetic fixes (#1449)
Agupane Oct 9, 2020
8fe31d3
Add staging configuration for deployment using xDai (#1459)
Oct 9, 2020
4d1cecf
(Bugfix) Set min height to ListContentLayout wrapper #1447 (#1451)
alongoni Oct 12, 2020
525491a
disable OpenZepplin in xDai (#1465)
nicosampler Oct 13, 2020
058e23b
remove any in config/index.ts (#1462)
mmv08 Oct 13, 2020
f5f57dd
[xDai] Parametrize Native Coin (#1444)
matextrem Oct 13, 2020
b16c737
(Feature) [xDai] - Disable safe sections based on network config (#1…
Agupane Oct 13, 2020
05f6bb7
Deploy from xDai integration branch only to xDai staging
Oct 14, 2020
f5864d5
Fix .travis.yml warnings
Oct 14, 2020
fc23728
Update branch and condition for staging deployment
Oct 14, 2020
46d0496
Update xDai depoy condition
Oct 14, 2020
bdcffa7
(Feature) [xDai] - Fetch collectibles from Gnosis services (#1460)
fernandomg Oct 14, 2020
b29cd24
Add https to safe-xdai apps link
Oct 14, 2020
b033938
make getExplorerInfo return values per network (#1470)
nicosampler Oct 14, 2020
de76b20
Merge branch 'development' into feature/#1353-xDai-compatibility
fernandomg Oct 14, 2020
0f4ac62
Merge remote-tracking branch 'origin/feature/#1353-xDai-compatibility…
fernandomg Oct 14, 2020
3dcf27e
(Fix) "Approve transaction" modal closes (#1477)
fernandomg Oct 15, 2020
44045c5
Merge branch 'development' into feature/#1353-xDai-compatibility
nicosampler Oct 15, 2020
13e0cb9
(Fix) xDai feature issues (#1484)
fernandomg Oct 16, 2020
80c7f3c
Merge branch 'development' into feature/#1353-xDai-compatibility
Oct 16, 2020
80acbdd
Add disableWallets key to config
matextrem Oct 20, 2020
490a173
Fix errors
matextrem Oct 20, 2020
ffed3ef
Fix merge issues
Oct 21, 2020
ef927b3
Merge branch 'development' into feature/disableWallet
matextrem Oct 21, 2020
ac8b961
Merge branch 'development' into feature/disableWallet
matextrem Oct 22, 2020
629c1fb
Merge branch 'development' into feature/disableWallet
Oct 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import networks from 'src/config/networks'
import { EnvironmentSettings, ETHEREUM_NETWORK, NetworkSettings, SafeFeatures } from 'src/config/networks/network.d'
import { EnvironmentSettings, ETHEREUM_NETWORK, NetworkSettings, SafeFeatures, Wallets } from 'src/config/networks/network.d'
import { APP_ENV, ETHERSCAN_API_KEY, GOOGLE_ANALYTICS_ID, INFURA_TOKEN, NETWORK, NODE_ENV } from 'src/utils/constants'
import { ensureOnce } from 'src/utils/singleton'
import memoize from 'lodash.memoize'
Expand All @@ -25,6 +25,7 @@ const getCurrentEnvironment = (): string => {
type NetworkSpecificConfiguration = EnvironmentSettings & {
network: NetworkSettings,
disabledFeatures?: SafeFeatures,
disabledWallets?: Wallets,
}

const configuration = (): NetworkSpecificConfiguration => {
Expand All @@ -50,6 +51,7 @@ const configuration = (): NetworkSpecificConfiguration => {
...networkBaseConfig,
network: configFile.network,
disabledFeatures: configFile.disabledFeatures,
disabledWallets: configFile.disabledWallets
}
}

Expand Down Expand Up @@ -79,6 +81,8 @@ export const getNetworkExplorerInfo = (): { name: string; url: string; apiUrl: s

export const getNetworkConfigDisabledFeatures = (): SafeFeatures => getConfig()?.disabledFeatures || []

export const getNetworkConfigDisabledWallets = (): Wallets => getConfig()?.disabledWallets || []

export const getNetworkInfo = (): NetworkSettings => getConfig()?.network

export const getTxServiceUriFrom = (safeAddress: string) => `/safes/${safeAddress}/transactions/`
Expand Down
22 changes: 22 additions & 0 deletions src/config/networks/network.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
// matches src/logic/tokens/store/model/token.ts `TokenProps` type

export enum WALLETS {
METAMASK = 'metamask',
WALLET_CONNECT = 'walletConnect',
TREZOR = 'trezor',
LEDGER = 'ledger',
TRUST = 'trust',
DAPPER = 'dapper',
FORTMATIC = 'fortmatic',
PORTIS = 'portis',
AUTHEREUM = 'authereum',
TORUS = 'torus',
UNILOGIN = 'unilogin',
COINBASE = 'coinbase',
WALLET_LINK = 'walletLink',
OPERA = 'opera',
OPERA_TOUCH = 'operaTouch'
}

export enum FEATURES {
ERC721 = 'ERC721',
ERC1155 = 'ERC1155',
Expand Down Expand Up @@ -44,6 +62,9 @@ export type NetworkSettings = {
// If non is present, all the sections are available.
export type SafeFeatures = FEATURES[]

export type Wallets = WALLETS[]


type GasPrice = {
gasPrice: number
gasPriceOracleUrl?: string
Expand Down Expand Up @@ -73,5 +94,6 @@ type SafeEnvironments = {
export interface NetworkConfig {
network: NetworkSettings
disabledFeatures?: SafeFeatures
disabledWallets?: Wallets
environment: SafeEnvironments
}
8 changes: 6 additions & 2 deletions src/config/networks/xdai.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EnvironmentSettings, ETHEREUM_NETWORK, NetworkConfig } from 'src/config/networks/network.d'
import { EnvironmentSettings, ETHEREUM_NETWORK, WALLETS, NetworkConfig } from 'src/config/networks/network.d'
import xDaiLogo from 'src/config/assets/token_xdai.svg'

const baseConfig: EnvironmentSettings = {
Expand Down Expand Up @@ -35,7 +35,11 @@ const xDai: NetworkConfig = {
decimals: 18,
logoUri: xDaiLogo,
},
}
},
disabledWallets:[
WALLETS.TREZOR,
WALLETS.LEDGER
]
}

export default xDai
39 changes: 20 additions & 19 deletions src/logic/wallets/utils/walletList.ts
Original file line number Diff line number Diff line change
@@ -1,71 +1,72 @@
import { WalletInitOptions } from 'bnc-onboard/dist/src/interfaces'

import { getNetworkId, getRpcServiceUrl } from 'src/config'
import { ETHEREUM_NETWORK } from 'src/config/networks/network.d'
import { getNetworkId, getRpcServiceUrl, getNetworkConfigDisabledWallets } from 'src/config'
import { ETHEREUM_NETWORK, WALLETS } from 'src/config/networks/network.d'
import { FORTMATIC_KEY, PORTIS_ID } from 'src/utils/constants'

const networkId = getNetworkId()
const disabledWallets = getNetworkConfigDisabledWallets()
const PORTIS_DAPP_ID = PORTIS_ID[networkId] ?? PORTIS_ID[ETHEREUM_NETWORK.RINKEBY]
const FORTMATIC_API_KEY = FORTMATIC_KEY[networkId] ?? FORTMATIC_KEY[ETHEREUM_NETWORK.RINKEBY]

type Wallet = WalletInitOptions & {
desktop: boolean
walletName: WALLETS
}

const rpcUrl = getRpcServiceUrl()
const wallets: Wallet[] = [
{ walletName: 'metamask', preferred: true, desktop: false },
{ walletName: WALLETS.METAMASK, preferred: true, desktop: false },
{
walletName: 'walletConnect',
walletName: WALLETS.WALLET_CONNECT,
preferred: true,
// as stated in the documentation, `infuraKey` is not mandatory if rpc is provided
rpc: { [networkId]: rpcUrl },
desktop: true,
bridge: 'https://safe-walletconnect.gnosis.io/',
},
{
walletName: 'trezor',
walletName: WALLETS.TREZOR,
appUrl: 'gnosis-safe.io',
preferred: true,
email: 'safe@gnosis.io',
desktop: true,
rpcUrl,
},
{
walletName: 'ledger',
walletName: WALLETS.LEDGER,
desktop: true,
preferred: true,
rpcUrl,
LedgerTransport: (window as any).TransportNodeHid,
},
{ walletName: 'trust', preferred: true, desktop: false },
{ walletName: 'dapper', desktop: false },
{ walletName: WALLETS.TRUST, preferred: true, desktop: false },
{ walletName: WALLETS.DAPPER, desktop: false },
{
walletName: 'fortmatic',
walletName: WALLETS.FORTMATIC,
apiKey: FORTMATIC_API_KEY,
desktop: true,
},
{
walletName: 'portis',
walletName: WALLETS.PORTIS,
apiKey: PORTIS_DAPP_ID,
desktop: true,
},
{ walletName: 'authereum', desktop: false },
{ walletName: 'torus', desktop: true },
{ walletName: 'unilogin', desktop: true },
{ walletName: 'coinbase', desktop: false },
{ walletName: 'walletLink', rpcUrl, desktop: false },
{ walletName: 'opera', desktop: false },
{ walletName: 'operaTouch', desktop: false },
{ walletName: WALLETS.AUTHEREUM, desktop: false },
{ walletName: WALLETS.TORUS, desktop: true },
{ walletName: WALLETS.UNILOGIN, desktop: true },
{ walletName: WALLETS.COINBASE, desktop: false },
{ walletName: WALLETS.WALLET_LINK, rpcUrl, desktop: false },
{ walletName: WALLETS.OPERA, desktop: false },
{ walletName: WALLETS.OPERA_TOUCH, desktop: false },
]

export const getSupportedWallets = (): WalletInitOptions[] => {
const { isDesktop } = window as any
/* eslint-disable no-unused-vars */

if (isDesktop) {
return wallets.filter((wallet) => wallet.desktop).map(({ desktop, ...rest }) => rest)
}

return wallets.map(({ desktop, ...rest }) => rest)
return wallets.map(({ desktop, ...rest }) => rest).filter((w) => !disabledWallets.includes(w.walletName))
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const { nativeCoin } = getNetworkInfo()

const ExpandedTx = ({ cancelTx, tx }: ExpandedTxProps): React.ReactElement => {
const { fromWei, toBN } = getWeb3().utils

const classes = useStyles()
const nonce = useSelector(safeNonceSelector)
const threshold = useSelector(safeThresholdSelector) as number
Expand Down