lens-protocol / lens-sdk Goto Github PK
View Code? Open in Web Editor NEWThe official SDK to interact with the Lens Protocol
Home Page: https://docs.lens.xyz/docs/what-is-lens
License: MIT License
The official SDK to interact with the Lens Protocol
Home Page: https://docs.lens.xyz/docs/what-is-lens
License: MIT License
Describe the bug
I am trying to implement react-web and client sdk in my NextJS app but I am getting different errors.
In turboRepo I am getting error regarding to createContext which is have to use 'use client' before import createContext from react.
Without turboRepo in Nextjs App I am getting error
Error: require() of ES Module /Users/harpreet/Desktop/Pinsta/my-app/node_modules/wagmi/dist/index.js from /Users/harpreet/Desktop/Pinsta/my-app/node_modules/@lens-protocol/wagmi/dist/lens-protocol-wagmi.cjs.dev.js not supported.
Instead change the require of index.js in /Users/harpreet/Desktop/Pinsta/my-app/node_modules/@lens-protocol/wagmi/dist/lens-protocol-wagmi.cjs.dev.js to a dynamic import() which is available in all CommonJS modules.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/client": "^2.0.0-alpha.18",
"@lens-protocol/react-web": "^2.0.0-alpha.15",
"@lens-protocol/wagmi": "^3.0.0-alpha.12",
"next": "14.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Describe the bug
Cursor-based pagination doesn't seem to be working for the usePublications
hook. hasMore
is always false
and if I try to fetch using next
I get the error Unable to merge incoming cursor-based pagination result
To Reproduce
https://codesandbox.io/s/relaxed-cache-7jqnw3?file=/src/LensFeed.tsx
Expected behaviuor
A clear and concise description of what you expected to happen.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/react": "1.2.0-next.2",
Additional context
NA
Describe the bug
In the notifications hook,
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
1.2.1
Describe the bug
When doing a request with profileIds
in usePublications
and useProfiles
, the results are cached and no new values for profileIds
can be requested on those hooks anymore.
Expected behaviuor
I should be able to call usePublications
and useProfiles
with different arrays of profileIds and get proper results each time.
react-web 1.3.0-next
Problem
Wagmi had a major milestone with the release of v1 (currently 1.1.0
), and there's no point in staying on 0.12.13
. Projects using wagmi 0.12.13
should transition to v1, which replaces ethers
with viem
.
Solution
wagmi
v1 and viem
.@lens-protocol/wagmi
should change the peerDependency from ^0.12.13 to ^1.0.0.See the viem
documentation: https://viem.sh/docs/ethers-migration.html
A discussion on ethers
interoperability in the wagmi
git repository: wevm/wagmi#2340
Alternatives
Long-term, it's essential to move to viem
as staying with wagmi 0.12.13
will lead to hard to debug issues and missing out on important improvements.
Additional context
The ethersWalletToAccount
adapter can facilitate the ethers
to viem
transition: https://viem.sh/docs/migration-guide.html#for-ethers-wallet-adapter-use-etherswallettoaccount
Happy to help out to speed up the upgrade!
Is your feature request related to a problem? Please describe.
Right now, if a lens protocol implementer had to verify a lens token as belonging to a user,
the only way to do that is to use the verify-jwt method.
This ALWAYS requires an extra network hop in the backend, slowing down lens apps.
Describe the solution you'd like
https://api.lens.dev/well-known/jwks.json
.Describe alternatives you've considered
RS256 is probably much better known; but at this point there's a LOT of library support for ES256.
Additional context
ES256 uses the secp256r1 curve.
Hey everyone!
Today I started to play around with Lens API's.
GraphQL queries works great, although I wanted to get advantage of types by using this package @lens-protocol/client.
Unfortunately it seems to not work at Cloudflare functions:
ReferenceError: XMLHttpRequest is not defined
I'm using Remix loader here^^
To Reproduce
const result = await lensClient.explore.profiles({
sortCriteria: ProfileSortCriteria.CreatedOn,
});
ReferenceError: XMLHttpRequest is not defined
- As Cloudflare functions supports only Fetch API's.Worth to mention same code used at frontend useEffect() works as expected.
Expected behaviuor
Lens client would work at Remix Cloudflare Pages without errors
Version of the packages you are using
Additional context
Are there any plans to switch over to Fetch API? Or some other known workaround for it?
Thanks
Describe the bug
sources
and profileIds
missing from useExplorePublications
request
react-web 1.3.0-next
Is your feature request related to a problem? Please describe.
Currently building https://www.lensclubs.xyz/ where we allow communities, dao's, and companies to collaborate under one lens handle. The way we handle this is by using a smart-contract wallet where we talk directly to the lens contract.
This also means we can't authenticate, since we don't have a private key, and therefore can't use the usefeed hook.
Describe the solution you'd like
A way for us to get the feed of a certain profileID without having to authenticate. Or allowing us to be able to authenticate once as lens-clubs and allow the smart contracts wallets to retrieve feed without being limited in the API.
Would be great if we can find a solution for this, The lens SDK has been nothing but great so far, but this is a major blocker for us at the moment.
Thanks for taking the time!
Describe the bug
setting endTimestamp
when creating a post causes an api error on the CreatePostTypedData
endpoint when the dispatcher is not allowed and we're trying to do a self funded fallback. The error is:
UnspecifiedError: invalid BigNumber string (argument="value", value="NaN", code=INVALID_ARGUMENT, version=bignumber/5.6.2)
the endTimestamp
value i'm providing is a number as required by the sdk, example: 1692201833189
I noticed that the sdk is sending the endTimestamp to the api as a string, for example: "1692201833189"
, so as a workaround i tried to provide an ISO string for the endTimestamp like "2023-08-16T16:33:02.277Z"
like i do in the mobile app, and that seems to work for simple collects, but for multi recipient collects, i get another error from the sdk and not from the api:
error InvariantError: fix the following issues
· "collect" expected to match one of the following groups:
· "collect.recipient": Required
OR:
· "collect.endTimestamp": Expected number, received string
OR:
· "collect.recipient": Required
· "collect.vault": Required
· "collect.endTimestamp": Expected number, received string
OR:
· "collect.recipient": Required
· "collect.depositToAave": Invalid literal value, expected true
· "collect.endTimestamp": Expected number, received string
OR:
· "collect.type": Invalid literal value, expected "FREE"
OR:
· "collect.type": Invalid literal value, expected "NO_COLLECT"
Version of the packages you are using
react-web 1.3 next.9
Describe the bug
I'm trying to use the LensClient
for V2 in a Chrome Extension but I received this error when attempting to query profiles:
{
"message": "Context creation failed: Invalid url protocol chrome-extension:. Should be https:, value: chrome-extension://iebmcaohopockfafpfoeoaopihocflci",
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"stacktrace": [
"Error: Context creation failed: Invalid url protocol chrome-extension:. Should be https:, value: chrome-extension://iebmcaohopockfafpfoeoaopihocflci",
" at URL.validate (/usr/src/app/packages/custom-types-shared/lib/url.type.js:38:19)",
" at new BaseType (/usr/src/app/packages/custom-types-shared/lib/base-types/base-type.js:9:14)",
" at new StringType (/usr/src/app/packages/custom-types-shared/lib/base-types/string.type.js:10:9)",
" at new URI (/usr/src/app/packages/custom-types-shared/lib/uri.type.js:14:9)",
" at new URL (/usr/src/app/packages/custom-types-shared/lib/url.type.js:7:9)",
" at getOriginFromRequest (/usr/src/app/packages/apollo-server-shared/lib/middleware/get-origin-from-request.js:8:16)",
" at ApolloServer.context (/usr/src/app/packages/api-lens/lib/api-setup/api.js:75:83)",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
]
}
}
}
To Reproduce
I've only tried using LensClient.profile.fetchAll()
but I assume this would be the error for all functions hitting the API. To reproduce use the LensClient
from a Chrome Extension.
Expected behaviuor
The LensClient
should allow requests from chrome-extension:
protocol origins, as well as other browser extension protocols, like moz-extension:
.
Version of the packages you are using
@lens-protocol/client: 2.0.0-alpha.11
Describe the bug
Publications returned from the SDK don't include the appId
property.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
1.2.2
Describe the bug
Updating react-web from 1.3-next.5 to 1.3-next.8 cases error when running app
ERROR in ./node_modules/@lens-protocol/react-web/dist/lens-protocol-react-web.esm.js 36:53-58
export 'maybe' (imported as 'maybe') was not found in '@lens-protocol/shared-kernel' (possible exports: Amount, BigDecimal, CausedError, ChainType, DateUtils, Deferred, Denomination, InvariantError, Kind, NativeType, WellKnownSymbols, assertError, assertErrorWithCode, assertErrorWithReason, assertFailure, assertJustOne, assertNever, assertNonEmptyArray, assertSuccess, clearSafeTimeout, erc20, ether, failure, get, getID, hasAtLeastOne, hasJustOne, hasTwoOrMore, invariant, isInEnum, isNonNullable, matic, never, nonNullable, omitDeep, removeAtIndex, safeSetTimeout, success, usd)
Do you know why this might be happening?
Is your feature request related to a problem? Please describe.
The lens SDK does not expose the access token directly. However, the
verify-jwt endpoint requires it.
This seems to be the only way for a lens protocol implementer's API
server to verify that the user has logged in through lens.
Describe the solution you'd like
Add a getAccessToken(): Promise<string>
method to IAuthentication
.
Re-use the code currently in Authentication.getRequestHeader
and pull it
out into a publicly exposed method on IAuthentication
.
Describe alternatives you've considered
Adding getRequestHeader
to the public interface. But this seems a little too
use-case specific. You don't always need the access token for adding to your
request headers.
Additional context
Current workaround from a package that uses the official SDK:
async function getCredentials (lens: LensClient): Promise<string> {
const lensAuth = lens.authentication as Authentication
const getHeadersResp = await lensAuth.getRequestHeader()
if (getHeadersResp.isFailure()) {
return ''
}
const headers = getHeadersResp.unwrap()
const authHeaderValue = headers.authorization
if (authHeaderValue.length < 7) {
return ''
}
const accessToken = authHeaderValue.slice(7)
return accessToken
}
Is your feature request related to a problem? Please describe.
Under the useCreatePost metadata don't have option for attributes, image, imageMimeType.
Look at lens docs.
/**
* These are the attributes for the item, which will show up on the OpenSea and others NFT trading websites on the
item.
*/
attributes?: PublicationMetadataAttribute[] | undefined | null;
/**
* legacy to support OpenSea will store any NFT image here.
*/
image?: Url | undefined | null;
/**
* This is the mime type of image. This is used if you uploading more advanced cover images
* as sometimes IPFS does not emit the content header so this solves the pr
*/
imageMimeType?: MimeType | undefined | null;
https://docs.lens.xyz/docs/metadata-standards#metadata-structure
Describe the bug
I'm trying to use lens sdk on react-native and getting this error when using lens provider
Using expo and not react-native directly as in your example
To Reproduce
Code straight from example app
import './shims'
import {
LensConfig,
LensProvider as LensProviderOG,
development,
IStorageProvider,
} from '@lens-protocol/react'
import { MMKV } from 'react-native-mmkv'
import { ReactNode } from 'react'
import { IBindings } from '@lens-protocol/react'
import { providers, Wallet } from 'ethers'
const provider = new providers.InfuraProvider('maticmum')
console.log('LensProvider native')
// This is the private key of the `@jsisthebest.test` profile
// It's a public private key so anyone can modify the profile
// For your own convenience change to the private key of a new wallet
const testWalletPrivateKey = '6c434da5e5c0e3a8e0db5cf835d23e04c7592037854f0700c26836be7581c68c'
export const wallet = new Wallet(testWalletPrivateKey, provider)
export function bindings(): IBindings {
return {
getProvider: async () => provider,
getSigner: async () => wallet,
}
}
const lensConfig: LensConfig = {
bindings: bindings(),
environment: development,
storage: mmkvStorageProvider(),
}
export const LensProvider = ({ children }: { children: ReactNode }) => {
return <LensProviderOG config={lensConfig}>{children}</LensProviderOG>
}
class MmkvStorageProvider implements IStorageProvider {
private readonly storage
constructor() {
this.storage = new MMKV({ id: 'lens-sdk-storage' })
}
async getItem(key: string) {
const result = await this.storage.getString(key)
return result ?? null
}
setItem(key: string, value: string) {
this.storage.set(key, value)
}
removeItem(key: string) {
this.storage.delete(key)
}
}
function mmkvStorageProvider(): IStorageProvider {
return new MmkvStorageProvider()
}
Expected behaviuor
app provider should work and app should startup
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/react": "1.3.0-next.10",
"@lens-protocol/react": "^1.2.2",
Additional context
Using expo and not react-native directly as in your example
console error:
ERROR Error: Failed to construct 'TextDecoder': the 'fatal' option is unsupported., js engine: hermes
at ContextNavigator (http://192.168.86.78:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:174694:24)
at ExpoRoot (http://192.168.86.78:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:174665:30)
at App
at withDevTools(App) (http://192.168.86.78:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:151289:27)
at ErrorToastContainer (http://192.168.86.78:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:151166:24)
at ErrorOverlay
at RCTView
at View (http://192.168.86.78:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:63955:43)
at RCTView
at View (http://192.168.86.78:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:63955:43)
at AppContainer (http://192.168.86.78:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:63788:38)
at main(RootComponent) (http://192.168.86.78:8081/index.bundle//&platform=ios&dev=true&hot=false&lazy=true:112656:28)
ERROR TypeError: Cannot read property 'state' of null
This error is located at:
in Unknown (created by HomeScreen)
in HomeScreen (created by Screen)
in RNCSafeAreaView
in Unknown (created by Screen)
in Screen
in Unknown (created by Route(index))
in Route (created by Route(index))
in Route(index) (created by SceneView)
in StaticContainer
in EnsureSingleNavigator (created by SceneView)
in SceneView (created by BottomTabView)
in RCTView (created by View)
in View (created by Screen)
in RCTView (created by View)
in View (created by Background)
in Background (created by Screen)
in Screen (created by BottomTabView)
in RNSScreen
in Unknown (created by InnerScreen)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by InnerScreen)
in InnerScreen (created by Screen)
in Screen (created by MaybeScreen)
in MaybeScreen (created by BottomTabView)
in RNSScreenNavigationContainer (created by ScreenContainer)
Describe the bug
An error occurs for the following query:
`
query Publications
{
"where": {
"withOpenActions": [
{
"address": "0xfF824aB2FCb6986e399B5Af922c4a20778a047A1",
"category": "COLLECT"
}
]
},
"orderBy": "LATEST",
"limit": "TwentyFive"
}
`
The error is:
{ "errors": [ { "message": "[CanDecrypt] Publication metadata not found for 0x33-0x0261} - [getPublicationMetadata] Could not find metadata context for publication 0x33-0x0261 - fix the following issues\n· \"version\": Required - SHOULD NEVER HAPPEN!", "locations": [ { "line": 444, "column": 3 } ], "path": [ "result", "items", 1, "operations", "canDecrypt" ], "extensions": { "code": "INTERNAL_SERVER_ERROR", "exception": { "apollo": false, "statusCode": 500, "stacktrace": [ "Error: [CanDecrypt] Publication metadata not found for 0x33-0x0261} - [getPublicationMetadata] Could not find metadata context for publication 0x33-0x0261 - fix the following issues", "· \"version\": Required - SHOULD NEVER HAPPEN!", " at PublicationOperationsFieldResolver.canDecrypt (/usr/src/app/packages/api-lens/lib/publication/resolvers/field-resolvers/publication-operations.js:191:19)", " at process.processTicksAndRejections (node:internal/process/task_queues:95:5)" ] } } } ], "data": null }
To Reproduce
Happens each time.
Expected behaviuor
No errors
Version of the packages you are using
lens client 2.0.0-alpha.14
Describe the bug
RangeError: Out of memory for regexp results., js engine: hermes
at App (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.lens-test:122203:54)
at RCTView
at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.lens-test:59078:43)
at RCTView
at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.lens-test:59078:43)
at AppContainer (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.lens-test:58922:36)
at lens_test(RootComponent) (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.lens-test:108143:28)
ERROR TypeError: Cannot read property 'LensProvider' of undefined
This error is located at:
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in lens_test(RootComponent), js engine: hermes
ERROR TypeError: Cannot read property 'LensProvider' of undefined
This error is located at:
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in lens_test(RootComponent), js engine: hermes
✨ Done in 225.97s.
To Reproduce
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import {development, LensProvider} from '@lens-protocol/react';
import React from 'react';
import type {PropsWithChildren} from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {IBindings} from '@lens-protocol/react';
import {providers, Wallet} from 'ethers';
const provider = new providers.InfuraProvider('maticmum');
const testWalletPrivateKey =
'6c434da5e5c0e3a8e0db5cf835d23e04c7592037854f0700c26836be7581c68c';
const wallet = new Wallet(testWalletPrivateKey, provider);
function bindings(): IBindings {
return {
getProvider: async () => provider,
getSigner: async () => wallet,
};
}
function App(): JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};
return (
<LensProvider
config={{
bindings: bindings(),
environment: development,
storage: AsyncStorage,
}}>
<SafeAreaView style={backgroundStyle}>
<Text>App</Text>
</SafeAreaView>
</LensProvider>
);
}
export default App;
Expected behaviuor
A clear and concise description of what you expected to happen.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/metadata": "^1.0.5",
"@lens-protocol/react": "^2.0.0-alpha.22",
"@react-native-async-storage/async-storage": "^1.19.8",
"ethers": "5.7.0",
"react": "18.2.0",
"react-native": "0.72.7"
Additional context
This is the official minimum demo that can easily demonstrate the problem. My app is paralyzed because of this. Please help!!
Describe the bug
A internal server error happens when calling Explore publications with the Lens V2 Alpha 7 client.
{ "errors": [ { "message": "Cannot read properties of undefined (reading 'toLocaleLowerCase')", "locations": [ { "line": 36, "column": 3 } ], "path": [ "result", "items", 9, "metadata" ], "extensions": { "code": "INTERNAL_SERVER_ERROR", "exception": { "stacktrace": [ "TypeError: Cannot read properties of undefined (reading 'toLocaleLowerCase')", " at new Locale (/usr/src/app/packages/custom-types-shared/lib/locale.type.js:19:22)", " at PublicationMetadataRedisCacheStorage.get (/usr/src/app/packages/api-lens/lib/publication/cache/metadata.js:27:38)", " at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", " at async getPublicationMetadata (/usr/src/app/packages/api-lens/lib/publication/operations/metadata/get-publication-metadata.js:7:27)", " at async PublicationPostFieldResolver.metadata (/usr/src/app/packages/api-lens/lib/publication/resolvers/field-resolvers/publication.js:56:28)" ] } } } ], "data": null }
To Reproduce
Call the the function like this:
`
const query = {where:{publicationTypes:[ExplorePublicationType.Post],
metadata:{mainContentFocus:mediaFilter}},
orderBy:ExplorePublicationsOrderByType.LensCurated,limit:LimitType.TwentyFive,
cursor:null
};
lensClient.explore.publications(query)`
``
Expected behavior
No error
Version of the packages you are using
Lens v2 client 2.0.0-alpha.7
Additional context
Was working with previous Alpha
Is your feature request related to a problem? Please describe.
Is there a way to get the Lens API accessToken
of the current authenticated user? Can this be added?
Describe the solution you'd like
I would like a function or hook to return the accessToken.
Describe the bug
usePublications
missing publicationIds
request param
react-web 1.3-next.9
I'd like to have access to the authenticated Apollo Client used in the Lens Client SDK to do custom graphql queries and mutations that are not directly supported by the sdk, similar to how the Lens React SDK has a useApolloClient
hook.
can this be added?
Describe the bug
It's currently not possible to toggle options like commentsOfOrdering
and commentsRankingFilter
in useComments
. can this be supported?
Edit: in fact, these attributes don't seem to be passed to the actual graphql query at all.
Expected behaviuor
i expect those options to be toggled so the user can toggle the order of comments in the ui.
If using the React bindings, what is the essence of your React app?
react-web 1.2.2 and 1.3.0-next.4
Describe the bug
I am getting error of version conflict installing @lens-protocol/react-web and @lens-protocol/client alpha versions
To Reproduce
Can you please update @lens-protocol/metadata@"0.1.0-alpha.29 to @lens-protocol/metadata@"0.1.0-alpha.30 under @lens-protocol/client?
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/client": "^2.0.0-alpha.11",
"@lens-protocol/react-web": "^2.0.0-alpha.7",
"@lens-protocol/wagmi": "^3.0.0-alpha.4"
Describe the bug
To Reproduce
Just installing the basic @lens-protocol/wagmi and creating the wrapper gives this error, next js 13.4, page directory, wrap wagmi in _app.tsx
Expected behaviuor
Error with the module
If using the React bindings, what is the essence of your React app?
I have the fix, I found the fix, but unable to the find the exact file, the problem is in /wagmi/dist/lens-protocol-wagmi.cjs.js file, so, if someone can help me, i can help with the fix
System:
OS: macOS 13.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 97.39 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
Watchman: 2023.05.08.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /Users/jingxiaopeng/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 11.0.19 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.8 => 0.71.8
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
code:
const {
data: publications,
loading,
hasMore,
next,
} = useExplorePublications({
limit: 20,
timestamp: refreshTimestamp,
sortCriteria: PublicationSortCriteria.Latest,
publicationTypes: [PublicationTypes.Post],
});
Describe the bug
A Server error occurs when parsing or getting the result: INTERNAL_SERVER_ERROR
Abstract type \"AccessCondition\" must resolve to an Object type at runtime for field \"PublicationMetadataV3LitEncryption.accessCondition\". Either the \"AccessCondition\" type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function.
Or when adding metadata:{mainContentFocus:[PublicationMetadataMainFocusType.Image]} in the query: INTERNAL_SERVER_ERROR
Expected a value of type \"MimeType\" but received: \"image/png\
To Reproduce
Call function like:
const mostPopular = await window.lensClient.explore.publications({where:{ publicationTypes:[ExplorePublicationType.Post]},orderBy:ExplorePublicationsOrderByType.LensCurated,limit:LimitType.Ten});
or
const mostPopular = await window.lensClient.explore.publications({where:{ publicationTypes:[ExplorePublicationType.Post],metadata:{mainContentFocus:[PublicationMetadataMainFocusType.Image]}},orderBy:ExplorePublicationsOrderByType.LensCurated,limit:LimitType.Ten});
Also happens with ExplorePublicationsOrderByType.Latest
Expected behavior
No errors
Version of the packages you are using
Happens with client version Lens V2 alpha 2 and 3
Additional context
Seems like some metadata or fragment error getting or expecting the wrong type.
Describe the bug
Updating from @lens-protocol/react-web
1.3.0-next.4
to 1.3.0-next.5
causes this error when running the app:
Module not found: Error: Can't resolve '@xmtp/react-sdk'
Do I have to explicitly add @xmtp/react-sdk
as a dependency?
Similar to the enable option in useQuery of React Query, I would like to trigger a query only when certain conditions are met.
Describe the bug
In the useLogin hook, the SDK does not handle the signing message error properly. When the user rejects the sign message in their wallet, the error is not reported here but thrown as an unhandled promise rejection.
To Reproduce
Expected behaviour
The error should be catched and returned by the isFailure
function
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/react-web": "2.0.0-alpha.19"
Describe the bug
Is there a cache in queries, when I change the route or click on another link and go back, the Component is re-rendered but the hook is not called.
Version of the packages you are using
1.2.1
Describe the bug
usePollDetails:
When there is a risk of snapshotting potentially volatile voting details, accessing the voting information becomes unreliable, and it may lead to a potential crash of the shared kernel.
To Reproduce
const {data} = usePollDetails({ publication: { __typename: 'Post', id: '0x3d0f-0x01dc', stats: { __typename: 'PublicationStats', totalAmountOfMirrors: 0, totalUpvotes: 0, totalDownvotes: 0, totalAmountOfCollects: 0, totalAmountOfComments: 0, commentsCount: 0, }, metadata: { __typename: 'MetadataOutput', animatedUrl: null, contentWarning: null, description: null, image: null, locale: 'mt', mainContentFocus: 'TEXT_ONLY', name: 'Post by @xiaoqiecf5e.lens', media: [], attributes: [ { __typename: 'MetadataAttributeOutput', traitType: 'type', value: 'text_only', }, ], encryptionParams: null, tags: ['business_&_entrepreneurs'], }, profile: { __typename: 'Profile', id: '0x3d0f', name: 'xiaoqiecf5e ◱ ◱', bio: 'xiaoqie is the best yyds', handle: 'xiaoqiecf5e.lens', ownedBy: '0x15d693444ABd97710437de8B9Bc271137994cf5e', interests: [ 'ART_ENTERTAINMENT__DESIGN', 'ART_ENTERTAINMENT__MUSIC', 'BUSINESS__CREATOR_ECONOMY', 'CAREER', 'EDUCATION', 'FOOD_DRINK__COOKING', 'HEALTH_FITNESS__BIOHACKING', 'HOBBIES_INTERESTS__SPORTS', 'LAW_GOVERNMENT_POLITICS__REGULATION', 'LENS', 'NEWS', 'TECHNOLOGY__SCIENCE', ], picture: { __typename: 'MediaSet', original: { __typename: 'Media', altTag: null, cover: null, mimeType: null, url: 'https://ik.imagekit.io/lens/media-snapshot/394954b96a3daefc5203017bdb3c33344ec760885030eb431327fd24e709bc44.jpg', }, }, coverPicture: { __typename: 'MediaSet', original: { __typename: 'Media', altTag: null, cover: null, mimeType: null, url: 'https://lens.infura-ipfs.io/ipfs/QmPSyEJYc481LcddQWXx8bK3xHzShfz9R1chZWZLtJH3XG', }, }, stats: { __typename: 'ProfileStats', totalCollects: 15, totalComments: 51, totalFollowers: 51, totalFollowing: 291, totalMirrors: 221, totalPosts: 206, totalPublications: 478, commentsCount: 0, postsCount: 0, mirrorsCount: 0, }, followModule: null, followPolicy: { type: 'ANYONE', }, __attributes: [ { __typename: 'Attribute', displayType: null, key: 'location', value: 'gzhou', }, { __typename: 'Attribute', displayType: null, key: 'website', value: 'https://land.philand.xyz/xiaoqie.eth', }, { __typename: 'Attribute', displayType: null, key: 'twitter', value: 'xianshengxiong1', }, { __typename: 'Attribute', displayType: null, key: 'hasPrideLogo', value: 'true', }, { __typename: 'Attribute', displayType: null, key: 'statusEmoji', value: '😍', }, { __typename: 'Attribute', displayType: null, key: 'statusMessage', value: 'love', }, { __typename: 'Attribute', displayType: null, key: 'app', value: 'Lenster', }, ], attributes: { location: { attribute: { __typename: 'Attribute', displayType: null, key: 'location', value: 'gzhou', }, }, website: { attribute: { __typename: 'Attribute', displayType: null, key: 'website', value: 'https://land.philand.xyz/xiaoqie.eth', }, }, twitter: { attribute: { __typename: 'Attribute', displayType: null, key: 'twitter', value: 'xianshengxiong1', }, }, hasPrideLogo: { attribute: { __typename: 'Attribute', displayType: null, key: 'hasPrideLogo', value: 'true', }, }, statusEmoji: { attribute: { __typename: 'Attribute', displayType: null, key: 'statusEmoji', value: '😍', }, }, statusMessage: { attribute: { __typename: 'Attribute', displayType: null, key: 'statusMessage', value: 'love', }, }, app: { attribute: { __typename: 'Attribute', displayType: null, key: 'app', value: 'Lenster', }, }, }, dispatcher: { __typename: 'Dispatcher', address: '0xca674628a04dA98D12147EF8bE7c3663bc0820Ff', canUseRelay: true, }, onChainIdentity: { __typename: 'OnChainIdentity', proofOfHumanity: false, ens: { __typename: 'EnsOnChainIdentity', name: 'xiaoqie.eth', }, sybilDotOrg: { __typename: 'SybilDotOrgIdentity', verified: false, source: { __typename: 'SybilDotOrgIdentitySource', twitter: { __typename: 'SybilDotOrgTwitterIdentity', handle: null, }, }, }, worldcoin: { __typename: 'WorldcoinIdentity', isHuman: false, }, }, isFollowedByMe: false, isFollowingObserver: false, followStatus: null, ownedByMe: false, }, collectedBy: null, collectModule: { __typename: 'RevertCollectModuleSettings', contractAddress: '0xa31FF85E840ED117E172BC9Ad89E55128A999205', }, collectNftAddress: null, referenceModule: null, createdAt: '2023-07-17T13:33:05.000Z', hidden: false, isGated: false, reaction: null, hasCollectedByMe: false, canComment: { __typename: 'CanCommentResponse', result: false, }, canMirror: { __typename: 'CanMirrorResponse', result: false, }, mirrors: [], canObserverDecrypt: { __typename: 'CanDecryptResponse', result: false, reasons: ['MISSING_ENCRYPTION_PARAMS'], }, hasOptimisticCollectedByMe: false, isOptimisticMirroredByMe: false, isMirroredByMe: false, collectPolicy: { type: 'NO_COLLECT', state: 'CANNOT_BE_COLLECTED', }, referencePolicy: { type: 'ANYONE', }, decryptionCriteria: null, contentInsight: { type: 'SNAPSHOT_POLL', spaceId: 'lido-snapshot.eth', proposalId: '0xbf00c00a2e9c009e9d014e1ed4885d2b77d525ffb1c7495479f750a915f30f2e', url: 'https://snapshot.org/#/lido-snapshot.eth/proposal/0xbf00c00a2e9c009e9d014e1ed4885d2b77d525ffb1c7495479f750a915f30f2e', }, }, });
Expected behaviuor
InvariantError: Snapshot proposal must have at least two choices
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
Please provide the version of the packages.
Additional context
Add any other context about the problem here.
Describe the bug
Issue with Wagmi
To Reproduce
Basic Sdk setup, nextjs 13.4, page directory
Expected behaviuor
There is problem with wagmi and ethers, wagmi supports ethers version 5.7.2, but when installed according to documentation it installs recent version and may cause problems.
If using the React bindings, what is the essence of your React app?
Additional context
I know wagmi would be trying to get the fix, but we should also give good experience to our users from our side, as the sdk was released just 2 days ago, we can may be improve documentation ( for time being ) or find some possible fix
** How I fixed it **
I just migrated my ethers module back to 5.7.2 and its up and running
Describe the bug
Mirror notification post no getting correct typename, It won't return mirrorOf data.
To Reproduce
In the mirrored publication it should return mirrorOf data with original publication id.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
1.2.1
Describe the bug
const { execute: create, isPending, error } = useCreateMirror();
Hi, I use the above code in my file and I got _ref undefined error, when I removed this line everything working fine.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
1.2.1
Describe the bug
While following the NextJS example, the useActiveProfile
hook always seems to return null even when signed in with a wallet that has a lens profile.
To Reproduce
Following this example from the docs, profile is always null
Expected behaviuor
I have a lens protocol profile and after signing in, I would expect profile to not be null.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"next": "13.2.3",
"@lens-protocol/react-web": "0.6.0",
"@lens-protocol/wagmi": "0.6.0",
"ethers": "5.7.2",
"wagmi": "0.12.8"
Additional context
Is there any other special steps I am missing? I'm not sure why the profile would be null
Hi, I want to fetch publications based on their type: Mirror and Comment separately, but there's no option to add publication type in the request.
So I request you to please add restrictEventTypesTo in the usePublications request.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @lens-protocol/[email protected]
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.cjs.dev.js b/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.cjs.dev.js
index 8df3c2b..42cc040 100644
--- a/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.cjs.dev.js
+++ b/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.cjs.dev.js
@@ -26,8 +26,11 @@ function assertNonEmptyArray(items) {
function hasJustOne(items) {
return items.length === 1;
}
+function hasTwoOrLess(items) {
+ return items.length <= 2;
+}
function assertJustOne(items) {
- Amount.invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
+ Amount.invariant(hasTwoOrLess(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
diff --git a/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.cjs.prod.js b/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.cjs.prod.js
index 2b6c25d..28d4939 100644
--- a/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.cjs.prod.js
+++ b/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.cjs.prod.js
@@ -26,8 +26,11 @@ function assertNonEmptyArray(items) {
function hasJustOne(items) {
return items.length === 1;
}
+function hasTwoOrLess(items) {
+ return items.length <= 2;
+}
function assertJustOne(items) {
- Amount.invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
+ Amount.invariant(hasTwoOrLess(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
diff --git a/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.esm.js b/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.esm.js
index 17a759a..87dfc26 100644
--- a/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.esm.js
+++ b/node_modules/@lens-protocol/shared-kernel/dist/lens-protocol-shared-kernel.esm.js
@@ -16,8 +16,11 @@ function assertNonEmptyArray(items) {
function hasJustOne(items) {
return items.length === 1;
}
+function hasTwoOrLess(items) {
+ return items.length <= 2;
+}
function assertJustOne(items) {
- invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
+ invariant(hasTwoOrLess(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
This issue body was partially generated by patch-package.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Warning
These dependencies are deprecated:
Datasource | Name | Replacement PR? |
---|---|---|
npm | @bundlr-network/client |
|
npm | @ensdomains/ens |
|
npm | @ensdomains/resolver |
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@graphql-codegen/add
, @graphql-codegen/cli
, @graphql-codegen/typescript
, @graphql-codegen/typescript-operations
)traverse
, @types/traverse
)@babel/core
, @babel/preset-env
, @babel/preset-react
, @babel/preset-typescript
)@types/react
, eslint-plugin-react-hooks
, react
, react-dom
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)node
, @types/node
)@graphql-codegen/add
, @graphql-codegen/cli
, @graphql-codegen/fragment-matcher
, @graphql-codegen/introspection
, @graphql-codegen/near-operation-file-preset
, @graphql-codegen/typescript
, @graphql-codegen/typescript-apollo-client-helpers
, @graphql-codegen/typescript-graphql-request
, @graphql-codegen/typescript-operations
, @graphql-codegen/typescript-react-apollo
)uuid
, @types/uuid
)@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
.github/workflows/ci.yaml
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
.github/workflows/docs.yaml
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
actions/checkout v4
pnpm/action-setup v3
actions/setup-node v4
JamesIves/github-pages-deploy-action v4.4.3
.github/workflows/lens-next-app.yaml
actions/checkout v4
actions/setup-node v4
actions/upload-artifact v4
package.json
@changesets/cli ^2.26.2
@preconstruct/cli ^2.8.1
prettier ^2.8.8
rimraf ^4.4.1
turbo ^1.10.16
typedoc ^0.25.8
typedoc-material-theme ^1.0.2
typedoc-plugin-extras ^3.0.0
typescript 5.2.2
node >=18
pnpm >=8
pnpm 8.12.1
ganache 7.7.4
packages/api-bindings/package.json
graphql ^16.8.1
graphql-tag ^2.12.6
tslib ^2.6.2
@apollo/client ^3.9.5
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-typescript ^7.23.3
@faker-js/faker ^7.6.0
@graphql-codegen/add ^4.0.1
@graphql-codegen/cli ^3.3.1
@graphql-codegen/fragment-matcher ^4.0.1
@graphql-codegen/introspection ^3.0.1
@graphql-codegen/typescript ^3.0.4
@graphql-codegen/typescript-apollo-client-helpers ^2.2.6
@graphql-codegen/typescript-operations ^3.0.4
@graphql-codegen/typescript-react-apollo ^3.3.7
@types/jest ^29.5.10
@types/node ^18.18.12
babel-plugin-graphql-tag ^3.3.0
eslint ^8.54.0
jest ^29.7.0
jest-mock-extended ^3.0.5
react ^18.2.0
react-dom ^18.2.0
ts-jest ^29.1.1
typescript 5.2.2
@apollo/client ^3.9.5
@faker-js/faker ^7.6.0
jest-mock-extended ^3.0.5
react ^18.2.0
packages/blockchain-bindings/package.json
@ethersproject/abi ^5.7.0
@ethersproject/contracts ^5.7.0
@ethersproject/providers ^5.7.2
@ethersproject/units ^5.7.0
ethers ^5.7.2
tslib ^2.6.2
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-typescript ^7.23.3
@types/jest ^29.5.10
eslint ^8.54.0
jest ^29.7.0
ts-jest ^29.1.1
typechain ^8.3.2
typescript 5.2.2
packages/cli/package.json
@commander-js/extra-typings ^12.0.1
@ethersproject/address ^5.7.0
chalk ^5.3.0
commander ^12.0.0
nanospinner ^1.1.0
tslib ^2.6.2
@types/node ^18.19.31
eslint ^8.57.0
prettier ^3.2.5
ts-node ^10.9.2
tsup ^8.0.2
typescript 5.2.2
node >=18 <21
packages/client/package.json
@ethersproject/abi ^5.7.0
@ethersproject/abstract-signer ^5.7.0
@ethersproject/address ^5.7.0
@ethersproject/bignumber ^5.7.0
@ethersproject/contracts ^5.7.0
@ethersproject/hash ^5.7.0
@ethersproject/providers ^5.7.2
@ethersproject/wallet ^5.7.0
graphql ^16.8.1
graphql-request ^6.1.0
graphql-tag ^2.12.6
jwt-decode ^3.1.2
tslib ^2.6.2
zod ^3.22.4
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-typescript ^7.23.3
@bundlr-network/client ^0.11.17
@faker-js/faker ^7.6.0
@graphql-codegen/add ^5.0.0
@graphql-codegen/cli ^5.0.0
@graphql-codegen/near-operation-file-preset ^2.5.0
@graphql-codegen/typescript ^4.0.1
@graphql-codegen/typescript-graphql-request ^5.0.0
@graphql-codegen/typescript-operations ^4.0.1
@lens-protocol/metadata ^1.1.6
@types/jest ^29.5.10
@types/node ^18.18.12
dotenv ^16.3.1
eslint ^8.54.0
jest ^29.7.0
prettier ^3.1.0
ts-jest ^29.1.1
typescript 5.2.2
@lens-protocol/metadata ^1.0.0
node >=18 <21
packages/domain/package.json
tslib ^2.6.2
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-typescript ^7.23.3
@faker-js/faker ^7.6.0
@jest/globals ^29.7.0
@types/jest ^29.5.10
@types/jest-when ^3.5.5
eslint ^8.54.0
jest ^29.7.0
jest-mock-extended ^3.0.5
jest-when ^3.6.0
prettier ^2.8.8
ts-jest ^29.1.1
typescript 5.2.2
wait-for-expect ^3.0.2
@faker-js/faker ^7.6.0
@jest/globals ^29.7.0
jest-mock-extended ^3.0.5
jest-when ^3.6.0
wait-for-expect ^3.0.2
packages/eslint-config/package.json
@typescript-eslint/eslint-plugin ^6.12.0
@typescript-eslint/parser ^6.12.0
eslint-config-prettier ^8.10.0
eslint-plugin-import 2.26.0
eslint-plugin-tsdoc ^0.2.17
eslint ^8.54.0
prettier ^2.8.8
typescript 5.2.2
eslint ^8.54.0
packages/gated-content/package.json
@lit-protocol/constants 2.1.62
@lit-protocol/crypto 2.1.62
@lit-protocol/encryption 2.1.62
@lit-protocol/node-client ^2.1.62
@lit-protocol/types 2.1.62
siwe ^2.1.4
tslib ^2.6.2
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-typescript ^7.23.3
@ethersproject/abi ^5.7.0
@ethersproject/address ^5.7.0
@ethersproject/bignumber ^5.7.0
@ethersproject/contracts ^5.7.0
@ethersproject/hash ^5.7.0
@ethersproject/providers ^5.7.2
@ethersproject/wallet ^5.7.0
@faker-js/faker ^7.6.0
@graphql-codegen/cli ^3.3.1
@graphql-codegen/typescript ^3.0.4
@jest/globals ^29.7.0
@lens-protocol/metadata ^1.1.6
@types/jest ^29.5.10
@types/jest-when ^3.5.5
@types/node ^18.18.12
eslint ^8.54.0
ethers ^5.7.2
graphql ^16.8.1
jest ^29.7.0
jest-mock-extended ^3.0.5
jest-when ^3.6.0
prettier ^2.8.8
ts-jest ^29.1.1
typescript 5.2.2
wait-for-expect ^3.0.2
zod ^3.22.4
@ethersproject/abi ^5.7.0
@ethersproject/address ^5.7.0
@ethersproject/bignumber ^5.7.0
@ethersproject/contracts ^5.7.0
@ethersproject/hash ^5.7.0
@ethersproject/providers ^5.7.2
@ethersproject/wallet ^5.7.0
@lens-protocol/metadata ^1.0.0
zod ^3.22.0
packages/prettier-config/package.json
prettier ^2.8.8
prettier ^2.8.8
packages/react-native/package.json
tslib ^2.6.2
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-react ^7.23.3
@babel/preset-typescript ^7.23.3
@types/jest ^29.5.10
@types/jest-when ^3.5.5
@types/react ^18.2.38
eslint ^8.54.0
eslint-plugin-react ^7.33.2
eslint-plugin-react-hooks ^4.6.0
jest ^29.7.0
jest-environment-jsdom ^29.7.0
jest-mock-extended ^3.0.5
jest-when ^3.6.0
prettier ^2.8.8
react ~18.2.0
react-native ~0.72.7
react-native-mmkv ~2.11.0
ts-jest ^29.1.1
typescript 5.2.2
@types/react ^18.0.0
react ~18.2.0
react-native ~0.72.7
react-native-mmkv ~2.11.0
packages/react-web/package.json
tslib ^2.6.2
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-react ^7.23.3
@babel/preset-typescript ^7.23.3
@testing-library/react ^13.4.0
@types/jest ^29.5.10
@types/jest-when ^3.5.5
@types/react ^18.2.38
eslint ^8.54.0
eslint-plugin-react ^7.33.2
eslint-plugin-react-hooks ^4.6.0
@xmtp/react-sdk ^3.0.0
jest ^29.7.0
jest-environment-jsdom ^29.7.0
jest-mock-extended ^3.0.5
jest-when ^3.6.0
prettier ^2.8.8
react ^18.2.0
react-dom ^18.2.0
ts-jest ^29.1.1
typescript 5.2.2
@types/react ^18.0.0
@xmtp/react-sdk ^3.0.0
react ^18.2.0
packages/react/package.json
@apollo/client ^3.9.5
@ethersproject/abstract-signer ^5.7.0
@ethersproject/address ^5.7.0
@ethersproject/bignumber ^5.7.0
@ethersproject/bytes ^5.7.0
@ethersproject/constants ^5.7.0
@ethersproject/contracts ^5.7.0
@ethersproject/hash ^5.7.0
@ethersproject/logger ^5.7.0
@ethersproject/providers ^5.7.2
@ethersproject/wallet ^5.7.0
@lens-protocol/metadata ^1.1.6
eth-rpc-errors ^4.0.3
graphql ^16.8.1
jwt-decode ^3.1.2
lodash ^4.17.21
tslib ^2.6.2
uuid ^9.0.1
zod ^3.22.4
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-react ^7.23.3
@babel/preset-typescript ^7.23.3
@ensdomains/ens 0.4.4
@ensdomains/resolver 0.2.4
@ethersproject/abi ^5.7.0
@faker-js/faker ^7.6.0
@testing-library/react ^13.4.0
@types/jest ^29.5.10
@types/jest-when ^3.5.5
@types/lodash ^4.14.202
@types/react ^18.2.38
@types/uuid ^9.0.7
eslint ^8.54.0
eslint-plugin-react ^7.33.2
eslint-plugin-react-hooks ^4.6.0
ethereum-waffle ^4.0.10
ethers ^5.7.2
ganache 7.7.4
jest ^29.7.0
jest-environment-jsdom ^29.7.0
jest-mock-extended ^3.0.5
jest-when ^3.6.0
prettier ^2.8.8
react ^18.2.0
react-dom ^18.2.0
ts-jest ^29.1.1
typescript 5.2.2
@types/react ^18.0.0
react ^18.2.0
packages/shared-kernel/package.json
@ethersproject/address ^5.7.0
decimal.js ^10.4.3
lodash ^4.17.21
traverse ^0.6.7
tslib ^2.6.2
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-typescript ^7.23.3
@types/jest ^29.5.10
@types/lodash ^4.14.202
@types/traverse ^0.6.35
@types/uuid ^9.0.7
eslint ^8.54.0
jest ^29.7.0
prettier ^2.8.8
ts-jest ^29.1.1
typescript 5.2.2
packages/storage/package.json
tslib ^2.6.2
zod ^3.22.4
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-typescript ^7.23.3
@types/jest ^29.5.10
@types/node ^18.18.12
eslint ^8.54.0
jest ^29.7.0
prettier ^2.8.8
ts-jest ^29.1.1
typescript 5.2.2
packages/tsconfig/package.json
tslib ^2.6.2
typescript 5.2.2
packages/wagmi/package.json
@ethersproject/providers ^5.7.2
@babel/core ^7.23.3
@babel/preset-env ^7.23.3
@babel/preset-typescript ^7.23.3
@tanstack/react-query ^5.18.1
@types/node ^18.18.12
@types/react ^18.2.38
prettier ^2.8.8
react ^18.2.0
react-dom ^18.2.0
typescript 5.2.2
viem ^2.9.16
wagmi ^2.5.19
@tanstack/react-query >=5.0.0
viem 2.x
wagmi ^2.5.19
.nvmrc
node 18.17.1
Describe the bug
I have an observerdId in my UseProfile hook like this:
const { data, loading, error } = useProfile({
handle: handle as string,
observerId: currentClubProfileId?._hex as ProfileId,
})
Expected result is that it should give me the data back from the profiled in my observerId. But it doesn't.
To Reproduce
Follow a profile on lenster, useProfile for that profile and insert your profileId as observer and see if isFollwedByMe returns true. cause for me it doesnt.
Expected behaviuor
It should reflect the data from the observerProfile
Version of the packages you are using
"@lens-protocol/react-web": "^1.0.1",
"@lens-protocol/wagmi": "^1.0.1",
Additional context
Here is a link to a demo of the issue:
https://drive.google.com/file/d/1GPH4hBF7Ckvu__6xeOJUVeTjhOIghqpc/view?usp=sharing
Could we include Global Protocol Stats as a hook? This would be beneficial for numerous statistics applications to access Lens protocol statistics.
Originally posted by @daoleno in https://github.com/lens-protocol/lens-sdk/discussions/48#discussioncomment-5276927
Describe the bug
unFollow hook returns two types errors:
{"data":{"result":{"__typename":"RelayError","reason":"NOT_ALLOWED"}}}
OR
{"data":{"result":{"id":"d7f1958c-a283-4bc2-8415-932d07757198","expiresAt":"2023-07-19T06:07:35.000Z","typedData":{"types":{"BurnWithSig":[{"name":"tokenId","type":"uint256","__typename":"EIP712TypedDataField"},{"name":"nonce","type":"uint256","__typename":"EIP712TypedDataField"},{"name":"deadline","type":"uint256","__typename":"EIP712TypedDataField"}],"__typename":"CreateBurnEIP712TypedDataTypes"},"domain":{"__typename":"EIP712TypedDataDomain","name":"shefi.lens-Follower","chainId":137,"version":"1","verifyingContract":"0x993c359316A1E293F6A7d54a62A183C6034A8cF3"},"message":{"nonce":0,"deadline":1689746855,"tokenId":"0x1568","__typename":"CreateBurnEIP712TypedDataValue"},"__typename":"CreateBurnEIP712TypedData"},"__typename":"CreateUnfollowBroadcastItemResult"}}}
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
1.2.1
Describe the bug
I am getting "Error: Module not found: Can't resolve '@lens-protocol/metadata'"
When I upgrade from lens client 1.3.1 to 2.0.0-alpha.19 I am getting the above error. It seems to be happening even when downgraded all the way to alpha.7
To Reproduce
Install the above packages and try to run it
Expected behavior
That the app runs as expected without the mentioned error
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/client": "^2.0.0-alpha.19",
"@lens-protocol/react": "2.0.0-alpha.18",
"@lens-protocol/react-web": "^2.0.0-alpha.7",
"@lens-protocol/wagmi": "^3.0.0-alpha.15",
"next": "^13.4.0",
Describe the bug
Comments returned from useFeed
(feed
api endpoint) don't contain the commentOn
property because it's not needed in that context. However, due to the caching in the SDK, subsequent calls to usePublication
for one of those comments will return the local cached Comment that doesn't include commentOn
so the comment cannot be displayed properly.
To Reproduce
You can reproduce this on Buttrfly Web. Once you sign in, go to your home feed. You'll see some comments displayed with their parent post, but if you press on a comment to go to the full post screen, the comment will not show the post it was in response to (because of the missing commentOn
property). If you do a full refresh on that page, then you'll see the comment and it's parent post displayed properly.
Expected behaviuor
I expect calling usePublication
on a comment to always return a comment with a commentOn
property.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
1.2.2
Describe the bug
It's not currently possible to set name
in metadata when posting. This is required for normal posts, not just collected NFTs.
name
is a standard property commonly used by most popular lens apps to set the name or title of a post:
react-web 1.3.0-next
Describe the bug
Hi, Sometime, i am getting error from useCreateComment hook.
Error: BroadcastingError: broadcasting failed with reason: NOT_ALLOWED
Request:
{"operationName":"CreateCommentTypedData","variables":{"request":{"contentURI":"https://arweave.net/5i4txx46U0FqKpRVcCN6IrFvrdrv818EuoamVPXXIRI","profileId":"0x016efc","publicationId":"0xf6b0-0x017d","collectModule":{"revertCollectModule":true}}},"query":"mutation CreateCommentTypedData($request: CreatePublicCommentRequest!, $options: TypedDataOptions) {\n result: createCommentTypedData(request: $request, options: $options) {\n id\n expiresAt\n typedData {\n ...CreateCommentEIP712TypedData\n __typename\n }\n __typename\n }\n}\n\nfragment CreateCommentEIP712TypedData on CreateCommentEIP712TypedData {\n types {\n CommentWithSig {\n name\n type\n __typename\n }\n __typename\n }\n domain {\n ...EIP712TypedDataDomain\n __typename\n }\n message: value {\n nonce\n deadline\n profileId\n contentURI\n profileIdPointed\n pubIdPointed\n collectModule\n collectModuleInitData\n referenceModuleData\n referenceModule\n referenceModuleInitData\n __typename\n }\n __typename\n}\n\nfragment EIP712TypedDataDomain on EIP712TypedDataDomain {\n __typename\n name\n chainId\n version\n verifyingContract\n}"}
Response:
{"data":{"result":{"id":"626145e0-99e0-4aac-a755-5418c32545a6","expiresAt":"2023-07-31T07:13:54.000Z","typedData":{"types":{"CommentWithSig":[{"name":"profileId","type":"uint256","__typename":"EIP712TypedDataField"},{"name":"contentURI","type":"string","__typename":"EIP712TypedDataField"},{"name":"profileIdPointed","type":"uint256","__typename":"EIP712TypedDataField"},{"name":"pubIdPointed","type":"uint256","__typename":"EIP712TypedDataField"},{"name":"referenceModuleData","type":"bytes","__typename":"EIP712TypedDataField"},{"name":"collectModule","type":"address","__typename":"EIP712TypedDataField"},{"name":"collectModuleInitData","type":"bytes","__typename":"EIP712TypedDataField"},{"name":"referenceModule","type":"address","__typename":"EIP712TypedDataField"},{"name":"referenceModuleInitData","type":"bytes","__typename":"EIP712TypedDataField"},{"name":"nonce","type":"uint256","__typename":"EIP712TypedDataField"},{"name":"deadline","type":"uint256","__typename":"EIP712TypedDataField"}],"__typename":"CreateCommentEIP712TypedDataTypes"},"domain":{"__typename":"EIP712TypedDataDomain","name":"Lens Protocol Profiles","chainId":137,"version":"1","verifyingContract":"0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d"},"message":{"nonce":45,"deadline":1690787634,"profileId":"0x016efc","contentURI":"https://arweave.net/5i4txx46U0FqKpRVcCN6IrFvrdrv818EuoamVPXXIRI","profileIdPointed":"0xf6b0","pubIdPointed":"0x017d","collectModule":"0xa31FF85E840ED117E172BC9Ad89E55128A999205","collectModuleInitData":"0x","referenceModuleData":"0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000","referenceModule":"0x0000000000000000000000000000000000000000","referenceModuleInitData":"0x","__typename":"CreateCommentEIP712TypedDataValue"},"__typename":"CreateCommentEIP712TypedData"},"__typename":"CreateCommentBroadcastItemResult"}}}
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/client": "^1.2.0",
"@lens-protocol/react-web": "^1.2.2",
"@lens-protocol/wagmi": "^2.0.1"
Describe the bug
Hello, I'm using the V1 version of the Lens Protocol SDK for my React Native project. However, at some point, I noticed that all my data requests seem to be stuck within a fixed time range. Regardless of how I make requests, I'm unable to fetch real-time on-chain data. This is causing me some distress. Could you please help me investigate what might be the issue? The SDK version I'm currently using is "@lens-protocol/react": "^1.3.1".
———The current state lacks a profileId.
———So far, I haven't been fortunate enough to obtain a profile.LOL
To Reproduce
const {
data: publications,
loading,
hasMore,
next,
} = useExplorePublications({
limit: 20,
sortCriteria: PublicationSortCriteria.Latest,
publicationTypes: [PublicationTypes.Post],
});
Expected behaviuor
A clear and concise description of what you expected to happen.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
"@lens-protocol/react": "^1.3.1".
Additional context
Describe the bug
Hi,
I am trying to fetch publications based on multiple profileIds, But I checked in the usePublications() hook doesn't have a request parameter for profileIds.
If using the React bindings, what is the essence of your React app?
Version of the packages you are using
1.2.2
Additional context
Please check in Lens API documentation
https://docs.lens.xyz/docs/get-publications
type PublicationsQueryRequest = {
/** The ethereum address */
collectedBy?: InputMaybe<Scalars['EthereumAddress']>;
/** The publication id you wish to get comments for */
commentsOf?: InputMaybe<Scalars['InternalPublicationId']>;
/** The comment ordering type - only used when you use commentsOf */
commentsOfOrdering?: InputMaybe<CommentOrderingTypes>;
/** The comment ranking filter, you can use - only used when you use commentsOf + commentsOfOrdering=ranking */
commentsRankingFilter?: InputMaybe<CommentRankingFilter>;
cursor?: InputMaybe<Scalars['Cursor']>;
customFilters?: InputMaybe<Array<CustomFiltersTypes>>;
limit?: InputMaybe<Scalars['LimitScalar']>;
metadata?: InputMaybe<PublicationMetadataFilters>;
/** Profile id */
profileId?: InputMaybe<Scalars['ProfileId']>;
/** Profile ids */
profileIds?: InputMaybe<Array<Scalars['ProfileId']>>;
/** The publication id */
publicationIds?: InputMaybe<Array<Scalars['InternalPublicationId']>>;
/** The publication types you want to query */
publicationTypes?: InputMaybe<Array<PublicationTypes>>;
/** The App Id */
sources?: InputMaybe<Array<Scalars['Sources']>>;
};
Describe the bug
When collecting this post 0x28-0x06 with multirecipientCollectOpenActionSettings from lens v2 developer preview the following error returns:
{ "errors": [ { "message": "Variable \"$request\" got invalid value { multirecipientCollectOpenAction: true } at \"request.actOn\"; Field \"multirecipientCollectOpenAction\" is not defined by type \"ActOnOpenActionLensManagerInput\". Did you mean \"simpleCollectOpenAction\"?", "locations": [ { "line": 1, "column": 26 } ], "extensions": { "code": "BAD_USER_INPUT", "exception": { "stacktrace": [ "GraphQLError: Variable \"$request\" got invalid value { multirecipientCollectOpenAction: true } at \"request.actOn\"; Field \"multirecipientCollectOpenAction\" is not defined by type \"ActOnOpenActionLensManagerInput\". Did you mean \"simpleCollectOpenAction\"?", " at /usr/src/app/node_modules/graphql/execution/values.js:116:15", " at coerceInputValueImpl (/usr/src/app/node_modules/graphql/utilities/coerceInputValue.js:114:9)", " at coerceInputValueImpl (/usr/src/app/node_modules/graphql/utilities/coerceInputValue.js:54:14)", " at coerceInputValueImpl (/usr/src/app/node_modules/graphql/utilities/coerceInputValue.js:105:34)", " at coerceInputValueImpl (/usr/src/app/node_modules/graphql/utilities/coerceInputValue.js:54:14)", " at coerceInputValue (/usr/src/app/node_modules/graphql/utilities/coerceInputValue.js:37:10)", " at _loop (/usr/src/app/node_modules/graphql/execution/values.js:109:69)", " at coerceVariableValues (/usr/src/app/node_modules/graphql/execution/values.js:121:16)", " at getVariableValues (/usr/src/app/node_modules/graphql/execution/values.js:50:19)", " at buildExecutionContext (/usr/src/app/node_modules/graphql/execution/execute.js:203:61)", " at executeImpl (/usr/src/app/node_modules/graphql/execution/execute.js:101:20)", " at Object.execute (/usr/src/app/node_modules/graphql/execution/execute.js:60:35)", " at /usr/src/app/node_modules/apollo-server-core/dist/requestPipeline.js:261:48", " at Generator.next (<anonymous>)", " at /usr/src/app/node_modules/apollo-server-core/dist/requestPipeline.js:8:71", " at new Promise (<anonymous>)" ] } } } ] }
Using the following query
{ "for": "0x28-0x06", "actOn": { "multirecipientCollectOpenAction": true } }
Using profile 0x28 test/@collectz and 0xdd test/@collector both with profile manager enabled (lensManager = true)
To Reproduce
Happens each time. Allowance has been set.
Expected behavior
That works. No errors expected.
Version of the packages you are using
lensclient V2 alpha 11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.