Skip to content

Commit 429b95c

Browse files
committed
fix: linting errs
1 parent 94c091a commit 429b95c

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

packages/auth-browser/src/lib/chains/eth.ts

+23-22
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
import { Buffer as BufferPolyfill } from 'buffer';
2-
import depd from 'depd';
32

43
import { hexlify } from '@ethersproject/bytes';
54
import { Web3Provider, JsonRpcSigner } from '@ethersproject/providers';
65
import { toUtf8Bytes } from '@ethersproject/strings';
7-
86
import { verifyMessage } from '@ethersproject/wallet';
7+
import { injected, walletConnect } from '@wagmi/connectors';
8+
import {
9+
connect as wagmiConnect,
10+
disconnect as wagmiDisconnect,
11+
getWalletClient,
12+
Config,
13+
} from '@wagmi/core';
14+
import depd from 'depd';
915
import { ethers } from 'ethers';
1016
import { getAddress } from 'ethers/lib/utils';
1117
import { SiweMessage } from 'siwe';
12-
13-
// @ts-ignore: If importing 'nacl' directly, the built files will use .default instead
1418
import * as nacl from 'tweetnacl';
1519
import * as naclUtil from 'tweetnacl-util';
20+
import { http } from 'viem';
21+
import { createConfig } from 'wagmi';
1622

17-
// @ts-ignore: If importing 'nacl' directly, the built files will use .default instead
1823
import {
1924
ELeft,
2025
ERight,
@@ -40,13 +45,6 @@ import {
4045
import { getStorageItem } from '@lit-protocol/misc-browser';
4146
import { AuthSig, AuthCallbackParams, LITEVMChain } from '@lit-protocol/types';
4247

43-
import {
44-
createConfig,
45-
} from 'wagmi';
46-
import { connect as wagmiConnect, disconnect as wagmiDisconnect, getWalletClient, Config } from '@wagmi/core';
47-
import { injected, walletConnect } from '@wagmi/connectors'
48-
import { http } from 'viem';
49-
5048
const deprecated = depd('lit-js-sdk:auth-browser:index');
5149

5250
if (globalThis && typeof globalThis.Buffer === 'undefined') {
@@ -321,8 +319,11 @@ export const decodeCallResult = deprecated.function(
321319
'decodeCallResult will be removed.'
322320
);
323321

324-
const getWagmiProvider = async (chainId: number, walletConnectProjectId?: string) => {
325-
const chain = Object.values(LIT_CHAINS).find(c => c.chainId === chainId);
322+
const getWagmiProvider = async (
323+
chainId: number,
324+
walletConnectProjectId?: string
325+
) => {
326+
const chain = Object.values(LIT_CHAINS).find((c) => c.chainId === chainId);
326327
if (!chain) {
327328
throw new Error(`Chain ID ${chainId} not supported`);
328329
}
@@ -347,18 +348,18 @@ const getWagmiProvider = async (chainId: number, walletConnectProjectId?: string
347348
const config = createConfig({
348349
chains: [litChain],
349350
transports: {
350-
[litChain.id]: http(litChain.rpcUrls.default.http[0])
351+
[litChain.id]: http(litChain.rpcUrls.default.http[0]),
351352
},
352353
connectors: [
353354
injected(),
354355
...(walletConnectProjectId
355356
? [
356357
walletConnect({
357-
projectId: walletConnectProjectId
358-
})
358+
projectId: walletConnectProjectId,
359+
}),
359360
]
360361
: []),
361-
]
362+
],
362363
});
363364

364365
return config;
@@ -386,27 +387,27 @@ export const connectWeb3 = async ({
386387

387388
const config = await getWagmiProvider(chainId, walletConnectProjectId);
388389
wagmiConfig = config;
389-
390+
390391
const result = await wagmiConnect(config, {
391392
connector: config.connectors[0],
392393
chainId,
393394
});
394-
395395

396396
log('got provider');
397397
if (!result) {
398398
throw new Error('Failed to connect wallet');
399399
}
400400

401401
const walletClient = await getWalletClient(config);
402-
402+
403403
if (!walletClient) {
404404
throw new Error('No wallet client found');
405405
}
406406

407+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
407408
// @ts-ignore - Create Web3Provider from wallet client
408409
const web3 = new Web3Provider(walletClient);
409-
410+
410411
log('listing accounts');
411412
const accounts = await web3.listAccounts();
412413
log('accounts', accounts);

packages/auth-browser/src/lib/chains/sol.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ import {
88
NoWalletException,
99
UnknownError,
1010
} from '@lit-protocol/constants';
11-
12-
import { IProvider, AuthSig } from '@lit-protocol/types';
1311
import { log } from '@lit-protocol/misc';
1412
import { getStorageItem } from '@lit-protocol/misc-browser';
15-
// import { toString as uint8arrayToString } from 'uint8arrays';
16-
13+
import { IProvider, AuthSig } from '@lit-protocol/types';
1714
import {
1815
uint8arrayFromString,
1916
uint8arrayToString,

0 commit comments

Comments
 (0)