Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
c48a7f26
Unverified
Commit
c48a7f26
authored
Jan 29, 2020
by
Noah Zinsmeister
Committed by
GitHub
Jan 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve network env stuff (#621)
* improve network env setup
parent
b21a6e39
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
60 deletions
+84
-60
.env.local.example
.env.local.example
+3
-2
netlify.toml
netlify.toml
+7
-1
index.js
src/connectors/index.js
+12
-4
index.js
src/constants/index.js
+62
-53
No files found.
.env.local.example
View file @
c48a7f26
REACT_APP_
NETWORK
_ID="1"
REACT_APP_
CHAIN
_ID="1"
REACT_APP_NETWORK_URL=""
REACT_APP_NETWORK_URL=""
REACT_APP_PORTIS_ID=""
REACT_APP_PORTIS_ID=""
REACT_APP_FORTMATIC_KEY=""
REACT_APP_FORTMATIC_KEY=""
\ No newline at end of file
REACT_APP_IS_PRODUCTION_DEPLOY="false"
\ No newline at end of file
netlify.toml
View file @
c48a7f26
...
@@ -5,10 +5,16 @@
...
@@ -5,10 +5,16 @@
status
=
451
status
=
451
force
=
true
force
=
true
conditions
=
{Country=
["BY","CU","IR","IQ","CI","LR","KP","SD","SY","ZW"]
}
conditions
=
{Country=
["BY","CU","IR","IQ","CI","LR","KP","SD","SY","ZW"]
}
headers
=
{Link
=
"<https://uniswap.exchange>"
}
headers
=
{Link
=
"<https://uniswap.exchange>"
}
# support SPA setup
# support SPA setup
[[redirects]]
[[redirects]]
from
=
"/*"
from
=
"/*"
to
=
"/index.html"
to
=
"/index.html"
status
=
200
status
=
200
[build.environment]
REACT_APP_IS_PRODUCTION_DEPLOY
=
"false"
[context.production.environment]
REACT_APP_IS_PRODUCTION_DEPLOY
=
"true"
src/connectors/index.js
View file @
c48a7f26
...
@@ -7,35 +7,43 @@ import { NetworkConnector } from './Network'
...
@@ -7,35 +7,43 @@ import { NetworkConnector } from './Network'
import
{
FortmaticConnector
}
from
'
./Fortmatic
'
import
{
FortmaticConnector
}
from
'
./Fortmatic
'
const
POLLING_INTERVAL
=
10000
const
POLLING_INTERVAL
=
10000
const
NETWORK_URL
=
process
.
env
.
REACT_APP_IS_PRODUCTION_DEPLOY
===
'
true
'
?
process
.
env
.
REACT_APP_NETWORK_URL_PROD
:
process
.
env
.
REACT_APP_NETWORK_URL
export
const
network
=
new
NetworkConnector
({
export
const
network
=
new
NetworkConnector
({
urls
:
{
1
:
process
.
env
.
REACT_APP_
NETWORK_URL
},
urls
:
{
[
Number
(
process
.
env
.
REACT_APP_CHAIN_ID
)]:
NETWORK_URL
},
pollingInterval
:
POLLING_INTERVAL
*
3
pollingInterval
:
POLLING_INTERVAL
*
3
})
})
export
const
injected
=
new
InjectedConnector
({
export
const
injected
=
new
InjectedConnector
({
supportedChainIds
:
[
1
]
supportedChainIds
:
[
Number
(
process
.
env
.
REACT_APP_CHAIN_ID
)
]
})
})
// mainnet only
export
const
walletconnect
=
new
WalletConnectConnector
({
export
const
walletconnect
=
new
WalletConnectConnector
({
rpc
:
{
1
:
process
.
env
.
REACT_APP_
NETWORK_URL
},
rpc
:
{
1
:
NETWORK_URL
},
bridge
:
'
https://bridge.walletconnect.org
'
,
bridge
:
'
https://bridge.walletconnect.org
'
,
qrcode
:
false
,
qrcode
:
false
,
pollingInterval
:
POLLING_INTERVAL
pollingInterval
:
POLLING_INTERVAL
})
})
// mainnet only
export
const
fortmatic
=
new
FortmaticConnector
({
export
const
fortmatic
=
new
FortmaticConnector
({
apiKey
:
process
.
env
.
REACT_APP_FORTMATIC_KEY
,
apiKey
:
process
.
env
.
REACT_APP_FORTMATIC_KEY
,
chainId
:
1
chainId
:
1
})
})
// mainnet only
export
const
portis
=
new
PortisConnector
({
export
const
portis
=
new
PortisConnector
({
dAppId
:
process
.
env
.
REACT_APP_PORTIS_ID
,
dAppId
:
process
.
env
.
REACT_APP_PORTIS_ID
,
networks
:
[
1
]
networks
:
[
1
]
})
})
// mainnet only
export
const
walletlink
=
new
WalletLinkConnector
({
export
const
walletlink
=
new
WalletLinkConnector
({
url
:
process
.
env
.
REACT_APP_
NETWORK_URL
,
url
:
NETWORK_URL
,
appName
:
'
Uniswap
'
,
appName
:
'
Uniswap
'
,
appLogoUrl
:
appLogoUrl
:
'
https://mpng.pngfly.com/20181202/bex/kisspng-emoji-domain-unicorn-pin-badges-sticker-unicorn-tumblr-emoji-unicorn-iphoneemoji-5c046729264a77.5671679315437924251569.jpg
'
'
https://mpng.pngfly.com/20181202/bex/kisspng-emoji-domain-unicorn-pin-badges-sticker-unicorn-tumblr-emoji-unicorn-iphoneemoji-5c046729264a77.5671679315437924251569.jpg
'
...
...
src/constants/index.js
View file @
c48a7f26
...
@@ -12,7 +12,7 @@ export const SUPPORTED_THEMES = {
...
@@ -12,7 +12,7 @@ export const SUPPORTED_THEMES = {
LIGHT
:
'
LIGHT
'
LIGHT
:
'
LIGHT
'
}
}
export
const
SUPPORTED
_WALLETS
=
{
const
MAINNET
_WALLETS
=
{
INJECTED
:
{
INJECTED
:
{
connector
:
injected
,
connector
:
injected
,
name
:
'
Injected
'
,
name
:
'
Injected
'
,
...
@@ -29,61 +29,70 @@ export const SUPPORTED_WALLETS = {
...
@@ -29,61 +29,70 @@ export const SUPPORTED_WALLETS = {
description
:
'
Easy-to-use browser extension.
'
,
description
:
'
Easy-to-use browser extension.
'
,
href
:
null
,
href
:
null
,
color
:
'
#E8831D
'
color
:
'
#E8831D
'
},
WALLET_CONNECT
:
{
connector
:
walletconnect
,
name
:
'
WalletConnect
'
,
iconName
:
'
walletConnectIcon.svg
'
,
description
:
'
Connect to Trust Wallet, Rainbow Wallet and more...
'
,
href
:
null
,
color
:
'
#4196FC
'
},
WALLET_LINK
:
{
connector
:
walletlink
,
name
:
'
Coinbase Wallet
'
,
iconName
:
'
coinbaseWalletIcon.svg
'
,
description
:
'
Use Coinbase Wallet app on mobile device
'
,
href
:
null
,
color
:
'
#315CF5
'
},
COINBASE_LINK
:
{
name
:
'
Open in Coinbase Wallet
'
,
iconName
:
'
coinbaseWalletIcon.svg
'
,
description
:
'
Open in Coinbase Wallet app.
'
,
href
:
'
https://go.cb-w.com/mtUDhEZPy1
'
,
color
:
'
#315CF5
'
,
mobile
:
true
,
mobileOnly
:
true
},
TRUST_WALLET_LINK
:
{
name
:
'
Open in Trust Wallet
'
,
iconName
:
'
trustWallet.png
'
,
description
:
'
iOS and Android app.
'
,
href
:
'
https://link.trustwallet.com/open_url?coin_id=60&url=https://uniswap.exchange/swap
'
,
color
:
'
#1C74CC
'
,
mobile
:
true
,
mobileOnly
:
true
},
FORTMATIC
:
{
connector
:
fortmatic
,
name
:
'
Fortmatic
'
,
iconName
:
'
fortmaticIcon.png
'
,
description
:
'
Login using Fortmatic hosted wallet
'
,
href
:
null
,
color
:
'
#6748FF
'
,
mobile
:
true
},
Portis
:
{
connector
:
portis
,
name
:
'
Portis
'
,
iconName
:
'
portisIcon.png
'
,
description
:
'
Login using Portis hosted wallet
'
,
href
:
null
,
color
:
'
#4A6C9B
'
,
mobile
:
true
}
}
}
}
export
const
SUPPORTED_WALLETS
=
process
.
env
.
REACT_APP_CHAIN_ID
!==
'
1
'
?
MAINNET_WALLETS
:
{
...
MAINNET_WALLETS
,
...{
WALLET_CONNECT
:
{
connector
:
walletconnect
,
name
:
'
WalletConnect
'
,
iconName
:
'
walletConnectIcon.svg
'
,
description
:
'
Connect to Trust Wallet, Rainbow Wallet and more...
'
,
href
:
null
,
color
:
'
#4196FC
'
},
WALLET_LINK
:
{
connector
:
walletlink
,
name
:
'
Coinbase Wallet
'
,
iconName
:
'
coinbaseWalletIcon.svg
'
,
description
:
'
Use Coinbase Wallet app on mobile device
'
,
href
:
null
,
color
:
'
#315CF5
'
},
COINBASE_LINK
:
{
name
:
'
Open in Coinbase Wallet
'
,
iconName
:
'
coinbaseWalletIcon.svg
'
,
description
:
'
Open in Coinbase Wallet app.
'
,
href
:
'
https://go.cb-w.com/mtUDhEZPy1
'
,
color
:
'
#315CF5
'
,
mobile
:
true
,
mobileOnly
:
true
},
TRUST_WALLET_LINK
:
{
name
:
'
Open in Trust Wallet
'
,
iconName
:
'
trustWallet.png
'
,
description
:
'
iOS and Android app.
'
,
href
:
'
https://link.trustwallet.com/open_url?coin_id=60&url=https://uniswap.exchange/swap
'
,
color
:
'
#1C74CC
'
,
mobile
:
true
,
mobileOnly
:
true
},
FORTMATIC
:
{
connector
:
fortmatic
,
name
:
'
Fortmatic
'
,
iconName
:
'
fortmaticIcon.png
'
,
description
:
'
Login using Fortmatic hosted wallet
'
,
href
:
null
,
color
:
'
#6748FF
'
,
mobile
:
true
},
Portis
:
{
connector
:
portis
,
name
:
'
Portis
'
,
iconName
:
'
portisIcon.png
'
,
description
:
'
Login using Portis hosted wallet
'
,
href
:
null
,
color
:
'
#4A6C9B
'
,
mobile
:
true
}
}
}
// list of tokens that lock fund on adding liquidity - used to disable button
// list of tokens that lock fund on adding liquidity - used to disable button
export
const
brokenTokens
=
[
export
const
brokenTokens
=
[
'
0xB8c77482e45F1F44dE1745F52C74426C631bDD52
'
,
'
0xB8c77482e45F1F44dE1745F52C74426C631bDD52
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment