Skip to content

Commit

Permalink
[factory]: Add new recurring-users group (#2224)
Browse files Browse the repository at this point in the history
Co-authored-by: bigq <[email protected]>
  • Loading branch information
sismobot and yum0e authored Oct 18, 2023
1 parent dd6f56d commit ae5edf2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions group-generators/generators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ import raul from "./raul";
import raverz from "./raverz";
import raviZkBadgeOnSismo from "./ravi-zk-badge-on-sismo";
import rayS from "./ray-s";
import recurringUsers from "./recurring-users";
import regenesisNftHolders from "./regenesis-nft-holders";
import regenpunks from "./regenpunks";
import rektFamillyDegen from "./rekt-familly-degen";
Expand Down Expand Up @@ -1490,6 +1491,7 @@ export const groupGenerators: GroupGeneratorsLibrary = {
"raverz": raverz,
"ravi-zk-badge-on-sismo": raviZkBadgeOnSismo,
"ray-s": rayS,
"recurring-users": recurringUsers,
"regenesis-nft-holders": regenesisNftHolders,
"regenpunks": regenpunks,
"rekt-familly-degen": rektFamillyDegen,
Expand Down
38 changes: 38 additions & 0 deletions group-generators/generators/recurring-users/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

import { dataProviders } from "@group-generators/helpers/data-providers";
import { Tags, ValueType, GroupWithData } from "topics/group";
import {
GenerationContext,
GenerationFrequency,
GroupGenerator,
} from "topics/group-generator";

// Generated from factory.sismo.io

const generator: GroupGenerator = {

generationFrequency: GenerationFrequency.Weekly,

generate: async (context: GenerationContext): Promise<GroupWithData[]> => {

const restProvider = new dataProviders.RestProvider();

const restProviderData0 = await restProvider.getAccountsFromAPI({
url: "https://front-git-feature-sismo-way2pay.vercel.app/api/sismo/recurring"
});

return [
{
name: "recurring-users",
timestamp: context.timestamp,
description: "People who have used the platform before",
specs: "Any Transaction with them as the buyer and transaction as executed",
data: restProviderData0,
valueType: ValueType.Score,
tags: [Tags.Factory],
},
];
},
};

export default generator;

0 comments on commit ae5edf2

Please sign in to comment.