File tree Expand file tree Collapse file tree 1 file changed +24
-15
lines changed
packages/walletconnect/src Expand file tree Collapse file tree 1 file changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,11 @@ interface WalletConnectOptions {
16
16
}
17
17
18
18
function walletConnect ( options ?: WalletConnectOptions ) : WalletInit {
19
- const { bridge = 'https://bridge.walletconnect.org' , qrcodeModalOptions , connectFirstChainId} =
20
- options || { }
19
+ const {
20
+ bridge = 'https://bridge.walletconnect.org' ,
21
+ qrcodeModalOptions,
22
+ connectFirstChainId
23
+ } = options || { }
21
24
22
25
return ( ) => {
23
26
return {
@@ -130,19 +133,25 @@ function walletConnect(options?: WalletConnectOptions): WalletInit {
130
133
// Check if connection is already established
131
134
if ( ! this . connector . connected ) {
132
135
// create new session
133
- this . connector . createSession ( connectFirstChainId ? { chainId : parseInt ( chains [ 0 ] . id , 16 ) } : undefined ) . then ( ( ) => {
134
- QRCodeModal . open (
135
- this . connector . uri ,
136
- ( ) =>
137
- reject (
138
- new ProviderRpcError ( {
139
- code : 4001 ,
140
- message : 'User rejected the request.'
141
- } )
142
- ) ,
143
- qrcodeModalOptions
136
+ this . connector
137
+ . createSession (
138
+ connectFirstChainId
139
+ ? { chainId : parseInt ( chains [ 0 ] . id , 16 ) }
140
+ : undefined
144
141
)
145
- } )
142
+ . then ( ( ) => {
143
+ QRCodeModal . open (
144
+ this . connector . uri ,
145
+ ( ) =>
146
+ reject (
147
+ new ProviderRpcError ( {
148
+ code : 4001 ,
149
+ message : 'User rejected the request.'
150
+ } )
151
+ ) ,
152
+ qrcodeModalOptions
153
+ )
154
+ } )
146
155
} else {
147
156
const { accounts, chainId } = this . connector . session
148
157
this . emit ( 'chainChanged' , `0x${ chainId . toString ( 16 ) } ` )
@@ -206,7 +215,7 @@ function walletConnect(options?: WalletConnectOptions): WalletInit {
206
215
}
207
216
208
217
// @ts -ignore
209
- if ( method . includes ( 'eth_signTypedData' ) {
218
+ if ( method . includes ( 'eth_signTypedData' ) ) {
210
219
// @ts -ignore
211
220
return this . connector . signTypedData ( params )
212
221
}
You can’t perform that action at this time.
0 commit comments