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
d180aef3
Unverified
Commit
d180aef3
authored
May 24, 2023
by
eddie
Committed by
GitHub
May 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: no-undefined-or in object field types (#6640)
parent
c07c4011
Changes
72
Show whitespace changes
Inline
Side-by-side
Showing
72 changed files
with
162 additions
and
133 deletions
+162
-133
.eslintrc.js
.eslintrc.js
+1
-0
no-undefined-or.js
eslint_rules/no-undefined-or.js
+44
-0
useMultiChainPositions.tsx
...ountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx
+1
-1
RangeBadge.tsx
src/components/Badge/RangeBadge.tsx
+1
-7
SparklineChart.tsx
src/components/Charts/SparklineChart.tsx
+1
-1
index.tsx
src/components/ConnectedAccountBlocked/index.tsx
+1
-1
index.tsx
src/components/FeeSelector/index.tsx
+2
-2
InputStepCounter.tsx
src/components/InputStepCounter/InputStepCounter.tsx
+2
-2
Area.tsx
src/components/LiquidityChartRangeInput/Area.tsx
+2
-2
hooks.ts
src/components/LiquidityChartRangeInput/hooks.ts
+3
-3
index.tsx
src/components/LiquidityChartRangeInput/index.tsx
+3
-3
types.ts
src/components/LiquidityChartRangeInput/types.ts
+1
-1
index.tsx
src/components/ModalViews/index.tsx
+1
-9
SearchBarDropdown.tsx
src/components/NavBar/SearchBarDropdown.tsx
+1
-1
index.tsx
src/components/NavigationTabs/index.tsx
+3
-3
index.tsx
src/components/NumericalInput/index.tsx
+1
-1
index.tsx
src/components/PositionPreview/index.tsx
+1
-1
About.tsx
src/components/Tokens/TokenDetails/About.tsx
+3
-3
PriceChart.tsx
src/components/Tokens/TokenDetails/PriceChart.tsx
+2
-2
index.tsx
src/components/Tokens/TokenDetails/index.tsx
+2
-2
index.tsx
src/components/TransactionConfirmationModal/index.tsx
+6
-6
ConfirmSwapModal.tsx
src/components/swap/ConfirmSwapModal.tsx
+4
-4
SwapDetailsDropdown.tsx
src/components/swap/SwapDetailsDropdown.tsx
+1
-1
SwapModalFooter.tsx
src/components/swap/SwapModalFooter.tsx
+3
-3
SwapModalHeaderAmount.tsx
src/components/swap/SwapModalHeaderAmount.tsx
+1
-1
styleds.tsx
src/components/swap/styleds.tsx
+1
-1
ExecuteModal.tsx
src/components/vote/ExecuteModal.tsx
+1
-1
QueueModal.tsx
src/components/vote/QueueModal.tsx
+1
-1
VoteModal.tsx
src/components/vote/VoteModal.tsx
+2
-2
TopTokens.ts
src/graphql/data/TopTokens.ts
+1
-1
util.tsx
src/graphql/data/util.tsx
+1
-1
FeeTierDistributionQuery.ts
src/graphql/thegraph/FeeTierDistributionQuery.ts
+1
-1
useClientSideV3Trade.ts
src/hooks/useClientSideV3Trade.ts
+1
-1
useDerivedPositionInfo.ts
src/hooks/useDerivedPositionInfo.ts
+2
-2
useFeeTierDistribution.ts
src/hooks/useFeeTierDistribution.ts
+1
-1
usePoolTickData.ts
src/hooks/usePoolTickData.ts
+3
-3
useSwapCallback.tsx
src/hooks/useSwapCallback.tsx
+1
-1
useTokenAllowance.ts
src/hooks/useTokenAllowance.ts
+2
-2
useUSDPrice.ts
src/hooks/useUSDPrice.ts
+2
-2
useUniversalRouter.ts
src/hooks/useUniversalRouter.ts
+1
-1
useV3Positions.ts
src/hooks/useV3Positions.ts
+2
-2
useWrapCallback.tsx
src/hooks/useWrapCallback.tsx
+1
-1
useRoutingAPIArguments.ts
src/lib/hooks/routing/useRoutingAPIArguments.ts
+3
-3
analytics.ts
src/lib/utils/analytics.ts
+1
-1
formatLocaleNumber.ts
src/lib/utils/formatLocaleNumber.ts
+1
-1
parseENSAddress.ts
src/lib/utils/parseENSAddress.ts
+1
-3
BagFooter.tsx
src/nft/components/bag/BagFooter.tsx
+3
-3
BagRow.tsx
src/nft/components/bag/BagRow.tsx
+3
-3
Sweep.tsx
src/nft/components/collection/Sweep.tsx
+1
-1
AssetActivity.tsx
src/nft/components/details/AssetActivity.tsx
+1
-1
MediaRenderer.tsx
src/nft/components/details/detailsV2/MediaRenderer.tsx
+1
-1
PriceTextInput.tsx
src/nft/components/profile/list/PriceTextInput.tsx
+1
-1
ProfilePage.tsx
src/nft/components/profile/view/ProfilePage.tsx
+1
-1
useDerivedPayWithAnyTokenSwapInfo.ts
src/nft/hooks/useDerivedPayWithAnyTokenSwapInfo.ts
+2
-2
useTokenInput.ts
src/nft/hooks/useTokenInput.ts
+2
-2
useWalletBalance.ts
src/nft/hooks/useWalletBalance.ts
+1
-1
sell.ts
src/nft/types/sell/sell.ts
+1
-1
tokenRoutes.ts
src/nft/utils/tokenRoutes.ts
+3
-3
ProposalActionDetail.tsx
src/pages/CreateProposal/ProposalActionDetail.tsx
+1
-1
ProposalSubmissionModal.tsx
src/pages/CreateProposal/ProposalSubmissionModal.tsx
+1
-1
index.tsx
src/pages/Swap/index.tsx
+4
-4
reducer.ts
src/state/connection/reducer.ts
+1
-1
hooks.ts
src/state/governance/hooks.ts
+1
-1
hooks.ts
src/state/logs/hooks.ts
+1
-1
hooks.tsx
src/state/mint/v3/hooks.tsx
+1
-1
hooks.tsx
src/state/stake/hooks.tsx
+1
-1
hooks.tsx
src/state/swap/hooks.tsx
+1
-1
reducer.ts
src/state/swap/reducer.ts
+2
-2
reducer.ts
src/state/user/reducer.ts
+2
-2
formatNumbers.ts
src/utils/formatNumbers.ts
+1
-1
formatTickPrice.ts
src/utils/formatTickPrice.ts
+1
-1
loggingFormatters.ts
src/utils/loggingFormatters.ts
+3
-3
No files found.
.eslintrc.js
View file @
d180aef3
...
@@ -14,6 +14,7 @@ module.exports = {
...
@@ -14,6 +14,7 @@ module.exports = {
rules
:
{
rules
:
{
'
multiline-comment-style
'
:
[
'
error
'
,
'
separate-lines
'
],
'
multiline-comment-style
'
:
[
'
error
'
,
'
separate-lines
'
],
'
rulesdir/enforce-retry-on-import
'
:
'
error
'
,
'
rulesdir/enforce-retry-on-import
'
:
'
error
'
,
'
rulesdir/no-undefined-or
'
:
'
error
'
,
},
},
},
},
{
{
...
...
eslint_rules/no-undefined-or.js
0 → 100644
View file @
d180aef3
/* eslint-env node */
module
.
exports
=
{
meta
:
{
type
:
'
suggestion
'
,
docs
:
{
description
:
'
Enforce the use of optional object fields
'
,
category
:
'
Best Practices
'
,
recommended
:
true
,
},
fixable
:
'
code
'
,
schema
:
[],
},
create
(
context
)
{
return
{
'
TSPropertySignature > TSTypeAnnotation > TSUnionType
'
:
(
node
)
=>
{
const
types
=
node
.
types
const
hasUndefined
=
types
.
some
((
typeNode
)
=>
typeNode
.
type
===
'
TSUndefinedKeyword
'
)
if
(
hasUndefined
)
{
const
typesWithoutUndefined
=
types
.
filter
((
typeNode
)
=>
typeNode
.
type
!==
'
TSUndefinedKeyword
'
)
// If there is more than one type left after removing 'undefined',
// join them together with ' | ' to create a new union type.
const
newTypeSource
=
typesWithoutUndefined
.
length
>
1
?
typesWithoutUndefined
.
map
((
typeNode
)
=>
context
.
getSourceCode
().
getText
(
typeNode
)).
join
(
'
|
'
)
:
context
.
getSourceCode
().
getText
(
typesWithoutUndefined
[
0
])
context
.
report
({
node
,
message
:
`Prefer optional properties to "Type | undefined".`
,
fix
(
fixer
)
{
const
propertySignature
=
node
.
parent
.
parent
const
isAlreadyOptional
=
propertySignature
.
optional
const
newTypeAnnotation
=
isAlreadyOptional
?
`:
${
newTypeSource
}
`
:
`?:
${
newTypeSource
}
`
return
fixer
.
replaceText
(
node
.
parent
,
newTypeAnnotation
)
},
})
}
},
}
},
}
src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx
View file @
d180aef3
...
@@ -49,7 +49,7 @@ const DEFAULT_CHAINS = [
...
@@ -49,7 +49,7 @@ const DEFAULT_CHAINS = [
SupportedChainId
.
CELO
,
SupportedChainId
.
CELO
,
]
]
type
UseMultiChainPositionsData
=
{
positions
:
PositionInfo
[]
|
undefined
;
loading
:
boolean
}
type
UseMultiChainPositionsData
=
{
positions
?:
PositionInfo
[]
;
loading
:
boolean
}
/**
/**
* Returns all positions for a given account on multiple chains.
* Returns all positions for a given account on multiple chains.
...
...
src/components/Badge/RangeBadge.tsx
View file @
d180aef3
...
@@ -32,13 +32,7 @@ const LabelText = styled.div<{ color: string }>`
...
@@ -32,13 +32,7 @@ const LabelText = styled.div<{ color: string }>`
justify-content: flex-end;
justify-content: flex-end;
`
`
export
default
function
RangeBadge
({
export
default
function
RangeBadge
({
removed
,
inRange
}:
{
removed
?:
boolean
;
inRange
?:
boolean
})
{
removed
,
inRange
,
}:
{
removed
:
boolean
|
undefined
inRange
:
boolean
|
undefined
})
{
const
theme
=
useTheme
()
const
theme
=
useTheme
()
return
(
return
(
<
BadgeWrapper
>
<
BadgeWrapper
>
...
...
src/components/Charts/SparklineChart.tsx
View file @
d180aef3
...
@@ -19,7 +19,7 @@ interface SparklineChartProps {
...
@@ -19,7 +19,7 @@ interface SparklineChartProps {
width
:
number
width
:
number
height
:
number
height
:
number
tokenData
:
TopToken
tokenData
:
TopToken
pricePercentChange
:
number
|
undefined
|
null
pricePercentChange
?:
number
|
null
sparklineMap
:
SparklineMap
sparklineMap
:
SparklineMap
}
}
...
...
src/components/ConnectedAccountBlocked/index.tsx
View file @
d180aef3
...
@@ -14,7 +14,7 @@ const ContentWrapper = styled(Column)`
...
@@ -14,7 +14,7 @@ const ContentWrapper = styled(Column)`
font-size: 12px;
font-size: 12px;
`
`
interface
ConnectedAccountBlockedProps
{
interface
ConnectedAccountBlockedProps
{
account
:
string
|
null
|
undefined
account
?:
string
|
null
isOpen
:
boolean
isOpen
:
boolean
}
}
...
...
src/components/FeeSelector/index.tsx
View file @
d180aef3
...
@@ -56,8 +56,8 @@ export default function FeeSelector({
...
@@ -56,8 +56,8 @@ export default function FeeSelector({
disabled
?:
boolean
disabled
?:
boolean
feeAmount
?:
FeeAmount
feeAmount
?:
FeeAmount
handleFeePoolSelect
:
(
feeAmount
:
FeeAmount
)
=>
void
handleFeePoolSelect
:
(
feeAmount
:
FeeAmount
)
=>
void
currencyA
?:
Currency
|
undefined
currencyA
?:
Currency
currencyB
?:
Currency
|
undefined
currencyB
?:
Currency
})
{
})
{
const
{
chainId
}
=
useWeb3React
()
const
{
chainId
}
=
useWeb3React
()
...
...
src/components/InputStepCounter/InputStepCounter.tsx
View file @
d180aef3
...
@@ -79,8 +79,8 @@ interface StepCounterProps {
...
@@ -79,8 +79,8 @@ interface StepCounterProps {
width
?:
string
width
?:
string
locked
?:
boolean
// disable input
locked
?:
boolean
// disable input
title
:
ReactNode
title
:
ReactNode
tokenA
:
string
|
undefined
tokenA
?:
string
tokenB
:
string
|
undefined
tokenB
?:
string
}
}
const
StepCounter
=
({
const
StepCounter
=
({
...
...
src/components/LiquidityChartRangeInput/Area.tsx
View file @
d180aef3
...
@@ -4,7 +4,7 @@ import styled from 'styled-components/macro'
...
@@ -4,7 +4,7 @@ import styled from 'styled-components/macro'
import
{
ChartEntry
}
from
'
./types
'
import
{
ChartEntry
}
from
'
./types
'
const
Path
=
styled
.
path
<
{
fill
:
string
|
undefined
}
>
`
const
Path
=
styled
.
path
<
{
fill
?:
string
}
>
`
opacity: 0.5;
opacity: 0.5;
stroke:
${({
fill
,
theme
})
=>
fill
??
theme
.
accentAction
};
stroke:
${({
fill
,
theme
})
=>
fill
??
theme
.
accentAction
};
fill
:
$
{({
fill
,
theme
})
=>
fill
??
theme
.
accentAction
};
fill
:
$
{({
fill
,
theme
})
=>
fill
??
theme
.
accentAction
};
...
@@ -23,7 +23,7 @@ export const Area = ({
...
@@ -23,7 +23,7 @@ export const Area = ({
yScale: ScaleLinear<number, number>
yScale: ScaleLinear<number, number>
xValue: (d: ChartEntry) => number
xValue: (d: ChartEntry) => number
yValue: (d: ChartEntry) => number
yValue: (d: ChartEntry) => number
fill?: string
| undefined
fill?: string
}) =>
}) =>
useMemo(
useMemo(
() => (
() => (
...
...
src/components/LiquidityChartRangeInput/hooks.ts
View file @
d180aef3
...
@@ -10,9 +10,9 @@ export function useDensityChartData({
...
@@ -10,9 +10,9 @@ export function useDensityChartData({
currencyB
,
currencyB
,
feeAmount
,
feeAmount
,
}:
{
}:
{
currencyA
:
Currency
|
undefined
currencyA
?:
Currency
currencyB
:
Currency
|
undefined
currencyB
?:
Currency
feeAmount
:
FeeAmount
|
undefined
feeAmount
?:
FeeAmount
})
{
})
{
const
{
isLoading
,
error
,
data
}
=
usePoolActiveLiquidity
(
currencyA
,
currencyB
,
feeAmount
)
const
{
isLoading
,
error
,
data
}
=
usePoolActiveLiquidity
(
currencyA
,
currencyB
,
feeAmount
)
...
...
src/components/LiquidityChartRangeInput/index.tsx
View file @
d180aef3
...
@@ -76,11 +76,11 @@ export default function LiquidityChartRangeInput({
...
@@ -76,11 +76,11 @@ export default function LiquidityChartRangeInput({
onRightRangeInput
,
onRightRangeInput
,
interactive
,
interactive
,
}:
{
}:
{
currencyA
:
Currency
|
undefined
currencyA
?:
Currency
currencyB
:
Currency
|
undefined
currencyB
?:
Currency
feeAmount
?:
FeeAmount
feeAmount
?:
FeeAmount
ticksAtLimit
:
{
[
bound
in
Bound
]?:
boolean
|
undefined
}
ticksAtLimit
:
{
[
bound
in
Bound
]?:
boolean
|
undefined
}
price
:
number
|
undefined
price
?:
number
priceLower
?:
Price
<
Token
,
Token
>
priceLower
?:
Price
<
Token
,
Token
>
priceUpper
?:
Price
<
Token
,
Token
>
priceUpper
?:
Price
<
Token
,
Token
>
onLeftRangeInput
:
(
typedValue
:
string
)
=>
void
onLeftRangeInput
:
(
typedValue
:
string
)
=>
void
...
...
src/components/LiquidityChartRangeInput/types.ts
View file @
d180aef3
...
@@ -54,7 +54,7 @@ export interface LiquidityChartRangeInputProps {
...
@@ -54,7 +54,7 @@ export interface LiquidityChartRangeInputProps {
interactive
?:
boolean
interactive
?:
boolean
brushLabels
:
(
d
:
'
w
'
|
'
e
'
,
x
:
number
)
=>
string
brushLabels
:
(
d
:
'
w
'
|
'
e
'
,
x
:
number
)
=>
string
brushDomain
:
[
number
,
number
]
|
undefined
brushDomain
?:
[
number
,
number
]
onBrushDomainChange
:
(
domain
:
[
number
,
number
],
mode
:
string
|
undefined
)
=>
void
onBrushDomainChange
:
(
domain
:
[
number
,
number
],
mode
:
string
|
undefined
)
=>
void
zoomLevels
:
ZoomLevels
zoomLevels
:
ZoomLevels
...
...
src/components/ModalViews/index.tsx
View file @
d180aef3
...
@@ -39,15 +39,7 @@ export function LoadingView({ children, onDismiss }: { children: any; onDismiss:
...
@@ -39,15 +39,7 @@ export function LoadingView({ children, onDismiss }: { children: any; onDismiss:
)
)
}
}
export
function
SubmittedView
({
export
function
SubmittedView
({
children
,
onDismiss
,
hash
}:
{
children
:
any
;
onDismiss
:
()
=>
void
;
hash
?:
string
})
{
children
,
onDismiss
,
hash
,
}:
{
children
:
any
onDismiss
:
()
=>
void
hash
:
string
|
undefined
})
{
const
theme
=
useTheme
()
const
theme
=
useTheme
()
const
{
chainId
}
=
useWeb3React
()
const
{
chainId
}
=
useWeb3React
()
...
...
src/components/NavBar/SearchBarDropdown.tsx
View file @
d180aef3
...
@@ -33,7 +33,7 @@ interface SearchBarDropdownSectionProps {
...
@@ -33,7 +33,7 @@ interface SearchBarDropdownSectionProps {
suggestions
:
(
GenieCollection
|
SearchToken
)[]
suggestions
:
(
GenieCollection
|
SearchToken
)[]
header
:
JSX
.
Element
header
:
JSX
.
Element
headerIcon
?:
JSX
.
Element
headerIcon
?:
JSX
.
Element
hoveredIndex
:
number
|
undefined
hoveredIndex
?:
number
startingIndex
:
number
startingIndex
:
number
setHoveredIndex
:
(
index
:
number
|
undefined
)
=>
void
setHoveredIndex
:
(
index
:
number
|
undefined
)
=>
void
isLoading
?:
boolean
isLoading
?:
boolean
...
...
src/components/NavigationTabs/index.tsx
View file @
d180aef3
...
@@ -21,7 +21,7 @@ const Tabs = styled.div`
...
@@ -21,7 +21,7 @@ const Tabs = styled.div`
justify-content: space-evenly;
justify-content: space-evenly;
`
`
const
StyledHistoryLink
=
styled
(
HistoryLink
)
<
{
flex
:
string
|
undefined
}
>
`
const
StyledHistoryLink
=
styled
(
HistoryLink
)
<
{
flex
?:
string
}
>
`
flex:
${({
flex
})
=>
flex
??
'
none
'
};
flex:
${({
flex
})
=>
flex
??
'
none
'
};
$
{({
theme
})
=>
theme
.
deprecated_mediaWidth
.
deprecated_upToMedium
`
$
{({
theme
})
=>
theme
.
deprecated_mediaWidth
.
deprecated_upToMedium
`
...
@@ -64,9 +64,9 @@ export function AddRemoveTabs({
...
@@ -64,9 +64,9 @@ export function AddRemoveTabs({
adding
:
boolean
adding
:
boolean
creating
:
boolean
creating
:
boolean
autoSlippage
:
Percent
autoSlippage
:
Percent
positionID
?:
string
|
undefined
positionID
?:
string
showBackLink
?:
boolean
showBackLink
?:
boolean
children
?:
ReactNode
|
undefined
children
?:
ReactNode
})
{
})
{
const
theme
=
useTheme
()
const
theme
=
useTheme
()
// reset states on back
// reset states on back
...
...
src/components/NumericalInput/index.tsx
View file @
d180aef3
...
@@ -53,7 +53,7 @@ export const Input = React.memo(function InnerInput({
...
@@ -53,7 +53,7 @@ export const Input = React.memo(function InnerInput({
error
?:
boolean
error
?:
boolean
fontSize
?:
string
fontSize
?:
string
align
?:
'
right
'
|
'
left
'
align
?:
'
right
'
|
'
left
'
prependSymbol
?:
string
|
undefined
prependSymbol
?:
string
}
&
Omit
<
React
.
HTMLProps
<
HTMLInputElement
>
,
'
ref
'
|
'
onChange
'
|
'
as
'
>
)
{
}
&
Omit
<
React
.
HTMLProps
<
HTMLInputElement
>
,
'
ref
'
|
'
onChange
'
|
'
as
'
>
)
{
const
enforcer
=
(
nextUserInput
:
string
)
=>
{
const
enforcer
=
(
nextUserInput
:
string
)
=>
{
if
(
nextUserInput
===
''
||
inputRegex
.
test
(
escapeRegExp
(
nextUserInput
)))
{
if
(
nextUserInput
===
''
||
inputRegex
.
test
(
escapeRegExp
(
nextUserInput
)))
{
...
...
src/components/PositionPreview/index.tsx
View file @
d180aef3
...
@@ -27,7 +27,7 @@ export const PositionPreview = ({
...
@@ -27,7 +27,7 @@ export const PositionPreview = ({
position
:
Position
position
:
Position
title
?:
ReactNode
title
?:
ReactNode
inRange
:
boolean
inRange
:
boolean
baseCurrencyDefault
?:
Currency
|
undefined
baseCurrencyDefault
?:
Currency
ticksAtLimit
:
{
[
bound
:
string
]:
boolean
|
undefined
}
ticksAtLimit
:
{
[
bound
:
string
]:
boolean
|
undefined
}
})
=>
{
})
=>
{
const
theme
=
useTheme
()
const
theme
=
useTheme
()
...
...
src/components/Tokens/TokenDetails/About.tsx
View file @
d180aef3
...
@@ -68,9 +68,9 @@ const ResourcesContainer = styled.div`
...
@@ -68,9 +68,9 @@ const ResourcesContainer = styled.div`
type
AboutSectionProps
=
{
type
AboutSectionProps
=
{
address
:
string
address
:
string
chainId
:
SupportedChainId
chainId
:
SupportedChainId
description
?:
string
|
null
|
undefined
description
?:
string
|
null
homepageUrl
?:
string
|
null
|
undefined
homepageUrl
?:
string
|
null
twitterName
?:
string
|
null
|
undefined
twitterName
?:
string
|
null
}
}
export
function
AboutSection
({
address
,
chainId
,
description
,
homepageUrl
,
twitterName
}:
AboutSectionProps
)
{
export
function
AboutSection
({
address
,
chainId
,
description
,
homepageUrl
,
twitterName
}:
AboutSectionProps
)
{
...
...
src/components/Tokens/TokenDetails/PriceChart.tsx
View file @
d180aef3
...
@@ -64,7 +64,7 @@ export function formatDelta(delta: number | null | undefined) {
...
@@ -64,7 +64,7 @@ export function formatDelta(delta: number | null | undefined) {
return
formattedDelta
return
formattedDelta
}
}
export
const
DeltaText
=
styled
.
span
<
{
delta
:
number
|
undefined
}
>
`
export
const
DeltaText
=
styled
.
span
<
{
delta
?:
number
}
>
`
color:
${({
theme
,
delta
})
=>
color:
${({
theme
,
delta
})
=>
delta
!==
undefined
?
(
Math
.
sign
(
delta
)
<
0
?
theme
.
accentFailure
:
theme
.
accentSuccess
)
:
theme
.
textPrimary
}
;
delta
!==
undefined
?
(
Math
.
sign
(
delta
)
<
0
?
theme
.
accentFailure
:
theme
.
accentSuccess
)
:
theme
.
textPrimary
}
;
`
`
...
@@ -124,7 +124,7 @@ const timeOptionsHeight = 44
...
@@ -124,7 +124,7 @@ const timeOptionsHeight = 44
interface
PriceChartProps
{
interface
PriceChartProps
{
width
:
number
width
:
number
height
:
number
height
:
number
prices
:
PricePoint
[]
|
undefined
|
null
prices
?:
PricePoint
[]
|
null
timePeriod
:
TimePeriod
timePeriod
:
TimePeriod
}
}
...
...
src/components/Tokens/TokenDetails/index.tsx
View file @
d180aef3
...
@@ -87,11 +87,11 @@ function useRelevantToken(
...
@@ -87,11 +87,11 @@ function useRelevantToken(
}
}
type
TokenDetailsProps
=
{
type
TokenDetailsProps
=
{
urlAddress
:
string
|
undefined
urlAddress
?:
string
inputTokenAddress
?:
string
inputTokenAddress
?:
string
chain
:
Chain
chain
:
Chain
tokenQuery
:
TokenQuery
tokenQuery
:
TokenQuery
tokenPriceQuery
:
TokenPriceQuery
|
undefined
tokenPriceQuery
?:
TokenPriceQuery
onChangeTimePeriod
:
OnChangeTimePeriod
onChangeTimePeriod
:
OnChangeTimePeriod
}
}
export
default
function
TokenDetails
({
export
default
function
TokenDetails
({
...
...
src/components/TransactionConfirmationModal/index.tsx
View file @
d180aef3
...
@@ -94,9 +94,9 @@ function TransactionSubmittedContent({
...
@@ -94,9 +94,9 @@ function TransactionSubmittedContent({
inline
,
inline
,
}:
{
}:
{
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
hash
:
string
|
undefined
hash
?:
string
chainId
:
number
chainId
:
number
currencyToAdd
?:
Currency
|
undefined
currencyToAdd
?:
Currency
inline
?:
boolean
// not in modal
inline
?:
boolean
// not in modal
})
{
})
{
const
theme
=
useTheme
()
const
theme
=
useTheme
()
...
@@ -229,9 +229,9 @@ function L2Content({
...
@@ -229,9 +229,9 @@ function L2Content({
inline
,
inline
,
}:
{
}:
{
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
hash
:
string
|
undefined
hash
?:
string
chainId
:
SupportedL2ChainId
chainId
:
SupportedL2ChainId
currencyToAdd
?:
Currency
|
undefined
currencyToAdd
?:
Currency
pendingText
:
ReactNode
pendingText
:
ReactNode
inline
?:
boolean
// not in modal
inline
?:
boolean
// not in modal
})
{
})
{
...
@@ -324,11 +324,11 @@ function L2Content({
...
@@ -324,11 +324,11 @@ function L2Content({
interface
ConfirmationModalProps
{
interface
ConfirmationModalProps
{
isOpen
:
boolean
isOpen
:
boolean
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
hash
:
string
|
undefined
hash
?:
string
content
:
()
=>
ReactNode
content
:
()
=>
ReactNode
attemptingTxn
:
boolean
attemptingTxn
:
boolean
pendingText
:
ReactNode
pendingText
:
ReactNode
currencyToAdd
?:
Currency
|
undefined
currencyToAdd
?:
Currency
}
}
export
default
function
TransactionConfirmationModal
({
export
default
function
TransactionConfirmationModal
({
...
...
src/components/swap/ConfirmSwapModal.tsx
View file @
d180aef3
...
@@ -30,15 +30,15 @@ export default function ConfirmSwapModal({
...
@@ -30,15 +30,15 @@ export default function ConfirmSwapModal({
fiatValueOutput
,
fiatValueOutput
,
}:
{
}:
{
trade
:
InterfaceTrade
trade
:
InterfaceTrade
originalTrade
:
InterfaceTrade
|
undefined
originalTrade
?:
InterfaceTrade
attemptingTxn
:
boolean
attemptingTxn
:
boolean
txHash
:
string
|
undefined
txHash
?:
string
allowedSlippage
:
Percent
allowedSlippage
:
Percent
onAcceptChanges
:
()
=>
void
onAcceptChanges
:
()
=>
void
onConfirm
:
()
=>
void
onConfirm
:
()
=>
void
swapErrorMessage
:
ReactNode
|
undefined
swapErrorMessage
?:
ReactNode
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
swapQuoteReceivedDate
:
Date
|
undefined
swapQuoteReceivedDate
?:
Date
fiatValueInput
:
{
data
?:
number
;
isLoading
:
boolean
}
fiatValueInput
:
{
data
?:
number
;
isLoading
:
boolean
}
fiatValueOutput
:
{
data
?:
number
;
isLoading
:
boolean
}
fiatValueOutput
:
{
data
?:
number
;
isLoading
:
boolean
}
})
{
})
{
...
...
src/components/swap/SwapDetailsDropdown.tsx
View file @
d180aef3
...
@@ -92,7 +92,7 @@ const Wrapper = styled(Column)`
...
@@ -92,7 +92,7 @@ const Wrapper = styled(Column)`
`
`
interface
SwapDetailsInlineProps
{
interface
SwapDetailsInlineProps
{
trade
:
InterfaceTrade
|
undefined
trade
?:
InterfaceTrade
syncing
:
boolean
syncing
:
boolean
loading
:
boolean
loading
:
boolean
allowedSlippage
:
Percent
allowedSlippage
:
Percent
...
...
src/components/swap/SwapModalFooter.tsx
View file @
d180aef3
...
@@ -58,12 +58,12 @@ export default function SwapModalFooter({
...
@@ -58,12 +58,12 @@ export default function SwapModalFooter({
onAcceptChanges
,
onAcceptChanges
,
}:
{
}:
{
trade
:
InterfaceTrade
trade
:
InterfaceTrade
hash
:
string
|
undefined
hash
?:
string
allowedSlippage
:
Percent
allowedSlippage
:
Percent
onConfirm
:
()
=>
void
onConfirm
:
()
=>
void
swapErrorMessage
:
ReactNode
|
undefined
swapErrorMessage
?:
ReactNode
disabledConfirm
:
boolean
disabledConfirm
:
boolean
swapQuoteReceivedDate
:
Date
|
undefined
swapQuoteReceivedDate
?:
Date
fiatValueInput
:
{
data
?:
number
;
isLoading
:
boolean
}
fiatValueInput
:
{
data
?:
number
;
isLoading
:
boolean
}
fiatValueOutput
:
{
data
?:
number
;
isLoading
:
boolean
}
fiatValueOutput
:
{
data
?:
number
;
isLoading
:
boolean
}
showAcceptChanges
:
boolean
showAcceptChanges
:
boolean
...
...
src/components/swap/SwapModalHeaderAmount.tsx
View file @
d180aef3
...
@@ -33,7 +33,7 @@ interface AmountProps {
...
@@ -33,7 +33,7 @@ interface AmountProps {
field
:
Field
field
:
Field
tooltipText
?:
ReactNode
tooltipText
?:
ReactNode
label
:
ReactNode
label
:
ReactNode
amount
:
CurrencyAmount
<
Currency
>
|
undefined
amount
?:
CurrencyAmount
<
Currency
>
usdAmount
?:
number
usdAmount
?:
number
}
}
...
...
src/components/swap/styleds.tsx
View file @
d180aef3
...
@@ -22,7 +22,7 @@ export const PageWrapper = styled.div`
...
@@ -22,7 +22,7 @@ export const PageWrapper = styled.div`
`
`
// Mostly copied from `AppBody` but it was getting too hard to maintain backwards compatibility.
// Mostly copied from `AppBody` but it was getting too hard to maintain backwards compatibility.
export
const
SwapWrapper
=
styled
.
main
<
{
chainId
:
number
|
undefined
}
>
`
export
const
SwapWrapper
=
styled
.
main
<
{
chainId
?:
number
}
>
`
position: relative;
position: relative;
background:
${({
theme
})
=>
theme
.
backgroundSurface
}
;
background:
${({
theme
})
=>
theme
.
backgroundSurface
}
;
border-radius: 16px;
border-radius: 16px;
...
...
src/components/vote/ExecuteModal.tsx
View file @
d180aef3
...
@@ -37,7 +37,7 @@ const ConfirmedIcon = styled(ColumnCenter)`
...
@@ -37,7 +37,7 @@ const ConfirmedIcon = styled(ColumnCenter)`
interface
ExecuteModalProps
{
interface
ExecuteModalProps
{
isOpen
:
boolean
isOpen
:
boolean
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
proposalId
:
string
|
undefined
// id for the proposal to execute
proposalId
?:
string
// id for the proposal to execute
}
}
export
default
function
ExecuteModal
({
isOpen
,
onDismiss
,
proposalId
}:
ExecuteModalProps
)
{
export
default
function
ExecuteModal
({
isOpen
,
onDismiss
,
proposalId
}:
ExecuteModalProps
)
{
...
...
src/components/vote/QueueModal.tsx
View file @
d180aef3
...
@@ -37,7 +37,7 @@ const ConfirmedIcon = styled(ColumnCenter)`
...
@@ -37,7 +37,7 @@ const ConfirmedIcon = styled(ColumnCenter)`
interface
QueueModalProps
{
interface
QueueModalProps
{
isOpen
:
boolean
isOpen
:
boolean
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
proposalId
:
string
|
undefined
// id for the proposal to queue
proposalId
?:
string
// id for the proposal to queue
}
}
export
default
function
QueueModal
({
isOpen
,
onDismiss
,
proposalId
}:
QueueModalProps
)
{
export
default
function
QueueModal
({
isOpen
,
onDismiss
,
proposalId
}:
QueueModalProps
)
{
...
...
src/components/vote/VoteModal.tsx
View file @
d180aef3
...
@@ -39,8 +39,8 @@ const ConfirmedIcon = styled(ColumnCenter)`
...
@@ -39,8 +39,8 @@ const ConfirmedIcon = styled(ColumnCenter)`
interface
VoteModalProps
{
interface
VoteModalProps
{
isOpen
:
boolean
isOpen
:
boolean
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
voteOption
:
VoteOption
|
undefined
voteOption
?:
VoteOption
proposalId
:
string
|
undefined
// id for the proposal to vote on
proposalId
?:
string
// id for the proposal to vote on
}
}
export
default
function
VoteModal
({
isOpen
,
onDismiss
,
proposalId
,
voteOption
}:
VoteModalProps
)
{
export
default
function
VoteModal
({
isOpen
,
onDismiss
,
proposalId
,
voteOption
}:
VoteModalProps
)
{
...
...
src/graphql/data/TopTokens.ts
View file @
d180aef3
...
@@ -140,7 +140,7 @@ export type SparklineMap = { [key: string]: PricePoint[] | undefined }
...
@@ -140,7 +140,7 @@ export type SparklineMap = { [key: string]: PricePoint[] | undefined }
export
type
TopToken
=
NonNullable
<
NonNullable
<
TopTokens100Query
>
[
'
topTokens
'
]
>
[
number
]
export
type
TopToken
=
NonNullable
<
NonNullable
<
TopTokens100Query
>
[
'
topTokens
'
]
>
[
number
]
interface
UseTopTokensReturnValue
{
interface
UseTopTokensReturnValue
{
tokens
:
TopToken
[]
|
undefined
tokens
?:
TopToken
[]
tokenSortRank
:
Record
<
string
,
number
>
tokenSortRank
:
Record
<
string
,
number
>
loadingTokens
:
boolean
loadingTokens
:
boolean
sparklines
:
SparklineMap
sparklines
:
SparklineMap
...
...
src/graphql/data/util.tsx
View file @
d180aef3
...
@@ -153,7 +153,7 @@ export function getTokenDetailsURL({
...
@@ -153,7 +153,7 @@ export function getTokenDetailsURL({
export
function
unwrapToken
<
export
function
unwrapToken
<
T
extends
{
T
extends
{
address
?:
string
|
null
|
undefined
address
?:
string
|
null
}
|
null
}
|
null
>
(
chainId
:
number
,
token
:
T
):
T
{
>
(
chainId
:
number
,
token
:
T
):
T
{
if
(
!
token
?.
address
)
return
token
if
(
!
token
?.
address
)
return
token
...
...
src/graphql/thegraph/FeeTierDistributionQuery.ts
View file @
d180aef3
...
@@ -37,7 +37,7 @@ export default function useFeeTierDistributionQuery(
...
@@ -37,7 +37,7 @@ export default function useFeeTierDistributionQuery(
token0
:
string
|
undefined
,
token0
:
string
|
undefined
,
token1
:
string
|
undefined
,
token1
:
string
|
undefined
,
interval
:
number
interval
:
number
):
{
error
:
ApolloError
|
undefined
;
isLoading
:
boolean
;
data
:
FeeTierDistributionQuery
}
{
):
{
error
?:
ApolloError
;
isLoading
:
boolean
;
data
:
FeeTierDistributionQuery
}
{
const
{
const
{
data
,
data
,
loading
:
isLoading
,
loading
:
isLoading
,
...
...
src/hooks/useClientSideV3Trade.ts
View file @
d180aef3
...
@@ -33,7 +33,7 @@ export function useClientSideV3Trade<TTradeType extends TradeType>(
...
@@ -33,7 +33,7 @@ export function useClientSideV3Trade<TTradeType extends TradeType>(
tradeType
:
TTradeType
,
tradeType
:
TTradeType
,
amountSpecified
?:
CurrencyAmount
<
Currency
>
,
amountSpecified
?:
CurrencyAmount
<
Currency
>
,
otherCurrency
?:
Currency
otherCurrency
?:
Currency
):
{
state
:
TradeState
;
trade
:
InterfaceTrade
|
undefined
}
{
):
{
state
:
TradeState
;
trade
?:
InterfaceTrade
}
{
const
[
currencyIn
,
currencyOut
]
=
const
[
currencyIn
,
currencyOut
]
=
tradeType
===
TradeType
.
EXACT_INPUT
tradeType
===
TradeType
.
EXACT_INPUT
?
[
amountSpecified
?.
currency
,
otherCurrency
]
?
[
amountSpecified
?.
currency
,
otherCurrency
]
...
...
src/hooks/useDerivedPositionInfo.ts
View file @
d180aef3
...
@@ -5,8 +5,8 @@ import { PositionDetails } from 'types/position'
...
@@ -5,8 +5,8 @@ import { PositionDetails } from 'types/position'
import
{
useCurrency
}
from
'
./Tokens
'
import
{
useCurrency
}
from
'
./Tokens
'
export
function
useDerivedPositionInfo
(
positionDetails
:
PositionDetails
|
undefined
):
{
export
function
useDerivedPositionInfo
(
positionDetails
:
PositionDetails
|
undefined
):
{
position
:
Position
|
undefined
position
?:
Position
pool
:
Pool
|
undefined
pool
?:
Pool
}
{
}
{
const
currency0
=
useCurrency
(
positionDetails
?.
token0
)
const
currency0
=
useCurrency
(
positionDetails
?.
token0
)
const
currency1
=
useCurrency
(
positionDetails
?.
token1
)
const
currency1
=
useCurrency
(
positionDetails
?.
token1
)
...
...
src/hooks/useFeeTierDistribution.ts
View file @
d180aef3
...
@@ -13,7 +13,7 @@ const MAX_DATA_BLOCK_AGE = 20
...
@@ -13,7 +13,7 @@ const MAX_DATA_BLOCK_AGE = 20
interface
FeeTierDistribution
{
interface
FeeTierDistribution
{
isLoading
:
boolean
isLoading
:
boolean
isError
:
boolean
isError
:
boolean
largestUsageFeeTier
?:
FeeAmount
|
undefined
largestUsageFeeTier
?:
FeeAmount
// distributions as percentages of overall liquidity
// distributions as percentages of overall liquidity
distributions
?:
Record
<
FeeAmount
,
number
|
undefined
>
distributions
?:
Record
<
FeeAmount
,
number
|
undefined
>
...
...
src/hooks/usePoolTickData.ts
View file @
d180aef3
...
@@ -174,7 +174,7 @@ function useAllV3Ticks(
...
@@ -174,7 +174,7 @@ function useAllV3Ticks(
):
{
):
{
isLoading
:
boolean
isLoading
:
boolean
error
:
unknown
error
:
unknown
ticks
:
TickData
[]
|
undefined
ticks
?:
TickData
[]
}
{
}
{
const
useSubgraph
=
currencyA
?
!
CHAIN_IDS_MISSING_SUBGRAPH_DATA
.
includes
(
currencyA
.
chainId
)
:
true
const
useSubgraph
=
currencyA
?
!
CHAIN_IDS_MISSING_SUBGRAPH_DATA
.
includes
(
currencyA
.
chainId
)
:
true
...
@@ -213,8 +213,8 @@ export function usePoolActiveLiquidity(
...
@@ -213,8 +213,8 @@ export function usePoolActiveLiquidity(
):
{
):
{
isLoading
:
boolean
isLoading
:
boolean
error
:
any
error
:
any
activeTick
:
number
|
undefined
activeTick
?:
number
data
:
TickProcessed
[]
|
undefined
data
?:
TickProcessed
[]
}
{
}
{
const
pool
=
usePool
(
currencyA
,
currencyB
,
feeAmount
)
const
pool
=
usePool
(
currencyA
,
currencyB
,
feeAmount
)
...
...
src/hooks/useSwapCallback.tsx
View file @
d180aef3
...
@@ -13,7 +13,7 @@ import { useUniversalRouterSwapCallback } from './useUniversalRouter'
...
@@ -13,7 +13,7 @@ import { useUniversalRouterSwapCallback } from './useUniversalRouter'
// and the user has approved the slippage adjusted input amount for the trade
// and the user has approved the slippage adjusted input amount for the trade
export
function
useSwapCallback
(
export
function
useSwapCallback
(
trade
:
Trade
<
Currency
,
Currency
,
TradeType
>
|
undefined
,
// trade to execute, required
trade
:
Trade
<
Currency
,
Currency
,
TradeType
>
|
undefined
,
// trade to execute, required
fiatValues
:
{
amountIn
:
number
|
undefined
;
amountOut
:
number
|
undefined
},
// usd values for amount in and out, logged for analytics
fiatValues
:
{
amountIn
?:
number
;
amountOut
?:
number
},
// usd values for amount in and out, logged for analytics
allowedSlippage
:
Percent
,
// in bips
allowedSlippage
:
Percent
,
// in bips
permitSignature
:
PermitSignature
|
undefined
permitSignature
:
PermitSignature
|
undefined
):
{
callback
:
null
|
(()
=>
Promise
<
string
>
)
}
{
):
{
callback
:
null
|
(()
=>
Promise
<
string
>
)
}
{
...
...
src/hooks/useTokenAllowance.ts
View file @
d180aef3
...
@@ -11,7 +11,7 @@ export function useTokenAllowance(
...
@@ -11,7 +11,7 @@ export function useTokenAllowance(
owner
?:
string
,
owner
?:
string
,
spender
?:
string
spender
?:
string
):
{
):
{
tokenAllowance
:
CurrencyAmount
<
Token
>
|
undefined
tokenAllowance
?:
CurrencyAmount
<
Token
>
isSyncing
:
boolean
isSyncing
:
boolean
}
{
}
{
const
contract
=
useTokenContract
(
token
?.
address
,
false
)
const
contract
=
useTokenContract
(
token
?.
address
,
false
)
...
@@ -21,7 +21,7 @@ export function useTokenAllowance(
...
@@ -21,7 +21,7 @@ export function useTokenAllowance(
// This guarantees that the tokenAllowance is marked isSyncing upon approval and updated upon being synced.
// This guarantees that the tokenAllowance is marked isSyncing upon approval and updated upon being synced.
const
[
blocksPerFetch
,
setBlocksPerFetch
]
=
useState
<
1
>
()
const
[
blocksPerFetch
,
setBlocksPerFetch
]
=
useState
<
1
>
()
const
{
result
,
syncing
:
isSyncing
}
=
useSingleCallResult
(
contract
,
'
allowance
'
,
inputs
,
{
blocksPerFetch
})
as
{
const
{
result
,
syncing
:
isSyncing
}
=
useSingleCallResult
(
contract
,
'
allowance
'
,
inputs
,
{
blocksPerFetch
})
as
{
result
:
Awaited
<
ReturnType
<
NonNullable
<
typeof
contract
>
[
'
allowance
'
]
>>
|
undefined
result
?:
Awaited
<
ReturnType
<
NonNullable
<
typeof
contract
>
[
'
allowance
'
]
>>
syncing
:
boolean
syncing
:
boolean
}
}
...
...
src/hooks/useUSDPrice.ts
View file @
d180aef3
...
@@ -21,7 +21,7 @@ const ETH_AMOUNT_OUT: { [chainId: number]: CurrencyAmount<Currency> } = {
...
@@ -21,7 +21,7 @@ const ETH_AMOUNT_OUT: { [chainId: number]: CurrencyAmount<Currency> } = {
}
}
function
useETHValue
(
currencyAmount
?:
CurrencyAmount
<
Currency
>
):
{
function
useETHValue
(
currencyAmount
?:
CurrencyAmount
<
Currency
>
):
{
data
:
CurrencyAmount
<
Currency
>
|
undefined
data
?:
CurrencyAmount
<
Currency
>
isLoading
:
boolean
isLoading
:
boolean
}
{
}
{
const
chainId
=
currencyAmount
?.
currency
?.
chainId
const
chainId
=
currencyAmount
?.
currency
?.
chainId
...
@@ -51,7 +51,7 @@ function useETHValue(currencyAmount?: CurrencyAmount<Currency>): {
...
@@ -51,7 +51,7 @@ function useETHValue(currencyAmount?: CurrencyAmount<Currency>): {
}
}
export
function
useUSDPrice
(
currencyAmount
?:
CurrencyAmount
<
Currency
>
):
{
export
function
useUSDPrice
(
currencyAmount
?:
CurrencyAmount
<
Currency
>
):
{
data
:
number
|
undefined
data
?:
number
isLoading
:
boolean
isLoading
:
boolean
}
{
}
{
const
chain
=
currencyAmount
?.
currency
.
chainId
?
chainIdToBackendName
(
currencyAmount
?.
currency
.
chainId
)
:
undefined
const
chain
=
currencyAmount
?.
currency
.
chainId
?
chainIdToBackendName
(
currencyAmount
?.
currency
.
chainId
)
:
undefined
...
...
src/hooks/useUniversalRouter.ts
View file @
d180aef3
...
@@ -45,7 +45,7 @@ interface SwapOptions {
...
@@ -45,7 +45,7 @@ interface SwapOptions {
export
function
useUniversalRouterSwapCallback
(
export
function
useUniversalRouterSwapCallback
(
trade
:
Trade
<
Currency
,
Currency
,
TradeType
>
|
undefined
,
trade
:
Trade
<
Currency
,
Currency
,
TradeType
>
|
undefined
,
fiatValues
:
{
amountIn
:
number
|
undefined
;
amountOut
:
number
|
undefined
},
fiatValues
:
{
amountIn
?:
number
;
amountOut
?:
number
},
options
:
SwapOptions
options
:
SwapOptions
)
{
)
{
const
{
account
,
chainId
,
provider
}
=
useWeb3React
()
const
{
account
,
chainId
,
provider
}
=
useWeb3React
()
...
...
src/hooks/useV3Positions.ts
View file @
d180aef3
...
@@ -7,7 +7,7 @@ import { useV3NFTPositionManagerContract } from './useContract'
...
@@ -7,7 +7,7 @@ import { useV3NFTPositionManagerContract } from './useContract'
interface
UseV3PositionsResults
{
interface
UseV3PositionsResults
{
loading
:
boolean
loading
:
boolean
positions
:
PositionDetails
[]
|
undefined
positions
?:
PositionDetails
[]
}
}
function
useV3PositionsFromTokenIds
(
tokenIds
:
BigNumber
[]
|
undefined
):
UseV3PositionsResults
{
function
useV3PositionsFromTokenIds
(
tokenIds
:
BigNumber
[]
|
undefined
):
UseV3PositionsResults
{
...
@@ -51,7 +51,7 @@ function useV3PositionsFromTokenIds(tokenIds: BigNumber[] | undefined): UseV3Pos
...
@@ -51,7 +51,7 @@ function useV3PositionsFromTokenIds(tokenIds: BigNumber[] | undefined): UseV3Pos
interface
UseV3PositionResults
{
interface
UseV3PositionResults
{
loading
:
boolean
loading
:
boolean
position
:
PositionDetails
|
undefined
position
?:
PositionDetails
}
}
export
function
useV3PositionFromTokenId
(
tokenId
:
BigNumber
|
undefined
):
UseV3PositionResults
{
export
function
useV3PositionFromTokenId
(
tokenId
:
BigNumber
|
undefined
):
UseV3PositionResults
{
...
...
src/hooks/useWrapCallback.tsx
View file @
d180aef3
...
@@ -60,7 +60,7 @@ export default function useWrapCallback(
...
@@ -60,7 +60,7 @@ export default function useWrapCallback(
inputCurrency
:
Currency
|
undefined
|
null
,
inputCurrency
:
Currency
|
undefined
|
null
,
outputCurrency
:
Currency
|
undefined
|
null
,
outputCurrency
:
Currency
|
undefined
|
null
,
typedValue
:
string
|
undefined
typedValue
:
string
|
undefined
):
{
wrapType
:
WrapType
;
execute
?:
undefined
|
(()
=>
Promise
<
void
>
)
;
inputError
?:
WrapInputError
}
{
):
{
wrapType
:
WrapType
;
execute
?:
()
=>
Promise
<
void
>
;
inputError
?:
WrapInputError
}
{
const
{
chainId
,
account
}
=
useWeb3React
()
const
{
chainId
,
account
}
=
useWeb3React
()
const
wethContract
=
useWETHContract
()
const
wethContract
=
useWETHContract
()
const
balance
=
useCurrencyBalance
(
account
??
undefined
,
inputCurrency
??
undefined
)
const
balance
=
useCurrencyBalance
(
account
??
undefined
,
inputCurrency
??
undefined
)
...
...
src/lib/hooks/routing/useRoutingAPIArguments.ts
View file @
d180aef3
...
@@ -15,9 +15,9 @@ export function useRoutingAPIArguments({
...
@@ -15,9 +15,9 @@ export function useRoutingAPIArguments({
tradeType
,
tradeType
,
routerPreference
,
routerPreference
,
}:
{
}:
{
tokenIn
:
Currency
|
undefined
tokenIn
?:
Currency
tokenOut
:
Currency
|
undefined
tokenOut
?:
Currency
amount
:
CurrencyAmount
<
Currency
>
|
undefined
amount
?:
CurrencyAmount
<
Currency
>
tradeType
:
TradeType
tradeType
:
TradeType
routerPreference
:
RouterPreference
|
typeof
INTERNAL_ROUTER_PREFERENCE_PRICE
routerPreference
:
RouterPreference
|
typeof
INTERNAL_ROUTER_PREFERENCE_PRICE
})
{
})
{
...
...
src/lib/utils/analytics.ts
View file @
d180aef3
...
@@ -40,7 +40,7 @@ export const formatSwapSignedAnalyticsEventProperties = ({
...
@@ -40,7 +40,7 @@ export const formatSwapSignedAnalyticsEventProperties = ({
txHash
,
txHash
,
}:
{
}:
{
trade
:
InterfaceTrade
|
Trade
<
Currency
,
Currency
,
TradeType
>
trade
:
InterfaceTrade
|
Trade
<
Currency
,
Currency
,
TradeType
>
fiatValues
:
{
amountIn
:
number
|
undefined
;
amountOut
:
number
|
undefined
}
fiatValues
:
{
amountIn
?:
number
;
amountOut
?:
number
}
txHash
:
string
txHash
:
string
})
=>
({
})
=>
({
transaction_hash
:
txHash
,
transaction_hash
:
txHash
,
...
...
src/lib/utils/formatLocaleNumber.ts
View file @
d180aef3
...
@@ -3,7 +3,7 @@ import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from 'constants/locales'
...
@@ -3,7 +3,7 @@ import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from 'constants/locales'
interface
FormatLocaleNumberArgs
{
interface
FormatLocaleNumberArgs
{
number
:
CurrencyAmount
<
Currency
>
|
Price
<
Currency
,
Currency
>
|
number
number
:
CurrencyAmount
<
Currency
>
|
Price
<
Currency
,
Currency
>
|
number
locale
:
string
|
null
|
undefined
locale
?:
string
|
null
options
?:
Intl
.
NumberFormatOptions
options
?:
Intl
.
NumberFormatOptions
sigFigs
?:
number
sigFigs
?:
number
fixedDecimals
?:
number
fixedDecimals
?:
number
...
...
src/lib/utils/parseENSAddress.ts
View file @
d180aef3
const
ENS_NAME_REGEX
=
/^
(([
a-zA-Z0-9
]
+
(
-
[
a-zA-Z0-9
]
+
)
*
\.)
+
)
eth
(\/
.*
)?
$/
const
ENS_NAME_REGEX
=
/^
(([
a-zA-Z0-9
]
+
(
-
[
a-zA-Z0-9
]
+
)
*
\.)
+
)
eth
(\/
.*
)?
$/
export
default
function
parseENSAddress
(
export
default
function
parseENSAddress
(
ensAddress
:
string
):
{
ensName
:
string
;
ensPath
?:
string
}
|
undefined
{
ensAddress
:
string
):
{
ensName
:
string
;
ensPath
:
string
|
undefined
}
|
undefined
{
const
match
=
ensAddress
.
match
(
ENS_NAME_REGEX
)
const
match
=
ensAddress
.
match
(
ENS_NAME_REGEX
)
if
(
!
match
)
return
undefined
if
(
!
match
)
return
undefined
return
{
ensName
:
`
${
match
[
1
].
toLowerCase
()}
eth`
,
ensPath
:
match
[
4
]
}
return
{
ensName
:
`
${
match
[
1
].
toLowerCase
()}
eth`
,
ensPath
:
match
[
4
]
}
...
...
src/nft/components/bag/BagFooter.tsx
View file @
d180aef3
...
@@ -206,9 +206,9 @@ const InputCurrencyValue = ({
...
@@ -206,9 +206,9 @@ const InputCurrencyValue = ({
}:
{
}:
{
usingPayWithAnyToken
:
boolean
usingPayWithAnyToken
:
boolean
totalEthPrice
:
BigNumber
totalEthPrice
:
BigNumber
activeCurrency
:
Currency
|
undefined
|
null
activeCurrency
?:
Currency
|
null
tradeState
:
TradeState
tradeState
:
TradeState
trade
:
InterfaceTrade
|
undefined
trade
?:
InterfaceTrade
})
=>
{
})
=>
{
if
(
!
usingPayWithAnyToken
)
{
if
(
!
usingPayWithAnyToken
)
{
return
(
return
(
...
@@ -241,7 +241,7 @@ const FiatValue = ({
...
@@ -241,7 +241,7 @@ const FiatValue = ({
usingPayWithAnyToken
,
usingPayWithAnyToken
,
}:
{
}:
{
usdcValue
:
CurrencyAmount
<
Token
>
|
null
usdcValue
:
CurrencyAmount
<
Token
>
|
null
priceImpact
:
PriceImpact
|
undefined
priceImpact
?:
PriceImpact
tradeState
:
TradeState
tradeState
:
TradeState
usingPayWithAnyToken
:
boolean
usingPayWithAnyToken
:
boolean
})
=>
{
})
=>
{
...
...
src/nft/components/bag/BagRow.tsx
View file @
d180aef3
...
@@ -82,7 +82,7 @@ const NoContentContainer = () => (
...
@@ -82,7 +82,7 @@ const NoContentContainer = () => (
interface
BagRowProps
{
interface
BagRowProps
{
asset
:
UpdatedGenieAsset
asset
:
UpdatedGenieAsset
usdPrice
:
number
|
undefined
usdPrice
?:
number
removeAsset
:
(
assets
:
GenieAsset
[])
=>
void
removeAsset
:
(
assets
:
GenieAsset
[])
=>
void
showRemove
?:
boolean
showRemove
?:
boolean
grayscale
?:
boolean
grayscale
?:
boolean
...
@@ -168,7 +168,7 @@ export const BagRow = ({ asset, usdPrice, removeAsset, showRemove, grayscale, is
...
@@ -168,7 +168,7 @@ export const BagRow = ({ asset, usdPrice, removeAsset, showRemove, grayscale, is
interface
PriceChangeBagRowProps
{
interface
PriceChangeBagRowProps
{
asset
:
UpdatedGenieAsset
asset
:
UpdatedGenieAsset
usdPrice
:
number
|
undefined
usdPrice
?:
number
markAssetAsReviewed
:
(
asset
:
UpdatedGenieAsset
,
toKeep
:
boolean
)
=>
void
markAssetAsReviewed
:
(
asset
:
UpdatedGenieAsset
,
toKeep
:
boolean
)
=>
void
top
?:
boolean
top
?:
boolean
isMobile
:
boolean
isMobile
:
boolean
...
@@ -219,7 +219,7 @@ export const PriceChangeBagRow = ({ asset, usdPrice, markAssetAsReviewed, top, i
...
@@ -219,7 +219,7 @@ export const PriceChangeBagRow = ({ asset, usdPrice, markAssetAsReviewed, top, i
interface
UnavailableAssetsHeaderRowProps
{
interface
UnavailableAssetsHeaderRowProps
{
assets
?:
UpdatedGenieAsset
[]
assets
?:
UpdatedGenieAsset
[]
usdPrice
:
number
|
undefined
usdPrice
?:
number
clearUnavailableAssets
:
()
=>
void
clearUnavailableAssets
:
()
=>
void
didOpenUnavailableAssets
:
boolean
didOpenUnavailableAssets
:
boolean
setDidOpenUnavailableAssets
:
(
didOpen
:
boolean
)
=>
void
setDidOpenUnavailableAssets
:
(
didOpen
:
boolean
)
=>
void
...
...
src/nft/components/collection/Sweep.tsx
View file @
d180aef3
...
@@ -111,7 +111,7 @@ const NftDisplayContainer = styled.div`
...
@@ -111,7 +111,7 @@ const NftDisplayContainer = styled.div`
height: 34px;
height: 34px;
`
`
const
NftHolder
=
styled
.
div
<
{
index
:
number
;
src
:
string
|
undefined
}
>
`
const
NftHolder
=
styled
.
div
<
{
index
:
number
;
src
?:
string
}
>
`
position: absolute;
position: absolute;
top: 50%;
top: 50%;
left: 50%;
left: 50%;
...
...
src/nft/components/details/AssetActivity.tsx
View file @
d180aef3
...
@@ -147,7 +147,7 @@ export const LoadingAssetActivity = ({ rowCount }: { rowCount: number }) => {
...
@@ -147,7 +147,7 @@ export const LoadingAssetActivity = ({ rowCount }: { rowCount: number }) => {
)
)
}
}
const
AssetActivity
=
({
events
}:
{
events
:
ActivityEvent
[]
|
undefined
})
=>
{
const
AssetActivity
=
({
events
}:
{
events
?:
ActivityEvent
[]
})
=>
{
return
(
return
(
<
ActivityTable
>
<
ActivityTable
>
{
events
&&
{
events
&&
...
...
src/nft/components/details/detailsV2/MediaRenderer.tsx
View file @
d180aef3
...
@@ -128,7 +128,7 @@ function assetMediaType(asset: GenieAsset): MediaType {
...
@@ -128,7 +128,7 @@ function assetMediaType(asset: GenieAsset): MediaType {
return
MediaType
.
Image
return
MediaType
.
Image
}
}
const
RenderMediaShadow
=
({
imageUrl
}:
{
imageUrl
:
string
|
undefined
})
=>
{
const
RenderMediaShadow
=
({
imageUrl
}:
{
imageUrl
?:
string
})
=>
{
const
[
contentNotAvailable
,
setContentNotAvailable
]
=
useState
(
false
)
const
[
contentNotAvailable
,
setContentNotAvailable
]
=
useState
(
false
)
if
(
!
imageUrl
||
contentNotAvailable
)
{
if
(
!
imageUrl
||
contentNotAvailable
)
{
...
...
src/nft/components/profile/list/PriceTextInput.tsx
View file @
d180aef3
...
@@ -32,7 +32,7 @@ const InputWrapper = styled(Row)<{ borderColor: string }>`
...
@@ -32,7 +32,7 @@ const InputWrapper = styled(Row)<{ borderColor: string }>`
box-sizing: border-box;
box-sizing: border-box;
`
`
const
CurrencyWrapper
=
styled
.
div
<
{
listPrice
:
number
|
undefined
}
>
`
const
CurrencyWrapper
=
styled
.
div
<
{
listPrice
?:
number
}
>
`
color:
${({
listPrice
,
theme
})
=>
(
listPrice
?
theme
.
textPrimary
:
theme
.
textSecondary
)}
;
color:
${({
listPrice
,
theme
})
=>
(
listPrice
?
theme
.
textPrimary
:
theme
.
textSecondary
)}
;
`
`
...
...
src/nft/components/profile/view/ProfilePage.tsx
View file @
d180aef3
...
@@ -313,7 +313,7 @@ const CollectionFilterItem = ({
...
@@ -313,7 +313,7 @@ const CollectionFilterItem = ({
collection
,
collection
,
setCollectionFilters
,
setCollectionFilters
,
}:
{
}:
{
collection
:
WalletCollection
|
undefined
collection
?:
WalletCollection
setCollectionFilters
:
(
address
:
string
)
=>
void
setCollectionFilters
:
(
address
:
string
)
=>
void
})
=>
{
})
=>
{
if
(
!
collection
)
return
null
if
(
!
collection
)
return
null
...
...
src/nft/hooks/useDerivedPayWithAnyTokenSwapInfo.ts
View file @
d180aef3
...
@@ -9,8 +9,8 @@ export default function useDerivedPayWithAnyTokenSwapInfo(
...
@@ -9,8 +9,8 @@ export default function useDerivedPayWithAnyTokenSwapInfo(
parsedOutputAmount
?:
CurrencyAmount
<
NativeCurrency
|
Token
>
parsedOutputAmount
?:
CurrencyAmount
<
NativeCurrency
|
Token
>
):
{
):
{
state
:
TradeState
state
:
TradeState
trade
:
InterfaceTrade
|
undefined
trade
?:
InterfaceTrade
maximumAmountIn
:
CurrencyAmount
<
Token
>
|
undefined
maximumAmountIn
?:
CurrencyAmount
<
Token
>
allowedSlippage
:
Percent
allowedSlippage
:
Percent
}
{
}
{
const
{
state
,
trade
}
=
useBestTrade
(
TradeType
.
EXACT_OUTPUT
,
parsedOutputAmount
,
inputCurrency
??
undefined
)
const
{
state
,
trade
}
=
useBestTrade
(
TradeType
.
EXACT_OUTPUT
,
parsedOutputAmount
,
inputCurrency
??
undefined
)
...
...
src/nft/hooks/useTokenInput.ts
View file @
d180aef3
...
@@ -4,10 +4,10 @@ import { create } from 'zustand'
...
@@ -4,10 +4,10 @@ import { create } from 'zustand'
import
{
devtools
}
from
'
zustand/middleware
'
import
{
devtools
}
from
'
zustand/middleware
'
interface
TokenInputState
{
interface
TokenInputState
{
inputCurrency
:
Currency
|
undefined
inputCurrency
?:
Currency
setInputCurrency
:
(
currency
:
Currency
|
undefined
)
=>
void
setInputCurrency
:
(
currency
:
Currency
|
undefined
)
=>
void
clearInputCurrency
:
()
=>
void
clearInputCurrency
:
()
=>
void
tokenTradeInput
:
TokenTradeInput
|
undefined
tokenTradeInput
?:
TokenTradeInput
setTokenTradeInput
:
(
tokenTradeInput
:
TokenTradeInput
|
undefined
)
=>
void
setTokenTradeInput
:
(
tokenTradeInput
:
TokenTradeInput
|
undefined
)
=>
void
}
}
...
...
src/nft/hooks/useWalletBalance.ts
View file @
d180aef3
...
@@ -8,7 +8,7 @@ interface WalletBalanceProps {
...
@@ -8,7 +8,7 @@ interface WalletBalanceProps {
address
:
string
address
:
string
balance
:
string
balance
:
string
weiBalance
:
BigNumber
weiBalance
:
BigNumber
provider
:
Web3Provider
|
undefined
provider
?:
Web3Provider
}
}
export
function
useWalletBalance
():
WalletBalanceProps
{
export
function
useWalletBalance
():
WalletBalanceProps
{
...
...
src/nft/types/sell/sell.ts
View file @
d180aef3
...
@@ -88,7 +88,7 @@ export enum ListingStatus {
...
@@ -88,7 +88,7 @@ export enum ListingStatus {
}
}
export
interface
AssetRow
{
export
interface
AssetRow
{
image
:
string
|
undefined
image
?:
string
name
?:
string
name
?:
string
status
:
ListingStatus
status
:
ListingStatus
marketplace
:
ListingMarket
marketplace
:
ListingMarket
...
...
src/nft/utils/tokenRoutes.ts
View file @
d180aef3
...
@@ -109,9 +109,9 @@ function buildTradeRouteInput(swap: Swap): TokenTradeRouteInput {
...
@@ -109,9 +109,9 @@ function buildTradeRouteInput(swap: Swap): TokenTradeRouteInput {
}
}
export
function
buildAllTradeRouteInputs
(
trade
:
InterfaceTrade
):
{
export
function
buildAllTradeRouteInputs
(
trade
:
InterfaceTrade
):
{
mixedTokenTradeRouteInputs
:
TokenTradeRouteInput
[]
|
undefined
mixedTokenTradeRouteInputs
?:
TokenTradeRouteInput
[]
v2TokenTradeRouteInputs
:
TokenTradeRouteInput
[]
|
undefined
v2TokenTradeRouteInputs
?:
TokenTradeRouteInput
[]
v3TokenTradeRouteInputs
:
TokenTradeRouteInput
[]
|
undefined
v3TokenTradeRouteInputs
?:
TokenTradeRouteInput
[]
}
{
}
{
const
mixedTokenTradeRouteInputs
:
TokenTradeRouteInput
[]
=
[]
const
mixedTokenTradeRouteInputs
:
TokenTradeRouteInput
[]
=
[]
const
v2TokenTradeRouteInputs
:
TokenTradeRouteInput
[]
=
[]
const
v2TokenTradeRouteInputs
:
TokenTradeRouteInput
[]
=
[]
...
...
src/pages/CreateProposal/ProposalActionDetail.tsx
View file @
d180aef3
...
@@ -31,7 +31,7 @@ export const ProposalActionDetail = ({
...
@@ -31,7 +31,7 @@ export const ProposalActionDetail = ({
}:
{
}:
{
className
?:
string
className
?:
string
proposalAction
:
ProposalAction
proposalAction
:
ProposalAction
currency
:
Currency
|
undefined
currency
?:
Currency
amount
:
string
amount
:
string
toAddress
:
string
toAddress
:
string
onCurrencySelect
:
(
currency
:
Currency
)
=>
void
onCurrencySelect
:
(
currency
:
Currency
)
=>
void
...
...
src/pages/CreateProposal/ProposalSubmissionModal.tsx
View file @
d180aef3
...
@@ -15,7 +15,7 @@ export const ProposalSubmissionModal = ({
...
@@ -15,7 +15,7 @@ export const ProposalSubmissionModal = ({
onDismiss
,
onDismiss
,
}:
{
}:
{
isOpen
:
boolean
isOpen
:
boolean
hash
:
string
|
undefined
hash
?:
string
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
})
=>
{
})
=>
{
const
theme
=
useTheme
()
const
theme
=
useTheme
()
...
...
src/pages/Swap/index.tsx
View file @
d180aef3
...
@@ -172,7 +172,7 @@ export function Swap({
...
@@ -172,7 +172,7 @@ export function Swap({
}:
{
}:
{
className
?:
string
className
?:
string
prefilledState
?:
Partial
<
SwapState
>
prefilledState
?:
Partial
<
SwapState
>
chainId
:
SupportedChainId
|
undefine
d
chainId
?:
SupportedChainI
d
onCurrencyChange
?:
(
selected
:
Pick
<
SwapState
,
Field
.
INPUT
|
Field
.
OUTPUT
>
)
=>
void
onCurrencyChange
?:
(
selected
:
Pick
<
SwapState
,
Field
.
INPUT
|
Field
.
OUTPUT
>
)
=>
void
disableTokenInputs
?:
boolean
disableTokenInputs
?:
boolean
})
{
})
{
...
@@ -334,10 +334,10 @@ export function Swap({
...
@@ -334,10 +334,10 @@ export function Swap({
// modal and loading
// modal and loading
const
[{
showConfirm
,
tradeToConfirm
,
swapErrorMessage
,
attemptingTxn
,
txHash
},
setSwapState
]
=
useState
<
{
const
[{
showConfirm
,
tradeToConfirm
,
swapErrorMessage
,
attemptingTxn
,
txHash
},
setSwapState
]
=
useState
<
{
showConfirm
:
boolean
showConfirm
:
boolean
tradeToConfirm
:
InterfaceTrade
|
undefined
tradeToConfirm
?:
InterfaceTrade
attemptingTxn
:
boolean
attemptingTxn
:
boolean
swapErrorMessage
:
string
|
undefined
swapErrorMessage
?:
string
txHash
:
string
|
undefined
txHash
?:
string
}
>
({
}
>
({
showConfirm
:
false
,
showConfirm
:
false
,
tradeToConfirm
:
undefined
,
tradeToConfirm
:
undefined
,
...
...
src/state/connection/reducer.ts
View file @
d180aef3
...
@@ -22,7 +22,7 @@ const connectionSlice = createSlice({
...
@@ -22,7 +22,7 @@ const connectionSlice = createSlice({
reducers
:
{
reducers
:
{
updateConnectionError
(
updateConnectionError
(
state
,
state
,
{
payload
:
{
connectionType
,
error
}
}:
{
payload
:
{
connectionType
:
ConnectionType
;
error
:
string
|
undefined
}
}
{
payload
:
{
connectionType
,
error
}
}:
{
payload
:
{
connectionType
:
ConnectionType
;
error
?:
string
}
}
)
{
)
{
state
.
errorByConnectionType
[
connectionType
]
=
error
state
.
errorByConnectionType
[
connectionType
]
=
error
},
},
...
...
src/state/governance/hooks.ts
View file @
d180aef3
...
@@ -362,7 +362,7 @@ export function useUserDelegatee(): string {
...
@@ -362,7 +362,7 @@ export function useUserDelegatee(): string {
}
}
// gets the users current votes
// gets the users current votes
export
function
useUserVotes
():
{
loading
:
boolean
;
votes
:
CurrencyAmount
<
Token
>
|
undefined
}
{
export
function
useUserVotes
():
{
loading
:
boolean
;
votes
?:
CurrencyAmount
<
Token
>
}
{
const
{
account
,
chainId
}
=
useWeb3React
()
const
{
account
,
chainId
}
=
useWeb3React
()
const
uniContract
=
useUniContract
()
const
uniContract
=
useUniContract
()
...
...
src/state/logs/hooks.ts
View file @
d180aef3
...
@@ -21,7 +21,7 @@ enum LogsState {
...
@@ -21,7 +21,7 @@ enum LogsState {
}
}
interface
UseLogsResult
{
interface
UseLogsResult
{
logs
:
Log
[]
|
undefined
logs
?:
Log
[]
state
:
LogsState
state
:
LogsState
}
}
...
...
src/state/mint/v3/hooks.tsx
View file @
d180aef3
...
@@ -126,7 +126,7 @@ export function useV3DerivedMintInfo(
...
@@ -126,7 +126,7 @@ export function useV3DerivedMintInfo(
currencyBalances
:
{
[
field
in
Field
]?:
CurrencyAmount
<
Currency
>
}
currencyBalances
:
{
[
field
in
Field
]?:
CurrencyAmount
<
Currency
>
}
dependentField
:
Field
dependentField
:
Field
parsedAmounts
:
{
[
field
in
Field
]?:
CurrencyAmount
<
Currency
>
}
parsedAmounts
:
{
[
field
in
Field
]?:
CurrencyAmount
<
Currency
>
}
position
:
Position
|
undefined
position
?:
Position
noLiquidity
?:
boolean
noLiquidity
?:
boolean
errorMessage
?:
ReactNode
errorMessage
?:
ReactNode
invalidPool
:
boolean
invalidPool
:
boolean
...
...
src/state/stake/hooks.tsx
View file @
d180aef3
...
@@ -58,7 +58,7 @@ interface StakingInfo {
...
@@ -58,7 +58,7 @@ interface StakingInfo {
// equivalent to percent of total supply * reward rate
// equivalent to percent of total supply * reward rate
rewardRate
:
CurrencyAmount
<
Token
>
rewardRate
:
CurrencyAmount
<
Token
>
// when the period ends
// when the period ends
periodFinish
:
Date
|
undefined
periodFinish
?:
Date
// if pool is active
// if pool is active
active
:
boolean
active
:
boolean
// calculates a hypothetical amount of token distributed to the active account per second.
// calculates a hypothetical amount of token distributed to the active account per second.
...
...
src/state/swap/hooks.tsx
View file @
d180aef3
...
@@ -78,7 +78,7 @@ export function useDerivedSwapInfo(
...
@@ -78,7 +78,7 @@ export function useDerivedSwapInfo(
):
{
):
{
currencies
:
{
[
field
in
Field
]?:
Currency
|
null
}
currencies
:
{
[
field
in
Field
]?:
Currency
|
null
}
currencyBalances
:
{
[
field
in
Field
]?:
CurrencyAmount
<
Currency
>
}
currencyBalances
:
{
[
field
in
Field
]?:
CurrencyAmount
<
Currency
>
}
parsedAmount
:
CurrencyAmount
<
Currency
>
|
undefined
parsedAmount
?:
CurrencyAmount
<
Currency
>
inputError
?:
ReactNode
inputError
?:
ReactNode
trade
:
{
trade
:
{
trade
?:
InterfaceTrade
trade
?:
InterfaceTrade
...
...
src/state/swap/reducer.ts
View file @
d180aef3
...
@@ -8,10 +8,10 @@ export interface SwapState {
...
@@ -8,10 +8,10 @@ export interface SwapState {
readonly
independentField
:
Field
readonly
independentField
:
Field
readonly
typedValue
:
string
readonly
typedValue
:
string
readonly
[
Field
.
INPUT
]:
{
readonly
[
Field
.
INPUT
]:
{
readonly
currencyId
:
string
|
undefined
|
null
readonly
currencyId
?:
string
|
null
}
}
readonly
[
Field
.
OUTPUT
]:
{
readonly
[
Field
.
OUTPUT
]:
{
readonly
currencyId
:
string
|
undefined
|
null
readonly
currencyId
?:
string
|
null
}
}
// the typed recipient address or ENS name, or null if swap should go to sender
// the typed recipient address or ENS name, or null if swap should go to sender
readonly
recipient
:
string
|
null
readonly
recipient
:
string
|
null
...
...
src/state/user/reducer.ts
View file @
d180aef3
...
@@ -10,7 +10,7 @@ import { SerializedPair, SerializedToken, SlippageTolerance } from './types'
...
@@ -10,7 +10,7 @@ import { SerializedPair, SerializedToken, SlippageTolerance } from './types'
const
currentTimestamp
=
()
=>
new
Date
().
getTime
()
const
currentTimestamp
=
()
=>
new
Date
().
getTime
()
export
interface
UserState
{
export
interface
UserState
{
buyFiatFlowCompleted
:
boolean
|
undefined
buyFiatFlowCompleted
?:
boolean
selectedWallet
?:
ConnectionType
selectedWallet
?:
ConnectionType
...
@@ -53,7 +53,7 @@ export interface UserState {
...
@@ -53,7 +53,7 @@ export interface UserState {
URLWarningVisible
:
boolean
URLWarningVisible
:
boolean
hideUniswapWalletBanner
:
boolean
hideUniswapWalletBanner
:
boolean
// undefined means has not gone through A/B split yet
// undefined means has not gone through A/B split yet
showSurveyPopup
:
boolean
|
undefined
showSurveyPopup
?:
boolean
}
}
function
pairKey
(
token0Address
:
string
,
token1Address
:
string
)
{
function
pairKey
(
token0Address
:
string
,
token1Address
:
string
)
{
...
...
src/utils/formatNumbers.ts
View file @
d180aef3
...
@@ -24,7 +24,7 @@ export const priceToPreciseFloat = (price: Price<Currency, Currency> | undefined
...
@@ -24,7 +24,7 @@ export const priceToPreciseFloat = (price: Price<Currency, Currency> | undefined
}
}
interface
FormatDollarArgs
{
interface
FormatDollarArgs
{
num
:
number
|
undefined
|
null
num
?:
number
|
null
isPrice
?:
boolean
isPrice
?:
boolean
lessPreciseStablecoinValues
?:
boolean
lessPreciseStablecoinValues
?:
boolean
digits
?:
number
digits
?:
number
...
...
src/utils/formatTickPrice.ts
View file @
d180aef3
...
@@ -4,7 +4,7 @@ import { Price, Token } from '@uniswap/sdk-core'
...
@@ -4,7 +4,7 @@ import { Price, Token } from '@uniswap/sdk-core'
import
{
Bound
}
from
'
../state/mint/v3/actions
'
import
{
Bound
}
from
'
../state/mint/v3/actions
'
interface
FormatTickPriceArgs
{
interface
FormatTickPriceArgs
{
price
:
Price
<
Token
,
Token
>
|
undefined
price
?:
Price
<
Token
,
Token
>
atLimit
:
{
[
bound
in
Bound
]?:
boolean
|
undefined
}
atLimit
:
{
[
bound
in
Bound
]?:
boolean
|
undefined
}
direction
:
Bound
direction
:
Bound
placeholder
?:
string
placeholder
?:
string
...
...
src/utils/loggingFormatters.ts
View file @
d180aef3
...
@@ -57,12 +57,12 @@ export const formatSwapPriceUpdatedEventProperties = (
...
@@ -57,12 +57,12 @@ export const formatSwapPriceUpdatedEventProperties = (
interface
AnalyticsEventProps
{
interface
AnalyticsEventProps
{
trade
:
InterfaceTrade
trade
:
InterfaceTrade
hash
:
string
|
undefined
hash
?:
string
allowedSlippage
:
Percent
allowedSlippage
:
Percent
transactionDeadlineSecondsSinceEpoch
:
number
|
undefined
transactionDeadlineSecondsSinceEpoch
?:
number
isAutoSlippage
:
boolean
isAutoSlippage
:
boolean
isAutoRouterApi
:
boolean
isAutoRouterApi
:
boolean
swapQuoteReceivedDate
:
Date
|
undefined
swapQuoteReceivedDate
?:
Date
routes
:
RoutingDiagramEntry
[]
routes
:
RoutingDiagramEntry
[]
fiatValueInput
?:
number
fiatValueInput
?:
number
fiatValueOutput
?:
number
fiatValueOutput
?:
number
...
...
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