diff --git a/apps/core-app/src/components/FilterDropdown.tsx b/apps/core-app/src/components/FilterDropdown.tsx index 74e606126..7bfc9b0fd 100644 --- a/apps/core-app/src/components/FilterDropdown.tsx +++ b/apps/core-app/src/components/FilterDropdown.tsx @@ -24,7 +24,6 @@ const IconFilter = styled(RiFilterFill)` `; type FilterDropdownProps = { - // filter: Record; filter: string; toggleFilter: (event: MouseEvent) => void; }; diff --git a/apps/core-app/src/components/MetadataSettings.tsx b/apps/core-app/src/components/MetadataSettings.tsx index 8faed59d9..aba7872bc 100644 --- a/apps/core-app/src/components/MetadataSettings.tsx +++ b/apps/core-app/src/components/MetadataSettings.tsx @@ -10,7 +10,7 @@ import { Link, } from '@daohaus/ui'; -import { TDao, useUserMembership } from '../contexts/DaoContext'; +import { TDao, useConnectedMembership } from '../contexts/DaoContext'; import { TagList } from '../components/TagList'; import { useParams } from 'react-router-dom'; import { Keychain } from '@daohaus/common-utilities'; @@ -54,13 +54,13 @@ type MetadataSettingsProps = { export const MetadataSettings = ({ dao }: MetadataSettingsProps) => { const { daochain, daoid } = useParams(); - const { userMembership } = useUserMembership(); + const { connectedMembership } = useConnectedMembership(); return ( <>

Metadata

- {userMembership && Number(userMembership.shares) && ( + {connectedMembership && Number(connectedMembership.shares) && ( diff --git a/apps/core-app/src/components/SearchInput.tsx b/apps/core-app/src/components/SearchInput.tsx index 692f90442..3100cf8c7 100644 --- a/apps/core-app/src/components/SearchInput.tsx +++ b/apps/core-app/src/components/SearchInput.tsx @@ -1,8 +1,9 @@ -import { ChangeEvent } from 'react'; +import { ChangeEvent, useEffect, useState } from 'react'; import styled from 'styled-components'; import { indigoDark } from '@radix-ui/colors'; import { BiSearch } from 'react-icons/bi'; import { Input } from '@daohaus/ui'; +import useDebounce from '../utils/debounceHook'; const StyledInput = styled(Input)` background: ${indigoDark.indigo3}; @@ -26,7 +27,7 @@ const IconSearch = styled(BiSearch)` type SearchInputProps = { searchTerm: string; - setSearchTerm: (event: ChangeEvent) => void; + setSearchTerm: (term: string) => void; totalItems: number; }; @@ -35,6 +36,24 @@ const SearchInput = ({ setSearchTerm, totalItems, }: SearchInputProps) => { + const [localSearchTerm, setLocalSearchTerm] = useState(''); + + const debouncedSearchTerm = useDebounce(localSearchTerm, 700); + + useEffect(() => { + if (localSearchTerm !== searchTerm) { + setSearchTerm(localSearchTerm); + } + // TODO: I don't want to fire on these others!! + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [debouncedSearchTerm]); + + const handleSearchTermChange = (event: ChangeEvent) => { + setLocalSearchTerm((prevState) => + prevState === event.target.value ? '' : event.target.value + ); + }; + return ( ); }; diff --git a/apps/core-app/src/contexts/DaoContext.tsx b/apps/core-app/src/contexts/DaoContext.tsx index bc7b0455b..b35c59f26 100644 --- a/apps/core-app/src/contexts/DaoContext.tsx +++ b/apps/core-app/src/contexts/DaoContext.tsx @@ -3,6 +3,7 @@ import { DaoWithTokenDataQuery, FindMemberQuery, ITransformedProposalListQuery, + ListConnectedMemberProposalsQuery, ListMembersQuery, Member_Filter, Member_OrderBy, @@ -20,9 +21,11 @@ import { useState, SetStateAction, Dispatch, + useRef, } from 'react'; import { useParams } from 'react-router-dom'; import { + loadConnectedMemberVotesList, loadDao, loadMember, loadMembersList, @@ -40,9 +43,14 @@ export const defaultDaoData = { refreshDao: async () => { return; }, - userMembership: null, - isUserMembershipLoading: false, - refreshUserMembership: async () => { + connectedMembership: null, + isConnectedMembershipLoading: false, + refreshConnectedMembership: async () => { + return; + }, + connectedMembershipProposalVotes: null, + isConnectedMembershipProposalVotesLoading: false, + refreshConnectedMembershipProposalVotes: async () => { return; }, members: null, @@ -102,10 +110,16 @@ export type DaoConnectDaoType = { refreshAll: () => Promise; }; -export type DaoConnectUserMembershipType = { - userMembership: FindMemberQuery['member'] | null | undefined; - isUserMembershipLoading: boolean; - refreshUserMembership: () => Promise; +export type DaoConnectConnectedMembershipType = { + connectedMembership: FindMemberQuery['member'] | null | undefined; + isConnectedMembershipLoading: boolean; + refreshConnectedMembership: () => Promise; + connectedMembershipProposalVotes: + | ListConnectedMemberProposalsQuery['proposals'] + | null + | undefined; + isConnectedMembershipProposalVotesLoading: boolean; + refreshConnectedMembershipProposalVotes: () => Promise; }; export type DaoConnectMembersType = { @@ -146,7 +160,7 @@ export type DaoConnectProposalsType = { interface DaoConnectType extends DaoConnectDaoType, - DaoConnectUserMembershipType, + DaoConnectConnectedMembershipType, DaoConnectMembersType, DaoConnectProposalsType {} @@ -164,10 +178,20 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { const [dao, setDao] = useState(); const [isDaoLoading, setDaoLoading] = useState(false); - const [userMembership, setUserMembership] = useState< + const [connectedMembership, setConnectedMembership] = useState< FindMemberQuery['member'] | undefined >(); - const [isUserMembershipLoading, setUserMembershipLoading] = useState(false); + const [isConnectedMembershipLoading, setConnectedMembershipLoading] = + useState(false); + + const [ + connectedMembershipProposalVotes, + setConnectedMembershipProposalVotes, + ] = useState(); + const [ + isConnectedMembershipProposalVotesLoading, + setConnectedMembershipProposalVotesLoading, + ] = useState(false); const [members, setMembers] = useState< ListMembersQuery['members'] | undefined @@ -228,8 +252,8 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { daoid, daochain: daochain as keyof Keychain, address, - setMember: setUserMembership, - setMemberLoading: setUserMembershipLoading, + setMember: setConnectedMembership, + setMemberLoading: setConnectedMembershipLoading, shouldUpdate, }); } @@ -238,9 +262,13 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { }; }, [daochain, daoid, address]); + const currentDaoMembers = useRef(null); useEffect(() => { let shouldUpdate = true; if (daoid && daochain) { + if (currentDaoMembers.current && currentDaoMembers.current !== daoid) { + setMembers(undefined); + } loadMembersList({ filter: { dao: daoid, ...membersFilter }, ordering: membersSort, @@ -251,16 +279,26 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { setNextPaging: setMembersNextPaging, shouldUpdate, }); + currentDaoMembers.current = daoid; } return () => { shouldUpdate = false; }; }, [daochain, daoid, membersFilter, membersSort, membersPaging]); + const currentDaoProposals = useRef(null); useEffect(() => { let shouldUpdate = true; + + console.log('prop useeffect fired'); if (daochain && daoid) { - console.log('proposalsFilter', proposalsFilter); + if ( + currentDaoProposals.current && + currentDaoProposals.current !== daoid + ) { + console.log('CLEAR'); + setProposals(undefined); + } loadProposalsList({ filter: { dao: daoid, ...proposalsFilter }, ordering: proposalsSort, @@ -271,6 +309,7 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { setNextPaging: setProposalsNextPaging, shouldUpdate, }); + currentDaoProposals.current = daoid; } return () => { @@ -278,11 +317,48 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { }; }, [daochain, daoid, proposalsFilter, proposalsSort, proposalsPaging]); + const currentDaoConnectedMembershipProposalVotes = useRef( + null + ); + useEffect(() => { + let shouldUpdate = true; + if (daochain && daoid && address) { + if ( + currentDaoConnectedMembershipProposalVotes.current && + currentDaoConnectedMembershipProposalVotes.current !== daoid + ) { + setConnectedMembershipProposalVotes(undefined); + } + loadConnectedMemberVotesList({ + filter: { dao: daoid, ...proposalsFilter }, + ordering: proposalsSort, + paging: proposalsPaging, + daochain: daochain as keyof Keychain, + setData: setConnectedMembershipProposalVotes, + setLoading: setConnectedMembershipProposalVotesLoading, + shouldUpdate, + memberAddress: address, + }); + currentDaoConnectedMembershipProposalVotes.current = daoid; + } + + return () => { + shouldUpdate = false; + }; + }, [ + daochain, + daoid, + proposalsFilter, + proposalsSort, + proposalsPaging, + address, + ]); + const refreshAll = async () => { refreshDao(); refreshMembers(); refreshProposals(); - refreshUserMembership(); + refreshConnectedMembership(); }; const refreshDao = async () => { @@ -296,14 +372,14 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { }); } }; - const refreshUserMembership = async () => { + const refreshConnectedMembership = async () => { if (daochain && daoid && address) { loadMember({ daoid, daochain: daochain as keyof Keychain, address, - setMember: setUserMembership, - setMemberLoading: setUserMembershipLoading, + setMember: setConnectedMembership, + setMemberLoading: setConnectedMembershipLoading, shouldUpdate: true, }); } @@ -336,6 +412,20 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { }); } }; + const refreshConnectedMembershipProposalVotes = async () => { + if (daochain && daoid && address) { + loadConnectedMemberVotesList({ + filter: { dao: daoid, ...proposalsFilter }, + ordering: proposalsSort, + paging: proposalsPaging, + daochain: daochain as keyof Keychain, + setData: setConnectedMembershipProposalVotes, + setLoading: setConnectedMembershipProposalVotesLoading, + shouldUpdate: false, + memberAddress: address, + }); + } + }; const getNextPage = async (entity: string): Promise => { if (entity === 'members' && membersNextPaging) { @@ -352,9 +442,12 @@ export const DaoContextProvider = ({ children }: DaoContextProviderProps) => { dao, isDaoLoading, refreshDao, - userMembership, - isUserMembershipLoading, - refreshUserMembership, + connectedMembership, + isConnectedMembershipLoading, + refreshConnectedMembership, + connectedMembershipProposalVotes, + isConnectedMembershipProposalVotesLoading, + refreshConnectedMembershipProposalVotes, members, setMembers, isMembersLoading, @@ -395,13 +488,22 @@ export const useDao = (): DaoConnectDaoType => { refreshAll, }; }; -export const useUserMembership = (): DaoConnectUserMembershipType => { - const { userMembership, isUserMembershipLoading, refreshUserMembership } = - useContext(DaoContext); +export const useConnectedMembership = (): DaoConnectConnectedMembershipType => { + const { + connectedMembership, + isConnectedMembershipLoading, + refreshConnectedMembership, + connectedMembershipProposalVotes, + isConnectedMembershipProposalVotesLoading, + refreshConnectedMembershipProposalVotes, + } = useContext(DaoContext); return { - userMembership, - isUserMembershipLoading, - refreshUserMembership, + connectedMembership, + isConnectedMembershipLoading, + refreshConnectedMembership, + connectedMembershipProposalVotes, + isConnectedMembershipProposalVotesLoading, + refreshConnectedMembershipProposalVotes, }; }; export const useMembers = (): DaoConnectMembersType => { diff --git a/apps/core-app/src/pages/Members.tsx b/apps/core-app/src/pages/Members.tsx index 5f312e016..4f67eb107 100644 --- a/apps/core-app/src/pages/Members.tsx +++ b/apps/core-app/src/pages/Members.tsx @@ -20,7 +20,7 @@ import { useMembers, useDao, TMembers, - useUserMembership, + useConnectedMembership, defaultDaoData, } from '../contexts/DaoContext'; import { MembersOverview } from '../components/MembersOverview'; @@ -55,7 +55,7 @@ export function Members() { setMembersSort, setMembers, } = useMembers(); - const { userMembership } = useUserMembership(); + const { connectedMembership } = useConnectedMembership(); const isMobile = useBreakpoint(widthQuery.sm); const tableData = useMemo(() => { @@ -184,9 +184,9 @@ export function Members() { ) diff --git a/apps/core-app/src/pages/Proposals.tsx b/apps/core-app/src/pages/Proposals.tsx index dd7914468..092f31ee2 100644 --- a/apps/core-app/src/pages/Proposals.tsx +++ b/apps/core-app/src/pages/Proposals.tsx @@ -1,4 +1,4 @@ -import { ChangeEvent, MouseEvent, useEffect, useMemo, useState } from 'react'; +import { MouseEvent, useMemo, useState } from 'react'; import styled from 'styled-components'; import { Button, @@ -16,7 +16,6 @@ import { FORM } from '../legos/form'; import SearchInput from '../components/SearchInput'; import FilterDropdown from '../components/FilterDropdown'; import { BaseProposalCard } from '../components/BaseProposalCard'; -import useDebounce from '../utils/debounceHook'; import { PROPOSAL_STATUS } from '@daohaus/common-utilities'; const ActionsContainer = styled.div` @@ -42,19 +41,15 @@ export function Proposals() { setProposals, } = useProposals(); const { dao } = useDao(); - const [searchTerm, setSearchTerm] = useState(''); - const [filter, setFilter] = useState(''); - - const debouncedSearchTerm = useDebounce(searchTerm, 700); + const [searchTerm, setSearchTerm] = useState(''); + const [filter, setFilter] = useState(''); const newProposals = useMemo(() => { - console.log('proposals', proposals); return Object.keys(FORM).map((key) => FORM[key]); - }, [proposals]); - - useEffect(() => { - console.log('deboun', debouncedSearchTerm); + }, []); + const handleSearchFilter = (term: string) => { + setSearchTerm(term); const filterQuery = filter !== '' ? statusFilter( @@ -63,26 +58,18 @@ export function Proposals() { ) : undefined; - if (debouncedSearchTerm && debouncedSearchTerm !== '') { + if (searchTerm && searchTerm.length > 0) { setProposals(undefined); setProposalsFilter({ ...filterQuery, - title_contains_nocase: debouncedSearchTerm, + title_contains_nocase: searchTerm, }); setProposalsPaging(defaultDaoData.proposalsPaging); } else { + setProposals(undefined); setProposalsFilter(filterQuery); setProposalsPaging(defaultDaoData.proposalsPaging); - setProposals(undefined); } - // TODO: I don't want to fire on these others!! - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [debouncedSearchTerm]); - - const handleSearchTermChange = (event: ChangeEvent) => { - setSearchTerm((prevState) => - prevState === event.target.value ? '' : event.target.value - ); }; const toggleFilter = (event: MouseEvent) => { @@ -119,7 +106,7 @@ export function Proposals() { diff --git a/apps/core-app/src/utils/dataFetchHelpers.ts b/apps/core-app/src/utils/dataFetchHelpers.ts index 87f17642b..1547dc104 100644 --- a/apps/core-app/src/utils/dataFetchHelpers.ts +++ b/apps/core-app/src/utils/dataFetchHelpers.ts @@ -4,6 +4,7 @@ import { FindMemberQuery, Haus, ITransformedProposalListQuery, + ListConnectedMemberProposalsQuery, ListMembersQuery, Member_Filter, Member_OrderBy, @@ -194,3 +195,54 @@ export const loadProposalsList = async ({ } } }; + +export const loadConnectedMemberVotesList = async ({ + filter, + ordering, + paging, + daochain, + setData, + setLoading, + shouldUpdate, + memberAddress, +}: { + filter: Proposal_Filter; + ordering?: Ordering; + paging?: Paging; + daochain: keyof Keychain; + setData: ReactSetter< + ListConnectedMemberProposalsQuery['proposals'] | undefined + >; + setLoading: ReactSetter; + shouldUpdate: boolean; + memberAddress: string; +}) => { + try { + setLoading(true); + const haus = Haus.create(); + const res = await haus.profile.listProposalVotesByMember({ + networkId: daochain, + filter, + ordering, + paging, + memberAddress, + }); + if (shouldUpdate) { + setData((prevState) => { + if (deepEqual(prevState, res.items)) return res.items; + if (prevState) { + return [...prevState, ...res.items]; + } else { + return res.items; + } + }); + } + } catch (error) { + console.error(error); + setData(undefined); + } finally { + if (shouldUpdate) { + setLoading(false); + } + } +}; diff --git a/apps/v3-subgraph/src/baal-mapping.ts b/apps/v3-subgraph/src/baal-mapping.ts index f46dad2c6..69536110d 100644 --- a/apps/v3-subgraph/src/baal-mapping.ts +++ b/apps/v3-subgraph/src/baal-mapping.ts @@ -194,6 +194,7 @@ export function handleSubmitProposal(event: SubmitProposal): void { .plus(dao.gracePeriod) : constants.BIGINT_ZERO; + proposal.details = event.params.details; let result = parser.getResultFromJson(event.params.details); if (result.error != 'none') { log.error('details parse error prop: {}', [proposalId]); diff --git a/apps/v3-subgraph/src/poster-mapping.ts b/apps/v3-subgraph/src/poster-mapping.ts index 931778f3a..37503506f 100644 --- a/apps/v3-subgraph/src/poster-mapping.ts +++ b/apps/v3-subgraph/src/poster-mapping.ts @@ -3,6 +3,7 @@ import { log } from '@graphprotocol/graph-ts'; import { parser } from './util/parser'; import { constants } from './util/constants'; import { validators } from './util/validators'; +import { addTransaction } from './util/transactions'; // event NewPost(address indexed user, string content, string indexed tag); export function handleNewPost(event: NewPost): void { @@ -33,6 +34,7 @@ export function handleNewPost(event: NewPost): void { ) { log.info('&&& creating summon record', [event.params.content]); parser.createDaoProfileSummoning(object, event.params.user, event); + addTransaction(event.block, event.transaction, event.address); return; } @@ -48,12 +50,14 @@ export function handleNewPost(event: NewPost): void { validators.isShareholder(event.params.user, daoId.data) ) { parser.createDaoProfile(object, daoId.data, event); + addTransaction(event.block, event.transaction, event.address); return; } if (event.params.tag.toHexString() == constants.DAOHAUS_PROPOSAL_SIGNAL) { log.info('&&& creating summon record', [event.params.content]); parser.createDaoSignal(daoId.data, event); + addTransaction(event.block, event.transaction, event.address); return; } } diff --git a/libs/dao-data/src/Profile.ts b/libs/dao-data/src/Profile.ts index ed1b7f38e..5c0b1c4eb 100644 --- a/libs/dao-data/src/Profile.ts +++ b/libs/dao-data/src/Profile.ts @@ -12,12 +12,25 @@ import { Dao_OrderBy, Member_Filter, LensProfile, + IListQueryArguments, + Proposal_OrderBy, + Proposal_Filter, + IListQueryResults, + ITransformedProposalListQuery, + ListConnectedMemberProposalsQueryVariables, + ListConnectedMemberProposalsQuery, + ListConnectedMemberProposalsDocument, } from './types'; import { transformMembershipList, transformProfile, } from './utils/transformers'; -import { graphFetch, graphFetchList } from './utils'; +import { + createPaging, + DEFAULT_RECORDS_PER_PAGE, + graphFetch, + graphFetchList, +} from './utils'; import Query from './Query'; import { Dao_Filter } from './types'; import { @@ -25,6 +38,7 @@ import { ListProfileQuery, ListProfileQueryVariables, } from './subgraph/queries-lens/profiles.generated'; +import { HausError } from './HausError'; export default class Profile { query: Query; @@ -156,4 +170,54 @@ export default class Profile { return { data: { daos: transformedList } }; } } + + public async listProposalVotesByMember({ + networkId, + filter, + memberAddress, + ordering = { + orderBy: 'id', + orderDirection: 'desc', + }, + paging = { + pageSize: DEFAULT_RECORDS_PER_PAGE, + offset: 0, + }, + }: IListQueryArguments & { + memberAddress: string; + }): Promise< + IListQueryResults< + Proposal_OrderBy, + Proposal_Filter, + ListConnectedMemberProposalsQuery['proposals'] + > + > { + const url = this.query.endpoints['V3_SUBGRAPH'][networkId]; + if (!url) { + throw new HausError({ type: 'INVALID_NETWORK_ERROR' }); + } + + const res = await graphFetchList< + ListConnectedMemberProposalsQuery, + ListConnectedMemberProposalsQueryVariables + >(ListConnectedMemberProposalsDocument, url, { + where: { ...filter, id_gt: paging.lastId || '' }, + memberWhere: { memberAddress }, + orderBy: paging.lastId ? 'id' : ordering.orderBy, + orderDirection: paging.lastId ? 'asc' : ordering.orderDirection, + first: paging.pageSize + 1, + skip: paging.offset, + }); + + const pagingUpdates = createPaging(res['proposals'], paging); + + return { + networkId, + filter, + ordering, + nextPaging: pagingUpdates.nextPaging, + previousPaging: pagingUpdates.previousPaging, + items: pagingUpdates.pageItems, + }; + } } diff --git a/libs/dao-data/src/Query.ts b/libs/dao-data/src/Query.ts index 05db991f1..aff5d7647 100644 --- a/libs/dao-data/src/Query.ts +++ b/libs/dao-data/src/Query.ts @@ -31,6 +31,8 @@ import { Member_OrderBy, Proposal_Filter, Proposal_OrderBy, + Vote_Filter, + Vote_OrderBy, } from './subgraph/schema.generated'; import { FindDaoDocument, @@ -48,6 +50,14 @@ import { ListProposalsQuery, ListProposalsQueryVariables, } from './subgraph/queries/proposals.generated'; +import { + FindVoteDocument, + FindVoteQuery, + FindVoteQueryVariables, + ListVotesDocument, + ListVotesQuery, + ListVotesQueryVariables, +} from './subgraph/queries/votes.generated'; import { FindTxDocument, FindTxQuery, @@ -212,6 +222,49 @@ export default class Query { }; } + public async listVotes({ + networkId, + filter, + ordering = { + orderBy: 'id', + orderDirection: 'desc', + }, + paging = { + pageSize: DEFAULT_RECORDS_PER_PAGE, + offset: 0, + }, + }: IListQueryArguments): Promise< + IListQueryResults + > { + const url = this.endpoints['V3_SUBGRAPH'][networkId]; + if (!url) { + throw new HausError({ type: 'INVALID_NETWORK_ERROR' }); + } + + const res = await graphFetchList( + ListVotesDocument, + url, + { + where: { ...filter, id_gt: paging.lastId || '' }, + orderBy: paging.lastId ? 'id' : ordering.orderBy, + orderDirection: paging.lastId ? 'asc' : ordering.orderDirection, + first: paging.pageSize + 1, + skip: paging.offset, + } + ); + + const pagingUpdates = createPaging(res['votes'], paging); + + return { + networkId, + filter, + ordering, + nextPaging: pagingUpdates.nextPaging, + previousPaging: pagingUpdates.previousPaging, + items: pagingUpdates.pageItems, + }; + } + public async listTransactions({ networkId, filter, @@ -369,6 +422,36 @@ export default class Query { } } + public async findVote({ + networkId, + voteId, + }: { + networkId: keyof Keychain; + voteId: string; + }): Promise> { + const url = this.endpoints['V3_SUBGRAPH'][networkId]; + if (!url) { + return { + error: new HausError({ type: 'INVALID_NETWORK_ERROR' }), + }; + } + + try { + return await graphFetch( + FindVoteDocument, + url, + networkId, + { + id: voteId, + } + ); + } catch (err) { + return { + error: new HausError({ type: 'SUBGRAPH_ERROR', errorObject: err }), + }; + } + } + public async findProposal({ networkId, dao, diff --git a/libs/dao-data/src/subgraph/queries-lens/profiles.generated.ts b/libs/dao-data/src/subgraph/queries-lens/profiles.generated.ts index 22035a2d8..2b150fe20 100644 --- a/libs/dao-data/src/subgraph/queries-lens/profiles.generated.ts +++ b/libs/dao-data/src/subgraph/queries-lens/profiles.generated.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import * as Types from '../schema-lens.generated'; import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; @@ -6,340 +5,8 @@ export type ListProfileQueryVariables = Types.Exact<{ memberAddress: Types.Scalars['EthereumAddress']; }>; -export type ListProfileQuery = { - profiles: { - items: Array<{ - id: any; - name?: string | undefined; - bio?: string | undefined; - followNftAddress?: any | undefined; - metadata?: any | undefined; - isDefault: boolean; - handle: any; - ownedBy: any; - picture?: - | { - __typename: 'MediaSet'; - original: { url: any; mimeType?: any | undefined }; - } - | { - __typename: 'NftImage'; - contractAddress: any; - tokenId: string; - uri: any; - verified: boolean; - } - | undefined; - coverPicture?: - | { - __typename: 'MediaSet'; - original: { url: any; mimeType?: any | undefined }; - } - | { - __typename: 'NftImage'; - contractAddress: any; - tokenId: string; - uri: any; - verified: boolean; - } - | undefined; - onChainIdentity: { ens?: { name?: any | undefined } | undefined }; - }>; - pageInfo: { - prev?: any | undefined; - next?: any | undefined; - totalCount: number; - }; - }; -}; -export const ListProfileDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'listProfile' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'memberAddress' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'EthereumAddress' }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'profiles' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'request' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'ownedBy' }, - value: { - kind: 'ListValue', - values: [ - { - kind: 'Variable', - name: { kind: 'Name', value: 'memberAddress' }, - }, - ], - }, - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'limit' }, - value: { kind: 'IntValue', value: '10' }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'items' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'id' } }, - { kind: 'Field', name: { kind: 'Name', value: 'name' } }, - { kind: 'Field', name: { kind: 'Name', value: 'bio' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'followNftAddress' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'metadata' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'isDefault' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'picture' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: '__typename' }, - }, - { - kind: 'InlineFragment', - typeCondition: { - kind: 'NamedType', - name: { kind: 'Name', value: 'NftImage' }, - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'contractAddress', - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'tokenId' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'uri' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'verified' }, - }, - ], - }, - }, - { - kind: 'InlineFragment', - typeCondition: { - kind: 'NamedType', - name: { kind: 'Name', value: 'MediaSet' }, - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'original' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'url' }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'mimeType', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'handle' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'coverPicture' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: '__typename' }, - }, - { - kind: 'InlineFragment', - typeCondition: { - kind: 'NamedType', - name: { kind: 'Name', value: 'NftImage' }, - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'contractAddress', - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'tokenId' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'uri' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'verified' }, - }, - ], - }, - }, - { - kind: 'InlineFragment', - typeCondition: { - kind: 'NamedType', - name: { kind: 'Name', value: 'MediaSet' }, - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'original' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'url' }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'mimeType', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'ownedBy' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'onChainIdentity' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'ens' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'name' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'pageInfo' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'prev' } }, - { kind: 'Field', name: { kind: 'Name', value: 'next' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'totalCount' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; +export type ListProfileQuery = { profiles: { items: Array<{ id: any, name?: string | undefined, bio?: string | undefined, followNftAddress?: any | undefined, metadata?: any | undefined, isDefault: boolean, handle: any, ownedBy: any, picture?: { __typename: 'MediaSet', original: { url: any, mimeType?: any | undefined } } | { __typename: 'NftImage', contractAddress: any, tokenId: string, uri: any, verified: boolean } | undefined, coverPicture?: { __typename: 'MediaSet', original: { url: any, mimeType?: any | undefined } } | { __typename: 'NftImage', contractAddress: any, tokenId: string, uri: any, verified: boolean } | undefined, onChainIdentity: { ens?: { name?: any | undefined } | undefined } }>, pageInfo: { prev?: any | undefined, next?: any | undefined, totalCount: number } } }; + + +export const ListProfileDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"listProfile"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"memberAddress"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"EthereumAddress"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"profiles"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"request"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"ownedBy"},"value":{"kind":"ListValue","values":[{"kind":"Variable","name":{"kind":"Name","value":"memberAddress"}}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"10"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"followNftAddress"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"isDefault"}},{"kind":"Field","name":{"kind":"Name","value":"picture"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NftImage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contractAddress"}},{"kind":"Field","name":{"kind":"Name","value":"tokenId"}},{"kind":"Field","name":{"kind":"Name","value":"uri"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MediaSet"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"original"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"handle"}},{"kind":"Field","name":{"kind":"Name","value":"coverPicture"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NftImage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contractAddress"}},{"kind":"Field","name":{"kind":"Name","value":"tokenId"}},{"kind":"Field","name":{"kind":"Name","value":"uri"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MediaSet"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"original"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"ownedBy"}},{"kind":"Field","name":{"kind":"Name","value":"onChainIdentity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ens"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prev"}},{"kind":"Field","name":{"kind":"Name","value":"next"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/libs/dao-data/src/subgraph/queries/proposals.generated.ts b/libs/dao-data/src/subgraph/queries/proposals.generated.ts index 03445426c..0785419b2 100644 --- a/libs/dao-data/src/subgraph/queries/proposals.generated.ts +++ b/libs/dao-data/src/subgraph/queries/proposals.generated.ts @@ -7,18 +7,34 @@ export type ListProposalsQueryVariables = Types.Exact<{ first?: Types.Scalars['Int']; orderBy?: Types.Proposal_OrderBy; orderDirection?: Types.OrderDirection; + connectedAddress?: Types.InputMaybe; }>; export type ListProposalsQuery = { proposals: Array<{ id: string, createdAt: string, createdBy: string, txHash: string, proposalId: string, prevProposalId: string, proposalDataHash: string, proposalData: string, actionGasEstimate: string, details: string, title?: string | undefined, description?: string | undefined, proposalType: string, contentURI?: string | undefined, contentURIType?: string | undefined, sponsorTxHash?: string | undefined, sponsored: boolean, selfSponsor: boolean, sponsor?: string | undefined, sponsorTxAt?: string | undefined, votingPeriod: string, votingStarts: string, votingEnds: string, gracePeriod: string, graceEnds: string, expiration: string, cancelledTxHash?: string | undefined, cancelledBy?: string | undefined, cancelled: boolean, cancelledTxAt?: string | undefined, yesBalance: string, noBalance: string, yesVotes: string, noVotes: string, processTxHash?: string | undefined, processedBy?: string | undefined, processed: boolean, processTxAt?: string | undefined, actionFailed: boolean, passed: boolean, proposalOffering: string, maxTotalSharesAndLootAtYesVote: string, tributeToken?: string | undefined, tributeOffered?: string | undefined, tributeTokenSymbol?: string | undefined, tributeTokenDecimals?: string | undefined, tributeEscrowRecipient?: string | undefined, dao: { totalShares: string, quorumPercent: string }, votes?: Array<{ id: string, txHash: string, createdAt: string, daoAddress: string, approved: boolean, balance: string, member: { id: string, memberAddress: string } }> | undefined }> }; +export type ListConnectedMemberProposalsQueryVariables = Types.Exact<{ + where?: Types.Proposal_Filter; + memberWhere?: Types.Member_Filter; + skip?: Types.Scalars['Int']; + first?: Types.Scalars['Int']; + orderBy?: Types.Proposal_OrderBy; + orderDirection?: Types.OrderDirection; + connectedAddress?: Types.InputMaybe; +}>; + + +export type ListConnectedMemberProposalsQuery = { proposals: Array<{ id: string, connectedMemberVotes?: Array<{ id: string, txHash: string, createdAt: string, daoAddress: string, approved: boolean, balance: string, member: { id: string, memberAddress: string } }> | undefined }> }; + export type FindProposalQueryVariables = Types.Exact<{ id: Types.Scalars['ID']; + connectedAddress?: Types.InputMaybe; }>; export type FindProposalQuery = { proposal?: { id: string, createdAt: string, createdBy: string, txHash: string, proposalId: string, prevProposalId: string, proposalDataHash: string, proposalData: string, actionGasEstimate: string, details: string, title?: string | undefined, description?: string | undefined, proposalType: string, contentURI?: string | undefined, contentURIType?: string | undefined, sponsorTxHash?: string | undefined, sponsored: boolean, selfSponsor: boolean, sponsor?: string | undefined, sponsorTxAt?: string | undefined, votingPeriod: string, votingStarts: string, votingEnds: string, gracePeriod: string, graceEnds: string, expiration: string, cancelledTxHash?: string | undefined, cancelledBy?: string | undefined, cancelled: boolean, cancelledTxAt?: string | undefined, yesBalance: string, noBalance: string, yesVotes: string, noVotes: string, processTxHash?: string | undefined, processedBy?: string | undefined, processed: boolean, processTxAt?: string | undefined, actionFailed: boolean, passed: boolean, proposalOffering: string, maxTotalSharesAndLootAtYesVote: string, tributeToken?: string | undefined, tributeOffered?: string | undefined, tributeTokenSymbol?: string | undefined, tributeTokenDecimals?: string | undefined, tributeEscrowRecipient?: string | undefined, dao: { totalShares: string, quorumPercent: string }, votes?: Array<{ id: string, txHash: string, createdAt: string, daoAddress: string, approved: boolean, balance: string, member: { id: string, memberAddress: string } }> | undefined } | undefined }; -export const ListProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"listProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Proposal_filter"}}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"defaultValue":{"kind":"IntValue","value":"0"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"defaultValue":{"kind":"IntValue","value":"100"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Proposal_orderBy"}}},"defaultValue":{"kind":"EnumValue","value":"id"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},"defaultValue":{"kind":"EnumValue","value":"asc"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"prevProposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalDataHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalData"}},{"kind":"Field","name":{"kind":"Name","value":"actionGasEstimate"}},{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"proposalType"}},{"kind":"Field","name":{"kind":"Name","value":"contentURI"}},{"kind":"Field","name":{"kind":"Name","value":"contentURIType"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"sponsored"}},{"kind":"Field","name":{"kind":"Name","value":"selfSponsor"}},{"kind":"Field","name":{"kind":"Name","value":"sponsor"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"votingPeriod"}},{"kind":"Field","name":{"kind":"Name","value":"votingStarts"}},{"kind":"Field","name":{"kind":"Name","value":"votingEnds"}},{"kind":"Field","name":{"kind":"Name","value":"gracePeriod"}},{"kind":"Field","name":{"kind":"Name","value":"graceEnds"}},{"kind":"Field","name":{"kind":"Name","value":"expiration"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledBy"}},{"kind":"Field","name":{"kind":"Name","value":"cancelled"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"yesBalance"}},{"kind":"Field","name":{"kind":"Name","value":"noBalance"}},{"kind":"Field","name":{"kind":"Name","value":"yesVotes"}},{"kind":"Field","name":{"kind":"Name","value":"noVotes"}},{"kind":"Field","name":{"kind":"Name","value":"processTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"processedBy"}},{"kind":"Field","name":{"kind":"Name","value":"processed"}},{"kind":"Field","name":{"kind":"Name","value":"processTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"actionFailed"}},{"kind":"Field","name":{"kind":"Name","value":"passed"}},{"kind":"Field","name":{"kind":"Name","value":"proposalOffering"}},{"kind":"Field","name":{"kind":"Name","value":"maxTotalSharesAndLootAtYesVote"}},{"kind":"Field","name":{"kind":"Name","value":"tributeToken"}},{"kind":"Field","name":{"kind":"Name","value":"tributeOffered"}},{"kind":"Field","name":{"kind":"Name","value":"tributeTokenSymbol"}},{"kind":"Field","name":{"kind":"Name","value":"tributeTokenDecimals"}},{"kind":"Field","name":{"kind":"Name","value":"tributeEscrowRecipient"}},{"kind":"Field","name":{"kind":"Name","value":"dao"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalShares"}},{"kind":"Field","name":{"kind":"Name","value":"quorumPercent"}}]}},{"kind":"Field","name":{"kind":"Name","value":"votes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"daoAddress"}},{"kind":"Field","name":{"kind":"Name","value":"approved"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"member"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"memberAddress"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const FindProposalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"findProposal"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"prevProposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalDataHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalData"}},{"kind":"Field","name":{"kind":"Name","value":"actionGasEstimate"}},{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"proposalType"}},{"kind":"Field","name":{"kind":"Name","value":"contentURI"}},{"kind":"Field","name":{"kind":"Name","value":"contentURIType"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"sponsored"}},{"kind":"Field","name":{"kind":"Name","value":"selfSponsor"}},{"kind":"Field","name":{"kind":"Name","value":"sponsor"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"votingPeriod"}},{"kind":"Field","name":{"kind":"Name","value":"votingStarts"}},{"kind":"Field","name":{"kind":"Name","value":"votingEnds"}},{"kind":"Field","name":{"kind":"Name","value":"gracePeriod"}},{"kind":"Field","name":{"kind":"Name","value":"graceEnds"}},{"kind":"Field","name":{"kind":"Name","value":"expiration"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledBy"}},{"kind":"Field","name":{"kind":"Name","value":"cancelled"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"yesBalance"}},{"kind":"Field","name":{"kind":"Name","value":"noBalance"}},{"kind":"Field","name":{"kind":"Name","value":"yesVotes"}},{"kind":"Field","name":{"kind":"Name","value":"noVotes"}},{"kind":"Field","name":{"kind":"Name","value":"processTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"processedBy"}},{"kind":"Field","name":{"kind":"Name","value":"processed"}},{"kind":"Field","name":{"kind":"Name","value":"processTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"actionFailed"}},{"kind":"Field","name":{"kind":"Name","value":"passed"}},{"kind":"Field","name":{"kind":"Name","value":"proposalOffering"}},{"kind":"Field","name":{"kind":"Name","value":"maxTotalSharesAndLootAtYesVote"}},{"kind":"Field","name":{"kind":"Name","value":"tributeToken"}},{"kind":"Field","name":{"kind":"Name","value":"tributeOffered"}},{"kind":"Field","name":{"kind":"Name","value":"tributeTokenSymbol"}},{"kind":"Field","name":{"kind":"Name","value":"tributeTokenDecimals"}},{"kind":"Field","name":{"kind":"Name","value":"tributeEscrowRecipient"}},{"kind":"Field","name":{"kind":"Name","value":"dao"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalShares"}},{"kind":"Field","name":{"kind":"Name","value":"quorumPercent"}}]}},{"kind":"Field","name":{"kind":"Name","value":"votes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"daoAddress"}},{"kind":"Field","name":{"kind":"Name","value":"approved"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"member"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"memberAddress"}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const ListProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"listProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Proposal_filter"}}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"defaultValue":{"kind":"IntValue","value":"0"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"defaultValue":{"kind":"IntValue","value":"100"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Proposal_orderBy"}}},"defaultValue":{"kind":"EnumValue","value":"id"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"connectedAddress"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Bytes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"prevProposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalDataHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalData"}},{"kind":"Field","name":{"kind":"Name","value":"actionGasEstimate"}},{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"proposalType"}},{"kind":"Field","name":{"kind":"Name","value":"contentURI"}},{"kind":"Field","name":{"kind":"Name","value":"contentURIType"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"sponsored"}},{"kind":"Field","name":{"kind":"Name","value":"selfSponsor"}},{"kind":"Field","name":{"kind":"Name","value":"sponsor"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"votingPeriod"}},{"kind":"Field","name":{"kind":"Name","value":"votingStarts"}},{"kind":"Field","name":{"kind":"Name","value":"votingEnds"}},{"kind":"Field","name":{"kind":"Name","value":"gracePeriod"}},{"kind":"Field","name":{"kind":"Name","value":"graceEnds"}},{"kind":"Field","name":{"kind":"Name","value":"expiration"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledBy"}},{"kind":"Field","name":{"kind":"Name","value":"cancelled"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"yesBalance"}},{"kind":"Field","name":{"kind":"Name","value":"noBalance"}},{"kind":"Field","name":{"kind":"Name","value":"yesVotes"}},{"kind":"Field","name":{"kind":"Name","value":"noVotes"}},{"kind":"Field","name":{"kind":"Name","value":"processTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"processedBy"}},{"kind":"Field","name":{"kind":"Name","value":"processed"}},{"kind":"Field","name":{"kind":"Name","value":"processTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"actionFailed"}},{"kind":"Field","name":{"kind":"Name","value":"passed"}},{"kind":"Field","name":{"kind":"Name","value":"proposalOffering"}},{"kind":"Field","name":{"kind":"Name","value":"maxTotalSharesAndLootAtYesVote"}},{"kind":"Field","name":{"kind":"Name","value":"tributeToken"}},{"kind":"Field","name":{"kind":"Name","value":"tributeOffered"}},{"kind":"Field","name":{"kind":"Name","value":"tributeTokenSymbol"}},{"kind":"Field","name":{"kind":"Name","value":"tributeTokenDecimals"}},{"kind":"Field","name":{"kind":"Name","value":"tributeEscrowRecipient"}},{"kind":"Field","name":{"kind":"Name","value":"dao"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalShares"}},{"kind":"Field","name":{"kind":"Name","value":"quorumPercent"}}]}},{"kind":"Field","name":{"kind":"Name","value":"votes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"daoAddress"}},{"kind":"Field","name":{"kind":"Name","value":"approved"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"member"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"memberAddress"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const ListConnectedMemberProposalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"listConnectedMemberProposals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Proposal_filter"}}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"memberWhere"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Member_filter"}}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"defaultValue":{"kind":"IntValue","value":"0"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"defaultValue":{"kind":"IntValue","value":"100"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Proposal_orderBy"}}},"defaultValue":{"kind":"EnumValue","value":"id"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"connectedAddress"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Bytes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"connectedMemberVotes"},"name":{"kind":"Name","value":"votes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"member_"},"value":{"kind":"Variable","name":{"kind":"Name","value":"memberWhere"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"daoAddress"}},{"kind":"Field","name":{"kind":"Name","value":"approved"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"member"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"memberAddress"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const FindProposalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"findProposal"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"connectedAddress"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Bytes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"proposal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalId"}},{"kind":"Field","name":{"kind":"Name","value":"prevProposalId"}},{"kind":"Field","name":{"kind":"Name","value":"proposalDataHash"}},{"kind":"Field","name":{"kind":"Name","value":"proposalData"}},{"kind":"Field","name":{"kind":"Name","value":"actionGasEstimate"}},{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"proposalType"}},{"kind":"Field","name":{"kind":"Name","value":"contentURI"}},{"kind":"Field","name":{"kind":"Name","value":"contentURIType"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"sponsored"}},{"kind":"Field","name":{"kind":"Name","value":"selfSponsor"}},{"kind":"Field","name":{"kind":"Name","value":"sponsor"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"votingPeriod"}},{"kind":"Field","name":{"kind":"Name","value":"votingStarts"}},{"kind":"Field","name":{"kind":"Name","value":"votingEnds"}},{"kind":"Field","name":{"kind":"Name","value":"gracePeriod"}},{"kind":"Field","name":{"kind":"Name","value":"graceEnds"}},{"kind":"Field","name":{"kind":"Name","value":"expiration"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledBy"}},{"kind":"Field","name":{"kind":"Name","value":"cancelled"}},{"kind":"Field","name":{"kind":"Name","value":"cancelledTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"yesBalance"}},{"kind":"Field","name":{"kind":"Name","value":"noBalance"}},{"kind":"Field","name":{"kind":"Name","value":"yesVotes"}},{"kind":"Field","name":{"kind":"Name","value":"noVotes"}},{"kind":"Field","name":{"kind":"Name","value":"processTxHash"}},{"kind":"Field","name":{"kind":"Name","value":"processedBy"}},{"kind":"Field","name":{"kind":"Name","value":"processed"}},{"kind":"Field","name":{"kind":"Name","value":"processTxAt"}},{"kind":"Field","name":{"kind":"Name","value":"actionFailed"}},{"kind":"Field","name":{"kind":"Name","value":"passed"}},{"kind":"Field","name":{"kind":"Name","value":"proposalOffering"}},{"kind":"Field","name":{"kind":"Name","value":"maxTotalSharesAndLootAtYesVote"}},{"kind":"Field","name":{"kind":"Name","value":"tributeToken"}},{"kind":"Field","name":{"kind":"Name","value":"tributeOffered"}},{"kind":"Field","name":{"kind":"Name","value":"tributeTokenSymbol"}},{"kind":"Field","name":{"kind":"Name","value":"tributeTokenDecimals"}},{"kind":"Field","name":{"kind":"Name","value":"tributeEscrowRecipient"}},{"kind":"Field","name":{"kind":"Name","value":"dao"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalShares"}},{"kind":"Field","name":{"kind":"Name","value":"quorumPercent"}}]}},{"kind":"Field","name":{"kind":"Name","value":"votes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"daoAddress"}},{"kind":"Field","name":{"kind":"Name","value":"approved"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"member"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"memberAddress"}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/libs/dao-data/src/subgraph/queries/proposals.graphql b/libs/dao-data/src/subgraph/queries/proposals.graphql index 2cf11c613..fab8b1921 100644 --- a/libs/dao-data/src/subgraph/queries/proposals.graphql +++ b/libs/dao-data/src/subgraph/queries/proposals.graphql @@ -4,6 +4,7 @@ query listProposals( $first: Int! = 100 $orderBy: Proposal_orderBy! = id $orderDirection: OrderDirection! = asc + $connectedAddress: Bytes ) { proposals: proposals( where: $where @@ -16,7 +17,39 @@ query listProposals( } } -query findProposal($id: ID!) { +query listConnectedMemberProposals( + $where: Proposal_filter! = {} + $memberWhere: Member_filter! = {} + $skip: Int! = 0 + $first: Int! = 100 + $orderBy: Proposal_orderBy! = id + $orderDirection: OrderDirection! = asc + $connectedAddress: Bytes +) { + proposals: proposals( + where: $where + skip: $skip + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + ) { + id + connectedMemberVotes: votes(where: { member_: $memberWhere }) { + id + txHash + createdAt + daoAddress + approved + balance + member { + id + memberAddress + } + } + } +} + +query findProposal($id: ID!, $connectedAddress: Bytes) { proposal: proposal(id: $id) { ...proposalFields } diff --git a/libs/dao-data/src/subgraph/queries/votes.generated.ts b/libs/dao-data/src/subgraph/queries/votes.generated.ts new file mode 100644 index 000000000..b537a51c3 --- /dev/null +++ b/libs/dao-data/src/subgraph/queries/votes.generated.ts @@ -0,0 +1,26 @@ +import * as Types from '../schema.generated'; + +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type ListVotesQueryVariables = Types.Exact<{ + where?: Types.Vote_Filter; + skip?: Types.Scalars['Int']; + first?: Types.Scalars['Int']; + orderBy?: Types.Vote_OrderBy; + orderDirection?: Types.OrderDirection; + connectedAddress?: Types.InputMaybe; +}>; + + +export type ListVotesQuery = { votes: Array<{ id: string, txHash: string, createdAt: string, daoAddress: string, approved: boolean, balance: string, member: { id: string, memberAddress: string } }> }; + +export type FindVoteQueryVariables = Types.Exact<{ + id: Types.Scalars['ID']; + connectedAddress?: Types.InputMaybe; +}>; + + +export type FindVoteQuery = { vote?: { id: string, txHash: string, createdAt: string, daoAddress: string, approved: boolean, balance: string, member: { id: string, memberAddress: string } } | undefined }; + + +export const ListVotesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"listVotes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Vote_filter"}}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"defaultValue":{"kind":"IntValue","value":"0"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"defaultValue":{"kind":"IntValue","value":"100"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Vote_orderBy"}}},"defaultValue":{"kind":"EnumValue","value":"id"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"connectedAddress"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Bytes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"votes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"daoAddress"}},{"kind":"Field","name":{"kind":"Name","value":"approved"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"member"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"memberAddress"}}]}}]}}]}}]} as unknown as DocumentNode; +export const FindVoteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"findVote"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"connectedAddress"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Bytes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"vote"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"txHash"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"daoAddress"}},{"kind":"Field","name":{"kind":"Name","value":"approved"}},{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"member"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"memberAddress"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/libs/dao-data/src/subgraph/queries/votes.graphql b/libs/dao-data/src/subgraph/queries/votes.graphql new file mode 100644 index 000000000..b10dc84f5 --- /dev/null +++ b/libs/dao-data/src/subgraph/queries/votes.graphql @@ -0,0 +1,37 @@ +query listVotes( + $where: Vote_filter! = {} + $skip: Int! = 0 + $first: Int! = 100 + $orderBy: Vote_orderBy! = id + $orderDirection: OrderDirection! = asc + $connectedAddress: Bytes +) { + votes: votes( + where: $where + skip: $skip + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + ) { + ...voteFields + } +} + +query findVote($id: ID!, $connectedAddress: Bytes) { + vote: vote(id: $id) { + ...voteFields + } +} + +fragment voteFields on Vote { + id + txHash + createdAt + daoAddress + approved + balance + member { + id + memberAddress + } +} diff --git a/libs/dao-data/src/subgraph/schema-lens.generated.ts b/libs/dao-data/src/subgraph/schema-lens.generated.ts index c1cab5fc3..b4f14260e 100644 --- a/libs/dao-data/src/subgraph/schema-lens.generated.ts +++ b/libs/dao-data/src/subgraph/schema-lens.generated.ts @@ -42,6 +42,8 @@ export interface Scalars { Jwt: any; /** limit custom scalar type */ LimitScalar: any; + /** Locale scalar type */ + Locale: any; /** Markdown scalar type */ Markdown: any; /** mimetype custom scalar type */ @@ -50,12 +52,20 @@ export interface Scalars { NftOwnershipId: any; /** Nonce custom scalar type */ Nonce: any; + /** The notification id */ + NotificationId: any; /** ProfileId custom scalar type */ ProfileId: any; + /** proxy action scalar id type */ + ProxyActionId: any; /** Publication id custom scalar type */ PublicationId: any; + /** The publication tag */ + PublicationTag: any; /** Publication url scalar type */ PublicationUrl: any; + /** The reaction id */ + ReactionId: any; /** reference module data scalar type */ ReferenceModuleData: any; /** Query search */ @@ -82,10 +92,19 @@ export interface AchRequest { ethereumAddress: Scalars['EthereumAddress']; freeTextHandle?: InputMaybe; handle?: InputMaybe; + overrideAlreadyClaimed: Scalars['Boolean']; overrideTradeMark: Scalars['Boolean']; secret: Scalars['String']; } +export interface AllPublicationsTagsRequest { + cursor?: InputMaybe; + limit?: InputMaybe; + sort: TagSortCriteria; + /** The App Id */ + source?: InputMaybe; +} + export interface ApprovedAllowanceAmount { __typename?: 'ApprovedAllowanceAmount'; allowance: Scalars['String']; @@ -95,11 +114,14 @@ export interface ApprovedAllowanceAmount { } export interface ApprovedModuleAllowanceAmountRequest { - collectModules: Array; + collectModules?: InputMaybe>; /** The contract addresses for the module approved currencies you want to find information on about the user */ currencies: Array; - followModules: Array; - referenceModules: Array; + followModules?: InputMaybe>; + referenceModules?: InputMaybe>; + unknownCollectModules?: InputMaybe>; + unknownFollowModules?: InputMaybe>; + unknownReferenceModules?: InputMaybe>; } /** The Profile */ @@ -153,13 +175,19 @@ export interface ClaimHandleRequest { id?: InputMaybe; } +/** The claim status */ +export type ClaimStatus = + | 'ALREADY_CLAIMED' + | 'CLAIM_FAILED' + | 'NOT_CLAIMED'; + export interface ClaimableHandles { __typename?: 'ClaimableHandles'; canClaimFreeTextHandle: Scalars['Boolean']; reservedHandles: Array; } -export type CollectModule = FeeCollectModuleSettings | FreeCollectModuleSettings | LimitedFeeCollectModuleSettings | LimitedTimedFeeCollectModuleSettings | RevertCollectModuleSettings | TimedFeeCollectModuleSettings; +export type CollectModule = FeeCollectModuleSettings | FreeCollectModuleSettings | LimitedFeeCollectModuleSettings | LimitedTimedFeeCollectModuleSettings | RevertCollectModuleSettings | TimedFeeCollectModuleSettings | UnknownCollectModuleSettings; export interface CollectModuleParams { /** The collect fee collect module */ @@ -174,6 +202,8 @@ export interface CollectModuleParams { revertCollectModule?: InputMaybe; /** The collect timed fee collect module */ timedFeeCollectModule?: InputMaybe; + /** A unknown collect module */ + unknownCollectModule?: InputMaybe; } /** The collect module types */ @@ -183,7 +213,12 @@ export type CollectModules = | 'LimitedFeeCollectModule' | 'LimitedTimedFeeCollectModule' | 'RevertCollectModule' - | 'TimedFeeCollectModule'; + | 'TimedFeeCollectModule' + | 'UnknownCollectModule'; + +export interface CollectProxyAction { + freeCollect?: InputMaybe; +} /** The social comment */ export interface Comment { @@ -311,6 +346,8 @@ export interface CreateCollectEip712TypedDataValue { export interface CreateCollectRequest { publicationId: Scalars['InternalPublicationId']; + /** The encoded data to collect with if using an unknown module */ + unknownModuleData?: InputMaybe; } /** The broadcast item */ @@ -903,6 +940,7 @@ export interface ExplorePublicationRequest { /** If you wish to exclude any results for profile ids */ excludeProfileIds?: InputMaybe>; limit?: InputMaybe; + metadata?: InputMaybe; /** If you want the randomizer off (default on) */ noRandomize?: InputMaybe; /** The publication types you want to query */ @@ -974,7 +1012,7 @@ export interface Follow { profile: Scalars['ProfileId']; } -export type FollowModule = FeeFollowModuleSettings | ProfileFollowModuleSettings | RevertFollowModuleSettings; +export type FollowModule = FeeFollowModuleSettings | ProfileFollowModuleSettings | RevertFollowModuleSettings | UnknownFollowModuleSettings; export interface FollowModuleParams { /** The follower fee follower module */ @@ -985,6 +1023,8 @@ export interface FollowModuleParams { profileFollowModule?: InputMaybe; /** The revert follow module */ revertFollowModule?: InputMaybe; + /** A unknown follow module */ + unknownFollowModule?: InputMaybe; } export interface FollowModuleRedeemParams { @@ -992,13 +1032,16 @@ export interface FollowModuleRedeemParams { feeFollowModule?: InputMaybe; /** The profile follower module */ profileFollowModule?: InputMaybe; + /** A unknown follow module */ + unknownFollowModule?: InputMaybe; } /** The follow module types */ export type FollowModules = | 'FeeFollowModule' | 'ProfileFollowModule' - | 'RevertFollowModule'; + | 'RevertFollowModule' + | 'UnknownFollowModule'; export interface FollowOnlyReferenceModuleSettings { __typename?: 'FollowOnlyReferenceModuleSettings'; @@ -1007,6 +1050,10 @@ export interface FollowOnlyReferenceModuleSettings { type: ReferenceModules; } +export interface FollowProxyAction { + freeFollow?: InputMaybe; +} + export interface FollowRequest { follow: Array; } @@ -1070,6 +1117,14 @@ export interface FreeCollectModuleSettings { type: CollectModules; } +export interface FreeCollectProxyAction { + publicationId: Scalars['InternalPublicationId']; +} + +export interface FreeFollowProxyAction { + profileId: Scalars['ProfileId']; +} + export interface GenerateModuleCurrencyApproval { __typename?: 'GenerateModuleCurrencyApproval'; data: Scalars['BlockchainData']; @@ -1082,10 +1137,19 @@ export interface GenerateModuleCurrencyApprovalDataRequest { currency: Scalars['ContractAddress']; followModule?: InputMaybe; referenceModule?: InputMaybe; + unknownCollectModule?: InputMaybe; + unknownFollowModule?: InputMaybe; + unknownReferenceModule?: InputMaybe; /** Floating point number as string (e.g. 42.009837). The server will move its decimal places for you */ value: Scalars['String']; } +export interface GetPublicationMetadataStatusRequest { + publicationId?: InputMaybe; + txHash?: InputMaybe; + txId?: InputMaybe; +} + export interface GlobalProtocolStats { __typename?: 'GlobalProtocolStats'; totalBurntProfiles: Scalars['Int']; @@ -1204,6 +1268,10 @@ export type MainPostReference = Mirror | Post; /** The Media url */ export interface Media { __typename?: 'Media'; + /** The alt tags for accessibility */ + altTag?: Maybe; + /** The cover for any video or audio you attached */ + cover?: Maybe; /** Height - will always be null on the public API */ height?: Maybe; /** The image/audio/video mime type for the publication */ @@ -1229,23 +1297,27 @@ export interface MediaSet { export type MentionPublication = Comment | Post; +/** The metadata attribute input */ +export interface MetadataAttributeInput { + /** The display type */ + displayType?: InputMaybe; + /** The trait type - can be anything its the name it will render so include spaces */ + traitType: Scalars['String']; + /** The value */ + value: Scalars['String']; +} + /** The metadata attribute output */ export interface MetadataAttributeOutput { __typename?: 'MetadataAttributeOutput'; /** The display type */ - displayType?: Maybe; + displayType?: Maybe; /** The trait type - can be anything its the name it will render so include spaces */ traitType?: Maybe; /** The value */ value?: Maybe; } -/** The metadata display types */ -export type MetadataDisplayType = - | 'date' - | 'number' - | 'string'; - /** The metadata output */ export interface MetadataOutput { __typename?: 'MetadataOutput'; @@ -1253,16 +1325,24 @@ export interface MetadataOutput { attributes: Array; /** This is the metadata content for the publication, should be markdown */ content?: Maybe; + /** The content warning for the publication */ + contentWarning?: Maybe; /** The image cover for video/music publications */ cover?: Maybe; /** This is the metadata description */ description?: Maybe; /** This is the image attached to the metadata and the property used to show the NFT! */ image?: Maybe; + /** The locale of the publication, */ + locale?: Maybe; + /** The main focus of the publication */ + mainContentFocus: PublicationMainFocus; /** The images/audios/videos for the publication */ media: Array; /** The metadata name */ name?: Maybe; + /** The tags for the publication */ + tags: Array; } /** The social mirror */ @@ -1341,18 +1421,24 @@ export interface Mutation { createBurnProfileTypedData: CreateBurnProfileBroadcastItemResult; createCollectTypedData: CreateCollectBroadcastItemResult; createCommentTypedData: CreateCommentBroadcastItemResult; + createCommentViaDispatcher: RelayResult; createFollowTypedData: CreateFollowBroadcastItemResult; createMirrorTypedData: CreateMirrorBroadcastItemResult; + createMirrorViaDispatcher: RelayResult; createPostTypedData: CreatePostBroadcastItemResult; + createPostViaDispatcher: RelayResult; createSetDefaultProfileTypedData: SetDefaultProfileBroadcastItemResult; createSetDispatcherTypedData: CreateSetDispatcherBroadcastItemResult; createSetFollowModuleTypedData: CreateSetFollowModuleBroadcastItemResult; createSetFollowNFTUriTypedData: CreateSetFollowNftUriBroadcastItemResult; createSetProfileImageURITypedData: CreateSetProfileImageUriBroadcastItemResult; + createSetProfileImageURIViaDispatcher: RelayResult; createSetProfileMetadataTypedData: CreateSetProfileMetadataUriBroadcastItemResult; + createSetProfileMetadataViaDispatcher: RelayResult; createToggleFollowTypedData: CreateToggleFollowBroadcastItemResult; createUnfollowTypedData: CreateUnfollowBroadcastItemResult; hidePublication?: Maybe; + proxyAction: Scalars['ProxyActionId']; refresh: AuthenticationResult; removeReaction?: Maybe; reportPublication?: Maybe; @@ -1402,6 +1488,11 @@ export interface MutationCreateCommentTypedDataArgs { } +export interface MutationCreateCommentViaDispatcherArgs { + request: CreatePublicCommentRequest; +} + + export interface MutationCreateFollowTypedDataArgs { options?: InputMaybe; request: FollowRequest; @@ -1414,12 +1505,22 @@ export interface MutationCreateMirrorTypedDataArgs { } +export interface MutationCreateMirrorViaDispatcherArgs { + request: CreateMirrorRequest; +} + + export interface MutationCreatePostTypedDataArgs { options?: InputMaybe; request: CreatePublicPostRequest; } +export interface MutationCreatePostViaDispatcherArgs { + request: CreatePublicPostRequest; +} + + export interface MutationCreateSetDefaultProfileTypedDataArgs { options?: InputMaybe; request: CreateSetDefaultProfileRequest; @@ -1450,12 +1551,22 @@ export interface MutationCreateSetProfileImageUriTypedDataArgs { } +export interface MutationCreateSetProfileImageUriViaDispatcherArgs { + request: UpdateProfileImageRequest; +} + + export interface MutationCreateSetProfileMetadataTypedDataArgs { options?: InputMaybe; request: CreatePublicSetProfileMetadataUriRequest; } +export interface MutationCreateSetProfileMetadataViaDispatcherArgs { + request: CreatePublicSetProfileMetadataUriRequest; +} + + export interface MutationCreateToggleFollowTypedDataArgs { options?: InputMaybe; request: CreateToggleFollowRequest; @@ -1473,6 +1584,11 @@ export interface MutationHidePublicationArgs { } +export interface MutationProxyActionArgs { + request: ProxyActionRequest; +} + + export interface MutationRefreshArgs { request: RefreshRequest; } @@ -1487,6 +1603,15 @@ export interface MutationReportPublicationArgs { request: ReportPublicationRequest; } +export interface MutualFollowersProfilesQueryRequest { + cursor?: InputMaybe; + limit?: InputMaybe; + /** The profile id your viewing */ + viewingProfileId: Scalars['ProfileId']; + /** The profile id you want the result to come back as your viewing from */ + yourProfileId: Scalars['ProfileId']; +} + /** The nft type */ export interface Nft { __typename?: 'NFT'; @@ -1556,6 +1681,7 @@ export interface NewCollectNotification { __typename?: 'NewCollectNotification'; collectedPublication: Publication; createdAt: Scalars['DateTime']; + notificationId: Scalars['NotificationId']; wallet: Wallet; } @@ -1563,6 +1689,7 @@ export interface NewCommentNotification { __typename?: 'NewCommentNotification'; comment: Comment; createdAt: Scalars['DateTime']; + notificationId: Scalars['NotificationId']; /** The profile */ profile: Profile; } @@ -1571,6 +1698,7 @@ export interface NewFollowerNotification { __typename?: 'NewFollowerNotification'; createdAt: Scalars['DateTime']; isFollowedByMe: Scalars['Boolean']; + notificationId: Scalars['NotificationId']; wallet: Wallet; } @@ -1578,11 +1706,13 @@ export interface NewMentionNotification { __typename?: 'NewMentionNotification'; createdAt: Scalars['DateTime']; mentionPublication: MentionPublication; + notificationId: Scalars['NotificationId']; } export interface NewMirrorNotification { __typename?: 'NewMirrorNotification'; createdAt: Scalars['DateTime']; + notificationId: Scalars['NotificationId']; /** The profile */ profile: Profile; publication: MirrorablePublication; @@ -1633,6 +1763,7 @@ export type Notification = NewCollectNotification | NewCommentNotification | New export interface NotificationRequest { cursor?: InputMaybe; limit?: InputMaybe; + metadata?: InputMaybe; /** The profile id */ profileId: Scalars['ProfileId']; /** The App Id */ @@ -1647,6 +1778,8 @@ export interface OnChainIdentity { proofOfHumanity: Scalars['Boolean']; /** The sybil dot org information */ sybilDotOrg: SybilDotOrgIdentity; + /** The worldcoin identity */ + worldcoin: WorldcoinIdentity; } /** The nft type */ @@ -1658,6 +1791,13 @@ export interface Owner { amount: Scalars['Float']; } +/** The paginated wallet result */ +export interface PaginatedAllPublicationsTagsResult { + __typename?: 'PaginatedAllPublicationsTagsResult'; + items: Array; + pageInfo: PaginatedResultInfo; +} + /** The paginated followers result */ export interface PaginatedFollowersResult { __typename?: 'PaginatedFollowersResult'; @@ -1728,6 +1868,12 @@ export interface PaginatedWhoCollectedResult { pageInfo: PaginatedResultInfo; } +export interface PaginatedWhoReactedResult { + __typename?: 'PaginatedWhoReactedResult'; + items: Array; + pageInfo: PaginatedResultInfo; +} + export interface PendingApprovalFollowsRequest { cursor?: InputMaybe; limit?: InputMaybe; @@ -1858,6 +2004,7 @@ export interface ProfileOnChainIdentityRequest { export interface ProfilePublicationRevenueQueryRequest { cursor?: InputMaybe; limit?: InputMaybe; + metadata?: InputMaybe; /** The profile id */ profileId: Scalars['ProfileId']; /** The App Id */ @@ -1876,6 +2023,7 @@ export interface ProfilePublicationRevenueResult { export interface ProfilePublicationsForSaleRequest { cursor?: InputMaybe; limit?: InputMaybe; + metadata?: InputMaybe; /** Profile id */ profileId: Scalars['ProfileId']; /** The App Id */ @@ -1962,10 +2110,92 @@ export interface ProfileStatsPublicationsTotalArgs { forSources: Array; } +export interface ProxyActionError { + __typename?: 'ProxyActionError'; + lastKnownTxId?: Maybe; + reason: Scalars['String']; +} + +export interface ProxyActionQueued { + __typename?: 'ProxyActionQueued'; + queuedAt: Scalars['DateTime']; +} + +export interface ProxyActionRequest { + collect?: InputMaybe; + follow?: InputMaybe; +} + +export interface ProxyActionStatusResult { + __typename?: 'ProxyActionStatusResult'; + status: ProxyActionStatusTypes; + txHash: Scalars['TxHash']; + txId: Scalars['TxId']; +} + +export type ProxyActionStatusResultUnion = ProxyActionError | ProxyActionQueued | ProxyActionStatusResult; + +/** The proxy action status */ +export type ProxyActionStatusTypes = + | 'COMPLETE' + | 'MINTING' + | 'TRANSFERRING'; + export type Publication = Comment | Mirror | Post; +/** The publication content warning */ +export type PublicationContentWarning = + | 'NSFW' + | 'SENSITIVE' + | 'SPOILER'; + export type PublicationForSale = Comment | Post; +/** The publication main focus */ +export type PublicationMainFocus = + | 'ARTICLE' + | 'AUDIO' + | 'EMBED' + | 'IMAGE' + | 'LINK' + | 'TEXT_ONLY' + | 'VIDEO'; + +/** Publication metadata content waring filters */ +export interface PublicationMetadataContentWarningFilter { + /** By default all content warnings will be hidden you can include them in your query by adding them to this array. */ + includeOneOf?: InputMaybe>; +} + +/** The publication metadata display types */ +export type PublicationMetadataDisplayTypes = + | 'date' + | 'number' + | 'string'; + +/** Publication metadata filters */ +export interface PublicationMetadataFilters { + contentWarning?: InputMaybe; + /** + * IOS 639-1 language code aka en or it and ISO 3166-1 alpha-2 region code aka US + * or IT aka en-US or it-IT. You can just filter on language if you wish. + */ + locale?: InputMaybe; + mainContentFocus?: InputMaybe>; + tags?: InputMaybe; +} + +/** The metadata attribute output */ +export interface PublicationMetadataMediaInput { + /** The alt tags for accessibility */ + altTag?: InputMaybe; + /** The cover for any video or audio you attached */ + cover?: InputMaybe; + item: Scalars['Url']; + /** This is the mime type of media */ + type?: InputMaybe; +} + export interface PublicationMetadataStatus { __typename?: 'PublicationMetadataStatus'; /** If metadata validation failed it will put a reason why here */ @@ -1976,9 +2206,118 @@ export interface PublicationMetadataStatus { /** publication metadata status type */ export type PublicationMetadataStatusType = | 'METADATA_VALIDATION_FAILED' + | 'NOT_FOUND' | 'PENDING' | 'SUCCESS'; +/** Publication metadata tag filter */ +export interface PublicationMetadataTagsFilter { + /** Needs to only match all */ + all?: InputMaybe>; + /** Needs to only match one of */ + oneOf?: InputMaybe>; +} + +export interface PublicationMetadataV1Input { + /** + * A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, + * and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA. + * Animation_url also supports HTML pages, allowing you to build rich + * experiences and interactive NFTs using JavaScript canvas, + * WebGL, and more. Scripts and relative paths within the HTML page are now + * supported. However, access to browser extensions is not supported. + */ + animation_url?: InputMaybe; + /** This is the appId the content belongs to */ + appId?: InputMaybe; + /** These are the attributes for the item, which will show up on the OpenSea and others NFT trading websites on the item. */ + attributes: Array; + /** The content of a publication. If this is blank `media` must be defined or its out of spec */ + content?: InputMaybe; + /** A human-readable description of the item. */ + description?: InputMaybe; + /** + * This is the URL that will appear below the asset's image on OpenSea and others etc + * and will allow users to leave OpenSea and view the item on the site. + */ + external_url?: InputMaybe; + /** legacy to support OpenSea will store any NFT image here. */ + image?: InputMaybe; + /** + * This is the mime type of the image. This is used if your uploading more + * advanced cover images as sometimes ipfs does not emit the content header so + * this solves that + */ + imageMimeType?: InputMaybe; + /** This is lens supported attached media items to the publication */ + media?: InputMaybe>; + /** + * The metadata id can be anything but if your uploading to ipfs you will want it + * to be random.. using uuid could be an option! + */ + metadata_id: Scalars['String']; + /** Name of the item. */ + name: Scalars['String']; + /** Signed metadata to validate the owner */ + signatureContext?: InputMaybe; + /** The metadata version. (1.0.0 | 2.0.0) */ + version: Scalars['String']; +} + +export interface PublicationMetadataV2Input { + /** + * A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, + * and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA. + * Animation_url also supports HTML pages, allowing you to build rich + * experiences and interactive NFTs using JavaScript canvas, + * WebGL, and more. Scripts and relative paths within the HTML page are now + * supported. However, access to browser extensions is not supported. + */ + animation_url?: InputMaybe; + /** This is the appId the content belongs to */ + appId?: InputMaybe; + /** These are the attributes for the item, which will show up on the OpenSea and others NFT trading websites on the item. */ + attributes: Array; + /** The content of a publication. If this is blank `media` must be defined or its out of spec */ + content?: InputMaybe; + /** Ability to add a content warning */ + contentWarning?: InputMaybe; + /** A human-readable description of the item. */ + description?: InputMaybe; + /** + * This is the URL that will appear below the asset's image on OpenSea and others etc + * and will allow users to leave OpenSea and view the item on the site. + */ + external_url?: InputMaybe; + /** legacy to support OpenSea will store any NFT image here. */ + image?: InputMaybe; + /** + * This is the mime type of the image. This is used if your uploading more + * advanced cover images as sometimes ipfs does not emit the content header so + * this solves that + */ + imageMimeType?: InputMaybe; + /** IOS 639-1 language code aka en or it and ISO 3166-1 alpha-2 region code aka US or IT aka en-US or it-IT */ + locale: Scalars['Locale']; + /** Main content focus that for this publication */ + mainContentFocus: PublicationMainFocus; + /** This is lens supported attached media items to the publication */ + media?: InputMaybe>; + /** + * The metadata id can be anything but if your uploading to ipfs you will want it + * to be random.. using uuid could be an option! + */ + metadata_id: Scalars['String']; + /** Name of the item. */ + name: Scalars['String']; + /** Signed metadata to validate the owner */ + signatureContext?: InputMaybe; + /** Ability to tag your publication */ + tags?: InputMaybe>; + /** The metadata version. (1.0.0 | 2.0.0) */ + version: Scalars['String']; +} + export interface PublicationQueryRequest { /** The publication id */ publicationId?: InputMaybe; @@ -1994,19 +2333,33 @@ export type PublicationReportingFraudSubreason = /** Publication reporting illegal subreason */ export type PublicationReportingIllegalSubreason = | 'ANIMAL_ABUSE' - | 'HUMAN_ABUSE'; + | 'DIRECT_THREAT' + | 'HUMAN_ABUSE' + | 'THREAT_INDIVIDUAL' + | 'VIOLENCE'; /** Publication reporting reason */ export type PublicationReportingReason = | 'FRAUD' | 'ILLEGAL' - | 'SENSITIVE'; + | 'SENSITIVE' + | 'SPAM'; /** Publication reporting sensitive subreason */ export type PublicationReportingSensitiveSubreason = | 'NSFW' | 'OFFENSIVE'; +/** Publication reporting spam subreason */ +export type PublicationReportingSpamSubreason = + | 'FAKE_ENGAGEMENT' + | 'MANIPULATION_ALGO' + | 'MISLEADING' + | 'MISUSE_HASHTAGS' + | 'REPETITIVE' + | 'SOMETHING_ELSE' + | 'UNRELATED'; + /** The social comment */ export interface PublicationRevenue { __typename?: 'PublicationRevenue'; @@ -2029,6 +2382,10 @@ export interface PublicationSearchResult { export type PublicationSearchResultItem = Comment | Post; +export interface PublicationSignatureContextInput { + signature: Scalars['String']; +} + /** Publication sort criteria */ export type PublicationSortCriteria = | 'LATEST' @@ -2066,6 +2423,13 @@ export type PublicationTypes = | 'MIRROR' | 'POST'; +export interface PublicationValidateMetadataResult { + __typename?: 'PublicationValidateMetadataResult'; + /** If `valid` is false it will put a reason why here */ + reason?: Maybe; + valid: Scalars['Boolean']; +} + export interface PublicationsQueryRequest { /** The ethereum address */ collectedBy?: InputMaybe; @@ -2073,6 +2437,7 @@ export interface PublicationsQueryRequest { commentsOf?: InputMaybe; cursor?: InputMaybe; limit?: InputMaybe; + metadata?: InputMaybe; /** Profile id */ profileId?: InputMaybe; /** The publication id */ @@ -2085,21 +2450,24 @@ export interface PublicationsQueryRequest { export interface Query { __typename?: 'Query'; + allPublicationsTags: PaginatedAllPublicationsTagsResult; approvedModuleAllowanceAmount: Array; challenge: AuthChallengeResult; claimableHandles: ClaimableHandles; + claimableStatus: ClaimStatus; defaultProfile?: Maybe; doesFollow: Array; enabledModuleCurrencies: Array; enabledModules: EnabledModules; exploreProfiles: ExploreProfileResult; explorePublications: ExplorePublicationResult; - followerNftOwnedTokenIds: FollowerNftOwnedTokenIds; + followerNftOwnedTokenIds?: Maybe; followers: PaginatedFollowersResult; following: PaginatedFollowingResult; generateModuleCurrencyApprovalData: GenerateModuleCurrencyApproval; globalProtocolStats: GlobalProtocolStats; hasTxHashBeenIndexed: TransactionResult; + mutualFollowersProfiles: PaginatedProfileResult; nftOwnershipChallenge: NftOwnershipChallengeResult; nfts: NfTsResult; notifications: PaginatedNotificationResult; @@ -2112,15 +2480,27 @@ export interface Query { profilePublicationRevenue: ProfilePublicationRevenueResult; profilePublicationsForSale: PaginatedProfilePublicationsForSaleResult; profiles: PaginatedProfileResult; + proxyActionStatus: ProxyActionStatusResultUnion; publication?: Maybe; + publicationMetadataStatus: PublicationMetadataStatus; publicationRevenue?: Maybe; publications: PaginatedPublicationResult; recommendedProfiles: Array; + rel?: Maybe; search: SearchResult; timeline: PaginatedTimelineResult; + txIdToTxHash: Scalars['TxHash']; + unknownEnabledModules: EnabledModules; userSigNonces: UserSigNonces; + validatePublicationMetadata: PublicationValidateMetadataResult; verify: Scalars['Boolean']; whoCollectedPublication: PaginatedWhoCollectedResult; + whoReactedPublication: PaginatedWhoReactedResult; +} + + +export interface QueryAllPublicationsTagsArgs { + request: AllPublicationsTagsRequest; } @@ -2184,6 +2564,11 @@ export interface QueryHasTxHashBeenIndexedArgs { } +export interface QueryMutualFollowersProfilesArgs { + request: MutualFollowersProfilesQueryRequest; +} + + export interface QueryNftOwnershipChallengeArgs { request: NftOwnershipChallengeRequest; } @@ -2239,11 +2624,21 @@ export interface QueryProfilesArgs { } +export interface QueryProxyActionStatusArgs { + proxyActionId: Scalars['ProxyActionId']; +} + + export interface QueryPublicationArgs { request: PublicationQueryRequest; } +export interface QueryPublicationMetadataStatusArgs { + request: GetPublicationMetadataStatusRequest; +} + + export interface QueryPublicationRevenueArgs { request: PublicationRevenueQueryRequest; } @@ -2254,6 +2649,11 @@ export interface QueryPublicationsArgs { } +export interface QueryRelArgs { + request: RelRequest; +} + + export interface QuerySearchArgs { request: SearchQueryRequest; } @@ -2264,6 +2664,16 @@ export interface QueryTimelineArgs { } +export interface QueryTxIdToTxHashArgs { + txId: Scalars['TxId']; +} + + +export interface QueryValidatePublicationMetadataArgs { + request: ValidatePublicationMetadataRequest; +} + + export interface QueryVerifyArgs { request: VerifyRequest; } @@ -2273,6 +2683,11 @@ export interface QueryWhoCollectedPublicationArgs { request: WhoCollectedPublicationRequest; } + +export interface QueryWhoReactedPublicationArgs { + request: WhoReactedPublicationRequest; +} + export interface ReactionFieldResolverRequest { /** Profile id */ profileId?: InputMaybe; @@ -2292,16 +2707,19 @@ export type ReactionTypes = | 'DOWNVOTE' | 'UPVOTE'; -export type ReferenceModule = FollowOnlyReferenceModuleSettings; +export type ReferenceModule = FollowOnlyReferenceModuleSettings | UnknownReferenceModuleSettings; export interface ReferenceModuleParams { /** The follower only reference module */ followerOnlyReferenceModule?: InputMaybe; + /** A unknown reference module */ + unknownReferenceModule?: InputMaybe; } /** The reference module types */ export type ReferenceModules = - | 'FollowerOnlyReferenceModule'; + | 'FollowerOnlyReferenceModule' + | 'UnknownReferenceModule'; /** The refresh request */ export interface RefreshRequest { @@ -2309,6 +2727,11 @@ export interface RefreshRequest { refreshToken: Scalars['Jwt']; } +export interface RelRequest { + ethereumAddress: Scalars['EthereumAddress']; + secret: Scalars['String']; +} + export interface RelayError { __typename?: 'RelayError'; reason: RelayErrorReasons; @@ -2343,6 +2766,7 @@ export interface ReportingReasonInputParams { fraudReason?: InputMaybe; illegalReason?: InputMaybe; sensitiveReason?: InputMaybe; + spamReason?: InputMaybe; } export interface ReservedClaimableHandle { @@ -2432,7 +2856,11 @@ export interface SetDefaultProfileEip712TypedDataValue { } export interface SetDispatcherRequest { - /** The dispatcher address - they can post, comment, mirror, set follow module, change your profile picture on your behalf. */ + /** + * The dispatcher address - they can post, comment, mirror, set follow module, + * change your profile picture on your behalf, if left as none it will use the + * built in dispatcher address. + */ dispatcher?: InputMaybe; /** If you want to enable or disable it */ enable?: InputMaybe; @@ -2455,6 +2883,11 @@ export interface SingleProfileQueryRequest { profileId?: InputMaybe; } +export interface SpamReasonInputParams { + reason: PublicationReportingReason; + subreason: PublicationReportingSpamSubreason; +} + export interface SybilDotOrgIdentity { __typename?: 'SybilDotOrgIdentity'; source: SybilDotOrgIdentitySource; @@ -2472,6 +2905,20 @@ export interface SybilDotOrgTwitterIdentity { handle?: Maybe; } +/** The social comment */ +export interface TagResult { + __typename?: 'TagResult'; + /** The tag */ + tag: Scalars['PublicationTag']; + /** The total amount of publication tagged */ + total: Scalars['Int']; +} + +/** The publications tags sort criteria */ +export type TagSortCriteria = + | 'ALPHABETICAL' + | 'MOST_POPULAR'; + export interface TimedFeeCollectModuleParams { /** The collect module amount info */ amount: ModuleFeeAmountParams; @@ -2503,6 +2950,7 @@ export interface TimedFeeCollectModuleSettings { export interface TimelineRequest { cursor?: InputMaybe; limit?: InputMaybe; + metadata?: InputMaybe; /** The profile id */ profileId: Scalars['ProfileId']; /** The App Id */ @@ -2574,6 +3022,56 @@ export interface UnfollowRequest { profile: Scalars['ProfileId']; } +export interface UnknownCollectModuleParams { + contractAddress: Scalars['ContractAddress']; + /** The encoded data to submit with the module */ + data: Scalars['BlockchainData']; +} + +export interface UnknownCollectModuleSettings { + __typename?: 'UnknownCollectModuleSettings'; + /** The data used to setup the module which you can decode with your known ABI */ + collectModuleReturnData: Scalars['CollectModuleData']; + contractAddress: Scalars['ContractAddress']; + /** The collect modules enum */ + type: CollectModules; +} + +export interface UnknownFollowModuleParams { + contractAddress: Scalars['ContractAddress']; + /** The encoded data to submit with the module */ + data: Scalars['BlockchainData']; +} + +export interface UnknownFollowModuleRedeemParams { + /** The encoded data to submit with the module */ + data: Scalars['BlockchainData']; +} + +export interface UnknownFollowModuleSettings { + __typename?: 'UnknownFollowModuleSettings'; + contractAddress: Scalars['ContractAddress']; + /** The data used to setup the module which you can decode with your known ABI */ + followModuleReturnData: Scalars['FollowModuleData']; + /** The follow modules enum */ + type: FollowModules; +} + +export interface UnknownReferenceModuleParams { + contractAddress: Scalars['ContractAddress']; + /** The encoded data to submit with the module */ + data: Scalars['BlockchainData']; +} + +export interface UnknownReferenceModuleSettings { + __typename?: 'UnknownReferenceModuleSettings'; + contractAddress: Scalars['ContractAddress']; + /** The data used to setup the module which you can decode with your known ABI */ + referenceModuleReturnData: Scalars['ReferenceModuleData']; + /** The reference modules enum */ + type: ReferenceModules; +} + export interface UpdateProfileImageRequest { /** The nft data */ nftData?: InputMaybe; @@ -2588,6 +3086,11 @@ export interface UserSigNonces { peripheryOnChainSigNonce: Scalars['Nonce']; } +export interface ValidatePublicationMetadataRequest { + metadatav1?: InputMaybe; + metadatav2?: InputMaybe; +} + /** The access request */ export interface VerifyRequest { /** The access token */ @@ -2610,3 +3113,28 @@ export interface WhoCollectedPublicationRequest { /** Internal publication id */ publicationId: Scalars['InternalPublicationId']; } + +export interface WhoReactedPublicationRequest { + cursor?: InputMaybe; + limit?: InputMaybe; + /** Internal publication id */ + publicationId: Scalars['InternalPublicationId']; +} + +/** The Profile */ +export interface WhoReactedResult { + __typename?: 'WhoReactedResult'; + profile: Profile; + /** The reaction */ + reaction: ReactionTypes; + /** The reaction */ + reactionAt: Scalars['DateTime']; + /** The reaction id */ + reactionId: Scalars['ReactionId']; +} + +export interface WorldcoinIdentity { + __typename?: 'WorldcoinIdentity'; + /** If the profile has verified as a user */ + isHuman: Scalars['Boolean']; +} diff --git a/libs/dao-data/src/subgraph/schema-lens.graphql b/libs/dao-data/src/subgraph/schema-lens.graphql index 2a44808e0..c640e5f1f 100644 --- a/libs/dao-data/src/subgraph/schema-lens.graphql +++ b/libs/dao-data/src/subgraph/schema-lens.graphql @@ -10,6 +10,16 @@ input AchRequest { handle: CreateHandle freeTextHandle: Boolean overrideTradeMark: Boolean! + overrideAlreadyClaimed: Boolean! +} + +input AllPublicationsTagsRequest { + limit: LimitScalar + cursor: Cursor + sort: TagSortCriteria! + + """The App Id""" + source: Sources } type ApprovedAllowanceAmount { @@ -24,9 +34,12 @@ input ApprovedModuleAllowanceAmountRequest { The contract addresses for the module approved currencies you want to find information on about the user """ currencies: [ContractAddress!]! - collectModules: [CollectModules!]! - followModules: [FollowModules!]! - referenceModules: [ReferenceModules!]! + collectModules: [CollectModules!] = [] + unknownCollectModules: [ContractAddress!] = [] + followModules: [FollowModules!] = [] + unknownFollowModules: [ContractAddress!] = [] + referenceModules: [ReferenceModules!] = [] + unknownReferenceModules: [ContractAddress!] = [] } """The Profile""" @@ -98,7 +111,14 @@ input ClaimHandleRequest { followModule: FollowModuleParams } -union CollectModule = FreeCollectModuleSettings | FeeCollectModuleSettings | LimitedFeeCollectModuleSettings | LimitedTimedFeeCollectModuleSettings | RevertCollectModuleSettings | TimedFeeCollectModuleSettings +"""The claim status""" +enum ClaimStatus { + ALREADY_CLAIMED + CLAIM_FAILED + NOT_CLAIMED +} + +union CollectModule = FreeCollectModuleSettings | FeeCollectModuleSettings | LimitedFeeCollectModuleSettings | LimitedTimedFeeCollectModuleSettings | RevertCollectModuleSettings | TimedFeeCollectModuleSettings | UnknownCollectModuleSettings """collect module data scalar type""" scalar CollectModuleData @@ -121,6 +141,9 @@ input CollectModuleParams { """The collect timed fee collect module""" timedFeeCollectModule: TimedFeeCollectModuleParams + + """A unknown collect module""" + unknownCollectModule: UnknownCollectModuleParams } """The collect module types""" @@ -131,6 +154,11 @@ enum CollectModules { TimedFeeCollectModule RevertCollectModule FreeCollectModule + UnknownCollectModule +} + +input CollectProxyAction { + freeCollect: FreeCollectProxyAction } """The social comment""" @@ -273,6 +301,9 @@ type CreateCollectEIP712TypedDataValue { input CreateCollectRequest { publicationId: InternalPublicationId! + + """The encoded data to collect with if using an unknown module""" + unknownModuleData: BlockchainData } """The broadcast item""" @@ -913,6 +944,7 @@ input ExplorePublicationRequest { """If you wish to exclude any results for profile ids""" excludeProfileIds: [ProfileId!] + metadata: PublicationMetadataFilters } """The paginated publication result""" @@ -1015,7 +1047,7 @@ input FollowingRequest { address: EthereumAddress! } -union FollowModule = FeeFollowModuleSettings | ProfileFollowModuleSettings | RevertFollowModuleSettings +union FollowModule = FeeFollowModuleSettings | ProfileFollowModuleSettings | RevertFollowModuleSettings | UnknownFollowModuleSettings """follow module data scalar type""" scalar FollowModuleData @@ -1032,6 +1064,9 @@ input FollowModuleParams { """The empty follow module""" freeFollowModule: Boolean + + """A unknown follow module""" + unknownFollowModule: UnknownFollowModuleParams } input FollowModuleRedeemParams { @@ -1040,6 +1075,9 @@ input FollowModuleRedeemParams { """The profile follower module""" profileFollowModule: ProfileFollowModuleRedeemParams + + """A unknown follow module""" + unknownFollowModule: UnknownFollowModuleRedeemParams } """The follow module types""" @@ -1047,6 +1085,7 @@ enum FollowModules { FeeFollowModule RevertFollowModule ProfileFollowModule + UnknownFollowModule } type FollowOnlyReferenceModuleSettings { @@ -1055,6 +1094,10 @@ type FollowOnlyReferenceModuleSettings { contractAddress: ContractAddress! } +input FollowProxyAction { + freeFollow: FreeFollowProxyAction +} + input FollowRequest { follow: [Follow!]! } @@ -1082,6 +1125,14 @@ type FreeCollectModuleSettings { followerOnly: Boolean! } +input FreeCollectProxyAction { + publicationId: InternalPublicationId! +} + +input FreeFollowProxyAction { + profileId: ProfileId! +} + type GenerateModuleCurrencyApproval { to: ContractAddress! from: EthereumAddress! @@ -1096,8 +1147,17 @@ input GenerateModuleCurrencyApprovalDataRequest { """ value: String! collectModule: CollectModules + unknownCollectModule: ContractAddress followModule: FollowModules + unknownFollowModule: ContractAddress referenceModule: ReferenceModules + unknownReferenceModule: ContractAddress +} + +input GetPublicationMetadataStatusRequest { + publicationId: InternalPublicationId + txHash: TxHash + txId: TxId } type GlobalProtocolStats { @@ -1238,6 +1298,9 @@ type LimitedTimedFeeCollectModuleSettings { """limit custom scalar type""" scalar LimitScalar +"""Locale scalar type""" +scalar Locale + type Log { blockNumber: Int! blockHash: String! @@ -1271,6 +1334,12 @@ type Media { """The image/audio/video mime type for the publication""" mimeType: MimeType + + """The alt tags for accessibility""" + altTag: String + + """The cover for any video or audio you attached""" + cover: String } """The Media Set""" @@ -1287,10 +1356,24 @@ type MediaSet { union MentionPublication = Post | Comment +"""The metadata attribute input""" +input MetadataAttributeInput { + """The display type""" + displayType: PublicationMetadataDisplayTypes + + """ + The trait type - can be anything its the name it will render so include spaces + """ + traitType: String! + + """The value""" + value: String! +} + """The metadata attribute output""" type MetadataAttributeOutput { """The display type""" - displayType: MetadataDisplayType + displayType: PublicationMetadataDisplayTypes """ The trait type - can be anything its the name it will render so include spaces @@ -1301,13 +1384,6 @@ type MetadataAttributeOutput { value: String } -"""The metadata display types""" -enum MetadataDisplayType { - number - string - date -} - """The metadata output""" type MetadataOutput { """The metadata name""" @@ -1332,6 +1408,18 @@ type MetadataOutput { """The attributes""" attributes: [MetadataAttributeOutput!]! + + """The locale of the publication, """ + locale: Locale + + """The tags for the publication""" + tags: [String!]! + + """The content warning for the publication""" + contentWarning: PublicationContentWarning + + """The main focus of the publication""" + mainContentFocus: PublicationMainFocus! } """mimetype custom scalar type""" @@ -1424,48 +1512,72 @@ type Mutation { createCollectTypedData(options: TypedDataOptions, request: CreateCollectRequest!): CreateCollectBroadcastItemResult! createSetDefaultProfileTypedData(options: TypedDataOptions, request: CreateSetDefaultProfileRequest!): SetDefaultProfileBroadcastItemResult! createSetProfileImageURITypedData(options: TypedDataOptions, request: UpdateProfileImageRequest!): CreateSetProfileImageUriBroadcastItemResult! + createSetProfileImageURIViaDispatcher(request: UpdateProfileImageRequest!): RelayResult! createBurnProfileTypedData(options: TypedDataOptions, request: BurnProfileRequest!): CreateBurnProfileBroadcastItemResult! createPostTypedData(options: TypedDataOptions, request: CreatePublicPostRequest!): CreatePostBroadcastItemResult! + createPostViaDispatcher(request: CreatePublicPostRequest!): RelayResult! createCommentTypedData(options: TypedDataOptions, request: CreatePublicCommentRequest!): CreateCommentBroadcastItemResult! + createCommentViaDispatcher(request: CreatePublicCommentRequest!): RelayResult! createMirrorTypedData(options: TypedDataOptions, request: CreateMirrorRequest!): CreateMirrorBroadcastItemResult! hidePublication(request: HidePublicationRequest!): Void + createMirrorViaDispatcher(request: CreateMirrorRequest!): RelayResult! claim(request: ClaimHandleRequest!): RelayResult! createSetProfileMetadataTypedData(options: TypedDataOptions, request: CreatePublicSetProfileMetadataURIRequest!): CreateSetProfileMetadataURIBroadcastItemResult! + createSetProfileMetadataViaDispatcher(request: CreatePublicSetProfileMetadataURIRequest!): RelayResult! + proxyAction(request: ProxyActionRequest!): ProxyActionId! addReaction(request: ReactionRequest!): Void removeReaction(request: ReactionRequest!): Void reportPublication(request: ReportPublicationRequest!): Void ach(request: AchRequest!): Void } +input MutualFollowersProfilesQueryRequest { + limit: LimitScalar + cursor: Cursor + + """The profile id your viewing""" + viewingProfileId: ProfileId! + + """The profile id you want the result to come back as your viewing from""" + yourProfileId: ProfileId! +} + type NewCollectNotification { + notificationId: NotificationId! + createdAt: DateTime! wallet: Wallet! collectedPublication: Publication! - createdAt: DateTime! } type NewCommentNotification { + notificationId: NotificationId! + createdAt: DateTime! + """The profile""" profile: Profile! comment: Comment! - createdAt: DateTime! } type NewFollowerNotification { + notificationId: NotificationId! + createdAt: DateTime! wallet: Wallet! isFollowedByMe: Boolean! - createdAt: DateTime! } type NewMentionNotification { - mentionPublication: MentionPublication! + notificationId: NotificationId! createdAt: DateTime! + mentionPublication: MentionPublication! } type NewMirrorNotification { + notificationId: NotificationId! + createdAt: DateTime! + """The profile""" profile: Profile! publication: MirrorablePublication! - createdAt: DateTime! } """The nft type""" @@ -1602,6 +1714,9 @@ scalar Nonce union Notification = NewFollowerNotification | NewCollectNotification | NewCommentNotification | NewMirrorNotification | NewMentionNotification +"""The notification id""" +scalar NotificationId + input NotificationRequest { limit: LimitScalar cursor: Cursor @@ -1611,6 +1726,7 @@ input NotificationRequest { """The App Id""" sources: [Sources!] = [] + metadata: PublicationMetadataFilters } type OnChainIdentity { @@ -1622,6 +1738,9 @@ type OnChainIdentity { """The sybil dot org information""" sybilDotOrg: SybilDotOrgIdentity! + + """The worldcoin identity""" + worldcoin: WorldcoinIdentity! } """The nft type""" @@ -1633,6 +1752,12 @@ type Owner { address: EthereumAddress! } +"""The paginated wallet result""" +type PaginatedAllPublicationsTagsResult { + items: [TagResult!]! + pageInfo: PaginatedResultInfo! +} + """The paginated followers result""" type PaginatedFollowersResult { items: [Follower!]! @@ -1696,6 +1821,11 @@ type PaginatedWhoCollectedResult { pageInfo: PaginatedResultInfo! } +type PaginatedWhoReactedResult { + items: [WhoReactedResult!]! + pageInfo: PaginatedResultInfo! +} + input PendingApprovalFollowsRequest { limit: LimitScalar cursor: Cursor @@ -1847,6 +1977,7 @@ input ProfilePublicationRevenueQueryRequest { """The revenue types""" types: [PublicationTypes!] = [COMMENT, MIRROR, POST] + metadata: PublicationMetadataFilters } """The paginated revenue result""" @@ -1864,6 +1995,7 @@ input ProfilePublicationsForSaleRequest { """The App Id""" sources: [Sources!] = [] + metadata: PublicationMetadataFilters } input ProfileQueryRequest { @@ -1934,13 +2066,104 @@ type ProfileStats { publicationsTotal(forSources: [Sources!]!): Int! } +type ProxyActionError { + reason: String! + lastKnownTxId: TxId +} + +"""proxy action scalar id type""" +scalar ProxyActionId + +type ProxyActionQueued { + queuedAt: DateTime! +} + +input ProxyActionRequest { + follow: FollowProxyAction + collect: CollectProxyAction +} + +type ProxyActionStatusResult { + txHash: TxHash! + txId: TxId! + status: ProxyActionStatusTypes! +} + +union ProxyActionStatusResultUnion = ProxyActionStatusResult | ProxyActionError | ProxyActionQueued + +"""The proxy action status""" +enum ProxyActionStatusTypes { + MINTING + TRANSFERRING + COMPLETE +} + union Publication = Post | Comment | Mirror +"""The publication content warning""" +enum PublicationContentWarning { + NSFW + SENSITIVE + SPOILER +} + union PublicationForSale = Post | Comment """Publication id custom scalar type""" scalar PublicationId +"""The publication main focus""" +enum PublicationMainFocus { + VIDEO + IMAGE + ARTICLE + TEXT_ONLY + AUDIO + LINK + EMBED +} + +"""Publication metadata content waring filters""" +input PublicationMetadataContentWarningFilter { + """ + By default all content warnings will be hidden you can include them in your query by adding them to this array. + """ + includeOneOf: [PublicationContentWarning!] +} + +"""The publication metadata display types""" +enum PublicationMetadataDisplayTypes { + number + string + date +} + +"""Publication metadata filters""" +input PublicationMetadataFilters { + """ + IOS 639-1 language code aka en or it and ISO 3166-1 alpha-2 region code aka US + or IT aka en-US or it-IT. You can just filter on language if you wish. + """ + locale: Locale + contentWarning: PublicationMetadataContentWarningFilter + mainContentFocus: [PublicationMainFocus!] = [ARTICLE, AUDIO, VIDEO, EMBED, IMAGE, LINK, TEXT_ONLY] + tags: PublicationMetadataTagsFilter +} + +"""The metadata attribute output""" +input PublicationMetadataMediaInput { + item: Url! + + """This is the mime type of media""" + type: MimeType + + """The alt tags for accessibility""" + altTag: String + + """The cover for any video or audio you attached""" + cover: String +} + type PublicationMetadataStatus { status: PublicationMetadataStatusType! @@ -1950,11 +2173,157 @@ type PublicationMetadataStatus { """publication metadata status type""" enum PublicationMetadataStatusType { + NOT_FOUND PENDING METADATA_VALIDATION_FAILED SUCCESS } +"""Publication metadata tag filter""" +input PublicationMetadataTagsFilter { + """Needs to only match one of""" + oneOf: [String!] + + """Needs to only match all""" + all: [String!] +} + +input PublicationMetadataV1Input { + """The metadata version. (1.0.0 | 2.0.0)""" + version: String! + + """ + The metadata id can be anything but if your uploading to ipfs you will want it + to be random.. using uuid could be an option! + """ + metadata_id: String! + + """ This is the appId the content belongs to""" + appId: Sources + + """A human-readable description of the item.""" + description: String + + """ + The content of a publication. If this is blank `media` must be defined or its out of spec + """ + content: Markdown + + """ + This is the URL that will appear below the asset's image on OpenSea and others etc + and will allow users to leave OpenSea and view the item on the site. + """ + external_url: Url + + """Signed metadata to validate the owner""" + signatureContext: PublicationSignatureContextInput + + """Name of the item.""" + name: String! + + """ These are the attributes for the item, which will show up on the OpenSea and others NFT trading websites on the item. + """ + attributes: [MetadataAttributeInput!]! + + """legacy to support OpenSea will store any NFT image here.""" + image: Url + + """ + This is the mime type of the image. This is used if your uploading more + advanced cover images as sometimes ipfs does not emit the content header so + this solves that + """ + imageMimeType: MimeType + + """ This is lens supported attached media items to the publication""" + media: [PublicationMetadataMediaInput!] + + """ + A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, + and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA. + Animation_url also supports HTML pages, allowing you to build rich + experiences and interactive NFTs using JavaScript canvas, + WebGL, and more. Scripts and relative paths within the HTML page are now + supported. However, access to browser extensions is not supported. + """ + animation_url: Url +} + +input PublicationMetadataV2Input { + """The metadata version. (1.0.0 | 2.0.0)""" + version: String! + + """ + The metadata id can be anything but if your uploading to ipfs you will want it + to be random.. using uuid could be an option! + """ + metadata_id: String! + + """ This is the appId the content belongs to""" + appId: Sources + + """A human-readable description of the item.""" + description: String + + """ + The content of a publication. If this is blank `media` must be defined or its out of spec + """ + content: Markdown + + """ + This is the URL that will appear below the asset's image on OpenSea and others etc + and will allow users to leave OpenSea and view the item on the site. + """ + external_url: Url + + """Signed metadata to validate the owner""" + signatureContext: PublicationSignatureContextInput + + """Name of the item.""" + name: String! + + """ These are the attributes for the item, which will show up on the OpenSea and others NFT trading websites on the item. + """ + attributes: [MetadataAttributeInput!]! + + """legacy to support OpenSea will store any NFT image here.""" + image: Url + + """ + This is the mime type of the image. This is used if your uploading more + advanced cover images as sometimes ipfs does not emit the content header so + this solves that + """ + imageMimeType: MimeType + + """ This is lens supported attached media items to the publication""" + media: [PublicationMetadataMediaInput!] + + """ + A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, + and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA. + Animation_url also supports HTML pages, allowing you to build rich + experiences and interactive NFTs using JavaScript canvas, + WebGL, and more. Scripts and relative paths within the HTML page are now + supported. However, access to browser extensions is not supported. + """ + animation_url: Url + + """ + IOS 639-1 language code aka en or it and ISO 3166-1 alpha-2 region code aka US or IT aka en-US or it-IT + """ + locale: Locale! + + """Ability to tag your publication""" + tags: [String!] + + """Ability to add a content warning""" + contentWarning: PublicationContentWarning + + """Main content focus that for this publication""" + mainContentFocus: PublicationMainFocus! +} + input PublicationQueryRequest { """The publication id""" publicationId: InternalPublicationId @@ -1973,6 +2342,9 @@ enum PublicationReportingFraudSubreason { enum PublicationReportingIllegalSubreason { ANIMAL_ABUSE HUMAN_ABUSE + VIOLENCE + THREAT_INDIVIDUAL + DIRECT_THREAT } """Publication reporting reason""" @@ -1980,6 +2352,7 @@ enum PublicationReportingReason { SENSITIVE ILLEGAL FRAUD + SPAM } """Publication reporting sensitive subreason""" @@ -1988,6 +2361,17 @@ enum PublicationReportingSensitiveSubreason { OFFENSIVE } +"""Publication reporting spam subreason""" +enum PublicationReportingSpamSubreason { + MISLEADING + MISUSE_HASHTAGS + UNRELATED + REPETITIVE + FAKE_ENGAGEMENT + MANIPULATION_ALGO + SOMETHING_ELSE +} + """The social comment""" type PublicationRevenue { publication: Publication! @@ -2008,6 +2392,10 @@ type PublicationSearchResult { union PublicationSearchResultItem = Post | Comment +input PublicationSignatureContextInput { + signature: String! +} + """Publication sort criteria""" enum PublicationSortCriteria { TOP_COMMENTED @@ -2037,6 +2425,7 @@ input PublicationsQueryRequest { """The publication id""" publicationIds: [InternalPublicationId!] + metadata: PublicationMetadataFilters } """The publication stats""" @@ -2061,6 +2450,9 @@ type PublicationStats { commentsTotal(forSources: [Sources!]!): Int! } +"""The publication tag""" +scalar PublicationTag + """The publication types""" enum PublicationTypes { POST @@ -2071,16 +2463,25 @@ enum PublicationTypes { """Publication url scalar type""" scalar PublicationUrl +type PublicationValidateMetadataResult { + valid: Boolean! + + """If `valid` is false it will put a reason why here""" + reason: String +} + type Query { challenge(request: ChallengeRequest!): AuthChallengeResult! verify(request: VerifyRequest!): Boolean! + txIdToTxHash(txId: TxId!): TxHash! explorePublications(request: ExplorePublicationRequest!): ExplorePublicationResult! exploreProfiles(request: ExploreProfilesRequest!): ExploreProfileResult! pendingApprovalFollows(request: PendingApprovalFollowsRequest!): PendingApproveFollowsResult! doesFollow(request: DoesFollowRequest!): [DoesFollowResponse!]! following(request: FollowingRequest!): PaginatedFollowingResult! followers(request: FollowersRequest!): PaginatedFollowersResult! - followerNftOwnedTokenIds(request: FollowerNftOwnedTokenIdsRequest!): FollowerNftOwnedTokenIds! + followerNftOwnedTokenIds(request: FollowerNftOwnedTokenIdsRequest!): FollowerNftOwnedTokenIds + mutualFollowersProfiles(request: MutualFollowersProfilesQueryRequest!): PaginatedProfileResult! ping: String! hasTxHashBeenIndexed(request: HasTxHashBeenIndexedRequest!): TransactionResult! enabledModuleCurrencies: [Erc20!]! @@ -2088,6 +2489,7 @@ type Query { generateModuleCurrencyApprovalData(request: GenerateModuleCurrencyApprovalDataRequest!): GenerateModuleCurrencyApproval! profileFollowModuleBeenRedeemed(request: ProfileFollowModuleBeenRedeemedRequest!): Boolean! enabledModules: EnabledModules! + unknownEnabledModules: EnabledModules! nfts(request: NFTsRequest!): NFTsResult! nftOwnershipChallenge(request: NftOwnershipChallengeRequest!): NftOwnershipChallengeResult! notifications(request: NotificationRequest!): PaginatedNotificationResult! @@ -2100,14 +2502,21 @@ type Query { publication(request: PublicationQueryRequest!): Publication whoCollectedPublication(request: WhoCollectedPublicationRequest!): PaginatedWhoCollectedResult! profilePublicationsForSale(request: ProfilePublicationsForSaleRequest!): PaginatedProfilePublicationsForSaleResult! + allPublicationsTags(request: AllPublicationsTagsRequest!): PaginatedAllPublicationsTagsResult! search(request: SearchQueryRequest!): SearchResult! timeline(request: TimelineRequest!): PaginatedTimelineResult! userSigNonces: UserSigNonces! claimableHandles: ClaimableHandles! + claimableStatus: ClaimStatus! profileOnChainIdentity(request: ProfileOnChainIdentityRequest!): [OnChainIdentity!]! + proxyActionStatus(proxyActionId: ProxyActionId!): ProxyActionStatusResultUnion! + validatePublicationMetadata(request: ValidatePublicationMetadataRequest!): PublicationValidateMetadataResult! + publicationMetadataStatus(request: GetPublicationMetadataStatusRequest!): PublicationMetadataStatus! + whoReactedPublication(request: WhoReactedPublicationRequest!): PaginatedWhoReactedResult! profilePublicationRevenue(request: ProfilePublicationRevenueQueryRequest!): ProfilePublicationRevenueResult! publicationRevenue(request: PublicationRevenueQueryRequest!): PublicationRevenue profileFollowRevenue(request: ProfileFollowRevenueQueryRequest!): FollowRevenueResult! + rel(request: RelRequest!): Void } input ReactionFieldResolverRequest { @@ -2115,6 +2524,9 @@ input ReactionFieldResolverRequest { profileId: ProfileId } +"""The reaction id""" +scalar ReactionId + input ReactionRequest { """Profile id to perform the action""" profileId: ProfileId! @@ -2132,7 +2544,7 @@ enum ReactionTypes { DOWNVOTE } -union ReferenceModule = FollowOnlyReferenceModuleSettings +union ReferenceModule = FollowOnlyReferenceModuleSettings | UnknownReferenceModuleSettings """reference module data scalar type""" scalar ReferenceModuleData @@ -2140,11 +2552,15 @@ scalar ReferenceModuleData input ReferenceModuleParams { """The follower only reference module""" followerOnlyReferenceModule: Boolean + + """A unknown reference module""" + unknownReferenceModule: UnknownReferenceModuleParams } """The reference module types""" enum ReferenceModules { FollowerOnlyReferenceModule + UnknownReferenceModule } """The refresh request""" @@ -2179,10 +2595,16 @@ enum RelayErrorReasons { union RelayResult = RelayerResult | RelayError +input RelRequest { + secret: String! + ethereumAddress: EthereumAddress! +} + input ReportingReasonInputParams { sensitiveReason: SensitiveReasonInputParams illegalReason: IllegalReasonInputParams fraudReason: FraudReasonInputParams + spamReason: SpamReasonInputParams } input ReportPublicationRequest { @@ -2284,7 +2706,9 @@ input SetDispatcherRequest { profileId: ProfileId! """ - The dispatcher address - they can post, comment, mirror, set follow module, change your profile picture on your behalf. + The dispatcher address - they can post, comment, mirror, set follow module, + change your profile picture on your behalf, if left as none it will use the + built in dispatcher address. """ dispatcher: EthereumAddress @@ -2315,6 +2739,11 @@ input SingleProfileQueryRequest { """Sources custom scalar type""" scalar Sources +input SpamReasonInputParams { + reason: PublicationReportingReason! + subreason: PublicationReportingSpamSubreason! +} + type SybilDotOrgIdentity { """The sybil dot org status""" verified: Boolean! @@ -2329,6 +2758,21 @@ type SybilDotOrgTwitterIdentity { handle: String } +"""The social comment""" +type TagResult { + """The tag""" + tag: PublicationTag! + + """The total amount of publication tagged""" + total: Int! +} + +"""The publications tags sort criteria""" +enum TagSortCriteria { + MOST_POPULAR + ALPHABETICAL +} + input TimedFeeCollectModuleParams { """The collect module amount info""" amount: ModuleFeeAmountParams! @@ -2378,6 +2822,7 @@ input TimelineRequest { The timeline types you wish to include, if nothing passed in will bring back all """ timelineTypes: [TimelineType!] = [COLLECT_COMMENT, COLLECT_POST, COMMENT, POST, MIRROR] + metadata: PublicationMetadataFilters } """Timeline types""" @@ -2457,6 +2902,65 @@ input UnfollowRequest { """UnixTimestamp custom scalar type""" scalar UnixTimestamp +input UnknownCollectModuleParams { + contractAddress: ContractAddress! + + """The encoded data to submit with the module""" + data: BlockchainData! +} + +type UnknownCollectModuleSettings { + """The collect modules enum""" + type: CollectModules! + contractAddress: ContractAddress! + + """ + The data used to setup the module which you can decode with your known ABI + """ + collectModuleReturnData: CollectModuleData! +} + +input UnknownFollowModuleParams { + contractAddress: ContractAddress! + + """The encoded data to submit with the module""" + data: BlockchainData! +} + +input UnknownFollowModuleRedeemParams { + """The encoded data to submit with the module""" + data: BlockchainData! +} + +type UnknownFollowModuleSettings { + """The follow modules enum""" + type: FollowModules! + contractAddress: ContractAddress! + + """ + The data used to setup the module which you can decode with your known ABI + """ + followModuleReturnData: FollowModuleData! +} + +input UnknownReferenceModuleParams { + contractAddress: ContractAddress! + + """The encoded data to submit with the module""" + data: BlockchainData! +} + +type UnknownReferenceModuleSettings { + """The reference modules enum""" + type: ReferenceModules! + contractAddress: ContractAddress! + + """ + The data used to setup the module which you can decode with your known ABI + """ + referenceModuleReturnData: ReferenceModuleData! +} + input UpdateProfileImageRequest { profileId: ProfileId! @@ -2475,6 +2979,11 @@ type UserSigNonces { peripheryOnChainSigNonce: Nonce! } +input ValidatePublicationMetadataRequest { + metadatav1: PublicationMetadataV1Input + metadatav2: PublicationMetadataV2Input +} + """The access request""" input VerifyRequest { """The access token""" @@ -2502,3 +3011,29 @@ input WhoCollectedPublicationRequest { publicationId: InternalPublicationId! } +input WhoReactedPublicationRequest { + limit: LimitScalar + cursor: Cursor + + """Internal publication id""" + publicationId: InternalPublicationId! +} + +"""The Profile""" +type WhoReactedResult { + """The reaction id""" + reactionId: ReactionId! + + """The reaction""" + reaction: ReactionTypes! + + """The reaction""" + reactionAt: DateTime! + profile: Profile! +} + +type WorldcoinIdentity { + """If the profile has verified as a user""" + isHuman: Boolean! +} + diff --git a/libs/dao-data/src/subgraph/schema.generated.ts b/libs/dao-data/src/subgraph/schema.generated.ts index 10ce34be3..0de616458 100644 --- a/libs/dao-data/src/subgraph/schema.generated.ts +++ b/libs/dao-data/src/subgraph/schema.generated.ts @@ -2297,6 +2297,8 @@ export interface _Block_ { hash?: Maybe; /** The block number */ number: Scalars['Int']; + /** Timestamp of the block if available, format depends on the chain */ + timestamp?: Maybe; } /** The type for the top-level _meta field */ diff --git a/libs/dao-data/src/subgraph/schema.graphql b/libs/dao-data/src/subgraph/schema.graphql index 6f3a32309..d88a4e31e 100644 --- a/libs/dao-data/src/subgraph/schema.graphql +++ b/libs/dao-data/src/subgraph/schema.graphql @@ -18,6 +18,9 @@ type _Block_ { """The block number""" number: Int! + + """Timestamp of the block if available, format depends on the chain""" + timestamp: String } """The type for the top-level _meta field""" diff --git a/libs/dao-data/src/utils/transformers.ts b/libs/dao-data/src/utils/transformers.ts index 54b516c29..79d85d9ce 100644 --- a/libs/dao-data/src/utils/transformers.ts +++ b/libs/dao-data/src/utils/transformers.ts @@ -101,7 +101,10 @@ export const addDaoProfileFields = ( try { const obj = JSON.parse(dao.profile[0].content); - const links = obj.links && JSON.parse(obj.links); + const links = + obj.links && typeof obj.links === 'string' + ? JSON.parse(obj.links) + : obj.links; return { description: obj.description, longDescription: obj.longDescription, diff --git a/libs/tx-builder-feature/src/utils/txBuilderUtils.ts b/libs/tx-builder-feature/src/utils/txBuilderUtils.ts index 6e0fa2013..0efe68f51 100644 --- a/libs/tx-builder-feature/src/utils/txBuilderUtils.ts +++ b/libs/tx-builder-feature/src/utils/txBuilderUtils.ts @@ -141,6 +141,15 @@ export async function prepareTX(args: { console.log('**PROCESSED ARGS**', processedArgs); + // TODO for gasLimit and value + // const processOverrides = await + // looks in the lego and gets value and/or gasLimit + // returns {} or { + // value: '1000000000', + // gasLimit: '1000000', + // } + // add new overrides to tx lego and it can use the process args stuff and all current arg types + const contract = new ethers.Contract( address, abi, @@ -148,6 +157,11 @@ export async function prepareTX(args: { ); lifeCycleFns?.onRequestSign?.(); + // const ethersTx = await contract.functions[method](...processedArgs, { + // value: '1000000000', + // gasLimit: '1000000', + // }); + const ethersTx = await contract.functions[method](...processedArgs); executeTx({ ...args, ethersTx }); } catch (error) {