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
7e709e10
Unverified
Commit
7e709e10
authored
Jun 14, 2022
by
Jordan Frankfurt
Committed by
GitHub
Jun 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(L2): removes network-specific polling (#3912)
parent
7389b178
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
15 deletions
+1
-15
getLibrary.ts
src/utils/getLibrary.ts
+1
-15
No files found.
src/utils/getLibrary.ts
View file @
7e709e10
import
{
Web3Provider
}
from
'
@ethersproject/providers
'
import
{
Web3Provider
}
from
'
@ethersproject/providers
'
import
ms
from
'
ms.macro
'
import
ms
from
'
ms.macro
'
import
{
SupportedChainId
}
from
'
../constants/chains
'
const
NETWORK_POLLING_INTERVALS
:
{
[
chainId
:
number
]:
number
}
=
{
[
SupportedChainId
.
OPTIMISM
]:
ms
`1s`
,
[
SupportedChainId
.
OPTIMISTIC_KOVAN
]:
ms
`1s`
,
}
export
default
function
getLibrary
(
provider
:
any
):
Web3Provider
{
export
default
function
getLibrary
(
provider
:
any
):
Web3Provider
{
const
library
=
new
Web3Provider
(
const
library
=
new
Web3Provider
(
provider
,
provider
,
...
@@ -17,13 +10,6 @@ export default function getLibrary(provider: any): Web3Provider {
...
@@ -17,13 +10,6 @@ export default function getLibrary(provider: any): Web3Provider {
?
parseInt
(
provider
.
chainId
)
?
parseInt
(
provider
.
chainId
)
:
'
any
'
:
'
any
'
)
)
library
.
pollingInterval
=
15
_000
library
.
pollingInterval
=
ms
`15s`
library
.
detectNetwork
().
then
((
network
)
=>
{
const
networkPollingInterval
=
NETWORK_POLLING_INTERVALS
[
network
.
chainId
]
if
(
networkPollingInterval
)
{
console
.
debug
(
'
Setting polling interval
'
,
networkPollingInterval
)
library
.
pollingInterval
=
networkPollingInterval
}
})
return
library
return
library
}
}
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