Skip to content

Commit

Permalink
latest schema changes
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysu committed Sep 19, 2023
1 parent 0ab4373 commit fc2468d
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 109 deletions.
6 changes: 4 additions & 2 deletions examples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"dependencies": {
"@bundlr-network/client": "^0.11.9",
"@lens-protocol/client": "workspace:*",
"@lens-protocol/metadata": "0.1.0-alpha.25",
"dotenv": "^16.0.3",
"ethers": "^5.7.2",
"uuid": "^9.0.0",
"viem": "^1.0.0"
"viem": "^1.0.0",
"zod": "^3.22.0"
},
"devDependencies": {
"@lens-protocol/eslint-config": "workspace:*",
Expand All @@ -31,7 +33,7 @@
"@types/uuid": "^9.0.0",
"prettier": "^2.8.4",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
"typescript": "^5.1.6"
},
"prettier": "@lens-protocol/prettier-config"
}
14 changes: 7 additions & 7 deletions examples/node/scripts/profile/changeProfileManagers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeProfileManagerActionType, isRelaySuccess } from '@lens-protocol/client';
import { isRelaySuccess } from '@lens-protocol/client';

import { getAuthenticatedClientFromEthersWallet } from '../shared/getAuthenticatedClient';
import { setupWallet } from '../shared/setupWallet';
Expand All @@ -9,12 +9,12 @@ async function main() {

const typedDataResult = await lensClient.profile.createChangeProfileManagersTypedData({
approveLensManager: true,
changeManagers: [
{
action: ChangeProfileManagerActionType.Add,
address: '0x0000000000',
},
],
// changeManagers: [
// {
// action: ChangeProfileManagerActionType.Add,
// address: '0x0000000000',
// },
// ],
});

const { id, typedData } = typedDataResult.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function main() {
forProfileId: profileId,
});

if (profile.sponsor) {
if (profile.lensManager) {
console.log('Profile manager is enabled');
} else {
console.log('Profile manager is disabled');
Expand Down
4 changes: 2 additions & 2 deletions examples/node/scripts/profile/fetchProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ async function main() {

// by id
const profileById = await lensClient.profile.fetch({
forProfileId: '0x0635',
forProfileId: '0x01',
});

console.log(`Profile fetched by id: `, { id: profileById.id, handle: profileById.handle });

// by handle
const profileByHandle = await lensClient.profile.fetch({
forHandle: 'lensprotocol.test',
forHandle: 'test/@firstprofile',
});

console.log(`Profile fetched by handle: `, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ async function main() {
const wallet = setupWallet();
const client = await getAuthenticatedClientFromEthersWallet(wallet);

const contentURI = 'https://arweave.net/Ff8hn9iT0RXG3S_l0_AbYRb1OzY-4WS9QDRsEHBQpgw'; // await uploadWithBundlr(metadata);

const resultTypedData = await client.publication.createOnchainPostTypedData({
contentURI: 'ipfs://Qm...', // or arweave
contentURI,
referenceModule: {
followerOnlyReferenceModule: false, // anybody can comment or mirror
},
Expand Down
72 changes: 36 additions & 36 deletions packages/client/src/graphql/fragments.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@ export type NetworkAddressFragment = { address: string; chainId: string };

export type ImageFragment = {
uri: string;
mimeType: Types.ImageMimeType | null;
mimeType: string | null;
width: number | null;
height: number | null;
};

export type VideoFragment = { uri: string; mimeType: Types.VideoMimeType | null };
export type VideoFragment = { uri: string; mimeType: string | null };

export type VideoSetFragment = { raw: VideoFragment; optimized: VideoFragment | null };

export type EncryptableVideoFragment = { mimeType: Types.VideoMimeType | null; uri: string };
export type EncryptableVideoFragment = { mimeType: string | null; uri: string };

export type EncryptableVideoSetFragment = {
raw: EncryptableVideoFragment;
optimized: VideoFragment | null;
};

export type AudioFragment = { uri: string; mimeType: Types.AudioMimeType | null };
export type AudioFragment = { uri: string; mimeType: string | null };

export type AudioSetFragment = { raw: AudioFragment; optimized: AudioFragment | null };

export type EncryptableAudioFragment = { mimeType: Types.AudioMimeType | null; uri: string };
export type EncryptableAudioFragment = { mimeType: string | null; uri: string };

export type EncryptableAudioSetFragment = {
raw: EncryptableAudioFragment;
Expand Down Expand Up @@ -171,17 +171,17 @@ export type SimpleCollectOpenActionSettingsFragment = {
recipient: string;
referralFee: number;
followerOnly: boolean;
collectLimitOptional: string | null;
endTimestampOptional: string | null;
collectLimit: string | null;
endsAt: string | null;
contract: NetworkAddressFragment;
amountOptional: AmountFragment | null;
amount: AmountFragment;
};

export type MultirecipientFeeCollectOpenActionSettingsFragment = {
referralFee: number;
followerOnly: boolean;
collectLimitOptional: string | null;
endTimestampOptional: string | null;
collectLimit: string | null;
endsAt: string | null;
contract: NetworkAddressFragment;
amount: AmountFragment;
recipients: Array<{ recipient: string; split: number }>;
Expand All @@ -206,7 +206,7 @@ export type LegacyFeeCollectModuleSettingsFragment = {
};

export type LegacyLimitedFeeCollectModuleSettingsFragment = {
collectLimit: string;
collectLimit: string | null;
recipient: string;
referralFee: number;
followerOnly: boolean;
Expand All @@ -215,7 +215,7 @@ export type LegacyLimitedFeeCollectModuleSettingsFragment = {
};

export type LegacyLimitedTimedFeeCollectModuleSettingsFragment = {
collectLimit: string;
collectLimit: string | null;
recipient: string;
referralFee: number;
followerOnly: boolean;
Expand All @@ -238,8 +238,8 @@ export type LegacyTimedFeeCollectModuleSettingsFragment = {
export type LegacyMultirecipientFeeCollectModuleSettingsFragment = {
referralFee: number;
followerOnly: boolean;
collectLimitOptional: string | null;
endTimestampOptional: string | null;
collectLimit: string | null;
endsAt: string | null;
contract: NetworkAddressFragment;
amount: AmountFragment;
recipients: Array<{ recipient: string; split: number }>;
Expand All @@ -249,18 +249,18 @@ export type LegacySimpleCollectModuleSettingsFragment = {
recipient: string;
referralFee: number;
followerOnly: boolean;
collectLimitOptional: string | null;
endTimestampOptional: string | null;
collectLimit: string | null;
endsAt: string | null;
contract: NetworkAddressFragment;
amountOptional: AmountFragment | null;
amount: AmountFragment;
};

export type LegacyErc4626FeeCollectModuleSettingsFragment = {
recipient: string;
referralFee: number;
followerOnly: boolean;
collectLimitOptional: string | null;
endTimestampOptional: string | null;
collectLimit: string | null;
endsAt: string | null;
contract: NetworkAddressFragment;
vault: NetworkAddressFragment;
amount: AmountFragment;
Expand All @@ -270,8 +270,8 @@ export type LegacyAaveFeeCollectModuleSettingsFragment = {
recipient: string;
referralFee: number;
followerOnly: boolean;
collectLimitOptional: string | null;
endTimestampOptional: string | null;
collectLimit: string | null;
endsAt: string | null;
contract: NetworkAddressFragment;
amount: AmountFragment;
};
Expand Down Expand Up @@ -381,7 +381,7 @@ export type PublicationImageSetFragment = {

export type EncryptableImageFragment = {
uri: string;
mimeType: Types.ImageMimeType | null;
mimeType: string | null;
width: number | null;
height: number | null;
};
Expand Down Expand Up @@ -2435,8 +2435,8 @@ export const LegacyMultirecipientFeeCollectModuleSettingsFragmentDoc = gql`
}
referralFee
followerOnly
collectLimitOptional: collectLimit
endTimestampOptional: endTimestamp
collectLimit
endsAt
}
${NetworkAddressFragmentDoc}
${AmountFragmentDoc}
Expand All @@ -2446,14 +2446,14 @@ export const LegacySimpleCollectModuleSettingsFragmentDoc = gql`
contract {
...NetworkAddress
}
amountOptional: amount {
amount {
...Amount
}
recipient
referralFee
followerOnly
collectLimitOptional: collectLimit
endTimestampOptional: endTimestamp
collectLimit
endsAt
}
${NetworkAddressFragmentDoc}
${AmountFragmentDoc}
Expand All @@ -2472,8 +2472,8 @@ export const LegacyErc4626FeeCollectModuleSettingsFragmentDoc = gql`
recipient
referralFee
followerOnly
collectLimitOptional: collectLimit
endTimestampOptional: endTimestamp
collectLimit
endsAt
}
${NetworkAddressFragmentDoc}
${AmountFragmentDoc}
Expand All @@ -2489,8 +2489,8 @@ export const LegacyAaveFeeCollectModuleSettingsFragmentDoc = gql`
recipient
referralFee
followerOnly
collectLimitOptional: collectLimit
endTimestampOptional: endTimestamp
collectLimit
endsAt
}
${NetworkAddressFragmentDoc}
${AmountFragmentDoc}
Expand All @@ -2509,8 +2509,8 @@ export const MultirecipientFeeCollectOpenActionSettingsFragmentDoc = gql`
}
referralFee
followerOnly
collectLimitOptional: collectLimit
endTimestampOptional: endTimestamp
collectLimit
endsAt
}
${NetworkAddressFragmentDoc}
${AmountFragmentDoc}
Expand All @@ -2520,14 +2520,14 @@ export const SimpleCollectOpenActionSettingsFragmentDoc = gql`
contract {
...NetworkAddress
}
amountOptional: amount {
amount {
...Amount
}
recipient
referralFee
followerOnly
collectLimitOptional: collectLimit
endTimestampOptional: endTimestamp
collectLimit
endsAt
}
${NetworkAddressFragmentDoc}
${AmountFragmentDoc}
Expand Down
Loading

0 comments on commit fc2468d

Please sign in to comment.