Skip to content

Commit

Permalink
feat: support new Shared Revenue Collect module
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarenaldi committed May 6, 2024
1 parent eba11bc commit 09c4865
Show file tree
Hide file tree
Showing 14 changed files with 3,580 additions and 67 deletions.
9 changes: 9 additions & 0 deletions .changeset/weak-hairs-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@lens-protocol/react-native": minor
"@lens-protocol/react-web": minor
"@lens-protocol/react": minor
"@lens-protocol/api-bindings": patch
"@lens-protocol/domain": patch
---

**feat:** support new Shared Revenue Collect module
4 changes: 2 additions & 2 deletions packages/api-bindings/codegen-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ generates:
Void: void
schema:
# - https://api-amoy.lens-v2.crtlkey.com/ # staging
- https://api-v2-amoy.lens.dev/ # testnet
# - http://localhost:4000/
# - https://api-v2-amoy.lens.dev/ # testnet
- http://localhost:4000/
documents:
- src/lens/graphql/*.graphql
plugins:
Expand Down
12 changes: 4 additions & 8 deletions packages/api-bindings/src/apollo/cache/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import {
UnlinkHandleRequest,
} from '@lens-protocol/domain/use-cases/profile';
import {
OpenActionRequest,
AllOpenActionType,
CreateQuoteRequest,
CreateMirrorRequest,
CreateCommentRequest,
CollectRequest,
isCollectRequest,
} from '@lens-protocol/domain/use-cases/publications';
import { AnyTransactionRequest } from '@lens-protocol/domain/use-cases/transactions';

Expand Down Expand Up @@ -68,14 +68,10 @@ export function useRecentTransactionsVar() {

function isCollectTransaction(
transaction: TransactionState<AnyTransactionRequest>,
): transaction is TransactionState<OpenActionRequest> {
): transaction is TransactionState<CollectRequest> {
return (
transaction.request.kind === TransactionKind.ACT_ON_PUBLICATION &&
[
AllOpenActionType.LEGACY_COLLECT,
AllOpenActionType.SIMPLE_COLLECT,
AllOpenActionType.MULTIRECIPIENT_COLLECT,
].includes(transaction.request.type)
isCollectRequest(transaction.request)
);
}

Expand Down
27 changes: 27 additions & 0 deletions packages/api-bindings/src/lens/graphql/fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,24 @@ fragment SimpleCollectOpenActionSettings on SimpleCollectOpenActionSettings {
endsAt
}

fragment ProtocolSharedRevenueCollectOpenActionSettings on ProtocolSharedRevenueCollectOpenActionSettings {
__typename
type
contract {
...NetworkAddress
}
collectNft
amount {
...Amount
}
recipient
referralFee
followerOnly
collectLimit
endsAt
creatorClient
}

# purposefully renamed Recipient to have a better narrative
fragment Recipient on RecipientDataOutput {
# __typename not include to hide RecipientDataOutput not needed anyway here
Expand Down Expand Up @@ -1639,6 +1657,9 @@ fragment Post on Post {
... on MultirecipientFeeCollectOpenActionSettings {
...MultirecipientFeeCollectOpenActionSettings
}
... on ProtocolSharedRevenueCollectOpenActionSettings {
...ProtocolSharedRevenueCollectOpenActionSettings
}
... on SimpleCollectOpenActionSettings {
...SimpleCollectOpenActionSettings
}
Expand Down Expand Up @@ -1778,6 +1799,9 @@ fragment CommentFields on Comment {
... on MultirecipientFeeCollectOpenActionSettings {
...MultirecipientFeeCollectOpenActionSettings
}
... on ProtocolSharedRevenueCollectOpenActionSettings {
...ProtocolSharedRevenueCollectOpenActionSettings
}
... on SimpleCollectOpenActionSettings {
...SimpleCollectOpenActionSettings
}
Expand Down Expand Up @@ -1961,6 +1985,9 @@ fragment QuoteFields on Quote {
... on MultirecipientFeeCollectOpenActionSettings {
...MultirecipientFeeCollectOpenActionSettings
}
... on ProtocolSharedRevenueCollectOpenActionSettings {
...ProtocolSharedRevenueCollectOpenActionSettings
}
... on SimpleCollectOpenActionSettings {
...SimpleCollectOpenActionSettings
}
Expand Down
Loading

0 comments on commit 09c4865

Please sign in to comment.