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
f7a1a2ab
Unverified
Commit
f7a1a2ab
authored
Aug 27, 2020
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move noImplicitAny and some type declarations
parent
66a20062
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
54 additions
and
50 deletions
+54
-50
index.tsx
src/components/AccountDetails/index.tsx
+3
-3
index.tsx
src/components/NumericalInput/index.tsx
+1
-1
ListUpdatePopup.tsx
src/components/Popups/ListUpdatePopup.tsx
+2
-1
index.tsx
src/components/TransactionSettings/index.tsx
+10
-10
index.tsx
src/components/WalletModal/index.tsx
+3
-2
index.tsx
src/components/Web3ReactManager/index.tsx
+1
-1
GoogleAnalyticsReporter.tsx
src/components/analytics/GoogleAnalyticsReporter.tsx
+1
-1
Fortmatic.ts
src/connectors/Fortmatic.ts
+1
-0
ethereum.d.ts
src/ethereum.d.ts
+0
-8
ethereum.d.ts
src/hooks/ethereum.d.ts
+0
-8
RemoveV1Exchange.tsx
src/pages/MigrateV1/RemoveV1Exchange.tsx
+1
-1
react-app-env.d.ts
src/react-app-env.d.ts
+25
-0
updater.ts
src/state/application/updater.ts
+1
-1
updater.tsx
src/state/multicall/updater.tsx
+1
-1
updater.tsx
src/state/transactions/updater.tsx
+1
-1
updater.tsx
src/state/user/updater.tsx
+1
-1
DarkModeQueryParamReader.tsx
src/theme/DarkModeQueryParamReader.tsx
+1
-1
content-hash.d.ts
src/utils/content-hash.d.ts
+0
-4
multihashes.d.ts
src/utils/multihashes.d.ts
+0
-4
tsconfig.json
tsconfig.json
+1
-0
tsconfig.strict.json
tsconfig.strict.json
+0
-1
No files found.
src/components/AccountDetails/index.tsx
View file @
f7a1a2ab
...
...
@@ -200,7 +200,7 @@ const MainWalletAction = styled(WalletAction)`
color:
${({
theme
})
=>
theme
.
primary1
}
;
`
function
renderTransactions
(
transactions
)
{
function
renderTransactions
(
transactions
:
string
[]
)
{
return
(
<
TransactionListWrapper
>
{
transactions
.
map
((
hash
,
i
)
=>
{
...
...
@@ -212,8 +212,8 @@ function renderTransactions(transactions) {
interface
AccountDetailsProps
{
toggleWalletModal
:
()
=>
void
pendingTransactions
:
any
[]
confirmedTransactions
:
any
[]
pendingTransactions
:
string
[]
confirmedTransactions
:
string
[]
ENSName
?:
string
openOptions
:
()
=>
void
}
...
...
src/components/NumericalInput/index.tsx
View file @
f7a1a2ab
...
...
@@ -46,7 +46,7 @@ export const Input = React.memo(function InnerInput({
...
rest
}:
{
value
:
string
|
number
onUserInput
:
(
string
)
=>
void
onUserInput
:
(
input
:
string
)
=>
void
error
?:
boolean
fontSize
?:
string
align
?:
'
right
'
|
'
left
'
...
...
src/components/Popups/ListUpdatePopup.tsx
View file @
f7a1a2ab
...
...
@@ -44,7 +44,8 @@ export default function ListUpdatePopup({
return
diffTokenLists
(
oldList
.
tokens
,
newList
.
tokens
)
},
[
newList
.
tokens
,
oldList
.
tokens
])
const
numTokensChanged
=
useMemo
(
()
=>
Object
.
keys
(
tokensChanged
).
reduce
((
memo
,
chainId
)
=>
memo
+
Object
.
keys
(
tokensChanged
[
chainId
]).
length
,
0
),
()
=>
Object
.
keys
(
tokensChanged
).
reduce
((
memo
,
chainId
:
any
)
=>
memo
+
Object
.
keys
(
tokensChanged
[
chainId
]).
length
,
0
),
[
tokensChanged
]
)
...
...
src/components/TransactionSettings/index.tsx
View file @
f7a1a2ab
...
...
@@ -118,12 +118,12 @@ export default function SlippageTabs({ rawSlippage, setRawSlippage, deadline, se
deadlineError
=
DeadlineError
.
InvalidInput
}
function
parseCustomSlippage
(
event
)
{
setSlippageInput
(
event
.
target
.
value
)
function
parseCustomSlippage
(
value
:
string
)
{
setSlippageInput
(
value
)
let
valueAsIntFromRoundedFloat
:
number
try
{
valueAsIntFromRoundedFloat
=
Number
.
parseInt
((
Number
.
parseFloat
(
event
.
target
.
value
)
*
100
).
toString
())
valueAsIntFromRoundedFloat
=
Number
.
parseInt
((
Number
.
parseFloat
(
value
)
*
100
).
toString
())
}
catch
{}
if
(
...
...
@@ -135,12 +135,12 @@ export default function SlippageTabs({ rawSlippage, setRawSlippage, deadline, se
}
}
function
parseCustomDeadline
(
event
)
{
setDeadlineInput
(
event
.
target
.
value
)
function
parseCustomDeadline
(
value
:
string
)
{
setDeadlineInput
(
value
)
let
valueAsInt
:
number
try
{
valueAsInt
=
Number
.
parseInt
(
event
.
target
.
value
)
*
60
valueAsInt
=
Number
.
parseInt
(
value
)
*
60
}
catch
{}
if
(
typeof
valueAsInt
===
'
number
'
&&
!
Number
.
isNaN
(
valueAsInt
)
&&
valueAsInt
>
0
)
{
...
...
@@ -200,9 +200,9 @@ export default function SlippageTabs({ rawSlippage, setRawSlippage, deadline, se
placeholder=
{
(
rawSlippage
/
100
).
toFixed
(
2
)
}
value=
{
slippageInput
}
onBlur=
{
()
=>
{
parseCustomSlippage
(
{
target
:
{
value
:
(
rawSlippage
/
100
).
toFixed
(
2
)
}
}
)
parseCustomSlippage
(
(
rawSlippage
/
100
).
toFixed
(
2
)
)
}
}
onChange=
{
parseCustomSlippage
}
onChange=
{
e
=>
parseCustomSlippage
(
e
.
target
.
value
)
}
color=
{
!
slippageInputIsValid
?
'
red
'
:
''
}
/>
%
...
...
@@ -238,11 +238,11 @@ export default function SlippageTabs({ rawSlippage, setRawSlippage, deadline, se
<
Input
color=
{
!!
deadlineError
?
'
red
'
:
undefined
}
onBlur=
{
()
=>
{
parseCustomDeadline
(
{
target
:
{
value
:
(
deadline
/
60
).
toString
()
}
}
)
parseCustomDeadline
(
(
deadline
/
60
).
toString
()
)
}
}
placeholder=
{
(
deadline
/
60
).
toString
()
}
value=
{
deadlineInput
}
onChange=
{
parseCustomDeadline
}
onChange=
{
e
=>
parseCustomDeadline
(
e
.
target
.
value
)
}
/>
</
OptionCustom
>
<
TYPE
.
body
style=
{
{
paddingLeft
:
'
8px
'
}
}
fontSize=
{
14
}
>
...
...
src/components/WalletModal/index.tsx
View file @
f7a1a2ab
...
...
@@ -17,6 +17,7 @@ import { ReactComponent as Close } from '../../assets/images/x.svg'
import
{
injected
,
fortmatic
,
portis
}
from
'
../../connectors
'
import
{
OVERLAY_READY
}
from
'
../../connectors/Fortmatic
'
import
{
WalletConnectConnector
}
from
'
@web3-react/walletconnect-connector
'
import
{
AbstractConnector
}
from
'
@web3-react/abstract-connector
'
const
CloseIcon
=
styled
.
div
`
position: absolute;
...
...
@@ -128,7 +129,7 @@ export default function WalletModal({
const
[
walletView
,
setWalletView
]
=
useState
(
WALLET_VIEWS
.
ACCOUNT
)
const
[
pendingWallet
,
setPendingWallet
]
=
useState
()
const
[
pendingWallet
,
setPendingWallet
]
=
useState
<
AbstractConnector
|
undefined
>
()
const
[
pendingError
,
setPendingError
]
=
useState
<
boolean
>
()
...
...
@@ -161,7 +162,7 @@ export default function WalletModal({
}
},
[
setWalletView
,
active
,
error
,
connector
,
walletModalOpen
,
activePrevious
,
connectorPrevious
])
const
tryActivation
=
async
connector
=>
{
const
tryActivation
=
async
(
connector
:
AbstractConnector
|
undefined
)
=>
{
let
name
=
''
Object
.
keys
(
SUPPORTED_WALLETS
).
map
(
key
=>
{
if
(
connector
===
SUPPORTED_WALLETS
[
key
].
connector
)
{
...
...
src/components/Web3ReactManager/index.tsx
View file @
f7a1a2ab
...
...
@@ -19,7 +19,7 @@ const Message = styled.h2`
color:
${({
theme
})
=>
theme
.
secondary1
}
;
`
export
default
function
Web3ReactManager
({
children
}
)
{
export
default
function
Web3ReactManager
({
children
}
:
{
children
:
JSX
.
Element
}):
JSX
.
Element
{
const
{
t
}
=
useTranslation
()
const
{
active
}
=
useWeb3React
()
const
{
active
:
networkActive
,
error
:
networkError
,
activate
:
activateNetwork
}
=
useWeb3React
(
NetworkContextName
)
...
...
src/components/analytics/GoogleAnalyticsReporter.tsx
View file @
f7a1a2ab
...
...
@@ -3,7 +3,7 @@ import ReactGA from 'react-ga'
import
{
RouteComponentProps
}
from
'
react-router-dom
'
// fires a GA pageview every time the route changes
export
default
function
GoogleAnalyticsReporter
({
location
:
{
pathname
,
search
}
}:
RouteComponentProps
)
{
export
default
function
GoogleAnalyticsReporter
({
location
:
{
pathname
,
search
}
}:
RouteComponentProps
)
:
null
{
useEffect
(()
=>
{
ReactGA
.
pageview
(
`
${
pathname
}${
search
}
`
)
},
[
pathname
,
search
])
...
...
src/connectors/Fortmatic.ts
View file @
f7a1a2ab
...
...
@@ -16,6 +16,7 @@ export class FortmaticConnector extends FortmaticConnectorCore {
async
activate
()
{
if
(
!
this
.
fortmatic
)
{
const
{
default
:
Fortmatic
}
=
await
import
(
'
fortmatic
'
)
const
{
apiKey
,
chainId
}
=
this
as
any
if
(
chainId
in
CHAIN_ID_NETWORK_ARGUMENT
)
{
this
.
fortmatic
=
new
Fortmatic
(
apiKey
,
CHAIN_ID_NETWORK_ARGUMENT
[
chainId
as
FormaticSupportedChains
])
...
...
src/ethereum.d.ts
deleted
100644 → 0
View file @
66a20062
interface
Window
{
ethereum
?:
{
isMetaMask
?:
true
on
?:
(...
args
:
any
[])
=>
void
removeListener
?:
(...
args
:
any
[])
=>
void
}
web3
?:
{}
}
src/hooks/ethereum.d.ts
deleted
100644 → 0
View file @
66a20062
interface
Window
{
ethereum
?:
{
isMetaMask
?:
true
on
?:
(...
args
:
any
[])
=>
void
removeListener
?:
(...
args
:
any
[])
=>
void
}
web3
?:
{}
}
src/pages/MigrateV1/RemoveV1Exchange.tsx
View file @
f7a1a2ab
...
...
@@ -83,7 +83,7 @@ function V1PairRemoval({
})
setPendingRemovalHash
(
response
.
hash
)
})
.
catch
(
error
=>
{
.
catch
(
(
error
:
Error
)
=>
{
console
.
error
(
error
)
setConfirmingRemoval
(
false
)
})
...
...
src/react-app-env.d.ts
View file @
f7a1a2ab
/// <reference types="react-scripts" />
declare
module
'
jazzicon
'
{
export
default
function
(
diameter
:
number
,
seed
:
number
):
HTMLElement
}
declare
module
'
fortmatic
'
interface
Window
{
ethereum
?:
{
isMetaMask
?:
true
on
?:
(...
args
:
any
[])
=>
void
removeListener
?:
(...
args
:
any
[])
=>
void
}
web3
?:
{}
}
declare
module
'
content-hash
'
{
declare
function
decode
(
x
:
string
):
string
declare
function
getCodec
(
x
:
string
):
string
}
declare
module
'
multihashes
'
{
declare
function
decode
(
buff
:
Uint8Array
):
{
code
:
number
;
name
:
string
;
length
:
number
;
digest
:
Uint8Array
}
declare
function
toB58String
(
hash
:
Uint8Array
):
string
}
src/state/application/updater.ts
View file @
f7a1a2ab
...
...
@@ -5,7 +5,7 @@ import useIsWindowVisible from '../../hooks/useIsWindowVisible'
import
{
updateBlockNumber
}
from
'
./actions
'
import
{
useDispatch
}
from
'
react-redux
'
export
default
function
Updater
()
{
export
default
function
Updater
()
:
null
{
const
{
library
,
chainId
}
=
useActiveWeb3React
()
const
dispatch
=
useDispatch
()
...
...
src/state/multicall/updater.tsx
View file @
f7a1a2ab
...
...
@@ -110,7 +110,7 @@ export function outdatedListeningKeys(
})
}
export
default
function
Updater
()
{
export
default
function
Updater
()
:
null
{
const
dispatch
=
useDispatch
<
AppDispatch
>
()
const
state
=
useSelector
<
AppState
,
AppState
[
'
multicall
'
]
>
(
state
=>
state
.
multicall
)
// wait for listeners to settle before triggering updates
...
...
src/state/transactions/updater.tsx
View file @
f7a1a2ab
...
...
@@ -26,7 +26,7 @@ export function shouldCheck(
}
}
export
default
function
Updater
()
{
export
default
function
Updater
()
:
null
{
const
{
chainId
,
library
}
=
useActiveWeb3React
()
const
lastBlockNumber
=
useBlockNumber
()
...
...
src/state/user/updater.tsx
View file @
f7a1a2ab
...
...
@@ -3,7 +3,7 @@ import { useDispatch } from 'react-redux'
import
{
AppDispatch
}
from
'
../index
'
import
{
updateMatchesDarkMode
}
from
'
./actions
'
export
default
function
Updater
()
{
export
default
function
Updater
()
:
null
{
const
dispatch
=
useDispatch
<
AppDispatch
>
()
// keep dark mode in sync with the system
...
...
src/theme/DarkModeQueryParamReader.tsx
View file @
f7a1a2ab
...
...
@@ -5,7 +5,7 @@ import { parse } from 'qs'
import
{
AppDispatch
}
from
'
../state
'
import
{
updateUserDarkMode
}
from
'
../state/user/actions
'
export
default
function
DarkModeQueryParamReader
({
location
:
{
search
}
}:
RouteComponentProps
)
{
export
default
function
DarkModeQueryParamReader
({
location
:
{
search
}
}:
RouteComponentProps
)
:
null
{
const
dispatch
=
useDispatch
<
AppDispatch
>
()
useEffect
(()
=>
{
...
...
src/utils/content-hash.d.ts
deleted
100644 → 0
View file @
66a20062
declare
module
'
content-hash
'
{
declare
function
decode
(
x
:
string
):
string
declare
function
getCodec
(
x
:
string
):
string
}
src/utils/multihashes.d.ts
deleted
100644 → 0
View file @
66a20062
declare
module
'
multihashes
'
{
declare
function
decode
(
buff
:
Uint8Array
):
{
code
:
number
;
name
:
string
;
length
:
number
;
digest
:
Uint8Array
}
declare
function
toB58String
(
hash
:
Uint8Array
):
string
}
tsconfig.json
View file @
f7a1a2ab
...
...
@@ -15,6 +15,7 @@
"module"
:
"esnext"
,
"noUnusedLocals"
:
true
,
"noFallthroughCasesInSwitch"
:
true
,
"noImplicitAny"
:
true
,
"noImplicitThis"
:
true
,
"noImplicitReturns"
:
true
,
"moduleResolution"
:
"node"
,
...
...
tsconfig.strict.json
View file @
f7a1a2ab
...
...
@@ -2,7 +2,6 @@
"extends"
:
"./tsconfig.json"
,
"compilerOptions"
:
{
"strict"
:
true
,
"noImplicitAny"
:
true
,
"alwaysStrict"
:
true
,
"strictNullChecks"
:
true
}
...
...
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