File tree Expand file tree Collapse file tree 6 files changed +25
-17
lines changed Expand file tree Collapse file tree 6 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export interface Initialization {
7
7
darkMode ?: boolean
8
8
apiUrl ?: string
9
9
hideBranding ?: boolean
10
- pollingInterval ?: number
10
+ blockPollingInterval ?: number
11
11
}
12
12
13
13
export interface Subscriptions {
@@ -182,7 +182,6 @@ export interface WalletConnectOptions extends CommonWalletOptions {
182
182
[ key : string ] : string
183
183
}
184
184
bridge : string
185
- pollingInterval : number
186
185
}
187
186
188
187
export interface TrezorOptions extends CommonWalletOptions {
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import HookedWalletSubprovider from 'web3-provider-engine/subproviders/hooked-wa
4
4
import SubscriptionSubprovider from 'web3-provider-engine/subproviders/subscriptions'
5
5
import FilterSubprovider from 'web3-provider-engine/subproviders/filters'
6
6
7
+ import { get } from 'svelte/store'
8
+
9
+ import { app } from '../../../stores'
10
+
7
11
function createProvider ( config : any ) {
8
12
const {
9
13
getAccounts,
@@ -13,10 +17,9 @@ function createProvider(config: any) {
13
17
processPersonalMessage,
14
18
signMessage,
15
19
signPersonalMessage,
16
- pollingInterval
17
20
} = config
18
21
19
- console . log ( "from inside provider engine : " , { pollingInterval } )
22
+ const pollingInterval = get ( app ) . blockPollingInterval
20
23
21
24
const idMgmt =
22
25
getAccounts &&
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ import {
6
6
7
7
import walletConnectIcon from '../wallet-icons/icon-wallet-connect'
8
8
9
+ import { get } from 'svelte/store'
10
+
11
+ import {
12
+ app ,
13
+ } from '../../../stores'
14
+
9
15
function walletConnect (
10
16
options : WalletConnectOptions & { networkId : number }
11
17
) : WalletModule {
@@ -17,11 +23,10 @@ function walletConnect(
17
23
label,
18
24
iconSrc,
19
25
svg,
20
- networkId,
21
- pollingInterval
26
+ networkId
22
27
} = options
23
28
24
- console . log ( { pollingInterval} )
29
+ const pollingInterval = get ( app ) . blockPollingInterval
25
30
26
31
if ( ! infuraKey ) {
27
32
if ( ! rpc || ! rpc [ networkId ] ) {
@@ -49,8 +54,7 @@ function walletConnect(
49
54
: `https://${ networkName ( networkId ) } .infura.io/v3/${ infuraKey } `
50
55
51
56
const balanceProvider = createProvider ( {
52
- rpcUrl,
53
- pollingInterval
57
+ rpcUrl
54
58
} )
55
59
56
60
const provider = new WalletConnectProvider ( {
Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ function init(initialization: Initialization): API {
49
49
networkId,
50
50
darkMode,
51
51
apiUrl,
52
- hideBranding
52
+ hideBranding,
53
+ blockPollingInterval = 40000
53
54
} = initialization
54
55
55
56
const { os, browser, isMobile } = getDeviceInfo ( )
@@ -86,7 +87,8 @@ function init(initialization: Initialization): API {
86
87
browser,
87
88
darkMode,
88
89
displayBranding,
89
- checkModules : initializedModules . walletCheck
90
+ checkModules : initializedModules . walletCheck ,
91
+ blockPollingInterval
90
92
} ) )
91
93
92
94
initializeStores ( )
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ export const app: WritableStore = writable({
30
30
checkModules : [ ] ,
31
31
walletSelectDisplayedUI : false ,
32
32
walletCheckDisplayedUI : false ,
33
- displayBranding : false
33
+ displayBranding : false ,
34
+ blockPollingInterval : 4000 ,
34
35
} )
35
36
36
37
export const stateSyncStatus : {
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export function validateInit(init: Initialization): never | void {
64
64
darkMode,
65
65
apiUrl,
66
66
hideBranding,
67
- pollingInterval ,
67
+ blockPollingInterval ,
68
68
...otherParams
69
69
} = init
70
70
@@ -79,7 +79,7 @@ export function validateInit(init: Initialization): never | void {
79
79
'darkMode' ,
80
80
'apiUrl' ,
81
81
'hideBranding' ,
82
- 'pollingInterval '
82
+ 'blockPollingInterval '
83
83
] ,
84
84
'init'
85
85
)
@@ -110,8 +110,8 @@ export function validateInit(init: Initialization): never | void {
110
110
optional : true
111
111
} )
112
112
validateType ( {
113
- name : 'pollingInterval ' ,
114
- value : pollingInterval ,
113
+ name : 'blockPollingInterval ' ,
114
+ value : blockPollingInterval ,
115
115
type : 'number' ,
116
116
optional : true
117
117
} )
@@ -649,7 +649,6 @@ export function validateWalletInit(
649
649
'webUri' ,
650
650
'xsUri' ,
651
651
'blockedPopupRedirect' ,
652
- 'pollingInterval'
653
652
] ,
654
653
'walletInitObject'
655
654
)
You can’t perform that action at this time.
0 commit comments