diff --git a/.changeset/config.json b/.changeset/config.json index e17c6af222..9f7d010d33 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", "changelog": "@changesets/cli/changelog", "commit": false, - "fixed": [["@lens-protocol/react", "@lens-protocol/react-web"]], + "fixed": [["@lens-protocol/react", "@lens-protocol/react-web", "@lens-protocol/react-native"]], "linked": [], "access": "public", "baseBranch": "develop", diff --git a/.changeset/early-keys-know.md b/.changeset/early-keys-know.md new file mode 100644 index 0000000000..376cd73c93 --- /dev/null +++ b/.changeset/early-keys-know.md @@ -0,0 +1,11 @@ +--- +"@lens-protocol/blockchain-bindings": minor +"@lens-protocol/api-bindings": minor +"@lens-protocol/domain": minor +"@lens-protocol/react": minor +"@lens-protocol/react-native": minor +"@lens-protocol/react-web": minor +--- + +**feat:** added `useSignFrameAction` hook +**feat:** added `useIdentityToken` hook diff --git a/.changeset/hot-pumas-doubt.md b/.changeset/hot-pumas-doubt.md new file mode 100644 index 0000000000..e87c71c45e --- /dev/null +++ b/.changeset/hot-pumas-doubt.md @@ -0,0 +1,9 @@ +--- +"@lens-protocol/api-bindings": patch +"@lens-protocol/client": patch +"@lens-protocol/react": patch +"@lens-protocol/react-native": patch +"@lens-protocol/react-web": patch +--- + +**fix:** adds missing `small` and `medium` aliases to `EncryptedImageSet` and `ImageSet` fragments. diff --git a/.changeset/little-emus-lick.md b/.changeset/little-emus-lick.md new file mode 100644 index 0000000000..0a35ee54c7 --- /dev/null +++ b/.changeset/little-emus-lick.md @@ -0,0 +1,14 @@ +--- +"@lens-protocol/client": minor +--- + +**feat:** added Frames module + + - `client.frames.createFrameTypedData` - create Frame action typed data to be signed by user wallet + - `client.frames.signFrameAction` - sign Frame action with Lens Manager if enabled + - `client.frames.verifyFrameSignature` - verify Frame signature + +**feat:** added support for Identity Token + + - `client.authentication.getIdentityToken` - retrieve Identity Token from authenticated LensClient + - `client.authentication.verify({ identityToken })` - verify the token, notice new argument format diff --git a/.changeset/modern-poems-battle.md b/.changeset/modern-poems-battle.md new file mode 100644 index 0000000000..a623cf88fd --- /dev/null +++ b/.changeset/modern-poems-battle.md @@ -0,0 +1,7 @@ +--- +"@lens-protocol/react-native": patch +"@lens-protocol/react-web": patch +"@lens-protocol/react": patch +--- + +**fix:** `useAccessToken` not picking up all possible token changes diff --git a/.changeset/pre.json b/.changeset/pre.json index c1e21c84d7..b1d9e074e4 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -58,6 +58,7 @@ "dry-cobras-bow", "dull-bags-nail", "early-gorillas-enjoy", + "early-keys-know", "early-penguins-whisper", "early-spiders-scream", "eighty-timers-mix", @@ -108,6 +109,7 @@ "honest-drinks-try", "hot-eels-divide", "hot-hornets-drum", + "hot-pumas-doubt", "itchy-mails-shout", "khaki-students-pump", "kind-wombats-serve", @@ -121,6 +123,7 @@ "lemon-terms-perform", "light-seas-cheat", "light-suits-glow", + "little-emus-lick", "long-ants-guess", "long-carpets-marry", "long-moose-reflect", @@ -132,6 +135,7 @@ "metal-bikes-applaud", "metal-cougars-train", "mighty-planets-retire", + "modern-poems-battle", "modern-spies-confess", "modern-taxis-share", "neat-cycles-doubt", @@ -165,6 +169,7 @@ "rare-birds-breathe", "rude-suns-visit", "serious-bats-shake", + "serious-comics-jog", "shaggy-carrots-cry", "shaggy-colts-turn", "shaggy-eagles-scream", @@ -207,6 +212,7 @@ "thin-falcons-tap", "thin-news-pull", "thirty-eyes-act", + "three-books-sit", "three-cougars-pay", "three-tools-fly", "tidy-kangaroos-bake", diff --git a/.changeset/serious-comics-jog.md b/.changeset/serious-comics-jog.md new file mode 100644 index 0000000000..6877b715b3 --- /dev/null +++ b/.changeset/serious-comics-jog.md @@ -0,0 +1,7 @@ +--- +"@lens-protocol/react": patch +"@lens-protocol/react-native": patch +"@lens-protocol/react-web": patch +--- + +**fix:** proactive refresh credentials diff --git a/.changeset/three-books-sit.md b/.changeset/three-books-sit.md new file mode 100644 index 0000000000..e99a4d748b --- /dev/null +++ b/.changeset/three-books-sit.md @@ -0,0 +1,10 @@ +--- +"@lens-protocol/blockchain-bindings": patch +"@lens-protocol/api-bindings": patch +"@lens-protocol/client": patch +"@lens-protocol/react": patch +"@lens-protocol/react-native": patch +"@lens-protocol/react-web": patch +--- + +**chore:** exported missing gql types diff --git a/examples/node/scripts/authentication/authenticate.ts b/examples/node/scripts/authentication/authenticate.ts index 1d4f9bee29..d4d9bebfda 100644 --- a/examples/node/scripts/authentication/authenticate.ts +++ b/examples/node/scripts/authentication/authenticate.ts @@ -35,7 +35,7 @@ async function main() { console.log(`Is LensClient authenticated? `, await client.authentication.isAuthenticated()); console.log(`Authenticated profileId: `, profileId); console.log(`Access token: `, accessToken); - console.log(`Is access token valid? `, await client.authentication.verify(accessToken)); + console.log(`Is access token valid? `, await client.authentication.verify({ accessToken })); } main(); diff --git a/examples/node/scripts/authentication/authenticateWithWallet.ts b/examples/node/scripts/authentication/authenticateWithWallet.ts index 112c04316a..07b2eb32da 100644 --- a/examples/node/scripts/authentication/authenticateWithWallet.ts +++ b/examples/node/scripts/authentication/authenticateWithWallet.ts @@ -25,7 +25,7 @@ async function main() { console.log(`Is LensClient authenticated? `, await client.authentication.isAuthenticated()); console.log(`Authenticated wallet: `, walletAddress); console.log(`Access token: `, accessToken); - console.log(`Is access token valid? `, await client.authentication.verify(accessToken)); + console.log(`Is access token valid? `, await client.authentication.verify({ accessToken })); } main(); diff --git a/examples/node/scripts/authentication/verifyIdentityToken.ts b/examples/node/scripts/authentication/verifyIdentityToken.ts new file mode 100644 index 0000000000..88f2985fe2 --- /dev/null +++ b/examples/node/scripts/authentication/verifyIdentityToken.ts @@ -0,0 +1,35 @@ +import { LensClient, development } from '@lens-protocol/client'; + +import { setupWallet } from '../shared/setupWallet'; + +async function main() { + const client = new LensClient({ + environment: development, + }); + + const wallet = setupWallet(); + const address = await wallet.getAddress(); + + const managedProfiles = await client.wallet.profilesManaged({ for: wallet.address }); + + if (managedProfiles.items.length === 0) { + throw new Error(`You don't manage any profiles, create one first`); + } + + const { id, text } = await client.authentication.generateChallenge({ + signedBy: address, + for: managedProfiles.items[0].id, + }); + + const signature = await wallet.signMessage(text); + + await client.authentication.authenticate({ id, signature }); + + const identityTokenResult = await client.authentication.getIdentityToken(); + const identityToken = identityTokenResult.unwrap(); + + console.log(`Identity token: `, identityToken); + console.log(`Is identity token valid? `, await client.authentication.verify({ identityToken })); +} + +main(); diff --git a/examples/node/scripts/frames/createFrameTypedData.ts b/examples/node/scripts/frames/createFrameTypedData.ts new file mode 100644 index 0000000000..6fd0ccb321 --- /dev/null +++ b/examples/node/scripts/frames/createFrameTypedData.ts @@ -0,0 +1,23 @@ +import { LensClient, development } from '@lens-protocol/client'; + +async function main() { + const client = new LensClient({ + environment: development, + }); + + const result = await client.frames.createFrameTypedData({ + actionResponse: '0x0000000000000000000000000000000000000000', + buttonIndex: 2, + deadline: new Date(Date.now() + 30 * 60 * 1000).getTime(), // 30 minutes from now + inputText: 'Hello, World!', + profileId: '0x01', + pubId: '0x01-0x01', + specVersion: '1.0.0', + state: '{"counter":1,"idempotency_key":"431b8b38-eb4d-455b"}', + url: 'https://mylensframe.xyz', + }); + + console.log(`Result: `, result); +} + +main(); diff --git a/examples/node/scripts/frames/signFrameAction.ts b/examples/node/scripts/frames/signFrameAction.ts new file mode 100644 index 0000000000..1e24f21599 --- /dev/null +++ b/examples/node/scripts/frames/signFrameAction.ts @@ -0,0 +1,29 @@ +import { getAuthenticatedClient } from '../shared/getAuthenticatedClient'; +import { setupWallet } from '../shared/setupWallet'; + +async function main() { + const wallet = setupWallet(); + const client = await getAuthenticatedClient(wallet); + + const result = await client.frames.signFrameAction({ + actionResponse: '0x0000000000000000000000000000000000000000', + buttonIndex: 2, + inputText: 'Hello, World!', + profileId: '0x01', + pubId: '0x01-0x01', + specVersion: '1.0.0', + state: '{"counter":1,"idempotency_key":"431b8b38-eb4d-455b"}', + url: 'https://mylensframe.xyz', + }); + + if (result.isFailure()) { + console.error(result.error); // CredentialsExpiredError or NotAuthenticatedError + process.exit(1); + } + + const data = result.value; + + console.log(`Result: `, data); +} + +main(); diff --git a/examples/node/scripts/frames/verifyFrameSignature.ts b/examples/node/scripts/frames/verifyFrameSignature.ts new file mode 100644 index 0000000000..937d5a0541 --- /dev/null +++ b/examples/node/scripts/frames/verifyFrameSignature.ts @@ -0,0 +1,47 @@ +import { FrameVerifySignatureResult } from '@lens-protocol/client'; + +import { getAuthenticatedClient } from '../shared/getAuthenticatedClient'; +import { setupWallet } from '../shared/setupWallet'; + +async function main() { + const wallet = setupWallet(); + const client = await getAuthenticatedClient(wallet); + const profileId = await client.authentication.getProfileId(); + + if (!profileId) { + throw new Error('Profile not authenticated'); + } + + const identityTokenResult = await client.authentication.getIdentityToken(); + const identityToken = identityTokenResult.unwrap(); + + // get signature + const result = await client.frames.signFrameAction({ + actionResponse: '0x0000000000000000000000000000000000000000', + buttonIndex: 2, + inputText: 'Hello, World!', + profileId: profileId, + pubId: '0x01-0x01', + specVersion: '1.0.0', + state: '{"counter":1,"idempotency_key":"431b8b38-eb4d-455b"}', + url: 'https://mylensframe.xyz', + }); + + if (result.isFailure()) { + console.error(result.error); // CredentialsExpiredError or NotAuthenticatedError + process.exit(1); + } + + const data = result.value; + + // verify + const verifyResult = await client.frames.verifyFrameSignature({ + identityToken, + signature: data.signature, + signedTypedData: data.signedTypedData, + }); + + console.log(`Is signature valid? `, verifyResult === FrameVerifySignatureResult.Verified); +} + +main(); diff --git a/examples/web/src/App.tsx b/examples/web/src/App.tsx index 71b16c1bd9..2771d514a4 100644 --- a/examples/web/src/App.tsx +++ b/examples/web/src/App.tsx @@ -34,6 +34,7 @@ import { UseInviteWallets, UseNotifications, UseResolveAddress, + UseSignFrameAction, UseValidateHandle, } from './misc'; import { @@ -193,6 +194,7 @@ export function App() { path="lensClientInteroperability" element={} /> + } /> (); + const storage = useStorage(); + const client = useMemo( + () => + new LensClient({ + environment: development, + storage, + }), + [storage], + ); + + useEffect(() => { + void (async () => { + const status = await client.frames.verifyFrameSignature(toVerify); + setVerified(status); + })(); + }, [client, toVerify]); + + return
Server verifications status: {verified}
; +} + +export function UseSignFrameActionInner({ profile }: { profile: Profile }) { + const [frameActionToVerify, setFrameActionToVerify] = useState(); + + const { data, execute, loading } = useSignFrameAction(); + const identityToken = useIdentityToken(); + + const sign = async () => { + const result = await execute({ + actionResponse: '0x0000000000000000000000000000000000000000', + buttonIndex: 2, + inputText: 'Hello, World!', + profileId: profile.id, + pubId: publicationId('0x01-0x01'), + specVersion: '1.0.0', + state: '{"counter":1,"idempotency_key":"431b8b38-eb4d-455b"}', + url: uri('https://mylensframe.xyz'), + }); + + if (result.isFailure()) { + toast.error(result.error.message); + return; + } + + const { signature, signedTypedData } = result.value; + + if (!identityToken) { + throw new Error('No identity token found'); + } + + setFrameActionToVerify({ + signature, + signedTypedData, + identityToken, + }); + }; + + return ( +
+ + {data &&

Signature: {data.signature}

} + {frameActionToVerify && } +
+ ); +} + +export function UseSignFrameAction() { + return ( +
+

+ useSignFrameAction +

+ + + {({ profile }) => } + +
+ ); +} diff --git a/examples/web/src/misc/index.ts b/examples/web/src/misc/index.ts index 504b7ebd17..53e77c56c6 100644 --- a/examples/web/src/misc/index.ts +++ b/examples/web/src/misc/index.ts @@ -6,4 +6,5 @@ export * from './UseCurrencies'; export * from './UseInviteWallets'; export * from './UseNotifications'; export * from './UseResolveAddress'; +export * from './UseSignFrameAction'; export * from './UseValidateHandle'; diff --git a/packages/api-bindings/CHANGELOG.md b/packages/api-bindings/CHANGELOG.md index e62c0f087b..ec080ab1cc 100644 --- a/packages/api-bindings/CHANGELOG.md +++ b/packages/api-bindings/CHANGELOG.md @@ -1,5 +1,19 @@ # @lens-protocol/api-bindings +## 0.11.0-alpha.33 + +### Minor Changes + +- cdaf25268: **feat:** added `useSignFrameAction` hook + **feat:** added `useIdentityToken` hook + +### Patch Changes + +- dbb1657e3: **fix:** adds missing `small` and `medium` aliases to `EncryptedImageSet` and `ImageSet` fragments. +- 4183f686a: **chore:** exported missing gql types +- Updated dependencies [cdaf25268] + - @lens-protocol/domain@0.11.0-alpha.26 + ## 0.11.0-alpha.32 ### Minor Changes diff --git a/packages/api-bindings/package.json b/packages/api-bindings/package.json index a9d0191bc2..65fd5b59be 100644 --- a/packages/api-bindings/package.json +++ b/packages/api-bindings/package.json @@ -1,6 +1,6 @@ { "name": "@lens-protocol/api-bindings", - "version": "0.11.0-alpha.32", + "version": "0.11.0-alpha.33", "description": "Graphql fragments, react hooks, typescript types of lens API.", "repository": { "directory": "packages/api-bindings", diff --git a/packages/api-bindings/src/lens/ReferenceModule.ts b/packages/api-bindings/src/lens/ReferenceModule.ts index d15f80a726..2e9104e407 100644 --- a/packages/api-bindings/src/lens/ReferenceModule.ts +++ b/packages/api-bindings/src/lens/ReferenceModule.ts @@ -81,7 +81,7 @@ export type ReferencePolicy = * } * ``` * - * @param args - The {@link AnyPublication} to resolve {@link ReferencePolicy} from + * @param publication - The {@link AnyPublication} to resolve {@link ReferencePolicy} from * @returns {@link ReferencePolicy} */ export function resolveReferencePolicy(publication: AnyPublication): ReferencePolicy { diff --git a/packages/api-bindings/src/lens/graphql/auth.graphql b/packages/api-bindings/src/lens/graphql/auth.graphql index 9ebcb720fd..02d780cc85 100644 --- a/packages/api-bindings/src/lens/graphql/auth.graphql +++ b/packages/api-bindings/src/lens/graphql/auth.graphql @@ -18,6 +18,7 @@ mutation AuthAuthenticate($request: SignedAuthChallenge!) { result: authenticate(request: $request) { accessToken refreshToken + identityToken } } @@ -25,6 +26,7 @@ mutation AuthRefresh($request: RefreshRequest!) { result: refresh(request: $request) { accessToken refreshToken + identityToken } } @@ -34,6 +36,7 @@ mutation WalletAuthenticationToProfileAuthentication( result: walletAuthenticationToProfileAuthentication(request: $request) { accessToken refreshToken + identityToken } } diff --git a/packages/api-bindings/src/lens/graphql/fragments.graphql b/packages/api-bindings/src/lens/graphql/fragments.graphql index b53ca389bd..a4641e66bb 100644 --- a/packages/api-bindings/src/lens/graphql/fragments.graphql +++ b/packages/api-bindings/src/lens/graphql/fragments.graphql @@ -118,6 +118,12 @@ fragment EncryptableImageSet on EncryptableImageSet { optimized { ...Image } + small: transformed(request: $imageSmallSize) { + ...Image + } + medium: transformed(request: $imageMediumSize) { + ...Image + } } fragment Video on Video { diff --git a/packages/api-bindings/src/lens/graphql/frames.graphql b/packages/api-bindings/src/lens/graphql/frames.graphql new file mode 100644 index 0000000000..186b03a0eb --- /dev/null +++ b/packages/api-bindings/src/lens/graphql/frames.graphql @@ -0,0 +1,41 @@ +query CreateFrameTypedData($request: FrameEIP712Request!) { + result: createFrameTypedData(request: $request) { + ...CreateFrameEIP712TypedData + } +} + +fragment CreateFrameEIP712TypedData on CreateFrameEIP712TypedData { + types { + FrameData { + name + type + } + } + domain { + ...EIP712TypedDataDomain + } + value { + specVersion + url + buttonIndex + profileId + pubId + inputText + state + actionResponse + deadline + } +} + +fragment FrameLensManagerSignatureResult on FrameLensManagerSignatureResult { + signedTypedData { + ...CreateFrameEIP712TypedData + } + signature +} + +mutation SignFrameAction($request: FrameLensManagerEIP712Request!) { + result: signFrameAction(request: $request) { + ...FrameLensManagerSignatureResult + } +} diff --git a/packages/api-bindings/src/lens/graphql/generated.ts b/packages/api-bindings/src/lens/graphql/generated.ts index 18db273a8a..9f6348762b 100644 --- a/packages/api-bindings/src/lens/graphql/generated.ts +++ b/packages/api-bindings/src/lens/graphql/generated.ts @@ -223,6 +223,14 @@ export type ClaimProfileWithHandleRequest = { id?: InputMaybe; }; +export type ClaimTokensRequest = { + for: ClaimableTokenType; +}; + +export enum ClaimableTokenType { + Bonsai = 'BONSAI', +} + export type CollectActionModuleInput = { multirecipientCollectOpenAction?: InputMaybe; simpleCollectOpenAction?: InputMaybe; @@ -259,6 +267,32 @@ export enum ComparisonOperatorConditionType { NotEqual = 'NOT_EQUAL', } +export type CreateFrameEip712TypedDataInput = { + /** The typed data domain */ + domain: Eip712TypedDataDomainInput; + /** The types */ + types: CreateFrameEip712TypedDataTypesInput; + /** The values */ + value: CreateFrameEip712TypedDataValueInput; +}; + +export type CreateFrameEip712TypedDataTypesInput = { + FrameData: Array; +}; + +export type CreateFrameEip712TypedDataValueInput = { + actionResponse: Scalars['String']; + buttonIndex: Scalars['Int']; + deadline: Scalars['UnixTimestamp']; + inputText: Scalars['String']; + profileId: Scalars['ProfileId']; + pubId: Scalars['PublicationId']; + /** The EIP-721 spec version, must be 1.0.0 */ + specVersion: Scalars['String']; + state: Scalars['String']; + url: Scalars['URI']; +}; + export type CreateProfileRequest = { followModule?: InputMaybe; to: Scalars['EvmAddress']; @@ -309,10 +343,38 @@ export type DegreesOfSeparationReferenceModuleInput = { sourceProfileId?: InputMaybe; }; +export type DidReactOnPublicationPublicationIdAndProfileId = { + profileId: Scalars['ProfileId']; + publicationId: Scalars['PublicationId']; +}; + +export type DidReactOnPublicationRequest = { + for: Array; + where?: InputMaybe; +}; + export type DismissRecommendedProfilesRequest = { dismiss: Array; }; +export type Eip712TypedDataDomainInput = { + /** The chainId */ + chainId: Scalars['ChainId']; + /** The name of the typed data domain */ + name: Scalars['String']; + /** The verifying contract */ + verifyingContract: Scalars['EvmAddress']; + /** The version */ + version: Scalars['String']; +}; + +export type Eip712TypedDataFieldInput = { + /** The name of the typed data field */ + name: Scalars['String']; + /** The type of the typed data field */ + type: Scalars['String']; +}; + /** Possible sort criteria for exploring profiles */ export enum ExploreProfilesOrderByType { CreatedOn = 'CREATED_ON', @@ -406,6 +468,7 @@ export type FeedRequest = { }; export type FeedWhere = { + customFilters?: InputMaybe>; feedEventItemTypes?: InputMaybe>; for?: InputMaybe; metadata?: InputMaybe; @@ -481,6 +544,48 @@ export type FollowingRequest = { orderBy?: InputMaybe; }; +export type FrameEip712Request = { + actionResponse: Scalars['String']; + buttonIndex: Scalars['Int']; + deadline: Scalars['UnixTimestamp']; + inputText: Scalars['String']; + profileId: Scalars['ProfileId']; + pubId: Scalars['PublicationId']; + /** The EIP-721 spec version, must be 1.0.0 */ + specVersion: Scalars['String']; + state: Scalars['String']; + url: Scalars['URI']; +}; + +export type FrameLensManagerEip712Request = { + actionResponse: Scalars['String']; + buttonIndex: Scalars['Int']; + inputText: Scalars['String']; + profileId: Scalars['ProfileId']; + pubId: Scalars['PublicationId']; + /** The EIP-721 spec version, must be 1.0.0 */ + specVersion: Scalars['String']; + state: Scalars['String']; + url: Scalars['URI']; +}; + +export type FrameVerifySignature = { + /** The identity token */ + identityToken: Scalars['Jwt']; + /** The signature */ + signature: Scalars['Signature']; + /** The typed data signed */ + signedTypedData: CreateFrameEip712TypedDataInput; +}; + +export enum FrameVerifySignatureResult { + DeadlineExpired = 'DEADLINE_EXPIRED', + IdentityCannotUseProfile = 'IDENTITY_CANNOT_USE_PROFILE', + IdentityUnauthorized = 'IDENTITY_UNAUTHORIZED', + SignerAddressCannotUseProfile = 'SIGNER_ADDRESS_CANNOT_USE_PROFILE', + Verified = 'VERIFIED', +} + export type FraudReasonInput = { reason: PublicationReportingReason; subreason: PublicationReportingFraudSubreason; @@ -514,6 +619,11 @@ export type HideCommentRequest = { for: Scalars['PublicationId']; }; +export type HideManagedProfileRequest = { + /** The profile to hide */ + profileId: Scalars['ProfileId']; +}; + export type HidePublicationRequest = { for: Scalars['PublicationId']; }; @@ -611,6 +721,12 @@ export type InternalInvitesRequest = { secret: Scalars['String']; }; +export type InternalMintHandleAndProfileRequest = { + a: Scalars['EvmAddress']; + h: Scalars['String']; + secret: Scalars['String']; +}; + export type InternalNftIndexRequest = { n: Array; secret: Scalars['String']; @@ -621,6 +737,11 @@ export type InternalNftVerifyRequest = { secret: Scalars['String']; }; +export type InternalPaymentHandleInfoRequest = { + p: Scalars['String']; + secret: Scalars['String']; +}; + export type InternalProfileStatusRequest = { hhh: Scalars['String']; secret: Scalars['String']; @@ -660,6 +781,10 @@ export type LatestPaidActionsFilter = { openActionPublicationMetadataFilters?: InputMaybe; }; +export type LatestPaidActionsWhere = { + customFilters?: InputMaybe>; +}; + export type LegacyCollectRequest = { on: Scalars['PublicationId']; referrer?: InputMaybe; @@ -704,6 +829,13 @@ export type LinkHandleToProfileRequest = { handle: Scalars['Handle']; }; +/** Managed profile visibility type */ +export enum ManagedProfileVisibility { + All = 'ALL', + HiddenOnly = 'HIDDEN_ONLY', + NoneHidden = 'NONE_HIDDEN', +} + export enum MarketplaceMetadataAttributeDisplayType { Date = 'DATE', Number = 'NUMBER', @@ -1313,6 +1445,7 @@ export type ProfilesManagedRequest = { cursor?: InputMaybe; /** The Ethereum address for which to retrieve managed profiles */ for: Scalars['EvmAddress']; + hiddenFilter?: InputMaybe; includeOwned?: InputMaybe; limit?: InputMaybe; }; @@ -1648,6 +1781,7 @@ export enum RelayRoleKey { CreateProfileWithHandleUsingCredits_8 = 'CREATE_PROFILE_WITH_HANDLE_USING_CREDITS_8', CreateProfileWithHandleUsingCredits_9 = 'CREATE_PROFILE_WITH_HANDLE_USING_CREDITS_9', CreateProfileWithHandleUsingCredits_10 = 'CREATE_PROFILE_WITH_HANDLE_USING_CREDITS_10', + CreateProfileWithHandleUsingCreditsUnderCharLimit = 'CREATE_PROFILE_WITH_HANDLE_USING_CREDITS_UNDER_CHAR_LIMIT', LensManager_1 = 'LENS_MANAGER_1', LensManager_2 = 'LENS_MANAGER_2', LensManager_3 = 'LENS_MANAGER_3', @@ -1821,6 +1955,11 @@ export type UnhideCommentRequest = { for: Scalars['PublicationId']; }; +export type UnhideManagedProfileRequest = { + /** The profile to unhide */ + profileId: Scalars['ProfileId']; +}; + export type UnknownFollowModuleInput = { address: Scalars['EvmAddress']; data: Scalars['BlockchainData']; @@ -1869,7 +2008,9 @@ export type ValidatePublicationMetadataRequest = { export type VerifyRequest = { /** The access token to verify */ - accessToken: Scalars['Jwt']; + accessToken?: InputMaybe; + /** The identity token to verify */ + identityToken?: InputMaybe; }; export type WalletAuthenticationToProfileAuthenticationRequest = { @@ -1975,20 +2116,24 @@ export type AuthAuthenticateVariables = Exact<{ request: SignedAuthChallenge; }>; -export type AuthAuthenticateData = { result: { accessToken: string; refreshToken: string } }; +export type AuthAuthenticateData = { + result: { accessToken: string; refreshToken: string; identityToken: string }; +}; export type AuthRefreshVariables = Exact<{ request: RefreshRequest; }>; -export type AuthRefreshData = { result: { accessToken: string; refreshToken: string } }; +export type AuthRefreshData = { + result: { accessToken: string; refreshToken: string; identityToken: string }; +}; export type WalletAuthenticationToProfileAuthenticationVariables = Exact<{ request: WalletAuthenticationToProfileAuthenticationRequest; }>; export type WalletAuthenticationToProfileAuthenticationData = { - result: { accessToken: string; refreshToken: string }; + result: { accessToken: string; refreshToken: string; identityToken: string }; }; export type RevokeAuthenticationVariables = Exact<{ @@ -2163,6 +2308,8 @@ export type EncryptableImageSet = { __typename: 'EncryptableImageSet'; raw: EncryptableImage; optimized: Image | null; + small: Image | null; + medium: Image | null; }; export type Video = { __typename: 'Video'; uri: URI; mimeType: string | null }; @@ -3243,6 +3390,39 @@ export type CreateMomokaPublicationResult = { momokaId: string; }; +export type CreateFrameTypedDataVariables = Exact<{ + request: FrameEip712Request; +}>; + +export type CreateFrameTypedDataData = { result: CreateFrameEip712TypedData }; + +export type CreateFrameEip712TypedData = { + types: { FrameData: Array<{ name: string; type: string }> }; + domain: Eip712TypedDataDomain; + value: { + specVersion: string; + url: URI; + buttonIndex: number; + profileId: ProfileId; + pubId: PublicationId; + inputText: string; + state: string; + actionResponse: string; + deadline: number; + }; +}; + +export type FrameLensManagerSignatureResult = { + signature: string; + signedTypedData: CreateFrameEip712TypedData; +}; + +export type SignFrameActionVariables = Exact<{ + request: FrameLensManagerEip712Request; +}>; + +export type SignFrameActionData = { result: FrameLensManagerSignatureResult }; + export type HandleToAddressVariables = Exact<{ request: HandleToAddressRequest; }>; @@ -10969,6 +11149,38 @@ export const FragmentEncryptableImageSet = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -11116,6 +11328,38 @@ export const FragmentPublicationMetadataMediaAudio = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -11380,6 +11624,38 @@ export const FragmentPublicationMetadataMediaVideo = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -11537,6 +11813,38 @@ export const FragmentPublicationMetadataMediaImage = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -11912,6 +12220,38 @@ export const FragmentAudioMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -13071,6 +13411,38 @@ export const FragmentVideoMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -14229,6 +14601,38 @@ export const FragmentImageMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -15374,6 +15778,38 @@ export const FragmentArticleMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -16550,6 +16986,38 @@ export const FragmentEventMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -17709,6 +18177,38 @@ export const FragmentLinkMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -18854,6 +19354,38 @@ export const FragmentEmbedMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -20009,6 +20541,38 @@ export const FragmentCheckingInMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -21991,6 +22555,38 @@ export const FragmentThreeDMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -23151,6 +23747,38 @@ export const FragmentStoryMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -24298,6 +24926,38 @@ export const FragmentTransactionMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -25443,6 +26103,38 @@ export const FragmentMintMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -26590,6 +27282,38 @@ export const FragmentSpaceMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -27740,6 +28464,38 @@ export const FragmentLiveStreamMetadataV3 = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -31591,6 +32347,38 @@ export const FragmentPost = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -36882,6 +37670,38 @@ export const FragmentQuoteFields = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -42174,6 +42994,38 @@ export const FragmentCommentFields = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -48155,6 +49007,38 @@ export const FragmentQuote = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -54749,6 +55633,38 @@ export const FragmentExplorePublication = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -61447,6 +62363,38 @@ export const FragmentComment = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -68091,6 +69039,38 @@ export const FragmentMirror = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -75848,6 +76828,38 @@ export const FragmentFeedItem = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -82648,6 +83660,38 @@ export const FragmentFeedHighlight = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -89341,6 +90385,38 @@ export const FragmentAnyPublicationInternal = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -95860,6 +96936,193 @@ export const FragmentCreateMomokaPublicationResult = /*#__PURE__*/ { }, ], } as unknown as DocumentNode; +export const FragmentCreateFrameEip712TypedData = /*#__PURE__*/ { + kind: 'Document', + definitions: [ + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'types' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'FrameData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'type' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'domain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'FragmentSpread', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'specVersion' } }, + { kind: 'Field', name: { kind: 'Name', value: 'url' } }, + { kind: 'Field', name: { kind: 'Name', value: 'buttonIndex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'profileId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'pubId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'inputText' } }, + { kind: 'Field', name: { kind: 'Name', value: 'state' } }, + { kind: 'Field', name: { kind: 'Name', value: 'actionResponse' } }, + { kind: 'Field', name: { kind: 'Name', value: 'deadline' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'EIP712TypedDataDomain' }, + typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'chainId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'version' } }, + { kind: 'Field', name: { kind: 'Name', value: 'verifyingContract' } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const FragmentFrameLensManagerSignatureResult = /*#__PURE__*/ { + kind: 'Document', + definitions: [ + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'signedTypedData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'signature' } }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'EIP712TypedDataDomain' }, + typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'chainId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'version' } }, + { kind: 'Field', name: { kind: 'Name', value: 'verifyingContract' } }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'types' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'FrameData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'type' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'domain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'FragmentSpread', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'specVersion' } }, + { kind: 'Field', name: { kind: 'Name', value: 'url' } }, + { kind: 'Field', name: { kind: 'Name', value: 'buttonIndex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'profileId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'pubId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'inputText' } }, + { kind: 'Field', name: { kind: 'Name', value: 'state' } }, + { kind: 'Field', name: { kind: 'Name', value: 'actionResponse' } }, + { kind: 'Field', name: { kind: 'Name', value: 'deadline' } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; export const FragmentInvitedResult = /*#__PURE__*/ { kind: 'Document', definitions: [ @@ -98319,6 +99582,38 @@ export const FragmentReactionNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -105079,6 +106374,38 @@ export const FragmentCommentNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -112741,6 +114068,38 @@ export const FragmentMirrorNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -119480,6 +120839,38 @@ export const FragmentQuoteNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -127346,6 +128737,38 @@ export const FragmentActedNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -135237,6 +136660,38 @@ export const FragmentMentionNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -142036,6 +143491,38 @@ export const FragmentNotification = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -152539,6 +154026,38 @@ export const FragmentPublicationRevenue = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -159714,6 +161233,7 @@ export const AuthAuthenticateDocument = /*#__PURE__*/ { selections: [ { kind: 'Field', name: { kind: 'Name', value: 'accessToken' } }, { kind: 'Field', name: { kind: 'Name', value: 'refreshToken' } }, + { kind: 'Field', name: { kind: 'Name', value: 'identityToken' } }, ], }, }, @@ -159795,6 +161315,7 @@ export const AuthRefreshDocument = /*#__PURE__*/ { selections: [ { kind: 'Field', name: { kind: 'Name', value: 'accessToken' } }, { kind: 'Field', name: { kind: 'Name', value: 'refreshToken' } }, + { kind: 'Field', name: { kind: 'Name', value: 'identityToken' } }, ], }, }, @@ -159873,6 +161394,7 @@ export const WalletAuthenticationToProfileAuthenticationDocument = /*#__PURE__*/ selections: [ { kind: 'Field', name: { kind: 'Name', value: 'accessToken' } }, { kind: 'Field', name: { kind: 'Name', value: 'refreshToken' } }, + { kind: 'Field', name: { kind: 'Name', value: 'identityToken' } }, ], }, }, @@ -160522,6 +162044,38 @@ export const ExplorePublicationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -168607,6 +170161,38 @@ export const FeedDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -175608,6 +177194,38 @@ export const FeedHighlightsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -181972,6 +183590,361 @@ export type FeedHighlightsQueryResult = Apollo.QueryResult< FeedHighlightsData, FeedHighlightsVariables >; +export const CreateFrameTypedDataDocument = /*#__PURE__*/ { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'CreateFrameTypedData' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'FrameEIP712Request' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'result' }, + name: { kind: 'Name', value: 'createFrameTypedData' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'EIP712TypedDataDomain' }, + typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'chainId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'version' } }, + { kind: 'Field', name: { kind: 'Name', value: 'verifyingContract' } }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'types' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'FrameData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'type' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'domain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'FragmentSpread', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'specVersion' } }, + { kind: 'Field', name: { kind: 'Name', value: 'url' } }, + { kind: 'Field', name: { kind: 'Name', value: 'buttonIndex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'profileId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'pubId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'inputText' } }, + { kind: 'Field', name: { kind: 'Name', value: 'state' } }, + { kind: 'Field', name: { kind: 'Name', value: 'actionResponse' } }, + { kind: 'Field', name: { kind: 'Name', value: 'deadline' } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; + +/** + * __useCreateFrameTypedData__ + * + * To run a query within a React component, call `useCreateFrameTypedData` and pass it any options that fit your needs. + * When your component renders, `useCreateFrameTypedData` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useCreateFrameTypedData({ + * variables: { + * request: // value for 'request' + * }, + * }); + */ +export function useCreateFrameTypedData( + baseOptions: Apollo.QueryHookOptions, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + CreateFrameTypedDataDocument, + options, + ); +} +export function useCreateFrameTypedDataLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + CreateFrameTypedDataData, + CreateFrameTypedDataVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + CreateFrameTypedDataDocument, + options, + ); +} +export type CreateFrameTypedDataHookResult = ReturnType; +export type CreateFrameTypedDataLazyQueryHookResult = ReturnType< + typeof useCreateFrameTypedDataLazyQuery +>; +export type CreateFrameTypedDataQueryResult = Apollo.QueryResult< + CreateFrameTypedDataData, + CreateFrameTypedDataVariables +>; +export const SignFrameActionDocument = /*#__PURE__*/ { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'mutation', + name: { kind: 'Name', value: 'SignFrameAction' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'FrameLensManagerEIP712Request' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'result' }, + name: { kind: 'Name', value: 'signFrameAction' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'EIP712TypedDataDomain' }, + typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'chainId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'version' } }, + { kind: 'Field', name: { kind: 'Name', value: 'verifyingContract' } }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'types' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'FrameData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'type' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'domain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'FragmentSpread', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'specVersion' } }, + { kind: 'Field', name: { kind: 'Name', value: 'url' } }, + { kind: 'Field', name: { kind: 'Name', value: 'buttonIndex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'profileId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'pubId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'inputText' } }, + { kind: 'Field', name: { kind: 'Name', value: 'state' } }, + { kind: 'Field', name: { kind: 'Name', value: 'actionResponse' } }, + { kind: 'Field', name: { kind: 'Name', value: 'deadline' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'signedTypedData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'signature' } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export type SignFrameActionMutationFn = Apollo.MutationFunction< + SignFrameActionData, + SignFrameActionVariables +>; + +/** + * __useSignFrameAction__ + * + * To run a mutation, you first call `useSignFrameAction` within a React component and pass it any options that fit your needs. + * When your component renders, `useSignFrameAction` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [signFrameAction, { data, loading, error }] = useSignFrameAction({ + * variables: { + * request: // value for 'request' + * }, + * }); + */ +export function useSignFrameAction( + baseOptions?: Apollo.MutationHookOptions, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation( + SignFrameActionDocument, + options, + ); +} +export type SignFrameActionHookResult = ReturnType; +export type SignFrameActionMutationResult = Apollo.MutationResult; +export type SignFrameActionMutationOptions = Apollo.BaseMutationOptions< + SignFrameActionData, + SignFrameActionVariables +>; export const HandleToAddressDocument = /*#__PURE__*/ { kind: 'Document', definitions: [ @@ -184163,6 +186136,38 @@ export const NotificationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -204462,6 +206467,38 @@ export const PublicationDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -211471,6 +213508,38 @@ export const PublicationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -218730,6 +220799,38 @@ export const PublicationBookmarksDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -230749,6 +232850,38 @@ export const RevenueFromPublicationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -237787,6 +239920,38 @@ export const RevenueFromPublicationDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -245130,6 +247295,38 @@ export const SearchPublicationsDocument = /*#__PURE__*/ { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageSmallSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'imageMediumSize' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -256124,11 +258321,13 @@ export type AuthChallengeResultFieldPolicy = { }; export type AuthenticationResultKeySpecifier = ( | 'accessToken' + | 'identityToken' | 'refreshToken' | AuthenticationResultKeySpecifier )[]; export type AuthenticationResultFieldPolicy = { accessToken?: FieldPolicy | FieldReadFunction; + identityToken?: FieldPolicy | FieldReadFunction; refreshToken?: FieldPolicy | FieldReadFunction; }; export type CanClaimResultKeySpecifier = ('address' | 'canClaim' | CanClaimResultKeySpecifier)[]; @@ -256198,6 +258397,10 @@ export type ClaimableProfilesResultFieldPolicy = { canMintProfileWithFreeTextHandle?: FieldPolicy | FieldReadFunction; reserved?: FieldPolicy | FieldReadFunction; }; +export type ClaimableTokensResultKeySpecifier = ('bonsai' | ClaimableTokensResultKeySpecifier)[]; +export type ClaimableTokensResultFieldPolicy = { + bonsai?: FieldPolicy | FieldReadFunction; +}; export type CollectConditionKeySpecifier = ( | 'publicationId' | 'thisPublication' @@ -256449,6 +258652,47 @@ export type CreateFollowEIP712TypedDataValueFieldPolicy = { idsOfProfilesToFollow?: FieldPolicy | FieldReadFunction; nonce?: FieldPolicy | FieldReadFunction; }; +export type CreateFrameEIP712TypedDataKeySpecifier = ( + | 'domain' + | 'types' + | 'value' + | CreateFrameEIP712TypedDataKeySpecifier +)[]; +export type CreateFrameEIP712TypedDataFieldPolicy = { + domain?: FieldPolicy | FieldReadFunction; + types?: FieldPolicy | FieldReadFunction; + value?: FieldPolicy | FieldReadFunction; +}; +export type CreateFrameEIP712TypedDataTypesKeySpecifier = ( + | 'FrameData' + | CreateFrameEIP712TypedDataTypesKeySpecifier +)[]; +export type CreateFrameEIP712TypedDataTypesFieldPolicy = { + FrameData?: FieldPolicy | FieldReadFunction; +}; +export type CreateFrameEIP712TypedDataValueKeySpecifier = ( + | 'actionResponse' + | 'buttonIndex' + | 'deadline' + | 'inputText' + | 'profileId' + | 'pubId' + | 'specVersion' + | 'state' + | 'url' + | CreateFrameEIP712TypedDataValueKeySpecifier +)[]; +export type CreateFrameEIP712TypedDataValueFieldPolicy = { + actionResponse?: FieldPolicy | FieldReadFunction; + buttonIndex?: FieldPolicy | FieldReadFunction; + deadline?: FieldPolicy | FieldReadFunction; + inputText?: FieldPolicy | FieldReadFunction; + profileId?: FieldPolicy | FieldReadFunction; + pubId?: FieldPolicy | FieldReadFunction; + specVersion?: FieldPolicy | FieldReadFunction; + state?: FieldPolicy | FieldReadFunction; + url?: FieldPolicy | FieldReadFunction; +}; export type CreateLegacyCollectBroadcastItemResultKeySpecifier = ( | 'expiresAt' | 'id' @@ -257236,6 +259480,17 @@ export type DegreesOfSeparationReferenceModuleSettingsFieldPolicy = { sourceProfileId?: FieldPolicy | FieldReadFunction; type?: FieldPolicy | FieldReadFunction; }; +export type DidReactOnPublicationResultKeySpecifier = ( + | 'profileId' + | 'publicationId' + | 'result' + | DidReactOnPublicationResultKeySpecifier +)[]; +export type DidReactOnPublicationResultFieldPolicy = { + profileId?: FieldPolicy | FieldReadFunction; + publicationId?: FieldPolicy | FieldReadFunction; + result?: FieldPolicy | FieldReadFunction; +}; export type EIP712TypedDataDomainKeySpecifier = ( | 'chainId' | 'name' @@ -257495,6 +259750,15 @@ export type FollowStatusBulkResultFieldPolicy = { profileId?: FieldPolicy | FieldReadFunction; status?: FieldPolicy | FieldReadFunction; }; +export type FrameLensManagerSignatureResultKeySpecifier = ( + | 'signature' + | 'signedTypedData' + | FrameLensManagerSignatureResultKeySpecifier +)[]; +export type FrameLensManagerSignatureResultFieldPolicy = { + signature?: FieldPolicy | FieldReadFunction; + signedTypedData?: FieldPolicy | FieldReadFunction; +}; export type GenerateModuleCurrencyApprovalResultKeySpecifier = ( | 'data' | 'from' @@ -257532,8 +259796,18 @@ export type GetModuleMetadataResultFieldPolicy = { sponsoredApproved?: FieldPolicy | FieldReadFunction; verified?: FieldPolicy | FieldReadFunction; }; +export type HandleGuardianResultKeySpecifier = ( + | 'cooldownEndsOn' + | 'protected' + | HandleGuardianResultKeySpecifier +)[]; +export type HandleGuardianResultFieldPolicy = { + cooldownEndsOn?: FieldPolicy | FieldReadFunction; + protected?: FieldPolicy | FieldReadFunction; +}; export type HandleInfoKeySpecifier = ( | 'fullHandle' + | 'guardian' | 'id' | 'linkedTo' | 'localName' @@ -257544,6 +259818,7 @@ export type HandleInfoKeySpecifier = ( )[]; export type HandleInfoFieldPolicy = { fullHandle?: FieldPolicy | FieldReadFunction; + guardian?: FieldPolicy | FieldReadFunction; id?: FieldPolicy | FieldReadFunction; linkedTo?: FieldPolicy | FieldReadFunction; localName?: FieldPolicy | FieldReadFunction; @@ -257556,6 +259831,12 @@ export type HandleLinkedToFieldPolicy = { contract?: FieldPolicy | FieldReadFunction; nftTokenId?: FieldPolicy | FieldReadFunction; }; +export type IPHResultKeySpecifier = ('h' | 'hda' | 'hs' | IPHResultKeySpecifier)[]; +export type IPHResultFieldPolicy = { + h?: FieldPolicy | FieldReadFunction; + hda?: FieldPolicy | FieldReadFunction; + hs?: FieldPolicy | FieldReadFunction; +}; export type ImageKeySpecifier = ('height' | 'mimeType' | 'uri' | 'width' | ImageKeySpecifier)[]; export type ImageFieldPolicy = { height?: FieldPolicy | FieldReadFunction; @@ -258069,6 +260350,17 @@ export type MirrorNotificationFieldPolicy = { mirrors?: FieldPolicy | FieldReadFunction; publication?: FieldPolicy | FieldReadFunction; }; +export type ModFollowerResultKeySpecifier = ( + | 'createdAt' + | 'follower' + | 'following' + | ModFollowerResultKeySpecifier +)[]; +export type ModFollowerResultFieldPolicy = { + createdAt?: FieldPolicy | FieldReadFunction; + follower?: FieldPolicy | FieldReadFunction; + following?: FieldPolicy | FieldReadFunction; +}; export type ModuleInfoKeySpecifier = ('name' | 'type' | ModuleInfoKeySpecifier)[]; export type ModuleInfoFieldPolicy = { name?: FieldPolicy | FieldReadFunction; @@ -258285,6 +260577,7 @@ export type MutationKeySpecifier = ( | 'dismissRecommendedProfiles' | 'follow' | 'hideComment' + | 'hideManagedProfile' | 'hidePublication' | 'idKitPhoneVerifyWebhook' | 'internalAddCuratedTag' @@ -258293,6 +260586,7 @@ export type MutationKeySpecifier = ( | 'internalBoostProfile' | 'internalClaim' | 'internalCuratedUpdate' + | 'internalMintHandleAndProfile' | 'internalNftIndex' | 'internalNftVerify' | 'internalRemoveCuratedTag' @@ -258321,10 +260615,12 @@ export type MutationKeySpecifier = ( | 'setDefaultProfile' | 'setFollowModule' | 'setProfileMetadata' + | 'signFrameAction' | 'unblock' | 'undoPublicationNotInterested' | 'unfollow' | 'unhideComment' + | 'unhideManagedProfile' | 'unlinkHandleFromProfile' | 'updateNftGalleryInfo' | 'updateNftGalleryItems' @@ -258371,6 +260667,7 @@ export type MutationFieldPolicy = { dismissRecommendedProfiles?: FieldPolicy | FieldReadFunction; follow?: FieldPolicy | FieldReadFunction; hideComment?: FieldPolicy | FieldReadFunction; + hideManagedProfile?: FieldPolicy | FieldReadFunction; hidePublication?: FieldPolicy | FieldReadFunction; idKitPhoneVerifyWebhook?: FieldPolicy | FieldReadFunction; internalAddCuratedTag?: FieldPolicy | FieldReadFunction; @@ -258379,6 +260676,7 @@ export type MutationFieldPolicy = { internalBoostProfile?: FieldPolicy | FieldReadFunction; internalClaim?: FieldPolicy | FieldReadFunction; internalCuratedUpdate?: FieldPolicy | FieldReadFunction; + internalMintHandleAndProfile?: FieldPolicy | FieldReadFunction; internalNftIndex?: FieldPolicy | FieldReadFunction; internalNftVerify?: FieldPolicy | FieldReadFunction; internalRemoveCuratedTag?: FieldPolicy | FieldReadFunction; @@ -258407,10 +260705,12 @@ export type MutationFieldPolicy = { setDefaultProfile?: FieldPolicy | FieldReadFunction; setFollowModule?: FieldPolicy | FieldReadFunction; setProfileMetadata?: FieldPolicy | FieldReadFunction; + signFrameAction?: FieldPolicy | FieldReadFunction; unblock?: FieldPolicy | FieldReadFunction; undoPublicationNotInterested?: FieldPolicy | FieldReadFunction; unfollow?: FieldPolicy | FieldReadFunction; unhideComment?: FieldPolicy | FieldReadFunction; + unhideManagedProfile?: FieldPolicy | FieldReadFunction; unlinkHandleFromProfile?: FieldPolicy | FieldReadFunction; updateNftGalleryInfo?: FieldPolicy | FieldReadFunction; updateNftGalleryItems?: FieldPolicy | FieldReadFunction; @@ -258637,6 +260937,15 @@ export type PaginatedModExplorePublicationResultFieldPolicy = { items?: FieldPolicy | FieldReadFunction; pageInfo?: FieldPolicy | FieldReadFunction; }; +export type PaginatedModFollowersResultKeySpecifier = ( + | 'items' + | 'pageInfo' + | PaginatedModFollowersResultKeySpecifier +)[]; +export type PaginatedModFollowersResultFieldPolicy = { + items?: FieldPolicy | FieldReadFunction; + pageInfo?: FieldPolicy | FieldReadFunction; +}; export type PaginatedNftCollectionsResultKeySpecifier = ( | 'items' | 'pageInfo' @@ -259275,11 +261584,15 @@ export type QueryKeySpecifier = ( | 'approvedModuleAllowanceAmount' | 'canClaim' | 'challenge' + | 'claimTokens' | 'claimableProfiles' | 'claimableStatus' + | 'claimableTokens' + | 'createFrameTypedData' | 'currencies' | 'currentSession' | 'defaultProfile' + | 'didReactOnPublication' | 'exploreProfiles' | 'explorePublications' | 'feed' @@ -259297,6 +261610,7 @@ export type QueryKeySpecifier = ( | 'internalCuratedHandles' | 'internalCuratedTags' | 'internalInvites' + | 'internalPaymentHandleInfo' | 'internalProfileStatus' | 'invitedProfiles' | 'lastLoggedInProfile' @@ -259305,6 +261619,7 @@ export type QueryKeySpecifier = ( | 'lensProtocolVersion' | 'lensTransactionStatus' | 'modExplorePublications' + | 'modFollowers' | 'moduleMetadata' | 'momokaSubmitters' | 'momokaSummary' @@ -259350,6 +261665,7 @@ export type QueryKeySpecifier = ( | 'userSigNonces' | 'validatePublicationMetadata' | 'verify' + | 'verifyFrameSignature' | 'whoActedOnPublication' | 'whoHaveBlocked' | 'whoReactedPublication' @@ -259360,11 +261676,15 @@ export type QueryFieldPolicy = { approvedModuleAllowanceAmount?: FieldPolicy | FieldReadFunction; canClaim?: FieldPolicy | FieldReadFunction; challenge?: FieldPolicy | FieldReadFunction; + claimTokens?: FieldPolicy | FieldReadFunction; claimableProfiles?: FieldPolicy | FieldReadFunction; claimableStatus?: FieldPolicy | FieldReadFunction; + claimableTokens?: FieldPolicy | FieldReadFunction; + createFrameTypedData?: FieldPolicy | FieldReadFunction; currencies?: FieldPolicy | FieldReadFunction; currentSession?: FieldPolicy | FieldReadFunction; defaultProfile?: FieldPolicy | FieldReadFunction; + didReactOnPublication?: FieldPolicy | FieldReadFunction; exploreProfiles?: FieldPolicy | FieldReadFunction; explorePublications?: FieldPolicy | FieldReadFunction; feed?: FieldPolicy | FieldReadFunction; @@ -259382,6 +261702,7 @@ export type QueryFieldPolicy = { internalCuratedHandles?: FieldPolicy | FieldReadFunction; internalCuratedTags?: FieldPolicy | FieldReadFunction; internalInvites?: FieldPolicy | FieldReadFunction; + internalPaymentHandleInfo?: FieldPolicy | FieldReadFunction; internalProfileStatus?: FieldPolicy | FieldReadFunction; invitedProfiles?: FieldPolicy | FieldReadFunction; lastLoggedInProfile?: FieldPolicy | FieldReadFunction; @@ -259390,6 +261711,7 @@ export type QueryFieldPolicy = { lensProtocolVersion?: FieldPolicy | FieldReadFunction; lensTransactionStatus?: FieldPolicy | FieldReadFunction; modExplorePublications?: FieldPolicy | FieldReadFunction; + modFollowers?: FieldPolicy | FieldReadFunction; moduleMetadata?: FieldPolicy | FieldReadFunction; momokaSubmitters?: FieldPolicy | FieldReadFunction; momokaSummary?: FieldPolicy | FieldReadFunction; @@ -259435,6 +261757,7 @@ export type QueryFieldPolicy = { userSigNonces?: FieldPolicy | FieldReadFunction; validatePublicationMetadata?: FieldPolicy | FieldReadFunction; verify?: FieldPolicy | FieldReadFunction; + verifyFrameSignature?: FieldPolicy | FieldReadFunction; whoActedOnPublication?: FieldPolicy | FieldReadFunction; whoHaveBlocked?: FieldPolicy | FieldReadFunction; whoReactedPublication?: FieldPolicy | FieldReadFunction; @@ -260092,6 +262415,13 @@ export type StrictTypedTypePolicies = { | (() => undefined | ClaimableProfilesResultKeySpecifier); fields?: ClaimableProfilesResultFieldPolicy; }; + ClaimableTokensResult?: Omit & { + keyFields?: + | false + | ClaimableTokensResultKeySpecifier + | (() => undefined | ClaimableTokensResultKeySpecifier); + fields?: ClaimableTokensResultFieldPolicy; + }; CollectCondition?: Omit & { keyFields?: | false @@ -260222,6 +262552,27 @@ export type StrictTypedTypePolicies = { | (() => undefined | CreateFollowEIP712TypedDataValueKeySpecifier); fields?: CreateFollowEIP712TypedDataValueFieldPolicy; }; + CreateFrameEIP712TypedData?: Omit & { + keyFields?: + | false + | CreateFrameEIP712TypedDataKeySpecifier + | (() => undefined | CreateFrameEIP712TypedDataKeySpecifier); + fields?: CreateFrameEIP712TypedDataFieldPolicy; + }; + CreateFrameEIP712TypedDataTypes?: Omit & { + keyFields?: + | false + | CreateFrameEIP712TypedDataTypesKeySpecifier + | (() => undefined | CreateFrameEIP712TypedDataTypesKeySpecifier); + fields?: CreateFrameEIP712TypedDataTypesFieldPolicy; + }; + CreateFrameEIP712TypedDataValue?: Omit & { + keyFields?: + | false + | CreateFrameEIP712TypedDataValueKeySpecifier + | (() => undefined | CreateFrameEIP712TypedDataValueKeySpecifier); + fields?: CreateFrameEIP712TypedDataValueFieldPolicy; + }; CreateLegacyCollectBroadcastItemResult?: Omit & { keyFields?: | false @@ -260663,6 +263014,13 @@ export type StrictTypedTypePolicies = { | (() => undefined | DegreesOfSeparationReferenceModuleSettingsKeySpecifier); fields?: DegreesOfSeparationReferenceModuleSettingsFieldPolicy; }; + DidReactOnPublicationResult?: Omit & { + keyFields?: + | false + | DidReactOnPublicationResultKeySpecifier + | (() => undefined | DidReactOnPublicationResultKeySpecifier); + fields?: DidReactOnPublicationResultFieldPolicy; + }; EIP712TypedDataDomain?: Omit & { keyFields?: | false @@ -260819,6 +263177,13 @@ export type StrictTypedTypePolicies = { | (() => undefined | FollowStatusBulkResultKeySpecifier); fields?: FollowStatusBulkResultFieldPolicy; }; + FrameLensManagerSignatureResult?: Omit & { + keyFields?: + | false + | FrameLensManagerSignatureResultKeySpecifier + | (() => undefined | FrameLensManagerSignatureResultKeySpecifier); + fields?: FrameLensManagerSignatureResultFieldPolicy; + }; GenerateModuleCurrencyApprovalResult?: Omit & { keyFields?: | false @@ -260837,6 +263202,13 @@ export type StrictTypedTypePolicies = { | (() => undefined | GetModuleMetadataResultKeySpecifier); fields?: GetModuleMetadataResultFieldPolicy; }; + HandleGuardianResult?: Omit & { + keyFields?: + | false + | HandleGuardianResultKeySpecifier + | (() => undefined | HandleGuardianResultKeySpecifier); + fields?: HandleGuardianResultFieldPolicy; + }; HandleInfo?: Omit & { keyFields?: false | HandleInfoKeySpecifier | (() => undefined | HandleInfoKeySpecifier); fields?: HandleInfoFieldPolicy; @@ -260845,6 +263217,10 @@ export type StrictTypedTypePolicies = { keyFields?: false | HandleLinkedToKeySpecifier | (() => undefined | HandleLinkedToKeySpecifier); fields?: HandleLinkedToFieldPolicy; }; + IPHResult?: Omit & { + keyFields?: false | IPHResultKeySpecifier | (() => undefined | IPHResultKeySpecifier); + fields?: IPHResultFieldPolicy; + }; Image?: Omit & { keyFields?: false | ImageKeySpecifier | (() => undefined | ImageKeySpecifier); fields?: ImageFieldPolicy; @@ -261034,6 +263410,13 @@ export type StrictTypedTypePolicies = { | (() => undefined | MirrorNotificationKeySpecifier); fields?: MirrorNotificationFieldPolicy; }; + ModFollowerResult?: Omit & { + keyFields?: + | false + | ModFollowerResultKeySpecifier + | (() => undefined | ModFollowerResultKeySpecifier); + fields?: ModFollowerResultFieldPolicy; + }; ModuleInfo?: Omit & { keyFields?: false | ModuleInfoKeySpecifier | (() => undefined | ModuleInfoKeySpecifier); fields?: ModuleInfoFieldPolicy; @@ -261250,6 +263633,13 @@ export type StrictTypedTypePolicies = { | (() => undefined | PaginatedModExplorePublicationResultKeySpecifier); fields?: PaginatedModExplorePublicationResultFieldPolicy; }; + PaginatedModFollowersResult?: Omit & { + keyFields?: + | false + | PaginatedModFollowersResultKeySpecifier + | (() => undefined | PaginatedModFollowersResultKeySpecifier); + fields?: PaginatedModFollowersResultFieldPolicy; + }; PaginatedNftCollectionsResult?: Omit & { keyFields?: | false diff --git a/packages/blockchain-bindings/CHANGELOG.md b/packages/blockchain-bindings/CHANGELOG.md index d3180ae2f7..b91fea0d5a 100644 --- a/packages/blockchain-bindings/CHANGELOG.md +++ b/packages/blockchain-bindings/CHANGELOG.md @@ -1,5 +1,18 @@ # @lens-protocol/blockchain-bindings +## 0.10.0-alpha.27 + +### Minor Changes + +- cdaf25268: **feat:** added `useSignFrameAction` hook + **feat:** added `useIdentityToken` hook + +### Patch Changes + +- 4183f686a: **chore:** exported missing gql types +- Updated dependencies [cdaf25268] + - @lens-protocol/domain@0.11.0-alpha.26 + ## 0.10.0-alpha.26 ### Patch Changes diff --git a/packages/blockchain-bindings/package.json b/packages/blockchain-bindings/package.json index 4df35aa61e..7d5672b61f 100644 --- a/packages/blockchain-bindings/package.json +++ b/packages/blockchain-bindings/package.json @@ -1,6 +1,6 @@ { "name": "@lens-protocol/blockchain-bindings", - "version": "0.10.0-alpha.26", + "version": "0.10.0-alpha.27", "description": "Utilities for interacting with the blockchain.", "repository": { "directory": "packages/blockchain-bindings", @@ -40,7 +40,6 @@ "license": "MIT", "dependencies": { "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/contracts": "^5.7.0", "@ethersproject/providers": "^5.7.2", "@ethersproject/units": "^5.7.0", diff --git a/packages/blockchain-bindings/src/TypedData.ts b/packages/blockchain-bindings/src/TypedData.ts index d201c37567..fe03a242f5 100644 --- a/packages/blockchain-bindings/src/TypedData.ts +++ b/packages/blockchain-bindings/src/TypedData.ts @@ -1,4 +1,7 @@ -import { TypedDataField } from '@ethersproject/abstract-signer'; +export type TypedDataField = { + name: string; + type: string; +}; export type Eip712TypedDataDomain = { name: string; diff --git a/packages/blockchain-bindings/src/data.ts b/packages/blockchain-bindings/src/data.ts index 8cc89863fb..22b5d6d6ca 100644 --- a/packages/blockchain-bindings/src/data.ts +++ b/packages/blockchain-bindings/src/data.ts @@ -76,7 +76,7 @@ export function encodeData(abi: ModuleParam[], data: ModuleData): Data { * ); * ``` */ -export function decodeData(abi: ModuleParam[], encoded: string): ModuleData { +export function decodeData(abi: ModuleParam[], calldata: string): ModuleData { const types = abi.map((param) => { return ParamType.fromObject({ name: param.name, @@ -85,5 +85,5 @@ export function decodeData(abi: ModuleParam[], encoded: string): ModuleData { }); }); - return defaultAbiCoder.decode(types, encoded) as ModuleData; + return defaultAbiCoder.decode(types, calldata) as ModuleData; } diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 092124ae08..79f5d8a598 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -1,5 +1,28 @@ # @lens-protocol/client +## 2.0.0-alpha.37 + +### Minor Changes + +- 469940deb: **feat:** added Frames module + + - `client.frames.createFrameTypedData` - create Frame action typed data to be signed by user wallet + - `client.frames.signFrameAction` - sign Frame action with Lens Manager if enabled + - `client.frames.verifyFrameSignature` - verify Frame signature + + **feat:** added support for Identity Token + + - `client.authentication.getIdentityToken` - retrieve Identity Token from authenticated LensClient + - `client.authentication.verify({ identityToken })` - verify the token, notice new argument format + +### Patch Changes + +- dbb1657e3: **fix:** adds missing `small` and `medium` aliases to `EncryptedImageSet` and `ImageSet` fragments. +- 4183f686a: **chore:** exported missing gql types +- Updated dependencies [cdaf25268] +- Updated dependencies [4183f686a] + - @lens-protocol/blockchain-bindings@0.10.0-alpha.27 + ## 2.0.0-alpha.36 ### Patch Changes diff --git a/packages/client/package.json b/packages/client/package.json index ac54d12ce1..607248e9cd 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@lens-protocol/client", - "version": "2.0.0-alpha.36", + "version": "2.0.0-alpha.37", "description": "Low level Lens API client", "repository": { "directory": "packages/client", diff --git a/packages/client/src/LensClient.ts b/packages/client/src/LensClient.ts index 085bf43526..bddaf9b08b 100644 --- a/packages/client/src/LensClient.ts +++ b/packages/client/src/LensClient.ts @@ -7,6 +7,7 @@ import { QueryParams } from './queryParams'; import { Explore, Feed, + Frames, Handle, Invites, Modules, @@ -108,6 +109,13 @@ export class LensClient { return new Feed(this.context, this._authentication); } + /** + * The Frames module + */ + get frames(): Frames { + return new Frames(this.context, this._authentication); + } + /** * The Handle module */ diff --git a/packages/client/src/authentication/Authentication.ts b/packages/client/src/authentication/Authentication.ts index 4d7fe2eb41..5595cc563d 100644 --- a/packages/client/src/authentication/Authentication.ts +++ b/packages/client/src/authentication/Authentication.ts @@ -13,6 +13,7 @@ import type { ChallengeRequest, RevokeAuthenticationRequest, SignedAuthChallenge, + VerifyRequest, WalletAuthenticationToProfileAuthenticationRequest, } from '../graphql/types.generated'; import { buildAuthorizationHeader } from '../helpers/buildAuthorizationHeader'; @@ -39,7 +40,7 @@ export class Authentication implements IAuthentication { } async authenticateWith({ refreshToken }: { refreshToken: string }): Promise { - const credentials = new Credentials(undefined, refreshToken); + const credentials = new Credentials(undefined, undefined, refreshToken); await this.credentials.set(credentials); } @@ -59,8 +60,10 @@ export class Authentication implements IAuthentication { }); } - async verify(accessToken: string): Promise { - return this.api.verify(accessToken); + async verify(request: string | VerifyRequest): Promise { + const correctRequest = typeof request === 'string' ? { accessToken: request } : request; + + return this.api.verify(correctRequest); } async isAuthenticated(): Promise { @@ -109,6 +112,31 @@ export class Authentication implements IAuthentication { return failure(new CredentialsExpiredError()); } + async getIdentityToken(): PromiseResult { + const credentials = await this.credentials.get(); + + if (!credentials) { + return failure(new NotAuthenticatedError()); + } + + if (!credentials.shouldRefresh() && credentials.identityToken) { + return success(credentials.identityToken); + } + + if (credentials.canRefresh()) { + const newCredentials = await this.api.refresh(credentials.refreshToken); + await this.credentials.set(newCredentials); + + if (!newCredentials.identityToken) { + return failure(new CredentialsExpiredError()); + } + + return success(newCredentials.identityToken); + } + + return failure(new CredentialsExpiredError()); + } + async getProfileId(): Promise { const result = await this.getCredentials(); diff --git a/packages/client/src/authentication/IAuthentication.ts b/packages/client/src/authentication/IAuthentication.ts index 8f2d2a9a20..c171d18b6b 100644 --- a/packages/client/src/authentication/IAuthentication.ts +++ b/packages/client/src/authentication/IAuthentication.ts @@ -6,6 +6,7 @@ import type { ChallengeRequest, RevokeAuthenticationRequest, SignedAuthChallenge, + VerifyRequest, WalletAuthenticationToProfileAuthenticationRequest, } from '../graphql/types.generated'; import type { PaginatedResult } from '../helpers/buildPaginatedQueryResult'; @@ -55,12 +56,22 @@ export interface IAuthentication { ): PromiseResult; /** - * Verify that the access token is signed by the server and the user. + * Check the validity of the provided token. * - * @param accessToken - The access token to verify - * @returns Whether the access token is valid + * @deprecated Use with {@link VerifyRequest} instead. + * + * @param request - Access token as a string + * @returns Whether the provided token is valid + */ + verify(request: string): Promise; + + /** + * Check the validity of the provided token. + * + * @param request - Verify request + * @returns Whether the provided token is valid */ - verify(accessToken: string): Promise; + verify(request: VerifyRequest): Promise; /** * Check if the user is authenticated. If the credentials are expired, try to refresh them. @@ -76,6 +87,13 @@ export interface IAuthentication { */ getAccessToken(): PromiseResult; + /** + * Get the identity token. If it expired, try to refresh it. + * + * @returns A Result with the identity token or possible error scenarios + */ + getIdentityToken(): PromiseResult; + /** * Get the authenticated profile id. * diff --git a/packages/client/src/authentication/adapters/AuthenticationApi.ts b/packages/client/src/authentication/adapters/AuthenticationApi.ts index 3e473a3833..ceed3f1b9e 100644 --- a/packages/client/src/authentication/adapters/AuthenticationApi.ts +++ b/packages/client/src/authentication/adapters/AuthenticationApi.ts @@ -5,6 +5,7 @@ import type { ChallengeRequest, RevokeAuthenticationRequest, SignedAuthChallenge, + VerifyRequest, WalletAuthenticationToProfileAuthenticationRequest, } from '../../graphql/types.generated'; import { @@ -33,27 +34,27 @@ export class AuthenticationApi { return result.data.result; } - async verify(accessToken: string): Promise { - const result = await this.sdk.AuthVerify({ request: { accessToken } }); + async verify(request: VerifyRequest): Promise { + const result = await this.sdk.AuthVerify({ request }); return result.data.result; } async authenticate(request: SignedAuthChallenge): Promise { const result = await this.sdk.AuthAuthenticate({ request }); - const { accessToken, refreshToken } = result.data.result; + const { accessToken, identityToken, refreshToken } = result.data.result; - const credentials = new Credentials(accessToken, refreshToken); + const credentials = new Credentials(accessToken, identityToken, refreshToken); credentials.checkClock(); return credentials; } - async refresh(refreshToken: string): Promise { - const result = await this.sdk.AuthRefresh({ request: { refreshToken } }); - const { accessToken: newAccessToken, refreshToken: newRefreshToken } = result.data.result; + async refresh(currentRefreshToken: string): Promise { + const result = await this.sdk.AuthRefresh({ request: { refreshToken: currentRefreshToken } }); + const { accessToken, identityToken, refreshToken } = result.data.result; - const credentials = new Credentials(newAccessToken, newRefreshToken); + const credentials = new Credentials(accessToken, identityToken, refreshToken); credentials.checkClock(); return credentials; @@ -64,9 +65,9 @@ export class AuthenticationApi { headers?: Record, ): Promise { const result = await this.sdk.WalletAuthenticationToProfileAuthentication({ request }, headers); - const { accessToken, refreshToken } = result.data.result; + const { accessToken, identityToken, refreshToken } = result.data.result; - const credentials = new Credentials(accessToken, refreshToken); + const credentials = new Credentials(accessToken, identityToken, refreshToken); return credentials; } diff --git a/packages/client/src/authentication/adapters/Credentials.spec.ts b/packages/client/src/authentication/adapters/Credentials.spec.ts index 7309941a46..5e7971571b 100644 --- a/packages/client/src/authentication/adapters/Credentials.spec.ts +++ b/packages/client/src/authentication/adapters/Credentials.spec.ts @@ -9,6 +9,7 @@ const profileSession = { refreshToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4NTYiLCJldm1BZGRyZXNzIjoiMHgzZkM0N2NkRGNGZDU5ZGNlMjA2OTRiNTc1QUZjMUQ5NDE4Njc3NWIwIiwicm9sZSI6InByb2ZpbGVfcmVmcmVzaCIsImF1dGhvcml6YXRpb25JZCI6IjA0NWM2N2I2LWIzNTEtNDVjOS1hNWE1LWM0YWQ5ODg5ZDYyYyIsImlhdCI6MTcwMTM1MzA5NiwiZXhwIjoxNzAxOTU3ODk2fQ.i2kzT4I6VBTuZvjly0TEdGN_YsuBaTDopMQU4_398kA', refreshTokenExp: 1701957896000, + identityToken: '', }; const walletSession = { @@ -18,14 +19,23 @@ const walletSession = { refreshToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4YTU2NTNlODhEOWMzNTIzODdkZURkQzc5YmNmOTlmMGFkYTYyZTljNiIsInJvbGUiOiJ3YWxsZXRfcmVmcmVzaCIsImF1dGhvcml6YXRpb25JZCI6IjMxMWVkNzNkLTZjYjMtNDRmZi05NzdmLTJjMmM1MjI4YWJiNCIsImlhdCI6MTcwMTM1NTA3NywiZXhwIjoxNzAxOTU5ODc3fQ.WTUpWsH-Fvv8U4WIwL_Sk6cpHvRSGY_vdBsy1IQrCmM', refreshTokenExp: 1701959877000, + identityToken: '', }; const buildProfileCredentials = () => { - return new Credentials(profileSession.accessToken, profileSession.refreshToken); + return new Credentials( + profileSession.accessToken, + profileSession.identityToken, + profileSession.refreshToken, + ); }; const buildWalletCredentials = () => { - return new Credentials(walletSession.accessToken, walletSession.refreshToken); + return new Credentials( + walletSession.accessToken, + walletSession.identityToken, + walletSession.refreshToken, + ); }; describe(`Given the ${Credentials.name} class`, () => { diff --git a/packages/client/src/authentication/adapters/Credentials.ts b/packages/client/src/authentication/adapters/Credentials.ts index 58695a787c..ff983ec1ca 100644 --- a/packages/client/src/authentication/adapters/Credentials.ts +++ b/packages/client/src/authentication/adapters/Credentials.ts @@ -44,6 +44,7 @@ function isProfileJwtContent(decodedJwt: DecodedJwt): decodedJwt is ProfileJwtPa export class Credentials { constructor( readonly accessToken: string | undefined, + readonly identityToken: string | undefined, readonly refreshToken: string, ) {} diff --git a/packages/client/src/authentication/adapters/CredentialsStorage.spec.ts b/packages/client/src/authentication/adapters/CredentialsStorage.spec.ts index 13aac31ecc..4b9f24a473 100644 --- a/packages/client/src/authentication/adapters/CredentialsStorage.spec.ts +++ b/packages/client/src/authentication/adapters/CredentialsStorage.spec.ts @@ -5,6 +5,7 @@ import { CredentialsStorage } from './CredentialsStorage'; const accessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4YjE5QzI4OTBjZjk0N0FEM2YwYjdkN0U1QTlmZkJjZTM2ZDNmOWJkMiIsInJvbGUiOiJub3JtYWwiLCJpYXQiOjE2Mzc3NTQ2ODEsImV4cCI6MTYzNzc1NDc0MX0.Be1eGBvVuFL4fj4pHHqc0yWDledsgS2GP3Jgonmy-xw'; +const identityToken = ''; const refreshToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4YjE5QzI4OTBjZjk0N0FEM2YwYjdkN0U1QTlmZkJjZTM2ZDNmOWJkMiIsInJvbGUiOiJyZWZyZXNoIiwiaWF0IjoxNjM3NzU0NjgxLCJleHAiOjE2Mzc3NTQ5ODF9.3SqgsVMyqFPBcem2W9Iog91SWC8cIAFixXBkDue73Rc'; @@ -13,7 +14,7 @@ describe(`Given the ${CredentialsStorage.name} class`, () => { it(`should make the credentials available with ${CredentialsStorage.prototype.get.name} method`, async () => { const storage = new CredentialsStorage(new InMemoryStorageProvider(), 'namespace'); - const creds = new Credentials(accessToken, refreshToken); + const creds = new Credentials(accessToken, identityToken, refreshToken); await storage.set(creds); const storedCreds = await storage.get(); diff --git a/packages/client/src/authentication/adapters/CredentialsStorage.ts b/packages/client/src/authentication/adapters/CredentialsStorage.ts index 631fa2d7dd..65069b662b 100644 --- a/packages/client/src/authentication/adapters/CredentialsStorage.ts +++ b/packages/client/src/authentication/adapters/CredentialsStorage.ts @@ -18,14 +18,16 @@ import { Credentials } from './Credentials'; export class CredentialsStorage implements IStorage { private refreshTokenStorage: IStorage; private accessToken: string | undefined; + private identityToken: string | undefined; constructor(storageProvider: IStorageProvider, namespace: string) { const authStorageSchema = new CredentialsStorageSchema(`lens.${namespace}.credentials`); this.refreshTokenStorage = Storage.createForSchema(authStorageSchema, storageProvider); } - async set({ accessToken, refreshToken }: Credentials): Promise { + async set({ accessToken, identityToken, refreshToken }: Credentials): Promise { this.accessToken = accessToken; + this.identityToken = identityToken; await this.refreshTokenStorage.set({ refreshToken }); } @@ -38,12 +40,14 @@ export class CredentialsStorage implements IStorage { } const accessToken = this.accessToken; + const identityToken = this.identityToken; - return new Credentials(accessToken, refreshToken); + return new Credentials(accessToken, identityToken, refreshToken); } async reset(): Promise { this.accessToken = undefined; + this.identityToken = undefined; await this.refreshTokenStorage.reset(); } diff --git a/packages/client/src/authentication/graphql/auth.generated.ts b/packages/client/src/authentication/graphql/auth.generated.ts index def259d397..ff1a8a00b5 100644 --- a/packages/client/src/authentication/graphql/auth.generated.ts +++ b/packages/client/src/authentication/graphql/auth.generated.ts @@ -48,20 +48,24 @@ export type AuthAuthenticateMutationVariables = Types.Exact<{ request: Types.SignedAuthChallenge; }>; -export type AuthAuthenticateMutation = { result: { accessToken: string; refreshToken: string } }; +export type AuthAuthenticateMutation = { + result: { accessToken: string; refreshToken: string; identityToken: string }; +}; export type AuthRefreshMutationVariables = Types.Exact<{ request: Types.RefreshRequest; }>; -export type AuthRefreshMutation = { result: { accessToken: string; refreshToken: string } }; +export type AuthRefreshMutation = { + result: { accessToken: string; refreshToken: string; identityToken: string }; +}; export type WalletAuthenticationToProfileAuthenticationMutationVariables = Types.Exact<{ request: Types.WalletAuthenticationToProfileAuthenticationRequest; }>; export type WalletAuthenticationToProfileAuthenticationMutation = { - result: { accessToken: string; refreshToken: string }; + result: { accessToken: string; refreshToken: string; identityToken: string }; }; export type RevokeAuthenticationMutationVariables = Types.Exact<{ @@ -388,6 +392,7 @@ export const AuthAuthenticateDocument = { selections: [ { kind: 'Field', name: { kind: 'Name', value: 'accessToken' } }, { kind: 'Field', name: { kind: 'Name', value: 'refreshToken' } }, + { kind: 'Field', name: { kind: 'Name', value: 'identityToken' } }, ], }, }, @@ -432,6 +437,7 @@ export const AuthRefreshDocument = { selections: [ { kind: 'Field', name: { kind: 'Name', value: 'accessToken' } }, { kind: 'Field', name: { kind: 'Name', value: 'refreshToken' } }, + { kind: 'Field', name: { kind: 'Name', value: 'identityToken' } }, ], }, }, @@ -479,6 +485,7 @@ export const WalletAuthenticationToProfileAuthenticationDocument = { selections: [ { kind: 'Field', name: { kind: 'Name', value: 'accessToken' } }, { kind: 'Field', name: { kind: 'Name', value: 'refreshToken' } }, + { kind: 'Field', name: { kind: 'Name', value: 'identityToken' } }, ], }, }, diff --git a/packages/client/src/authentication/graphql/auth.graphql b/packages/client/src/authentication/graphql/auth.graphql index 7349d52d04..7f237bc662 100644 --- a/packages/client/src/authentication/graphql/auth.graphql +++ b/packages/client/src/authentication/graphql/auth.graphql @@ -47,6 +47,7 @@ mutation AuthAuthenticate($request: SignedAuthChallenge!) { result: authenticate(request: $request) { accessToken refreshToken + identityToken } } @@ -54,6 +55,7 @@ mutation AuthRefresh($request: RefreshRequest!) { result: refresh(request: $request) { accessToken refreshToken + identityToken } } @@ -63,6 +65,7 @@ mutation WalletAuthenticationToProfileAuthentication( result: walletAuthenticationToProfileAuthentication(request: $request) { accessToken refreshToken + identityToken } } diff --git a/packages/client/src/graphql/fragments.generated.ts b/packages/client/src/graphql/fragments.generated.ts index 1715d205c8..8eca380ee7 100644 --- a/packages/client/src/graphql/fragments.generated.ts +++ b/packages/client/src/graphql/fragments.generated.ts @@ -86,6 +86,8 @@ export type EncryptableImageSetFragment = { __typename: 'EncryptableImageSet'; raw: EncryptableImageFragment; optimized: ImageFragment | null; + small: ImageFragment | null; + medium: ImageFragment | null; }; export type VideoFragment = { __typename: 'Video'; uri: string; mimeType: string | null }; @@ -6634,6 +6636,44 @@ export const EncryptableImageSetFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -6769,6 +6809,44 @@ export const PublicationMetadataMediaAudioFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -7021,6 +7099,44 @@ export const PublicationMetadataMediaVideoFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -7166,6 +7282,44 @@ export const PublicationMetadataMediaImageFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -7539,6 +7693,44 @@ export const AudioMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -8737,6 +8929,44 @@ export const VideoMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -9934,6 +10164,44 @@ export const ImageMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -11118,6 +11386,44 @@ export const ArticleMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -12333,6 +12639,44 @@ export const EventMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -13531,6 +13875,44 @@ export const LinkMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -14715,6 +15097,44 @@ export const EmbedMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -15909,6 +16329,44 @@ export const CheckingInMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -18005,6 +18463,44 @@ export const ThreeDMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -19204,6 +19700,44 @@ export const StoryMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -20390,6 +20924,44 @@ export const TransactionMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -21574,6 +22146,44 @@ export const MintMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -22760,6 +23370,44 @@ export const SpaceMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -23949,6 +24597,44 @@ export const LiveStreamMetadataV3FragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -27569,6 +28255,44 @@ export const PostFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -32887,6 +33611,44 @@ export const CommentBaseFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -38071,6 +38833,44 @@ export const QuoteBaseFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -42803,6 +43603,44 @@ export const CommentFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -49317,6 +50155,44 @@ export const QuoteFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -55831,6 +56707,44 @@ export const MirrorFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, diff --git a/packages/client/src/graphql/fragments.graphql b/packages/client/src/graphql/fragments.graphql index 6b651aacd2..69895d28d8 100644 --- a/packages/client/src/graphql/fragments.graphql +++ b/packages/client/src/graphql/fragments.graphql @@ -118,6 +118,12 @@ fragment EncryptableImageSet on EncryptableImageSet { optimized { ...Image } + small: transformed(request: $publicationImageSmallTransform) { + ...Image + } + medium: transformed(request: $publicationImageMediumTransform) { + ...Image + } } fragment Video on Video { diff --git a/packages/client/src/graphql/index.ts b/packages/client/src/graphql/index.ts index 6aadbbbdee..b4c4b930c7 100644 --- a/packages/client/src/graphql/index.ts +++ b/packages/client/src/graphql/index.ts @@ -262,6 +262,7 @@ export type { Exact, Follow, FollowStatusBulk, + FrameVerifySignature, ImageTransform, InputMaybe, Maybe, @@ -292,11 +293,13 @@ export { ExplorePublicationType, FeedEventItemType, FollowModuleType, + FrameVerifySignatureResult, HiddenCommentsType, LensProfileManagerRelayErrorReasonType, LensTransactionFailureType, LensTransactionStatusType, LimitType, + ManagedProfileVisibility, MarketplaceMetadataAttributeDisplayType, ModuleType, MomokaValidatorError, diff --git a/packages/client/src/graphql/types.generated.ts b/packages/client/src/graphql/types.generated.ts index e27ebd6f0d..19e171eb51 100644 --- a/packages/client/src/graphql/types.generated.ts +++ b/packages/client/src/graphql/types.generated.ts @@ -171,6 +171,14 @@ export type ClaimProfileWithHandleRequest = { id?: InputMaybe; }; +export type ClaimTokensRequest = { + for: ClaimableTokenType; +}; + +export enum ClaimableTokenType { + Bonsai = 'BONSAI', +} + export type CollectActionModuleInput = { multirecipientCollectOpenAction?: InputMaybe; simpleCollectOpenAction?: InputMaybe; @@ -207,6 +215,32 @@ export enum ComparisonOperatorConditionType { NotEqual = 'NOT_EQUAL', } +export type CreateFrameEip712TypedDataInput = { + /** The typed data domain */ + domain: Eip712TypedDataDomainInput; + /** The types */ + types: CreateFrameEip712TypedDataTypesInput; + /** The values */ + value: CreateFrameEip712TypedDataValueInput; +}; + +export type CreateFrameEip712TypedDataTypesInput = { + FrameData: Array; +}; + +export type CreateFrameEip712TypedDataValueInput = { + actionResponse: Scalars['String']['input']; + buttonIndex: Scalars['Int']['input']; + deadline: Scalars['UnixTimestamp']['input']; + inputText: Scalars['String']['input']; + profileId: Scalars['ProfileId']['input']; + pubId: Scalars['PublicationId']['input']; + /** The EIP-721 spec version, must be 1.0.0 */ + specVersion: Scalars['String']['input']; + state: Scalars['String']['input']; + url: Scalars['URI']['input']; +}; + export type CreateProfileRequest = { followModule?: InputMaybe; to: Scalars['EvmAddress']['input']; @@ -257,10 +291,38 @@ export type DegreesOfSeparationReferenceModuleInput = { sourceProfileId?: InputMaybe; }; +export type DidReactOnPublicationPublicationIdAndProfileId = { + profileId: Scalars['ProfileId']['input']; + publicationId: Scalars['PublicationId']['input']; +}; + +export type DidReactOnPublicationRequest = { + for: Array; + where?: InputMaybe; +}; + export type DismissRecommendedProfilesRequest = { dismiss: Array; }; +export type Eip712TypedDataDomainInput = { + /** The chainId */ + chainId: Scalars['ChainId']['input']; + /** The name of the typed data domain */ + name: Scalars['String']['input']; + /** The verifying contract */ + verifyingContract: Scalars['EvmAddress']['input']; + /** The version */ + version: Scalars['String']['input']; +}; + +export type Eip712TypedDataFieldInput = { + /** The name of the typed data field */ + name: Scalars['String']['input']; + /** The type of the typed data field */ + type: Scalars['String']['input']; +}; + /** Possible sort criteria for exploring profiles */ export enum ExploreProfilesOrderByType { CreatedOn = 'CREATED_ON', @@ -430,6 +492,48 @@ export type FollowingRequest = { orderBy?: InputMaybe; }; +export type FrameEip712Request = { + actionResponse: Scalars['String']['input']; + buttonIndex: Scalars['Int']['input']; + deadline: Scalars['UnixTimestamp']['input']; + inputText: Scalars['String']['input']; + profileId: Scalars['ProfileId']['input']; + pubId: Scalars['PublicationId']['input']; + /** The EIP-721 spec version, must be 1.0.0 */ + specVersion: Scalars['String']['input']; + state: Scalars['String']['input']; + url: Scalars['URI']['input']; +}; + +export type FrameLensManagerEip712Request = { + actionResponse: Scalars['String']['input']; + buttonIndex: Scalars['Int']['input']; + inputText: Scalars['String']['input']; + profileId: Scalars['ProfileId']['input']; + pubId: Scalars['PublicationId']['input']; + /** The EIP-721 spec version, must be 1.0.0 */ + specVersion: Scalars['String']['input']; + state: Scalars['String']['input']; + url: Scalars['URI']['input']; +}; + +export type FrameVerifySignature = { + /** The identity token */ + identityToken: Scalars['Jwt']['input']; + /** The signature */ + signature: Scalars['Signature']['input']; + /** The typed data signed */ + signedTypedData: CreateFrameEip712TypedDataInput; +}; + +export enum FrameVerifySignatureResult { + DeadlineExpired = 'DEADLINE_EXPIRED', + IdentityCannotUseProfile = 'IDENTITY_CANNOT_USE_PROFILE', + IdentityUnauthorized = 'IDENTITY_UNAUTHORIZED', + SignerAddressCannotUseProfile = 'SIGNER_ADDRESS_CANNOT_USE_PROFILE', + Verified = 'VERIFIED', +} + export type FraudReasonInput = { reason: PublicationReportingReason; subreason: PublicationReportingFraudSubreason; @@ -581,6 +685,11 @@ export type InternalNftVerifyRequest = { secret: Scalars['String']['input']; }; +export type InternalPaymentHandleInfoRequest = { + p: Scalars['String']['input']; + secret: Scalars['String']['input']; +}; + export type InternalProfileStatusRequest = { hhh: Scalars['String']['input']; secret: Scalars['String']['input']; @@ -620,6 +729,10 @@ export type LatestPaidActionsFilter = { openActionPublicationMetadataFilters?: InputMaybe; }; +export type LatestPaidActionsWhere = { + customFilters?: InputMaybe>; +}; + export type LegacyCollectRequest = { on: Scalars['PublicationId']['input']; referrer?: InputMaybe; @@ -1843,7 +1956,9 @@ export type ValidatePublicationMetadataRequest = { export type VerifyRequest = { /** The access token to verify */ - accessToken: Scalars['Jwt']['input']; + accessToken?: InputMaybe; + /** The identity token to verify */ + identityToken?: InputMaybe; }; export type WalletAuthenticationToProfileAuthenticationRequest = { diff --git a/packages/client/src/submodules/explore/graphql/explore.generated.ts b/packages/client/src/submodules/explore/graphql/explore.generated.ts index 7c93457446..68d75ef798 100644 --- a/packages/client/src/submodules/explore/graphql/explore.generated.ts +++ b/packages/client/src/submodules/explore/graphql/explore.generated.ts @@ -3050,6 +3050,44 @@ export const ExplorePublicationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, diff --git a/packages/client/src/submodules/feed/graphql/feed.generated.ts b/packages/client/src/submodules/feed/graphql/feed.generated.ts index 117fbec1cf..1580c0b046 100644 --- a/packages/client/src/submodules/feed/graphql/feed.generated.ts +++ b/packages/client/src/submodules/feed/graphql/feed.generated.ts @@ -3927,6 +3927,44 @@ export const FeedItemFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -12552,6 +12590,44 @@ export const OpenActionPaidActionFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -19414,6 +19490,44 @@ export const FeedDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -26292,6 +26406,44 @@ export const FeedHighlightsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -33101,6 +33253,44 @@ export const LatestPaidActionsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, diff --git a/packages/client/src/submodules/frames/Frames.ts b/packages/client/src/submodules/frames/Frames.ts new file mode 100644 index 0000000000..94e035f7f0 --- /dev/null +++ b/packages/client/src/submodules/frames/Frames.ts @@ -0,0 +1,131 @@ +import { PromiseResult } from '@lens-protocol/shared-kernel'; + +import type { Authentication } from '../../authentication'; +import { LensContext } from '../../context'; +import { CredentialsExpiredError, NotAuthenticatedError } from '../../errors'; +import { FetchGraphQLClient } from '../../graphql/FetchGraphQLClient'; +import { + FrameEip712Request, + FrameLensManagerEip712Request, + FrameVerifySignature, + FrameVerifySignatureResult, +} from '../../graphql/types.generated'; +import { requireAuthHeaders, sdkAuthHeaderWrapper } from '../../helpers'; +import { + CreateFrameEip712TypedDataFragment, + FrameLensManagerSignatureResultFragment, + Sdk, + getSdk, +} from './graphql/frames.generated'; + +/** + * Lens Frames + * + * @group LensClient Modules + */ +export class Frames { + private readonly sdk: Sdk; + + /** + * @internal + */ + constructor( + context: LensContext, + private readonly authentication: Authentication, + ) { + const client = new FetchGraphQLClient(context); + + this.sdk = getSdk(client, sdkAuthHeaderWrapper(authentication)); + } + + /** + * Create Frame action typed data to be signed by user wallet + * + * @param request - The request object + * @returns Typed data for Frame request + * @experimental This function might change in the future release + * + * @example + * ```ts + * const result = await client.frames.createFrameTypedData({ + * actionResponse: '0x0000000000000000000000000000000000000000', + * buttonIndex: 2, + * deadline: 1711038973, + * inputText: 'Hello, World!', + * profileId: '0x01', + * pubId: '0x01-0x01', + * specVersion: '1.0.0', + * state: '{"counter":1,"idempotency_key":"431b8b38-eb4d-455b"}', + * url: 'https://mylensframe.xyz', + * }); + * ``` + */ + async createFrameTypedData( + request: FrameEip712Request, + ): Promise { + const response = await this.sdk.CreateFrameTypedData({ request }); + return response.data.result; + } + + /** + * Sign Frame action with Lens Manager if enabled + * + * ⚠️ Requires authenticated LensClient. + * + * @param request - The request object + * @returns Signature result + * @experimental This function might change in the future release + * + * @example + * ```ts + * const result = await client.frames.signFrameAction({ + * actionResponse: '0x0000000000000000000000000000000000000000', + * buttonIndex: 2, + * inputText: 'Hello, World!', + * profileId: '0x01', + * pubId: '0x01-0x01', + * specVersion: '1.0.0', + * state: '{"counter":1,"idempotency_key":"431b8b38-eb4d-455b"}', + * url: 'https://mylensframe.xyz', + * }); + * ``` + */ + async signFrameAction( + request: FrameLensManagerEip712Request, + ): PromiseResult< + FrameLensManagerSignatureResultFragment, + CredentialsExpiredError | NotAuthenticatedError + > { + return requireAuthHeaders(this.authentication, async (headers) => { + const result = await this.sdk.SignFrameAction( + { + request, + }, + headers, + ); + + return result.data.result; + }); + } + + /** + * Verify Frame signature + * + * @param request - The request object + * @returns Verification result + * @experimental This function might change in the future release + * + * @example + * ```ts + * const result = await client.frames.verifyFrameSignature({ + * identityToken: identityToken, + * signature: data.signature, + * signedTypedData: data.signedTypedData, + * }); + * ``` + */ + async verifyFrameSignature(request: FrameVerifySignature): Promise { + const response = await this.sdk.VerifyFrameSignature({ request }); + return response.data.result; + } +} diff --git a/packages/client/src/submodules/frames/graphql/frames.generated.ts b/packages/client/src/submodules/frames/graphql/frames.generated.ts new file mode 100644 index 0000000000..05d00b74d5 --- /dev/null +++ b/packages/client/src/submodules/frames/graphql/frames.generated.ts @@ -0,0 +1,632 @@ +// @ts-nocheck +import * as Types from '../../../graphql/types.generated'; + +import { + Eip712TypedDataDomainFragment, + Eip712TypedDataFieldFragment, + ProfileFragment, + PostFragment, + QuoteFragment, + PaginatedResultInfoFragment, + CommentFragment, + MirrorFragment, + OpenActionResult_KnownCollectOpenActionResult_Fragment, + OpenActionResult_UnknownOpenActionResult_Fragment, + OptimisticStatusResultFragment, + RelaySuccessFragment, + LensProfileManagerRelayErrorFragment, +} from '../../../graphql/fragments.generated'; +import { GraphQLClient } from 'graphql-request'; +import { GraphQLClientRequestHeaders } from 'graphql-request/build/cjs/types'; +import { print } from 'graphql'; +import { DocumentNode } from 'graphql'; +export type VerifyFrameSignatureQueryVariables = Types.Exact<{ + request: Types.FrameVerifySignature; +}>; + +export type VerifyFrameSignatureQuery = { result: Types.FrameVerifySignatureResult }; + +export type CreateFrameTypedDataQueryVariables = Types.Exact<{ + request: Types.FrameEip712Request; +}>; + +export type CreateFrameTypedDataQuery = { result: CreateFrameEip712TypedDataFragment }; + +export type CreateFrameEip712TypedDataFragment = { + types: { FrameData: Array<{ name: string; type: string }> }; + domain: Eip712TypedDataDomainFragment; + value: { + specVersion: string; + url: string; + buttonIndex: number; + profileId: string; + pubId: string; + inputText: string; + state: string; + actionResponse: string; + deadline: number; + }; +}; + +export type FrameLensManagerSignatureResultFragment = { + signature: string; + signedTypedData: CreateFrameEip712TypedDataFragment; +}; + +export type SignFrameActionMutationVariables = Types.Exact<{ + request: Types.FrameLensManagerEip712Request; +}>; + +export type SignFrameActionMutation = { result: FrameLensManagerSignatureResultFragment }; + +export const CreateFrameEip712TypedDataFragmentDoc = { + kind: 'Document', + definitions: [ + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'types' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'FrameData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'type' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'domain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'FragmentSpread', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'specVersion' } }, + { kind: 'Field', name: { kind: 'Name', value: 'url' } }, + { kind: 'Field', name: { kind: 'Name', value: 'buttonIndex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'profileId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'pubId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'inputText' } }, + { kind: 'Field', name: { kind: 'Name', value: 'state' } }, + { kind: 'Field', name: { kind: 'Name', value: 'actionResponse' } }, + { kind: 'Field', name: { kind: 'Name', value: 'deadline' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'EIP712TypedDataDomain' }, + typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'chainId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'version' } }, + { kind: 'Field', name: { kind: 'Name', value: 'verifyingContract' } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const FrameLensManagerSignatureResultFragmentDoc = { + kind: 'Document', + definitions: [ + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'signedTypedData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'signature' } }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'types' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'FrameData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'type' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'domain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'FragmentSpread', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'specVersion' } }, + { kind: 'Field', name: { kind: 'Name', value: 'url' } }, + { kind: 'Field', name: { kind: 'Name', value: 'buttonIndex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'profileId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'pubId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'inputText' } }, + { kind: 'Field', name: { kind: 'Name', value: 'state' } }, + { kind: 'Field', name: { kind: 'Name', value: 'actionResponse' } }, + { kind: 'Field', name: { kind: 'Name', value: 'deadline' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'EIP712TypedDataDomain' }, + typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'chainId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'version' } }, + { kind: 'Field', name: { kind: 'Name', value: 'verifyingContract' } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const VerifyFrameSignatureDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'VerifyFrameSignature' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'FrameVerifySignature' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'result' }, + name: { kind: 'Name', value: 'verifyFrameSignature' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + }, + ], + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const CreateFrameTypedDataDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'CreateFrameTypedData' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'FrameEIP712Request' } }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'result' }, + name: { kind: 'Name', value: 'createFrameTypedData' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'types' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'FrameData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'type' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'domain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'FragmentSpread', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'specVersion' } }, + { kind: 'Field', name: { kind: 'Name', value: 'url' } }, + { kind: 'Field', name: { kind: 'Name', value: 'buttonIndex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'profileId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'pubId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'inputText' } }, + { kind: 'Field', name: { kind: 'Name', value: 'state' } }, + { kind: 'Field', name: { kind: 'Name', value: 'actionResponse' } }, + { kind: 'Field', name: { kind: 'Name', value: 'deadline' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'EIP712TypedDataDomain' }, + typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'chainId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'version' } }, + { kind: 'Field', name: { kind: 'Name', value: 'verifyingContract' } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const SignFrameActionDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'mutation', + name: { kind: 'Name', value: 'SignFrameAction' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'FrameLensManagerEIP712Request' }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'result' }, + name: { kind: 'Name', value: 'signFrameAction' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'request' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'types' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'FrameData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'type' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'domain' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'FragmentSpread', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + ], + }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'value' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'specVersion' } }, + { kind: 'Field', name: { kind: 'Name', value: 'url' } }, + { kind: 'Field', name: { kind: 'Name', value: 'buttonIndex' } }, + { kind: 'Field', name: { kind: 'Name', value: 'profileId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'pubId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'inputText' } }, + { kind: 'Field', name: { kind: 'Name', value: 'state' } }, + { kind: 'Field', name: { kind: 'Name', value: 'actionResponse' } }, + { kind: 'Field', name: { kind: 'Name', value: 'deadline' } }, + ], + }, + }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + typeCondition: { + kind: 'NamedType', + name: { kind: 'Name', value: 'FrameLensManagerSignatureResult' }, + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'signedTypedData' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { kind: 'Name', value: 'CreateFrameEIP712TypedData' }, + }, + ], + }, + }, + { kind: 'Field', name: { kind: 'Name', value: 'signature' } }, + ], + }, + }, + { + kind: 'FragmentDefinition', + name: { kind: 'Name', value: 'EIP712TypedDataDomain' }, + typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'EIP712TypedDataDomain' } }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'chainId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'version' } }, + { kind: 'Field', name: { kind: 'Name', value: 'verifyingContract' } }, + ], + }, + }, + ], +} as unknown as DocumentNode; + +export type SdkFunctionWrapper = ( + action: (requestHeaders?: Record) => Promise, + operationName: string, + operationType?: string, +) => Promise; + +const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType) => action(); +const VerifyFrameSignatureDocumentString = print(VerifyFrameSignatureDocument); +const CreateFrameTypedDataDocumentString = print(CreateFrameTypedDataDocument); +const SignFrameActionDocumentString = print(SignFrameActionDocument); +export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) { + return { + VerifyFrameSignature( + variables: VerifyFrameSignatureQueryVariables, + requestHeaders?: GraphQLClientRequestHeaders, + ): Promise<{ + data: VerifyFrameSignatureQuery; + extensions?: any; + headers: Dom.Headers; + status: number; + }> { + return withWrapper( + (wrappedRequestHeaders) => + client.rawRequest( + VerifyFrameSignatureDocumentString, + variables, + { ...requestHeaders, ...wrappedRequestHeaders }, + ), + 'VerifyFrameSignature', + 'query', + ); + }, + CreateFrameTypedData( + variables: CreateFrameTypedDataQueryVariables, + requestHeaders?: GraphQLClientRequestHeaders, + ): Promise<{ + data: CreateFrameTypedDataQuery; + extensions?: any; + headers: Dom.Headers; + status: number; + }> { + return withWrapper( + (wrappedRequestHeaders) => + client.rawRequest( + CreateFrameTypedDataDocumentString, + variables, + { ...requestHeaders, ...wrappedRequestHeaders }, + ), + 'CreateFrameTypedData', + 'query', + ); + }, + SignFrameAction( + variables: SignFrameActionMutationVariables, + requestHeaders?: GraphQLClientRequestHeaders, + ): Promise<{ + data: SignFrameActionMutation; + extensions?: any; + headers: Dom.Headers; + status: number; + }> { + return withWrapper( + (wrappedRequestHeaders) => + client.rawRequest(SignFrameActionDocumentString, variables, { + ...requestHeaders, + ...wrappedRequestHeaders, + }), + 'SignFrameAction', + 'mutation', + ); + }, + }; +} +export type Sdk = ReturnType; diff --git a/packages/client/src/submodules/frames/graphql/frames.graphql b/packages/client/src/submodules/frames/graphql/frames.graphql new file mode 100644 index 0000000000..14e7115148 --- /dev/null +++ b/packages/client/src/submodules/frames/graphql/frames.graphql @@ -0,0 +1,45 @@ +query VerifyFrameSignature($request: FrameVerifySignature!) { + result: verifyFrameSignature(request: $request) +} + +query CreateFrameTypedData($request: FrameEIP712Request!) { + result: createFrameTypedData(request: $request) { + ...CreateFrameEIP712TypedData + } +} + +fragment CreateFrameEIP712TypedData on CreateFrameEIP712TypedData { + types { + FrameData { + name + type + } + } + domain { + ...EIP712TypedDataDomain + } + value { + specVersion + url + buttonIndex + profileId + pubId + inputText + state + actionResponse + deadline + } +} + +fragment FrameLensManagerSignatureResult on FrameLensManagerSignatureResult { + signedTypedData { + ...CreateFrameEIP712TypedData + } + signature +} + +mutation SignFrameAction($request: FrameLensManagerEIP712Request!) { + result: signFrameAction(request: $request) { + ...FrameLensManagerSignatureResult + } +} diff --git a/packages/client/src/submodules/frames/index.ts b/packages/client/src/submodules/frames/index.ts new file mode 100644 index 0000000000..b280a7b0b7 --- /dev/null +++ b/packages/client/src/submodules/frames/index.ts @@ -0,0 +1,6 @@ +export * from './Frames'; + +export type { + CreateFrameEip712TypedDataFragment, + FrameLensManagerSignatureResultFragment, +} from './graphql/frames.generated'; diff --git a/packages/client/src/submodules/index.ts b/packages/client/src/submodules/index.ts index f2bccd4c48..1f33dfbd0f 100644 --- a/packages/client/src/submodules/index.ts +++ b/packages/client/src/submodules/index.ts @@ -1,5 +1,6 @@ export * from './explore'; export * from './feed'; +export * from './frames'; export * from './handle'; export * from './invites'; export * from './modules'; diff --git a/packages/client/src/submodules/notifications/graphql/notifications.generated.ts b/packages/client/src/submodules/notifications/graphql/notifications.generated.ts index 90e45ef3cf..b3372c3133 100644 --- a/packages/client/src/submodules/notifications/graphql/notifications.generated.ts +++ b/packages/client/src/submodules/notifications/graphql/notifications.generated.ts @@ -2994,6 +2994,44 @@ export const ReactionNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -9622,6 +9660,44 @@ export const CommentNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -16224,6 +16300,44 @@ export const MirrorNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -22852,6 +22966,44 @@ export const QuoteNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -30464,6 +30616,44 @@ export const ActedNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -38114,6 +38304,44 @@ export const MentionNotificationFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -45349,6 +45577,44 @@ export const NotificationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, diff --git a/packages/client/src/submodules/publication/graphql/publication.generated.ts b/packages/client/src/submodules/publication/graphql/publication.generated.ts index 9674664308..4b95978194 100644 --- a/packages/client/src/submodules/publication/graphql/publication.generated.ts +++ b/packages/client/src/submodules/publication/graphql/publication.generated.ts @@ -4478,6 +4478,44 @@ export const PublicationDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -11370,6 +11408,44 @@ export const PublicationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, diff --git a/packages/client/src/submodules/publication/submodules/bookmarks/graphql/bookmarks.generated.ts b/packages/client/src/submodules/publication/submodules/bookmarks/graphql/bookmarks.generated.ts index 4887fe5ed3..874fbd5eb8 100644 --- a/packages/client/src/submodules/publication/submodules/bookmarks/graphql/bookmarks.generated.ts +++ b/packages/client/src/submodules/publication/submodules/bookmarks/graphql/bookmarks.generated.ts @@ -3080,6 +3080,44 @@ export const PublicationBookmarksDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, diff --git a/packages/client/src/submodules/revenue/graphql/revenue.generated.ts b/packages/client/src/submodules/revenue/graphql/revenue.generated.ts index e8ae3919ad..51f94add2a 100644 --- a/packages/client/src/submodules/revenue/graphql/revenue.generated.ts +++ b/packages/client/src/submodules/revenue/graphql/revenue.generated.ts @@ -3100,6 +3100,44 @@ export const PublicationRevenueFragmentDoc = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -10035,6 +10073,44 @@ export const RevenueFromPublicationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, @@ -16957,6 +17033,44 @@ export const RevenueFromPublicationDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, diff --git a/packages/client/src/submodules/search/graphql/search.generated.ts b/packages/client/src/submodules/search/graphql/search.generated.ts index 5d397c8dc0..39bdd4e9e9 100644 --- a/packages/client/src/submodules/search/graphql/search.generated.ts +++ b/packages/client/src/submodules/search/graphql/search.generated.ts @@ -3066,6 +3066,44 @@ export const SearchPublicationsDocument = { selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], }, }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'small' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageSmallTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'medium' }, + name: { kind: 'Name', value: 'transformed' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'request' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'publicationImageMediumTransform' }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'Image' } }], + }, + }, ], }, }, diff --git a/packages/domain/CHANGELOG.md b/packages/domain/CHANGELOG.md index 8a383d5d09..81d57818ef 100644 --- a/packages/domain/CHANGELOG.md +++ b/packages/domain/CHANGELOG.md @@ -1,5 +1,12 @@ # @lens-protocol/domain +## 0.11.0-alpha.26 + +### Minor Changes + +- cdaf25268: **feat:** added `useSignFrameAction` hook + **feat:** added `useIdentityToken` hook + ## 0.11.0-alpha.25 ### Patch Changes diff --git a/packages/domain/package.json b/packages/domain/package.json index 302d3cf8f2..a5337d39f3 100644 --- a/packages/domain/package.json +++ b/packages/domain/package.json @@ -1,6 +1,6 @@ { "name": "@lens-protocol/domain", - "version": "0.11.0-alpha.25", + "version": "0.11.0-alpha.26", "description": "Critical Business Rules and Application-specific Business Rules", "exports": { "./mocks": { diff --git a/packages/domain/src/entities/FrameAction.ts b/packages/domain/src/entities/FrameAction.ts new file mode 100644 index 0000000000..e87e9109ea --- /dev/null +++ b/packages/domain/src/entities/FrameAction.ts @@ -0,0 +1,8 @@ +export type UnsignedFrameAction = { + data: TData; +}; + +export type SignedFrameAction = { + signature: string; + signedTypedData: TData; +}; diff --git a/packages/domain/src/entities/Wallet.ts b/packages/domain/src/entities/Wallet.ts index 9966e871b8..93eef42fd9 100644 --- a/packages/domain/src/entities/Wallet.ts +++ b/packages/domain/src/entities/Wallet.ts @@ -1,5 +1,6 @@ import { CryptoNativeAsset, EvmAddress, PromiseResult } from '@lens-protocol/shared-kernel'; +import { SignedFrameAction, UnsignedFrameAction } from './FrameAction'; import { Signature } from './Signature'; import { AnyTransactionRequestModel, @@ -58,6 +59,13 @@ export abstract class Wallet { PendingSigningRequestError | UserRejectedError | WalletConnectionError >; + abstract signFrameAction( + unsignedAction: UnsignedFrameAction, + ): PromiseResult< + SignedFrameAction, + PendingSigningRequestError | UserRejectedError | WalletConnectionError + >; + abstract signMessage( message: string, ): PromiseResult< diff --git a/packages/domain/src/entities/index.ts b/packages/domain/src/entities/index.ts index c1467b7ef1..d0c466fbde 100644 --- a/packages/domain/src/entities/index.ts +++ b/packages/domain/src/entities/index.ts @@ -1,5 +1,6 @@ export * from './AppId'; export * from './Credentials'; +export * from './FrameAction'; export * from './Invite'; export * from './Nft'; export * from './Profile'; diff --git a/packages/domain/src/use-cases/wallets/SignFrameAction.ts b/packages/domain/src/use-cases/wallets/SignFrameAction.ts new file mode 100644 index 0000000000..ea5f8ee99c --- /dev/null +++ b/packages/domain/src/use-cases/wallets/SignFrameAction.ts @@ -0,0 +1,49 @@ +import { UnknownObject, success } from '@lens-protocol/shared-kernel'; + +import { + PendingSigningRequestError, + SignedFrameAction, + UnsignedFrameAction, + UserRejectedError, + WalletConnectionError, +} from '../../entities'; +import { ActiveWallet } from '../authentication/ActiveWallet'; +import { IGenericResultPresenter } from '../transactions'; + +export type SignFrameActionRequest = { + input: TInput; + signless: boolean; +}; + +export interface ISignFrameActionGateway { + signFrameAction(input: TInput): Promise>; + createUnsignedFrameAction(input: TInput): Promise>; +} + +export type ISignFrameActionPresenter = IGenericResultPresenter< + SignedFrameAction, + PendingSigningRequestError | UserRejectedError | WalletConnectionError +>; + +export class SignFrameAction { + constructor( + protected readonly activeWallet: ActiveWallet, + protected readonly gateway: ISignFrameActionGateway, + protected readonly presenter: ISignFrameActionPresenter, + ) {} + + async execute(request: SignFrameActionRequest) { + if (request.signless) { + const signedAction = await this.gateway.signFrameAction(request.input); + + this.presenter.present(success(signedAction)); + return; + } + + const wallet = await this.activeWallet.requireActiveWallet(); + const unsignedAction = await this.gateway.createUnsignedFrameAction(request.input); + const signedActionResult = await wallet.signFrameAction(unsignedAction); + + this.presenter.present(signedActionResult); + } +} diff --git a/packages/domain/src/use-cases/wallets/index.ts b/packages/domain/src/use-cases/wallets/index.ts index ccea7b2a84..b7a938dd56 100644 --- a/packages/domain/src/use-cases/wallets/index.ts +++ b/packages/domain/src/use-cases/wallets/index.ts @@ -1,3 +1,4 @@ -export * from './IWalletGateway'; export * from './InviteWallets'; +export * from './IWalletGateway'; +export * from './SignFrameAction'; export * from './TokenAvailability'; diff --git a/packages/react-native/CHANGELOG.md b/packages/react-native/CHANGELOG.md index cc5d33894a..4d6aba3417 100644 --- a/packages/react-native/CHANGELOG.md +++ b/packages/react-native/CHANGELOG.md @@ -1,5 +1,27 @@ # @lens-protocol/react-native +## 2.0.0-alpha.37 + +### Minor Changes + +- cdaf25268: **feat:** added `useSignFrameAction` hook + **feat:** added `useIdentityToken` hook + +### Patch Changes + +- dbb1657e3: **fix:** adds missing `small` and `medium` aliases to `EncryptedImageSet` and `ImageSet` fragments. +- 95f361c8b: **fix:** `useAccessToken` not picking up all possible token changes +- 69c04be1d: **fix:** proactive refresh credentials +- 4183f686a: **chore:** exported missing gql types +- Updated dependencies [cdaf25268] +- Updated dependencies [dbb1657e3] +- Updated dependencies [95f361c8b] +- Updated dependencies [69c04be1d] +- Updated dependencies [4183f686a] + - @lens-protocol/api-bindings@0.11.0-alpha.33 + - @lens-protocol/domain@0.11.0-alpha.26 + - @lens-protocol/react@2.0.0-alpha.37 + ## 0.1.0-alpha.13 ### Minor Changes diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 8b2df1aeca..2e4df5e593 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -1,6 +1,6 @@ { "name": "@lens-protocol/react-native", - "version": "0.1.0-alpha.13", + "version": "2.0.0-alpha.37", "description": "Lens Protocol SDK for React Native", "main": "dist/lens-protocol-react-native.cjs.js", "module": "dist/lens-protocol-react-native.esm.js", diff --git a/packages/react-web/CHANGELOG.md b/packages/react-web/CHANGELOG.md index 1cfb7e2ad7..340ecc1eb7 100644 --- a/packages/react-web/CHANGELOG.md +++ b/packages/react-web/CHANGELOG.md @@ -1,5 +1,26 @@ # @lens-protocol/react-web +## 2.0.0-alpha.37 + +### Minor Changes + +- cdaf25268: **feat:** added `useSignFrameAction` hook + **feat:** added `useIdentityToken` hook + +### Patch Changes + +- dbb1657e3: **fix:** adds missing `small` and `medium` aliases to `EncryptedImageSet` and `ImageSet` fragments. +- 95f361c8b: **fix:** `useAccessToken` not picking up all possible token changes +- 69c04be1d: **fix:** proactive refresh credentials +- 4183f686a: **chore:** exported missing gql types +- Updated dependencies [cdaf25268] +- Updated dependencies [dbb1657e3] +- Updated dependencies [95f361c8b] +- Updated dependencies [69c04be1d] +- Updated dependencies [4183f686a] + - @lens-protocol/domain@0.11.0-alpha.26 + - @lens-protocol/react@2.0.0-alpha.37 + ## 2.0.0-alpha.36 ### Minor Changes diff --git a/packages/react-web/package.json b/packages/react-web/package.json index f9f9784c53..eb73ebcba2 100644 --- a/packages/react-web/package.json +++ b/packages/react-web/package.json @@ -1,6 +1,6 @@ { "name": "@lens-protocol/react-web", - "version": "2.0.0-alpha.36", + "version": "2.0.0-alpha.37", "description": "Lens Protocol SDK for React web applications", "main": "dist/lens-protocol-react-web.cjs.js", "module": "dist/lens-protocol-react-web.esm.js", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index a14c0ca020..af59ab21a3 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,25 @@ # @lens-protocol/react +## 2.0.0-alpha.37 + +### Minor Changes + +- cdaf25268: **feat:** added `useSignFrameAction` hook + **feat:** added `useIdentityToken` hook + +### Patch Changes + +- dbb1657e3: **fix:** adds missing `small` and `medium` aliases to `EncryptedImageSet` and `ImageSet` fragments. +- 95f361c8b: **fix:** `useAccessToken` not picking up all possible token changes +- 69c04be1d: **fix:** proactive refresh credentials +- 4183f686a: **chore:** exported missing gql types +- Updated dependencies [cdaf25268] +- Updated dependencies [dbb1657e3] +- Updated dependencies [4183f686a] + - @lens-protocol/blockchain-bindings@0.10.0-alpha.27 + - @lens-protocol/api-bindings@0.11.0-alpha.33 + - @lens-protocol/domain@0.11.0-alpha.26 + ## 2.0.0-alpha.36 ### Minor Changes diff --git a/packages/react/package.json b/packages/react/package.json index 21b07427d7..c130e7af1e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@lens-protocol/react", - "version": "2.0.0-alpha.36", + "version": "2.0.0-alpha.37", "description": "Interacting with the Lens Protocol API using React.", "main": "dist/lens-protocol-react.cjs.js", "module": "dist/lens-protocol-react.esm.js", diff --git a/packages/react/src/authentication/adapters/AccessTokenStorage.ts b/packages/react/src/authentication/adapters/AccessTokenStorage.ts deleted file mode 100644 index d1e3161cd3..0000000000 --- a/packages/react/src/authentication/adapters/AccessTokenStorage.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { IAccessTokenStorage } from '@lens-protocol/api-bindings'; -import { CredentialsExpiredError } from '@lens-protocol/domain/use-cases/authentication'; -import { PromiseResult, failure, invariant, success } from '@lens-protocol/shared-kernel'; - -import { AuthApi } from './AuthApi'; -import { Callback, ICredentialsExpiryEmitter } from './CredentialsExpiryController'; -import { CredentialsStorage } from './CredentialsStorage'; - -export type Unsubscribe = () => void; - -export class AccessTokenStorage implements IAccessTokenStorage, ICredentialsExpiryEmitter { - private isRefreshing = false; - - private expiryListeners: Set = new Set(); - private refreshListeners: Set = new Set(); - - constructor( - private readonly authApi: AuthApi, - private readonly credentialsStorage: CredentialsStorage, - ) {} - - onExpiry(callback: Callback): Unsubscribe { - this.expiryListeners.add(callback); - return () => this.expiryListeners.delete(callback); - } - - onRefresh(callback: Callback): Unsubscribe { - this.refreshListeners.add(callback); - return () => this.refreshListeners.delete(callback); - } - - getAccessToken(): string | null { - return this.credentialsStorage.getAccessToken(); - } - - async refreshToken(): PromiseResult { - invariant(this.isRefreshing === false, 'Cannot refresh token while refreshing'); - this.isRefreshing = true; - - const result = await this.refreshCredentials(); - - this.isRefreshing = false; - - if (result.isSuccess()) { - this.emitRefreshEvent(); - } else { - this.emitExpiryEvent(); - } - return result; - } - - private async refreshCredentials(): PromiseResult { - const credentials = await this.credentialsStorage.get(); - - if (!credentials || !credentials.canRefresh()) { - return failure(new CredentialsExpiredError()); - } - try { - const newCredentials = await this.authApi.refreshCredentials(credentials.refreshToken); - await this.credentialsStorage.set(newCredentials); - return success(); - } catch { - return failure(new CredentialsExpiredError()); - } - } - - private emitExpiryEvent() { - this.expiryListeners.forEach((callback) => callback()); - } - - private emitRefreshEvent() { - this.refreshListeners.forEach((callback) => callback()); - } -} diff --git a/packages/react/src/authentication/adapters/AuthApi.ts b/packages/react/src/authentication/adapters/AuthApi.ts index 175c4b6211..9adab5896a 100644 --- a/packages/react/src/authentication/adapters/AuthApi.ts +++ b/packages/react/src/authentication/adapters/AuthApi.ts @@ -43,9 +43,9 @@ export class AuthApi { variables: { request }, }); - const { accessToken, refreshToken } = result.data.result; + const { accessToken, identityToken, refreshToken } = result.data.result; - return new JwtCredentials(accessToken, refreshToken); + return new JwtCredentials(accessToken, identityToken, refreshToken); } async refreshCredentials(refreshToken: string): Promise { @@ -54,8 +54,12 @@ export class AuthApi { variables: { request: { refreshToken } }, }); - const { accessToken: newAccessToken, refreshToken: newRefreshToken } = result.data.result; + const { + accessToken: newAccessToken, + identityToken: newIdentityToken, + refreshToken: newRefreshToken, + } = result.data.result; - return new JwtCredentials(newAccessToken, newRefreshToken); + return new JwtCredentials(newAccessToken, newIdentityToken, newRefreshToken); } } diff --git a/packages/react/src/authentication/adapters/CredentialsExpiryController.ts b/packages/react/src/authentication/adapters/CredentialsExpiryController.ts deleted file mode 100644 index a887b89832..0000000000 --- a/packages/react/src/authentication/adapters/CredentialsExpiryController.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Logout, LogoutReason } from '@lens-protocol/domain/use-cases/authentication'; - -export type Callback = () => void; - -export interface ICredentialsExpiryEmitter { - onExpiry(callback: Callback): void; -} - -export class CredentialsExpiryController { - constructor(readonly logout: Logout) {} - - subscribe(tokenExpiryEmitter: ICredentialsExpiryEmitter) { - tokenExpiryEmitter.onExpiry(() => { - void this.onTokenExpired(); - }); - } - - private async onTokenExpired(): Promise { - await this.logout.execute(LogoutReason.CREDENTIALS_EXPIRED); - } -} diff --git a/packages/react/src/authentication/adapters/CredentialsGateway.ts b/packages/react/src/authentication/adapters/CredentialsGateway.ts index 209237a9ef..ce1b185b5f 100644 --- a/packages/react/src/authentication/adapters/CredentialsGateway.ts +++ b/packages/react/src/authentication/adapters/CredentialsGateway.ts @@ -5,8 +5,7 @@ import { SafeApolloClient, } from '@lens-protocol/api-bindings'; import { - ICredentialsReader, - ICredentialsWriter, + ICredentialsGateway, IResettableCredentialsGateway, LogoutReason, } from '@lens-protocol/domain/use-cases/authentication'; @@ -19,9 +18,7 @@ type RevokeSessionRequest = { authorizationId: string; }; -export class CredentialsGateway - implements ICredentialsWriter, ICredentialsReader, IResettableCredentialsGateway -{ +export class CredentialsGateway implements ICredentialsGateway, IResettableCredentialsGateway { constructor( private readonly credentialsStorage: IStorage, private apolloClient: SafeApolloClient, diff --git a/packages/react/src/authentication/adapters/CredentialsStorage.ts b/packages/react/src/authentication/adapters/CredentialsStorage.ts index fb3eef67a9..01002c1657 100644 --- a/packages/react/src/authentication/adapters/CredentialsStorage.ts +++ b/packages/react/src/authentication/adapters/CredentialsStorage.ts @@ -1,33 +1,63 @@ +import { IAccessTokenStorage } from '@lens-protocol/api-bindings'; +import { + CredentialsExpiredError, + Logout, + LogoutReason, +} from '@lens-protocol/domain/use-cases/authentication'; +import { PromiseResult, failure, success } from '@lens-protocol/shared-kernel'; import { - CredentialsStorageSchema, IStorage, - IStorageProvider, PersistedCredentials, - Storage, StorageSubscriber, StorageSubscription, } from '@lens-protocol/storage'; +import { AuthApi } from './AuthApi'; import { JwtCredentials } from './JwtCredentials'; +import { TimerId, clearSafeTimeout, setSafeTimeout } from './timeout'; + +export type Unsubscribe = () => void; /** * Stores auth credentials. * Access token is kept in memory. + * Identity token is kept in memory. * Refresh token is persisted permanently. */ -export class CredentialsStorage implements IStorage { - refreshTokenStorage: IStorage; - accessToken: string | null = null; +export class CredentialsStorage implements IStorage, IAccessTokenStorage { + private refreshTimer: TimerId | null = null; + + private refreshPromise: PromiseResult | null = null; + + private subscribers: Set> = new Set(); + + private accessToken: string | null = null; + private identityToken: string | null = null; + + private logout: Logout | null = null; + + constructor( + private readonly refreshTokenStorage: IStorage, + private readonly authApi: AuthApi, + ) {} - constructor(storageProvider: IStorageProvider, namespace: string) { - const authStorageSchema = new CredentialsStorageSchema(`lens.${namespace}.credentials`); - this.refreshTokenStorage = Storage.createForSchema(authStorageSchema, storageProvider); + onExpiry(logout: Logout) { + this.logout = logout; } - async set({ accessToken, refreshToken }: JwtCredentials): Promise { - this.accessToken = accessToken; + async set(newCredentials: JwtCredentials): Promise { + this.accessToken = newCredentials.accessToken; + this.identityToken = newCredentials.identityToken; - await this.refreshTokenStorage.set({ refreshToken }); + const oldCredentials = await this.get(); + + await this.refreshTokenStorage.set({ refreshToken: newCredentials.refreshToken }); + + this.refreshTimer = setSafeTimeout( + this.refreshToken.bind(this), + newCredentials.getTokenRefreshTime(), + ); + this.notifySubscribers(newCredentials, oldCredentials); } async get(): Promise { @@ -38,23 +68,74 @@ export class CredentialsStorage implements IStorage { } const accessToken = this.getAccessToken(); + const identityToken = this.getIdentityToken(); - return new JwtCredentials(accessToken, refreshToken); + return new JwtCredentials(accessToken, identityToken, refreshToken); } async reset(): Promise { this.accessToken = null; + this.cancelScheduledRefresh(); await this.refreshTokenStorage.reset(); } - subscribe(_: StorageSubscriber): StorageSubscription { - throw new Error('Method not implemented.'); + subscribe(subscriber: StorageSubscriber): StorageSubscription { + this.subscribers.add(subscriber); + + return { + unsubscribe: () => this.subscribers.delete(subscriber), + }; } getAccessToken(): string | null { return this.accessToken; } + getIdentityToken(): string | null { + return this.identityToken; + } + + async refreshToken(): PromiseResult { + if (this.refreshPromise) { + return this.refreshPromise; + } + + this.refreshPromise = this.refreshCredentials(); + const result = await this.refreshPromise; + this.refreshPromise = null; + return result; + } + + private cancelScheduledRefresh() { + if (this.refreshTimer) { + clearSafeTimeout(this.refreshTimer); + } + this.refreshTimer = null; + } + + private async refreshCredentials(): PromiseResult { + const credentials = await this.get(); + + if (!credentials || !credentials.canRefresh()) { + return failure(new CredentialsExpiredError()); + } + try { + const newCredentials = await this.authApi.refreshCredentials(credentials.refreshToken); + await this.set(newCredentials); + return success(); + } catch { + await this.logout?.execute(LogoutReason.CREDENTIALS_EXPIRED); + return failure(new CredentialsExpiredError()); + } + } + + private notifySubscribers( + newCredentials: JwtCredentials | null, + oldCredentials: JwtCredentials | null, + ) { + this.subscribers.forEach((callback) => callback(newCredentials, oldCredentials)); + } + private async getRefreshToken(): Promise { const result = await this.refreshTokenStorage.get(); diff --git a/packages/react/src/authentication/adapters/CredentialsUpgrader.ts b/packages/react/src/authentication/adapters/CredentialsUpgrader.ts index 604d255678..7e25cf6896 100644 --- a/packages/react/src/authentication/adapters/CredentialsUpgrader.ts +++ b/packages/react/src/authentication/adapters/CredentialsUpgrader.ts @@ -25,8 +25,8 @@ export class CredentialsUpgrader implements ICredentialsUpgrader { }, }); - const { accessToken, refreshToken } = result.data.result; + const { accessToken, identityToken, refreshToken } = result.data.result; - return new JwtCredentials(accessToken, refreshToken); + return new JwtCredentials(accessToken, identityToken, refreshToken); } } diff --git a/packages/react/src/authentication/adapters/JwtCredentials.ts b/packages/react/src/authentication/adapters/JwtCredentials.ts index 19e5383816..c78b71ab35 100644 --- a/packages/react/src/authentication/adapters/JwtCredentials.ts +++ b/packages/react/src/authentication/adapters/JwtCredentials.ts @@ -28,6 +28,14 @@ function isProfileJwtContent(decodedJwt: unknown): decodedJwt is ProfileJwtPaylo return isObject(decodedJwt) && 'role' in decodedJwt && decodedJwt.role === 'profile_refresh'; } +function getTokenExpDate(token: string) { + const decodedToken = jwtDecode(token); + + invariant(decodedToken.exp, 'Exp date should be provided by JWT token'); + + return DateUtils.secondsToMs(decodedToken.exp); +} + // Threshold in seconds that will mark token as expired even it's still valid // Adds some time for all communications that's required to refresh tokens const TOKEN_EXP_THRESHOLD = DateUtils.secondsToMs(3); @@ -37,7 +45,11 @@ export class JwtCredentials implements Credentials { readonly profileId?: ProfileId; readonly authorizationId: string; - constructor(readonly accessToken: string | null, readonly refreshToken: string) { + constructor( + readonly accessToken: string | null, + readonly identityToken: string | null, + readonly refreshToken: string, + ) { const decodedRefreshToken = jwtDecode(refreshToken); if (isWalletJwtContent(decodedRefreshToken)) { @@ -58,16 +70,19 @@ export class JwtCredentials implements Credentials { canRefresh(): boolean { const now = Date.now(); - const tokenExpDate = this.getTokenExpDate(this.refreshToken); + const tokenExpDate = getTokenExpDate(this.refreshToken); return now < tokenExpDate - TOKEN_EXP_THRESHOLD; } - private getTokenExpDate(token: string) { - const decodedToken = jwtDecode(token); + getTokenRefreshTime(): number { + if (!this.accessToken) { + return 0; + } - invariant(decodedToken.exp, 'Exp date should be provided by JWT token'); + const now = Date.now(); + const tokenExpDate = getTokenExpDate(this.accessToken); - return DateUtils.secondsToMs(decodedToken.exp); + return Math.max(tokenExpDate - now - TOKEN_EXP_THRESHOLD, 0); } } diff --git a/packages/react/src/authentication/adapters/RefreshTokenStorage.ts b/packages/react/src/authentication/adapters/RefreshTokenStorage.ts new file mode 100644 index 0000000000..542b749317 --- /dev/null +++ b/packages/react/src/authentication/adapters/RefreshTokenStorage.ts @@ -0,0 +1,6 @@ +import { CredentialsStorageSchema, IStorageProvider, Storage } from '@lens-protocol/storage'; + +export function createRefreshTokenStorage(storageProvider: IStorageProvider, namespace: string) { + const schema = new CredentialsStorageSchema(`lens.${namespace}.credentials`); + return Storage.createForSchema(schema, storageProvider); +} diff --git a/packages/react/src/authentication/adapters/__helpers__/mocks.ts b/packages/react/src/authentication/adapters/__helpers__/mocks.ts index bdf1394eee..0f23ec395a 100644 --- a/packages/react/src/authentication/adapters/__helpers__/mocks.ts +++ b/packages/react/src/authentication/adapters/__helpers__/mocks.ts @@ -2,7 +2,8 @@ import { JwtCredentials } from '../JwtCredentials'; export function mockJwtCredentials(): JwtCredentials { return new JwtCredentials( - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4NTYiLCJldm1BZGRyZXNzIjoiMHgzZkM0N2NkRGNGZDU5ZGNlMjA2OTRiNTc1QUZjMUQ5NDE4Njc3NWIwIiwicm9sZSI6InByb2ZpbGUiLCJhdXRob3JpemF0aW9uSWQiOiIwNDVjNjdiNi1iMzUxLTQ1YzktYTVhNS1jNGFkOTg4OWQ2MmMiLCJpYXQiOjE3MDEzNTMwOTYsImV4cCI6MTcwMTM1NDg5Nn0.O_pQ386uVIU_Pi1aex8K4E9rWxkqXcTELE1HTaD4gwI', - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4NTYiLCJldm1BZGRyZXNzIjoiMHgzZkM0N2NkRGNGZDU5ZGNlMjA2OTRiNTc1QUZjMUQ5NDE4Njc3NWIwIiwicm9sZSI6InByb2ZpbGVfcmVmcmVzaCIsImF1dGhvcml6YXRpb25JZCI6IjA0NWM2N2I2LWIzNTEtNDVjOS1hNWE1LWM0YWQ5ODg5ZDYyYyIsImlhdCI6MTcwMTM1MzA5NiwiZXhwIjoxNzAxOTU3ODk2fQ.i2kzT4I6VBTuZvjly0TEdGN_YsuBaTDopMQU4_398kA', + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4NTgiLCJldm1BZGRyZXNzIjoiMHhhNTY1M2U4OEQ5YzM1MjM4N2RlRGRDNzliY2Y5OWYwYWRhNjJlOWM2Iiwicm9sZSI6InByb2ZpbGUiLCJhdXRob3JpemF0aW9uSWQiOiI2NDkwNjEzYi1iNzAxLTRjMTYtOTcwYi1iNTUxNGU2ZWIzNzkiLCJpYXQiOjE3MTE0NDk0NzYsImV4cCI6MTcxMTQ1MTI3Nn0.AqjrTNc1gTJTtix4WpEYfYINe2_ndkrn9OlO-gNRnFM', + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4NTgiLCJldm1BZGRyZXNzIjoiMHhhNTY1M2U4OEQ5YzM1MjM4N2RlRGRDNzliY2Y5OWYwYWRhNjJlOWM2Iiwicm9sZSI6InByb2ZpbGVfaWRlbnRpdHkiLCJhdXRob3JpemF0aW9uSWQiOiI2NDkwNjEzYi1iNzAxLTRjMTYtOTcwYi1iNTUxNGU2ZWIzNzkiLCJpYXQiOjE3MTE0NDk0NzYsImV4cCI6MTcxMTQ1MTI3Nn0.ZF2L-F6_b2RcFfzoNTkqUYDwSOIMDTNs8LdQsK2mEJE', + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjB4NTgiLCJldm1BZGRyZXNzIjoiMHhhNTY1M2U4OEQ5YzM1MjM4N2RlRGRDNzliY2Y5OWYwYWRhNjJlOWM2Iiwicm9sZSI6InByb2ZpbGVfcmVmcmVzaCIsImF1dGhvcml6YXRpb25JZCI6IjY0OTA2MTNiLWI3MDEtNGMxNi05NzBiLWI1NTE0ZTZlYjM3OSIsImlhdCI6MTcxMTQ0OTQyNywiZXhwIjoxNzEyMDU0MjI3fQ.1u3oKsFtjIWysA4W7r3xXn4OZysL-KNKLpjH5wNune4', ); } diff --git a/packages/react/src/authentication/adapters/timeout.ts b/packages/react/src/authentication/adapters/timeout.ts new file mode 100644 index 0000000000..bbdb563236 --- /dev/null +++ b/packages/react/src/authentication/adapters/timeout.ts @@ -0,0 +1,71 @@ +import { Brand } from '@lens-protocol/shared-kernel'; + +const POLLING_TIME = 1000; + +export type TimerId = Brand; + +export type SafeTimeoutOptions = { poolingTimeout: number }; + +let lastActiveTimerId = 0; +const activeTimers = new Set(); + +function safeSetTimeoutRec( + fn: () => void, + endTime: number, + timerId: TimerId, + options: SafeTimeoutOptions, +) { + const msToEnd = endTime - Date.now(); + + setTimeout( + () => { + if (!activeTimers.has(timerId)) { + return; + } + + const now = Date.now(); + + if (now >= endTime) { + activeTimers.delete(timerId); + fn(); + } else { + safeSetTimeoutRec(fn, endTime, timerId, options); + } + }, + msToEnd <= options.poolingTimeout ? msToEnd : options.poolingTimeout, + ); +} + +/** + * Safe version of `setTimeout` that should support + * 1. Large milliseconds delays (larger than 2147483647) + * 2. Hibernation/Sleep + * + * @param fn - callback to be invoked after + * @param ms - milliseconds to wait + * @param options - timer options + * + * Note: `safeSetTimeout` should be only used when really needed + * as processor overhead is bigger than with normal `setTimeout` + * @returns timerId Use `clearSafeTimeout(timerId)` to cancel timeout + */ +export function setSafeTimeout( + fn: () => void, + ms: number, + options: SafeTimeoutOptions = { poolingTimeout: POLLING_TIME }, +): TimerId { + const timerId = ++lastActiveTimerId as TimerId; + + activeTimers.add(timerId); + + safeSetTimeoutRec(fn, Date.now() + ms, timerId, options); + + return timerId; +} + +/** + * Cancel timeout created with `safeSetTimeout`. + */ +export function clearSafeTimeout(timerId: TimerId): void { + activeTimers.delete(timerId); +} diff --git a/packages/react/src/discovery/index.ts b/packages/react/src/discovery/index.ts index 050b109b1a..61ce3a7d86 100644 --- a/packages/react/src/discovery/index.ts +++ b/packages/react/src/discovery/index.ts @@ -7,4 +7,14 @@ export * from './useRecommendedProfiles'; export * from './useSearchProfiles'; export * from './useSearchPublications'; -export type { FeedItem, FeedHighlight, ExplorePublication } from '@lens-protocol/api-bindings'; +export type { + ExploreProfilesWhere, + ExplorePublication, + ExplorePublicationsWhere, + FeedHighlight, + FeedHighlightsWhere, + FeedItem, + FeedWhere, + ProfileSearchWhere, + PublicationSearchWhere, +} from '@lens-protocol/api-bindings'; diff --git a/packages/react/src/discovery/useFeed.ts b/packages/react/src/discovery/useFeed.ts index 97cde00d03..0242833469 100644 --- a/packages/react/src/discovery/useFeed.ts +++ b/packages/react/src/discovery/useFeed.ts @@ -2,10 +2,10 @@ import { FeedItem, FeedRequest, useFeed as useBaseFeedQuery } from '@lens-protoc import { SessionType, useSession } from '../authentication'; import { useLensApolloClient } from '../helpers/arguments'; -import { OmitCursor, PaginatedReadResult, usePaginatedReadResult } from '../helpers/reads'; +import { PaginatedArgs, PaginatedReadResult, usePaginatedReadResult } from '../helpers/reads'; import { useFragmentVariables } from '../helpers/variables'; -export type UseFeedArgs = OmitCursor; +export type UseFeedArgs = PaginatedArgs; /** * Fetch a the feed of a given profile and filters. diff --git a/packages/react/src/discovery/useFeedHighlights.ts b/packages/react/src/discovery/useFeedHighlights.ts index d7c5654dae..b9baf57fe2 100644 --- a/packages/react/src/discovery/useFeedHighlights.ts +++ b/packages/react/src/discovery/useFeedHighlights.ts @@ -6,10 +6,10 @@ import { import { SessionType, useSession } from '../authentication'; import { useLensApolloClient } from '../helpers/arguments'; -import { OmitCursor, PaginatedReadResult, usePaginatedReadResult } from '../helpers/reads'; +import { PaginatedArgs, PaginatedReadResult, usePaginatedReadResult } from '../helpers/reads'; import { useFragmentVariables } from '../helpers/variables'; -export type UseFeedHighlightsArgs = OmitCursor; +export type UseFeedHighlightsArgs = PaginatedArgs; /** * Fetch a the highlights of a feed for given profile and filters. diff --git a/packages/react/src/discovery/useSearchProfiles.ts b/packages/react/src/discovery/useSearchProfiles.ts index db15a00b34..ed720bd663 100644 --- a/packages/react/src/discovery/useSearchProfiles.ts +++ b/packages/react/src/discovery/useSearchProfiles.ts @@ -15,7 +15,6 @@ export type UseSearchProfilesArgs = PaginatedArgs; * * @category Discovery * @group Hooks - * @param args - {@link UseSearchProfilesArgs} * * @example * ```tsx diff --git a/packages/react/src/experimental/index.ts b/packages/react/src/experimental/index.ts index b2dcf8f12d..1da6617ad7 100644 --- a/packages/react/src/experimental/index.ts +++ b/packages/react/src/experimental/index.ts @@ -1,3 +1,4 @@ export * from './useAccessToken'; export * from './useApolloClient'; +export * from './useIdentityToken'; export * from './useStorage'; diff --git a/packages/react/src/experimental/useAccessToken.ts b/packages/react/src/experimental/useAccessToken.ts index fa7d155f49..0237084504 100644 --- a/packages/react/src/experimental/useAccessToken.ts +++ b/packages/react/src/experimental/useAccessToken.ts @@ -9,14 +9,20 @@ import { useSharedDependencies } from '../shared'; * @defaultValue `null` if not authenticated. */ export function useAccessToken() { - const { accessTokenStorage } = useSharedDependencies(); - const [token, setToken] = useState(() => accessTokenStorage.getAccessToken()); + const { credentialsStorage } = useSharedDependencies(); + const [token, setToken] = useState(() => credentialsStorage.getAccessToken()); useEffect(() => { - return accessTokenStorage.onRefresh(() => { - setToken(accessTokenStorage.getAccessToken()); + const subscription = credentialsStorage.subscribe((credentials) => { + if (!credentials) { + setToken(null); + return; + } + setToken(credentials.accessToken); }); - }, [accessTokenStorage]); + + return () => subscription.unsubscribe(); + }, [credentialsStorage]); return token; } diff --git a/packages/react/src/experimental/useIdentityToken.ts b/packages/react/src/experimental/useIdentityToken.ts new file mode 100644 index 0000000000..08d21a46a3 --- /dev/null +++ b/packages/react/src/experimental/useIdentityToken.ts @@ -0,0 +1,28 @@ +import { useEffect, useState } from 'react'; + +import { useSharedDependencies } from '../shared'; + +/** + * Returns the current identity token. + * + * @experimental This API is VERY experimental and might change in the future. + * @defaultValue `null` if not authenticated. + */ +export function useIdentityToken() { + const { credentialsStorage } = useSharedDependencies(); + const [token, setToken] = useState(() => credentialsStorage.getIdentityToken()); + + useEffect(() => { + const subscription = credentialsStorage.subscribe((credentials) => { + if (!credentials) { + setToken(null); + return; + } + setToken(credentials.identityToken); + }); + + return () => subscription.unsubscribe(); + }, [credentialsStorage]); + + return token; +} diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index e135f46a90..21f31f59f8 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -42,6 +42,7 @@ export type { CryptoAsset, CryptoNativeAmount, CryptoNativeAsset, + Data, Erc20, Erc20Amount, Erc20Info, @@ -83,13 +84,21 @@ export * from './helpers/tasks'; /** * GQL common types */ -export type { App, OptimisticStatusResult } from '@lens-protocol/api-bindings'; +export type { + App, + ImageSizeTransform, + ImageTransform, + NetworkAddress, + OptimisticStatusResult, +} from '@lens-protocol/api-bindings'; // GQL enums export { + CollectOpenActionModuleType, CommentRankingFilterType, ComparisonOperatorConditionType, CustomFiltersType, + DecryptFailReasonType, ExploreProfilesOrderByType, ExplorePublicationsOrderByType, ExplorePublicationType, @@ -97,13 +106,17 @@ export { FollowModuleType, HiddenCommentsType, LimitType, + ManagedProfileVisibility, MarketplaceMetadataAttributeDisplayType, + MetadataAttributeType, + ModuleType, NftContractType, NotificationType, OpenActionCategoryType, OpenActionModuleType, ProfileActionHistoryType, ProfileInterestTypes, + ProfilesOrderBy, PublicationContentWarningType, PublicationMetadataLicenseType, PublicationMetadataMainFocusType, @@ -124,14 +137,18 @@ export { TransactionError, UserRejectedError, WalletConnectionError, + TransactionErrorReason, + WalletConnectionErrorReason, } from '@lens-protocol/domain/entities'; export { BroadcastingError, BroadcastingErrorReason, } from '@lens-protocol/domain/use-cases/transactions'; +export { ClaimHandleError } from '@lens-protocol/domain/use-cases/profile'; export { InsufficientAllowanceError, InsufficientFundsError, + WalletAlreadyInvitedError, } from '@lens-protocol/domain/use-cases/wallets'; export { InvariantError } from '@lens-protocol/shared-kernel'; export { NotFoundError } from './NotFoundError'; diff --git a/packages/react/src/misc/adapters/SignFrameActionGateway.ts b/packages/react/src/misc/adapters/SignFrameActionGateway.ts new file mode 100644 index 0000000000..d923d86cba --- /dev/null +++ b/packages/react/src/misc/adapters/SignFrameActionGateway.ts @@ -0,0 +1,55 @@ +import { + CreateFrameEip712TypedData, + CreateFrameTypedDataData, + CreateFrameTypedDataDocument, + CreateFrameTypedDataVariables, + FrameEip712Request, + FrameLensManagerEip712Request, + SafeApolloClient, + SignFrameActionData, + SignFrameActionDocument, + SignFrameActionVariables, + omitTypename, +} from '@lens-protocol/api-bindings'; +import { SignedFrameAction, UnsignedFrameAction } from '@lens-protocol/domain/entities'; +import { ISignFrameActionGateway } from '@lens-protocol/domain/use-cases/wallets'; + +export class SignFrameActionGateway + implements ISignFrameActionGateway +{ + constructor(private apolloClient: SafeApolloClient) {} + + async signFrameAction( + request: FrameEip712Request, + ): Promise> { + // omit deadline from request + const { deadline: _, ...requestWithoutDeadline } = request; + + const result = await this.apolloClient.mutate({ + mutation: SignFrameActionDocument, + variables: { + request: requestWithoutDeadline, + }, + }); + + return omitTypename(result.data.result); + } + + async createUnsignedFrameAction( + request: FrameEip712Request, + ): Promise> { + const result = await this.apolloClient.query< + CreateFrameTypedDataData, + CreateFrameTypedDataVariables + >({ + query: CreateFrameTypedDataDocument, + variables: { + request: request, + }, + }); + + return { + data: omitTypename(result.data.result), + }; + } +} diff --git a/packages/react/src/misc/adapters/useSignFrameActionController.ts b/packages/react/src/misc/adapters/useSignFrameActionController.ts new file mode 100644 index 0000000000..be5089781b --- /dev/null +++ b/packages/react/src/misc/adapters/useSignFrameActionController.ts @@ -0,0 +1,35 @@ +import { CreateFrameEip712TypedData, FrameEip712Request } from '@lens-protocol/api-bindings'; +import { + PendingSigningRequestError, + SignedFrameAction, + UserRejectedError, + WalletConnectionError, +} from '@lens-protocol/domain/entities'; +import { SignFrameAction, SignFrameActionRequest } from '@lens-protocol/domain/use-cases/wallets'; +import { PromiseResult } from '@lens-protocol/shared-kernel'; + +import { useSharedDependencies } from '../../shared'; +import { PromiseResultPresenter } from '../../transactions/adapters/PromiseResultPresenter'; +import { SignFrameActionGateway } from './SignFrameActionGateway'; + +export function useSignFrameActionController() { + const { activeWallet, apolloClient } = useSharedDependencies(); + + return async ( + request: SignFrameActionRequest, + ): PromiseResult< + SignedFrameAction, + PendingSigningRequestError | UserRejectedError | WalletConnectionError + > => { + const presenter = new PromiseResultPresenter< + SignedFrameAction, + PendingSigningRequestError | UserRejectedError | WalletConnectionError + >(); + const gateway = new SignFrameActionGateway(apolloClient); + const frameAction = new SignFrameAction(activeWallet, gateway, presenter); + + await frameAction.execute(request); + + return presenter.asResult(); + }; +} diff --git a/packages/react/src/misc/index.ts b/packages/react/src/misc/index.ts index a81c884b42..e35d1cad96 100644 --- a/packages/react/src/misc/index.ts +++ b/packages/react/src/misc/index.ts @@ -3,7 +3,12 @@ export * from './useInvitedProfiles'; export * from './useInviteWallets'; export * from './useModuleMetadata'; export * from './useResolveAddress'; +export * from './useSignFrameAction'; export * from './useValidateHandle'; export * from './useWasWalletInvited'; -export type { InvitedResult } from '@lens-protocol/api-bindings'; +export type { + CreateFrameEip712TypedData, + InvitedResult, + ModuleMetadata, +} from '@lens-protocol/api-bindings'; diff --git a/packages/react/src/misc/useSignFrameAction.ts b/packages/react/src/misc/useSignFrameAction.ts new file mode 100644 index 0000000000..4e06c4cd01 --- /dev/null +++ b/packages/react/src/misc/useSignFrameAction.ts @@ -0,0 +1,60 @@ +import { CreateFrameEip712TypedData, FrameEip712Request } from '@lens-protocol/api-bindings'; +import { + PendingSigningRequestError, + SignedFrameAction as SignedFrameActionEntity, + UserRejectedError, + WalletConnectionError, +} from '@lens-protocol/domain/entities'; +import { Prettify, invariant, success } from '@lens-protocol/shared-kernel'; + +import { SessionType, useSession } from '../authentication'; +import { UseDeferredTask, useDeferredTask } from '../helpers/tasks'; +import { useSignFrameActionController } from './adapters/useSignFrameActionController'; + +export type SignFrameActionArgs = Prettify< + Omit & { + deadline?: FrameEip712Request['deadline']; + } +>; + +export type SignedFrameAction = SignedFrameActionEntity; + +const DEFAULT_DEADLINE = 30 * 60 * 1000; // 30 minutes + +/** + * Sign a Frame action to be verified by a Frame server. + * + * You MUST be authenticated via {@link useLogin} to use this hook. + * + * @category Misc + * @group Hooks + */ +export function useSignFrameAction(): UseDeferredTask< + SignedFrameAction, + PendingSigningRequestError | UserRejectedError | WalletConnectionError, + SignFrameActionArgs +> { + const { data: session } = useSession(); + const sign = useSignFrameActionController(); + + return useDeferredTask(async (args) => { + invariant( + session?.type === SessionType.WithProfile, + 'You must be authenticated with a profile. Use `useLogin` hook to authenticate.', + ); + + const result = await sign({ + input: { + ...args, + deadline: args.deadline || new Date(Date.now() + DEFAULT_DEADLINE).getTime(), + }, + signless: session.profile.signless, + }); + + if (result.isFailure()) { + return result; + } + + return success(result.value); + }); +} diff --git a/packages/react/src/notifications/index.ts b/packages/react/src/notifications/index.ts index 68231f3292..34d111b824 100644 --- a/packages/react/src/notifications/index.ts +++ b/packages/react/src/notifications/index.ts @@ -6,6 +6,12 @@ export type { FollowNotification, MentionNotification, MirrorNotification, + NotificationWhere, + OpenActionProfileActed, + ProfileMirrorResult, + ProfileReactedResult, QuoteNotification, + ReactedResult, + ReactionEvent, ReactionNotification, } from '@lens-protocol/api-bindings'; diff --git a/packages/react/src/profile/useRecommendProfileToggle.ts b/packages/react/src/profile/useRecommendProfileToggle.ts index 60debe2915..2faf1cdd30 100644 --- a/packages/react/src/profile/useRecommendProfileToggle.ts +++ b/packages/react/src/profile/useRecommendProfileToggle.ts @@ -31,7 +31,6 @@ export type UseRecommendProfileToggleArgs = { * * @category Profiles * @group Hooks - * @param args - {@link UseRecommendProfileToggleArgs} */ export function useRecommendProfileToggle(): UseDeferredTask< void, diff --git a/packages/react/src/publication/index.ts b/packages/react/src/publication/index.ts index 53179f73b5..eefb1c1dcb 100644 --- a/packages/react/src/publication/index.ts +++ b/packages/react/src/publication/index.ts @@ -19,12 +19,30 @@ export * from './useWhoReactedToPublication'; */ export type { AnyPublication, + ArticleMetadataV3, + Audio, + AudioMetadataV3, + CheckingInMetadataV3, Comment, DegreesOfSeparationReferenceModuleSettings, + EmbedMetadataV3, + EncryptableAudio, + EncryptableAudioSet, + EncryptableImage, + EncryptableImageSet, + EncryptableVideo, + EncryptableVideoSet, + EventMetadataV3, FollowOnlyReferenceModuleSettings, + GeoLocation, + Image, + ImageMetadataV3, + ImageSet, LegacyAaveFeeCollectModuleSettings, + LegacyDegreesOfSeparationReferenceModuleSettings, LegacyErc4626FeeCollectModuleSettings, LegacyFeeCollectModuleSettings, + LegacyFollowOnlyReferenceModuleSettings, LegacyFreeCollectModuleSettings, LegacyLimitedFeeCollectModuleSettings, LegacyLimitedTimedFeeCollectModuleSettings, @@ -32,20 +50,49 @@ export type { LegacyRevertCollectModuleSettings, LegacySimpleCollectModuleSettings, LegacyTimedFeeCollectModuleSettings, + LinkMetadataV3, + LiveStreamMetadataV3, + MarketplaceMetadata, + MintMetadataV3, Mirror, MomokaInfo, MultirecipientFeeCollectOpenActionSettings, + OpenActionFilter, Post, PrimaryPublication, + ProfileCoverSet, + ProfileMentioned, ProfileWhoReactedResult, + PublicationBookmarksWhere, + PublicationCommentOn, + PublicationCommentOnRanking, + PublicationMarketplaceMetadataAttribute, PublicationMetadata, + PublicationMetadataContentWarningFilter, + PublicationMetadataFilters, + PublicationMetadataLitEncryption, PublicationMetadataMedia, + PublicationMetadataMediaAudio, + PublicationMetadataMediaImage, + PublicationMetadataMediaVideo, + PublicationMetadataTagsFilter, PublicationOperations, PublicationStats, + PublicationsWhere, Quote, SimpleCollectOpenActionSettings, + SpaceMetadataV3, + StoryMetadataV3, + TextOnlyMetadataV3, + ThreeDMetadataV3, + ThreeDMetadataV3Asset, + TransactionMetadataV3, UnknownOpenActionModuleSettings, UnknownReferenceModuleSettings, + Video, + VideoMetadataV3, + WhoActedOnPublicationWhere, + WhoReactedPublicationWhere, } from '@lens-protocol/api-bindings'; /** @@ -65,10 +112,12 @@ export { } from '@lens-protocol/api-bindings'; export type { AnyoneReferencePolicy, + CollectFee, CollectModuleSettings, CollectPolicy, DegreesOfSeparationReferencePolicy, FollowersOnlyReferencePolicy, + MultirecipientCollectFee, NoReferencePolicy, ReferenceModule, ReferencePolicy, diff --git a/packages/react/src/publication/useBookmarkToggle.ts b/packages/react/src/publication/useBookmarkToggle.ts index 9ae8fe2105..4f29cdc204 100644 --- a/packages/react/src/publication/useBookmarkToggle.ts +++ b/packages/react/src/publication/useBookmarkToggle.ts @@ -9,8 +9,6 @@ export type UseBookmarkToggleArgs = { publication: AnyPublication; }; -export type BookmarkOperation = UseDeferredTask; - /** * `useBookmarkToggle` hook lets the user save or remove a publication from their bookmarks. * @@ -21,7 +19,6 @@ export type BookmarkOperation = UseDeferredTask { const { data: session } = useSession(); diff --git a/packages/react/src/publication/useHidePublication.ts b/packages/react/src/publication/useHidePublication.ts index 5110f11ba4..3bd172c030 100644 --- a/packages/react/src/publication/useHidePublication.ts +++ b/packages/react/src/publication/useHidePublication.ts @@ -35,7 +35,6 @@ export type UseHidePublicationArgs = { * * @category Publications * @group Hooks - * @param args - {@link UseHidePublicationArgs} */ export function useHidePublication(): UseDeferredTask { const { data: session } = useSession(); diff --git a/packages/react/src/publication/useNotInterestedToggle.ts b/packages/react/src/publication/useNotInterestedToggle.ts index e805f105c6..16e0adafd2 100644 --- a/packages/react/src/publication/useNotInterestedToggle.ts +++ b/packages/react/src/publication/useNotInterestedToggle.ts @@ -9,8 +9,6 @@ export type UseNotInterestedToggleArgs = { publication: AnyPublication; }; -export type NotInterestedOperation = UseDeferredTask; - /** * `useNotInterestedToggle` hook let's the active profile toggle the not interested status of a publication. * @@ -37,7 +35,7 @@ export type NotInterestedOperation = UseDeferredTask { const { data: session } = useSession(); const { add, remove } = useNotInterestedController(); diff --git a/packages/react/src/shared.tsx b/packages/react/src/shared.tsx index 8c6973811c..63f7239e41 100644 --- a/packages/react/src/shared.tsx +++ b/packages/react/src/shared.tsx @@ -15,13 +15,12 @@ import { invariant } from '@lens-protocol/shared-kernel'; import { IStorage } from '@lens-protocol/storage'; import React, { ReactNode, useContext } from 'react'; -import { AccessTokenStorage } from './authentication/adapters/AccessTokenStorage'; import { AuthApi } from './authentication/adapters/AuthApi'; -import { CredentialsExpiryController } from './authentication/adapters/CredentialsExpiryController'; import { CredentialsFactory } from './authentication/adapters/CredentialsFactory'; import { CredentialsGateway } from './authentication/adapters/CredentialsGateway'; import { CredentialsStorage } from './authentication/adapters/CredentialsStorage'; import { LogoutPresenter } from './authentication/adapters/LogoutPresenter'; +import { createRefreshTokenStorage } from './authentication/adapters/RefreshTokenStorage'; import { BaseConfig, RequiredConfig, resolveConfig } from './config'; import { createInboxKeyStorage, DisableConversationsGateway } from './inbox'; import { IProfileCacheManager } from './profile/adapters/IProfileCacheManager'; @@ -66,8 +65,10 @@ export function createSharedDependencies(userConfig: BaseConfig): SharedDependen const authApi = new AuthApi(anonymousApolloClient); // storages - const credentialsStorage = new CredentialsStorage(config.storage, config.environment.name); - const accessTokenStorage = new AccessTokenStorage(authApi, credentialsStorage); + const credentialsStorage = new CredentialsStorage( + createRefreshTokenStorage(config.storage, config.environment.name), + authApi, + ); const transactionStorage = createTransactionStorage(config.storage, config.environment.name); const inboxKeyStorage = createInboxKeyStorage(config.storage, config.environment.name); @@ -75,7 +76,7 @@ export function createSharedDependencies(userConfig: BaseConfig): SharedDependen const apolloClient = createLensApolloClient({ connectToDevTools: config.debug, uri: config.environment.backend, - accessTokenStorage, + accessTokenStorage: credentialsStorage, pollingInterval: config.environment.timings.pollingInterval, logger: config.logger, origin: config.origin, @@ -153,14 +154,13 @@ export function createSharedDependencies(userConfig: BaseConfig): SharedDependen ); // controllers - const credentialsExpiryController = new CredentialsExpiryController(logout); - credentialsExpiryController.subscribe(accessTokenStorage); + credentialsStorage.onExpiry(logout); return { - accessTokenStorage, activeWallet, apolloClient, config, + credentialsStorage, credentialsFactory, credentialsGateway, inboxKeyStorage, @@ -182,10 +182,10 @@ export function createSharedDependencies(userConfig: BaseConfig): SharedDependen * @internal */ export type SharedDependencies = { - accessTokenStorage: AccessTokenStorage; activeWallet: ActiveWallet; apolloClient: SafeApolloClient; config: RequiredConfig; + credentialsStorage: CredentialsStorage; credentialsFactory: CredentialsFactory; credentialsGateway: CredentialsGateway; inboxKeyStorage: IStorage; diff --git a/packages/react/src/transactions/publications/optimistic.ts b/packages/react/src/transactions/publications/optimistic.ts index 77fab4cfe1..6709d66a15 100644 --- a/packages/react/src/transactions/publications/optimistic.ts +++ b/packages/react/src/transactions/publications/optimistic.ts @@ -30,6 +30,8 @@ function encryptableImageSet(uri: string): gql.EncryptableImageSet { width: null, }, optimized: null, + small: null, + medium: null, }; } diff --git a/packages/react/src/transactions/useBlockProfiles.ts b/packages/react/src/transactions/useBlockProfiles.ts index c6c33c7f43..0ed993efad 100644 --- a/packages/react/src/transactions/useBlockProfiles.ts +++ b/packages/react/src/transactions/useBlockProfiles.ts @@ -41,19 +41,6 @@ export type BlockProfileArgs = { sponsored?: boolean; }; -export type BlockOperation = UseDeferredTask< - AsyncTransactionResult, - | BroadcastingError - | InsufficientAllowanceError - | InsufficientFundsError - | InsufficientGasError - | PendingSigningRequestError - | TransactionError - | UserRejectedError - | WalletConnectionError, - BlockProfileArgs ->; - /** * Block one or many profiles. * @@ -61,7 +48,6 @@ export type BlockOperation = UseDeferredTask< * * @category Profiles * @group Hooks - * @param args - {@link BlockProfileArgs} * * @example * ```ts @@ -246,7 +232,18 @@ export type BlockOperation = UseDeferredTask< * whitelisted one (e.g. localhost). * */ -export function useBlockProfiles(): BlockOperation { +export function useBlockProfiles(): UseDeferredTask< + AsyncTransactionResult, + | BroadcastingError + | InsufficientAllowanceError + | InsufficientFundsError + | InsufficientGasError + | PendingSigningRequestError + | TransactionError + | UserRejectedError + | WalletConnectionError, + BlockProfileArgs +> { const { data: session } = useSession(); const blockProfile = useBlockProfilesController(); const configureRequest = useSponsoredConfig(); diff --git a/packages/react/src/transactions/useLinkHandle.ts b/packages/react/src/transactions/useLinkHandle.ts index 2b8ac4f9b3..5ae289932e 100644 --- a/packages/react/src/transactions/useLinkHandle.ts +++ b/packages/react/src/transactions/useLinkHandle.ts @@ -43,7 +43,6 @@ export type LinkHandleArgs = { * * @category Profiles * @group Hooks - * @param args - {@link LinkHandleArgs} * * @example * ```tsx diff --git a/packages/react/src/transactions/useSetProfileMetadata.ts b/packages/react/src/transactions/useSetProfileMetadata.ts index 9b1e3bec65..e0bf38d983 100644 --- a/packages/react/src/transactions/useSetProfileMetadata.ts +++ b/packages/react/src/transactions/useSetProfileMetadata.ts @@ -219,7 +219,6 @@ export type UseSetProfileMetadataArgs = { * * @category Profiles * @group Hooks - * @param args - {@link UseSetProfileMetadataArgs} */ export function useSetProfileMetadata(): UseDeferredTask< AsyncTransactionResult, @@ -234,7 +233,7 @@ export function useSetProfileMetadata(): UseDeferredTask< const { data: session } = useSession(); const configureRequest = useSponsoredConfig(); - return useDeferredTask(async (args: UseSetProfileMetadataArgs) => { + return useDeferredTask(async (args) => { invariant( session?.type === SessionType.WithProfile, 'You must be authenticated to set profile metadata. Use `useLogin` hook to authenticate.', diff --git a/packages/react/src/transactions/useUnblockProfiles.ts b/packages/react/src/transactions/useUnblockProfiles.ts index 3aa39c7a18..774757513c 100644 --- a/packages/react/src/transactions/useUnblockProfiles.ts +++ b/packages/react/src/transactions/useUnblockProfiles.ts @@ -40,18 +40,6 @@ export type UnblockProfileArgs = { sponsored?: boolean; }; -export type UnblockOperation = UseDeferredTask< - AsyncTransactionResult, - | BroadcastingError - | InsufficientAllowanceError - | InsufficientFundsError - | InsufficientGasError - | PendingSigningRequestError - | UserRejectedError - | WalletConnectionError, - UnblockProfileArgs ->; - /** * Unblock one or many profiles. * @@ -59,7 +47,6 @@ export type UnblockOperation = UseDeferredTask< * * @category Profiles * @group Hooks - * @param args - {@link UnblockProfileArgs} * * @example * ```ts @@ -83,7 +70,7 @@ export type UnblockOperation = UseDeferredTask< * * ## Unblock multiple profiles * - * Unbblock multiple profiles. + * Unblock multiple profiles. * * ```tsx * const { execute, loading, error } = useUnblockProfiles(); @@ -244,7 +231,17 @@ export type UnblockOperation = UseDeferredTask< * whitelisted one (e.g. localhost). * */ -export function useUnblockProfiles(): UnblockOperation { +export function useUnblockProfiles(): UseDeferredTask< + AsyncTransactionResult, + | BroadcastingError + | InsufficientAllowanceError + | InsufficientFundsError + | InsufficientGasError + | PendingSigningRequestError + | UserRejectedError + | WalletConnectionError, + UnblockProfileArgs +> { const { data: session } = useSession(); const unblockProfile = useUnblockProfilesController(); const configureRequest = useSponsoredConfig(); diff --git a/packages/react/src/transactions/useUnfollow.ts b/packages/react/src/transactions/useUnfollow.ts index 4b8b5d8939..2855f338a9 100644 --- a/packages/react/src/transactions/useUnfollow.ts +++ b/packages/react/src/transactions/useUnfollow.ts @@ -50,7 +50,6 @@ export type UnfollowArgs = { * * @category Profiles * @group Hooks - * @param args - {@link UnfollowArgs} * * @example * ```tsx diff --git a/packages/react/src/transactions/useUnlinkHandle.ts b/packages/react/src/transactions/useUnlinkHandle.ts index 3d57b70d29..12093ca9cb 100644 --- a/packages/react/src/transactions/useUnlinkHandle.ts +++ b/packages/react/src/transactions/useUnlinkHandle.ts @@ -43,7 +43,6 @@ export type UnlinkHandleArgs = { * * @category Profiles * @group Hooks - * @param args - {@link UnlinkHandleArgs} * * @example * ```tsx diff --git a/packages/react/src/transactions/useUpdateFollowPolicy.ts b/packages/react/src/transactions/useUpdateFollowPolicy.ts index 825d63c0fc..e20c521d34 100644 --- a/packages/react/src/transactions/useUpdateFollowPolicy.ts +++ b/packages/react/src/transactions/useUpdateFollowPolicy.ts @@ -47,7 +47,6 @@ export type UpdateFollowPolicyArgs = { * * @category Profiles * @group Hooks - * @param args - {@link UpdateFollowPolicyArgs} * * @example * ```tsx diff --git a/packages/react/src/transactions/useUpdateProfileManagers.ts b/packages/react/src/transactions/useUpdateProfileManagers.ts index 2340329e2d..47bb5c2320 100644 --- a/packages/react/src/transactions/useUpdateProfileManagers.ts +++ b/packages/react/src/transactions/useUpdateProfileManagers.ts @@ -194,7 +194,6 @@ export type UpdateProfileManagersArgs = AtLeastOneOf<{ * * @category Profiles * @group Hooks - * @param args - {@link UpdateProfileManagersArgs} */ export function useUpdateProfileManagers(): UseDeferredTask< void, diff --git a/packages/react/src/wallet/adapters/ConcreteWallet.ts b/packages/react/src/wallet/adapters/ConcreteWallet.ts index b358554db3..0e13cb27b9 100644 --- a/packages/react/src/wallet/adapters/ConcreteWallet.ts +++ b/packages/react/src/wallet/adapters/ConcreteWallet.ts @@ -1,20 +1,23 @@ import { TypedDataSigner, Signer } from '@ethersproject/abstract-signer'; import { ErrorCode } from '@ethersproject/logger'; import { TransactionRequest } from '@ethersproject/providers'; +import { CreateFrameEip712TypedData } from '@lens-protocol/api-bindings'; import { TypedData } from '@lens-protocol/blockchain-bindings'; import { + AnyTransactionRequestModel, InsufficientGasError, - Wallet, - WalletConnectionError, - UserRejectedError, - PendingSigningRequestError, ISignedProtocolCall, IUnsignedProtocolCall, - UnsignedTransaction, NativeTransaction, + PendingSigningRequestError, ProtocolTransactionRequestModel, - AnyTransactionRequestModel, Signature, + SignedFrameAction, + UnsignedFrameAction, + UnsignedTransaction, + UserRejectedError, + Wallet, + WalletConnectionError, } from '@lens-protocol/domain/entities'; import { AnyTransactionRequest } from '@lens-protocol/domain/use-cases/transactions'; import { @@ -155,6 +158,50 @@ export class ConcreteWallet extends Wallet { } } + async signFrameAction( + unsignedAction: UnsignedFrameAction, + ): PromiseResult< + SignedFrameAction, + PendingSigningRequestError | UserRejectedError | WalletConnectionError + > { + const result = await this.signerFactory.createSigner({ + address: this.address, + chainType: ChainType.POLYGON, + }); + + if (result.isFailure()) { + return result; + } + + if (this.signingInProgress) { + return failure(new PendingSigningRequestError()); + } + this.signingInProgress = true; + + const signer = result.value; + + const { domain, types, value } = unsignedAction.data as CreateFrameEip712TypedData; + + try { + const signature = await signer._signTypedData(domain, types, value); + + return success({ + signature: signature as Signature, + signedTypedData: unsignedAction.data, + }); + } catch (err) { + assertErrorObjectWithCode(err); + + if (isUserRejectedError(err)) { + return failure(new UserRejectedError()); + } + + throw err; + } finally { + this.signingInProgress = false; + } + } + async signMessage( message: string, ): PromiseResult< diff --git a/packages/wagmi/CHANGELOG.md b/packages/wagmi/CHANGELOG.md index 44663bf28c..b34849429f 100644 --- a/packages/wagmi/CHANGELOG.md +++ b/packages/wagmi/CHANGELOG.md @@ -1,5 +1,16 @@ # @lens-protocol/wagmi +## 4.0.0-alpha.6 + +### Patch Changes + +- Updated dependencies [cdaf25268] +- Updated dependencies [dbb1657e3] +- Updated dependencies [95f361c8b] +- Updated dependencies [69c04be1d] +- Updated dependencies [4183f686a] + - @lens-protocol/react-web@2.0.0-alpha.37 + ## 4.0.0-alpha.5 ### Patch Changes diff --git a/packages/wagmi/package.json b/packages/wagmi/package.json index f130feb1b9..c175820676 100644 --- a/packages/wagmi/package.json +++ b/packages/wagmi/package.json @@ -1,6 +1,6 @@ { "name": "@lens-protocol/wagmi", - "version": "4.0.0-alpha.5", + "version": "4.0.0-alpha.6", "description": "wagmi bindings for @lens-protocol/react", "repository": { "directory": "packages/wagmi", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 797e914084..2f13a486c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -451,9 +451,6 @@ importers: '@ethersproject/abi': specifier: ^5.7.0 version: 5.7.0 - '@ethersproject/abstract-signer': - specifier: ^5.7.0 - version: 5.7.0 '@ethersproject/contracts': specifier: ^5.7.0 version: 5.7.0 @@ -10828,7 +10825,7 @@ packages: '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/modal': 2.6.2 + '@walletconnect/modal': 2.6.2(@types/react@18.2.38)(react@18.2.0) '@walletconnect/sign-client': 2.10.6 '@walletconnect/types': 2.10.6 '@walletconnect/universal-provider': 2.10.6 @@ -10973,15 +10970,6 @@ packages: pino: 7.11.0 tslib: 1.14.1 - /@walletconnect/modal-core@2.6.2: - resolution: {integrity: sha512-cv8ibvdOJQv2B+nyxP9IIFdxvQznMz8OOr/oR/AaUZym4hjXNL/l1a2UlSQBXrVjo3xxbouMxLb3kBsHoYP2CA==} - dependencies: - valtio: 1.11.2 - transitivePeerDependencies: - - '@types/react' - - react - dev: false - /@walletconnect/modal-core@2.6.2(@types/react@18.2.38)(react@18.2.0): resolution: {integrity: sha512-cv8ibvdOJQv2B+nyxP9IIFdxvQznMz8OOr/oR/AaUZym4hjXNL/l1a2UlSQBXrVjo3xxbouMxLb3kBsHoYP2CA==} dependencies: @@ -10990,18 +10978,6 @@ packages: - '@types/react' - react - /@walletconnect/modal-ui@2.6.2: - resolution: {integrity: sha512-rbdstM1HPGvr7jprQkyPggX7rP4XiCG85ZA+zWBEX0dVQg8PpAgRUqpeub4xQKDgY7pY/xLRXSiCVdWGqvG2HA==} - dependencies: - '@walletconnect/modal-core': 2.6.2 - lit: 2.8.0 - motion: 10.16.2 - qrcode: 1.5.3 - transitivePeerDependencies: - - '@types/react' - - react - dev: false - /@walletconnect/modal-ui@2.6.2(@types/react@18.2.38)(react@18.2.0): resolution: {integrity: sha512-rbdstM1HPGvr7jprQkyPggX7rP4XiCG85ZA+zWBEX0dVQg8PpAgRUqpeub4xQKDgY7pY/xLRXSiCVdWGqvG2HA==} dependencies: @@ -11013,16 +10989,6 @@ packages: - '@types/react' - react - /@walletconnect/modal@2.6.2: - resolution: {integrity: sha512-eFopgKi8AjKf/0U4SemvcYw9zlLpx9njVN8sf6DAkowC2Md0gPU/UNEbH1Wwj407pEKnEds98pKWib1NN1ACoA==} - dependencies: - '@walletconnect/modal-core': 2.6.2 - '@walletconnect/modal-ui': 2.6.2 - transitivePeerDependencies: - - '@types/react' - - react - dev: false - /@walletconnect/modal@2.6.2(@types/react@18.2.38)(react@18.2.0): resolution: {integrity: sha512-eFopgKi8AjKf/0U4SemvcYw9zlLpx9njVN8sf6DAkowC2Md0gPU/UNEbH1Wwj407pEKnEds98pKWib1NN1ACoA==} dependencies: @@ -23831,15 +23797,6 @@ packages: resolution: {integrity: sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==} dev: true - /use-sync-external-store@1.2.0: - resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - dev: false - /use-sync-external-store@1.2.0(react@18.2.0): resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: @@ -23954,22 +23911,6 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /valtio@1.11.2: - resolution: {integrity: sha512-1XfIxnUXzyswPAPXo1P3Pdx2mq/pIqZICkWN60Hby0d9Iqb+MEIpqgYVlbflvHdrp2YR/q3jyKWRPJJ100yxaw==} - engines: {node: '>=12.20.0'} - peerDependencies: - '@types/react': '>=16.8' - react: '>=16.8' - peerDependenciesMeta: - '@types/react': - optional: true - react: - optional: true - dependencies: - proxy-compare: 2.5.1 - use-sync-external-store: 1.2.0 - dev: false - /valtio@1.11.2(@types/react@18.2.38)(react@18.2.0): resolution: {integrity: sha512-1XfIxnUXzyswPAPXo1P3Pdx2mq/pIqZICkWN60Hby0d9Iqb+MEIpqgYVlbflvHdrp2YR/q3jyKWRPJJ100yxaw==} engines: {node: '>=12.20.0'}