diff --git a/.changeset/neat-moons-study.md b/.changeset/neat-moons-study.md new file mode 100644 index 0000000000..73fd98e3b2 --- /dev/null +++ b/.changeset/neat-moons-study.md @@ -0,0 +1,8 @@ +--- +"@lens-protocol/react-native": patch +"@lens-protocol/react-web": patch +"@lens-protocol/client": patch +"@lens-protocol/react": patch +--- + +**fix:** TSDoc and better exporting of shared parts diff --git a/assets/docs.css b/assets/docs.css new file mode 100644 index 0000000000..a9b6581d0f --- /dev/null +++ b/assets/docs.css @@ -0,0 +1,9 @@ +@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=SF+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap"); + +:root, +:root[data-theme="light"], +:root[data-theme="dark"] { + --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, + "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol" !important; + --font-mono: "SF Mono", "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, Courier, monospace !important; +} diff --git a/package.json b/package.json index 5717020716..4b0fb81b4c 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,13 @@ }, "devDependencies": { "@changesets/cli": "^2.26.2", - "@mxssfd/typedoc-theme": "^1.1.3", "@preconstruct/cli": "^2.8.1", "prettier": "^2.8.8", "rimraf": "^4.4.1", "turbo": "^1.10.16", - "typedoc": "^0.25.3", + "typedoc": "^0.25.8", + "typedoc-material-theme": "^1.0.2", + "typedoc-plugin-extras": "^3.0.0", "typescript": "5.2.2" }, "resolutions": { diff --git a/packages/client/README.md b/packages/client/README.md index 54d7159d66..dd39735823 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -1,5 +1,53 @@ -# `@lens-protocol/client` +# Lens JavaScript SDK -The official framework-agnostic Lens API Client. +The official framework-agnostic JavaScript SDK for Lens Protocol. + +--- This package enables you to interact with the Lens API via a type safe interface that abstracts away some of the GraphQL intricacies. + +## Documentation + +- [GitHub monorepo](https://github.com/lens-protocol/lens-sdk) +- [Getting Started](https://docs.lens.xyz/docs/lensclient-sdk-1) +- [Reference](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_client.html) + +## Quick start + +Install the Lens React Native SDK package using your package manager of choice: + +| Package Manager | Command | +| :-------------: | :----------------------------------------- | +| npm | `npm install @lens-protocol/client@latest` | +| yarn | `yarn add @lens-protocol/client@latest` | +| pnpm | `pnpm add @lens-protocol/client@latest` | + +Development configuration example: + +```ts +import { LensClient, development } from '@lens-protocol/client'; + +const client = new LensClient({ + environment: development, +}); +``` + +Production configuration example: + +```ts +import { LensClient, production } from '@lens-protocol/client'; + +const client = new LensClient({ + environment: production, +}); +``` + +In a browser-based implementation you can use the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) to persist authentication state. + +```ts +const client = new LensClient({ + environment: production, + + storage: window.localStorage, +}); +``` diff --git a/packages/client/package.json b/packages/client/package.json index 443b3b1aff..3a9ca7c20a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -115,5 +115,10 @@ }, "peerDependencies": { "@lens-protocol/metadata": "^1.0.0" + }, + "peerDependenciesMeta": { + "@lens-protocol/metadata": { + "optional": true + } } } diff --git a/packages/client/src/LensClient.ts b/packages/client/src/LensClient.ts index dbe8e23e78..547a651a25 100644 --- a/packages/client/src/LensClient.ts +++ b/packages/client/src/LensClient.ts @@ -24,6 +24,8 @@ import { /** * LensClient configuration + * + * @group LensClient */ export type LensClientConfig = { /** diff --git a/packages/client/src/gated/LensClient.ts b/packages/client/src/gated/LensClient.ts index 1b353b04df..dacc167d19 100644 --- a/packages/client/src/gated/LensClient.ts +++ b/packages/client/src/gated/LensClient.ts @@ -10,6 +10,11 @@ import { InMemoryStorageProvider } from '@lens-protocol/storage'; import * as core from '../LensClient'; import { Gated } from './Gated'; +/** + * The configuration for the LensClient + * + * @group LensClient + */ export type LensClientConfig = core.LensClientConfig & { /** * The authentication configuration to use for authenticating with the Lit Protocol network. @@ -73,6 +78,8 @@ export type LensClientConfig = core.LensClientConfig & { * signer: await provider.getSigner(), * }); * ``` + * + * @group LensClient */ export class LensClient extends core.LensClient { private _gated: Gated; diff --git a/packages/client/src/gated/index.ts b/packages/client/src/gated/index.ts index bed60767cd..65d7bcdd89 100644 --- a/packages/client/src/gated/index.ts +++ b/packages/client/src/gated/index.ts @@ -12,18 +12,18 @@ * * ## Quick start * - * Install: + * Install the required peer dependencies. * * ```bash - * npm install zod @lens-protocol/metadata@latest @lens-protocol/client@alpha + * npm install zod @lens-protocol/metadata@latest * * # OR * - * yarn add zod @lens-protocol/metadata@latest @lens-protocol/client@alpha + * yarn add zod @lens-protocol/metadata@latest * * # OR * - * pnpm add zod @lens-protocol/metadata@latest @lens-protocol/client@alpha + * pnpm add zod @lens-protocol/metadata@latest * ``` * * Typical NodeJS setup: @@ -190,19 +190,19 @@ * * @module Gated */ -import { LensClientConfig, LensClient } from './LensClient'; +import { LensClient, LensClientConfig } from './LensClient'; export * from '../index'; export * from './Gated'; // NOTE: local exports takes priority over package exports, basically overriding the LensClient and // see https://github.com/systemjs/systemjs/issues/1031#issuecomment-171262430 -export type { LensClientConfig }; export { LensClient }; +export type { LensClientConfig }; export { isEncryptedPublicationMetadata } from '@lens-protocol/gated-content'; export type { AuthenticationConfig, - ISigner, IEncryptionProvider, + ISigner, } from '@lens-protocol/gated-content'; diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 7994150ce6..06016b6328 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -1,42 +1,16 @@ /** - * @module Core - * - * @example - * Development example: - * ```ts - * import { LensClient, development } from '@lens-protocol/client'; - * - * const client = new LensClient({ - * environment: development - * }); - * ``` - * - * @example - * Production example: - * ```ts - * import { LensClient, production } from '@lens-protocol/client'; + * The primary entry point of the `@lens-protocol/client` package. * - * const client = new LensClient({ - * environment: production - * }); - * ``` + * See {@link Gated} for token-gated support. * - * @example - * Use [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) to persist authentication state: - * ```ts - * const client = new LensClient({ - * environment: production, - * - * storage: window.localStorage, - * }); - * ``` + * @module Core */ export * from './LensClient'; +export * from './authentication'; export * from './environments'; export * from './errors'; export * from './graphql'; -export * from './authentication'; export * from './submodules'; // types @@ -54,6 +28,6 @@ export type { Success, } from '@lens-protocol/shared-kernel'; export type { IStorageProvider, InMemoryStorageProvider } from '@lens-protocol/storage'; +export type { PaginatedQueryData, PaginatedResult } from './helpers/buildPaginatedQueryResult'; +export type { AppId, MediaTransformsConfig, QueryParams } from './queryParams'; export type { TypedData, TypedDataResponse } from './types'; -export type { MediaTransformsConfig, AppId, QueryParams } from './queryParams'; -export type { PaginatedResult, PaginatedQueryData } from './helpers/buildPaginatedQueryResult'; diff --git a/packages/client/typedoc.json b/packages/client/typedoc.json index 962fb71be6..5c6695e80f 100644 --- a/packages/client/typedoc.json +++ b/packages/client/typedoc.json @@ -3,5 +3,6 @@ "extends": ["../../typedoc.base.json"], "entryPoints": ["src/index.ts", "src/gated/index.ts"], "intentionallyNotExported": ["Environment", "Typename", "PickByTypename"], - "groupOrder": ["LensClient", "LensClient Modules", "Variables", "Functions"] + "groupOrder": ["LensClient", "LensClient Modules", "Variables", "Functions"], + "readme": "./README.md" } diff --git a/packages/react-native/README.md b/packages/react-native/README.md index ce67b67ac0..d77d409128 100644 --- a/packages/react-native/README.md +++ b/packages/react-native/README.md @@ -1,11 +1,78 @@ -# `@lens-protocol/react-native` +# Lens React Native SDK The official Lens Protocol React bindings for React Native. +--- + This package enables you to build mobile applications on top of the Lens Protocol using React Native. ## Documentation - [GitHub monorepo](https://github.com/lens-protocol/lens-sdk) -- [Getting Started](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_react_web.html#md:quick-start) -- [SDK Reference](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_react_web.html) +- [Reference](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_react_native.html) + +## Quick start + +Install the Lens React Native SDK package using your package manager of choice: + +| Package Manager | Command | +| :-------------: | :----------------------------------------------- | +| npm | `npm install @lens-protocol/react-native@latest` | +| yarn | `yarn add @lens-protocol/react-native@latest` | +| pnpm | `pnpm add @lens-protocol/react-native@latest` | + +First we need to create so-called bindings. Bindings are just an object implementing the `IBindings` interface. This is used by the Lens SDK to access the Signer and the Provider. + +In this example we will limit ourselves to the bare minimum and we will use the `ethers.js` library to create the bindings. + +```ts +// wallet.ts +import { IBindings } from '@lens-protocol/react-native'; +import { providers, Wallet } from 'ethers'; + +const provider = new providers.InfuraProvider('maticmum'); +const wallet = new Wallet('', provider); + +export const bindings: IBindings = { + getProvider: async () => provider, + getSigner: async () => wallet, +}; +``` + +Create the `LensConfig`. In this example we will use `react-native-mmkk` as underlying storage. You can use any storage you want as long as it implements the `IStorageProvider` interface. + +First install the `react-native-mmkv` package: + +| Package Manager | Command | +| :-------------: | :------------------------------ | +| npm | `npm install react-native-mmkv` | +| yarn | `yarn add react-native-mmkv` | +| pnpm | `pnpm add react-native-mmkv` | + +Create the `LensConfig` object: + +```ts +import { LensConfig, development } from '@lens-protocol/react-web'; +import { storage } from '@lens-protocol/react-web/storage/mmkv'; +import { bindings } from './wallet.ts'; + +const lensConfig: LensConfig = { + bindings, + environment: development, + storage: storage(), +}; +``` + +Wrap your app with the `` and pass the `LensConfig` as a prop. + +```tsx +import { LensProvider } from '@lens-protocol/react-web'; + +function App() { + return ( + + + + ); +} +``` diff --git a/packages/react-native/src/LensProvider.tsx b/packages/react-native/src/LensProvider.tsx new file mode 100644 index 0000000000..68bde72624 --- /dev/null +++ b/packages/react-native/src/LensProvider.tsx @@ -0,0 +1,74 @@ +import { BaseProvider, EnvironmentConfig, IBindings, QueryParams } from '@lens-protocol/react'; +import { ILogger } from '@lens-protocol/shared-kernel'; +import { IObservableStorageProvider, IStorageProvider } from '@lens-protocol/storage'; +import { ReactNode } from 'react'; + +/** + * `` configuration + */ +export type LensConfig = { + /** + * Provides integration with the ethers.js Signer and Provider + */ + bindings: IBindings; + /** + * The environment to use. See {@link production} or {@link development}. + */ + environment: EnvironmentConfig; + /** + * The logger interface to use when something worth logging happens + * + * @defaultValue `ConsoleLogger`, an internal implementation of `ILogger` interface that logs to the console + */ + logger?: ILogger; + /** + * Enable debug mode. Disable gas estimation on self-funded transactions. + * + * @defaultValue `false` + */ + debug?: boolean; + /** + * The storage provider to use. + * + * If a implementation of {@link IObservableStorageProvider} is provided, + * the provider will be used to subscribe to changes in the storage. + */ + storage: IStorageProvider | IObservableStorageProvider; + /** + * The common query params allow you customize some aspect of the returned data. + */ + params?: QueryParams; + /** + * The value of the `Origin` HTTP header to use when making requests to the Lens API. + * + * @example + * ```md + * https://example.xyz + * ``` + * + * @defaultValue if not provided, the requests will be made without the `Origin` header. + */ + origin?: string; +}; + +/** + * props + */ +export type LensProviderProps = { + /** + * The children to render + */ + children: ReactNode; + /** + * The configuration for the Lens SDK + */ + config: LensConfig; +}; + +/** + * Manages the lifecycle and internal state of the Lens SDK + * + * @group Components + * @param props - {@link LensProviderProps} + */ +export const LensProvider = BaseProvider; diff --git a/packages/react-native/src/index.ts b/packages/react-native/src/index.ts index 4cd630e034..0c1b5b3141 100644 --- a/packages/react-native/src/index.ts +++ b/packages/react-native/src/index.ts @@ -1,79 +1,11 @@ /** - * ## Quick start + * The primary entry point of the `@lens-protocol/react-native` package. * - * Install: + * See {@link Storage} for built-in storage options. * - * | Package Manager | Command | - * |:---------------:|:------- | - * | npm | `npm install @lens-protocol/react-native@latest` | - * | yarn | `yarn add @lens-protocol/react-native@latest` | - * | pnpm | `pnpm add @lens-protocol/react-native@latest` | - * - * First we need to create so-called bindings. Bindings are just an object implementing the {@link IBindings} interface. This is used by the Lens SDK to access the Signer and the Provider. - * - * In this example we will limit ourselves to the bare minimum and we will use the `ethers.js` library to create the bindings. - * - * ```ts - * // wallet.ts - * import { IBindings } from '@lens-protocol/react-native'; - * import { providers, Wallet } from 'ethers'; - * - * const provider = new providers.InfuraProvider('maticmum'); - * const wallet = new Wallet('', provider); - * - * export function bindings(): IBindings { - * return { - * getProvider: async () => provider, - * getSigner: async () => wallet, - * }; - * } - * ``` - * - * Create the {@link LensConfig}. In this example we will use `react-native-mmkk` as underlying storage. You can use any storage you want as long as it implements the {@link IStorageProvider} interface. - * - * First install the `react-native-mmkv` package: - * - * | Package Manager | Command | - * |:---------------:|:------- | - * | npm | `npm install react-native-mmkv` | - * | yarn | `yarn add react-native-mmkv` | - * | pnpm | `pnpm add react-native-mmkv` | - * - * Create the `LensConfig` object: - * - * ```ts - * import { LensConfig, development } from '@lens-protocol/react-web'; - * import { storage } from '@lens-protocol/react-web/storage/mmkv'; - * import { bindings } from './wallet.ts'; - * - * const lensConfig: LensConfig = { - * bindings: bindings(), - * environment: development, - * storage: storage(), - * }; - * ``` - * - * Wrap your app with the {@link LensProvider | ``} and pass the `LensConfig` as a prop. - * - * ```tsx - * import { LensProvider } from '@lens-protocol/react-web'; - * - * function App() { - * return ( - * - * - * - * ); - * } - * ``` - * - * @module + * @module Core */ export * from '@lens-protocol/react'; -// NOTE: local exports takes priority over package exports, basically overriding the hooks with same names from @lens-protocol/react -// see https://github.com/systemjs/systemjs/issues/1031#issuecomment-171262430 - -// Shadows the types from @lens-protocol/react so that they cannot be used nor surfaced in reference docs for @lens-protocol/react-web -export type EncryptionConfig = never; +export * from './LensProvider'; diff --git a/packages/react-native/src/storage/index.ts b/packages/react-native/src/storage/index.ts new file mode 100644 index 0000000000..b221e2beaf --- /dev/null +++ b/packages/react-native/src/storage/index.ts @@ -0,0 +1,6 @@ +/** + * The secondary `/storage` entrypoint provides a set of storage options for use with the Lens React Native SDK. + * + * @module Storage + */ +export * as mmkv from './mmkv'; diff --git a/packages/react-native/typedoc.json b/packages/react-native/typedoc.json index bf79e1a80a..1b87fd276f 100644 --- a/packages/react-native/typedoc.json +++ b/packages/react-native/typedoc.json @@ -1,8 +1,8 @@ { "tsconfig": "./tsconfig.json", "extends": ["../../typedoc.base.json"], - "entryPoints": ["src/index.ts"], - "readme": "none", + "entryPoints": ["src/index.ts", "src/storage/index.ts"], + "readme": "./README.md", "categorizeByGroup": true, "groupOrder": [ "Hooks", diff --git a/packages/react-web/README.md b/packages/react-web/README.md index 532ce2dcd6..e646d9d0cd 100644 --- a/packages/react-web/README.md +++ b/packages/react-web/README.md @@ -1,14 +1,103 @@ -# `@lens-protocol/react-web` +# Lens React Web SDK The official Lens Protocol React bindings for web applications. +--- + This package enables you to build web applications on top of the Lens Protocol using React. ## Documentation - [GitHub monorepo](https://github.com/lens-protocol/lens-sdk) -- [Getting Started](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_react_web.html#md:quick-start) -- [SDK Reference](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_react_web.html) +- [Getting Started](https://docs.lens.xyz/docs/react-hooks-sdk-v2) +- [Reference](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_react_web.html) + +## Quick start + +Install the Lens React Web SDK package using your package manager of choice: + +| Package Manager | Command | +| :-------------: | :-------------------------------------------- | +| npm | `npm install @lens-protocol/react-web@latest` | +| yarn | `yarn add @lens-protocol/react-web@latest` | +| pnpm | `pnpm add @lens-protocol/react-web@latest` | + +In the following examples we will show you integration with Wagmi and we will explain later how to integrate other libraries via custom bindings. + +Install the Lens Wagmi bindings package and its peer dependencies. + +| Package Manager | Command | +| :-------------: | :----------------------------------------------------------------------------------- | +| npm | `npm install viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` | +| yarn | `yarn add viem@2 viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` | +| pnpm | `pnpm add viem@2 viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` | + +Follow the [Wagmi documentation](https://wagmi.sh/react/getting-started#create-config) to create the Wagmi configuration. + +```ts +import { createConfig, http } from 'wagmi'; +import { polygon } from 'wagmi/chains'; + +const wagmiConfig = createConfig({ + chains: [polygon], + transports: { + [polygon.id]: http(), + }, +}); +``` + +Next, use this configuration with the `bindings` from the `@lens-protocol/wagmi` package to generate the [LensConfig](https://lens-protocol.github.io/lens-sdk/types/_lens_protocol_react_web.index.LensConfig.html) object. + +```ts +import { LensConfig, production } from '@lens-protocol/react-web'; +import { bindings } from '@lens-protocol/wagmi'; + +const lensConfig: LensConfig = { + environment: production, + bindings: bindings(wagmiConfig), +}; +``` + +Now, wrap your app with the `` component and pass the `LensConfig` object you created earlier. + +```tsx +import { LensProvider } from '@lens-protocol/react-web'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { WagmiProvider } from 'wagmi'; + +const queryClient = new QueryClient(); + +function App() { + return ( + + + + + + + + ); +} +``` + +### Custom bindings + +You can create custom bindings for your own `Signer` and `Provider` by implementing the {@link IBindings} interface. + +An example of how to create custom bindings for a `Wallet` from `ethers.js` + +```ts +import { InfuraProvider, Wallet } from 'ethers'; +import { IBindings } from '@lens-protocol/react-web'; + +const provider = new providers.InfuraProvider('maticmum'); +const wallet = new Wallet('', provider); + +const bindings: IBindings = { + getProvider: () => provider, + getSigner: () => wallet, +}; +``` ## Troubleshooting diff --git a/packages/react-web/src/LensProvider.tsx b/packages/react-web/src/LensProvider.tsx index d76a2d3bae..5f782eb0b9 100644 --- a/packages/react-web/src/LensProvider.tsx +++ b/packages/react-web/src/LensProvider.tsx @@ -1,10 +1,5 @@ -import { - EnvironmentConfig, - IBindings, - LensProvider as LensProviderBase, - QueryParams, -} from '@lens-protocol/react'; -import type { LensConfig as LensConfigBase } from '@lens-protocol/react'; +import type { BaseConfig } from '@lens-protocol/react'; +import { BaseProvider, EnvironmentConfig, IBindings, QueryParams } from '@lens-protocol/react'; import { ILogger } from '@lens-protocol/shared-kernel'; import { IObservableStorageProvider, IStorageProvider } from '@lens-protocol/storage'; import { ReactNode, useState } from 'react'; @@ -46,8 +41,6 @@ export type LensConfig = { storage?: IStorageProvider | IObservableStorageProvider; /** * The common query params allow you to customize some aspect of the returned data. - * - * @defaultValue see individual fields of {@link QueryParams} */ params?: QueryParams; }; @@ -94,10 +87,10 @@ const storage = localStorage(); * ``` */ export function LensProvider({ config, ...props }: LensProviderProps) { - const [resolvedConfig] = useState(() => ({ + const [resolvedConfig] = useState(() => ({ ...config, storage: config.storage ?? storage, })); - return ; + return ; } diff --git a/packages/react-web/src/inbox/index.ts b/packages/react-web/src/inbox/index.ts index 2ec5ef3de0..049483ab6d 100644 --- a/packages/react-web/src/inbox/index.ts +++ b/packages/react-web/src/inbox/index.ts @@ -1,7 +1,5 @@ /** - * ## Quick start - * - * This folder provides a set of hooks to help integrate XMTP SDK features with the Lens SDK. + * The secondary `/inbox` entrypoint provides a set of hooks to help integrate XMTP SDK features with the Lens SDK. * The hooks are intended to be used together with hooks provided by `@xmtp/react-sdk` package. * You can find more in their [GitHub repository](https://github.com/xmtp/xmtp-web/tree/main/packages/react-sdk) * diff --git a/packages/react-web/src/index.ts b/packages/react-web/src/index.ts index c0461882d4..939a7bf984 100644 --- a/packages/react-web/src/index.ts +++ b/packages/react-web/src/index.ts @@ -1,105 +1,13 @@ /** - * ## Quick start + * The primary entry point of the `@lens-protocol/react-web` package. * - * Install the Lens React Web SDK package. - * - * | Package Manager | Command | - * |:---------------:|:------- | - * | npm | `npm install @lens-protocol/react-web@latest` | - * | yarn | `yarn add @lens-protocol/react-web@latest` | - * | pnpm | `pnpm add @lens-protocol/react-web@latest` | - * - * In the following examples we will show you integration with Wagmi and we will explain later how to integrate other libraries via custom bindings. - * - * Install the Lens Wagmi bindings package and its peer dependencies. - * - * | Package Manager | Command | - * |:---------------:|:------- | - * | npm | `npm install viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` | - * | yarn | `yarn add viem@2 viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` | - * | pnpm | `pnpm add viem@2 viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` | - * - * Follow the [Wagmi documentation](https://wagmi.sh/react/getting-started#create-config) to create the Wagmi configuration. - * - * ```ts - * import { createConfig, http } from "wagmi"; - * import { polygon } from "wagmi/chains"; - * - * const wagmiConfig = createConfig({ - * chains: [polygon], - * transports: { - * [polygon.id]: http(), - * }, - * }); - * ``` - * - * Next, use this configuration with the `bindings` from the `@lens-protocol/wagmi` package to generate the [LensConfig](https://lens-protocol.github.io/lens-sdk/types/_lens_protocol_react_web.index.LensConfig.html) object. - * - * - * ```ts - * import { LensConfig, production } from "@lens-protocol/react-web"; - * import { bindings } from "@lens-protocol/wagmi"; - * - * const lensConfig: LensConfig = { - * environment: production, - * bindings: bindings(wagmiConfig), - * }; - * ``` - * - * Now, wrap your app with the `` component and pass the `LensConfig` object you created earlier. - * - * ```tsx - * import { LensProvider } from '@lens-protocol/react-web'; - * import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; - * import { WagmiProvider } from "wagmi"; - * - * const queryClient = new QueryClient(); - * - * function App() { - * return ( - * - * - * - * - * - * - * - * ); - * } - * ``` - * - * ### Custom bindings - * - * You can create custom bindings for your own `Signer` and `Provider` by implementing the {@link IBindings} interface. - * - * @example - * An example of how to create custom bindings for a `Wallet` from `ethers.js` - * ```ts - * import { InfuraProvider, Wallet } from 'ethers'; - * import { IBindings } from '@lens-protocol/react-web'; - * - * const provider = new providers.InfuraProvider('maticmum'); - * const wallet = new Wallet('', provider); - * - * const bindings: IBindings = { - * getProvider: () => provider, - * getSigner: () => wallet - * }; - * ``` + * See {@link Inbox} for DMs support. * * @module Core */ 'use client'; -import { LensConfig, LensProvider, LensProviderProps } from './LensProvider'; - export * from '@lens-protocol/react'; -export * from './storage'; - -// NOTE: local exports takes priority over package exports, basically overriding the hooks with same names from @lens-protocol/react -// see https://github.com/systemjs/systemjs/issues/1031#issuecomment-171262430 -export { LensProvider }; -export type { LensConfig, LensProviderProps }; -// Shadows the types from @lens-protocol/react so that they cannot be used nor surfaced in reference docs for @lens-protocol/react-web -export type EncryptionConfig = never; +export * from './LensProvider'; +export * from './storage'; diff --git a/packages/react-web/typedoc.json b/packages/react-web/typedoc.json index ee3e40f200..5d121e9bce 100644 --- a/packages/react-web/typedoc.json +++ b/packages/react-web/typedoc.json @@ -2,7 +2,7 @@ "tsconfig": "./tsconfig.json", "extends": ["../../typedoc.base.json"], "entryPoints": ["src/index.ts", "src/inbox/index.ts"], - "readme": "none", + "readme": "./README.md", "categorizeByGroup": true, "groupOrder": [ "Hooks", diff --git a/packages/react/src/LensProvider.tsx b/packages/react/src/BaseProvider.tsx similarity index 71% rename from packages/react/src/LensProvider.tsx rename to packages/react/src/BaseProvider.tsx index 15a0afa04f..3d1d868342 100644 --- a/packages/react/src/LensProvider.tsx +++ b/packages/react/src/BaseProvider.tsx @@ -1,13 +1,13 @@ import { ReactNode, useState } from 'react'; import { useBootstrapController } from './authentication/adapters/useBootstrapController'; -import { LensConfig } from './config'; +import { BaseConfig } from './config'; import { createSharedDependencies, SharedDependenciesProvider } from './shared'; /** - * props + * props */ -export type LensProviderProps = { +export type BaseProviderProps = { /** * The children to render */ @@ -15,16 +15,18 @@ export type LensProviderProps = { /** * The configuration for the Lens SDK */ - config: LensConfig; + config: TConfig; }; /** * Manages the lifecycle and internal state of the Lens SDK * - * @group Components - * @param props - {@link LensProviderProps} + * @internal */ -export function LensProvider({ children, ...props }: LensProviderProps) { +export function BaseProvider({ + children, + ...props +}: BaseProviderProps) { const [sharedDependencies] = useState(() => createSharedDependencies(props.config)); useBootstrapController(sharedDependencies); diff --git a/packages/react/src/config.ts b/packages/react/src/config.ts index b191b56283..02ac3e282d 100644 --- a/packages/react/src/config.ts +++ b/packages/react/src/config.ts @@ -4,17 +4,17 @@ import { IObservableStorageProvider, IStorageProvider } from '@lens-protocol/sto import { EnvironmentConfig } from './environments'; import { RequiredSigner } from './wallet/adapters/ConcreteWallet'; -import { IProviderBinding, GetProvider } from './wallet/infrastructure/ProviderFactory'; -import { ISignerBinding, GetSigner } from './wallet/infrastructure/SignerFactory'; +import { GetProvider, IProviderBinding } from './wallet/infrastructure/ProviderFactory'; +import { GetSigner, ISignerBinding } from './wallet/infrastructure/SignerFactory'; export type { - QueryParams, - ILogger, GetProvider, GetSigner, - RequiredSigner, + ILogger, IObservableStorageProvider, IStorageProvider, + QueryParams, + RequiredSigner, }; export { SupportedFiatType } from '@lens-protocol/api-bindings'; @@ -22,9 +22,11 @@ export { SupportedFiatType } from '@lens-protocol/api-bindings'; export interface IBindings extends ISignerBinding, IProviderBinding {} /** - * `` configuration + * `` configuration + * + * @internal */ -export type LensConfig = { +export type BaseConfig = { /** * Provides integration with the ethers.js Signer and Provider */ @@ -53,9 +55,7 @@ export type LensConfig = { */ storage: IStorageProvider | IObservableStorageProvider; /** - * The common query params allows you customize some aspect of the returned data. - * - * @defaultValue see individual fields of {@link QueryParams} + * The common query params allow you customize some aspect of the returned data. */ params?: QueryParams; }; diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 5b1afc2245..2d9ef27ada 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -13,7 +13,7 @@ /** * Components */ -export * from './LensProvider'; +export * from './BaseProvider'; /** * Hooks @@ -32,16 +32,16 @@ export * from './wallet'; /** * Domain essentials */ +export type { AppId, NftId, ProfileId, PublicationId } from '@lens-protocol/domain/entities'; export { Amount, - WellKnownSymbols, ChainType, + WellKnownSymbols, + erc20, ether, matic, - erc20, usd, } from '@lens-protocol/shared-kernel'; -export type { EvmAddress, Url } from '@lens-protocol/shared-kernel'; export type { AmountValue, Asset, @@ -54,25 +54,26 @@ export type { Erc20Amount, Erc20Info, Ether, - Kind, - NativeType, + EvmAddress, Failure, Fiat, FiatAmount, IEquatableError, + Kind, Matic, + NativeType, PromiseResult, Result, Success, + Url, } from '@lens-protocol/shared-kernel'; -export type { AppId, NftId, ProfileId, PublicationId } from '@lens-protocol/domain/entities'; /** * Config */ export * from './chains'; -export * from './environments'; export * from './config'; +export * from './environments'; /** * Hooks helpers types @@ -97,8 +98,8 @@ export { ComparisonOperatorConditionType, CustomFiltersType, ExploreProfilesOrderByType, - ExplorePublicationsOrderByType, ExplorePublicationType, + ExplorePublicationsOrderByType, FeedEventItemType, FollowModuleType, LimitType, @@ -122,7 +123,7 @@ export { /** * Common errors */ -export { InvariantError } from '@lens-protocol/shared-kernel'; +export { UnspecifiedError } from '@lens-protocol/api-bindings'; export { InsufficientGasError, PendingSigningRequestError, @@ -134,17 +135,17 @@ export { BroadcastingError, BroadcastingErrorReason, } from '@lens-protocol/domain/use-cases/transactions'; -export { NotFoundError } from './NotFoundError'; export { InsufficientAllowanceError, InsufficientFundsError, } from '@lens-protocol/domain/use-cases/wallets'; -export { UnspecifiedError } from '@lens-protocol/api-bindings'; +export { InvariantError } from '@lens-protocol/shared-kernel'; +export { NotFoundError } from './NotFoundError'; /** * Helpers */ -export * from './utils'; +export { erc20Amount } from '@lens-protocol/api-bindings'; export * from './ConsoleLogger'; export { useSharedDependencies } from './shared'; -export { erc20Amount } from '@lens-protocol/api-bindings'; +export * from './utils'; diff --git a/packages/react/src/misc/useModuleMetadata.ts b/packages/react/src/misc/useModuleMetadata.ts index c69348d1be..3e62fee381 100644 --- a/packages/react/src/misc/useModuleMetadata.ts +++ b/packages/react/src/misc/useModuleMetadata.ts @@ -4,17 +4,17 @@ import { useModuleMetadata as useModuleMetadataHook, useModuleMetadataLazyQuery, } from '@lens-protocol/api-bindings'; -import { failure, PromiseResult, success } from '@lens-protocol/shared-kernel'; +import { PromiseResult, failure, success } from '@lens-protocol/shared-kernel'; import { NotFoundError } from '../NotFoundError'; import { useLensApolloClient } from '../helpers/arguments'; import { ReadResult, useReadResult } from '../helpers/reads'; -import { useDeferredTask, UseDeferredTask } from '../helpers/tasks'; +import { UseDeferredTask, useDeferredTask } from '../helpers/tasks'; export type { ModuleMetadataResult }; // export helpers -export { encodeData, decodeData } from '@lens-protocol/blockchain-bindings'; +export { decodeData, encodeData } from '@lens-protocol/blockchain-bindings'; export type { ModuleData, ModuleParam } from '@lens-protocol/blockchain-bindings'; /** @@ -35,7 +35,7 @@ export type UseModuleMetadataArgs = { * const { data, error, loading } = useModuleMetadata(); * ``` * - * @category Misc + * @category Modules * @group Hooks */ export function useModuleMetadata( @@ -71,7 +71,7 @@ export type FetchModuleMetadataArgs = { * ``` * * @experimental This hook is experimental and may change in the future. - * @category Misc + * @category Modules * @group Hooks */ export function useLazyModuleMetadata(): UseDeferredTask< diff --git a/packages/react/src/misc/useResolveAddress.ts b/packages/react/src/misc/useResolveAddress.ts index 5cd8a466ee..e7b447695f 100644 --- a/packages/react/src/misc/useResolveAddress.ts +++ b/packages/react/src/misc/useResolveAddress.ts @@ -36,7 +36,7 @@ import { UseDeferredTask, useDeferredTask } from '../helpers/tasks'; * ``` * * @experimental This hook is experimental and may change in the future. - * @category Misc + * @category Handle * @group Hooks */ export function useResolveAddress(): UseDeferredTask< diff --git a/packages/react/src/misc/useValidateHandle.ts b/packages/react/src/misc/useValidateHandle.ts index a1d622817d..d7f22d5427 100644 --- a/packages/react/src/misc/useValidateHandle.ts +++ b/packages/react/src/misc/useValidateHandle.ts @@ -65,7 +65,7 @@ export type ValidateHandleRequest = { * ``` * * @experimental This hook is experimental and may change in the future. - * @category Misc + * @category Handle * @group Hooks */ export function useValidateHandle(): UseDeferredTask< diff --git a/packages/react/src/misc/useWasWalletInvited.ts b/packages/react/src/misc/useWasWalletInvited.ts index 1933df7f79..5be9d7d2e8 100644 --- a/packages/react/src/misc/useWasWalletInvited.ts +++ b/packages/react/src/misc/useWasWalletInvited.ts @@ -25,7 +25,7 @@ export type UseWasWalletInvitedArgs = AlreadyInvitedCheckRequest; * }); * ``` * - * @category Misc + * @category Wallet * @group Hooks */ export function useWasWalletInvited(args: UseWasWalletInvitedArgs): ReadResult { @@ -64,7 +64,7 @@ export function useWasWalletInvited(args: UseWasWalletInvitedArgs): ReadResult = { ...defaultConfig, ...userConfig }; + const config: Required = { ...defaultConfig, ...userConfig }; // auth api const anonymousApolloClient = createAuthApolloClient({ @@ -187,7 +187,7 @@ export type SharedDependencies = { accessTokenStorage: AccessTokenStorage; activeWallet: ActiveWallet; apolloClient: SafeApolloClient; - config: LensConfig; + config: BaseConfig; credentialsFactory: CredentialsFactory; credentialsGateway: CredentialsGateway; inboxKeyStorage: IStorage; diff --git a/packages/react/src/transactions/adapters/AbstractContractCallGateway.ts b/packages/react/src/transactions/adapters/AbstractContractCallGateway.ts index a05f2869b1..2df29e41af 100644 --- a/packages/react/src/transactions/adapters/AbstractContractCallGateway.ts +++ b/packages/react/src/transactions/adapters/AbstractContractCallGateway.ts @@ -9,7 +9,7 @@ import { Amount, ChainType, Data, EvmAddress } from '@lens-protocol/shared-kerne import { BigNumberish, BytesLike } from 'ethers'; import { v4 } from 'uuid'; -import { LensConfig } from '../../config'; +import { BaseConfig } from '../../config'; import { ITransactionRequest } from '../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../wallet/adapters/IProviderFactory'; import { Eip1559GasPriceEstimator, TransactionExecutionSpeed } from './Eip1559GasPriceEstimator'; @@ -50,7 +50,7 @@ export abstract class AbstractContractCallGateway { constructor( - protected readonly config: LensConfig, + protected readonly config: BaseConfig, private readonly providerFactory: IProviderFactory, ) {} diff --git a/packages/react/src/transactions/adapters/CreateProfileTransactionGateway.ts b/packages/react/src/transactions/adapters/CreateProfileTransactionGateway.ts index ad2b5b6924..f8d7462f27 100644 --- a/packages/react/src/transactions/adapters/CreateProfileTransactionGateway.ts +++ b/packages/react/src/transactions/adapters/CreateProfileTransactionGateway.ts @@ -8,14 +8,14 @@ import { permissionlessCreator } from '@lens-protocol/blockchain-bindings'; import { CreateProfileRequest } from '@lens-protocol/domain/use-cases/profile'; import { Data, EvmAddress } from '@lens-protocol/shared-kernel'; -import { LensConfig } from '../../config'; +import { BaseConfig } from '../../config'; import { IProviderFactory } from '../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from './AbstractContractCallGateway'; export class CreateProfileTransactionGateway extends AbstractContractCallGateway { constructor( private apolloClient: SafeApolloClient, - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, ) { super(config, providerFactory); diff --git a/packages/react/src/transactions/adapters/OpenActionGateway.ts b/packages/react/src/transactions/adapters/OpenActionGateway.ts index af7952110b..cc48d2bb9d 100644 --- a/packages/react/src/transactions/adapters/OpenActionGateway.ts +++ b/packages/react/src/transactions/adapters/OpenActionGateway.ts @@ -31,7 +31,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../config'; +import { BaseConfig } from '../../config'; import { UnsignedProtocolCall } from '../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from './AbstractContractCallGateway'; @@ -50,7 +50,7 @@ export class OpenActionGateway IDelegatedTransactionGateway { constructor( - config: LensConfig, + config: BaseConfig, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, providerFactory: IProviderFactory, diff --git a/packages/react/src/transactions/adapters/__tests__/ApproveTransactionGateway.spec.ts b/packages/react/src/transactions/adapters/__tests__/ApproveTransactionGateway.spec.ts index 9e15371754..0c13332d9b 100644 --- a/packages/react/src/transactions/adapters/__tests__/ApproveTransactionGateway.spec.ts +++ b/packages/react/src/transactions/adapters/__tests__/ApproveTransactionGateway.spec.ts @@ -10,7 +10,7 @@ import { import { BigNumber, constants, providers, utils } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { mockIProviderFactory } from '../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../AbstractContractCallGateway'; import { ApproveTransactionGateway } from '../ApproveTransactionGateway'; @@ -23,7 +23,7 @@ function setupApproveTransactionGateway({ request: TokenAllowanceRequest; provider: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const providerFactory = mockIProviderFactory({ chainType: request.amount.asset.chainType, provider, diff --git a/packages/react/src/transactions/adapters/__tests__/CreateProfileTransactionGateway.spec.ts b/packages/react/src/transactions/adapters/__tests__/CreateProfileTransactionGateway.spec.ts index 653383b2bb..935f9d6671 100644 --- a/packages/react/src/transactions/adapters/__tests__/CreateProfileTransactionGateway.spec.ts +++ b/packages/react/src/transactions/adapters/__tests__/CreateProfileTransactionGateway.spec.ts @@ -18,7 +18,7 @@ import { deployMockContract } from 'ethereum-waffle'; import { BigNumber, Wallet, utils } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { staging } from '../../../environments'; import { mockIProviderFactory } from '../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../AbstractContractCallGateway'; @@ -49,7 +49,7 @@ async function setupTestScenario(mocks: MockedResponse[] = []) { // eslint-disable-next-line @typescript-eslint/await-thenable await mockContract.mock.getProfileWithHandleCreationPrice!.returns(utils.parseEther('10')); - const config = mock({ environment: staging }); + const config = mock({ environment: staging }); return new CreateProfileTransactionGateway(apolloClient, config, providerFactory); } diff --git a/packages/react/src/transactions/adapters/__tests__/OpenActionGateway.spec.ts b/packages/react/src/transactions/adapters/__tests__/OpenActionGateway.spec.ts index 16b3268ecb..dd151c323f 100644 --- a/packages/react/src/transactions/adapters/__tests__/OpenActionGateway.spec.ts +++ b/packages/react/src/transactions/adapters/__tests__/OpenActionGateway.spec.ts @@ -36,7 +36,7 @@ import { mockEvmAddress } from '@lens-protocol/shared-kernel/mocks'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../AbstractContractCallGateway'; @@ -54,7 +54,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ diff --git a/packages/react/src/transactions/adapters/profiles/BlockProfilesGateway.ts b/packages/react/src/transactions/adapters/profiles/BlockProfilesGateway.ts index 7748468f09..d5e46bc591 100644 --- a/packages/react/src/transactions/adapters/profiles/BlockProfilesGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/BlockProfilesGateway.ts @@ -21,7 +21,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -35,7 +35,7 @@ export class BlockProfilesGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/profiles/FollowProfileGateway.ts b/packages/react/src/transactions/adapters/profiles/FollowProfileGateway.ts index 612ec69781..f6de7be790 100644 --- a/packages/react/src/transactions/adapters/profiles/FollowProfileGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/FollowProfileGateway.ts @@ -30,7 +30,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -76,7 +76,7 @@ export class FollowProfileGateway implements IDelegatedTransactionGateway, ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/profiles/LinkHandleGateway.ts b/packages/react/src/transactions/adapters/profiles/LinkHandleGateway.ts index f738e68a46..bee28834b0 100644 --- a/packages/react/src/transactions/adapters/profiles/LinkHandleGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/LinkHandleGateway.ts @@ -21,7 +21,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -35,7 +35,7 @@ export class LinkHandleGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/profiles/ProfileMetadataGateway.ts b/packages/react/src/transactions/adapters/profiles/ProfileMetadataGateway.ts index 2e1b39f1ec..cd1a051dea 100644 --- a/packages/react/src/transactions/adapters/profiles/ProfileMetadataGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/ProfileMetadataGateway.ts @@ -21,7 +21,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -35,7 +35,7 @@ export class ProfileMetadataGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/profiles/UnblockProfilesGateway.ts b/packages/react/src/transactions/adapters/profiles/UnblockProfilesGateway.ts index d5611fc08c..9107055052 100644 --- a/packages/react/src/transactions/adapters/profiles/UnblockProfilesGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/UnblockProfilesGateway.ts @@ -21,7 +21,7 @@ import { import { ChainType, Data, PromiseResult, failure, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -35,7 +35,7 @@ export class UnblockProfilesGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/profiles/UnfollowProfileGateway.ts b/packages/react/src/transactions/adapters/profiles/UnfollowProfileGateway.ts index 3b4b52d9c4..c1677d55ba 100644 --- a/packages/react/src/transactions/adapters/profiles/UnfollowProfileGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/UnfollowProfileGateway.ts @@ -21,7 +21,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -33,7 +33,7 @@ export class UnfollowProfileGateway implements IDelegatedTransactionGateway, ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/profiles/UnlinkHandleGateway.ts b/packages/react/src/transactions/adapters/profiles/UnlinkHandleGateway.ts index bb8ae69f80..1ea18b50fa 100644 --- a/packages/react/src/transactions/adapters/profiles/UnlinkHandleGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/UnlinkHandleGateway.ts @@ -21,7 +21,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -35,7 +35,7 @@ export class UnlinkHandleGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/profiles/UpdateFollowPolicyGateway.ts b/packages/react/src/transactions/adapters/profiles/UpdateFollowPolicyGateway.ts index d592d2fdb7..ae09de4c60 100644 --- a/packages/react/src/transactions/adapters/profiles/UpdateFollowPolicyGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/UpdateFollowPolicyGateway.ts @@ -22,7 +22,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -36,7 +36,7 @@ export class UpdateFollowPolicyGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/profiles/UpdateProfileManagersGateway.ts b/packages/react/src/transactions/adapters/profiles/UpdateProfileManagersGateway.ts index c6fe473bf5..66a318dc29 100644 --- a/packages/react/src/transactions/adapters/profiles/UpdateProfileManagersGateway.ts +++ b/packages/react/src/transactions/adapters/profiles/UpdateProfileManagersGateway.ts @@ -13,7 +13,7 @@ import { UpdateProfileManagersRequest } from '@lens-protocol/domain/use-cases/pr import { ISignedOnChainGateway } from '@lens-protocol/domain/use-cases/transactions'; import { Data } from '@lens-protocol/shared-kernel'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -23,7 +23,7 @@ export class UpdateProfileManagersGateway implements ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private apolloClient: SafeApolloClient, ) { diff --git a/packages/react/src/transactions/adapters/profiles/__tests__/BlockProfilesGateway.spec.ts b/packages/react/src/transactions/adapters/profiles/__tests__/BlockProfilesGateway.spec.ts index 938d19a476..90d8f94bde 100644 --- a/packages/react/src/transactions/adapters/profiles/__tests__/BlockProfilesGateway.spec.ts +++ b/packages/react/src/transactions/adapters/profiles/__tests__/BlockProfilesGateway.spec.ts @@ -15,7 +15,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -30,7 +30,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/profiles/__tests__/FollowProfileGateway.spec.ts b/packages/react/src/transactions/adapters/profiles/__tests__/FollowProfileGateway.spec.ts index 82211e1b30..28c7713ea0 100644 --- a/packages/react/src/transactions/adapters/profiles/__tests__/FollowProfileGateway.spec.ts +++ b/packages/react/src/transactions/adapters/profiles/__tests__/FollowProfileGateway.spec.ts @@ -20,7 +20,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -35,7 +35,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/profiles/__tests__/LinkHandleGateway.spec.ts b/packages/react/src/transactions/adapters/profiles/__tests__/LinkHandleGateway.spec.ts index 8d1aab5c25..a5495063a8 100644 --- a/packages/react/src/transactions/adapters/profiles/__tests__/LinkHandleGateway.spec.ts +++ b/packages/react/src/transactions/adapters/profiles/__tests__/LinkHandleGateway.spec.ts @@ -15,7 +15,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -30,7 +30,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/profiles/__tests__/ProfileMetadataGateway.spec.ts b/packages/react/src/transactions/adapters/profiles/__tests__/ProfileMetadataGateway.spec.ts index fdc8b59707..07066a68c5 100644 --- a/packages/react/src/transactions/adapters/profiles/__tests__/ProfileMetadataGateway.spec.ts +++ b/packages/react/src/transactions/adapters/profiles/__tests__/ProfileMetadataGateway.spec.ts @@ -13,7 +13,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -31,7 +31,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/profiles/__tests__/UnblockProfilesGateway.spec.ts b/packages/react/src/transactions/adapters/profiles/__tests__/UnblockProfilesGateway.spec.ts index 9b7c5629b3..891fd36afa 100644 --- a/packages/react/src/transactions/adapters/profiles/__tests__/UnblockProfilesGateway.spec.ts +++ b/packages/react/src/transactions/adapters/profiles/__tests__/UnblockProfilesGateway.spec.ts @@ -15,7 +15,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -30,7 +30,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/profiles/__tests__/UnfollowProfileGateway.spec.ts b/packages/react/src/transactions/adapters/profiles/__tests__/UnfollowProfileGateway.spec.ts index df04c56fa9..7da1cea5f8 100644 --- a/packages/react/src/transactions/adapters/profiles/__tests__/UnfollowProfileGateway.spec.ts +++ b/packages/react/src/transactions/adapters/profiles/__tests__/UnfollowProfileGateway.spec.ts @@ -15,7 +15,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -30,7 +30,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/profiles/__tests__/UnlinkHandleGateway.spec.ts b/packages/react/src/transactions/adapters/profiles/__tests__/UnlinkHandleGateway.spec.ts index 54ad43bdff..60d0c6fc79 100644 --- a/packages/react/src/transactions/adapters/profiles/__tests__/UnlinkHandleGateway.spec.ts +++ b/packages/react/src/transactions/adapters/profiles/__tests__/UnlinkHandleGateway.spec.ts @@ -15,7 +15,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -30,7 +30,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/profiles/__tests__/UpdateFollowPolicyGateway.spec.ts b/packages/react/src/transactions/adapters/profiles/__tests__/UpdateFollowPolicyGateway.spec.ts index 5c235657ec..c62bd56682 100644 --- a/packages/react/src/transactions/adapters/profiles/__tests__/UpdateFollowPolicyGateway.spec.ts +++ b/packages/react/src/transactions/adapters/profiles/__tests__/UpdateFollowPolicyGateway.spec.ts @@ -15,7 +15,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -30,7 +30,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/publications/CreateOnChainCommentGateway.ts b/packages/react/src/transactions/adapters/publications/CreateOnChainCommentGateway.ts index a03c49624a..0921430c4f 100644 --- a/packages/react/src/transactions/adapters/publications/CreateOnChainCommentGateway.ts +++ b/packages/react/src/transactions/adapters/publications/CreateOnChainCommentGateway.ts @@ -22,7 +22,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -38,7 +38,7 @@ export class CreateOnChainCommentGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/publications/CreateOnChainMirrorGateway.ts b/packages/react/src/transactions/adapters/publications/CreateOnChainMirrorGateway.ts index 371a7a1746..fcb49c330c 100644 --- a/packages/react/src/transactions/adapters/publications/CreateOnChainMirrorGateway.ts +++ b/packages/react/src/transactions/adapters/publications/CreateOnChainMirrorGateway.ts @@ -22,7 +22,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -36,7 +36,7 @@ export class CreateOnChainMirrorGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/publications/CreateOnChainPostGateway.ts b/packages/react/src/transactions/adapters/publications/CreateOnChainPostGateway.ts index 5169ce4340..458c61bdd0 100644 --- a/packages/react/src/transactions/adapters/publications/CreateOnChainPostGateway.ts +++ b/packages/react/src/transactions/adapters/publications/CreateOnChainPostGateway.ts @@ -22,7 +22,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -38,7 +38,7 @@ export class CreateOnChainPostGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/publications/CreateOnChainQuoteGateway.ts b/packages/react/src/transactions/adapters/publications/CreateOnChainQuoteGateway.ts index 4391f48838..0b3e058851 100644 --- a/packages/react/src/transactions/adapters/publications/CreateOnChainQuoteGateway.ts +++ b/packages/react/src/transactions/adapters/publications/CreateOnChainQuoteGateway.ts @@ -22,7 +22,7 @@ import { import { ChainType, Data, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { v4 } from 'uuid'; -import { LensConfig } from '../../../config'; +import { BaseConfig } from '../../../config'; import { UnsignedProtocolCall } from '../../../wallet/adapters/ConcreteWallet'; import { IProviderFactory } from '../../../wallet/adapters/IProviderFactory'; import { AbstractContractCallGateway, ContractCallDetails } from '../AbstractContractCallGateway'; @@ -38,7 +38,7 @@ export class CreateOnChainQuoteGateway ISignedOnChainGateway { constructor( - config: LensConfig, + config: BaseConfig, providerFactory: IProviderFactory, private readonly apolloClient: SafeApolloClient, private readonly transactionFactory: ITransactionFactory, diff --git a/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainCommentGateway.spec.ts b/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainCommentGateway.spec.ts index 06478f2611..3e94bed5e7 100644 --- a/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainCommentGateway.spec.ts +++ b/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainCommentGateway.spec.ts @@ -23,7 +23,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -42,7 +42,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainMirrorGateway.spec.ts b/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainMirrorGateway.spec.ts index 29b152d125..cb30f2437c 100644 --- a/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainMirrorGateway.spec.ts +++ b/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainMirrorGateway.spec.ts @@ -23,7 +23,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -42,7 +42,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainPostGateway.spec.ts b/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainPostGateway.spec.ts index f1408508e1..389d6cf0fe 100644 --- a/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainPostGateway.spec.ts +++ b/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainPostGateway.spec.ts @@ -23,7 +23,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -42,7 +42,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainQuoteGateway.spec.ts b/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainQuoteGateway.spec.ts index 97983ce194..077dfe387b 100644 --- a/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainQuoteGateway.spec.ts +++ b/packages/react/src/transactions/adapters/publications/__tests__/CreateOnChainQuoteGateway.spec.ts @@ -23,7 +23,7 @@ import { ChainType } from '@lens-protocol/shared-kernel'; import { providers } from 'ethers'; import { mock } from 'jest-mock-extended'; -import { LensConfig } from '../../../../config'; +import { BaseConfig } from '../../../../config'; import { UnsignedProtocolCall } from '../../../../wallet/adapters/ConcreteWallet'; import { mockIProviderFactory } from '../../../../wallet/adapters/__helpers__/mocks'; import { UnsignedContractCallTransaction } from '../../AbstractContractCallGateway'; @@ -42,7 +42,7 @@ function setupTestScenario({ apolloClient: SafeApolloClient; provider?: providers.JsonRpcProvider; }) { - const config = mock(); + const config = mock(); const transactionFactory = mockITransactionFactory(); const providerFactory = mockIProviderFactory({ chainType: ChainType.POLYGON, diff --git a/packages/react/src/transactions/useClaimHandle.ts b/packages/react/src/transactions/useClaimHandle.ts index a37283626c..628f2abe93 100644 --- a/packages/react/src/transactions/useClaimHandle.ts +++ b/packages/react/src/transactions/useClaimHandle.ts @@ -5,9 +5,9 @@ import { } from '@lens-protocol/api-bindings'; import { TransactionError, TransactionKind } from '@lens-protocol/domain/entities'; import { - ClaimHandleError as GenericClaimHandleError, ClaimHandleRequest, FollowPolicyConfig, + ClaimHandleError as GenericClaimHandleError, } from '@lens-protocol/domain/use-cases/profile'; import { OneOf, invariant } from '@lens-protocol/shared-kernel'; @@ -15,9 +15,10 @@ import { SessionType, useSession } from '../authentication'; import { UseDeferredTask, useDeferredTask } from '../helpers/tasks'; import { useClaimHandleController } from './adapters/useClaimHandleController'; -// re-export constructor and specialized type -export const ClaimHandleError = GenericClaimHandleError; -export type ClaimHandleError = GenericClaimHandleError; +/** + * @privateRemarks Extended class to generate proper documentation. No measurable run-time implications. + */ +export class ClaimHandleError extends GenericClaimHandleError {} export { ClaimProfileWithHandleErrorReasonType }; diff --git a/packages/react/tsdoc.json b/packages/react/tsdoc.json new file mode 100644 index 0000000000..b89839ca22 --- /dev/null +++ b/packages/react/tsdoc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "extends": ["typedoc/tsdoc.json"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d16d9c920..3004bce1b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,9 +15,6 @@ importers: '@changesets/cli': specifier: ^2.26.2 version: 2.26.2 - '@mxssfd/typedoc-theme': - specifier: ^1.1.3 - version: 1.1.3(typedoc@0.25.3) '@preconstruct/cli': specifier: ^2.8.1 version: 2.8.1 @@ -31,8 +28,14 @@ importers: specifier: ^1.10.16 version: 1.10.16 typedoc: - specifier: ^0.25.3 - version: 0.25.3(typescript@5.2.2) + specifier: ^0.25.8 + version: 0.25.8(typescript@5.2.2) + typedoc-material-theme: + specifier: ^1.0.2 + version: 1.0.2(typedoc@0.25.8) + typedoc-plugin-extras: + specifier: ^3.0.0 + version: 3.0.0(typedoc@0.25.8) typescript: specifier: 5.2.2 version: 5.2.2 @@ -59,7 +62,7 @@ importers: version: 18.2.0(react@18.2.0) viem: specifier: ^2.7.6 - version: 2.7.6(typescript@5.2.2)(zod@3.22.4) + version: 2.7.6(typescript@5.2.2) wagmi: specifier: ^2.5.6 version: 2.5.6(@tanstack/react-query@5.18.1)(@types/react@18.2.38)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@2.7.6) @@ -198,7 +201,7 @@ importers: version: 3.0.2 viem: specifier: ^2.7.6 - version: 2.7.6(typescript@5.2.2)(zod@3.22.4) + version: 2.7.6(typescript@5.2.2) wagmi: specifier: ^2.5.6 version: 2.5.6(@tanstack/react-query@5.18.1)(@types/react@18.2.38)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@2.7.6) @@ -1284,7 +1287,7 @@ importers: version: 5.2.2 viem: specifier: ^2.7.6 - version: 2.7.6(typescript@5.2.2)(zod@3.22.4) + version: 2.7.6(typescript@5.2.2) wagmi: specifier: ^2.5.6 version: 2.5.6(@tanstack/react-query@5.18.1)(@types/react@18.2.38)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2)(viem@2.7.6) @@ -5845,6 +5848,10 @@ packages: read-yaml-file: 1.1.0 dev: true + /@material/material-color-utilities@0.2.7: + resolution: {integrity: sha512-0FCeqG6WvK4/Cc06F/xXMd/pv4FeisI0c1tUpBbfhA2n9Y8eZEv4Karjbmf2ZqQCPUWMrGp8A571tCjizxoTiQ==} + dev: true + /@metamask/eth-json-rpc-provider@1.0.1: resolution: {integrity: sha512-whiUMPlAOrVGmX8aKYVPvlKyG4CpQXiNNyt74vE1xb5sPvmx5oA7B/kOi/JdBvhGQq97U1/AVdXEdk2zkP8qyA==} engines: {node: '>=14.0.0'} @@ -6088,15 +6095,6 @@ packages: '@motionone/dom': 10.16.4 tslib: 2.6.2 - /@mxssfd/typedoc-theme@1.1.3(typedoc@0.25.3): - resolution: {integrity: sha512-/yP5rqhvibMpzXpmw0YLLRCpoj3uVWWlwyJseZXzGxTfiA6/fd1uubUqNoQAi2U19atMDonq8mQc+hlVctrX4g==} - engines: {node: '>= 14'} - peerDependencies: - typedoc: ^0.25.1 - dependencies: - typedoc: 0.25.3(typescript@5.2.2) - dev: true - /@near-js/crypto@0.0.3: resolution: {integrity: sha512-3WC2A1a1cH8Cqrx+0iDjp1ASEEhxN/KHEMENYb0KZH6Hp5bXIY7Akt4quC7JlgJS5ESvEiLa40tS5h0zAhBWGw==} dependencies: @@ -7884,7 +7882,7 @@ packages: '@walletconnect/ethereum-provider': 2.11.1(@types/react@18.2.38)(react@18.2.0) '@walletconnect/modal': 2.6.2(@types/react@18.2.38)(react@18.2.0) typescript: 5.2.2 - viem: 2.7.6(typescript@5.2.2)(zod@3.22.4) + viem: 2.7.6(typescript@5.2.2) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -7924,7 +7922,7 @@ packages: eventemitter3: 5.0.1 mipd: 0.0.5(typescript@5.2.2) typescript: 5.2.2 - viem: 2.7.6(typescript@5.2.2)(zod@3.22.4) + viem: 2.7.6(typescript@5.2.2) zustand: 4.4.1(@types/react@18.2.38)(react@18.2.0) transitivePeerDependencies: - '@types/react' @@ -8656,7 +8654,7 @@ packages: typescript: 5.2.2 zod: 3.22.4 - /abitype@1.0.0(typescript@5.2.2)(zod@3.22.4): + /abitype@1.0.0(typescript@5.2.2): resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: typescript: '>=5.0.4' @@ -8668,7 +8666,6 @@ packages: optional: true dependencies: typescript: 5.2.2 - zod: 3.22.4 /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} @@ -14851,8 +14848,8 @@ packages: hasBin: true dev: true - /jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + /jsonc-parser@3.2.1: + resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} /jsonfile@2.4.0: resolution: {integrity: sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==} @@ -17129,7 +17126,7 @@ packages: /pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: - jsonc-parser: 3.2.0 + jsonc-parser: 3.2.1 mlly: 1.4.2 pathe: 1.1.1 @@ -18504,11 +18501,11 @@ packages: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} dev: true - /shiki@0.14.5: - resolution: {integrity: sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw==} + /shiki@0.14.7: + resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} dependencies: ansi-sequence-parser: 1.1.1 - jsonc-parser: 3.2.0 + jsonc-parser: 3.2.1 vscode-oniguruma: 1.7.0 vscode-textmate: 8.0.0 dev: true @@ -19750,17 +19747,35 @@ packages: for-each: 0.3.3 is-typed-array: 1.1.12 - /typedoc@0.25.3(typescript@5.2.2): - resolution: {integrity: sha512-Ow8Bo7uY1Lwy7GTmphRIMEo6IOZ+yYUyrc8n5KXIZg1svpqhZSWgni2ZrDhe+wLosFS8yswowUzljTAV/3jmWw==} + /typedoc-material-theme@1.0.2(typedoc@0.25.8): + resolution: {integrity: sha512-/nH/twYeHrnz5sZaaXzYJ85EOgKqnbl1ivzBKmuEAga1dBsARttwQUTPKAT7XrCPD+rRcoqxuCOdXZ6EGiqRQA==} + engines: {node: '>=18.0.0', npm: '>=8.6.0'} + peerDependencies: + typedoc: ^0.25.3 + dependencies: + '@material/material-color-utilities': 0.2.7 + typedoc: 0.25.8(typescript@5.2.2) + dev: true + + /typedoc-plugin-extras@3.0.0(typedoc@0.25.8): + resolution: {integrity: sha512-eiAe3qtm2WbV5owdncpt0zHZPqsNZH2mzNGILPd4zqrvEZie3Et9es4cpGZ+8lHO/SI0pVKwsAj7IuMxPNOdYg==} + peerDependencies: + typedoc: 0.25.x + dependencies: + typedoc: 0.25.8(typescript@5.2.2) + dev: true + + /typedoc@0.25.8(typescript@5.2.2): + resolution: {integrity: sha512-mh8oLW66nwmeB9uTa0Bdcjfis+48bAjSH3uqdzSuSawfduROQLlXw//WSNZLYDdhmMVB7YcYZicq6e8T0d271A==} engines: {node: '>= 16'} hasBin: true peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x dependencies: lunr: 2.3.9 marked: 4.3.0 minimatch: 9.0.3 - shiki: 0.14.5 + shiki: 0.14.7 typescript: 5.2.2 dev: true @@ -20241,7 +20256,7 @@ packages: - utf-8-validate - zod - /viem@2.7.6(typescript@5.2.2)(zod@3.22.4): + /viem@2.7.6(typescript@5.2.2): resolution: {integrity: sha512-43TF0VYcTeNef9dax1/BhqlRLXpAo6HAiQ68hrJ8XRhDOou73nHZEjeFl8Eai4UFFodKhu+PbRUFzuuoixOUfg==} peerDependencies: typescript: '>=5.0.4' @@ -20254,7 +20269,7 @@ packages: '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - abitype: 1.0.0(typescript@5.2.2)(zod@3.22.4) + abitype: 1.0.0(typescript@5.2.2) isows: 1.0.3(ws@8.13.0) typescript: 5.2.2 ws: 8.13.0 @@ -20360,7 +20375,7 @@ packages: react: 18.2.0 typescript: 5.2.2 use-sync-external-store: 1.2.0(react@18.2.0) - viem: 2.7.6(typescript@5.2.2)(zod@3.22.4) + viem: 2.7.6(typescript@5.2.2) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' diff --git a/typedoc.base.json b/typedoc.base.json index 3cfa4aa8a8..c9f115e5d7 100644 --- a/typedoc.base.json +++ b/typedoc.base.json @@ -6,7 +6,7 @@ "excludeNotDocumented": false, "excludePrivate": true, "excludeProtected": true, - "disableSources": true, - "gitRevision": "develop", + "disableSources": false, + "gitRevision": "main", "hideGenerator": true } diff --git a/typedoc.json b/typedoc.json index dfb0f71173..28b640b9a7 100644 --- a/typedoc.json +++ b/typedoc.json @@ -5,6 +5,14 @@ "name": "Lens SDK Reference", "out": "docs", "readme": "none", - "plugin": ["@mxssfd/typedoc-theme"], - "theme": "my-theme" + "plugin": ["typedoc-material-theme", "typedoc-plugin-extras"], + "themeColor": "#c3e4cd", + "customCss": "assets/docs.css", + "navigation": { + "includeCategories": false, + "includeGroups": true, + "includeFolders": false + }, + "categorizeByGroup": true, + "hideGenerator": true }