@iexec/dataprotector
Version:
This product enables users to confidentially store data–such as mail address, documents, personal information ...
34 lines • 869 B
JavaScript
import { gql } from 'graphql-request';
export async function getCollectionOwnersQuery({ graphQLClient, userAddress, limit, }) {
const accounts = gql `
query {
accounts(
where: { collections_: { id_not: null } },
first: ${limit}
) {
id
collections(
orderBy: creationTimestamp,
orderDirection: desc
) {
id
creationTimestamp
subscriptionParams {
price
duration
}
subscriptions(where: {
subscriber_: { id: "${userAddress}" },
endDate_gte: "${Math.floor(new Date().getTime() / 1000)}"
}) {
subscriber {
id
}
}
}
}
}
`;
return graphQLClient.request(accounts);
}
//# sourceMappingURL=getCollectionOwnersQuery.js.map