Skip to content

Commit

Permalink
Supports protocolSharedRevenueCollectOpenAction input
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarenaldi committed May 16, 2024
1 parent 1583121 commit e4e9a08
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
7 changes: 6 additions & 1 deletion packages/api-bindings/src/lens/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export type Scalars = {

export type ActOnOpenActionInput = {
multirecipientCollectOpenAction?: InputMaybe<Scalars['Boolean']>;
protocolSharedRevenueCollectOpenAction?: InputMaybe<Scalars['Boolean']>;
protocolSharedRevenueCollectOpenAction?: InputMaybe<ProtocolSharedRevenueActRedeemInput>;
simpleCollectOpenAction?: InputMaybe<Scalars['Boolean']>;
unknownOpenAction?: InputMaybe<UnknownOpenActionActRedeemInput>;
};
Expand Down Expand Up @@ -1454,6 +1454,11 @@ export type ProfilesRequestWhere = {
whoQuotedPublication?: InputMaybe<Scalars['PublicationId']>;
};

export type ProtocolSharedRevenueActRedeemInput = {
/** The frontend app address that the collector uses */
executorClient?: InputMaybe<Scalars['EvmAddress']>;
};

export type ProtocolSharedRevenueCollectModuleInput = {
amount?: InputMaybe<AmountInput>;
collectLimit?: InputMaybe<Scalars['String']>;
Expand Down
7 changes: 6 additions & 1 deletion packages/client/src/graphql/types.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export type Scalars = {

export type ActOnOpenActionInput = {
multirecipientCollectOpenAction?: InputMaybe<Scalars['Boolean']['input']>;
protocolSharedRevenueCollectOpenAction?: InputMaybe<Scalars['Boolean']['input']>;
protocolSharedRevenueCollectOpenAction?: InputMaybe<ProtocolSharedRevenueActRedeemInput>;
simpleCollectOpenAction?: InputMaybe<Scalars['Boolean']['input']>;
unknownOpenAction?: InputMaybe<UnknownOpenActionActRedeemInput>;
};
Expand Down Expand Up @@ -1444,6 +1444,11 @@ export type ProfilesRequestWhere = {
whoQuotedPublication?: InputMaybe<Scalars['PublicationId']['input']>;
};

export type ProtocolSharedRevenueActRedeemInput = {
/** The frontend app address that the collector uses */
executorClient?: InputMaybe<Scalars['EvmAddress']['input']>;
};

export type ProtocolSharedRevenueCollectModuleInput = {
amount?: InputMaybe<AmountInput>;
collectLimit?: InputMaybe<Scalars['String']['input']>;
Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/transactions/adapters/OpenActionGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,12 @@ export class OpenActionGateway
referrers: resolveOnchainReferrers(request.referrers),
};
case AllOpenActionType.SHARED_REVENUE_COLLECT:
// TODO handle executor client address
return {
for: request.publicationId,
actOn: {
protocolSharedRevenueCollectOpenAction: true,
protocolSharedRevenueCollectOpenAction: {
executorClient: request.executorClient ?? null,
},
},
referrers: resolveOnchainReferrers(request.referrers),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ describe(`Given an instance of ${OpenActionGateway.name}`, () => {
request: {
for: publicationId,
actOn: {
protocolSharedRevenueCollectOpenAction: true,
protocolSharedRevenueCollectOpenAction: {
executorClient: null,
},
},
referrers: expectedOnChainReferrers,
},
Expand Down Expand Up @@ -285,7 +287,9 @@ describe(`Given an instance of ${OpenActionGateway.name}`, () => {
request: {
for: publicationId,
actOn: {
protocolSharedRevenueCollectOpenAction: true,
protocolSharedRevenueCollectOpenAction: {
executorClient: null,
},
},
referrers: expectedOnChainReferrers,
},
Expand Down Expand Up @@ -497,11 +501,14 @@ describe(`Given an instance of ${OpenActionGateway.name}`, () => {
referrers,
public: true,
fee: mockCollectFee(),
executorClient: '0xAbAe21DD8737DbdCa26A16D6210D9293986800f9',
}),
expectedRequest: {
for: publicationId,
actOn: {
protocolSharedRevenueCollectOpenAction: true,
protocolSharedRevenueCollectOpenAction: {
executorClient: '0xAbAe21DD8737DbdCa26A16D6210D9293986800f9',
},
},
referrers: expectedOnChainReferrers,
},
Expand Down

0 comments on commit e4e9a08

Please sign in to comment.