Skip to content

Commit

Permalink
chore: update schema to latest version - FeeFollowModuleRedeemInput (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysu authored Oct 17, 2023
1 parent 9dd33b0 commit 01b2c2c
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 15 deletions.
8 changes: 8 additions & 0 deletions .changeset/six-tigers-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/gated-content": patch
"@lens-protocol/api-bindings": patch
"@lens-protocol/client": patch
"@lens-protocol/react": patch
---

Updated to support the latest API schema
8 changes: 6 additions & 2 deletions packages/api-bindings/src/lens/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export type ActOnOpenActionLensManagerInput = {

export type ActOnOpenActionLensManagerRequest = {
actOn: ActOnOpenActionLensManagerInput;
for?: InputMaybe<Scalars['PublicationId']>;
for: Scalars['PublicationId'];
referrers?: InputMaybe<Array<OnchainReferrer>>;
};

Expand Down Expand Up @@ -363,6 +363,10 @@ export type FeeFollowModuleInput = {
recipient: Scalars['EvmAddress'];
};

export type FeeFollowModuleRedeemInput = {
amount: AmountInput;
};

export enum FeedEventItemType {
Acted = 'ACTED',
Collect = 'COLLECT',
Expand Down Expand Up @@ -422,7 +426,7 @@ export type FollowModuleInput = {
};

export type FollowModuleRedeemInput = {
feeFollowModule?: InputMaybe<Scalars['Boolean']>;
feeFollowModule?: InputMaybe<FeeFollowModuleRedeemInput>;
unknownFollowModule?: InputMaybe<UnknownFollowModuleRedeemInput>;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@graphql-codegen/typescript-graphql-request": "^5.0.0",
"@graphql-codegen/typescript-operations": "^4.0.1",
"@lens-protocol/eslint-config": "workspace:*",
"@lens-protocol/metadata": "0.1.0-alpha.29",
"@lens-protocol/metadata": "0.1.0-alpha.30",
"@lens-protocol/prettier-config": "workspace:*",
"@lens-protocol/tsconfig": "workspace:*",
"@types/jest": "^29.5.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/client/src/graphql/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type {
AdvancedContractConditionFragment,
AmountFragment,
AndConditionFragment,
AppFragment,
Expand Down Expand Up @@ -205,6 +206,7 @@ export type {
CollectActionModuleInput,
DegreesOfSeparationReferenceModuleInput,
FeeFollowModuleInput,
FeeFollowModuleRedeemInput,
FollowModuleInput,
FollowModuleRedeemInput,
FraudReasonInput,
Expand Down Expand Up @@ -248,6 +250,7 @@ export type {
OnchainReferrer,
OpenActionFilter,
PublicationCommentOn,
PublicationCommentOnRanking,
Scalars,
SignedAuthChallenge,
TypedDataOptions,
Expand Down
13 changes: 11 additions & 2 deletions packages/client/src/graphql/types.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export type ActOnOpenActionLensManagerInput = {

export type ActOnOpenActionLensManagerRequest = {
actOn: ActOnOpenActionLensManagerInput;
for?: InputMaybe<Scalars['PublicationId']['input']>;
for: Scalars['PublicationId']['input'];
referrers?: InputMaybe<Array<OnchainReferrer>>;
};

Expand Down Expand Up @@ -310,6 +310,10 @@ export type FeeFollowModuleInput = {
recipient: Scalars['EvmAddress']['input'];
};

export type FeeFollowModuleRedeemInput = {
amount: AmountInput;
};

export enum FeedEventItemType {
Acted = 'ACTED',
Collect = 'COLLECT',
Expand Down Expand Up @@ -369,7 +373,7 @@ export type FollowModuleInput = {
};

export type FollowModuleRedeemInput = {
feeFollowModule?: InputMaybe<Scalars['Boolean']['input']>;
feeFollowModule?: InputMaybe<FeeFollowModuleRedeemInput>;
unknownFollowModule?: InputMaybe<UnknownFollowModuleRedeemInput>;
};

Expand Down Expand Up @@ -558,6 +562,11 @@ export enum LensProfileManagerRelayErrorReasonType {
RequiresSignature = 'REQUIRES_SIGNATURE',
}

export enum LensProtocolVersion {
V1 = 'V1',
V2 = 'V2',
}

export enum LensTransactionFailureType {
MetadataError = 'METADATA_ERROR',
Reverted = 'REVERTED',
Expand Down
4 changes: 2 additions & 2 deletions packages/gated-content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@graphql-codegen/typescript": "3.0.1",
"@jest/globals": "^29.4.3",
"@lens-protocol/eslint-config": "workspace:*",
"@lens-protocol/metadata": "0.1.0-alpha.29",
"@lens-protocol/metadata": "0.1.0-alpha.30",
"@lens-protocol/prettier-config": "workspace:*",
"@lens-protocol/tsconfig": "workspace:*",
"@types/jest": "29.5.3",
Expand All @@ -97,7 +97,7 @@
"@ethersproject/hash": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@ethersproject/wallet": "^5.7.0",
"@lens-protocol/metadata": "0.1.0-alpha.29",
"@lens-protocol/metadata": "0.1.0-alpha.30",
"zod": "^3.22.0"
},
"prettier": "@lens-protocol/prettier-config",
Expand Down
6 changes: 4 additions & 2 deletions packages/gated-content/src/conditions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ function toRawSimpleCondition(gqlCondition: gql.ThirdTierCondition): raw.SimpleC

case 'Erc20OwnershipCondition':
return raw.erc20OwnershipCondition({
chainId: gqlCondition.amount.asset.contract.chainId,
condition:
raw.ConditionComparisonOperator[gqlCondition.condition] ??
never(`Not supported condition: ${gqlCondition.condition}`),
contract: gqlCondition.amount.asset.contract.address,
contract: {
chainId: gqlCondition.amount.asset.contract.chainId,
address: gqlCondition.amount.asset.contract.address,
},
decimals: gqlCondition.amount.asset.decimals,
value: gqlCondition.amount.value,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ function resolveProfileFollow(request: FollowRequest): Follow[] {
{
profileId: request.profileId,
followModule: {
feeFollowModule: true,
feeFollowModule: {
amount: {
currency: request.fee.amount.asset.address,
value: request.fee.amount.toSignificantDigits(),
},
},
},
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ describe(`Given an instance of ${FollowProfileGateway.name}`, () => {
{
profileId: request.profileId,
followModule: {
feeFollowModule: true,
feeFollowModule: {
amount: {
currency: request.fee.amount.asset.address,
value: request.fee.amount.toSignificantDigits(),
},
},
},
},
],
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 01b2c2c

Please sign in to comment.