Skip to content

Commit abe9c36

Browse files
committed
Fix linting error
1 parent 7e27a1d commit abe9c36

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

packages/walletconnect/src/index.ts

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ interface WalletConnectOptions {
1616
}
1717

1818
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 || {}
2124

2225
return () => {
2326
return {
@@ -130,19 +133,25 @@ function walletConnect(options?: WalletConnectOptions): WalletInit {
130133
// Check if connection is already established
131134
if (!this.connector.connected) {
132135
// 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
144141
)
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+
})
146155
} else {
147156
const { accounts, chainId } = this.connector.session
148157
this.emit('chainChanged', `0x${chainId.toString(16)}`)
@@ -206,7 +215,7 @@ function walletConnect(options?: WalletConnectOptions): WalletInit {
206215
}
207216

208217
// @ts-ignore
209-
if (method.includes('eth_signTypedData') {
218+
if (method.includes('eth_signTypedData')) {
210219
// @ts-ignore
211220
return this.connector.signTypedData(params)
212221
}

0 commit comments

Comments
 (0)