@@ -67,6 +67,11 @@ export class RootStore {
67
67
) ;
68
68
69
69
this . keyRingStore = new KeyRingStore (
70
+ {
71
+ dispatchEvent : ( type : string ) => {
72
+ window . dispatchEvent ( new Event ( type ) ) ;
73
+ } ,
74
+ } ,
70
75
this . chainStore ,
71
76
new InExtensionMessageRequester ( ) ,
72
77
this . interactionStore
@@ -93,52 +98,57 @@ export class RootStore {
93
98
mixInSecretQueries ( mixInCosmosQueries ( QueriesSetBase ) )
94
99
) ;
95
100
96
- this . accountStore = new AccountStore ( this . chainStore , this . queriesStore , {
97
- defaultOpts : {
98
- // When the unlock request sent from external webpage,
99
- // it will open the extension popup below the uri "/unlock".
100
- // But, in this case, if the prefetching option is true, it will redirect
101
- // the page to the "/unlock" with **interactionInternal=true**
102
- // because prefetching will request the unlock from the internal.
103
- // To prevent this problem, just check the first uri is "#/unlcok" and
104
- // if it is "#/unlock", don't use the prefetching option.
105
- prefetching : ! window . location . href . includes ( "#/unlock" ) ,
106
- } ,
107
- chainOpts : this . chainStore . chainInfos . map ( ( chainInfo ) => {
108
- // In certik, change the msg type of the MsgSend to "bank/MsgSend"
109
- if ( chainInfo . chainId . startsWith ( "shentu-" ) ) {
110
- return {
111
- chainId : chainInfo . chainId ,
112
- msgOpts : {
113
- send : {
114
- native : {
115
- type : "bank/MsgSend" ,
101
+ this . accountStore = new AccountStore (
102
+ window ,
103
+ this . chainStore ,
104
+ this . queriesStore ,
105
+ {
106
+ defaultOpts : {
107
+ // When the unlock request sent from external webpage,
108
+ // it will open the extension popup below the uri "/unlock".
109
+ // But, in this case, if the prefetching option is true, it will redirect
110
+ // the page to the "/unlock" with **interactionInternal=true**
111
+ // because prefetching will request the unlock from the internal.
112
+ // To prevent this problem, just check the first uri is "#/unlcok" and
113
+ // if it is "#/unlock", don't use the prefetching option.
114
+ prefetching : ! window . location . href . includes ( "#/unlock" ) ,
115
+ } ,
116
+ chainOpts : this . chainStore . chainInfos . map ( ( chainInfo ) => {
117
+ // In certik, change the msg type of the MsgSend to "bank/MsgSend"
118
+ if ( chainInfo . chainId . startsWith ( "shentu-" ) ) {
119
+ return {
120
+ chainId : chainInfo . chainId ,
121
+ msgOpts : {
122
+ send : {
123
+ native : {
124
+ type : "bank/MsgSend" ,
125
+ } ,
116
126
} ,
117
127
} ,
118
- } ,
119
- } ;
120
- }
121
-
122
- // In akash or sifchain, increase the default gas for sending
123
- if (
124
- chainInfo . chainId . startsWith ( "akashnet-" ) ||
125
- chainInfo . chainId . startsWith ( "sifchain" )
126
- ) {
127
- return {
128
- chainId : chainInfo . chainId ,
129
- msgOpts : {
130
- send : {
131
- native : {
132
- gas : 120000 ,
128
+ } ;
129
+ }
130
+
131
+ // In akash or sifchain, increase the default gas for sending
132
+ if (
133
+ chainInfo . chainId . startsWith ( "akashnet-" ) ||
134
+ chainInfo . chainId . startsWith ( "sifchain" )
135
+ ) {
136
+ return {
137
+ chainId : chainInfo . chainId ,
138
+ msgOpts : {
139
+ send : {
140
+ native : {
141
+ gas : 120000 ,
142
+ } ,
133
143
} ,
134
144
} ,
135
- } ,
136
- } ;
137
- }
145
+ } ;
146
+ }
138
147
139
- return { chainId : chainInfo . chainId } ;
140
- } ) ,
141
- } ) ;
148
+ return { chainId : chainInfo . chainId } ;
149
+ } ) ,
150
+ }
151
+ ) ;
142
152
143
153
this . priceStore = new CoinGeckoPriceStore (
144
154
new ExtensionKVStore ( "store_prices" ) ,
@@ -151,6 +161,7 @@ export class RootStore {
151
161
) ;
152
162
153
163
this . tokensStore = new TokensStore (
164
+ window ,
154
165
this . chainStore ,
155
166
new InExtensionMessageRequester ( ) ,
156
167
this . interactionStore
0 commit comments