@@ -17,23 +17,24 @@ import {
1717 follow as lensFollow ,
1818 unfollow as lensUnfollow ,
1919} from '@lens-protocol/client/actions'
20- import { gql } from 'graphql-request'
21- import { sortBy , uniqBy } from 'lodash-es'
22- import { fetchJSON } from '../helpers/fetchJSON.js'
23- import { LENS_ROOT_API } from './constants.js'
24- import { fragments } from './fragments/index.js'
25- import type { FollowPair } from './types.js'
2620import {
2721 createIndicator ,
2822 createNextIndicator ,
2923 createPageable ,
3024 EMPTY_LIST ,
3125 type PageIndicator ,
3226} from '@masknet/shared-base'
33- import { formatLensPost , getAccountAvatar } from './helpers.js'
34- import { isZero } from '@masknet/web3-shared-base'
35- import type { LensV3BaseAPI } from '@masknet/web3-providers/types'
3627import { EVMWeb3 } from '@masknet/web3-providers'
28+ import type { LensV3BaseAPI } from '@masknet/web3-providers/types'
29+ import { isZero } from '@masknet/web3-shared-base'
30+ import { isValidAddress } from '@masknet/web3-shared-evm'
31+ import { gql } from 'graphql-request'
32+ import { sortBy , uniqBy } from 'lodash-es'
33+ import { fetchJSON } from '../helpers/fetchJSON.js'
34+ import { LENS_ROOT_API } from './constants.js'
35+ import { fragments } from './fragments/index.js'
36+ import { formatLensPost , getAccountAvatar } from './helpers.js'
37+ import type { FollowPair } from './types.js'
3738
3839export class LensV3 {
3940 private signMessage : ( message : string ) => Promise < string >
@@ -46,7 +47,7 @@ export class LensV3 {
4647 storage : window . localStorage ,
4748 fragments,
4849 } )
49- if ( account ) this . account = evmAddress ( account )
50+ if ( account && isValidAddress ( account ) ) this . account = evmAddress ( account )
5051 this . signMessage = signMessage || ( ( message : string ) => EVMWeb3 . signMessage ( 'message' , message ) )
5152 }
5253
0 commit comments