Skip to content

Commit

Permalink
Fixes Gasless into sponsor field (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarenaldi authored Sep 18, 2023
1 parent 8dd3913 commit e76750f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ async function main() {
const lensClient = await getAuthenticatedClientFromEthersWallet(wallet);

const profile = await lensClient.profile.fetch({
profileId: 'your-profile-id',
forProfileId: 'your-profile-id',
});

if (profile.gasless.enabled) {
if (profile.sponsor) {
console.log('Profile manager is enabled');
} else {
console.log('Profile manager is disabled');
Expand Down
20 changes: 4 additions & 16 deletions packages/client/src/graphql/fragments.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export type UnknownFollowModuleSettingsFragment = {
contract: NetworkAddressFragment;
};

export type GaslessFragment = { enabled: boolean; relay: NetworkAddressFragment | null };

export type NetworkAddressFragment = { address: string; chainId: string };

export type ImageFragment = {
Expand Down Expand Up @@ -100,12 +98,13 @@ export type ProfileFieldsFragment = {
__typename: 'Profile';
id: string;
handle: string | null;
sponsor: boolean;
lensManager: boolean;
interests: Array<string>;
invitesLeft: number | null;
createdAt: string;
metadata: { rawURI: string; displayName: string | null; bio: string | null } | null;
ownedBy: NetworkAddressFragment;
gasless: GaslessFragment;
followModule:
| FeeFollowModuleSettingsFragment
| RevertFollowModuleSettingsFragment
Expand Down Expand Up @@ -986,15 +985,6 @@ export const NetworkAddressFragmentDoc = gql`
chainId
}
`;
export const GaslessFragmentDoc = gql`
fragment Gasless on Gasless {
enabled
relay {
...NetworkAddress
}
}
${NetworkAddressFragmentDoc}
`;
export const Erc20FragmentDoc = gql`
fragment Erc20 on Erc20 {
name
Expand Down Expand Up @@ -1084,9 +1074,8 @@ export const ProfileFieldsFragmentDoc = gql`
ownedBy {
...NetworkAddress
}
gasless {
...Gasless
}
sponsor
lensManager
followModule {
... on FeeFollowModuleSettings {
...FeeFollowModuleSettings
Expand Down Expand Up @@ -1142,7 +1131,6 @@ export const ProfileFieldsFragmentDoc = gql`
createdAt
}
${NetworkAddressFragmentDoc}
${GaslessFragmentDoc}
${FeeFollowModuleSettingsFragmentDoc}
${RevertFollowModuleSettingsFragmentDoc}
${UnknownFollowModuleSettingsFragmentDoc}
Expand Down
12 changes: 2 additions & 10 deletions packages/client/src/graphql/fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ fragment UnknownFollowModuleSettings on UnknownFollowModuleSettings {
followModuleReturnData
}

fragment Gasless on Gasless {
enabled
relay {
...NetworkAddress
}
}

fragment NetworkAddress on NetworkAddress {
address
chainId
Expand Down Expand Up @@ -199,9 +192,8 @@ fragment ProfileFields on Profile {
ownedBy {
...NetworkAddress
}
gasless {
...Gasless
}
sponsor
lensManager
followModule {
... on FeeFollowModuleSettings {
...FeeFollowModuleSettings
Expand Down
1 change: 0 additions & 1 deletion packages/client/src/graphql/types.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ export enum ImageMimeType {
Jpeg = 'JPEG',
Jpg = 'JPG',
Png = 'PNG',
Svg = 'SVG',
SvgXml = 'SVG_XML',
Tiff = 'TIFF',
Webp = 'WEBP',
Expand Down

0 comments on commit e76750f

Please sign in to comment.